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.
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);
*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;
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)
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);
}
}
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)
*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);
}
}
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;
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;
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);
}