test/testoverlay2.c
changeset 12828 27d544cc7236
parent 12503 806492103856
     1.1 --- a/test/testoverlay2.c	Tue Jun 11 02:31:57 2019 -0400
     1.2 +++ b/test/testoverlay2.c	Tue Jun 11 02:32:43 2019 -0400
     1.3 @@ -252,7 +252,7 @@
     1.4      }
     1.5  
     1.6      while (argc > 1) {
     1.7 -        if (strcmp(argv[1], "-fps") == 0) {
     1.8 +        if (SDL_strcmp(argv[1], "-fps") == 0) {
     1.9              if (argv[2]) {
    1.10                  fps = SDL_atoi(argv[2]);
    1.11                  if (fps == 0) {
    1.12 @@ -272,11 +272,11 @@
    1.13                          "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
    1.14                  quit(10);
    1.15              }
    1.16 -        } else if (strcmp(argv[1], "-nodelay") == 0) {
    1.17 +        } else if (SDL_strcmp(argv[1], "-nodelay") == 0) {
    1.18              nodelay = 1;
    1.19              argv += 1;
    1.20              argc -= 1;
    1.21 -        } else if (strcmp(argv[1], "-scale") == 0) {
    1.22 +        } else if (SDL_strcmp(argv[1], "-scale") == 0) {
    1.23              if (argv[2]) {
    1.24                  scale = SDL_atoi(argv[2]);
    1.25                  if (scale == 0) {
    1.26 @@ -296,8 +296,8 @@
    1.27                          "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
    1.28                  quit(10);
    1.29              }
    1.30 -        } else if ((strcmp(argv[1], "-help") == 0)
    1.31 -                   || (strcmp(argv[1], "-h") == 0)) {
    1.32 +        } else if ((SDL_strcmp(argv[1], "-help") == 0)
    1.33 +                   || (SDL_strcmp(argv[1], "-h") == 0)) {
    1.34              PrintUsage(argv[0]);
    1.35              quit(0);
    1.36          } else {
    1.37 @@ -307,7 +307,7 @@
    1.38          break;
    1.39      }
    1.40  
    1.41 -    RawMooseData = (Uint8 *) malloc(MOOSEFRAME_SIZE * MOOSEFRAMES_COUNT);
    1.42 +    RawMooseData = (Uint8 *) SDL_malloc(MOOSEFRAME_SIZE * MOOSEFRAMES_COUNT);
    1.43      if (RawMooseData == NULL) {
    1.44          SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't allocate memory for movie !\n");
    1.45          quit(1);
    1.46 @@ -317,7 +317,7 @@
    1.47      handle = SDL_RWFromFile("moose.dat", "rb");
    1.48      if (handle == NULL) {
    1.49          SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't find the file moose.dat !\n");
    1.50 -        free(RawMooseData);
    1.51 +        SDL_free(RawMooseData);
    1.52          quit(2);
    1.53      }
    1.54  
    1.55 @@ -335,21 +335,21 @@
    1.56                                SDL_WINDOW_RESIZABLE);
    1.57      if (!window) {
    1.58          SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create window: %s\n", SDL_GetError());
    1.59 -        free(RawMooseData);
    1.60 +        SDL_free(RawMooseData);
    1.61          quit(4);
    1.62      }
    1.63  
    1.64      renderer = SDL_CreateRenderer(window, -1, 0);
    1.65      if (!renderer) {
    1.66          SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create renderer: %s\n", SDL_GetError());
    1.67 -        free(RawMooseData);
    1.68 +        SDL_free(RawMooseData);
    1.69          quit(4);
    1.70      }
    1.71  
    1.72      MooseTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_YV12, SDL_TEXTUREACCESS_STREAMING, MOOSEPIC_W, MOOSEPIC_H);
    1.73      if (!MooseTexture) {
    1.74          SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create texture: %s\n", SDL_GetError());
    1.75 -        free(RawMooseData);
    1.76 +        SDL_free(RawMooseData);
    1.77          quit(5);
    1.78      }
    1.79      /* Uncomment this to check vertex color with a YUV texture */
    1.80 @@ -373,7 +373,7 @@
    1.81              0, 100);
    1.82      }
    1.83  
    1.84 -    free(RawMooseData);
    1.85 +    SDL_free(RawMooseData);
    1.86  
    1.87      /* set the start frame */
    1.88      i = 0;