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 74443b9b7bcee64f
parent 7443 58c5fcba814d
child 7445 bf50f0b74811
Fixed compiler warnings in test program by using wrapped functions.
test/testresample.c
     1.1 --- a/test/testresample.c	Sun Jul 14 13:30:26 2013 +0200
     1.2 +++ b/test/testresample.c	Sun Jul 14 13:33:54 2013 +0200
     1.3 @@ -30,7 +30,7 @@
     1.4          return 1;
     1.5      }
     1.6  
     1.7 -    cvtfreq = atoi(argv[3]);
     1.8 +    cvtfreq = SDL_atoi(argv[3]);
     1.9  
    1.10      if (SDL_Init(SDL_INIT_AUDIO) == -1) {
    1.11          fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError());
    1.12 @@ -52,18 +52,18 @@
    1.13      }
    1.14  
    1.15      cvt.len = len;
    1.16 -    cvt.buf = (Uint8 *) malloc(len * cvt.len_mult);
    1.17 +    cvt.buf = (Uint8 *) SDL_malloc(len * cvt.len_mult);
    1.18      if (cvt.buf == NULL) {
    1.19          fprintf(stderr, "Out of memory.\n");
    1.20          SDL_FreeWAV(data);
    1.21          SDL_Quit();
    1.22          return 5;
    1.23      }
    1.24 -    memcpy(cvt.buf, data, len);
    1.25 +    SDL_memcpy(cvt.buf, data, len);
    1.26  
    1.27      if (SDL_ConvertAudio(&cvt) == -1) {
    1.28          fprintf(stderr, "Conversion failed: %s\n", SDL_GetError());
    1.29 -        free(cvt.buf);
    1.30 +        SDL_free(cvt.buf);
    1.31          SDL_FreeWAV(data);
    1.32          SDL_Quit();
    1.33          return 6;
    1.34 @@ -73,7 +73,7 @@
    1.35      io = SDL_RWFromFile(argv[2], "wb");
    1.36      if (io == NULL) {
    1.37          fprintf(stderr, "fopen('%s') failed: %s\n", argv[2], SDL_GetError());
    1.38 -        free(cvt.buf);
    1.39 +        SDL_free(cvt.buf);
    1.40          SDL_FreeWAV(data);
    1.41          SDL_Quit();
    1.42          return 7;
    1.43 @@ -100,13 +100,13 @@
    1.44  
    1.45      if (SDL_RWclose(io) == -1) {
    1.46          fprintf(stderr, "fclose('%s') failed: %s\n", argv[2], SDL_GetError());
    1.47 -        free(cvt.buf);
    1.48 +        SDL_free(cvt.buf);
    1.49          SDL_FreeWAV(data);
    1.50          SDL_Quit();
    1.51          return 8;
    1.52      }                           // if
    1.53  
    1.54 -    free(cvt.buf);
    1.55 +    SDL_free(cvt.buf);
    1.56      SDL_FreeWAV(data);
    1.57      SDL_Quit();
    1.58      return 0;