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

Commitb1f10c8

Browse files
committed
Ensure macros are adequately parenthesized.
1 parentfa9a95d commitb1f10c8

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 intday_tab[2][13];
218219
#defineJULIAN_MINMONTH (11)
219220
#defineJULIAN_MINDAY (23)
220221

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

225226
#defineUTIME_MINYEAR (1901)
226227
#defineUTIME_MINMONTH (12)
@@ -229,12 +230,12 @@ extern intday_tab[2][13];
229230
#defineUTIME_MAXMONTH (01)
230231
#defineUTIME_MAXDAY (18)
231232

232-
#defineIS_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+
#defineIS_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
externvoidGetCurrentTime(structtm*tm);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp