]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.026 v7.4.026
authorBram Moolenaar <Bram@vim.org>
Sun, 8 Sep 2013 14:07:07 +0000 (16:07 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 8 Sep 2013 14:07:07 +0000 (16:07 +0200)
Problem:    Clang warning for int shift overflow.
Solution:   Use unsigned and cast back to int. (Dominique Pelle)

src/misc2.c
src/version.c

index 504cf0aed33d8078b20a18fa72ac2fd1d6b458ca..b8655e84aaaf1abd7102445baea0a25c1c2e1abc 100644 (file)
@@ -6496,13 +6496,15 @@ get3c(fd)
 get4c(fd)
     FILE       *fd;
 {
-    int                n;
-
-    n = getc(fd);
-    n = (n << 8) + getc(fd);
-    n = (n << 8) + getc(fd);
-    n = (n << 8) + getc(fd);
-    return n;
+    /* Use unsigned rather than int otherwise result is undefined
+     * when left-shift sets the MSB. */
+    unsigned   n;
+
+    n = (unsigned)getc(fd);
+    n = (n << 8) + (unsigned)getc(fd);
+    n = (n << 8) + (unsigned)getc(fd);
+    n = (n << 8) + (unsigned)getc(fd);
+    return (int)n;
 }
 
 /*
index ff4e3bb6fc5b67a42526c4bb0887f02b30306d9a..f875d013d78902c3730990da8e44dab8bf29e599 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    26,
 /**/
     25,
 /**/