Wireshark-commits: [Wireshark-commits] master d2b02ea: Don't shift signed values left.

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 30 Apr 2015 20:40:22 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=d2b02eaf591145f40eaa65d6b50908e47d7c4484
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

d2b02ea by Guy Harris (guy@xxxxxxxxxxxx):

    Don't shift signed values left.
    
    That's not valid in C99, at least, if the value is negative or if the
    shift count is the number of bits in the value - 1, and we might get
    compile-time or run-time complaints about that.
    
    Also, make bit masks unsigned; to quote a run-time error reported in
    
    	https://www.wireshark.org/lists/wireshark-dev/201504/msg00084.html
    
    "left shift of 1 by 31 places cannot be represented in type 'int'", so
    use type "unsigned int" instead, by shifting 1U rather than 1 left.
    
    Change-Id: I62220808058cb93f83329c1916b888a2067d524c
    Reviewed-on: https://code.wireshark.org/review/8254
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  fac1107   CMake: Always set PROCESSOR_ARCHITECTURE on Windows.
    adds  d2b02ea   Don't shift signed values left.


Summary of changes:
 wsutil/sign_ext.h |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)