Two macros 'sbitset' and 'isdigok' in bdflib.c has recently become
synonymous. Quoting from the code:
Line 428:
#define sbitset( m, cc ) \
          ( m[(FT_Byte)(cc) >> 3]  & ( 1 << ( (cc) & 7 ) ) )
Line 845:
#define isdigok( m, d )  (m[(unsigned char)(d) >> 3] & ( 1 << ( (d) & 7 ) ) )

The attached patch removes 'isdigok' altogether.
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index b12b034..ed08a6e 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -842,9 +842,6 @@
   };
 
 
-#define isdigok( m, d )  (m[(unsigned char)(d) >> 3] & ( 1 << ( (d) & 7 ) ) )
-
-
   /* Routine to convert an ASCII string into an unsigned long integer. */
   static unsigned long
   _bdf_atoul( char*   s,
@@ -882,7 +879,7 @@
       s   += 2;
     }
 
-    for ( v = 0; isdigok( dmap, *s ); s++ )
+    for ( v = 0; sbitset( dmap, *s ); s++ )
       v = v * base + a2i[(int)*s];
 
     if ( end != 0 )
@@ -937,7 +934,7 @@
       s   += 2;
     }
 
-    for ( v = 0; isdigok( dmap, *s ); s++ )
+    for ( v = 0; sbitset( dmap, *s ); s++ )
       v = v * base + a2i[(int)*s];
 
     if ( end != 0 )
@@ -992,7 +989,7 @@
       s   += 2;
     }
 
-    for ( v = 0; isdigok( dmap, *s ); s++ )
+    for ( v = 0; sbitset( dmap, *s ); s++ )
       v = (short)( v * base + a2i[(int)*s] );
 
     if ( end != 0 )
@@ -1747,7 +1744,7 @@
       for ( i = 0; i < nibbles; i++ )
       {
         c = line[i];
-        if ( !isdigok( hdigits, c ) )
+        if ( !sbitset( hdigits, c ) )
           break;
         *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] );
         if ( i + 1 < nibbles && ( i & 1 ) )
@@ -1771,7 +1768,7 @@
 
       /* If any line has extra columns, indicate they have been removed. */
       if ( i == nibbles                           &&
-           isdigok( hdigits, line[nibbles] )      &&
+           sbitset( hdigits, line[nibbles] )      &&
            !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )
       {
         FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG14, glyph->encoding ));
_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to