mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 09:53:00 +02:00
geofast.h: warning: this 'else' clause does not guard...
Use of macro idiom: if(1) { ... } else
which has dangling else keyword to allow trailing semicolon at
use site, is not a good pattern.
Replaced with idiom: do { ... } while(0)
which should achieve the same purpose but now cause compile
error when used incorrectly at use site.
GCC14 -Wall cleanup series [-Wmisleading-indentation]
This commit is contained in:
committed by
Tim Edwards
parent
e8f9b0af5e
commit
88d36bfd1e
+2
-2
@@ -32,12 +32,12 @@
|
||||
*/
|
||||
|
||||
#define GEOCLIP(r, area) \
|
||||
if (1) { \
|
||||
do { \
|
||||
if ((r)->r_xbot < (area)->r_xbot) (r)->r_xbot = (area)->r_xbot; \
|
||||
if ((r)->r_ybot < (area)->r_ybot) (r)->r_ybot = (area)->r_ybot; \
|
||||
if ((r)->r_xtop > (area)->r_xtop) (r)->r_xtop = (area)->r_xtop; \
|
||||
if ((r)->r_ytop > (area)->r_ytop) (r)->r_ytop = (area)->r_ytop; \
|
||||
} else
|
||||
} while(0)
|
||||
|
||||
/* --------------------- Transforming rectangles ---------------------- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user