jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.026

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