@@ -1333,9 +1333,10 @@ flood_fill(PyObject *self, PyObject *arg, PyObject *kwargs)
13331333
13341334 if (pgSurface_Check (colorobj )) {
13351335 pat_surfobj = (pgSurfaceObject * )colorobj ;
1336- pattern = pat_surfobj -> surf ; /* No conversion: we will map per-pixel */
1337- color = 0 ; /* new_color unused for pattern path */
1338- } else {
1336+ pattern = pat_surfobj -> surf ; /* No conversion: we will map per-pixel */
1337+ color = 0 ; /* new_color unused for pattern path */
1338+ }
1339+ else {
13391340 CHECK_LOAD_COLOR (colorobj );
13401341 }
13411342
@@ -1369,7 +1370,8 @@ flood_fill(PyObject *self, PyObject *arg, PyObject *kwargs)
13691370 if (did_lock_surf ) {
13701371 pgSurface_Unlock (surfobj );
13711372 }
1372- return RAISE (PyExc_RuntimeError , "error unlocking pattern surface" );
1373+ return RAISE (PyExc_RuntimeError ,
1374+ "error unlocking pattern surface" );
13731375 }
13741376 }
13751377 if (did_lock_surf ) {
@@ -1384,12 +1386,14 @@ flood_fill(PyObject *self, PyObject *arg, PyObject *kwargs)
13841386
13851387 /* Compute return rect. */
13861388 if (drawn_area [0 ] != INT_MAX && drawn_area [1 ] != INT_MAX &&
1387- drawn_area [2 ] != INT_MIN && drawn_area [3 ] != INT_MIN )
1389+ drawn_area [2 ] != INT_MIN && drawn_area [3 ] != INT_MIN ) {
13881390 return pgRect_New4 (drawn_area [0 ], drawn_area [1 ],
13891391 drawn_area [2 ] - drawn_area [0 ] + 1 ,
13901392 drawn_area [3 ] - drawn_area [1 ] + 1 );
1391- else
1393+ }
1394+ else {
13921395 return pgRect_New4 (startx , starty , 0 , 0 );
1396+ }
13931397}
13941398/* Functions used in drawing algorithms */
13951399
@@ -1401,7 +1405,7 @@ swap(float *a, float *b)
14011405 * b = temp ;
14021406}
14031407
1404- #define WORD_BITS (CHAR_BIT * sizeof(unsigned int))
1408+ #define WORD_BITS (CHAR_BIT * sizeof(unsigned int))
14051409
14061410struct point2d {
14071411 Uint32 x ;
@@ -1423,10 +1427,12 @@ _bitarray_set(unsigned int *bitarray, size_t idx, SDL_bool value)
14231427static inline SDL_bool
14241428_bitarray_get (unsigned int * bitarray , size_t idx )
14251429{
1426- if (bitarray [idx / WORD_BITS ] & (1u << (idx % WORD_BITS )))
1430+ if (bitarray [idx / WORD_BITS ] & (1u << (idx % WORD_BITS ))) {
14271431 return SDL_TRUE ;
1428- else
1432+ }
1433+ else {
14291434 return SDL_FALSE ;
1435+ }
14301436}
14311437
14321438static int
@@ -2502,7 +2508,7 @@ draw_line(SDL_Surface *surf, SDL_Rect surf_clip_rect, int x1, int y1, int x2,
25022508 * ((Uint32 * )(p_pixels + (p_y ) * p_surf -> pitch ) + (p_x )); \
25032509 break ; \
25042510 }
2505- #endif // SURF_GET_AT
2511+ #endif // SURF_GET_AT
25062512
25072513static int
25082514flood_fill_inner (SDL_Surface * surf , int x1 , int y1 , Uint32 new_color ,
@@ -2609,8 +2615,9 @@ flood_fill_inner(SDL_Surface *surf, int x1, int y1, Uint32 new_color,
26092615 }
26102616
26112617 mask_idx = (ny - cliprect .y ) * cliprect .w + (nx - cliprect .x );
2612- if (_bitarray_get (mask , mask_idx ))
2618+ if (_bitarray_get (mask , mask_idx )) {
26132619 continue ;
2620+ }
26142621
26152622 // only queue node once
26162623 _bitarray_set (mask , mask_idx , SDL_TRUE );
0 commit comments