Use standard paradigm for macro scope limiting.

This commit is contained in:
Jeff Young 2023-03-19 19:21:42 +00:00
parent ef0d561a5c
commit 129ccb891e
1 changed files with 6 additions and 6 deletions

View File

@ -75,7 +75,7 @@ public:
// In "DRC" mode (aReporter == nulltpr) properties are only checked until a difference is found. // In "DRC" mode (aReporter == nulltpr) properties are only checked until a difference is found.
// //
#define TEST( a, b, msg ) \ #define TEST( a, b, msg ) \
{ \ do { \
if( a != b ) \ if( a != b ) \
{ \ { \
diff = true; \ diff = true; \
@ -86,11 +86,11 @@ public:
\ \
if( diff && !aReporter ) \ if( diff && !aReporter ) \
return diff; \ return diff; \
} } while (0)
#define EPSILON 0.000001 #define EPSILON 0.000001
#define TEST_D( a, b, msg ) \ #define TEST_D( a, b, msg ) \
{ \ do { \
if( abs( a - b ) > EPSILON ) \ if( abs( a - b ) > EPSILON ) \
{ \ { \
diff = true; \ diff = true; \
@ -101,10 +101,10 @@ public:
\ \
if( diff && !aReporter ) \ if( diff && !aReporter ) \
return diff; \ return diff; \
} } while (0)
#define TEST_V3D( a, b, msg ) \ #define TEST_V3D( a, b, msg ) \
{ \ do { \
if( abs( a.x - b.x ) > EPSILON \ if( abs( a.x - b.x ) > EPSILON \
|| abs( a.y - b.y ) > EPSILON \ || abs( a.y - b.y ) > EPSILON \
|| abs( a.z - b.z ) > EPSILON ) \ || abs( a.z - b.z ) > EPSILON ) \
@ -117,7 +117,7 @@ public:
\ \
if( diff && !aReporter ) \ if( diff && !aReporter ) \
return diff; \ return diff; \
} } while (0)
#define ITEM_DESC( item ) ( item )->GetItemDescription( &g_unitsProvider ) #define ITEM_DESC( item ) ( item )->GetItemDescription( &g_unitsProvider )