shithub: freetype+ttf2subf

Download patch

ref: 7c25946f085d5aaec73aaf5dbeb1b9be6d8ecbff
parent: d6e8b3315c3e4c754b07279602ab1ea44ae54388
author: Werner Lemberg <[email protected]>
date: Wed Sep 28 03:34:45 EDT 2005

Formatting.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,31 +5,35 @@
 
 2005-09-26  David Turner  <[email protected]>
 
-        * src/autofit/aflatin.c (af_latin_compute_stem_width): fixed bad
-        computation of the "vertical" flag, causing ugly things in LCD mode
-        and others.
+	* src/autofit/aflatin.c (af_latin_compute_stem_width): Fix bad
+	computation of the `vertical' flag, causing ugly things in LCD mode
+	and others.
 
 2005-09-23  David Turner  <[email protected]>
 
-        * src/autofit/aflatin.c (af_latin_hints_init): fixed a bug that
-        prevented internal hint mode bitflags from being computed correctly
+	* src/autofit/aflatin.c (af_latin_hints_init): Fix a bug that
+	prevented internal hint mode bitflags from being computed correctly.
 
-        * src/base/Jamfile: adding src/base/ftgxval.c
+	* src/base/Jamfile: Adding src/base/ftgxval.c.
 
-        * src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, src/gxvalid/gxvfeat.c,
-        src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c,
-        src/gxvalid/gxvmort.c, src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
-        src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c, src/gxvalid/gxvmort5.c,
-        src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
-        src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c, src/gxvalid/gxvopbd.c,
-        src/gxvalid/gxvprop.c, src/sfnt/sfdriver.c, src/truetype/ttgload.c:
-          removing _many_ compiler warnings when compiling with Visual C++
-          at maximum level (/W4)
+	* src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
+	src/gxvalid/gxvfeat.c, src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c,
+	src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
+	src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
+	src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c,
+	src/gxvalid/gxvmort5.c, src/gxvalid/gxvmorx.c,
+	src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
+	src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c,
+	src/gxvalid/gxvopbd.c, src/gxvalid/gxvprop.c,
+	src/truetype/ttgload.c: Remove _many_ compiler warnings when
+	compiling with Visual C++ at maximum level (/W4).
 
-        * src/autofit/afangles.c (af_angle_atan): replaced CORDIC-based
-        implementation with one using lookup tables. This simple thing
-        speeds glyph loading by 18% according to ftbench !
+	* src/autofit/afangles.c (af_angle_atan): Replaced CORDIC-based
+	implementation with one using lookup tables.  This simple thing
+	speeds up glyph loading by 18%, according to ftbench!
 
+	* src/sfnt/sfdriver.c (sfnt_get_interface): Don't check for
+	`get_sfnt' and `load_sfnt' module interfaces.
 
 2005-09-22  Werner Lemberg  <[email protected]>
 
--- a/src/autofit/afangles.c
+++ b/src/autofit/afangles.c
@@ -25,7 +25,7 @@
   /* the following table has been automatically generated with */
   /* the `mather.py' Python script                             */
 
-#define  AF_ATAN_BITS  8
+#define AF_ATAN_BITS  8
 
   static const FT_Byte  af_arctan[1L << AF_ATAN_BITS] =
   {
@@ -125,6 +125,7 @@
 
 
 #else /* 0 */
+
 /*
  * a python script used to generate the following table
  *
@@ -322,6 +323,7 @@
   }
 
 #endif /* 0 */
+
 
   FT_LOCAL_DEF( AF_Angle )
   af_angle_diff( AF_Angle  angle1,
--- a/src/gxvalid/gxvbsln.c
+++ b/src/gxvalid/gxvbsln.c
@@ -132,7 +132,8 @@
     GXV_LookupValueDesc  value;
 
     /* XXX: check range ? */
-    offset = (FT_UShort)(base_value.u + ( relative_gindex * sizeof ( FT_UShort ) ));
+    offset = (FT_UShort)( base_value.u +
+                          ( relative_gindex * sizeof ( FT_UShort ) ) );
 
     p     = valid->lookuptbl_head + offset;
     limit = lookuptbl_limit;
--- a/src/gxvalid/gxvcommn.c
+++ b/src/gxvalid/gxvcommn.c
@@ -94,7 +94,7 @@
       if ( j == nmemb )
         FT_INVALID_OFFSET;
 
-      *(length[i]) = (FT_UShort)(buff[j + 1] - buff[j]);
+      *(length[i]) = (FT_UShort)( buff[j + 1] - buff[j] );
 
       if ( 0 != offset[i] && 0 == *(length[i]) )
         FT_INVALID_OFFSET;
@@ -226,8 +226,8 @@
       GXV_LIMIT_CHECK( 2 );
       val = FT_NEXT_USHORT( p );
 
-      *min = (FT_Byte) FT_MIN( *min, val );
-      *max = (FT_Byte) FT_MAX( *max, val );
+      *min = (FT_Byte)FT_MIN( *min, val );
+      *max = (FT_Byte)FT_MAX( *max, val );
     }
 
     valid->subtable_length = p - table;
@@ -629,7 +629,7 @@
 
       for ( gid = firstGlyph; gid <= lastGlyph; gid++ )
       {
-        value = valid->lookupfmt4_trans( (FT_UShort)(gid - firstGlyph),
+        value = valid->lookupfmt4_trans( (FT_UShort)( gid - firstGlyph ),
                                          base_value,
                                          limit,
                                          valid );
@@ -742,7 +742,7 @@
     glyphCount = FT_NEXT_USHORT( p );
 
     gxv_glyphid_validate( firstGlyph, valid );
-    gxv_glyphid_validate( (FT_UShort)(firstGlyph + glyphCount), valid );
+    gxv_glyphid_validate( (FT_UShort)( firstGlyph + glyphCount ), valid );
 
     /* valueArray */
     for ( i = 0; i < glyphCount; i++ )
@@ -749,7 +749,7 @@
     {
       GXV_LIMIT_CHECK( 2 );
       value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign );
-      valid->lookupval_func( (FT_UShort)(firstGlyph + i), value, valid );
+      valid->lookupval_func( (FT_UShort)( firstGlyph + i ), value, valid );
     }
 
     valid->subtable_length = p - table;
@@ -915,7 +915,7 @@
     }
 
     GXV_TRACE(( "  nameIndex = %d (UNTITLED)\n", name_index ));
-      FT_INVALID_DATA;
+    FT_INVALID_DATA;
     goto Exit;  /* make compiler happy */
 
   Out:
@@ -972,7 +972,7 @@
     if ( !nGlyphs )
       goto Out;
 
-    gxv_glyphid_validate( (FT_UShort)(firstGlyph + nGlyphs), valid );
+    gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs ), valid );
 
     {
       FT_Byte    nGlyphInClass[256];
@@ -1005,12 +1005,12 @@
           break;
         }
       }
-      *length_p = (FT_UShort)(p - table);
+      *length_p = (FT_UShort)( p - table );
 
       /* scan max ClassID in use */
       for ( i = 0; i < stateSize; i++ )
         if ( ( 3 < i ) && ( nGlyphInClass[i] > 0 ) )
-          *maxClassID_p = (FT_Byte)i;  /* XXX: Check Range ? */
+          *maxClassID_p = (FT_Byte)i;  /* XXX: Check Range? */
     }
 
   Out:
@@ -1036,14 +1036,14 @@
     FT_Byte   clazz;
     FT_Byte   entry;
 
+    FT_UNUSED( stateSize ); /* for the non-debugging case */
 
+
     GXV_NAME_ENTER( "StateArray" );
 
     GXV_TRACE(( "parse %d bytes by stateSize=%d maxClassID=%d\n",
                 (int)(*length_p), stateSize, (int)(maxClassID) ));
 
-    FT_UNUSED( stateSize );
-
     /*
      * 2 states are predefined and must be described in StateArray:
      * state 0 (start of text), 1 (start of line)
@@ -1060,13 +1060,13 @@
       for ( clazz = 0; clazz <= maxClassID; clazz++ )
       {
         entry = FT_NEXT_BYTE( p );
-        *maxEntry_p = (FT_Byte) FT_MAX( *maxEntry_p, entry );
+        *maxEntry_p = (FT_Byte)FT_MAX( *maxEntry_p, entry );
       }
     }
     GXV_TRACE(( "parsed: maxState=%d, maxEntry=%d\n",
                 *maxState_p, *maxEntry_p ));
 
-    *length_p = (FT_UShort)(p - table);
+    *length_p = (FT_UShort)( p - table );
 
     GXV_EXIT;
   }
@@ -1104,7 +1104,7 @@
         FT_INVALID_TOO_SHORT;
 
       /* ftxvalidator and FontValidator both warn and continue */
-      maxEntry = (FT_Byte)(*length_p / entrySize - 1);
+      maxEntry = (FT_Byte)( *length_p / entrySize - 1 );
       GXV_TRACE(( "too large maxEntry, shrinking to %d fit EntryTable length\n",
                   maxEntry ));
     }
@@ -1139,12 +1139,12 @@
         continue;
       }
 
-      state =  (FT_Byte)(( newState - stateArray ) / ( 1 + maxClassID ));
+      state = (FT_Byte)( ( newState - stateArray ) / ( 1 + maxClassID ) );
 
       switch ( GXV_GLYPHOFFSET_FMT( statetable ) )
       {
       case GXV_GLYPHOFFSET_NONE:
-        glyphOffset.uc = 0;  /* make compiler happy !! */
+        glyphOffset.uc = 0;  /* make compiler happy */
         break;
 
       case GXV_GLYPHOFFSET_UCHAR:
@@ -1174,7 +1174,6 @@
       default:
         if ( valid->root->level >= FT_VALIDATE_PARANOID )
           FT_INVALID_FORMAT;
-
         goto Exit;
       }
 
@@ -1186,8 +1185,9 @@
                                                statetable_limit,
                                                valid );
     }
+
   Exit:
-    *length_p = (FT_UShort)(p - table);
+    *length_p = (FT_UShort)( p - table );
 
     GXV_EXIT;
   }
@@ -1269,7 +1269,7 @@
     else
       setup_func = gxv_StateTable_subtable_setup;
 
-    setup_func( (FT_UShort)(limit - table),
+    setup_func( (FT_UShort)( limit - table ),
                 classTable,
                 stateArray,
                 entryTable,
@@ -1287,7 +1287,7 @@
                                &maxClassID,
                                valid );
     else
-      maxClassID = (FT_Byte)(stateSize - 1);
+      maxClassID = (FT_Byte)( stateSize - 1 );
 
     if ( stateArray != 0 )
       gxv_StateArray_validate( table + stateArray,
@@ -1400,8 +1400,9 @@
     FT_UShort            offset;
     GXV_LookupValueDesc  value;
 
-    /* XXX: check range ? */
-    offset = (FT_UShort)(base_value.u + relative_gindex * sizeof ( FT_UShort ));
+    /* XXX: check range? */
+    offset = (FT_UShort)( base_value.u +
+                          relative_gindex * sizeof ( FT_UShort ) );
 
     p     = valid->lookuptbl_head + offset;
     limit = lookuptbl_limit;
@@ -1427,14 +1428,14 @@
     FT_UShort  clazz;
     FT_UShort  entry;
 
+    FT_UNUSED( stateSize ); /* for the non-debugging case */
 
+
     GXV_NAME_ENTER( "XStateArray" );
 
     GXV_TRACE(( "parse % 3d bytes by stateSize=% 3d maxClassID=% 3d\n",
                 (int)(*length_p), stateSize, (int)(maxClassID) ));
 
-    FT_UNUSED( stateSize );
-
     /*
      * 2 states are predefined and must be described:
      * state 0 (start of text), 1 (start of line)
@@ -1451,7 +1452,7 @@
       for ( clazz = 0; clazz <= maxClassID; clazz++ )
       {
         entry = FT_NEXT_USHORT( p );
-        *maxEntry_p = (FT_UShort) FT_MAX( *maxEntry_p, entry );
+        *maxEntry_p = (FT_UShort)FT_MAX( *maxEntry_p, entry );
       }
     }
     GXV_TRACE(( "parsed: maxState=%d, maxEntry=%d\n",
@@ -1505,7 +1506,7 @@
           FT_INVALID_OFFSET;
       }
 
-      state = (FT_UShort)(newState_idx / ( 1 + maxClassID ));
+      state = (FT_UShort)( newState_idx / ( 1 + maxClassID ) );
       if ( 0 != ( newState_idx % ( 1 + maxClassID ) ) )
       {
         FT_TRACE4(( "-> new state = %d (supposed)\n"
@@ -1639,9 +1640,9 @@
     }
     else
     {
-      /* XXX: check range ? */
+      /* XXX: check range? */
       valid->xstatetable.maxClassID =
-          (FT_UShort)(valid->xstatetable.nClasses - 1);
+        (FT_UShort)( valid->xstatetable.nClasses - 1 );
     }
 
     if ( stateArray != 0 )
--- a/src/gxvalid/gxvfeat.c
+++ b/src/gxvalid/gxvfeat.c
@@ -225,7 +225,7 @@
          ( featureFlags & GXV_FEAT_MASK_UNUSED ) == 0 )
       FT_INVALID_DATA;
 
-    exclusive = FT_BOOL(featureFlags & GXV_FEAT_MASK_EXCLUSIVE_SETTINGS);
+    exclusive = FT_BOOL( featureFlags & GXV_FEAT_MASK_EXCLUSIVE_SETTINGS );
     if ( exclusive )
     {
       FT_Byte  dynamic_default;
@@ -233,7 +233,7 @@
 
       if ( featureFlags & GXV_FEAT_MASK_DYNAMIC_DEFAULT )
         dynamic_default = (FT_Byte)( featureFlags &
-                                     GXV_FEAT_MASK_DEFAULT_SETTING);
+                                     GXV_FEAT_MASK_DEFAULT_SETTING );
       else
         dynamic_default = 0;
 
--- a/src/gxvalid/gxvjust.c
+++ b/src/gxvalid/gxvjust.c
@@ -401,10 +401,10 @@
     FT_UNUSED( valid );
 
 
-    setMark      = (FT_UShort)( (flags >> 15) & 1 );
-    dontAdvance  = (FT_UShort)( (flags >> 14) & 1);
-    markClass    = (FT_UShort)( (flags >> 7) & 0x7F );
-    currentClass = (FT_UShort)(  flags       & 0x7F );
+    setMark      = (FT_UShort)( ( flags >> 15 ) & 1    );
+    dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1    );
+    markClass    = (FT_UShort)( ( flags >> 7  ) & 0x7F );
+    currentClass = (FT_UShort)(   flags         & 0x7F );
 
     /* TODO: validate markClass & currentClass */
   }
--- a/src/gxvalid/gxvkern.c
+++ b/src/gxvalid/gxvkern.c
@@ -234,9 +234,9 @@
     FT_UNUSED( glyphOffset );
 
 
-    push        = (FT_UShort)( (flags >> 15) & 1 );
-    dontAdvance = (FT_UShort)( (flags >> 14) & 1 );
-    valueOffset = (FT_UShort)(  flags & 0x3FFF );
+    push        = (FT_UShort)( ( flags >> 15 ) & 1      );
+    dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1      );
+    valueOffset = (FT_UShort)(   flags         & 0x3FFF );
 
     {
       GXV_kern_fmt1_StateOptRecData  vt_rec =
@@ -341,7 +341,7 @@
                 tag, firstGlyph, nGlyphs ));
 
     gxv_glyphid_validate( firstGlyph, valid );
-    gxv_glyphid_validate( (FT_UShort)(firstGlyph + nGlyphs - 1), valid );
+    gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs - 1 ), valid );
 
     gxv_array_getlimits_ushort( p, p + ( 2 * nGlyphs ),
                                 &( GXV_KERN_FMT2_DATA( offset_min[spec] ) ),
@@ -512,16 +512,19 @@
     FT_Bool  kernCrossStream;
     FT_Bool  kernVariation;
 
+    FT_UNUSED( valid );
 
+
     /* reserved bits = 0 */
     if ( coverage & 0x1FFC )
       return 0;
 
-    kernVertical    = FT_BOOL(( coverage >> 15 ) & 1);
-    kernCrossStream = FT_BOOL(( coverage >> 14 ) & 1);
-    kernVariation   = FT_BOOL(( coverage >> 13 ) & 1);
-    *format         = (FT_UShort)( coverage & 0x0003 );
+    kernVertical    = FT_BOOL( ( coverage >> 15 ) & 1 );
+    kernCrossStream = FT_BOOL( ( coverage >> 14 ) & 1 );
+    kernVariation   = FT_BOOL( ( coverage >> 13 ) & 1 );
 
+    *format = (FT_UShort)( coverage & 0x0003 );
+
     GXV_TRACE(( "new Apple-dialect: "
                 "horizontal=%d, cross-stream=%d, variation=%d, format=%d\n",
                  !kernVertical, kernCrossStream, kernVariation, *format ));
@@ -528,8 +531,6 @@
 
     GXV_TRACE(( "kerning values in Apple format subtable are ignored\n" ));
 
-    FT_UNUSED( valid );
-
     return 1;
   }
 
@@ -552,10 +553,11 @@
     if ( coverage & 0x02FC )
       return 0;
 
-    horizontal   = FT_BOOL(( coverage >> 15 ) & 1);
-    cross_stream = FT_BOOL(( coverage >> 13 ) & 1);
-    *format      = (FT_UShort)( coverage & 0x0003 );
+    horizontal   = FT_BOOL( ( coverage >> 15 ) & 1 );
+    cross_stream = FT_BOOL( ( coverage >> 13 ) & 1 );
 
+    *format = (FT_UShort)( coverage & 0x0003 );
+
     GXV_TRACE(( "classic Apple-dialect: "
                 "horizontal=%d, cross-stream=%d, format=%d\n",
                  horizontal, cross_stream, *format ));
@@ -583,15 +585,17 @@
 
     FT_UNUSED( valid );
 
+
     /* reserved bits = 0 */
     if ( coverage & 0xFDF0 )
       return 0;
 
-    horizontal   = FT_BOOL( coverage & 1 );
-    minimum      = FT_BOOL(( coverage >> 1 ) & 1);
-    cross_stream = FT_BOOL(( coverage >> 2 ) & 1);
-    override     = FT_BOOL(( coverage >> 3 ) & 1);
-    *format      = (FT_UShort)(( coverage >> 8 ) & 0x0003);
+    horizontal   = FT_BOOL(   coverage        & 1 );
+    minimum      = FT_BOOL( ( coverage >> 1 ) & 1 );
+    cross_stream = FT_BOOL( ( coverage >> 2 ) & 1 );
+    override     = FT_BOOL( ( coverage >> 3 ) & 1 );
+
+    *format = (FT_UShort)( ( coverage >> 8 ) & 0x0003 );
 
     GXV_TRACE(( "classic Microsoft-dialect: "
                 "horizontal=%d, minimum=%d, cross-stream=%d, "
--- a/src/gxvalid/gxvlcar.c
+++ b/src/gxvalid/gxvlcar.c
@@ -157,8 +157,9 @@
 
     FT_UNUSED( lookuptbl_limit );
 
-    /* XXX: check range ? */
-    offset = (FT_UShort)(base_value.u + relative_gindex * sizeof ( FT_UShort ));
+    /* XXX: check range? */
+    offset = (FT_UShort)( base_value.u +
+                          relative_gindex * sizeof ( FT_UShort ) );
     p      = valid->root->base + offset;
     limit  = valid->root->limit;
 
--- a/src/gxvalid/gxvmort.c
+++ b/src/gxvalid/gxvmort.c
@@ -66,7 +66,7 @@
       /* nSettings in gxvfeat.c is halved for exclusive on/off settings */
       nSettings_max = gxv_feat_registry[f->featureType].nSettings;
       if ( gxv_feat_registry[f->featureType].exclusive )
-        nSettings_max = (FT_Byte)(2*nSettings_max);
+        nSettings_max = (FT_Byte)( 2 * nSettings_max );
 
       GXV_TRACE(( "featureType %d is registered", f->featureType ));
       GXV_TRACE(( "setting %d", f->featureSetting ));
--- a/src/gxvalid/gxvmort0.c
+++ b/src/gxvalid/gxvmort0.c
@@ -79,16 +79,17 @@
     FT_UNUSED( table );
     FT_UNUSED( limit );
 
+    FT_UNUSED( GXV_Mort_IndicScript_Msg[verb] ); /* for the non-debugging */
+    FT_UNUSED( glyphOffset );                    /* case                  */
 
-    markFirst   = (FT_UShort)( (flags >> 15) & 1 );
-    dontAdvance = (FT_UShort)( (flags >> 14) & 1 );
-    markLast    = (FT_UShort)( (flags >> 13) & 1 );
-    reserved    = (FT_UShort)(  flags & 0x1FF0 );
-    verb        = (FT_UShort)(  flags & 0x000F );
 
-    FT_UNUSED( GXV_Mort_IndicScript_Msg[verb] );
-    FT_UNUSED( glyphOffset );
+    markFirst   = (FT_UShort)( ( flags >> 15 ) & 1 );
+    dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
+    markLast    = (FT_UShort)( ( flags >> 13 ) & 1 );
 
+    reserved = (FT_UShort)( flags & 0x1FF0 );
+    verb     = (FT_UShort)( flags & 0x000F );
+
     GXV_TRACE(( "  IndicScript MorphRule for glyphOffset 0x%04x",
                 glyphOffset.u ));
     GXV_TRACE(( " markFirst=%01d", markFirst ));
@@ -96,8 +97,6 @@
     GXV_TRACE(( " markLast=%01d", markLast ));
     GXV_TRACE(( " %02d", verb ));
     GXV_TRACE(( " %s\n", GXV_Mort_IndicScript_Msg[verb] ));
-
-
 
     if ( 0 < reserved )
     {
--- a/src/gxvalid/gxvmort1.c
+++ b/src/gxvalid/gxvmort1.c
@@ -113,17 +113,20 @@
     FT_UNUSED( state );
 
 
-    substTable       = ((GXV_mort_subtable_type1_StateOptRec *)
-                        (valid->statetable.optdata))->substitutionTable;
-    substTable_limit = (FT_UShort)(substTable +
-                       ((GXV_mort_subtable_type1_StateOptRec *)
-                        (valid->statetable.optdata))->substitutionTable_length);
+    substTable =
+      ((GXV_mort_subtable_type1_StateOptRec *)
+       (valid->statetable.optdata))->substitutionTable;
+    substTable_limit =
+      (FT_UShort)( substTable +
+                   ((GXV_mort_subtable_type1_StateOptRec *)
+                    (valid->statetable.optdata))->substitutionTable_length );
 
-    min_gid = (FT_UShort)(( substTable       - wordOffset * 2 ) / 2);
-    max_gid = (FT_UShort)(( substTable_limit - wordOffset * 2 ) / 2);
-    max_gid = (FT_UShort)(FT_MAX( max_gid, valid->face->num_glyphs ));
-    /* XXX: check range ? */
+    min_gid = (FT_UShort)( ( substTable       - wordOffset * 2 ) / 2 );
+    max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 );
+    max_gid = (FT_UShort)( FT_MAX( max_gid, valid->face->num_glyphs ) );
 
+    /* XXX: check range? */
+
     /* TODO: min_gid & max_gid comparison with ClassTable contents */
   }
 
@@ -147,11 +150,12 @@
     FT_UNUSED( limit );
 
 
-    setMark       = (FT_UShort)( flags >> 15);
-    dontAdvance   = (FT_UShort)((flags >> 14) & 1);
-    reserved      = (FT_Short)(  flags & 0x3FFF );
+    setMark       = (FT_UShort)(   flags >> 15            );
+    dontAdvance   = (FT_UShort)( ( flags >> 14 ) & 1      );
+    reserved      = (FT_Short)(    flags         & 0x3FFF );
+
     markOffset    = (FT_Short)( glyphOffset.ul >> 16 );
-    currentOffset = (FT_Short)( glyphOffset.ul );
+    currentOffset = (FT_Short)( glyphOffset.ul       );
 
     if ( 0 < reserved )
     {
@@ -180,7 +184,7 @@
     FT_Bytes   p = table;
     FT_UShort  num_gids = (FT_UShort)(
                  ((GXV_mort_subtable_type1_StateOptRec *)
-                  (valid->statetable.optdata))->substitutionTable_length / 2);
+                  (valid->statetable.optdata))->substitutionTable_length / 2 );
     FT_UShort  i;
 
 
--- a/src/gxvalid/gxvmort2.c
+++ b/src/gxvalid/gxvmort2.c
@@ -177,8 +177,9 @@
 
 
       lig_action = FT_NEXT_ULONG( p );
-      last   = (FT_UShort)( (lig_action >> 31) & 1 );
-      store  = (FT_UShort)( (lig_action >> 30) & 1 );
+      last   = (FT_UShort)( ( lig_action >> 31 ) & 1 );
+      store  = (FT_UShort)( ( lig_action >> 30 ) & 1 );
+
       offset = lig_action & 0x3FFFFFFFUL;
     }
   }
@@ -202,9 +203,10 @@
     FT_UNUSED( limit );
 
 
-    setComponent  = (FT_UShort)( (flags >> 15) & 1 );
-    dontAdvance   = (FT_UShort)( (flags >> 14) & 1 );
-    offset        = (FT_UShort)(  flags & 0x3FFFU  );
+    setComponent = (FT_UShort)( ( flags >> 15 ) & 1 );
+    dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1 );
+    
+    offset = (FT_UShort)( flags & 0x3FFFU );
 
     if ( 0 < offset )
       gxv_mort_subtable_type2_ligActionOffset_validate( table, offset,
--- a/src/gxvalid/gxvmort4.c
+++ b/src/gxvalid/gxvmort4.c
@@ -87,8 +87,9 @@
     FT_UShort            offset;
     GXV_LookupValueDesc  value;
 
-    /* XXX: check range */
-    offset = (FT_UShort)(base_value.u + relative_gindex * sizeof ( FT_UShort ));
+    /* XXX: check range? */
+    offset = (FT_UShort)( base_value.u +
+                          relative_gindex * sizeof ( FT_UShort ) );
 
     p     = valid->lookuptbl_head + offset;
     limit = lookuptbl_limit;
--- a/src/gxvalid/gxvmort5.c
+++ b/src/gxvalid/gxvmort5.c
@@ -158,16 +158,18 @@
     FT_UNUSED( state );
 
 
-    setMark              = FT_BOOL(( flags >> 15 ) & 1);
-    dontAdvance          = FT_BOOL(( flags >> 14 ) & 1);
-    currentIsKashidaLike = FT_BOOL(( flags >> 13 ) & 1);
-    markedIsKashidaLike  = FT_BOOL(( flags >> 12 ) & 1);
-    currentInsertBefore  = FT_BOOL(( flags >> 11 ) & 1);
-    markedInsertBefore   = FT_BOOL(( flags >> 10 ) & 1);
-    currentInsertCount   = (FT_Byte)( (flags >> 5) & 0x1F );
-    markedInsertCount    = (FT_Byte)(  flags & 0x001F );
+    setMark              = FT_BOOL( ( flags >> 15 ) & 1 );
+    dontAdvance          = FT_BOOL( ( flags >> 14 ) & 1 );
+    currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );
+    markedIsKashidaLike  = FT_BOOL( ( flags >> 12 ) & 1 );
+    currentInsertBefore  = FT_BOOL( ( flags >> 11 ) & 1 );
+    markedInsertBefore   = FT_BOOL( ( flags >> 10 ) & 1 );
+
+    currentInsertCount   = (FT_Byte)( ( flags >> 5 ) & 0x1F   );
+    markedInsertCount    = (FT_Byte)(   flags        & 0x001F );
+
     currentInsertList    = (FT_UShort)( glyphOffset.ul >> 16 );
-    markedInsertList     = (FT_UShort)( glyphOffset.ul );
+    markedInsertList     = (FT_UShort)( glyphOffset.ul       );
 
     if ( 0 != currentInsertList && 0 != currentInsertCount )
     {
--- a/src/gxvalid/gxvmorx.c
+++ b/src/gxvalid/gxvmorx.c
@@ -85,7 +85,7 @@
       GXV_LIMIT_CHECK( rest );
 
       /* morx coverage consists of mort_coverage & 16bit padding */
-      gxv_mort_coverage_validate( (FT_UShort)(( coverage >> 16 ) | coverage),
+      gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ),
                                   valid );
       if ( type > 5 )
         FT_INVALID_FORMAT;
--- a/src/gxvalid/gxvmorx0.c
+++ b/src/gxvalid/gxvmorx0.c
@@ -59,11 +59,12 @@
     FT_UNUSED( limit );
 
 
-    markFirst   = (FT_UShort)( (flags >> 15) & 1 );
-    dontAdvance = (FT_UShort)( (flags >> 14) & 1 );
-    markLast    = (FT_UShort)( (flags >> 13) & 1 );
-    reserved    = (FT_UShort)(  flags & 0x1FF0 );
-    verb        = (FT_UShort)(  flags & 0x000F );
+    markFirst   = (FT_UShort)( ( flags >> 15 ) & 1 );
+    dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );
+    markLast    = (FT_UShort)( ( flags >> 13 ) & 1 );
+
+    reserved = (FT_UShort)( flags & 0x1FF0 );
+    verb     = (FT_UShort)( flags & 0x000F );
 
     if ( 0 < reserved )
     {
--- a/src/gxvalid/gxvmorx1.c
+++ b/src/gxvalid/gxvmorx1.c
@@ -122,11 +122,13 @@
     FT_UNUSED( limit );
 
 
-    setMark      = (FT_UShort)( (flags >> 15) & 1 );
-    dontAdvance  = (FT_UShort)( (flags >> 14) & 1 );
-    reserved     = (FT_UShort)( flags & 0x3FFF );
+    setMark      = (FT_UShort)( ( flags >> 15 ) & 1 );
+    dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1 );
+
+    reserved = (FT_UShort)( flags & 0x3FFF );
+
     markIndex    = (FT_Short)( glyphOffset.ul >> 16 );
-    currentIndex = (FT_Short)( glyphOffset.ul );
+    currentIndex = (FT_Short)( glyphOffset.ul       );
 
     GXV_TRACE(( " setMark=%01d dontAdvance=%01d\n",
                 setMark, dontAdvance ));
@@ -142,10 +144,12 @@
                 markIndex, currentIndex ));
 
     if ( optdata->substitutionTable_num_lookupTables < markIndex + 1 )
-      optdata->substitutionTable_num_lookupTables = (FT_Short)(markIndex + 1);
+      optdata->substitutionTable_num_lookupTables =
+        (FT_Short)( markIndex + 1 );
 
     if ( optdata->substitutionTable_num_lookupTables < currentIndex + 1 )
-      optdata->substitutionTable_num_lookupTables = (FT_Short)(currentIndex + 1);
+      optdata->substitutionTable_num_lookupTables =
+        (FT_Short)( currentIndex + 1 );
   }
 
 
@@ -154,10 +158,10 @@
                                                 GXV_LookupValueDesc  value,
                                                 GXV_Validator        valid )
   {
+    FT_UNUSED( glyph ); /* for the non-debugging case */
+
     GXV_TRACE(( "morx subtable type1 subst.: %d -> %d\n", glyph, value.u ));
 
-    FT_UNUSED( glyph );
-
     if ( value.u > valid->face->num_glyphs )
       FT_INVALID_GLYPH_ID;
   }
@@ -175,8 +179,9 @@
     FT_UShort            offset;
     GXV_LookupValueDesc  value;
 
-    /* XXX: check range ? */
-    offset = (FT_UShort)(base_value.u + relative_gindex * sizeof ( FT_UShort ));
+    /* XXX: check range? */
+    offset = (FT_UShort)( base_value.u +
+                          relative_gindex * sizeof ( FT_UShort ) );
 
     p     = valid->lookuptbl_head + offset;
     limit = lookuptbl_limit;
--- a/src/gxvalid/gxvmorx2.c
+++ b/src/gxvalid/gxvmorx2.c
@@ -174,9 +174,10 @@
 
 
       lig_action = FT_NEXT_ULONG( p );
-      last       = (FT_UShort)( (lig_action >> 31) & 1 );
-      store      = (FT_UShort)( (lig_action >> 30) & 1 );
-      offset     = lig_action & 0x3FFFFFFFUL;
+      last       = (FT_UShort)( ( lig_action >> 31 ) & 1 );
+      store      = (FT_UShort)( ( lig_action >> 30 ) & 1 );
+
+      offset = lig_action & 0x3FFFFFFFUL;
     }
   }
 
@@ -200,10 +201,11 @@
     FT_UNUSED( limit );
 
 
-    setComponent   = (FT_UShort)( (flags >> 15) & 1 );
-    dontAdvance    = (FT_UShort)( (flags >> 14) & 1 );
-    performAction  = (FT_UShort)( (flags >> 13) & 1 );
-    reserved       = (FT_UShort)(  flags & 0x1FFF );
+    setComponent   = (FT_UShort)( ( flags >> 15 ) & 1 );
+    dontAdvance    = (FT_UShort)( ( flags >> 14 ) & 1 );
+    performAction  = (FT_UShort)( ( flags >> 13 ) & 1 );
+
+    reserved       = (FT_UShort)( flags & 0x1FFF );
     ligActionIndex = glyphOffset.u;
 
     if ( reserved > 0 )
--- a/src/gxvalid/gxvmorx5.c
+++ b/src/gxvalid/gxvmorx5.c
@@ -155,16 +155,18 @@
     FT_UNUSED( state );
 
 
-    setMark              = FT_BOOL(( flags >> 15 ) & 1);
-    dontAdvance          = FT_BOOL(( flags >> 14 ) & 1);
-    currentIsKashidaLike = FT_BOOL(( flags >> 13 ) & 1);
-    markedIsKashidaLike  = FT_BOOL(( flags >> 12 ) & 1);
-    currentInsertBefore  = FT_BOOL(( flags >> 11 ) & 1);
-    markedInsertBefore   = FT_BOOL(( flags >> 10 ) & 1);
-    currentInsertCount   = (FT_Byte)( (flags >> 5) & 0x1F );
-    markedInsertCount    = (FT_Byte)(  flags & 0x001F );
-    currentInsertList    = (FT_Byte)  ( glyphOffset.ul >> 16 );
-    markedInsertList     = (FT_UShort)( glyphOffset.ul );
+    setMark              = FT_BOOL( ( flags >> 15 ) & 1 );
+    dontAdvance          = FT_BOOL( ( flags >> 14 ) & 1 );
+    currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );
+    markedIsKashidaLike  = FT_BOOL( ( flags >> 12 ) & 1 );
+    currentInsertBefore  = FT_BOOL( ( flags >> 11 ) & 1 );
+    markedInsertBefore   = FT_BOOL( ( flags >> 10 ) & 1 );
+
+    currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F   );
+    markedInsertCount  = (FT_Byte)(   flags        & 0x001F );
+
+    currentInsertList = (FT_Byte)  ( glyphOffset.ul >> 16 );
+    markedInsertList  = (FT_UShort)( glyphOffset.ul       );
 
     if ( currentInsertList && 0 != currentInsertCount )
       gxv_morx_subtable_type5_InsertList_validate( currentInsertList,
--- a/src/gxvalid/gxvopbd.c
+++ b/src/gxvalid/gxvopbd.c
@@ -141,8 +141,9 @@
     FT_UNUSED( lookuptbl_limit );
     FT_UNUSED( valid );
 
-    /* XXX: check range ? */
-    value.u = (FT_UShort)(base_value.u + relative_gindex * 4 * sizeof ( FT_Short ));
+    /* XXX: check range? */
+    value.u = (FT_UShort)( base_value.u +
+                           relative_gindex * 4 * sizeof ( FT_Short ) );
 
     return value;
   }
--- a/src/gxvalid/gxvprop.c
+++ b/src/gxvalid/gxvprop.c
@@ -117,17 +117,17 @@
       char       complement;
 
 
-      offset = (FT_UShort)(property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET);
+      offset = (FT_UShort)( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET );
       if ( offset == 0 )
         FT_INVALID_DATA;
 
-      complement = (char)(offset >> 8);
+      complement = (char)( offset >> 8 );
       if ( complement & 0x08 )
       {
         /* Top bit is set: negative */
 
         /* Calculate the absolute offset */
-        complement = (char)(( complement & 0x07 ) + 1);
+        complement = (char)( ( complement & 0x07 ) + 1 );
 
         /* The gid for complement must be greater than 0 */
         if ( glyph <= complement )
@@ -136,7 +136,7 @@
       else
       {
         /* The gid for complement must be the face. */
-        gxv_glyphid_validate( (FT_UShort)(glyph + complement), valid );
+        gxv_glyphid_validate( (FT_UShort)( glyph + complement ), valid );
       }
     }
     else
@@ -213,8 +213,9 @@
     FT_UShort            offset;
     GXV_LookupValueDesc  value;
 
-    /* XXX: check range ? */
-    offset = (FT_UShort)(base_value.u + relative_gindex * sizeof( FT_UShort ));
+    /* XXX: check range? */
+    offset = (FT_UShort)( base_value.u +
+                          relative_gindex * sizeof( FT_UShort ) );
     p      = valid->lookuptbl_head + offset;
     limit  = lookuptbl_limit;
 
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -755,22 +755,23 @@
   /*                                                                       */
 #define cur_to_org( n, zone ) \
           FT_ARRAY_COPY( (zone)->org, (zone)->cur, (n) )
+
   static FT_Error
-  TT_Hint_Glyph( TT_Loader     loader,
-                 FT_Bool       is_composite )
+  TT_Hint_Glyph( TT_Loader  loader,
+                 FT_Bool    is_composite )
   {
     TT_GlyphZone  zone = &loader->zone;
     FT_Pos        origin;
 
-    FT_UNUSED(is_composite);
-
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
     FT_UInt       n_ins;
+#else
+    FT_UNUSED( is_composite );
+#endif
 
 
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
     n_ins = loader->glyph->control_len;
-
 #endif
 
     origin = zone->cur[zone->n_points - 4].x;
@@ -779,16 +780,16 @@
       translate_array( zone->n_points, zone->cur, origin, 0 );
 
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
     /* save original point positioin in org */
     if ( n_ins > 0 )
       cur_to_org( zone->n_points, zone );
-
 #endif
 
     /* round pp2 and pp4 */
-    zone->cur[zone->n_points - 3].x = FT_PIX_ROUND( zone->cur[zone->n_points - 3].x );
-    zone->cur[zone->n_points - 1].y = FT_PIX_ROUND( zone->cur[zone->n_points - 1].y );
+    zone->cur[zone->n_points - 3].x =
+      FT_PIX_ROUND( zone->cur[zone->n_points - 3].x );
+    zone->cur[zone->n_points - 1].y =
+      FT_PIX_ROUND( zone->cur[zone->n_points - 1].y );
 
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 
@@ -803,8 +804,8 @@
       if ( error )
         return error;
 
-      loader->exec->is_composite     = is_composite;
-      loader->exec->pts              = *zone;
+      loader->exec->is_composite = is_composite;
+      loader->exec->pts          = *zone;
 
       debug = !( loader->load_flags & FT_LOAD_NO_SCALE ) &&
               ( (TT_Size)loader->size )->debug;
@@ -842,13 +843,13 @@
   static FT_Error
   TT_Process_Simple_Glyph( TT_Loader  loader )
   {
-    FT_GlyphLoader  gloader  = loader->gloader;
-    FT_Error        error    = TT_Err_Ok;
+    FT_GlyphLoader  gloader = loader->gloader;
+    FT_Error        error   = TT_Err_Ok;
     FT_Outline*     outline;
     FT_UInt         n_points;
 
 
-    outline = &gloader->current.outline;
+    outline  = &gloader->current.outline;
     n_points = outline->n_points;
 
     /* set phantom points */
@@ -870,9 +871,9 @@
     if ( ((TT_Face)loader->face)->doblend )
     {
       /* Deltas apply to the unscaled data. */
-      FT_Vector*    deltas;
-      FT_Memory     memory = loader->face->memory;
-      FT_UInt       i;
+      FT_Vector*  deltas;
+      FT_Memory   memory = loader->face->memory;
+      FT_UInt     i;
 
 
       error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),
@@ -1006,6 +1007,7 @@
             ( subglyph->flags & SCALED_COMPONENT_OFFSET ) )
 #endif
       {
+
 #if 0
 
   /*************************************************************************/
@@ -1041,7 +1043,7 @@
                                  FT_MulFix( subglyph->transform.xx,
                                             subglyph->transform.xx ) +
                                  FT_MulFix( subglyph->transform.xy,
-                                            subglyph->transform.xy) );
+                                            subglyph->transform.xy ) );
         FT_Fixed  mac_yscale = FT_SqrtFixed(
                                  FT_MulFix( subglyph->transform.yy,
                                             subglyph->transform.yy ) +
@@ -1128,7 +1130,7 @@
 
 
       /* TT_Load_Composite_Glyph only gives us the offset of instructions */
-      /* so we read them here */
+      /* so we read them here                                             */
       if ( FT_STREAM_SEEK( loader->ins_pos ) ||
            FT_READ_USHORT( n_ins )           )
         return error;
@@ -1200,17 +1202,13 @@
     FT_Bool         opened_frame = 0;
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-
     FT_Vector*      deltas       = NULL;
-
 #endif
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
-
     FT_StreamRec    inc_stream;
     FT_Data         glyph_data;
     FT_Bool         glyph_data_loaded = 0;
-
 #endif
 
 
@@ -1278,9 +1276,9 @@
         left_bearing  = (FT_Short)metrics.bearing_x;
         advance_width = (FT_UShort)metrics.advance;
 
-# if 0
+#if 0
 
-        /* GWW: Do I do the same for vertical metrics ??? */
+        /* GWW: Do I do the same for vertical metrics? */
         metrics.bearing_x = 0;
         metrics.bearing_y = top_bearing;
         metrics.advance = advance_height;
@@ -1292,7 +1290,7 @@
         top_bearing  = (FT_Short)metrics.bearing_y;
         advance_height = (FT_UShort)metrics.advance;
 
-# endif
+#endif /* 0 */
 
       }