]> git.tue.mpg.de Git - paraslash.git/commitdiff
use %zd instead of %d for size_t
authorAndre <maan@p133.(none)>
Sun, 5 Mar 2006 12:14:09 +0000 (13:14 +0100)
committerAndre <maan@p133.(none)>
Sun, 5 Mar 2006 12:14:09 +0000 (13:14 +0100)
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
compress.c
filter.c
filter_chain.c
http_recv.c
recv.c
wav.c

index 552577d538d4815f90e79b76c572a7fc28439fb9..eab44b4c936123eeaf687a5847adbb043645fcd7 100644 (file)
--- 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);
index a4d881f5afedb6057761f2aabcf789db8b4815e1..bad4ada4c6a78f712a01bd8a635ef2328b0a3115 100644 (file)
@@ -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;
index 04997cf29e84c01a7382339271754266028187e2..37c1c4305e7c82b8140bc4791046f777e9e88662 100644 (file)
--- 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);
                }
        }
index d11f169ea1486f4284a09a00b9eafd8647e35698..6265f19c931dc26b53a76eecfd887164961c928d 100644 (file)
@@ -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);
                        }
index 2e3a11b3ee0a1d667b54d06aff3fc78dd51c42e6..04f872133b1d5d8844691a2ef29caf07ce97f2f5 100644 (file)
@@ -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 abd0419f6f99bb2529982beeecf0d813061b5fd6..31c18a31eab3c8c7d79b50f5d59840bfcf0e9ece 100644 (file)
--- 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 01ac440239f1e4815a63365e098616d209831924..879b1887b069b43b05101ea52e602a4c9c12add3 100644 (file)
--- 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);
 }