consistently use IMG_SetError() instead of SDL_SetError.
authorOzkan Sezer <sezeroz@gmail.com>
Thu, 11 Jul 2019 01:10:28 +0300
changeset 6826950f1d21f82
parent 673 3dbafbda029f
child 683 f1baffa48926
consistently use IMG_SetError() instead of SDL_SetError.
IMG_bmp.c
IMG_jpg.c
IMG_png.c
     1.1 --- a/IMG_bmp.c	Tue Jul 02 08:41:30 2019 -0700
     1.2 +++ b/IMG_bmp.c	Thu Jul 11 01:10:28 2019 +0300
     1.3 @@ -376,7 +376,7 @@
     1.4          case 5:
     1.5          case 6:
     1.6          case 7:
     1.7 -            SDL_SetError("%d-bpp BMP images are not supported", biBitCount);
     1.8 +            IMG_SetError("%d-bpp BMP images are not supported", biBitCount);
     1.9              was_error = SDL_TRUE;
    1.10              goto done;
    1.11          default:
    1.12 @@ -543,7 +543,7 @@
    1.13                  if (biBitCount == 8 && palette && biClrUsed < (1 << biBitCount)) {
    1.14                      for (i = 0; i < surface->w; ++i) {
    1.15                          if (bits[i] >= biClrUsed) {
    1.16 -                            SDL_SetError("A BMP image contains a pixel with a color out of the palette");
    1.17 +                            IMG_SetError("A BMP image contains a pixel with a color out of the palette");
    1.18                              was_error = SDL_TRUE;
    1.19                              goto done;
    1.20                          }
     2.1 --- a/IMG_jpg.c	Tue Jul 02 08:41:30 2019 -0700
     2.2 +++ b/IMG_jpg.c	Thu Jul 11 01:10:28 2019 +0300
     2.3 @@ -479,7 +479,7 @@
     2.4      int result = -1;
     2.5  
     2.6      if (!dst) {
     2.7 -        SDL_SetError("Passed NULL dst");
     2.8 +        IMG_SetError("Passed NULL dst");
     2.9          goto done;
    2.10      }
    2.11  
     3.1 --- a/IMG_png.c	Tue Jul 02 08:41:30 2019 -0700
     3.2 +++ b/IMG_png.c	Thu Jul 11 01:10:28 2019 +0300
     3.3 @@ -543,14 +543,14 @@
     3.4  
     3.5          png_ptr = lib.png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
     3.6          if (png_ptr == NULL) {
     3.7 -            SDL_SetError("Couldn't allocate memory for PNG file or incompatible PNG dll");
     3.8 +            IMG_SetError("Couldn't allocate memory for PNG file or incompatible PNG dll");
     3.9              return -1;
    3.10          }
    3.11  
    3.12          info_ptr = lib.png_create_info_struct(png_ptr);
    3.13          if (info_ptr == NULL) {
    3.14              lib.png_destroy_write_struct(&png_ptr, NULL);
    3.15 -            SDL_SetError("Couldn't create image information for PNG file");
    3.16 +            IMG_SetError("Couldn't create image information for PNG file");
    3.17              return -1;
    3.18          }
    3.19  #ifdef PNG_SETJMP_SUPPORTED
    3.20 @@ -562,7 +562,7 @@
    3.21  #endif
    3.22          {
    3.23              lib.png_destroy_write_struct(&png_ptr, &info_ptr);
    3.24 -            SDL_SetError("Error writing the PNG file.");
    3.25 +            IMG_SetError("Error writing the PNG file.");
    3.26              return -1;
    3.27          }
    3.28  
    3.29 @@ -575,7 +575,7 @@
    3.30              if (color_ptr == NULL)
    3.31              {
    3.32                  lib.png_destroy_write_struct(&png_ptr, &info_ptr);
    3.33 -                SDL_SetError("Couldn't create palette for PNG file");
    3.34 +                IMG_SetError("Couldn't create palette for PNG file");
    3.35                  return -1;
    3.36              }
    3.37              for (i = 0; i < ncolors; i++) {
    3.38 @@ -603,7 +603,7 @@
    3.39              row_pointers = (png_bytep *) SDL_malloc(sizeof(png_bytep) * source->h);
    3.40              if (!row_pointers) {
    3.41                  lib.png_destroy_write_struct(&png_ptr, &info_ptr);
    3.42 -                SDL_SetError("Out of memory");
    3.43 +                IMG_SetError("Out of memory");
    3.44                  return -1;
    3.45              }
    3.46              for (row = 0; row < (int)source->h; row++) {
    3.47 @@ -626,7 +626,7 @@
    3.48              SDL_RWclose(dst);
    3.49          }
    3.50      } else {
    3.51 -        SDL_SetError("Passed NULL dst");
    3.52 +        IMG_SetError("Passed NULL dst");
    3.53          return -1;
    3.54      }
    3.55      return 0;
    3.56 @@ -670,13 +670,13 @@
    3.57              }
    3.58              SDL_free(png);
    3.59          } else {
    3.60 -            SDL_SetError("Failed to convert and save image");
    3.61 +            IMG_SetError("Failed to convert and save image");
    3.62          }
    3.63          if (freedst) {
    3.64              SDL_RWclose(dst);
    3.65          }
    3.66      } else {
    3.67 -        SDL_SetError("Passed NULL dst");
    3.68 +        IMG_SetError("Passed NULL dst");
    3.69      }
    3.70      return result;
    3.71  }