]> git.sur5r.net Git - openldap/commitdiff
Code cleanup
authorKurt Zeilenga <kurt@openldap.org>
Fri, 22 Sep 2000 22:43:30 +0000 (22:43 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 22 Sep 2000 22:43:30 +0000 (22:43 +0000)
libraries/liblber/bprint.c

index a7563aab770e5932d58fc70187cd71d00ea53401..f8794e8558816ce70b81db860c7eb5fac770c326 100644 (file)
@@ -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;