diff options
Diffstat (limited to 'wavextract.c')
-rw-r--r-- | wavextract.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/wavextract.c b/wavextract.c index 137d1a0..627406a 100644 --- a/wavextract.c +++ b/wavextract.c @@ -4,19 +4,15 @@ #include <errno.h> #include <stdint.h> #include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> #include <fcntl.h> #include <inttypes.h> -#include <math.h> -#include <ctype.h> #define VERSION "0.1" #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include <windows.h> - #define PRIsize_t "Iu" + #define PRIsize_t "llu" #define htole16(x) (x) #define htole32(x) (x) #else @@ -185,12 +181,12 @@ int main(int argc, char** argv){ //read sample if(read(source_fd, &sample, 2) != 2){ close(source_fd); - fprintf(stderr, "Failed to read input data at sample %ld: %s\n", n, strerror(errno)); + fprintf(stderr, "Failed to read input data at sample %" PRIsize_t ": %s\n", n, strerror(errno)); return EXIT_FAILURE; } if(channel == 0){ - printf("%ld,%d", n, (int16_t) sample); + printf("%" PRIsize_t ",%d", n, (int16_t) sample); } else{ printf(",%d", (int16_t) sample); @@ -205,6 +201,6 @@ int main(int argc, char** argv){ } close(source_fd); - fprintf(stderr, "Done, exported %ld frames of data %d channels, processed %ld samples\n", n, fmt.channels, fmt.channels * n); + fprintf(stderr, "Done, exported %" PRIsize_t " frames of data %d channels, processed %" PRIsize_t " samples\n", n, fmt.channels, fmt.channels * n); return EXIT_SUCCESS; } |