Conform to C99 integer types format specifiers

Review and modify to conform to C99 integer types format specifiers.
Use arm-none-eabi toolchain to build successfully.

Change-Id: If855072a8f88886809309155ac6d031dcfcbc4b2
Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com>
Signed-off-by: Hsiangkai <hsiangkai@gmail.com>
Reviewed-on: http://openocd.zylin.com/1794
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
Hsiangkai Wang
2013-11-04 12:43:12 +08:00
committed by Spencer Oliver
parent ee019bf5f8
commit 94d64ccaeb
21 changed files with 784 additions and 556 deletions

View File

@@ -464,7 +464,7 @@ static int jlink_select_interface(int iface)
uint32_t iface_mask = buf_get_u32(usb_in_buffer, 0, 32);
if (!(iface_mask & (1<<iface))) {
LOG_ERROR("J-Link requesting to select unsupported interface (%x)", iface_mask);
LOG_ERROR("J-Link requesting to select unsupported interface (%" PRIx32 ")", iface_mask);
return ERROR_JTAG_DEVICE_ERROR;
}
@@ -746,7 +746,7 @@ static void jlink_config_kickstart_dump(struct command_context *ctx, struct jlin
if (!cfg)
return;
jlink_dump_printf(ctx, "Kickstart power on JTAG-pin 19: 0x%x",
jlink_dump_printf(ctx, "Kickstart power on JTAG-pin 19: 0x%" PRIx32,
cfg->kickstart_power_on_jtag_pin_19);
}
@@ -920,7 +920,7 @@ static int jlink_get_version_info(void)
LOG_INFO("J-Link hw version %i", (int)jlink_hw_version);
if (jlink_hw_type >= JLINK_HW_TYPE_MAX)
LOG_INFO("J-Link hw type uknown 0x%x", jlink_hw_type);
LOG_INFO("J-Link hw type uknown 0x%" PRIx32, jlink_hw_type);
else
LOG_INFO("J-Link hw type %s", jlink_hw_type_str[jlink_hw_type]);
}

View File

@@ -307,7 +307,7 @@ static int opendous_execute_queue(void)
break;
case JTAG_SLEEP:
DEBUG_JTAG_IO("sleep %i", cmd->cmd.sleep->us);
DEBUG_JTAG_IO("sleep %" PRIi32, cmd->cmd.sleep->us);
opendous_tap_execute();
jtag_sleep(cmd->cmd.sleep->us);
break;

View File

@@ -431,7 +431,7 @@ static int osbdm_add_statemove(
int skip_first)
{
int len = 0;
int tms;
int tms = 0;
tap_set_end_state(new_state);
if (tap_get_end_state() == TAP_RESET) {

View File

@@ -738,7 +738,7 @@ static int stlink_usb_idcode(void *handle, uint32_t *idcode)
*idcode = le_to_h_u32(h->databuf);
LOG_DEBUG("IDCODE: 0x%08X", *idcode);
LOG_DEBUG("IDCODE: 0x%08" PRIX32, *idcode);
return ERROR_OK;
}
@@ -1043,7 +1043,7 @@ static int stlink_usb_trace_enable(void *handle)
if (res == ERROR_OK) {
h->trace.enabled = true;
LOG_DEBUG("Tracing: recording at %uHz\n", trace_hz);
LOG_DEBUG("Tracing: recording at %" PRIu32 "Hz\n", trace_hz);
}
} else {
LOG_ERROR("Tracing is not supported by this version.");

View File

@@ -368,12 +368,12 @@ static int icdi_usb_query(void *handle)
char *separator;
int max_packet;
max_packet = strtoul(offset + 11, &separator, 16);
max_packet = strtol(offset + 11, &separator, 16);
if (!max_packet)
LOG_ERROR("invalid max packet, using defaults");
else
h->max_packet = max_packet;
LOG_DEBUG("max packet supported : %" PRIu32 " bytes", h->max_packet);
LOG_DEBUG("max packet supported : %i bytes", h->max_packet);
}
@@ -536,7 +536,7 @@ static int icdi_usb_read_mem_int(void *handle, uint32_t addr, uint32_t len, uint
struct icdi_usb_handle_s *h = handle;
char cmd[20];
snprintf(cmd, sizeof(cmd), "x%x,%x", addr, len);
snprintf(cmd, sizeof(cmd), "x%" PRIx32 ",%" PRIx32, addr, len);
result = icdi_send_cmd(handle, cmd);
if (result != ERROR_OK)
return result;
@@ -551,7 +551,7 @@ static int icdi_usb_read_mem_int(void *handle, uint32_t addr, uint32_t len, uint
/* unescape input */
int read_len = remote_unescape_input(h->read_buffer + 5, h->read_count - 8, (char *)buffer, len);
if (read_len != (int)len) {
LOG_ERROR("read more bytes than expected: actual 0x%" PRIx32 " expected 0x%" PRIx32, read_len, len);
LOG_ERROR("read more bytes than expected: actual 0x%x expected 0x%" PRIx32, read_len, len);
return ERROR_FAIL;
}
@@ -563,7 +563,7 @@ static int icdi_usb_write_mem_int(void *handle, uint32_t addr, uint32_t len, con
int result;
struct icdi_usb_handle_s *h = handle;
size_t cmd_len = snprintf(h->write_buffer, h->max_packet, PACKET_START "X%x,%x:", addr, len);
size_t cmd_len = snprintf(h->write_buffer, h->max_packet, PACKET_START "X%" PRIx32 ",%" PRIx32 ":", addr, len);
int out_len;
cmd_len += remote_escape_output((const char *)buffer, len, h->write_buffer + cmd_len,
@@ -571,7 +571,7 @@ static int icdi_usb_write_mem_int(void *handle, uint32_t addr, uint32_t len, con
if (out_len < (int)len) {
/* for now issue a error as we have no way of allocating a larger buffer */
LOG_ERROR("memory buffer too small: requires 0x%" PRIx32 " actual 0x%" PRIx32, out_len, len);
LOG_ERROR("memory buffer too small: requires 0x%x actual 0x%" PRIx32, out_len, len);
return ERROR_FAIL;
}