mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Fix macros that were not properly surrounded by parens or braces.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.24 1998/02/26 04:36:57 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.25 1998/06/15 18:39:34 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This code is actually (almost) unused.
|
||||
@@ -187,8 +187,11 @@ reltimeout(int32 time)
|
||||
} /* reltimeout() */
|
||||
|
||||
|
||||
#define TMODULO(t,q,u) {q = (t / u); \
|
||||
if (q != 0) t -= (q * u);}
|
||||
#define TMODULO(t,q,u) \
|
||||
do { \
|
||||
q = (t / u); \
|
||||
if (q != 0) t -= (q * u); \
|
||||
} while(0)
|
||||
|
||||
static void
|
||||
reltime2tm(int32 time, struct tm * tm)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.53 1998/05/09 22:38:18 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.54 1998/06/15 18:39:37 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -66,8 +66,12 @@ char *days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
|
||||
/* TMODULO()
|
||||
* Macro to replace modf(), which is broken on some platforms.
|
||||
*/
|
||||
#define TMODULO(t,q,u) {q = ((t < 0)? ceil(t / u): floor(t / u)); \
|
||||
if (q != 0) t -= rint(q * u);}
|
||||
#define TMODULO(t,q,u) \
|
||||
do { \
|
||||
q = ((t < 0)? ceil(t / u): floor(t / u)); \
|
||||
if (q != 0) \
|
||||
t -= rint(q * u); \
|
||||
} while(0)
|
||||
|
||||
static void GetEpochTime(struct tm * tm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user