Fix several format string warnings

This commit is contained in:
Christian Helmuth 2014-02-07 08:48:23 +01:00 committed by Norman Feske
parent bdec3dd668
commit cdb5030cbb
4 changed files with 5 additions and 5 deletions

View File

@ -43,12 +43,12 @@ int main(int argc, char *argv[])
} }
offset = lseek(fd, 8193, SEEK_SET); offset = lseek(fd, 8193, SEEK_SET);
printf("offset: %zd\n", offset); printf("offset: %lld\n", (long long)offset);
n = write(fd, str, sizeof (str)); n = write(fd, str, sizeof (str));
offset = lseek(fd, 8193, SEEK_SET); offset = lseek(fd, 8193, SEEK_SET);
printf("offset: %zd\n", offset); printf("offset: %lld\n", (long long)offset);
n = read(fd, buf, sizeof (str)); n = read(fd, buf, sizeof (str));
printf("bytes: %zd\n", n); printf("bytes: %zd\n", n);
for (size_t i = 0; i < sizeof (str); i++) for (size_t i = 0; i < sizeof (str); i++)

View File

@ -355,7 +355,7 @@ class Line_editor
void _move_cursor_to(unsigned pos) void _move_cursor_to(unsigned pos)
{ {
char seq[10]; char seq[10];
snprintf(seq, sizeof(seq), "\e[%dG", pos + _prompt_len); snprintf(seq, sizeof(seq), "\e[%zdG", pos + _prompt_len);
_write(seq); _write(seq);
} }

View File

@ -130,7 +130,7 @@ class Track : Thread<8192>
} }
if (verbose) if (verbose)
PDBG("%s submit packet %zu", _file, PDBG("%s submit packet %u", _file,
_audio_out[0]->stream()->packet_position((p[0]))); _audio_out[0]->stream()->packet_position((p[0])));
for (int i = 0; i < CHN_CNT; i++) for (int i = 0; i < CHN_CNT; i++)

View File

@ -132,7 +132,7 @@ static void run_benchmark(
unsigned const sec_right = 1000 * ((float)sec - sec_left); unsigned const sec_right = 1000 * ((float)sec - sec_left);
unsigned const mb_per_sec_left = mb_per_sec; unsigned const mb_per_sec_left = mb_per_sec;
unsigned const mb_per_sec_right = 1000 * ((float)mb_per_sec - mb_per_sec_left); unsigned const mb_per_sec_right = 1000 * ((float)mb_per_sec - mb_per_sec_left);
PLOG(" %10u %10u %u.%03u %10u.%03u", request_size, bytes, sec_left, sec_right, mb_per_sec_left, mb_per_sec_right); PLOG(" %10zu %10u %u.%03u %10u.%03u", request_size, bytes, sec_left, sec_right, mb_per_sec_left, mb_per_sec_right);
} }
void print_bench_head() void print_bench_head()