printf format fixes

This commit is contained in:
Wim Taymans 2019-06-07 17:16:02 +02:00
parent d46c239ab0
commit 497a8364c5
9 changed files with 23 additions and 22 deletions

View file

@ -446,7 +446,7 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
state->period_frames = period_size;
periods = state->buffer_frames / state->period_frames;
spa_log_info(state->log, "%p: buffer frames %zd, period frames %zd, periods %u, frame_size %zd",
spa_log_info(state->log, "%p: buffer frames %lu, period frames %lu, periods %u, frame_size %zd",
state, state->buffer_frames, state->period_frames,
periods, state->frame_size);
@ -572,7 +572,7 @@ static int alsa_recover(struct state *state, int err)
return 0;
}
static int get_status(struct state *state, snd_pcm_sframes_t *delay)
static int get_status(struct state *state, snd_pcm_uframes_t *delay)
{
snd_pcm_sframes_t avail;
int res;
@ -674,7 +674,7 @@ int spa_alsa_write(struct state *state, snd_pcm_uframes_t silence)
if (state->slaved && state->alsa_started) {
uint64_t nsec;
snd_pcm_sframes_t delay;
snd_pcm_uframes_t delay;
if ((res = get_status(state, &delay)) < 0)
return res;
@ -879,14 +879,14 @@ int spa_alsa_read(struct state *state, snd_pcm_uframes_t silence)
if (state->slaved && state->alsa_started) {
uint64_t nsec;
snd_pcm_sframes_t delay;
snd_pcm_uframes_t delay;
uint32_t threshold = state->threshold;
if ((res = get_status(state, &delay)) < 0)
return res;
if (delay < threshold) {
spa_log_warn(state->log, "slave delay:%ld resync %f %f %f", delay,
spa_log_warn(state->log, "slave delay:%lu resync %f %f %f", delay,
state->z1, state->z2, state->z3);
init_loop(state);
push_frames(state, NULL, 0, 0);
@ -933,7 +933,7 @@ int spa_alsa_read(struct state *state, snd_pcm_uframes_t silence)
return 0;
}
static int handle_play(struct state *state, uint64_t nsec, snd_pcm_sframes_t delay)
static int handle_play(struct state *state, uint64_t nsec, snd_pcm_uframes_t delay)
{
int res;
@ -961,7 +961,7 @@ static int handle_play(struct state *state, uint64_t nsec, snd_pcm_sframes_t del
return res;
}
static int handle_capture(struct state *state, uint64_t nsec, snd_pcm_sframes_t delay)
static int handle_capture(struct state *state, uint64_t nsec, snd_pcm_uframes_t delay)
{
int res;
struct spa_io_buffers *io;
@ -995,7 +995,7 @@ static int handle_capture(struct state *state, uint64_t nsec, snd_pcm_sframes_t
static void alsa_on_timeout_event(struct spa_source *source)
{
struct state *state = source->data;
snd_pcm_sframes_t delay;
snd_pcm_uframes_t delay;
uint64_t nsec;
uint64_t expire;
int res;
@ -1011,8 +1011,8 @@ static void alsa_on_timeout_event(struct spa_source *source)
return;
nsec = SPA_TIMESPEC_TO_NSEC(&state->now);
spa_log_trace_fp(state->log, "timeout %ld %"PRIu64" %"PRIu64" %"PRIi64" %d %ld", delay,
nsec, state->next_time, nsec - state->next_time,
spa_log_trace_fp(state->log, "timeout %lu %"PRIu64" %"PRIu64" %"PRIi64" %d %"PRIi64,
delay, nsec, state->next_time, nsec - state->next_time,
state->threshold, state->sample_count);
if (state->stream == SND_PCM_STREAM_PLAYBACK)

View file

@ -810,7 +810,7 @@ static int impl_node_process(void *object)
resample_process(&this->resample, src_datas, &in_len, dst_datas, &out_len);
spa_log_trace_fp(this->log, NAME " %p: in %d/%d %ld %d out %d/%d %ld %d",
spa_log_trace_fp(this->log, NAME " %p: in %d/%d %zd %d out %d/%d %zd %d",
this, pin_len, in_len, size / sizeof(float), inport->offset,
pout_len, out_len, maxsize / sizeof(float), outport->offset);

View file

@ -369,7 +369,7 @@ static int send_buffer(struct impl *this)
ioctl(this->transport->fd, TIOCOUTQ, &val);
spa_log_trace(this->log, NAME " %p: send %d %u %u %u %lu %d",
spa_log_trace(this->log, NAME " %p: send %d %u %u %u %"PRIu64" %d",
this, this->frame_count, this->seqnum, this->timestamp, this->buffer_used,
this->sample_time, val);
@ -410,7 +410,7 @@ static int encode_buffer(struct impl *this, const void *data, int size)
this->frame_count += processed / this->codesize;
this->buffer_used += out_encoded;
spa_log_trace(this->log, NAME " %p: processed %d %ld used %d",
spa_log_trace(this->log, NAME " %p: processed %d %zd used %d",
this, processed, out_encoded, this->buffer_used);
return processed;
@ -577,7 +577,7 @@ static int flush_data(struct impl *this, uint64_t now_time)
written = flush_buffer(this, false);
if (written == -EAGAIN) {
spa_log_trace(this->log, NAME" %p: delay flush %ld", this, this->sample_time);
spa_log_trace(this->log, NAME" %p: delay flush %"PRIu64, this, this->sample_time);
if ((this->flush_source.mask & SPA_IO_OUT) == 0) {
this->flush_source.mask = SPA_IO_OUT;
spa_loop_update_source(this->data_loop, &this->flush_source);
@ -610,7 +610,7 @@ static int flush_data(struct impl *this, uint64_t now_time)
queued = this->sample_time - elapsed;
spa_log_trace(this->log, NAME" %p: %ld %ld %ld %ld %d", this,
spa_log_trace(this->log, NAME" %p: %"PRIu64" %"PRIi64" %"PRIu64" %"PRIu64" %d", this,
now_time, queued, this->sample_time, elapsed, this->write_samples);
if (!this->slaved) {
@ -678,7 +678,7 @@ static void a2dp_on_timeout(struct spa_source *source)
spa_system_clock_gettime(this->data_system, CLOCK_MONOTONIC, &this->now);
now_time = SPA_TIMESPEC_TO_NSEC(&this->now);
spa_log_trace(this->log, NAME" %p: timeout %ld %ld", this,
spa_log_trace(this->log, NAME" %p: timeout %"PRIu64" %"PRIu64"", this,
now_time, now_time - this->last_time);
this->last_time = now_time;

View file

@ -93,7 +93,7 @@ arm_init(struct impl *impl)
}
if ((line = get_cpuinfo_line(cpuinfo, "Features"))) {
const char *state = NULL;
char *state = NULL;
char *current = strtok_r(line, " ", &state);
do {

View file

@ -113,7 +113,7 @@ int main(int argc, char *argv[])
size = DEFAULT_SIZE;
printf("buffer size (bytes): %d\n", size);
printf("array size (bytes): %ld\n", sizeof(int) * ARRAY_SIZE);
printf("array size (bytes): %zd\n", sizeof(int) * ARRAY_SIZE);
spa_ringbuffer_init(&rb);
data = malloc(size);