jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.026

1fa1ff
To: vim_dev@googlegroups.com
1fa1ff
Subject: Patch 7.4.026
1fa1ff
Fcc: outbox
1fa1ff
From: Bram Moolenaar <Bram@moolenaar.net>
1fa1ff
Mime-Version: 1.0
1fa1ff
Content-Type: text/plain; charset=UTF-8
1fa1ff
Content-Transfer-Encoding: 8bit
1fa1ff
------------
1fa1ff
1fa1ff
Patch 7.4.026
1fa1ff
Problem:    Clang warning for int shift overflow.
1fa1ff
Solution:   Use unsigned and cast back to int. (Dominique Pelle)
1fa1ff
Files:	    src/misc2.c
1fa1ff
1fa1ff
1fa1ff
*** ../vim-7.4.025/src/misc2.c	2013-07-07 16:03:35.000000000 +0200
1fa1ff
--- src/misc2.c	2013-09-08 16:04:54.000000000 +0200
1fa1ff
***************
1fa1ff
*** 6496,6508 ****
1fa1ff
  get4c(fd)
1fa1ff
      FILE	*fd;
1fa1ff
  {
1fa1ff
!     int		n;
1fa1ff
  
1fa1ff
!     n = getc(fd);
1fa1ff
!     n = (n << 8) + getc(fd);
1fa1ff
!     n = (n << 8) + getc(fd);
1fa1ff
!     n = (n << 8) + getc(fd);
1fa1ff
!     return n;
1fa1ff
  }
1fa1ff
  
1fa1ff
  /*
1fa1ff
--- 6496,6510 ----
1fa1ff
  get4c(fd)
1fa1ff
      FILE	*fd;
1fa1ff
  {
1fa1ff
!     /* Use unsigned rather than int otherwise result is undefined
1fa1ff
!      * when left-shift sets the MSB. */
1fa1ff
!     unsigned	n;
1fa1ff
  
1fa1ff
!     n = (unsigned)getc(fd);
1fa1ff
!     n = (n << 8) + (unsigned)getc(fd);
1fa1ff
!     n = (n << 8) + (unsigned)getc(fd);
1fa1ff
!     n = (n << 8) + (unsigned)getc(fd);
1fa1ff
!     return (int)n;
1fa1ff
  }
1fa1ff
  
1fa1ff
  /*
1fa1ff
*** ../vim-7.4.025/src/version.c	2013-09-08 16:03:40.000000000 +0200
1fa1ff
--- src/version.c	2013-09-08 16:05:40.000000000 +0200
1fa1ff
***************
1fa1ff
*** 740,741 ****
1fa1ff
--- 740,743 ----
1fa1ff
  {   /* Add new patch number below this line */
1fa1ff
+ /**/
1fa1ff
+     26,
1fa1ff
  /**/
1fa1ff
1fa1ff
-- 
1fa1ff
A computer program does what you tell it to do, not what you want it to do.
1fa1ff
1fa1ff
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
1fa1ff
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1fa1ff
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
1fa1ff
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///