Refactoring to Sv*_set() macros - patch #6
[p5sagit/p5-mst-13.2.git] / hv.c
diff --git a/hv.c b/hv.c
index bb8cef6..8c6ec39 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -90,7 +90,7 @@ S_more_he(pTHX)
 STATIC HEK *
 S_save_hek_flags(pTHX_ const char *str, I32 len, U32 hash, int flags)
 {
-    int flags_masked = flags & HVhek_MASK;
+    const int flags_masked = flags & HVhek_MASK;
     char *k;
     register HEK *hek;
 
@@ -455,7 +455,7 @@ S_hv_fetch_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
                    if (isLOWER(key[i])) {
                        /* Would be nice if we had a routine to do the
                           copy and upercase in a single pass through.  */
-                       char *nkey = strupr(savepvn(key,klen));
+                       const char *nkey = strupr(savepvn(key,klen));
                        /* Note that this fetch is for nkey (the uppercased
                           key) whereas the store is for key (the original)  */
                        entry = hv_fetch_common(hv, Nullsv, nkey, klen,
@@ -1533,7 +1533,7 @@ Perl_hv_clear_placeholders(pTHX_ HV *hv)
 
                if (--items == 0) {
                    /* Finished.  */
-                   HvTOTALKEYS(hv) -= HvPLACEHOLDERS(hv);
+                   HvTOTALKEYS(hv) -= (IV)HvPLACEHOLDERS(hv);
                    if (HvKEYS(hv) == 0)
                        HvHASKFLAGS_off(hv);
                    HvPLACEHOLDERS(hv) = 0;
@@ -1999,7 +1999,7 @@ S_unshare_hek_or_pvn(pTHX_ HEK *hek, const char *str, I32 len, U32 hash)
             break;
         }
     } else {
-        int flags_masked = k_flags & HVhek_MASK;
+        const int flags_masked = k_flags & HVhek_MASK;
         for (entry = *oentry; entry; i=0, oentry = &HeNEXT(entry), entry = *oentry) {
             if (HeHASH(entry) != hash)         /* strings can't be equal */
                 continue;
@@ -2075,7 +2075,7 @@ S_share_hek_flags(pTHX_ const char *str, I32 len, register U32 hash, int flags)
     register HE **oentry;
     register I32 i = 1;
     I32 found = 0;
-    int flags_masked = flags & HVhek_MASK;
+    const int flags_masked = flags & HVhek_MASK;
 
     /* what follows is the moral equivalent of: