diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-21 23:03:48 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-21 23:03:48 -0800 |
commit | f407231c855bc0349d0f8543a9dfe9dff4b2508b (patch) | |
tree | 1756be88468206df4fff11769d614ca1c74f7589 | |
parent | ee596f7f67b203d04974fce16deadfcd122d0441 (diff) |
Declare 'len' as size_t to avoid unneccessary back-and-forth conversions
Fixes clang warnings:
xdpyinfo.c:1463:12: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
int len = strlen(arg);
~~~ ^~~~~~~~~~~
xdpyinfo.c:1465:32: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
if (!strncmp("-display", arg, len)) {
~~~~~~~ ^~~
xdpyinfo.c:1468:47: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
} else if (!strncmp("-queryExtensions", arg, len)) {
~~~~~~~ ^~~
xdpyinfo.c:1470:35: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
} else if (!strncmp("-ext", arg, len)) {
~~~~~~~ ^~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xdpyinfo.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1460,7 +1460,7 @@ main(int argc, char *argv[]) for (i = 1; i < argc; i++) { char *arg = argv[i]; - int len = strlen(arg); + size_t len = strlen(arg); if (!strncmp("-display", arg, len)) { if (++i >= argc) usage (); |