1
0
mirror of http://mpg123.de/trunk/.git synced 2025-07-30 02:01:12 +03:00

examples: fix compiler warnings

git-svn-id: svn://scm.orgis.org/mpg123/trunk@4620 35dc7657-300d-0410-a2e5-dc2837fedb53
This commit is contained in:
thor
2020-03-16 07:19:54 +00:00
parent 99336c6530
commit b030c49633
4 changed files with 11 additions and 3 deletions

View File

@ -8,6 +8,7 @@
#include <mpg123.h>
#include <stdio.h>
#include <inttypes.h>
int main(int argc, char **argv)
{
@ -31,7 +32,7 @@ int main(int argc, char **argv)
mpg123_index(m, &offsets, &step, &fill);
for(i=0; i<fill;i++) {
printf("Frame number %d: file offset %d\n", i * step, offsets[i]);
printf("Frame number %"PRIiMAX": file offset %"PRIiMAX"\n", (intmax_t)(i * step), (intmax_t)offsets[i]);
}
mpg123_close(m);

View File

@ -17,6 +17,7 @@
#endif
#include <stdio.h>
#include <string.h>
int do_work(mpg123_handle *m);
@ -79,7 +80,7 @@ int do_work(mpg123_handle *m)
/* Now write out both header and data, fire and forget. */
write(STDOUT_FILENO, hbuf, 4);
write(STDOUT_FILENO, bodydata, bodybytes);
fprintf(stderr, "%zu: header 0x%08x, %zu body bytes\n", ++count, header, bodybytes);
fprintf(stderr, "%zu: header 0x%08lx, %zu body bytes\n", ++count, header, bodybytes);
}
}

View File

@ -227,7 +227,7 @@ int main(int argc, char **argv)
}
}
fprintf(stderr, "Finished\n", (unsigned long)inc, (unsigned long)outc);
fprintf(stderr, "Finished\n");
closewav();
fclose(out);

View File

@ -30,6 +30,12 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifndef _MSC_VER
#include <unistd.h>
#else
#include <io.h>
#endif
#include <string.h>
void usage(const char *cmd)
{