diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2012-01-12 12:06:53 -0200 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2012-01-12 12:12:34 -0200 |
commit | 5fcf481539645d93800c388182b4887ec4d9c81c (patch) | |
tree | cc4f83f909d2329b6c4c4aa2b26dcd27fca1cc40 | |
parent | 66518ab5653cfdc840cd69e7b653ec05df060584 (diff) |
modetest: fix some compiler warnings
Use unsigned int instead of int:
- modetest.c:89:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:97:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:117:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:772:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
The 'fd' variable is global, we don't need to pass it as an argument:
- modetest.c:698:40: warning: unused parameter ‘fd’ [-Wunused-parameter]
We don't use the 'modeset' variable:
- modetest.c:725:8: warning: variable ‘modeset’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
-rw-r--r-- | tests/modetest/modetest.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 229ab8ae..c0f7ad7c 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -70,7 +70,7 @@ struct type_name { #define type_name_fn(res) \ char * res##_str(int type) { \ - int i; \ + unsigned int i; \ for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \ if (res##_names[i].type == type) \ return res##_names[i].name; \ @@ -695,7 +695,7 @@ void usage(char *name) #define dump_resource(res) if (res) dump_##res() -static int page_flipping_supported(int fd) +static int page_flipping_supported(void) { /*FIXME: generic ioctl needed? */ return 1; @@ -722,8 +722,8 @@ int main(int argc, char **argv) int encoders = 0, connectors = 0, crtcs = 0, framebuffers = 0; int test_vsync = 0; char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx" }; - char *modeset = NULL; - int i, count = 0; + unsigned int i; + int count = 0; struct connector con_args[2]; opterr = 0; @@ -748,7 +748,6 @@ int main(int argc, char **argv) test_vsync = 1; break; case 's': - modeset = strdup(optarg); con_args[count].crtc = -1; if (sscanf(optarg, "%d:%64s", &con_args[count].id, @@ -780,7 +779,7 @@ int main(int argc, char **argv) } } - if (test_vsync && !page_flipping_supported(fd)) { + if (test_vsync && !page_flipping_supported()) { fprintf(stderr, "page flipping not supported by drm.\n"); return -1; } |