Skip to content

Commit 6c51355

Browse files
committed
Eliminate duplicated code in dt.h
1 parent d19fc4c commit 6c51355

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/06 22:58:11 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -270,29 +270,7 @@ extern int datetime_is_epoch(double j);
270270

271271
extern int day_tab[2][13];
272272

273-
#define isleap(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-
#define JULIAN_MINYEAR (-4713)
281-
#define JULIAN_MINMONTH (11)
282-
#define JULIAN_MINDAY (23)
283-
284-
#define IS_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-
extern int day_tab[2][13];
294-
295-
#define isleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0)
273+
#define isleap(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)
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