More compiler warning fixes. */*: Use cast to `FT_Bool' (or `Bool') where appropriate.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
diff --git a/ChangeLog b/ChangeLog
index 9968449..bf8cd32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-06-12 Werner Lemberg <wl@gnu.org>
+
+ More compiler warning fixes.
+
+ */*: Use cast to `FT_Bool' (or `Bool') where appropriate.
+
2013-06-10 Werner Lemberg <wl@gnu.org>
[truetype] Improve handling of broken sbit advance widths.
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index ac2a39c..d6b2126 100644
--- 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 )
{
diff --git a/src/cff/cf2font.c b/src/cff/cf2font.c
index 8b2331d..479d912 100644
--- 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;
diff --git a/src/cff/cf2hints.c b/src/cff/cf2hints.c
index 1666e4f..96bd49f 100644
--- a/src/cff/cf2hints.c
+++ b/src/cff/cf2hints.c
@@ -217,52 +217,52 @@
FT_LOCAL_DEF( FT_Bool )
cf2_hint_isValid( const CF2_Hint hint )
{
- return hint->flags != 0;
+ return (FT_Bool)( hint->flags != 0 );
}
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 );
}
static FT_Bool
cf2_hint_isPairTop( const CF2_Hint hint )
{
- return ( hint->flags & CF2_PairTop ) != 0;
+ return (FT_Bool)( ( hint->flags & CF2_PairTop ) != 0 );
}
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 );
}
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 );
}
static FT_Bool
cf2_hint_isLocked( const CF2_Hint hint )
{
- return ( hint->flags & CF2_Locked ) != 0;
+ return (FT_Bool)( ( hint->flags & CF2_Locked ) != 0 );
}
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
{
diff --git a/src/cff/cf2intrp.c b/src/cff/cf2intrp.c
index 5b73e60..5610917 100644
--- 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 );
diff --git a/src/cff/cf2read.c b/src/cff/cf2read.c
index cb671ec..2b429e3 100644
--- 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 );
}
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 4865994..bbd503d 100644
--- 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 */
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 9da5d00..1c834a1 100644
--- 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