From 7533926d69875da66c5dc45940f67cb5d659738e Mon Sep 17 00:00:00 2001 From: Andre Date: Sun, 5 Mar 2006 13:14:09 +0100 Subject: [PATCH] use %zd instead of %d for size_t As of version 2.1 of glibc there is the %z modifier, so use it. This avoids many warnings of the type warning: int format, different type arg on x86_64. --- audiod.c | 6 +++--- compress.c | 2 +- filter.c | 6 +++--- filter_chain.c | 4 ++-- http_recv.c | 2 +- recv.c | 4 ++-- wav.c | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/audiod.c b/audiod.c index 552577d5..eab44b4c 100644 --- a/audiod.c +++ b/audiod.c @@ -987,16 +987,16 @@ static int write_audio_data(int slot_num) buf = &rn->buf; len = &rn->loaded; } - PARA_DEBUG_LOG("writing %p (%d bytes)\n", *buf, *len); + PARA_DEBUG_LOG("writing %p (%zd bytes)\n", *buf, *len); rv = write(s->write_fd, *buf, *len); - PARA_DEBUG_LOG("wrote %d/%d\n", rv, *len); + PARA_DEBUG_LOG("wrote %d/%zd\n", rv, *len); if (rv < 0) { PARA_WARNING_LOG("write error in slot %d (fd %d): %s\n", slot_num, s->write_fd, strerror(errno)); *len = 0; s->fci->error = E_WRITE_AUDIO_DATA; } else if (rv != *len) { - PARA_DEBUG_LOG("partial %s write (%i/%i) for slot %d\n", + PARA_DEBUG_LOG("partial %s write (%i/%zd) for slot %d\n", audio_formats[s->format], rv, *len, slot_num); *len -= rv; memmove(*buf, *buf + rv, *len); diff --git a/compress.c b/compress.c index a4d881f5..bad4ada4 100644 --- a/compress.c +++ b/compress.c @@ -124,7 +124,7 @@ static ssize_t compress(char *inbuf, size_t inbuf_len, struct filter_node *fn) *op++ = sample; } pcd->pn = (pcd->pn + 1) % pcd->conf->buckets_arg; - PARA_DEBUG_LOG("bucket: %03i, input len: %i, length: %i, peak: %05i, " + PARA_DEBUG_LOG("bucket: %03i, input len: %zd, length: %zd, peak: %05i, " "current gain: %03i, clipped: %d\n", pcd->pn, inbuf_len, length, peak, pcd->current_gain, pcd->clip); fn->loaded = length; diff --git a/filter.c b/filter.c index 04997cf2..37c1c430 100644 --- a/filter.c +++ b/filter.c @@ -141,7 +141,7 @@ int main(int argc, char *argv[]) again: if (*il < INBUF_SIZE && !eof) { ret = read(STDIN_FILENO, ib + *il, INBUF_SIZE - *il); - PARA_DEBUG_LOG("read %d/%d\n", ret, INBUF_SIZE - *il); + PARA_DEBUG_LOG("read %d/%zd\n", ret, INBUF_SIZE - *il); if (ret < 0) goto out; if (!ret) @@ -154,12 +154,12 @@ again: converted = ret; if (*ol) { ret = write(STDOUT_FILENO, ob, *ol); - PARA_DEBUG_LOG("wrote %d/%d\n", ret, *ol); + PARA_DEBUG_LOG("wrote %d/%zd\n", ret, *ol); if (ret <= 0) goto out; *ol -= ret; if (*ol) { - PARA_NOTICE_LOG("short write: %d bytes left\n", *ol); + PARA_NOTICE_LOG("short write: %zd bytes left\n", *ol); memmove(ob, ob + ret, *ol); } } diff --git a/filter_chain.c b/filter_chain.c index d11f169e..6265f19c 100644 --- a/filter_chain.c +++ b/filter_chain.c @@ -123,7 +123,7 @@ again: int ret; if (*loaded && fn->loaded < fn->bufsize) { size_t old_fn_loaded = fn->loaded; - PARA_DEBUG_LOG("fc %p loaded: %d, calling %s convert\n", fci, *loaded, fn->filter->name); + PARA_DEBUG_LOG("fc %p loaded: %zd, calling %s convert\n", fci, *loaded, fn->filter->name); ret = fn->filter->convert(ib, *loaded, fn); if (ret < 0) { if (!fci->error) @@ -134,7 +134,7 @@ again: *loaded -= ret; conv += ret; if (*loaded && ret) { - PARA_DEBUG_LOG("moving %d bytes in input buffer for %s filter\n", + PARA_DEBUG_LOG("moving %zd bytes in input buffer for %s filter\n", *loaded, fn->filter->name); memmove(ib, ib + ret, *loaded); } diff --git a/http_recv.c b/http_recv.c index 2e3a11b3..04f87213 100644 --- a/http_recv.c +++ b/http_recv.c @@ -139,7 +139,7 @@ static int http_post_select(struct receiver_node *rn, int select_ret, } ret = recv_bin_buffer(phd->fd, rn->buf + rn->loaded, BUFSIZE - rn->loaded); if (ret <= 0) { - PARA_NOTICE_LOG("recv returned %d/%d\n", ret, BUFSIZE - rn->loaded); + PARA_NOTICE_LOG("recv returned %d/%zd\n", ret, BUFSIZE - rn->loaded); return ret < 0? -E_HTTP_RECV_BUF : 0; } rn->loaded += ret; diff --git a/recv.c b/recv.c index abd0419f..31c18a31 100644 --- a/recv.c +++ b/recv.c @@ -104,13 +104,13 @@ recv: goto recv; } ret = write(STDOUT_FILENO, rn.buf, rn.loaded); - PARA_DEBUG_LOG("wrote %d/%d\n", ret, rn.loaded); + PARA_DEBUG_LOG("wrote %d/%zd\n", ret, rn.loaded); if (ret < 0) { ret = -E_WRITE_STDOUT; goto out; } if (ret != rn.loaded) { - PARA_INFO_LOG("short write %d/%d\n", ret, rn.loaded); + PARA_INFO_LOG("short write %d/%zd\n", ret, rn.loaded); memmove(rn.buf, rn.buf + ret, rn.loaded - ret); } rn.loaded -= ret; diff --git a/wav.c b/wav.c index 01ac4402..879b1887 100644 --- a/wav.c +++ b/wav.c @@ -95,7 +95,7 @@ static void wav_open(struct filter_node *fn) fn->private_data = para_malloc(sizeof(int)); bof = fn->private_data; *bof = 1; - PARA_DEBUG_LOG("wav filter node: %p, output buffer: %p, loaded: %d\n", + PARA_DEBUG_LOG("wav filter node: %p, output buffer: %p, loaded: %zd\n", fn, fn->buf, fn->loaded); } -- 2.39.5