diff options
author | Keith Packard <keithp@keithp.com> | 2015-12-07 15:46:13 -0800 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2016-05-30 21:23:32 -0700 |
commit | bee4a764ccef46101dca03c70d4ad1793a5a5d78 (patch) | |
tree | 6f9b251f5654791565bfe6976909a2646f574e6b /src | |
parent | d6877a7c1c35985f6a75b6cd4e814595e781adc4 (diff) |
Fix warnings
Mostly signed vs unsigned comparisons
Signed-off-by: Keith Packard <keithp@keithp.com>
Squashed commit of three cherry-picks from master:
(cherry picked from commit eb67d10ae82b364a4324e96ce53baaa4e5e75f97)
(cherry picked from commit eefc0b0b908eb8533e704d7156ce983ad7891cc5)
(cherry picked from commit d967caa988eaabd9e84c82879e2f21bd33b952a7)
Diffstat (limited to 'src')
-rw-r--r-- | src/FreeType/ftfuncs.c | 12 | ||||
-rw-r--r-- | src/bitmap/bdfread.c | 4 | ||||
-rw-r--r-- | src/bitmap/pcfread.c | 1 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c index c440fde..df64f5e 100644 --- a/src/FreeType/ftfuncs.c +++ b/src/FreeType/ftfuncs.c @@ -474,7 +474,7 @@ FreeTypeOpenInstance(FTInstancePtr *instance_return, FTFacePtr face, if( FT_IS_SFNT( face->face ) ) { #if 1 FT_F26Dot6 tt_char_width, tt_char_height, tt_dim_x, tt_dim_y; - FT_UInt nn; + FT_Int nn; instance->strike_index=0xFFFFU; @@ -1454,7 +1454,7 @@ FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp, } for( i = MAX(0, dy) ; i<ht ; i++ ){ int prev_jj,jj; - if( bitmap->rows <= i-dy ) break; + if( bitmap->rows <= (unsigned) (i-dy) ) break; current_buffer=(unsigned char *)(bitmap->buffer+bitmap->pitch*(i-dy)); current_raster=(unsigned char *)(raster+i*bpr); j = MAX(0,div_dx); @@ -2985,13 +2985,13 @@ ft_compute_bounds(FTFontPtr font, FontInfoPtr pinfo, FontScalablePtr vals ) c = row<<8|col; flags=0; if ( !force_c_outside ) { - if ( c <= instance->ttcap.forceConstantSpacingEnd - && instance->ttcap.forceConstantSpacingBegin <= c ) + if ( (signed) c <= instance->ttcap.forceConstantSpacingEnd + && instance->ttcap.forceConstantSpacingBegin <= (signed) c ) flags|=FT_FORCE_CONSTANT_SPACING; } else { /* for GB18030 proportional */ - if ( c <= instance->ttcap.forceConstantSpacingEnd - || instance->ttcap.forceConstantSpacingBegin <= c ) + if ( (signed) c <= instance->ttcap.forceConstantSpacingEnd + || instance->ttcap.forceConstantSpacingBegin <= (signed) c ) flags|=FT_FORCE_CONSTANT_SPACING; } #if 0 diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c index eccd7b7..f343eed 100644 --- a/src/bitmap/bdfread.c +++ b/src/bitmap/bdfread.c @@ -298,7 +298,7 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState, bdfError("invalid number of CHARS in BDF file\n"); return (FALSE); } - if (nchars > INT32_MAX / sizeof(CharInfoRec)) { + if (nchars > (signed) (INT32_MAX / sizeof(CharInfoRec))) { bdfError("Couldn't allocate pCI (%d*%d)\n", nchars, (int) sizeof(CharInfoRec)); goto BAILOUT; @@ -631,7 +631,7 @@ bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState) } if ((sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) || (nProps <= 0) || - (nProps > ((INT32_MAX / sizeof(FontPropRec)) - BDF_GENPROPS))) { + (nProps > (signed) ((INT32_MAX / sizeof(FontPropRec)) - BDF_GENPROPS))) { bdfError("bad 'STARTPROPERTIES'\n"); return (FALSE); } diff --git a/src/bitmap/pcfread.c b/src/bitmap/pcfread.c index 34eeeb7..33871ae 100644 --- a/src/bitmap/pcfread.c +++ b/src/bitmap/pcfread.c @@ -487,7 +487,6 @@ pcfReadFont(FontPtr pFont, FontFilePtr file, for (i = 0; i < GLYPHPADOPTIONS; i++) { bitmapSizes[i] = pcfGetINT32(file, format); if (IS_EOF(file)) goto Bail; - if (bitmapSizes[i] < 0) goto Bail; } sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)]; |