dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm 1/4] modetest: fix some compiler warnings
@ 2012-04-21 20:51 Paulo Zanoni
  2012-04-21 20:51 ` [PATCH libdrm 2/4] modetest: fix drmModeGetConnector memory leak Paulo Zanoni
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Paulo Zanoni @ 2012-04-21 20:51 UTC (permalink / raw)
  To: dri-devel; +Cc: Paulo Zanoni

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

Use unsigned int instead of int:
- modetest.c:90:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:98:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:118:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:286:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:303:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:694:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:1088: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:998:40: warning: unused parameter ‘fd’ [-Wunused-parameter]

We don't use the 'modeset' variable:
- modetest.c:1025:8: warning: variable ‘modeset’ set but not used [-Wunused-but-set-variable]

V2: rebase, clear some more warnings

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 tests/modetest/modetest.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Hi

I'm sending this patch series again. These 4 patches are independent
from the object properties patches, so once reviewed, it would be nice
if someone could push them.

Patch 1 had to be rebased and patch 3 is new.

Thanks,
Paulo


diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 223adc4..1b9ae18 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -71,7 +71,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;	\
@@ -272,7 +272,7 @@ static void dump_planes(void)
 {
 	drmModePlaneRes *plane_resources;
 	drmModePlane *ovr;
-	int i, j;
+	unsigned int i, j;
 
 	plane_resources = drmModeGetPlaneResources(fd);
 	if (!plane_resources) {
@@ -681,7 +681,8 @@ set_plane(struct kms_driver *kms, struct connector *c, struct plane *p)
 	uint32_t plane_id = 0;
 	struct kms_bo *plane_bo;
 	uint32_t plane_flags = 0, format;
-	int i, ret, crtc_x, crtc_y, crtc_w, crtc_h;
+	int ret, crtc_x, crtc_y, crtc_w, crtc_h;
+	unsigned int i;
 
 	/* find an unused plane which can be connected to our crtc */
 	plane_resources = drmModeGetPlaneResources(fd);
@@ -995,7 +996,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;
@@ -1022,8 +1023,8 @@ int main(int argc, char **argv)
 	int encoders = 0, connectors = 0, crtcs = 0, planes = 0, framebuffers = 0;
 	int test_vsync = 0;
 	char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "omapdrm" };
-	char *modeset = NULL;
-	int i, count = 0, plane_count = 0;
+	unsigned int i;
+	int count = 0, plane_count = 0;
 	struct connector con_args[2];
 	struct plane plane_args[2] = {0};
 	
@@ -1050,7 +1051,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,
@@ -1096,7 +1096,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;
 	}
-- 
1.7.9.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-03 11:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-21 20:51 [PATCH libdrm 1/4] modetest: fix some compiler warnings Paulo Zanoni
2012-04-21 20:51 ` [PATCH libdrm 2/4] modetest: fix drmModeGetConnector memory leak Paulo Zanoni
2012-04-21 20:51 ` [PATCH libdrm 3/4] modetest: call drmModeFreePlaneResources Paulo Zanoni
2012-04-21 20:51 ` [PATCH libdrm 4/4] modetest: print more about our properties Paulo Zanoni
2012-05-03 11:33   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox