]> granicus.if.org Git - strace/commitdiff
tests/xgetrlimit.c: fix a warning reported by -Wtype-limits
authorElvira Khabirova <lineprinter0@gmail.com>
Sat, 11 Jun 2016 17:27:16 +0000 (20:27 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 14 Jun 2016 15:48:25 +0000 (15:48 +0000)
* tests/xgetrlimit.c (sprint_rlim): Explicitly cast constants
to the type of argument.

tests/xgetrlimit.c

index 5e9d7bdc10744b456d0ef88fc3e37f2d23106ce4..d787ce38b50b077071be466e13e941c94b4f1aef 100644 (file)
@@ -41,10 +41,10 @@ const char *
 sprint_rlim(kernel_ulong_t lim)
 {
        if (sizeof(lim) == sizeof(uint64_t)) {
-               if (lim == -1ULL)
+               if (lim == (kernel_ulong_t) -1ULL)
                        return "RLIM64_INFINITY";
        } else {
-               if (lim == -1U)
+               if (lim == (kernel_ulong_t) -1U)
                        return "RLIM_INFINITY";
        }