@@ -674,8 +674,8 @@ surface_init(pgSurfaceObject *self, PyObject *args, PyObject *kwds)
674674 /* Give the surface something other than an all white palette.
675675 * */
676676 SDL_Palette * surf_palette = SDL_CreateSurfacePalette (surface );
677- if (SDL_SetPaletteColors (surf_palette , default_palette_colors , 0 ,
678- default_palette_size - 1 ) != 0 ) {
677+ if (! PG_SetPaletteColors (surf_palette , default_palette_colors , 0 ,
678+ default_palette_size - 1 )) {
679679 PyErr_SetString (pgExc_SDLError , SDL_GetError ());
680680 SDL_FreeSurface (surface );
681681 return -1 ;
@@ -858,9 +858,9 @@ surface_init(pgSurfaceObject *self, PyObject *args, PyObject *kwds)
858858 if (SDL_ISPIXELFORMAT_INDEXED (PG_SURF_FORMATENUM (surface ))) {
859859 /* Give the surface something other than an all white palette.
860860 * */
861- if (SDL_SetPaletteColors (surface -> format -> palette ,
861+ if (! PG_SetPaletteColors (surface -> format -> palette ,
862862 default_palette_colors , 0 ,
863- default_palette_size - 1 ) != 0 ) {
863+ default_palette_size - 1 )) {
864864 PyErr_SetString (pgExc_SDLError , SDL_GetError ());
865865 SDL_FreeSurface (surface );
866866 return -1 ;
@@ -1332,7 +1332,7 @@ surf_set_palette(PyObject *self, PyObject *seq)
13321332 }
13331333
13341334 if (!pal ) {
1335- return RAISE (pgExc_SDLError , "Surface is not palettitized \n" );
1335+ return RAISE (pgExc_SDLError , "Surface is not palettized \n" );
13361336 }
13371337 old_colors = pal -> colors ;
13381338
@@ -1360,8 +1360,7 @@ surf_set_palette(PyObject *self, PyObject *seq)
13601360 colors [i ].a = (unsigned char )old_colors [i ].a ;
13611361 }
13621362
1363- ecode = SDL_SetPaletteColors (pal , colors , 0 , len );
1364- if (ecode != 0 ) {
1363+ if (!PG_SetPaletteColors (pal , colors , 0 , len )) {
13651364 return RAISE (pgExc_SDLError , SDL_GetError ());
13661365 }
13671366 Py_RETURN_NONE ;
@@ -1405,7 +1404,7 @@ surf_set_palette_at(PyObject *self, PyObject *args)
14051404 color .b = rgba [2 ];
14061405 color .a = pal -> colors [_index ].a ; /* May be a colorkey color. */
14071406
1408- if (SDL_SetPaletteColors (pal , & color , _index , 1 ) != 0 ) {
1407+ if (! PG_SetPaletteColors (pal , & color , _index , 1 )) {
14091408 return RAISE (pgExc_SDLError , SDL_GetError ());
14101409 }
14111410
@@ -3232,7 +3231,7 @@ surf_subsurface(PyObject *self, PyObject *args)
32323231 SDL_FreeSurface (sub );
32333232 return NULL ;
32343233 }
3235- if (SDL_SetPaletteColors (pal , colors , 0 , ncolors ) != 0 ) {
3234+ if (! PG_SetPaletteColors (pal , colors , 0 , ncolors )) {
32363235 PyErr_SetString (pgExc_SDLError , SDL_GetError ());
32373236 SDL_FreePalette (pal );
32383237 SDL_FreeSurface (sub );
0 commit comments