diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-05-31 19:51:00 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-05-31 19:51:00 -0700 |
commit | 8e86b50311c3b926d2bb1e00fb5343f3e76d55b3 (patch) | |
tree | 247cf000f39479600ba8b191cc39d1743b001514 | |
parent | 641a71f594688d870540be47ddff339d746a4fa0 (diff) |
Fix some sign/size conversion warnings from clang
psgeom.c:1320:17: warning: implicit conversion changes signedness:
'int' to 'unsigned long' [-Wsign-conversion]
if ((sym & (~0xff)) == 0x700) {
~ ^~~~~
psgeom.c:1666:31: warning: implicit conversion changes signedness:
'int' to 'unsigned long' [-Wsign-conversion]
else if (((sym & (~0xff)) == 0) && isprint(sym) && (!isspace(sym))) {
~ ^~~~~
psgeom.c:1860:27: warning: implicit conversion loses integer precision:
'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
int len = strlen(top->label[i]);
~~~ ^~~~~~~~~~~~~~~~~~~~~
xkbprint.c:460:19: warning: implicit conversion loses integer precision:
'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
int len = strlen(inputFile);
~~~ ^~~~~~~~~~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | psgeom.c | 6 | ||||
-rw-r--r-- | xkbprint.c | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -1317,7 +1317,7 @@ PSNonLatin1Symbol(KeySym sym, unsigned char *buf, *font_rtrn = FONT_SYMBOL; if (sz_rtrn != NULL) *sz_rtrn = SZ_MEDIUM; - if ((sym & (~0xff)) == 0x700) { + if ((sym & (~0xffUL)) == 0x700) { switch (sym) { /* Greek symbol */ case XK_Greek_ALPHA: @@ -1663,7 +1663,7 @@ FindKeysymsByName(XkbDescPtr xkb, char *name, PSState *state, KeyTop *top) top->font[(g * 2) + l] = font; top->size[(g * 2) + l] = sz; } - else if (((sym & (~0xff)) == 0) && isprint(sym) && (!isspace(sym))) { + else if (((sym & (~0xffUL)) == 0) && isprint(sym) && (!isspace(sym))) { if (sym == '(') snprintf((char *) buf, sizeof(buf), "\\("); else if (sym == ')') @@ -1857,7 +1857,7 @@ PSLabelKey(FILE *out, PSState *state, KeyTop *top, int x, int y, int size; if (top->size[i] == SZ_AUTO) { - int len = strlen(top->label[i]); + size_t len = strlen(top->label[i]); if (len == 1) { if (top->font[i] == FONT_ISOCAPS) size = 18; @@ -453,7 +453,7 @@ parseArgs(int argc, char *argv[]) /* Nothing */ } else if (strchr(inputFile, ':') == NULL) { - int len = strlen(inputFile); + size_t len = strlen(inputFile); if ((len > 4) && (strcmp(&inputFile[len - 4], ".xkm") == 0)) { /* Nothing */ |