]> granicus.if.org Git - postgresql/commitdiff
Fix a few macro definitions to ensure that unary minus is enclosed in
authorNeil Conway <neilc@samurai.com>
Wed, 27 Jul 2005 12:44:10 +0000 (12:44 +0000)
committerNeil Conway <neilc@samurai.com>
Wed, 27 Jul 2005 12:44:10 +0000 (12:44 +0000)
parentheses. This avoids possible operator precedence problems, and
is consistent with most of the macro definitions in the tree.

src/backend/utils/adt/formatting.c
src/bin/pg_dump/pg_backup_archiver.h
src/include/getaddrinfo.h
src/include/rusagestub.h

index b473b9b13b4f388c24cb9b9053246b0adfa4c0a4..6c1a877c21f2edf03b505087797829b32b5890cd 100644 (file)
@@ -1,7 +1,7 @@
 /* -----------------------------------------------------------------------
  * formatting.c
  *
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.93 2005/07/23 14:25:33 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.94 2005/07/27 12:44:09 neilc Exp $
  *
  *
  *      Portions Copyright (c) 1999-2005, PostgreSQL Global Development Group
@@ -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; \
index 6d423d682c6608b6c813d3d98ddaccb99c78e188..d9a09e328586749b15da8b8048b1802eec311eff 100644 (file)
@@ -17,7 +17,7 @@
  *
  *
  * IDENTIFICATION
- *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.65 2005/06/21 20:45:44 tgl Exp $
+ *             $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.66 2005/07/27 12:44:10 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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
 {
index d71188c64709315200ede3b46dc8dc3e942be328..8c430bf5d85e4f1a0a3ec0313ec76b0303587899 100644 (file)
@@ -15,7 +15,7 @@
  *
  * Copyright (c) 2003-2005, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.14 2005/01/01 20:44:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.15 2005/07/27 12:44:10 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
 /* 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
index 45aaa5e3f29687f70ad4653177c9e3ebefbcb6db..527c8654bc2ef9e47ab9ce98ce3f73dc88ab7a94 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/rusagestub.h,v 1.15 2004/12/31 22:03:19 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/rusagestub.h,v 1.16 2005/07/27 12:44:10 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -21,7 +21,7 @@
 #include <limits.h>                            /* for CLK_TCK */
 
 #define RUSAGE_SELF            0
-#define RUSAGE_CHILDREN -1
+#define RUSAGE_CHILDREN (-1)
 
 struct rusage
 {