summaryrefslogtreecommitdiff
path: root/mkfontscale.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2019-01-06 14:26:00 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2019-01-06 14:26:00 -0800
commit0a20abea3ec9742f0982e043e725cdadf0fc493e (patch)
tree3d232a050e097fbd23db5ce065fd39767235db26 /mkfontscale.c
parenta311033403730db56bbbd0c56977e6c49a6b5519 (diff)
Clear some -Wshorten-64-to-32 warnings from clang 6
ident.c:84:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int n = strlen(filename); ~ ^~~~~~~~~~~~~~~~ ident.c:130:9: warning: implicit conversion loses integer precision: 'off64_t' (aka 'long') to 'int' [-Wshorten-64-to-32] return gzseek(ff->f.gz, offset, whence); ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ident.c:140:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] n = offset - ff->pos; ~ ~~~~~~~^~~~~~~~~ ident.c:143:10: warning: implicit conversion loses integer precision: 'off_t' (aka 'long') to 'int' [-Wshorten-64-to-32] n = offset; ~ ^~~~~~ ident.c:156:12: warning: implicit conversion loses integer precision: 'off_t' (aka 'long') to 'unsigned int' [-Wshorten-64-to-32] ff->pos = offset; ~ ^~~~~~ ident.c:157:9: warning: implicit conversion loses integer precision: 'off_t' (aka 'long') to 'int' [-Wshorten-64-to-32] return offset; ~~~~~~ ^~~~~~ mkfontscale.c:704:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int n = strlen(dirname); ~ ^~~~~~~~~~~~~~~ mkfontscale.c:748:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int n = strlen(filename); ~ ^~~~~~~~~~~~~~~~ mkfontscale.c:794:14: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] xl = strlen (exclusionSuffix); ~ ^~~~~~~~~~~~~~~~~~~~~~~~ mkfontscale.c:796:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] i = strlen(dirname_given); ~ ^~~~~~~~~~~~~~~~~~~~~ mkfontscale.c:858:15: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int dl = strlen (entry->d_name); ~~ ^~~~~~~~~~~~~~~~~~~~~~ mkfontscale.c:930:21: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int l = strlen(xlfd_name); ~ ^~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'mkfontscale.c')
-rw-r--r--mkfontscale.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/mkfontscale.c b/mkfontscale.c
index 6423867..4083e28 100644
--- a/mkfontscale.c
+++ b/mkfontscale.c
@@ -701,7 +701,7 @@ makeXLFD(char *filename, FT_Face face, int isBitmap)
static int
readFontScale(HashTablePtr entries, char *dirname)
{
- int n = strlen(dirname);
+ size_t n = strlen(dirname);
char *filename;
FILE *in;
int rc, count, i;
@@ -745,7 +745,7 @@ readFontScale(HashTablePtr entries, char *dirname)
static int
filePrio(char *filename)
{
- int n = strlen(filename);
+ size_t n = strlen(filename);
if(n < 4)
return 0;
if(strcmp(filename + n - 4, ".otf") == 0)
@@ -788,15 +788,16 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
HashTablePtr entries;
HashBucketPtr *array;
int i, n, dirn, diri, found, rc;
- int isBitmap=0,xl=0;
+ int isBitmap=0;
+ size_t d, xl=0;
if (exclusionSuffix)
xl = strlen (exclusionSuffix);
- i = strlen(dirname_given);
- if(i == 0)
+ d = strlen(dirname_given);
+ if(d == 0)
dirname = dsprintf("./");
- else if(dirname_given[i - 1] != '/')
+ else if(dirname_given[d - 1] != '/')
dirname = dsprintf("%s/", dirname_given);
else
dirname = strdup(dirname_given);
@@ -855,7 +856,7 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
xlfd = NULL;
if (xl) {
- int dl = strlen (entry->d_name);
+ size_t dl = strlen (entry->d_name);
if (strcmp (entry->d_name + dl - xl, exclusionSuffix) == 0)
continue;
}
@@ -927,7 +928,7 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
if(xlfd_name) {
/* We know it's a bitmap font, and we know its XLFD */
- int l = strlen(xlfd_name);
+ size_t l = strlen(xlfd_name);
if(reencodeLegacy &&
l >= 12 && strcasecmp(xlfd_name + l - 11, "-iso10646-1") == 0) {
char *s;