diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-01-06 13:33:42 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-01-06 13:39:22 -0800 |
commit | a311033403730db56bbbd0c56977e6c49a6b5519 (patch) | |
tree | 481b8d6f5b6bbaee06c7e94f399d8c4cf40241a1 | |
parent | d971bb62c6d2a35eccfdcd0c3c6c65c4f841f556 (diff) |
Clear some -Wsign-compare warnings from gcc 7
mkfontscale.c: In function ‘getName’:
mkfontscale.c:336:22: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for(i = 0; i < name.string_len / 2; i++) {
^
mkfontscale.c: In function ‘nameWidth’:
mkfontscale.c:427:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for(i = 0; i < NUMWIDTHS; i++)
^
mkfontscale.c: In function ‘notice_foundry’:
mkfontscale.c:1261:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for(i = 0; i < countof(notice_foundries); i++)
^
mkfontscale.c: In function ‘vendor_foundry’:
mkfontscale.c:1285:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for(i = 0; i < countof(vendor_foundries); i++)
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | mkfontscale.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mkfontscale.c b/mkfontscale.c index e5c038d..6423867 100644 --- a/mkfontscale.c +++ b/mkfontscale.c @@ -322,7 +322,7 @@ getName(FT_Face face, int nid) { FT_SfntName name; char *string; - int i; + unsigned int i; if(getNameHelper(face, nid, TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, &name) || @@ -416,8 +416,8 @@ static const char* nameWidth(const char *name) { char buf[500]; - int i; - int n = strlen(name); + unsigned int i; + size_t n = strlen(name); if(n >= 499) return NULL; for(i = 0; i < n; i++) @@ -1257,7 +1257,7 @@ checkExtraEncoding(FT_Face face, const char *encoding_name, int found) static const char* notice_foundry(const char *notice) { - int i; + unsigned int i; for(i = 0; i < countof(notice_foundries); i++) if(notice && strstr(notice, notice_foundries[i][0])) return notice_foundries[i][1]; @@ -1268,7 +1268,7 @@ static int vendor_match(const signed char *vendor, const char *vendor_string) { /* vendor is not necessarily NUL-terminated. */ - int i, len; + size_t i, len; len = strlen(vendor_string); if(memcmp(vendor, vendor_string, len) != 0) return 0; @@ -1281,7 +1281,7 @@ vendor_match(const signed char *vendor, const char *vendor_string) static const char* vendor_foundry(const signed char *vendor) { - int i; + unsigned int i; for(i = 0; i < countof(vendor_foundries); i++) if(vendor_match(vendor, vendor_foundries[i][0])) return vendor_foundries[i][1]; |