diff options
author | Neil Conway | 2005-07-27 12:44:10 +0000 |
---|---|---|
committer | Neil Conway | 2005-07-27 12:44:10 +0000 |
commit | 0f30bdb4f812da264c163e6b8b79e1e2b11b038e (patch) | |
tree | f8148b4ed7803f539d72dab5b9ffa5eec6b24154 | |
parent | cf100ef40db4e7e80a8cd0bc919f5b63bbc08caa (diff) |
Fix a few macro definitions to ensure that unary minus is enclosed in
parentheses. This avoids possible operator precedence problems, and
is consistent with most of the macro definitions in the tree.
-rw-r--r-- | src/backend/utils/adt/formatting.c | 16 | ||||
-rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.h | 2 | ||||
-rw-r--r-- | src/include/getaddrinfo.h | 18 | ||||
-rw-r--r-- | src/include/rusagestub.h | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 4bb6fc46fd..9954d31f81 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -292,7 +292,7 @@ typedef struct #define NUM_F_PLUS_POST (1 << 12) #define NUM_F_MINUS_POST (1 << 13) -#define NUM_LSIGN_PRE -1 +#define NUM_LSIGN_PRE (-1) #define NUM_LSIGN_POST 1 #define NUM_LSIGN_NONE 0 @@ -384,27 +384,27 @@ typedef struct yysz; /* is it YY or YYYY ? */ } TmFromChar; -#define ZERO_tmfc( _X ) memset(_X, 0, sizeof(TmFromChar)) +#define ZERO_tmfc(_X) memset(_X, 0, sizeof(TmFromChar)) /* ---------- * Debug * ---------- */ #ifdef DEBUG_TO_FROM_CHAR -#define DEBUG_TMFC( _X ) \ +#define DEBUG_TMFC(_X) \ elog(DEBUG_elog_output, "TMFC:\nhh %d\nam %d\npm %d\nmi %d\nss %d\nssss %d\nd %d\ndd %d\nddd %d\nmm %d\nms: %d\nyear %d\nbc %d\niw %d\nww %d\nw %d\ncc %d\nq %d\nj %d\nus: %d\nyysz: %d", \ (_X)->hh, (_X)->am, (_X)->pm, (_X)->mi, (_X)->ss, \ (_X)->ssss, (_X)->d, (_X)->dd, (_X)->ddd, (_X)->mm, (_X)->ms, \ (_X)->year, (_X)->bc, (_X)->iw, (_X)->ww, (_X)->w, \ (_X)->cc, (_X)->q, (_X)->j, (_X)->us, (_X)->yysz); -#define DEBUG_TM( _X ) \ +#define DEBUG_TM(_X) \ elog(DEBUG_elog_output, "TM:\nsec %d\nyear %d\nmin %d\nwday %d\nhour %d\nyday %d\nmday %d\nnisdst %d\nmon %d\n",\ (_X)->tm_sec, (_X)->tm_year,\ (_X)->tm_min, (_X)->tm_wday, (_X)->tm_hour, (_X)->tm_yday,\ (_X)->tm_mday, (_X)->tm_isdst, (_X)->tm_mon) #else -#define DEBUG_TMFC( _X ) -#define DEBUG_TM( _X ) +#define DEBUG_TMFC(_X) +#define DEBUG_TM(_X) #endif /* ---------- @@ -422,14 +422,14 @@ typedef struct TmToChar #define tmtcTzn(_X) ((_X)->tzn) #define tmtcFsec(_X) ((_X)->fsec) -#define ZERO_tm( _X ) \ +#define ZERO_tm(_X) \ do { \ (_X)->tm_sec = (_X)->tm_year = (_X)->tm_min = (_X)->tm_wday = \ (_X)->tm_hour = (_X)->tm_yday = (_X)->tm_isdst = 0; \ (_X)->tm_mday = (_X)->tm_mon = 1; \ } while(0) -#define ZERO_tmtc( _X ) \ +#define ZERO_tmtc(_X) \ do { \ ZERO_tm( tmtcTm(_X) ); \ tmtcFsec(_X) = 0; \ diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h index 99a43302cc..6250b0e37c 100644 --- a/src/bin/pg_dump/pg_backup_archiver.h +++ b/src/bin/pg_dump/pg_backup_archiver.h @@ -49,7 +49,7 @@ #define GZCLOSE(fh) fclose(fh) #define GZWRITE(p, s, n, fh) (fwrite(p, s, n, fh) * (s)) #define GZREAD(p, s, n, fh) fread(p, s, n, fh) -#define Z_DEFAULT_COMPRESSION -1 +#define Z_DEFAULT_COMPRESSION (-1) typedef struct _z_stream { diff --git a/src/include/getaddrinfo.h b/src/include/getaddrinfo.h index e8dde82908..8918a6a2e4 100644 --- a/src/include/getaddrinfo.h +++ b/src/include/getaddrinfo.h @@ -31,15 +31,15 @@ /* Various macros that ought to be in <netdb.h>, but might not be */ #ifndef EAI_FAIL -#define EAI_BADFLAGS -1 -#define EAI_NONAME -2 -#define EAI_AGAIN -3 -#define EAI_FAIL -4 -#define EAI_FAMILY -6 -#define EAI_SOCKTYPE -7 -#define EAI_SERVICE -8 -#define EAI_MEMORY -10 -#define EAI_SYSTEM -11 +#define EAI_BADFLAGS (-1) +#define EAI_NONAME (-2) +#define EAI_AGAIN (-3) +#define EAI_FAIL (-4) +#define EAI_FAMILY (-6) +#define EAI_SOCKTYPE (-7) +#define EAI_SERVICE (-8) +#define EAI_MEMORY (-10) +#define EAI_SYSTEM (-11) #endif #ifndef AI_PASSIVE diff --git a/src/include/rusagestub.h b/src/include/rusagestub.h index 8d0161496f..8b19945341 100644 --- a/src/include/rusagestub.h +++ b/src/include/rusagestub.h @@ -21,7 +21,7 @@ #include <limits.h> /* for CLK_TCK */ #define RUSAGE_SELF 0 -#define RUSAGE_CHILDREN -1 +#define RUSAGE_CHILDREN (-1) struct rusage { |