shithub: freetype+ttf2subf

Download patch

ref: c06889eb2c42b40d9ef557b03c9b57d6057e0f12
parent: 2d9caa0606439c6b02738ea104df055f2cea4c00
author: Werner Lemberg <[email protected]>
date: Wed Jun 12 06:58:06 EDT 2013

More compiler warning fixes.

*/*: Use cast to `FT_Bool' (or `Bool') where appropriate.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-06-12  Werner Lemberg  <[email protected]>
+
+	More compiler warning fixes.
+
+	*/*: Use cast to `FT_Bool' (or `Bool') where appropriate.
+
 2013-06-10  Werner Lemberg  <[email protected]>
 
 	[truetype] Improve handling of broken sbit advance widths.
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4513,9 +4513,9 @@
     service = (FT_Service_Properties)interface;
 
     if ( set )
-      missing_func = !service->set_property;
+      missing_func = (FT_Bool)( !service->set_property );
     else
-      missing_func = !service->get_property;
+      missing_func = (FT_Bool)( !service->get_property );
 
     if ( missing_func )
     {
--- a/src/cff/cf2font.c
+++ b/src/cff/cf2font.c
@@ -157,7 +157,8 @@
 
     /* if a CID fontDict has changed, we need to recompute some cached */
     /* data                                                            */
-    needExtraSetup = font->lastSubfont != cf2_getSubfont( decoder );
+    needExtraSetup =
+      (FT_Bool)( font->lastSubfont != cf2_getSubfont( decoder ) );
 
     /* if ppem has changed, we need to recompute some cached data         */
     /* note: because of CID font matrix concatenation, ppem and transform */
@@ -170,7 +171,7 @@
     }
 
     /* copy hinted flag on each call */
-    font->hinted = font->renderingFlags & CF2_FlagsHinted;
+    font->hinted = (FT_Bool)( font->renderingFlags & CF2_FlagsHinted );
 
     /* determine if transform has changed;       */
     /* include Fontmatrix but ignore translation */
@@ -204,7 +205,8 @@
      */
     if ( font->stemDarkened != ( font->renderingFlags & CF2_FlagsDarkened ) )
     {
-      font->stemDarkened = font->renderingFlags & CF2_FlagsDarkened;
+      font->stemDarkened =
+        (FT_Bool)( font->renderingFlags & CF2_FlagsDarkened );
 
       /* blue zones depend on darkened flag */
       needExtraSetup = TRUE;
--- a/src/cff/cf2hints.c
+++ b/src/cff/cf2hints.c
@@ -217,7 +217,7 @@
   FT_LOCAL_DEF( FT_Bool )
   cf2_hint_isValid( const CF2_Hint  hint )
   {
-    return hint->flags != 0;
+    return (FT_Bool)( hint->flags != 0 );
   }
 
 
@@ -224,8 +224,8 @@
   static FT_Bool
   cf2_hint_isPair( const CF2_Hint  hint )
   {
-    return ( hint->flags                      &
-             ( CF2_PairBottom | CF2_PairTop ) ) != 0;
+    return (FT_Bool)( ( hint->flags                      &
+                        ( CF2_PairBottom | CF2_PairTop ) ) != 0 );
   }
 
 
@@ -232,7 +232,7 @@
   static FT_Bool
   cf2_hint_isPairTop( const CF2_Hint  hint )
   {
-    return ( hint->flags & CF2_PairTop ) != 0;
+    return (FT_Bool)( ( hint->flags & CF2_PairTop ) != 0 );
   }
 
 
@@ -239,8 +239,8 @@
   FT_LOCAL_DEF( FT_Bool )
   cf2_hint_isTop( const CF2_Hint  hint )
   {
-    return ( hint->flags                    &
-             ( CF2_PairTop | CF2_GhostTop ) ) != 0;
+    return (FT_Bool)( ( hint->flags                    &
+                        ( CF2_PairTop | CF2_GhostTop ) ) != 0 );
   }
 
 
@@ -247,8 +247,8 @@
   FT_LOCAL_DEF( FT_Bool )
   cf2_hint_isBottom( const CF2_Hint  hint )
   {
-    return ( hint->flags                          &
-             ( CF2_PairBottom | CF2_GhostBottom ) ) != 0;
+    return (FT_Bool)( ( hint->flags                          &
+                        ( CF2_PairBottom | CF2_GhostBottom ) ) != 0 );
   }
 
 
@@ -255,7 +255,7 @@
   static FT_Bool
   cf2_hint_isLocked( const CF2_Hint  hint )
   {
-    return ( hint->flags & CF2_Locked ) != 0;
+    return (FT_Bool)( ( hint->flags & CF2_Locked ) != 0 );
   }
 
 
@@ -262,7 +262,7 @@
   static FT_Bool
   cf2_hint_isSynthetic( const CF2_Hint  hint )
   {
-    return ( hint->flags & CF2_Synthetic ) != 0;
+    return (FT_Bool)( ( hint->flags & CF2_Synthetic ) != 0 );
   }
 
 
@@ -462,7 +462,8 @@
                  hintmap->edge[i].dsCoord + moveDown - downMinCounter )
           {
             move     = moveDown;
-            saveEdge = moveUp < -moveDown;  /* true if non-optimum move */
+            /* true if non-optimum move */
+            saveEdge = (FT_Bool)( moveUp < -moveDown );
           }
           else
           {
--- a/src/cff/cf2intrp.c
+++ b/src/cff/cf2intrp.c
@@ -287,7 +287,7 @@
   {
     CF2_UInt  i;
     CF2_UInt  count       = cf2_stack_count( opStack );
-    FT_Bool   hasWidthArg = count & 1;
+    FT_Bool   hasWidthArg = (FT_Bool)( count & 1 );
 
     /* variable accumulates delta values from operand stack */
     CF2_Fixed  position = hintOffset;
@@ -357,8 +357,8 @@
 
     if ( doConditionalLastRead )
     {
-      FT_Bool    lastIsX = cf2_fixedAbs( vals[10] - *curX ) >
-                             cf2_fixedAbs( vals[11] - *curY );
+      FT_Bool    lastIsX = (FT_Bool)( cf2_fixedAbs( vals[10] - *curX ) >
+                                        cf2_fixedAbs( vals[11] - *curY ) );
       CF2_Fixed  lastVal = cf2_stack_getReal( opStack, index );
 
 
--- a/src/cff/cf2read.c
+++ b/src/cff/cf2read.c
@@ -105,7 +105,7 @@
   FT_LOCAL_DEF( FT_Bool )
   cf2_buf_isEnd( CF2_Buffer  buf )
   {
-    return buf->ptr >= buf->end;
+    return (FT_Bool)( buf->ptr >= buf->end );
   }
 
 
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -453,8 +453,10 @@
 #define FRAC( x )     ( (x) & ( ras.precision - 1 ) )
 #define SCALED( x )   ( ( (ULong)(x) << ras.scale_shift ) - ras.precision_half )
 
-#define IS_BOTTOM_OVERSHOOT( x )  ( CEILING( x ) - x >= ras.precision_half )
-#define IS_TOP_OVERSHOOT( x )     ( x - FLOOR( x ) >= ras.precision_half )
+#define IS_BOTTOM_OVERSHOOT( x ) \
+          (Bool)( CEILING( x ) - x >= ras.precision_half )
+#define IS_TOP_OVERSHOOT( x )    \
+          (Bool)( x - FLOOR( x ) >= ras.precision_half )
 
   /* The most used variables are positioned at the top of the structure. */
   /* Thus, their offset can be coded with less opcodes, resulting in a   */
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -72,7 +72,7 @@
 
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
-#define IS_INCREMENTAL  ( face->root.internal->incremental_interface != 0 )
+#define IS_INCREMENTAL  (FT_Bool)( face->root.internal->incremental_interface != 0 )
 #else
 #define IS_INCREMENTAL  0
 #endif