From 40d7e81c45d112522f021205f7f1b46f025b8984 Mon Sep 17 00:00:00 2001
From: duane <duane@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Date: Fri, 19 Jun 2009 23:15:58 +0000
Subject: printf() warning fixes due to uint32_t change-over

git-svn-id: svn://svn.berlios.de/openocd/trunk@2293 b42882b7-edfa-0310-969c-e2dbd0fdcd60
---
 src/jtag/arm-jtag-ew.c | 16 ++++++++--------
 src/jtag/core.c        | 15 +++++++++------
 src/jtag/ft2232.c      | 23 +++++++++++++++++------
 src/jtag/jlink.c       |  6 +++---
 src/jtag/presto.c      |  6 ++++--
 src/jtag/tcl.c         | 20 +++++++++++++-------
 6 files changed, 54 insertions(+), 32 deletions(-)

diff --git a/src/jtag/arm-jtag-ew.c b/src/jtag/arm-jtag-ew.c
index b951f61b..150cabf1 100644
--- a/src/jtag/arm-jtag-ew.c
+++ b/src/jtag/arm-jtag-ew.c
@@ -472,14 +472,14 @@ static int armjtagew_get_status(void)
 	if (result == 0)
 	{
 		unsigned int u_tg = buf_get_u32(usb_in_buffer, 0, 16);
-		LOG_INFO("U_tg = %d mV, U_aux = %d mV, U_tgpwr = %d mV, I_tgpwr = %d mA, D1 = %d, Target power %s %s\n", \
-			buf_get_u32(usb_in_buffer + 0, 0, 16), \
-			buf_get_u32(usb_in_buffer + 2, 0, 16), \
-			buf_get_u32(usb_in_buffer + 4, 0, 16), \
-			buf_get_u32(usb_in_buffer + 6, 0, 16), \
-			usb_in_buffer[9], \
-			usb_in_buffer[11] ? "OVERCURRENT" : "OK", \
-			usb_in_buffer[10] ? "enabled" : "disabled");
+		LOG_INFO("U_tg = %d mV, U_aux = %d mV, U_tgpwr = %d mV, I_tgpwr = %d mA, D1 = %d, Target power %s %s\n", 
+			 (int)(buf_get_u32(usb_in_buffer + 0, 0, 16)),
+			 (int)(buf_get_u32(usb_in_buffer + 2, 0, 16)),
+			 (int)(buf_get_u32(usb_in_buffer + 4, 0, 16)),
+			 (int)(buf_get_u32(usb_in_buffer + 6, 0, 16)),
+			 usb_in_buffer[9], 
+			 usb_in_buffer[11] ? "OVERCURRENT" : "OK", 
+			 usb_in_buffer[10] ? "enabled" : "disabled");
 
 		if (u_tg < 1500)
 		{
diff --git a/src/jtag/core.c b/src/jtag/core.c
index ed16bdbf..5bf7295e 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -862,10 +862,13 @@ static void jtag_examine_chain_display(enum log_levels level, const char *msg,
 		const char *name, uint32_t idcode)
 {
 	log_printf_lf(level, __FILE__, __LINE__, __FUNCTION__,
-			"JTAG tap: %s %16.16s: 0x%08x "
-			"(mfg: 0x%3.3x, part: 0x%4.4x, ver: 0x%1.1x)",
-		name, msg, idcode,
-		EXTRACT_MFG(idcode), EXTRACT_PART(idcode), EXTRACT_VER(idcode) );
+				  "JTAG tap: %s %16.16s: 0x%08x "
+				  "(mfg: 0x%3.3x, part: 0x%4.4x, ver: 0x%1.1x)",
+				  name, msg, 
+				  (unsigned int)idcode,
+				  (unsigned int)EXTRACT_MFG(idcode), 
+				  (unsigned int)EXTRACT_PART(idcode), 
+				  (unsigned int)EXTRACT_VER(idcode) );
 }
 
 static bool jtag_idcode_is_final(uint32_t idcode)
@@ -889,7 +892,7 @@ static void jtag_examine_chain_end(uint8_t *idcodes, unsigned count, unsigned ma
 		if (!triggered && jtag_idcode_is_final(idcode))
 			continue;
 		LOG_WARNING("Unexpected idcode after end of chain: %d 0x%08x",
-				count, idcode);
+					count, (unsigned int)idcode);
 		triggered = true;
 	}
 }
@@ -1100,7 +1103,7 @@ void jtag_tap_init(jtag_tap_t *tap)
 	LOG_DEBUG("Created Tap: %s @ abs position %d, "
 			"irlen %d, capture: 0x%x mask: 0x%x", tap->dotted_name,
 				tap->abs_chain_position, tap->ir_length,
-				tap->ir_capture_value, tap->ir_capture_mask);
+			  (unsigned int)(tap->ir_capture_value), (unsigned int)(tap->ir_capture_mask));
 	jtag_tap_add(tap);
 }
 
diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c
index 70c2dd31..c38d7d47 100644
--- a/src/jtag/ft2232.c
+++ b/src/jtag/ft2232.c
@@ -411,7 +411,9 @@ static int ft2232_read(uint8_t* buf, uint32_t size, uint32_t* bytes_read)
 
 	if (*bytes_read < size)
 	{
-		LOG_ERROR("couldn't read the requested number of bytes from FT2232 device (%i < %i)", *bytes_read, size);
+		LOG_ERROR("couldn't read the requested number of bytes from FT2232 device (%i < %i)", 
+			  (unsigned int)(*bytes_read), 
+			  (unsigned int)size);
 		return ERROR_JTAG_DEVICE_ERROR;
 	}
 
@@ -963,7 +965,8 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
 		LOG_ERROR("couldn't write MPSSE commands to FT2232");
 		exit(-1);
 	}
-	LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", ft2232_buffer_size, bytes_written);
+	LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", 
+		  ft2232_buffer_size, (int)bytes_written);
 	ft2232_buffer_size = 0;
 
 	/* add command for complete bytes */
@@ -1016,7 +1019,9 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
 			LOG_ERROR("couldn't write MPSSE commands to FT2232");
 			exit(-1);
 		}
-		LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", ft2232_buffer_size, bytes_written);
+		LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", 
+			  ft2232_buffer_size, 
+			  (int)bytes_written);
 		ft2232_buffer_size = 0;
 
 		if (type != SCAN_OUT)
@@ -1026,7 +1031,9 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
 				LOG_ERROR("couldn't read from FT2232");
 				exit(-1);
 			}
-			LOG_DEBUG("thisrun_read: %i, bytes_read: %i", thisrun_read, bytes_read);
+			LOG_DEBUG("thisrun_read: %i, bytes_read: %i", 
+				  thisrun_read, 
+				  (int)bytes_read);
 			receive_pointer += bytes_read;
 		}
 	}
@@ -1122,7 +1129,9 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
 		LOG_ERROR("couldn't write MPSSE commands to FT2232");
 		exit(-1);
 	}
-	LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", ft2232_buffer_size, bytes_written);
+	LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", 
+		  ft2232_buffer_size, 
+		  (int)bytes_written);
 	ft2232_buffer_size = 0;
 
 	if (type != SCAN_OUT)
@@ -1132,7 +1141,9 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
 			LOG_ERROR("couldn't read from FT2232");
 			exit(-1);
 		}
-		LOG_DEBUG("thisrun_read: %i, bytes_read: %i", thisrun_read, bytes_read);
+		LOG_DEBUG("thisrun_read: %i, bytes_read: %i", 
+			  thisrun_read, 
+			  (int)bytes_read);
 		receive_pointer += bytes_read;
 	}
 
diff --git a/src/jtag/jlink.c b/src/jtag/jlink.c
index 907207ce..283260ee 100644
--- a/src/jtag/jlink.c
+++ b/src/jtag/jlink.c
@@ -589,7 +589,7 @@ static int jlink_get_version_info(void)
 	}
 
 	jlink_caps = buf_get_u32(usb_in_buffer, 0, 32);
-	LOG_INFO("JLink caps 0x%x", jlink_caps);
+	LOG_INFO("JLink caps 0x%x", (unsigned)jlink_caps);
 
 	if (jlink_caps & (1 << EMU_CAP_GET_HW_VERSION))
 	{
@@ -608,7 +608,7 @@ static int jlink_get_version_info(void)
 		if (major_revision >= 5)
 			jlink_hw_jtag_version = 3;
 
-		LOG_INFO("JLink hw version %i", jlink_hw_version);
+		LOG_INFO("JLink hw version %i", (int)jlink_hw_version);
 	}
 
 	if (jlink_caps & (1 << EMU_CAP_GET_MAX_BLOCK_SIZE))
@@ -624,7 +624,7 @@ static int jlink_get_version_info(void)
 		}
 
 		jlink_max_size = buf_get_u32(usb_in_buffer, 0, 32);
-		LOG_INFO("JLink max mem block %i", jlink_max_size);
+		LOG_INFO("JLink max mem block %i", (int)jlink_max_size);
 	}
 
 	return ERROR_OK;
diff --git a/src/jtag/presto.c b/src/jtag/presto.c
index 385c93c0..1331f2af 100644
--- a/src/jtag/presto.c
+++ b/src/jtag/presto.c
@@ -150,7 +150,8 @@ static int presto_write(uint8_t *buf, uint32_t size)
 
 	if (ftbytes != size)
 	{
-		LOG_ERROR("couldn't write the requested number of bytes to PRESTO (%u < %u)", (uint32_t)ftbytes, size);
+		LOG_ERROR("couldn't write the requested number of bytes to PRESTO (%u < %u)", 
+			  (unsigned)ftbytes, (unsigned)size);
 		return ERROR_JTAG_DEVICE_ERROR;
 	}
 
@@ -192,7 +193,8 @@ static int presto_read(uint8_t* buf, uint32_t size)
 	if (ftbytes != size)
 	{
 		/* this is just a warning, there might have been timeout when detecting PRESTO, which is not fatal */
-		LOG_WARNING("couldn't read the requested number of bytes from PRESTO (%u < %u)", (uint32_t)ftbytes, size);
+		LOG_WARNING("couldn't read the requested number of bytes from PRESTO (%u < %u)", 
+			    (unsigned)ftbytes, (unsigned)size);
 		return ERROR_JTAG_DEVICE_ERROR;
 	}
 
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index 010b375f..44d652de 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -872,16 +872,16 @@ static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cm
 					  tap->abs_chain_position,
 					  tap->dotted_name,
 					  tap->enabled ? 'Y' : 'n',
-					  tap->idcode,
-					  (tap->expected_ids_cnt > 0 ? tap->expected_ids[0] : 0),
-					  tap->ir_length,
-					  expected,
-					  expected_mask,
-					  cur_instr);
+					  (unsigned int)(tap->idcode),
+					  (unsigned int)(tap->expected_ids_cnt > 0 ? tap->expected_ids[0] : 0),
+					  (unsigned int)(tap->ir_length),
+					  (unsigned int)(expected),
+					  (unsigned int)(expected_mask),
+					  (unsigned int)(cur_instr));
 
 		for (ii = 1; ii < tap->expected_ids_cnt; ii++) {
 			command_print(cmd_ctx, "   |                    |         |            | 0x%08x |      |      |      |         ",
-						  tap->expected_ids[ii]);
+						  (unsigned int)(tap->expected_ids[ii]));
 		}
 
 		tap = tap->next_tap;
@@ -1503,3 +1503,9 @@ static int handle_tms_sequence_command(struct command_context_s *cmd_ctx, char *
 	return ERROR_OK;
 }
 
+/*
+ * Local Variables: 
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */
-- 
cgit v1.2.3