All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH xf86-video-intel 20/21] tools: Get rid of -Wno-sign-compare
Date: Thu, 19 Sep 2019 19:31:12 +0300	[thread overview]
Message-ID: <20190919163113.17402-21-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Fix the sign comparison warnings by changing some types, and
using a few casts.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tools/backlight_helper.c |  2 +-
 tools/meson.build        |  2 --
 tools/virtual.c          | 18 +++++++++---------
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/tools/backlight_helper.c b/tools/backlight_helper.c
index aadb8fac92ba..65151a534009 100644
--- a/tools/backlight_helper.c
+++ b/tools/backlight_helper.c
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
 
 	if (snprintf(buf, sizeof(buf),
 		     "/sys/class/backlight/%s/brightness",
-		     argv[1]) >= sizeof(buf))
+		     argv[1]) >= (int)sizeof(buf))
 		die("Invalid interface '%s': name too long\n", argv[1]);
 
 	fd = open(buf, O_RDWR);
diff --git a/tools/meson.build b/tools/meson.build
index b4621abb3c7c..3df33385be3b 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -17,7 +17,6 @@ if with_tools
 	     ],
 	     c_args : [
 	       '-Wno-unused-parameter',
-	       '-Wno-sign-compare',
 	     ],
 	     install : true)
 
@@ -81,7 +80,6 @@ if with_backlight_helper
 	     install_mode : [ 'rws--x--x', 'root', 'root' ],
 	     c_args : [
 	       '-DMAJOR_IN_SYSMACROS',
-	       '-Wno-sign-compare',
 	     ],
 	     install : true)
 
diff --git a/tools/virtual.c b/tools/virtual.c
index fc8db2b9f2e2..010a3aab7cf3 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -121,7 +121,7 @@ struct display {
 	int cursor_y;
 	int cursor_moved;
 	int cursor_visible;
-	int cursor;
+	Cursor cursor;
 
 	int flush;
 	int send;
@@ -148,7 +148,7 @@ struct output {
 	Pixmap pixmap;
 	GC gc;
 
-	long serial;
+	unsigned long serial;
 	int use_shm;
 	int use_shm_pixmap;
 	XShmSegmentInfo shm;
@@ -166,7 +166,7 @@ struct clone {
 	struct clone *active;
 
 	struct output src, dst;
-	long timestamp;
+	Time timestamp;
 
 	XShmSegmentInfo shm;
 	XImage image;
@@ -194,8 +194,8 @@ struct context {
 
 	int timer_active;
 
-	long timestamp;
-	long configTimestamp;
+	Time timestamp;
+	Time configTimestamp;
 
 	Atom singleton;
 	char command[1024];
@@ -597,7 +597,7 @@ static int mode_equal(const XRRModeInfo *a, const XRRModeInfo *b)
 		a->modeFlags == b->modeFlags);
 }
 
-static XRRModeInfo *lookup_mode(XRRScreenResources *res, int id)
+static XRRModeInfo *lookup_mode(XRRScreenResources *res, RRMode id)
 {
 	int i;
 
@@ -3055,7 +3055,7 @@ static int first_display_send_command(struct context *ctx, int timeout,
 	va_start(va, format);
 	len = vsnprintf(buf+4, sizeof(buf)-4, format, va)+5;
 	va_end(va);
-	assert(len < sizeof(buf));
+	assert(len < (int)sizeof(buf));
 
 	DBG(X11, ("%s: send command '%s'\n", DisplayString(display->dpy), buf));
 
@@ -3063,7 +3063,7 @@ static int first_display_send_command(struct context *ctx, int timeout,
 	while (len) {
 		XClientMessageEvent msg;
 		int n = len;
-		if (n > sizeof(msg.data.b))
+		if (n > (int)sizeof(msg.data.b))
 			n = sizeof(msg.data.b);
 		len -= n;
 
@@ -3113,7 +3113,7 @@ static void first_display_handle_command(struct context *ctx,
 	for (len = 0; len < 20 && msg[len]; len++)
 		;
 
-	if (ctx->command_continuation + len > sizeof(ctx->command)) {
+	if (ctx->command_continuation + len > (int)sizeof(ctx->command)) {
 		ctx->command_continuation = 0;
 		return;
 	}
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-09-19 16:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 01/21] sna: Use -Wno-clobbered Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 02/21] sna: Shut up more compiler warns Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 03/21] sna: undef FontSetPrivate() before redefining it Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 04/21] sna: Replace fall through comments with standard form Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 05/21] sna: Annotate more fall throughs Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 06/21] sna: Add sna_br13_color_depth() Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 07/21] sna/fb: Eliminate implicit fallthrough Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 08/21] uxa: Use named initializers Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 09/21] Avoid missing initializer warning Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 10/21] sna: Use named initializers Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 11/21] sna: Increase the size of the path name buffer a bit Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 12/21] sna: Use memcmp() to avoid strict aliasing warns Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 13/21] sna: Avoid strict aliasing violations with glyphinfo Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 14/21] sna/fb: Use memcpy() to avoid strict aliasing violations Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 15/21] xvmc: Eliminate " Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 16/21] sna/fb: Initialize xoff/yoff Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 17/21] sna: Use -Wno-maybe-uninitialized Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 18/21] sna: Get rid of -Wno-shift-negative-value Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 19/21] uxa: " Ville Syrjala
2019-09-19 16:31 ` Ville Syrjala [this message]
2019-09-19 16:31 ` [PATCH xf86-video-intel 21/21] sna: Fix compiler warnings due to DrawablePtr vs. PixmapPtr Ville Syrjala
2019-09-27 19:41 ` [PATCH xf86-video-intel 00/21] Compiler warn elimination Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190919163113.17402-21-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.