summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-12-07 15:46:13 -0800
committerKeith Packard <keithp@keithp.com>2015-12-08 20:36:38 -0800
commiteb67d10ae82b364a4324e96ce53baaa4e5e75f97 (patch)
treef02278d58e2326e35dcdc5640ea6f44f02eda909 /src
parentd6877a7c1c35985f6a75b6cd4e814595e781adc4 (diff)
Add compiler warning flags and fix warnings
Mostly signed vs unsigned comparisons Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/FreeType/ftfuncs.c12
-rw-r--r--src/bitmap/bdfread.c4
-rw-r--r--src/bitmap/pcfread.c1
-rw-r--r--src/fc/fstrans.c2
4 files changed, 10 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)];
diff --git a/src/fc/fstrans.c b/src/fc/fstrans.c
index 24fceee..9b21864 100644
--- a/src/fc/fstrans.c
+++ b/src/fc/fstrans.c
@@ -26,3 +26,5 @@
#define FONT_t
#define TRANS_CLIENT
#include <X11/Xtrans/transport.c>
+/* inhibit warning about is_numeric */
+static inline void foo(void) { (void) is_numeric("a"); }