Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf534820

Browse files
committed
Put parentheses around use of macro arguments in FMODULO and TMODULO.
1 parent09ff9db commitf534820

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎src/include/utils/datetime.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $PostgreSQL: pgsql/src/include/utils/datetime.h,v 1.52 2004/12/31 22:03:45 pgsql Exp $
12+
* $PostgreSQL: pgsql/src/include/utils/datetime.h,v 1.53 2005/05/24 04:03:01 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -203,8 +203,8 @@ typedef struct
203203
*/
204204
#defineFMODULO(t,q,u) \
205205
do { \
206-
q = ((t < 0) ? ceil(t /u) : floor(t /u)); \
207-
if (q != 0)t -= rint(q *u); \
206+
(q) = (((t) < 0) ? ceil((t) /(u)) : floor((t) /(u))); \
207+
if ((q) != 0)(t) -= rint((q) *(u)); \
208208
} while(0)
209209

210210
/* TMODULO()
@@ -215,14 +215,14 @@ do { \
215215
#ifdefHAVE_INT64_TIMESTAMP
216216
#defineTMODULO(t,q,u) \
217217
do { \
218-
q = (t /u); \
219-
if (q != 0)t -= (q *u); \
218+
(q) = ((t) /(u)); \
219+
if ((q) != 0)(t) -= ((q) *(u)); \
220220
} while(0)
221221
#else
222222
#defineTMODULO(t,q,u) \
223223
do { \
224-
q = ((t < 0) ? ceil(t /u) : floor(t /u)); \
225-
if (q != 0)t -= rint(q *u); \
224+
(q) = (((t) < 0) ? ceil((t) /(u)) : floor((t) /(u))); \
225+
if ((q) != 0)(t) -= rint((q) *(u)); \
226226
} while(0)
227227
#endif
228228

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp