@@ -1442,9 +1442,8 @@ surf_set_colorkey(pgSurfaceObject *self, PyObject *args)
14421442 success = PG_SetSurfaceColorKey (surf , SDL_FALSE , color );
14431443 }
14441444 if (success && hascolor ) {
1445- success =
1446- SDL_SetSurfaceRLE (
1447- surf , (flags & PGS_RLEACCEL ) ? SDL_TRUE : SDL_FALSE ) == 0 ;
1445+ success = PG_SetSurfaceRLE (
1446+ surf , (flags & PGS_RLEACCEL ) ? SDL_TRUE : SDL_FALSE );
14481447 }
14491448 if (success ) {
14501449 success = PG_SetSurfaceColorKey (surf , hascolor , color );
@@ -1496,7 +1495,7 @@ surf_set_alpha(pgSurfaceObject *self, PyObject *args)
14961495 Uint32 flags = 0 ;
14971496 PyObject * alpha_obj = NULL , * intobj = NULL ;
14981497 Uint8 alpha ;
1499- int result , alphaval = 255 ;
1498+ int alphaval = 255 ;
15001499 SDL_Rect sdlrect ;
15011500 SDL_Surface * surface ;
15021501
@@ -1544,8 +1543,8 @@ surf_set_alpha(pgSurfaceObject *self, PyObject *args)
15441543 }
15451544 }
15461545 pgSurface_Prep (self );
1547- result =
1548- SDL_SetSurfaceRLE (surf , (flags & PGS_RLEACCEL ) ? SDL_TRUE : SDL_FALSE );
1546+ bool success =
1547+ PG_SetSurfaceRLE (surf , (flags & PGS_RLEACCEL ) ? SDL_TRUE : SDL_FALSE );
15491548 /* HACK HACK HACK */
15501549 if ((surf -> flags & SDL_RLEACCEL ) && (!(flags & PGS_RLEACCEL ))) {
15511550 /* hack to strip SDL_RLEACCEL flag off surface immediately when
@@ -1561,12 +1560,12 @@ surf_set_alpha(pgSurfaceObject *self, PyObject *args)
15611560 SDL_FreeSurface (surface );
15621561 }
15631562 /* HACK HACK HACK */
1564- if (result == 0 ) {
1565- result = ! PG_SetSurfaceAlphaMod (surf , alpha );
1563+ if (success ) {
1564+ success = PG_SetSurfaceAlphaMod (surf , alpha );
15661565 }
15671566 pgSurface_Unprep (self );
15681567
1569- if (result != 0 ) {
1568+ if (! success ) {
15701569 return RAISE (pgExc_SDLError , SDL_GetError ());
15711570 }
15721571
0 commit comments