Merge Request #13

Merged
jerasure/gf-complete!13
Created by Loic Dachary

add -Wsign-compare and address the warnings

Assignee: None
Milestone: None
Checking for CI status for a32aebd6

Merged by KMG

Commits (5)
  • * (1 << w) are changed into ((uint32_t)1 << w)
    * int are changed into uint32_t
    
    gf.c: gf_composite_get_default_poly:
    
       a larger unsigned were assigned to unsigned integers in which case
       the type of the assigned variable is changed to be the same as the
       value assigned to it.
    
    gf_w16.c: GF_MULTBY_TWO
    
       setting the parameter to a variable instead of passing the expression
       resolves the warning for some reason.
    
    Signed-off-by: Loic Dachary <loic@dachary.org>
    (cherry picked from commit d1b6bbf706b2628ab21cee2eb51a7cfe8cf04bcd)
    Loic Dachary
     
  • Fix for Coverity issue (from Ceph):
    
    CID 1193089 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
     overflow_before_widen: Potentially overflowing expression 1 << g_r with type
     int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in
     a context that expects an expression of type uint64_t (64 bits, unsigned).
    
    CID 1193090 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
     overflow_before_widen: Potentially overflowing expression 1 << g_s with type
     int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in
     a context that expects an expression of type uint64_t (64 bits, unsigned).
    
    Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
    (cherry picked from commit 2f6db512fb83f2d8e84e8097ebd2595c6ec8f8eb)
    Danny Al-Gaaf
     
  • Fix for Coverity issue (from Ceph):
    
    CID 1193088 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
     overflow_before_widen: Potentially overflowing expression 1 << g_s with type
     int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in
     a context that expects an expression of type uint64_t (64 bits, unsigned).
    
    Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
    (cherry picked from commit 1aef8694bc62a053e35cc1c74c67f1d15d8d1b6a)
    Danny Al-Gaaf
     
  • Fix for Coverity issue (from Ceph):
    
    CID 1193087 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
     overflow_before_widen: Potentially overflowing expression 1 << g_r with type
      int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used
      in a context that expects an expression of type uint64_t (64 bits, unsigned).
    
    Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
    (cherry picked from commit e127bb1fb9b1025094a0e0ce50d2e44c38c4e97f)
    Danny Al-Gaaf
     
  • Fix for Coverity issue (from Ceph):
    
    CID 1193086 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
     overflow_before_widen: Potentially overflowing expression 1 << g_r with type
      int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in
      a context that expects an expression of type uint64_t (64 bits, unsigned).
    
    Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
    (cherry picked from commit 98e5e37159f4c7634305aa65c9bc98a36488a4a9)
    Danny Al-Gaaf
     
2 participants