]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.740 v7.3.740
authorBram Moolenaar <Bram@vim.org>
Wed, 28 Nov 2012 17:31:54 +0000 (18:31 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 28 Nov 2012 17:31:54 +0000 (18:31 +0100)
Problem:    IOC tool complains about undefined behavior for int.
Solution:   Change to unsigned int. (Dominique Pelle)

src/hashtab.c
src/misc2.c
src/version.c

index 8b53aa4018c9af5afd79abbd9c7b30f7ac21f510..a47fa94b2da954820950c38281021a5d9355c946 100644 (file)
@@ -138,7 +138,7 @@ hash_lookup(ht, key, hash)
     hash_T     perturb;
     hashitem_T *freeitem;
     hashitem_T *hi;
-    int                idx;
+    unsigned   idx;
 
 #ifdef HT_DEBUG
     ++hash_count_lookup;
@@ -150,7 +150,7 @@ hash_lookup(ht, key, hash)
      * - skip over a removed item
      * - return if the item matches
      */
-    idx = (int)(hash & ht->ht_mask);
+    idx = (unsigned)(hash & ht->ht_mask);
     hi = &ht->ht_array[idx];
 
     if (hi->hi_key == NULL)
@@ -176,7 +176,7 @@ hash_lookup(ht, key, hash)
 #ifdef HT_DEBUG
        ++hash_count_perturb;       /* count a "miss" for hashtab lookup */
 #endif
-       idx = (int)((idx << 2) + idx + perturb + 1);
+       idx = (unsigned)((idx << 2U) + idx + perturb + 1U);
        hi = &ht->ht_array[idx & ht->ht_mask];
        if (hi->hi_key == NULL)
            return freeitem == NULL ? hi : freeitem;
@@ -342,7 +342,7 @@ hash_may_resize(ht, minitems)
     hashitem_T temparray[HT_INIT_SIZE];
     hashitem_T *oldarray, *newarray;
     hashitem_T *olditem, *newitem;
-    int                newi;
+    unsigned   newi;
     int                todo;
     long_u     oldsize, newsize;
     long_u     minsize;
@@ -448,13 +448,13 @@ hash_may_resize(ht, minitems)
             * the algorithm to find an item in hash_lookup().  But we only
             * need to search for a NULL key, thus it's simpler.
             */
-           newi = (int)(olditem->hi_hash & newmask);
+           newi = (unsigned)(olditem->hi_hash & newmask);
            newitem = &newarray[newi];
 
            if (newitem->hi_key != NULL)
                for (perturb = olditem->hi_hash; ; perturb >>= PERTURB_SHIFT)
                {
-                   newi = (int)((newi << 2) + newi + perturb + 1);
+                   newi = (unsigned)((newi << 2U) + newi + perturb + 1U);
                    newitem = &newarray[newi & newmask];
                    if (newitem->hi_key == NULL)
                        break;
index 084d451ac549c7435955aad36df294624c76b9f9..72a034362b27b28583fb8e5aa09a14b5b9793176 100644 (file)
@@ -3860,7 +3860,7 @@ static ulg keys[3]; /* keys defining the pseudo-random sequence */
     ush temp; \
  \
     temp = (ush)keys[2] | 2; \
-    t = (int)(((unsigned)(temp * (temp ^ 1)) >> 8) & 0xff); \
+    t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \
 }
 
 /*
@@ -4002,7 +4002,7 @@ crypt_decode(ptr, len)
            ush temp;
 
            temp = (ush)keys[2] | 2;
-           temp = (int)(((unsigned)(temp * (temp ^ 1)) >> 8) & 0xff);
+           temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff);
            UPDATE_KEYS_ZIP(*p ^= temp);
        }
     else
index 47a69c28ed6fe5b3db7c3f3dd8bd4ad17f7af8a4..e8996e3583c9b4ccf0a4fcf6c7b4c099aa52c156 100644 (file)
@@ -725,6 +725,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    740,
 /**/
     739,
 /**/