From patchwork Thu Sep 19 16:31:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 11152921 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1C0513BD for ; Thu, 19 Sep 2019 16:32:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA118218AF for ; Thu, 19 Sep 2019 16:32:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA118218AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 088A56F822; Thu, 19 Sep 2019 16:32:18 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35AD96F822 for ; Thu, 19 Sep 2019 16:32:15 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 09:32:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,524,1559545200"; d="scan'208";a="217356984" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga002.fm.intel.com with SMTP; 19 Sep 2019 09:32:13 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 19:32:12 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Sep 2019 19:31:12 +0300 Message-Id: <20190919163113.17402-21-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com> References: <20190919163113.17402-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH xf86-video-intel 20/21] tools: Get rid of -Wno-sign-compare X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä Fix the sign comparison warnings by changing some types, and using a few casts. Signed-off-by: Ville Syrjälä --- 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; }