Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed compiler warnings in test program by using wrapped functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed Jul 14, 2013
1 parent 4cd6617 commit 433f481
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/testresample.c
Expand Up @@ -30,7 +30,7 @@ main(int argc, char **argv)
return 1;
}

cvtfreq = atoi(argv[3]);
cvtfreq = SDL_atoi(argv[3]);

if (SDL_Init(SDL_INIT_AUDIO) == -1) {
fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError());
Expand All @@ -52,18 +52,18 @@ main(int argc, char **argv)
}

cvt.len = len;
cvt.buf = (Uint8 *) malloc(len * cvt.len_mult);
cvt.buf = (Uint8 *) SDL_malloc(len * cvt.len_mult);
if (cvt.buf == NULL) {
fprintf(stderr, "Out of memory.\n");
SDL_FreeWAV(data);
SDL_Quit();
return 5;
}
memcpy(cvt.buf, data, len);
SDL_memcpy(cvt.buf, data, len);

if (SDL_ConvertAudio(&cvt) == -1) {
fprintf(stderr, "Conversion failed: %s\n", SDL_GetError());
free(cvt.buf);
SDL_free(cvt.buf);
SDL_FreeWAV(data);
SDL_Quit();
return 6;
Expand All @@ -73,7 +73,7 @@ main(int argc, char **argv)
io = SDL_RWFromFile(argv[2], "wb");
if (io == NULL) {
fprintf(stderr, "fopen('%s') failed: %s\n", argv[2], SDL_GetError());
free(cvt.buf);
SDL_free(cvt.buf);
SDL_FreeWAV(data);
SDL_Quit();
return 7;
Expand All @@ -100,13 +100,13 @@ main(int argc, char **argv)

if (SDL_RWclose(io) == -1) {
fprintf(stderr, "fclose('%s') failed: %s\n", argv[2], SDL_GetError());
free(cvt.buf);
SDL_free(cvt.buf);
SDL_FreeWAV(data);
SDL_Quit();
return 8;
} // if

free(cvt.buf);
SDL_free(cvt.buf);
SDL_FreeWAV(data);
SDL_Quit();
return 0;
Expand Down

0 comments on commit 433f481

Please sign in to comment.