for ( i = 0 ; i < len ; i++ ) {
int n = i % 16;
- int off;
+ unsigned off;
if( !n ) {
if( i ) (*ber_pvt_log_print)( line );
off = i % 0x0ffffU;
- line[ 2 ] = hexdig[ ( off & 0xf000U ) >> 12 ];
- line[ 3 ] = hexdig[ ( off & 0x0f00U ) >> 8 ];
- line[ 4 ] = hexdig[ ( off & 0x00f0U ) >> 4 ];
- line[ 5 ] = hexdig[ ( off & 0x000fU ) ];
+ line[ 2 ] = hexdig[ 0x0f & (off >> 12) ];
+ line[ 3 ] = hexdig[ 0x0f & (off >> 8) ];
+ line[ 4 ] = hexdig[ 0x0f & (off >> 4) ];
+ line[ 5 ] = hexdig[ 0x0f & off ];
line[ 6 ] = ':';
}
off = BP_OFFSET + n*3 + ((n >= 8)?1:0);
- line[ off ] = hexdig[ ( data[i] & 0xf0U ) >> 4 ];
- line[ off+1 ] = hexdig[ data[i] & 0x0fU ];
+ line[ off ] = hexdig[ 0x0f & ( data[i] >> 4 ) ];
+ line[ off+1 ] = hexdig[ 0x0f & data[i] ];
off = BP_GRAPH + n;