This is an automated email from Gerrit.
Evan Hunter ([email protected]) just uploaded a new patch set to Gerrit,
which you can find at http://openocd.zylin.com/530
-- gerrit
commit 9bb35743ba2a50acb9241cac9ee2a2ea4d179d8c
Author: unknown <ehunter@LTSYDEHUNTER.(none)>
Date: Mon Mar 19 07:03:06 2012 +1100
Fix printf format errors in MinGW 32-bit
Change-Id: I0e86bd333c21a318af109f876917ea65ee550d1c
Signed-off-by: Evan Hunter <[email protected]>
diff --git a/src/helper/ioutil.c b/src/helper/ioutil.c
index 684950d..2e6873b 100644
--- a/src/helper/ioutil.c
+++ b/src/helper/ioutil.c
@@ -219,7 +219,7 @@ COMMAND_HANDLER(handle_cp_command)
if (retval != ERROR_OK)
break;
- command_print(CMD_CTX, "%zu", len - pos);
+ command_print(CMD_CTX, "%" PRIzu, len - pos);
pos += chunk;
diff --git a/src/helper/log.h b/src/helper/log.h
index e161a6e..453d2a8 100644
--- a/src/helper/log.h
+++ b/src/helper/log.h
@@ -34,8 +34,22 @@
*/
#if (defined(IS_MINGW) && (((__GNUC__ << 16) + __GNUC_MINOR__) >= 0x00040004))
#define PRINTF_ATTRIBUTE_FORMAT gnu_printf
+#define PRIzi "zi"
+#define PRIzu "zu"
+#define PRIzx "zx"
+#define PRIzd "zd"
+#undef PRIx64
+#define PRIx64 "llx"
+#undef PRId64
+#define PRId64 "lld"
+#undef PRIu64
+#define PRIu64 "llu"
#else
#define PRINTF_ATTRIBUTE_FORMAT printf
+#define PRIzi "Ii"
+#define PRIzu "Iu"
+#define PRIzx "Ix"
+#define PRIzd "Id"
#endif
/* logging priorities
diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index e249ff4..80c6aa1 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -685,7 +685,7 @@ struct current_thread *add_current_thread(struct
current_thread *currents,
struct threads *liste_del_task(struct threads *task_list, struct threads **t,
struct threads *prev)
{
- LOG_INFO("del task %" PRId64, (*t)->threadid);
+ LOG_INFO("del task %lld", (*t)->threadid);
prev->next = (*t)->next;
if (prev == task_list)
diff --git a/src/target/image.c b/src/target/image.c
index 4a4a7cc..a1d1bcd 100644
--- a/src/target/image.c
+++ b/src/target/image.c
@@ -480,7 +480,7 @@ static int image_elf_read_section(struct image *image,
if (offset < field32(elf, segment->p_filesz)) {
/* maximal size present in file for the current segment */
read_size = MIN(size, field32(elf, segment->p_filesz) - offset);
- LOG_DEBUG("read elf: size = 0x%zu at 0x%" PRIx32 "", read_size,
+ LOG_DEBUG("read elf: size = 0x%" PRIzu " at 0x%" PRIx32 "",
read_size,
field32(elf, segment->p_offset) + offset);
/* read initialized area of the segment */
retval = fileio_seek(&elf->fileio, field32(elf,
segment->p_offset) + offset);
diff --git a/src/target/oocd_trace.c b/src/target/oocd_trace.c
index 240f867..858912e 100644
--- a/src/target/oocd_trace.c
+++ b/src/target/oocd_trace.c
@@ -84,7 +84,7 @@ static int oocd_trace_read_memory(struct oocd_trace
*oocd_trace, uint8_t *data,
bytes_read = read(oocd_trace->tty_fd,
((uint8_t *)data) + (size * 16) -
bytes_to_read, bytes_to_read);
if (bytes_read < 0)
- LOG_DEBUG("read() returned %zi (%s)", bytes_read,
strerror(errno));
+ LOG_DEBUG("read() returned %" PRIzi " (%s)",
bytes_read, strerror(errno));
else
bytes_to_read -= bytes_read;
}
@@ -133,7 +133,7 @@ static int oocd_trace_init(struct etm_context *etm_ctx)
do {
bytes_read = read(oocd_trace->tty_fd, trash, sizeof(trash));
if (bytes_read)
- LOG_DEBUG("%zi bytes read", bytes_read);
+ LOG_DEBUG("%" PRIzi " bytes read", bytes_read);
} while (bytes_read > 0);
return ERROR_OK;
diff --git a/src/target/target.c b/src/target/target.c
index 51518e6..f06bdf8 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -3323,7 +3323,7 @@ static void writeData(FILE *f, const void *data, size_t
len)
{
size_t written = fwrite(data, 1, len, f);
if (written != len)
- LOG_ERROR("failed to write %zu bytes: %s", len,
strerror(errno));
+ LOG_ERROR("failed to write %" PRIzu " bytes: %s", len,
strerror(errno));
}
static void writeLong(FILE *f, int l)
--
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel