xcms: use size_t for strlen/sizeof values instead of converting to int & back

Fixes gcc warnings of the form:

IdOfPr.c: In function ‘XcmsFormatOfPrefix’:
IdOfPr.c:69:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if ((len = strlen(prefix)) >= sizeof(string_buf)) {
                                ^
IdOfPr.c:83:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (len >= sizeof(string_buf)) Xfree(string_lowered);
           ^
IdOfPr.c:97:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (len >= sizeof(string_buf)) Xfree(string_lowered);
           ^
IdOfPr.c:104:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (len >= sizeof(string_buf)) Xfree(string_lowered);
             ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
Alan Coopersmith 2016-02-06 13:01:25 -08:00
parent 4de6ed3e7b
commit 0ee0d383b4
2 changed files with 2 additions and 2 deletions

View file

@ -61,7 +61,7 @@ XcmsFormatOfPrefix(char *prefix)
XcmsColorSpace **papColorSpaces;
char string_buf[64];
char *string_lowered;
int len;
size_t len;
/*
* While copying prefix to string_lowered, convert to lowercase

View file

@ -198,7 +198,7 @@ _XcmsParseColorString(
XcmsColorSpace *pColorSpace;
char string_buf[64];
char *string_lowered;
int len;
size_t len;
int res;
if (ccc == NULL) {