From: Pierre Riteau <Pierre.Riteau@irisa.fr>
To: qemu-devel@nongnu.org
Cc: Pierre Riteau <Pierre.Riteau@irisa.fr>
Subject: [Qemu-devel] [PATCH] Fix compilation warnings when DEBUG_BUFFERED_FILE is defined
Date: Tue, 1 Sep 2009 11:57:20 +0200 [thread overview]
Message-ID: <1251799040-23567-1-git-send-email-Pierre.Riteau@irisa.fr> (raw)
gcc 4.3.2 throws warnings when DEBUG_BUFFERED_FILE is defined, because
we are using the wrong format specifiers to print size_t/ssize_t values.
---
buffered_file.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/buffered_file.c b/buffered_file.c
index 63de17d..56b4418 100644
--- a/buffered_file.c
+++ b/buffered_file.c
@@ -52,7 +52,7 @@ static void buffered_append(QEMUFileBuffered *s,
if (size > (s->buffer_capacity - s->buffer_size)) {
void *tmp;
- dprintf("increasing buffer capacity from %ld by %ld\n",
+ dprintf("increasing buffer capacity from %zu by %zu\n",
s->buffer_capacity, size + 1024);
s->buffer_capacity += size + 1024;
@@ -79,7 +79,7 @@ static void buffered_flush(QEMUFileBuffered *s)
return;
}
- dprintf("flushing %ld byte(s) of data\n", s->buffer_size);
+ dprintf("flushing %zu byte(s) of data\n", s->buffer_size);
while (offset < s->buffer_size) {
ssize_t ret;
@@ -93,16 +93,16 @@ static void buffered_flush(QEMUFileBuffered *s)
}
if (ret <= 0) {
- dprintf("error flushing data, %ld\n", ret);
+ dprintf("error flushing data, %zd\n", ret);
s->has_error = 1;
break;
} else {
- dprintf("flushed %ld byte(s)\n", ret);
+ dprintf("flushed %zd byte(s)\n", ret);
offset += ret;
}
}
- dprintf("flushed %ld of %ld byte(s)\n", offset, s->buffer_size);
+ dprintf("flushed %zu of %zu byte(s)\n", offset, s->buffer_size);
memmove(s->buffer, s->buffer + offset, s->buffer_size - offset);
s->buffer_size -= offset;
}
@@ -145,7 +145,7 @@ static int buffered_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, in
break;
}
- dprintf("put %ld byte(s)\n", ret);
+ dprintf("put %zd byte(s)\n", ret);
offset += ret;
s->bytes_xfer += ret;
}
--
1.6.3.3
reply other threads:[~2009-09-01 9:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1251799040-23567-1-git-send-email-Pierre.Riteau@irisa.fr \
--to=pierre.riteau@irisa.fr \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).