OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
macros.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MEMCHECK(x)   (((x) == NULL) ? 101 : 0 )
 
#define FREE(x)   { if (x) { free(x); x = NULL; } }
 
#define ABS(x)   (((x)<0) ? -(x) : (x)) /* absolute value of x */
 
#define MIN(x, y)   (((x)<=(y)) ? (x) : (y)) /* minimum of x and y */
 
#define MAX(x, y)   (((x)>=(y)) ? (x) : (y)) /* maximum of x and y */
 
#define MOD(x, y)   ((x)%(y)) /* x modulus y */
 
#define LOG10(x)   ((x) > 0.0 ? log10((x)) : (x)) /* safe log10 of x */
 
#define SQR(x)   ((x)*(x)) /* x-squared */
 
#define SGN(x)   (((x)<0) ? (-1) : (1)) /* sign of x */
 
#define SIGN(x, y)   ((y) >= 0.0 ? fabs(x) : -fabs(x))
 
#define UCHAR(x)   (((x) >= 'a' && (x) <= 'z') ? ((x)&~32) : (x))
 
#define ARRAY_LENGTH(x)   (sizeof(x)/sizeof(x[0])) /* length of array x */
 
#define CALL(x)   (ErrorCode = ((ErrorCode>0) ? (ErrorCode) : (x)))
 

Macro Definition Documentation

◆ ABS

#define ABS (   x)    (((x)<0) ? -(x) : (x)) /* absolute value of x */

◆ ARRAY_LENGTH

#define ARRAY_LENGTH (   x)    (sizeof(x)/sizeof(x[0])) /* length of array x */

◆ CALL

#define CALL (   x)    (ErrorCode = ((ErrorCode>0) ? (ErrorCode) : (x)))

◆ FREE

#define FREE (   x)    { if (x) { free(x); x = NULL; } }

◆ LOG10

#define LOG10 (   x)    ((x) > 0.0 ? log10((x)) : (x)) /* safe log10 of x */

◆ MAX

#define MAX (   x,
  y 
)    (((x)>=(y)) ? (x) : (y)) /* maximum of x and y */

◆ MEMCHECK

#define MEMCHECK (   x)    (((x) == NULL) ? 101 : 0 )

◆ MIN

#define MIN (   x,
  y 
)    (((x)<=(y)) ? (x) : (y)) /* minimum of x and y */

◆ MOD

#define MOD (   x,
  y 
)    ((x)%(y)) /* x modulus y */

◆ SGN

#define SGN (   x)    (((x)<0) ? (-1) : (1)) /* sign of x */

◆ SIGN

#define SIGN (   x,
  y 
)    ((y) >= 0.0 ? fabs(x) : -fabs(x))

◆ SQR

#define SQR (   x)    ((x)*(x)) /* x-squared */

◆ UCHAR

#define UCHAR (   x)    (((x) >= 'a' && (x) <= 'z') ? ((x)&~32) : (x))