mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Put parentheses around use of macro arguments in FMODULO and TMODULO.
This commit is contained in:
parent
09ff9dbe2b
commit
f534820d4d
@ -9,7 +9,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/utils/datetime.h,v 1.52 2004/12/31 22:03:45 pgsql Exp $
|
* $PostgreSQL: pgsql/src/include/utils/datetime.h,v 1.53 2005/05/24 04:03:01 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -203,8 +203,8 @@ typedef struct
|
|||||||
*/
|
*/
|
||||||
#define FMODULO(t,q,u) \
|
#define FMODULO(t,q,u) \
|
||||||
do { \
|
do { \
|
||||||
q = ((t < 0) ? ceil(t / u) : floor(t / u)); \
|
(q) = (((t) < 0) ? ceil((t) / (u)) : floor((t) / (u))); \
|
||||||
if (q != 0) t -= rint(q * u); \
|
if ((q) != 0) (t) -= rint((q) * (u)); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
/* TMODULO()
|
/* TMODULO()
|
||||||
@ -215,14 +215,14 @@ do { \
|
|||||||
#ifdef HAVE_INT64_TIMESTAMP
|
#ifdef HAVE_INT64_TIMESTAMP
|
||||||
#define TMODULO(t,q,u) \
|
#define TMODULO(t,q,u) \
|
||||||
do { \
|
do { \
|
||||||
q = (t / u); \
|
(q) = ((t) / (u)); \
|
||||||
if (q != 0) t -= (q * u); \
|
if ((q) != 0) (t) -= ((q) * (u)); \
|
||||||
} while(0)
|
} while(0)
|
||||||
#else
|
#else
|
||||||
#define TMODULO(t,q,u) \
|
#define TMODULO(t,q,u) \
|
||||||
do { \
|
do { \
|
||||||
q = ((t < 0) ? ceil(t / u) : floor(t / u)); \
|
(q) = (((t) < 0) ? ceil((t) / (u)) : floor((t) / (u))); \
|
||||||
if (q != 0) t -= rint(q * u); \
|
if ((q) != 0) (t) -= rint((q) * (u)); \
|
||||||
} while(0)
|
} while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user