File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 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#define FMODULO (t ,q ,u ) \
205205do { \
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#ifdef HAVE_INT64_TIMESTAMP
216216#define TMODULO (t ,q ,u ) \
217217do { \
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#define TMODULO (t ,q ,u ) \
223223do { \
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
You can’t perform that action at this time.
0 commit comments