PARA_DEBUG_LOG("found stsz@%d\n", i);
i += 8;
sample_size = aac_read_int32(buf + i);
- PARA_DEBUG_LOG("sample size: %d\n", sample_size);
+ PARA_DEBUG_LOG("sample size: %u\n", sample_size);
i += 4;
sample_count = aac_read_int32(buf + i);
i += 4;
- PARA_DEBUG_LOG("sample count: %d\n", sample_count);
+ PARA_DEBUG_LOG("sample count: %u\n", sample_count);
*skip = i;
return sample_count;
}
}
padd->sample_rate = rate;
padd->channels = channels;
- PARA_INFO_LOG("rate: %u, channels: %d\n",
+ PARA_INFO_LOG("rate: %u, channels: %u\n",
padd->sample_rate, padd->channels);
padd->initialized = 1;
}
goto success;
}
PARA_ERROR_LOG("%s\n", NeAACDecGetErrorMessage(err));
- PARA_ERROR_LOG("consumed: %zu + %zd + %lu\n",
+ PARA_ERROR_LOG("consumed: %zu + %zu + %lu\n",
padd->consumed_total, consumed,
padd->frame_info.bytesconsumed);
if (consumed < len)
inet_pton(AF_INET, addr, &ai->addr);
ai->netmask = netmask;
- PARA_INFO_LOG("adding %s/%i to access list\n", addr, ai->netmask);
+ PARA_INFO_LOG("adding %s/%u to access list\n", addr, ai->netmask);
para_list_add(&ai->node, acl);
}
if (v4_addr_match(to_delete.s_addr, ai->addr.s_addr,
PARA_MIN(netmask, ai->netmask))) {
- PARA_NOTICE_LOG("removing %s/%i from access list\n",
+ PARA_NOTICE_LOG("removing %s/%u from access list\n",
addr, ai->netmask);
list_del(&ai->node);
free(ai);
char *ret = NULL;
list_for_each_entry_safe(ai, tmp_ai, acl, node) {
- char *tmp = make_message("%s%s/%d ", ret? ret : "",
+ char *tmp = make_message("%s%s/%u ", ret? ret : "",
inet_ntoa(ai->addr), ai->netmask);
free(ret);
ret = tmp;
afh_get_chunk(pard->first_chunk, afhi, pard->map, &start, &size);
afh_get_chunk(pard->last_chunk, afhi, pard->map, &end, &size);
end += size;
- PARA_INFO_LOG("adding %zu bytes\n", end - start);
+ PARA_INFO_LOG("adding %td bytes\n", end - start);
btr_add_output_dont_free(start, end - start, btrn);
ret = -E_RECV_EOF;
goto out;
int i, ret;
get_database_dir();
- PARA_NOTICE_LOG("opening %u osl tables in %s\n", NUM_AFS_TABLES,
+ PARA_NOTICE_LOG("opening %d osl tables in %s\n", NUM_AFS_TABLES,
database_dir);
for (i = 0; i < NUM_AFS_TABLES; i++) {
ret = afs_tables[i].open(database_dir);
continue;
ret = t->event_handler(event, pb, data);
if (ret < 0) {
- PARA_CRIT_LOG("table %s, event %d: %s\n", t->name,
+ PARA_CRIT_LOG("table %s, event %u: %s\n", t->name,
event, para_strerror(-ret));
return ret;
}
if (!hours) { /* m:ss or mm:ss */
max_width = opts->mode == LS_MODE_LONG?
opts->widths.duration_width : 4;
- sprintf(buf, "%*u:%02u", max_width - 3, mins, seconds % 60);
+ sprintf(buf, "%*u:%02d", max_width - 3, mins, seconds % 60);
} else { /* more than one hour => h:mm:ss, hh:mm:ss, hhh:mm:ss, ... */
max_width = opts->mode == LS_MODE_LONG?
opts->widths.duration_width : 7;
- sprintf(buf, "%*u:%02u:%02u", max_width - 6, hours, mins,
+ sprintf(buf, "%*u:%02u:%02d", max_width - 6, hours, mins,
seconds % 60);
}
}
para_printf(b,
"%s " /* attributes */
"%*u " /* amp */
- "%*d " /* image_id */
- "%*d " /* lyrics_id */
- "%*d " /* bitrate */
+ "%*u " /* image_id */
+ "%*u " /* lyrics_id */
+ "%*u " /* bitrate */
"%*s " /* audio format */
- "%*d " /* frequency */
- "%d " /* channels */
+ "%*u " /* frequency */
+ "%u " /* channels */
"%s " /* duration */
- "%*d " /* num_played */
+ "%*u " /* num_played */
"%s " /* last_played */
"%s\n", /* path */
att_buf,
WRITE_STATUS_ITEM(b, SI_SECONDS_TOTAL, "%" PRIu32 "\n",
afhi->seconds_total);
WRITE_STATUS_ITEM(b, SI_LAST_PLAYED, "%s\n", last_played_time);
- WRITE_STATUS_ITEM(b, SI_NUM_PLAYED, "%d\n", afsi->num_played);
+ WRITE_STATUS_ITEM(b, SI_NUM_PLAYED, "%u\n", afsi->num_played);
WRITE_STATUS_ITEM(b, SI_AMPLIFICATION, "%u\n", afsi->amp);
WRITE_STATUS_ITEM(b, SI_CHUNK_TIME, "%lu\n", tv2ms(&afhi->chunk_tv));
WRITE_STATUS_ITEM(b, SI_NUM_CHUNKS, "%" PRIu32 "\n",
if (ret >= 0) {
unsigned num;
osl_get_num_rows(audio_file_table, &num);
- PARA_INFO_LOG("audio file table contains %d files\n", num);
+ PARA_INFO_LOG("audio file table contains %u files\n", num);
return ret;
}
PARA_NOTICE_LOG("failed to open audio file table\n");
snd_mixer_selem_id_set_name(sid, mixer_channel);
h->elem = snd_mixer_find_selem(h->mixer, sid);
if (!h->elem) {
- PARA_NOTICE_LOG("unable to find simple control '%s',%i\n",
+ PARA_NOTICE_LOG("unable to find simple control '%s',%u\n",
snd_mixer_selem_id_get_name(sid),
snd_mixer_selem_id_get_index(sid));
ret = -E_BAD_CHANNEL;
get_btr_sample_format(btrn, &val);
pad->sample_format = get_alsa_pcm_format(val);
- PARA_INFO_LOG("%d channel(s), %dHz\n", pad->channels,
+ PARA_INFO_LOG("%u channel(s), %uHz\n", pad->channels,
pad->sample_rate);
ret = alsa_init(pad, wn->conf);
if (ret < 0) {
if (count > 5) {
int s = tv_diff(&diff, &stat_task->sa_time_diff, &tmp);
if (tv_diff(&max_deviation, &tmp, NULL) < 0)
- PARA_WARNING_LOG("time diff jump: %lims\n",
+ PARA_WARNING_LOG("time diff jump: %lums\n",
s * tv2ms(&tmp));
}
count++;
if (st->clock_diff_count) { /* get status only one time */
char *argv[] = {"audiod", "--", "stat", "-p", "-n=1", NULL};
int argc = 5;
- PARA_INFO_LOG("clock diff count: %d\n", st->clock_diff_count);
+ PARA_INFO_LOG("clock diff count: %u\n", st->clock_diff_count);
st->clock_diff_count--;
client_open(argc, argv, &st->ct, NULL, NULL, st->btrn, s);
set_stat_task_restart_barrier(2);
if (pmd.num_matches == 0)
ret = -E_NO_MATCH;
else {
- para_printf(&aca->pbout, "removed %d blob(s)\n",
+ para_printf(&aca->pbout, "removed %u blob(s)\n",
pmd.num_matches);
ret = afs_event(BLOB_REMOVE, NULL, table);
}
else
cwc->sample_format = (a[3] == 'F')?
SF_S16_LE : SF_S16_BE;
- PARA_NOTICE_LOG("%dHz, %s, %s\n", cwc->sample_rate,
+ PARA_NOTICE_LOG("%uHz, %s, %s\n", cwc->sample_rate,
cwc->channels == 1? "mono" : "stereo",
sample_formats[cwc->sample_format]);
btr_consume(btrn, WAV_HEADER_LEN);
#define ITEM(x) "0004 %02x:\n"
EMPTY_STATUS_ITEMS
#undef ITEM
- #define ITEM(x) , SI_ ## x
+ #define ITEM(x) , (unsigned) SI_ ## x
EMPTY_STATUS_ITEMS
#undef ITEM
);
i = 100;
PARA_INFO_LOG("jumping to %lu%%\n", i);
mmd->repos_request = (mmd->afd.afhi.chunks_total * i + 50) / 100;
- PARA_INFO_LOG("sent: %lu, offset before jmp: %lu\n",
+ PARA_INFO_LOG("sent: %lu, offset before jmp: %li\n",
mmd->chunks_sent, mmd->offset);
mmd->new_vss_status_flags |= VSS_REPOS;
mmd->new_vss_status_flags &= ~VSS_NEXT;
numbytes = 256;
get_random_bytes_or_die((unsigned char *)buf, numbytes);
}
- PARA_DEBUG_LOG("sending %u byte challenge + session key (%zu bytes)\n",
+ PARA_DEBUG_LOG("sending %d byte challenge + session key (%zu bytes)\n",
CHALLENGE_SIZE, numbytes);
ret = send_sb(&cc->scc, buf, numbytes, SBD_CHALLENGE, false);
buf = NULL;
return -E_SSH_KEY_HEADER;
if (rlen < strlen(KEY_TYPE_TXT))
return -E_SSH_KEY_HEADER;
- PARA_DEBUG_LOG("type: %s, rlen: %d\n", p, rlen);
+ PARA_DEBUG_LOG("type: %s, rlen: %u\n", p, rlen);
if (strncmp((char *)p, KEY_TYPE_TXT, strlen(KEY_TYPE_TXT)))
return -E_SSH_KEY_HEADER;
return 4 + rlen;
if (ret < 0)
goto out;
vol = ret;
- PARA_NOTICE_LOG("fading %s from %d to %d in %d seconds\n",
+ PARA_NOTICE_LOG("fading %s from %d to %d in %u seconds\n",
conf.mixer_channel_arg, vol, new_vol, secs);
diff = new_vol - vol;
if (!diff) {
tm = localtime(&t1);
}
wake_time_epoch = mktime(tm);
- PARA_INFO_LOG("waketime: %u:%02u\n", tm->tm_hour, tm->tm_min);
+ PARA_INFO_LOG("waketime: %d:%02d\n", tm->tm_hour, tm->tm_min);
client_cmd("stop");
sleep(1);
if (fot) {
oldest = fg;
}
if (!group_complete(oldest) && !group_empty(oldest))
- PARA_WARNING_LOG("Clearing incomplete group %d "
+ PARA_WARNING_LOG("Clearing incomplete group %u "
"(contains %d slices)\n", oldest->h.group_num,
oldest->num_received_slices);
if (oldest == pfd->first_complete_group)
uint8_t slice_num = fg->h.slice_num;
if (group_complete(fg)) {
- PARA_DEBUG_LOG("group %d complete, ignoring slice %d\n",
+ PARA_DEBUG_LOG("group %u complete, ignoring slice %d\n",
fg->h.group_num, slice_num);
return 0;
}
r = fg->num_received_slices;
/* Check if we already have this slice. */
if (test_and_set_slice_bit(fg, slice_num)) {
- PARA_INFO_LOG("ignoring duplicate slice %d:%d\n", fg->h.group_num,
+ PARA_INFO_LOG("ignoring duplicate slice %u:%d\n", fg->h.group_num,
slice_num);
return 0;
}
char *buf = NULL;
if (u == FEC_GROUP_UNUSABLE) {
- PARA_INFO_LOG("dropping unusable group %d\n", fg->h.group_num);
+ PARA_INFO_LOG("dropping unusable group %u\n", fg->h.group_num);
return 0;
}
- PARA_DEBUG_LOG("decoding group %d (%d slices)\n", fg->h.group_num,
+ PARA_DEBUG_LOG("decoding group %u (%d slices)\n", fg->h.group_num,
fg->h.data_slices_per_group);
ret = fec_decode(pfd->fec, fg->data, fg->idx, sb);
if (ret < 0)
i = DIV_ROUND_UP(fg->h.audio_header_size, fg->h.slice_bytes);
PARA_DEBUG_LOG("skipping %d header slices\n", i);
}
- PARA_DEBUG_LOG("writing group %d (%d/%d decoded data bytes)\n",
+ PARA_DEBUG_LOG("writing group %u (%u/%d decoded data bytes)\n",
fg->h.group_num, fg->h.group_bytes,
fg->h.data_slices_per_group * sb);
need = (fg->h.data_slices_per_group - i) * sb;
char *result, *home = para_homedir();
srandom(clock_get_realtime(NULL)->tv_usec);
- result = make_message("%s/.paraslash/%08lu", home,
+ result = make_message("%s/.paraslash/%08ld", home,
para_random(99999999));
free(home);
return result;
return 1;
}
if (!strcmp(cmd, "sample_format")) {
- *result = make_message("%u", DECODER_SAMPLE_FORMAT);
+ *result = make_message("%d", DECODER_SAMPLE_FORMAT);
return 1;
}
return -ERRNO_TO_PARA_ERROR(ENOTSUP);
if (!ok) {
FLAC__Metadata_ChainStatus st;
st = FLAC__metadata_chain_status(chain);
- PARA_ERROR_LOG("chain status: %d\n", st);
+ PARA_ERROR_LOG("chain status: %u\n", st);
if (st == FLAC__METADATA_CHAIN_STATUS_READ_ERROR)
PARA_ERROR_LOG("read error\n");
return -E_FLAC_WRITE_CHAIN;
unsigned lines_total, filled = ringbuffer_filled(bot_win_rb);
int first_rbe = first_visible_rbe(&lines_total);
- print_in_bar(COLOR_MSG, "scrolled view: %d-%d/%d\n", filled - first_rbe,
+ print_in_bar(COLOR_MSG, "scrolled view: %u-%u/%u\n", filled - first_rbe,
filled - scroll_position, ringbuffer_filled(bot_win_rb));
}
percent = 100;
else if (percent < 0)
percent = 0;
- PARA_DEBUG_LOG("moving from rank %u to %lu%%\n", rank, percent);
+ PARA_DEBUG_LOG("moving from rank %u to %li%%\n", rank, percent);
return score_update(aft_row, percent);
}
if (!val || !*val)
return 0;
fr = id3_frame_new(id);
- PARA_DEBUG_LOG("frame desc: %s, %d fields\n", fr->description, fr->nfields);
+ PARA_DEBUG_LOG("frame desc: %s, %u fields\n", fr->description, fr->nfields);
/* Frame 0 contains the encoding. We always use UTF-8. */
field = id3_frame_field(fr, 0);
struct addrinfo *addr = NULL, hints;
*result = NULL;
- sprintf(port, "%u", port_number & 0xffff);
+ sprintf(port, "%d", port_number & 0xffff);
/* Set up address hint structure */
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
memcpy(p + og->header_len, og->body, og->body_len);
vghd->buf = buf;
vghd->len = new_len;
- PARA_DEBUG_LOG("header/body/old/new: %lu/%lu/%zu/%zu\n",
+ PARA_DEBUG_LOG("header/body/old/new: %li/%li/%zu/%zu\n",
og->header_len, og->body_len, old_len, new_len);
}
{
int ret;
- PARA_DEBUG_LOG("header/body: %lu/%lu\n", op->header_len, op->body_len);
+ PARA_DEBUG_LOG("header/body: %li/%li\n", op->header_len, op->body_len);
ret = xwrite(fd, (const char *)op->header, op->header_len);
if (ret < 0)
return ret;
goto out;
continue;
}
- PARA_DEBUG_LOG("packet: bytes: %d, granule: %d, packetno: %u\n",
+ PARA_DEBUG_LOG("packet: bytes: %d, granule: %d, packetno: %d\n",
(int)packet.bytes, (int)packet.granulepos,
(int)packet.packetno);
/* ignore meta data packet which we replaced */
#endif
if (ret <= 0)
break;
- PARA_DEBUG_LOG("writing page (%lu bytes)\n",
+ PARA_DEBUG_LOG("writing page (%li bytes)\n",
op.header_len + op.body_len);
ret = write_ogg_page(fd, &op);
if (ret < 0)
goto out;
pod->channels = ov_info(vf, 0)->channels;
pod->sample_rate = ov_info(vf, 0)->rate;
- PARA_NOTICE_LOG("%d channels, %d Hz\n", pod->channels,
+ PARA_NOTICE_LOG("%u channels, %u Hz\n", pod->channels,
pod->sample_rate);
ret = 1;
out:
p += 4;
if (p + ntags * 4 > end)
return -E_OPUS_COMMENT;
- PARA_INFO_LOG("found %d tag(s)\n", ntags);
+ PARA_INFO_LOG("found %u tag(s)\n", ntags);
for (i = 0; i < ntags; i++, p += val) {
char *tag;
ret = -E_BAD_SAMPLERATE;
if (100 * max > 110 * min) /* more than 10% deviation */
goto err;
- PARA_NOTICE_LOG("using %dHz rather than %dHz\n", rate,
+ PARA_NOTICE_LOG("using %uHz rather than %uHz\n", rate,
sample_rate);
}
wn->min_iqs = powd->bytes_per_frame;
char *buf;
size_t sz;
- sz = xasprintf(&buf, "%s %4u %s\n", num == pt->current_file?
+ sz = xasprintf(&buf, "%s %4d %s\n", num == pt->current_file?
"*" : " ", num, conf.inputs[num]);
btr_add_output(buf, sz, pt->btrn);
}
prev_uptime = uptime;
prev_events = mmd->events;
mmd->vss_status_flags = mmd->new_vss_status_flags;
- PARA_DEBUG_LOG("%d events, forcing status update\n", mmd->events);
+ PARA_DEBUG_LOG("%u events, forcing status update\n", mmd->events);
killpg(0, SIGUSR1);
}
if (c + 4 > end)
return -E_SPX_COMMENT;
nb_fields = read_u32(c);
- PARA_DEBUG_LOG("%d comment(s)\n", nb_fields);
+ PARA_DEBUG_LOG("%u comment(s)\n", nb_fields);
c += 4;
for (i = 0; i < nb_fields; i++, c += len) {
char *tag;
#define WRITE_STATUS_ITEM(b, n, f, ...) (\
{ \
if ((b)->flags & PBF_SIZE_PREFIX) { \
- para_printf((b), "%02x:" f, n, ## __VA_ARGS__); \
+ para_printf((b), "%02x:" f, (unsigned)n, ## __VA_ARGS__); \
} else { \
para_printf((b), "%s: " f, status_item_list[(n)], \
## __VA_ARGS__); \
for (; i < k; i++)
fc->src_data[i] = (const unsigned char *)buf;
}
- PARA_DEBUG_LOG("FEC group %d: %d chunks (%d - %d), %d bytes\n",
+ PARA_DEBUG_LOG("FEC group %u: %u chunks (%u - %u), %u bytes\n",
g->num, g->num_chunks, g->first_chunk,
g->first_chunk + g->num_chunks - 1, g->bytes
);
}
if (compute_next_fec_slice(fc, vsst) <= 0)
continue;
- PARA_DEBUG_LOG("sending %d:%d (%u bytes)\n", fc->group.num,
+ PARA_DEBUG_LOG("sending %u:%u (%u bytes)\n", fc->group.num,
fc->current_slice_num, fc->group.slice_bytes);
fc->fcp->send_fec(fc->sc, (char *)fc->enc_buf,
fc->group.slice_bytes + FEC_HEADER_SIZE);
int bytespersec = channels * sample_rate * BITS / 8;
int align = channels * BITS / 8;
- PARA_DEBUG_LOG("writing wave header: %d channels, %d KHz\n", channels, sample_rate);
+ PARA_DEBUG_LOG("writing wave header: %u channels, %u KHz\n", channels, sample_rate);
memset(headbuf, 0, WAV_HEADER_LEN);
memcpy(headbuf, "RIFF", 4);
write_u32(headbuf + 4, size - 8);
if (!p)
return -E_WMA_NO_GUID;
- PARA_DEBUG_LOG("found audio stream guid@%0x\n", (int)(p - buf));
+ PARA_DEBUG_LOG("found audio stream guid@%0x\n", (unsigned)(p - buf));
return p - buf + 16;
}
ahi->sample_rate);
ahi->bit_rate = 8 * read_u16(start + 46);
- PARA_INFO_LOG("bit rate: %d\n", ahi->bit_rate);
+ PARA_INFO_LOG("bit rate: %u\n", ahi->bit_rate);
ahi->block_align = read_u16(start + 50);
PARA_INFO_LOG("block_align: %d\n", ahi->block_align);
ahi->flags1 = read_u32(start + 56);
ahi->flags2 = read_u16(start + 60);
- PARA_INFO_LOG("read_asf_header: flags1: %d, flag2: %d\n",
+ PARA_INFO_LOG("read_asf_header: flags1: %u, flag2: %u\n",
ahi->flags1, ahi->flags2);
ahi->use_exp_vlc = ahi->flags2 & 0x0001;
ahi->use_bit_reservoir = ahi->flags2 & 0x0002;
else
high_freq = high_freq * 0.5;
}
- PARA_INFO_LOG("channels=%d sample_rate=%d "
- "bitrate=%d block_align=%d\n",
+ PARA_INFO_LOG("channels=%u sample_rate=%u "
+ "bitrate=%u block_align=%d\n",
ahi->channels, ahi->sample_rate,
ahi->bit_rate, ahi->block_align);
PARA_INFO_LOG("frame_len=%d, bps=%f bps1=%f "