diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-07-05 14:47:00 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-07-05 14:49:20 -0700 |
commit | 11b1eba90baecf41b9e54b32827be864f0823469 (patch) | |
tree | a80642b418c9c3ee268072a45e36ec96ba0c5cfd | |
parent | e9faac187bfa7ecd669c5fd68fc989641117d8bd (diff) |
Fix integer sign/size conversion warnings from clang & cppcheck
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | chars.c | 14 | ||||
-rw-r--r-- | header.c | 16 | ||||
-rw-r--r-- | props.c | 8 |
3 files changed, 19 insertions, 19 deletions
@@ -155,17 +155,17 @@ EmitCharacters(FILE *outFile, { FSXCharInfo *extents; FSXCharInfo *charInfo; - int encoding; + unsigned int encoding; FSOffset *offsets; unsigned char *glyph; unsigned char *glyphs; unsigned int nChars; - int firstCharLow; - int firstCharHigh; - int lastCharLow; - int lastCharHigh; - int chLow; - int chHigh; + unsigned int firstCharLow; + unsigned int firstCharHigh; + unsigned int lastCharLow; + unsigned int lastCharHigh; + unsigned int chLow; + unsigned int chHigh; FSBitmapFormat format; nChars = 0; @@ -66,17 +66,17 @@ static const char *warning[] = static char * FindStringProperty(const char *propName, - int *propLength, + unsigned int *propLength, FSPropInfo *propInfo, FSPropOffset *propOffsets, unsigned char *propData) { FSPropOffset *propOffset; - int length; - int i; + unsigned int length; + unsigned int i; propOffset = &propOffsets[0]; - length = strlen(propName); + length = (unsigned int) strlen(propName); for (i = propInfo->num_offsets; i--; propOffset++) { if (propOffset->type == PropTypeString) { @@ -109,11 +109,11 @@ FindNumberProperty(const char *propName, unsigned char *propData) { FSPropOffset *propOffset; - int i; - int length; + unsigned int i; + unsigned int length; propOffset = &propOffsets[0]; - length = strlen(propName); + length = (unsigned int) strlen(propName); for (i = propInfo->num_offsets; i--; propOffset++) { if ((propOffset->type == PropTypeSigned) || (propOffset->type == PropTypeUnsigned)) { @@ -138,7 +138,7 @@ EmitHeader(FILE *outFile, FSPropOffset *propOffsets, unsigned char *propData) { - int len; + unsigned int len; int type; char *cp; const char **cpp; @@ -48,7 +48,7 @@ in this Software without prior written authorization from The Open Group. #include "fstobdf.h" static char * -AddQuotes(unsigned char *string, int length) +AddQuotes(unsigned char *string, unsigned int length) { static unsigned char new[256] = "\""; unsigned char *cp; @@ -72,7 +72,7 @@ EmitProperties(FILE *outFile, FSPropOffset *propOffsets, unsigned char *propData) { - int nProperties; + unsigned int nProperties; FSPropOffset *property; Bool needDefaultChar; Bool needFontAscent; @@ -85,7 +85,7 @@ EmitProperties(FILE *outFile, nProperties = propInfo->num_offsets; for (property = &propOffsets[0]; nProperties--; property++) { char *name; - int length; + unsigned int length; name = (char *)propData + property->name.position; length = property->name.length; @@ -122,7 +122,7 @@ EmitProperties(FILE *outFile, fprintf(outFile, "%lu\n", value); break; case PropTypeSigned: - fprintf(outFile, "%ld\n", value); + fprintf(outFile, "%ld\n", (signed long) value); break; default: fprintf(stderr, "unknown property type\n"); |