Skip to content

Commit b1f10c8

Browse files
committed
Ensure macros are adequately parenthesized.
1 parent fa9a95d commit b1f10c8

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/include/utils/datetime.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $Id: datetime.h,v 1.19 2001/06/18 16:14:43 momjian Exp $
12+
* $Id: datetime.h,v 1.20 2001/07/10 01:39:20 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -19,6 +19,7 @@
1919
#include <time.h>
2020
#include <math.h>
2121
#include <limits.h>
22+
2223
#include "utils/timestamp.h"
2324

2425

@@ -218,9 +219,9 @@ extern int day_tab[2][13];
218219
#define JULIAN_MINMONTH (11)
219220
#define JULIAN_MINDAY (23)
220221

221-
#define IS_VALID_JULIAN(y,m,d) ((y > JULIAN_MINYEAR) \
222-
|| ((y == JULIAN_MINYEAR) && ((m > JULIAN_MINMONTH) \
223-
|| ((m == JULIAN_MINMONTH) && (d >= JULIAN_MINDAY)))))
222+
#define IS_VALID_JULIAN(y,m,d) (((y) > JULIAN_MINYEAR) \
223+
|| (((y) == JULIAN_MINYEAR) && (((m) > JULIAN_MINMONTH) \
224+
|| (((m) == JULIAN_MINMONTH) && ((d) >= JULIAN_MINDAY)))))
224225

225226
#define UTIME_MINYEAR (1901)
226227
#define UTIME_MINMONTH (12)
@@ -229,12 +230,12 @@ extern int day_tab[2][13];
229230
#define UTIME_MAXMONTH (01)
230231
#define UTIME_MAXDAY (18)
231232

232-
#define IS_VALID_UTIME(y,m,d) (((y > UTIME_MINYEAR) \
233-
|| ((y == UTIME_MINYEAR) && ((m > UTIME_MINMONTH) \
234-
|| ((m == UTIME_MINMONTH) && (d >= UTIME_MINDAY))))) \
235-
&& ((y < UTIME_MAXYEAR) \
236-
|| ((y == UTIME_MAXYEAR) && ((m < UTIME_MAXMONTH) \
237-
|| ((m == UTIME_MAXMONTH) && (d <= UTIME_MAXDAY))))))
233+
#define IS_VALID_UTIME(y,m,d) ((((y) > UTIME_MINYEAR) \
234+
|| (((y) == UTIME_MINYEAR) && (((m) > UTIME_MINMONTH) \
235+
|| (((m) == UTIME_MINMONTH) && ((d) >= UTIME_MINDAY))))) \
236+
&& (((y) < UTIME_MAXYEAR) \
237+
|| (((y) == UTIME_MAXYEAR) && (((m) < UTIME_MAXMONTH) \
238+
|| (((m) == UTIME_MAXMONTH) && ((d) <= UTIME_MAXDAY))))))
238239

239240

240241
extern void GetCurrentTime(struct tm * tm);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy