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

Commit6c51355

Browse files
committed
Eliminate duplicated code in dt.h
1 parentd19fc4c commit6c51355

File tree

1 file changed

+2
-24
lines changed
  • src/include/utils

1 file changed

+2
-24
lines changed

‎src/include/utils/dt.h

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: dt.h,v 1.36 1999/02/13 23:22:17 momjian Exp $
11+
* $Id: dt.h,v 1.37 1999/03/0622:58:11 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -270,29 +270,7 @@ extern intdatetime_is_epoch(double j);
270270

271271
externintday_tab[2][13];
272272

273-
#defineisleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0)
274-
275-
/* Julian date support for date2j() and j2date()
276-
* Set the minimum year to one greater than the year of the first valid day
277-
* to avoid having to check year and day both. - tgl 97/05/08
278-
*/
279-
280-
#defineJULIAN_MINYEAR (-4713)
281-
#defineJULIAN_MINMONTH (11)
282-
#defineJULIAN_MINDAY (23)
283-
284-
#defineIS_VALID_JULIAN(y,m,d) ((y > JULIAN_MINYEAR) \
285-
|| ((y == JULIAN_MINYEAR) && ((m > JULIAN_MINMONTH) \
286-
|| ((m == JULIAN_MINMONTH) && (d >= JULIAN_MINDAY)))))
287-
288-
/*
289-
* Date/time validation
290-
* Include check for leap year.
291-
*/
292-
293-
externintday_tab[2][13];
294-
295-
#defineisleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0)
273+
#defineisleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
296274

297275
/* Julian date support for date2j() and j2date()
298276
* Set the minimum year to one greater than the year of the first valid day

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp