From: Kurt Zeilenga Date: Fri, 22 Sep 2000 22:43:30 +0000 (+0000) Subject: Code cleanup X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1914 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6ec475cd61a2c13e4601d637f91e937efbda69e2;p=openldap Code cleanup --- diff --git a/libraries/liblber/bprint.c b/libraries/liblber/bprint.c index a7563aab77..f8794e8558 100644 --- a/libraries/liblber/bprint.c +++ b/libraries/liblber/bprint.c @@ -153,7 +153,7 @@ ber_bprint( for ( i = 0 ; i < len ; i++ ) { int n = i % 16; - int off; + unsigned off; if( !n ) { if( i ) (*ber_pvt_log_print)( line ); @@ -163,16 +163,16 @@ ber_bprint( 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;