4e4f5951fed8f4d923dcbbc313b3596c62374091 tdreszer Mon Jun 25 12:13:22 2012 -0700 Next batch of many checkins as dictated by Jim. Formatting space after if and limiting lines to 100 chars. Changes limited to lines last touched by tdreszer (git blame) so as not to ruin history. None of these changes should affect executables in any way. Only affect is to my sanity and Jim's. diff --git src/inc/common.h src/inc/common.h index c38c706..7fbd2ae 100644 --- src/inc/common.h +++ src/inc/common.h @@ -1372,34 +1372,39 @@ * prints a message, following by a new line, and then the stack track. Just * prints errors to stderr rather than aborts. For debugging purposes * only. */ void dumpStack(char *format, ...) /* debugging function to run the pstack program on the current process. In * prints a message, following by a new line, and then the stack track. Just * prints errors to stderr rather than aborts. For debugging purposes * only. */ #if defined(__GNUC__) __attribute__((format(printf, 1, 2))) #endif ; // SETTING_ON set of macros are frequently used comparisons of string values for boolean questions. -// Notice the subtle difference between NOT_ON and IS_OFF. NOT_ON could be NULL but IS_OFF must be explicitly set -#define SETTING_IS_ON(setting) (setting && (sameWord(setting,"on") || sameWord(setting,"true") || sameWord(setting,"yes") || sameWord(setting,"enabled") || atoi(setting) != 0)) +// Notice the subtle difference between NOT_ON and IS_OFF. +// NOT_ON could be NULL but IS_OFF must be explicitly set +#define SETTING_IS_ON(setting) ( setting && (sameWord(setting,"on") || sameWord(setting,"true") \ + || sameWord(setting,"yes") || sameWord(setting,"enabled") \ + || atoi(setting) != 0) ) #define SETTING_NOT_ON(setting) (!SETTING_IS_ON(setting)) -#define SETTING_IS_OFF(setting) (setting && (sameWord(setting,"off") || sameWord(setting,"false") || sameWord(setting,"no") || sameWord(setting,"disabled") || sameWord(setting,"0"))) +#define SETTING_IS_OFF(setting) ( setting && (sameWord(setting,"off") \ + || sameWord(setting,"false") || sameWord(setting,"no") \ + || sameWord(setting,"disabled") || sameWord(setting,"0")) ) // Standard bit mask macros #define BITS_ADD( flags,bits) ((flags) = ((flags) | (bits))) #define BITS_REMOVE( flags,bits) ((flags) = ((flags) & ~(bits))) #define BITS_ARE_ON( flags,bits) (((flags) & (bits)) == (bits)) #define BITS_ARE_OFF(flags,bits) (((flags) & (bits)) == 0) // It is sometimes useful to distinguish between 3 "boolean" states: TRUE, FALSE and UNKNOWN enum enumBool { beUnknown=0, // Not yet set ebYes=1, // already set to TRUE ebNo=-1 // already set to FALSE }; #define SET_TO_YES(ebool) { (ebool) = ebYes; }