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:
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <mpg123.h>
|
#include <mpg123.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -31,7 +32,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
mpg123_index(m, &offsets, &step, &fill);
|
mpg123_index(m, &offsets, &step, &fill);
|
||||||
for(i=0; i<fill;i++) {
|
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);
|
mpg123_close(m);
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int do_work(mpg123_handle *m);
|
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. */
|
/* Now write out both header and data, fire and forget. */
|
||||||
write(STDOUT_FILENO, hbuf, 4);
|
write(STDOUT_FILENO, hbuf, 4);
|
||||||
write(STDOUT_FILENO, bodydata, bodybytes);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
closewav();
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
@ -30,6 +30,12 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
#include <unistd.h>
|
||||||
|
#else
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
void usage(const char *cmd)
|
void usage(const char *cmd)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user