Put parentheses around use of macro arguments in FMODULO and TMODULO.
authorBruce Momjian <bruce@momjian.us>
Tue, 24 May 2005 04:03:01 +0000 (04:03 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 24 May 2005 04:03:01 +0000 (04:03 +0000)
src/include/utils/datetime.h

index d279fd378517b49e77e94df8fc51f0f07cd0f4d1..c0477579cffeac07117c8d8a614ded954e696747 100644 (file)
@@ -203,8 +203,8 @@ typedef struct
  */
 #define FMODULO(t,q,u) \
 do { \
-       q = ((t < 0) ? ceil(t / u) : floor(t / u)); \
-       if (q != 0) t -= rint(q * u); \
+       (q) = (((t) < 0) ? ceil((t) / (u)) : floor((t) / (u))); \
+       if ((q) != 0) (t) -= rint((q) * (u)); \
 } while(0)
 
 /* TMODULO()
@@ -215,14 +215,14 @@ do { \
 #ifdef HAVE_INT64_TIMESTAMP
 #define TMODULO(t,q,u) \
 do { \
-       q = (t / u); \
-       if (q != 0) t -= (q * u); \
+       (q) = ((t) / (u)); \
+       if ((q) != 0) (t) -= ((q) * (u)); \
 } while(0)
 #else
 #define TMODULO(t,q,u) \
 do { \
-       q = ((t < 0) ? ceil(t / u) : floor(t / u)); \
-       if (q != 0) t -= rint(q * u); \
+       (q) = (((t) < 0) ? ceil((t) / (u)) : floor((t) / (u))); \
+       if ((q) != 0) (t) -= rint((q) * (u)); \
 } while(0)
 #endif