Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 07/13] intel: Fix Wsigned-compare warnings (soon to be enabled).
Date: Wed, 21 Dec 2011 10:09:37 -0800	[thread overview]
Message-ID: <1324490983-6975-8-git-send-email-eric@anholt.net> (raw)
In-Reply-To: <1324490983-6975-1-git-send-email-eric@anholt.net>

---
 intel/intel_decode.c |   55 +++++++++++++++++++++++++------------------------
 1 files changed, 28 insertions(+), 27 deletions(-)

diff --git a/intel/intel_decode.c b/intel/intel_decode.c
index e61d5ed..f7ce205 100644
--- a/intel/intel_decode.c
+++ b/intel/intel_decode.c
@@ -110,7 +110,7 @@ instr_out(uint32_t *data, uint32_t hw_offset, unsigned int index,
 }
 
 static int
-decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
+decode_mi(uint32_t *data, uint32_t count, uint32_t hw_offset, int *failures)
 {
 	unsigned int opcode, len = -1;
 	char *post_sync_op = "";
@@ -118,8 +118,8 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
 	struct {
 		uint32_t opcode;
 		int len_mask;
-		int min_len;
-		int max_len;
+		unsigned int min_len;
+		unsigned int max_len;
 		char *name;
 	} opcodes_mi[] = {
 		{ 0x08, 0, 1, 1, "MI_ARB_ON_OFF" },
@@ -235,10 +235,11 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
 	for (opcode = 0; opcode < sizeof(opcodes_mi) / sizeof(opcodes_mi[0]);
 	     opcode++) {
 		if ((data[0] & 0x1f800000) >> 23 == opcodes_mi[opcode].opcode) {
+			unsigned int i;
 
 			instr_out(data, hw_offset, 0, "%s\n",
 				  opcodes_mi[opcode].name);
-			for (int i = 1; i < len; i++) {
+			for (i = 1; i < len; i++) {
 				if (i >= count)
 					BUFFER_FAIL(count, len,
 						    opcodes_mi[opcode].name);
@@ -255,7 +256,7 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
 }
 
 static void
-decode_2d_br00(uint32_t *data, int count, uint32_t hw_offset, char *cmd)
+decode_2d_br00(uint32_t *data, uint32_t count, uint32_t hw_offset, char *cmd)
 {
 	instr_out(data, hw_offset, 0,
 		  "%s (rgb %sabled, alpha %sabled, src tile %d, dst tile %d)\n",
@@ -265,7 +266,7 @@ decode_2d_br00(uint32_t *data, int count, uint32_t hw_offset, char *cmd)
 		  (data[count] >> 15) & 1, (data[count] >> 11) & 1);
 }
 
-static void decode_2d_br01(uint32_t *data, int count, uint32_t hw_offset)
+static void decode_2d_br01(uint32_t *data, uint32_t count, uint32_t hw_offset)
 {
 	char *format;
 	switch ((data[count] >> 24) & 0x3) {
@@ -296,14 +297,14 @@ static void decode_2d_br01(uint32_t *data, int count, uint32_t hw_offset)
 }
 
 static int
-decode_2d(uint32_t *data, int count, uint32_t hw_offset, int *failures)
+decode_2d(uint32_t *data, uint32_t count, uint32_t hw_offset, int *failures)
 {
 	unsigned int opcode, len;
 
 	struct {
 		uint32_t opcode;
-		int min_len;
-		int max_len;
+		unsigned int min_len;
+		unsigned int max_len;
 		char *name;
 	} opcodes_2d[] = {
 		{ 0x40, 5, 5, "COLOR_BLT" },
@@ -482,7 +483,7 @@ decode_2d(uint32_t *data, int count, uint32_t hw_offset, int *failures)
 }
 
 static int
-decode_3d_1c(uint32_t *data, int count, uint32_t hw_offset, int *failures)
+decode_3d_1c(uint32_t *data, uint32_t count, uint32_t hw_offset, int *failures)
 {
 	uint32_t opcode;
 
@@ -1151,7 +1152,7 @@ static char *decode_sample_filter(uint32_t mode)
 }
 
 static int
-decode_3d_1d(uint32_t *data, int count,
+decode_3d_1d(uint32_t *data, uint32_t count,
 	     uint32_t hw_offset, uint32_t devid, int *failures)
 {
 	unsigned int len, i, c, idx, word, map, sampler, instr;
@@ -1161,8 +1162,8 @@ decode_3d_1d(uint32_t *data, int count,
 	struct {
 		uint32_t opcode;
 		int i830_only;
-		int min_len;
-		int max_len;
+		unsigned int min_len;
+		unsigned int max_len;
 		char *name;
 	} opcodes_3d_1d[] = {
 		{ 0x86, 0, 4, 4, "3DSTATE_CHROMA_KEY" },
@@ -2228,7 +2229,7 @@ decode_3d_1d(uint32_t *data, int count,
 }
 
 static int
-decode_3d_primitive(uint32_t *data, int count, uint32_t hw_offset,
+decode_3d_primitive(uint32_t *data, uint32_t count, uint32_t hw_offset,
 		    int *failures)
 {
 	char immediate = (data[0] & (1 << 23)) == 0;
@@ -2491,7 +2492,7 @@ out:
 }
 
 static int
-decode_3d(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid,
+decode_3d(uint32_t *data, uint32_t count, uint32_t hw_offset, uint32_t devid,
 	  int *failures)
 {
 	uint32_t opcode;
@@ -2499,8 +2500,8 @@ decode_3d(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid,
 
 	struct {
 		uint32_t opcode;
-		int min_len;
-		int max_len;
+		unsigned int min_len;
+		unsigned int max_len;
 		char *name;
 	} opcodes_3d[] = {
 		{ 0x06, 1, 1, "3DSTATE_ANTI_ALIASING" },
@@ -2677,7 +2678,7 @@ static const char *get_965_prim_type(uint32_t data)
 }
 
 static int
-i965_decode_urb_fence(uint32_t *data, uint32_t hw_offset, int len, int count,
+i965_decode_urb_fence(uint32_t *data, uint32_t hw_offset, int len, uint32_t count,
 		      int *failures)
 {
 	uint32_t vs_fence, clip_fence, gs_fence, sf_fence, vfe_fence, cs_fence;
@@ -2753,18 +2754,18 @@ state_max_out(uint32_t *data, uint32_t hw_offset, unsigned int index,
 }
 
 static int
-decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid,
+decode_3d_965(uint32_t *data, uint32_t count, uint32_t hw_offset, uint32_t devid,
 	      int *failures)
 {
 	uint32_t opcode;
 	unsigned int idx, len;
-	int i, sba_len;
+	unsigned int i, sba_len;
 	char *desc1 = NULL;
 
 	struct {
 		uint32_t opcode;
-		int min_len;
-		int max_len;
+		int unsigned min_len;
+		int unsigned max_len;
 		char *name;
 	} opcodes_3d[] = {
 		{ 0x6000, 3, 3, "URB_FENCE" },
@@ -3308,7 +3309,7 @@ decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid,
 
 	case 0x7a00:
 		if (IS_GEN6(devid) || IS_GEN7(devid)) {
-			int i;
+			unsigned int i;
 			len = (data[0] & 0xff) + 2;
 			if (len != 4 && len != 5)
 				fprintf(out, "Bad count in PIPE_CONTROL\n");
@@ -3462,7 +3463,7 @@ decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid,
 }
 
 static int
-decode_3d_i830(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid,
+decode_3d_i830(uint32_t *data, uint32_t count, uint32_t hw_offset, uint32_t devid,
 	       int *failures)
 {
 	unsigned int idx;
@@ -3470,8 +3471,8 @@ decode_3d_i830(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid,
 
 	struct {
 		uint32_t opcode;
-		int min_len;
-		int max_len;
+		unsigned int min_len;
+		unsigned int max_len;
 		char *name;
 	} opcodes_3d[] = {
 		{ 0x02, 1, 1, "3DSTATE_MODES_3" },
@@ -3589,7 +3590,7 @@ void
 drm_intel_decode(struct drm_intel_decode *ctx)
 {
 	int ret;
-	int index = 0;
+	unsigned int index = 0;
 	int failures = 0;
 	uint32_t *data;
 	uint32_t count, hw_offset;
-- 
1.7.7.3

  parent reply	other threads:[~2011-12-21 18:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21 18:09 Moving intel_decode.c to libdrm Eric Anholt
2011-12-21 18:09 ` [PATCH 01/13] intel: Import intel_decode.c from intel-gpu-tools Eric Anholt
2011-12-21 18:09 ` [PATCH 02/13] intel: Make intel_chipset handle devid directly Eric Anholt
2011-12-21 18:09 ` [PATCH 03/13] intel: intel: Add IS_GEN[567] macros Eric Anholt
2011-12-21 18:09 ` [PATCH 04/13] intel: Reformat intel_decode.c from intel-gpu-tools using Lindent Eric Anholt
2011-12-21 18:09 ` [PATCH 05/13] intel: Minor style tweaks after Lindent Eric Anholt
2011-12-21 18:09 ` [PATCH 06/13] intel: Get intel_decode.c minimally building Eric Anholt
2011-12-21 18:09 ` Eric Anholt [this message]
2011-12-21 18:09 ` [PATCH 08/13] intel: Fix a ton of signed vs unsigned and const char *warnings Eric Anholt
2011-12-21 18:09 ` [PATCH 09/13] intel: Add printflike warnings for instr_out Eric Anholt
2011-12-21 18:09 ` [PATCH 10/13] intel: Fix printf format warnings for intel_decode Eric Anholt
2011-12-21 18:09 ` [PATCH 11/13] intel: Remove c99ish variable declarations Eric Anholt
2011-12-21 18:09 ` [PATCH 12/13] intel: Turn on normal warnings for intel_decode.c build Eric Anholt
2011-12-21 18:09 ` [PATCH 13/13] intel: Disable unused decode_logic_op() Eric Anholt
2011-12-21 18:46 ` Moving intel_decode.c to libdrm Daniel Vetter
2011-12-21 20:00   ` Eugeni Dodonov

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=1324490983-6975-8-git-send-email-eric@anholt.net \
    --to=eric@anholt.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox