From: Bruce Momjian Date: Tue, 24 May 2005 04:03:01 +0000 (+0000) Subject: Put parentheses around use of macro arguments in FMODULO and TMODULO. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=6a1c19c482c3787e801fbacd4d00aa4aa3b7e50c;p=users%2Fbernd%2Fpostgres.git Put parentheses around use of macro arguments in FMODULO and TMODULO. --- diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h index d279fd3785..c0477579cf 100644 --- a/src/include/utils/datetime.h +++ b/src/include/utils/datetime.h @@ -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