From f86709a15b61ab6049d6ee3d2526d5880818a868 Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 7 Jan 2002 10:04:09 +0000 Subject: [PATCH] * src/base/ftobjs.c, src/base/ftoutln.c, src/cache/ftccmap.c, src/cff/cffload.c, src/cff/cffobjs.c, src/pshinter/pshalgo2.c, src/sfnt/ttload.c, src/sfnt/ttsbit.c: removing small compiler warnings (in pedantic compilation modes) --- ChangeLog | 8 ++++++++ src/base/ftobjs.c | 1 + src/base/ftoutln.c | 3 +-- src/cache/ftccmap.c | 6 ++++-- src/cff/cffload.c | 2 +- src/cff/cffobjs.c | 16 ++++++++-------- src/pshinter/pshalgo2.c | 2 +- src/sfnt/ttload.c | 4 ++-- src/sfnt/ttsbit.c | 12 ++++++------ 9 files changed, 32 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b0ede23e..811e86131 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-01-06 David Turner + + * src/base/ftobjs.c, src/base/ftoutln.c, src/cache/ftccmap.c, + src/cff/cffload.c, src/cff/cffobjs.c, src/pshinter/pshalgo2.c, + src/sfnt/ttload.c, src/sfnt/ttsbit.c: removing small compiler + warnings (in pedantic compilation modes) + + 2002-01-05 David Turner * src/autohint/ahhint.c (ah_align_linked_edge): Modified computation diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 132c9ffab..f2eb27942 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -23,6 +23,7 @@ #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_TRUETYPE_TABLES_H +#include FT_OUTLINE_H #include /* for strcmp() */ diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c index 9f455b795..142ba0775 100644 --- a/src/base/ftoutln.c +++ b/src/base/ftoutln.c @@ -319,8 +319,7 @@ if ( n_points <= 0 || n_contours <= 0 ) goto Bad; - end0 = -1; - end = end0; + end0 = end = -1; for ( n = 0; n < n_contours; n++ ) { end = outline->contours[n]; diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c index d3c92407e..4b775e06f 100644 --- a/src/cache/ftccmap.c +++ b/src/cache/ftccmap.c @@ -130,6 +130,8 @@ FT_CALLBACK_DEF( FT_ULong ) ftc_cmap_node_weight( FTC_CMapNode cnode ) { + FT_UNUSED(cnode); + return sizeof ( *cnode ); } @@ -142,7 +144,7 @@ FT_UInt32 offset = (FT_UInt32)( cquery->char_code - cnode->first ); - return ( offset < FTC_CMAP_INDICES_MAX ); + return FT_BOOL( offset < FTC_CMAP_INDICES_MAX ); } @@ -373,7 +375,7 @@ /* perform lookup */ gindex = FT_Get_Char_Index( face, char_code ); - node->indices[offset] = gindex; + node->indices[offset] = (FT_UInt16) gindex; /* restore old charmap */ FT_Set_Charmap( face, old ); diff --git a/src/cff/cffload.c b/src/cff/cffload.c index f69c11385..8d144d03b 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -1049,7 +1049,7 @@ FT_LOCAL_DEF FT_UShort CFF_Get_Standard_Encoding( FT_UInt charcode ) { - return (charcode < 256 ? cff_standard_encoding[charcode] : 0); + return (FT_UShort)(charcode < 256 ? cff_standard_encoding[charcode] : 0); } diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c index 44e1fffa3..5b1568e01 100644 --- a/src/cff/cffobjs.c +++ b/src/cff/cffobjs.c @@ -120,34 +120,34 @@ count = priv.num_blue_values = cpriv->num_blue_values; for ( n = 0; n < count; n++ ) - priv.blue_values[n] = cpriv->blue_values[n]; + priv.blue_values[n] = (FT_Short) cpriv->blue_values[n]; count = priv.num_other_blues = cpriv->num_other_blues; for ( n = 0; n < count; n++ ) - priv.other_blues[n] = cpriv->other_blues[n]; + priv.other_blues[n] = (FT_Short) cpriv->other_blues[n]; count = priv.num_family_blues = cpriv->num_family_blues; for ( n = 0; n < count; n++ ) - priv.family_blues[n] = cpriv->family_blues[n]; + priv.family_blues[n] = (FT_Short) cpriv->family_blues[n]; count = priv.num_family_other_blues = cpriv->num_family_other_blues; for ( n = 0; n < count; n++ ) - priv.family_other_blues[n] = cpriv->family_other_blues[n]; + priv.family_other_blues[n] = (FT_Short) cpriv->family_other_blues[n]; priv.blue_scale = cpriv->blue_scale; priv.blue_shift = cpriv->blue_shift; priv.blue_fuzz = cpriv->blue_fuzz; - priv.standard_width[0] = (FT_UShort)cpriv->standard_width; - priv.standard_height[0] = (FT_UShort)cpriv->standard_height; + priv.standard_width[0] = (FT_UShort) cpriv->standard_width; + priv.standard_height[0] = (FT_UShort) cpriv->standard_height; count = priv.num_snap_widths = cpriv->num_snap_widths; for ( n = 0; n < count; n++ ) - priv.snap_widths[n] = cpriv->snap_widths[n]; + priv.snap_widths[n] = (FT_Short) cpriv->snap_widths[n]; count = priv.num_snap_heights = cpriv->num_snap_heights; for ( n = 0; n < count; n++ ) - priv.snap_heights[n] = cpriv->snap_heights[n]; + priv.snap_heights[n] = (FT_Short) cpriv->snap_heights[n]; priv.force_bold = cpriv->force_bold; priv.language_group = cpriv->language_group; diff --git a/src/pshinter/pshalgo2.c b/src/pshinter/pshalgo2.c index 00778e295..5546bc944 100644 --- a/src/pshinter/pshalgo2.c +++ b/src/pshinter/pshalgo2.c @@ -1044,7 +1044,7 @@ vec[n].y = point->cur_u; if ( psh2_point_is_strong( point ) ) - tags[n] |= (dimension == 0) ? 32 : 64; + tags[n] |= (char)((dimension == 0) ? 32 : 64); #ifdef DEBUG_HINTER if ( dimension == 0 ) diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c index ccb0174e1..4e5f9eb8d 100644 --- a/src/sfnt/ttload.c +++ b/src/sfnt/ttload.c @@ -649,8 +649,8 @@ /* We also increase maxPoints and maxContours in order to support */ /* some broken fonts. */ - face->root.internal->max_points += 8; - face->root.internal->max_contours += 4; + face->root.internal->max_points += (FT_UShort) 8; + face->root.internal->max_contours += (FT_Short) 4; } FT_TRACE2(( "MAXP loaded.\n" )); diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index cb007a179..d87d70b5c 100644 --- a/src/sfnt/ttsbit.c +++ b/src/sfnt/ttsbit.c @@ -123,7 +123,7 @@ /* ensure that there are at least 8 bits in the accumulator */ if ( loaded < 8 ) { - acc |= (FT_UShort)*source++ << ( 8 - loaded ); + acc |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded )); loaded += 8; } @@ -131,8 +131,8 @@ val = (FT_Byte)( acc >> 8 ); if ( shift ) { - cur[0] |= val >> shift; - cur[1] |= val << space; + cur[0] |= (FT_Byte)(val >> shift); + cur[1] |= (FT_Byte)(val << space); } else cur[0] |= val; @@ -158,16 +158,16 @@ /* ensure that there are at least `count' bits in the accumulator */ if ( (FT_Int)loaded < count ) { - acc |= (FT_UShort)*source++ << ( 8 - loaded ); + acc |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded )); loaded += 8; } /* now write remaining bits */ val = (FT_Byte)( ( (FT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count ) ); - cur[0] |= val >> shift; + cur[0] |= (FT_Byte)(val >> shift); if ( count > space ) - cur[1] |= val << space; + cur[1] |= (FT_Byte)(val << space); acc <<= count; loaded -= count;