Changeset 7404


Ignore:
Timestamp:
05/02/18 17:07:55 (3 weeks ago)
Author:
baker
Message:

fix warning: shifting a negative signed value is undefined

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libsrc/qlib2/unpack.c

    r6851 r7404  
    487487} 
    488488 
    489 /* Macro to return i-th bit of byte c (bit 0 is least signficant bit).  */ 
    490 #define getbit(c,i) (c >> i & ~(~0 << 1)) 
    491  
    492489/************************************************************************/ 
    493490/*  unpack_int_24:                                                      */ 
     
    538535        if (swapflag) swab3 ((unsigned char *)&tmp.byte[sbc]); 
    539536        /* Propogate sign bit.                                          */ 
    540         tmp.byte[sb32] = (getbit(tmp.byte[sb24],7)) ? 0xff : 0x00; 
     537        tmp.byte[sb32] = (tmp.byte[sb24] < 0) ? 0xff : 0x00; 
    541538        databuff[nd] = tmp.fw; 
    542539        ibuf += 3; 
Note: See TracChangeset for help on using the changeset viewer.