Fixed compiler warnings in test program by using wrapped functions.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 14 Jul 2013 13:33:54 +0200
changeset 7444 3b9b7bcee64f
parent 7443 58c5fcba814d
child 7445 bf50f0b74811
Fixed compiler warnings in test program by using wrapped functions.
test/testresample.c
--- a/test/testresample.c	Sun Jul 14 13:30:26 2013 +0200
+++ b/test/testresample.c	Sun Jul 14 13:33:54 2013 +0200
@@ -30,7 +30,7 @@
         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());
@@ -52,18 +52,18 @@
     }
 
     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;
@@ -73,7 +73,7 @@
     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;
@@ -100,13 +100,13 @@
 
     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;