]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 521] calleapwhen.c is obsolete
authorHarlan Stenn <stenn@ntp.org>
Fri, 28 Oct 2005 02:12:21 +0000 (22:12 -0400)
committerHarlan Stenn <stenn@ntp.org>
Fri, 28 Oct 2005 02:12:21 +0000 (22:12 -0400)
bk: 43618905bJBGoABdydnRS7GtRSSfrA

include/ntp_stdlib.h
libntp/Makefile.am
libntp/calleapwhen.c [deleted file]
ports/winnt/libntp/libntp.dsp

index bfebb542c957579c0da27c4f6f04b4823f17bf3b..3e15bc301a37ba7a2a7cd75ab964096ba9b3978a 100644 (file)
@@ -47,7 +47,6 @@ extern        int     authreadkeys    P((const char *));
 extern void    authtrust       P((keyid_t, u_long));
 extern int     authusekey      P((keyid_t, int, const u_char *));
 
-extern u_long  calleapwhen     P((u_long));
 extern u_long  calyearstart    P((u_long));
 extern const char *clockname   P((int));
 extern int     clocktime       P((int, int, int, int, int, u_long, u_long *, u_int32 *));
index 9047ea8e0f9885e67c20c6ac387238667690671f..932f87b10643e76e44484637fc3edc328d980e5a 100644 (file)
@@ -4,7 +4,7 @@ noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@
 EXTRA_LIBRARIES = libntpsim.a
 libntp_a_SRCS = a_md5encrypt.c adjtime.c atoint.c atolfp.c atouint.c \
        audio.c authkeys.c authreadkeys.c authusekey.c buftvtots.c \
-       caljulian.c calleapwhen.c caltontp.c calyearstart.c clocktime.c \
+       caljulian.c caltontp.c calyearstart.c clocktime.c \
        clocktypes.c decodenetnum.c dofptoa.c dolfptoa.c emalloc.c \
        findconfig.c fptoa.c fptoms.c getopt.c hextoint.c \
        hextolfp.c humandate.c icom.c inttoa.c iosignal.c \
diff --git a/libntp/calleapwhen.c b/libntp/calleapwhen.c
deleted file mode 100644 (file)
index c954901..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * calleapwhen - determine the number of seconds to the next possible
- *              leap occurance.
- */
-#include <sys/types.h>
-
-#include "ntp_types.h"
-#include "ntp_calendar.h"
-#include "ntp_stdlib.h"
-
-/*
- * calleaptab - leaps occur at the end of December and June
- */
-long calleaptab[10] = {
-       -(JAN+FEBLEAP)*SECSPERDAY,      /* leap previous to cycle */
-       (MAR+APR+MAY+JUN)*SECSPERDAY,   /* end of June */
-       (MAR+APR+MAY+JUN+JUL+AUG+SEP+OCT+NOV+DEC)*SECSPERDAY, /* end of Dec */
-       (MAR+APR+MAY+JUN)*SECSPERDAY + SECSPERYEAR,
-       (MAR+APR+MAY+JUN+JUL+AUG+SEP+OCT+NOV+DEC)*SECSPERDAY + SECSPERYEAR,
-       (MAR+APR+MAY+JUN)*SECSPERDAY + 2*SECSPERYEAR,
-       (MAR+APR+MAY+JUN+JUL+AUG+SEP+OCT+NOV+DEC)*SECSPERDAY + 2*SECSPERYEAR,
-       (MAR+APR+MAY+JUN)*SECSPERDAY + 3*SECSPERYEAR,
-       (MAR+APR+MAY+JUN+JUL+AUG+SEP+OCT+NOV+DEC)*SECSPERDAY + 3*SECSPERYEAR,
-       (MAR+APR+MAY+JUN+JUL+AUG+SEP+OCT+NOV+DEC+JAN+FEBLEAP+MAR+APR+MAY+JUN)
-       *SECSPERDAY + 3*SECSPERYEAR,    /* next after current cycle */
-};
-
-u_long
-calleapwhen(
-       u_long ntpdate
-       )
-{
-       register u_long dateincycle;
-       register int i;
-
-       /*
-        * Find the offset from the start of the cycle
-        */
-       dateincycle = ntpdate;
-       if (dateincycle >= MAR1988)
-           dateincycle -= MAR1988;
-       else
-           dateincycle -= MAR1900;
-
-       while (dateincycle >= SECSPERCYCLE)
-           dateincycle -= SECSPERCYCLE;
-
-       /*
-        * Find where we are with respect to the leap events.
-        */
-       for (i = 1; i < 9; i++)
-           if (dateincycle < (u_long)calleaptab[i])
-               break;
-       
-       /*
-        * i points at the next leap.  Compute the last and the next.
-        */
-       return (u_long)(calleaptab[i] - (long)dateincycle);
-}
index 9ecdbd3062a7cfad4268534ec42a93df743eb145..abac36c9514887cf40b212a69d9b2c831fef10fb 100644 (file)
@@ -130,10 +130,6 @@ SOURCE=..\..\..\libntp\caljulian.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\..\..\libntp\calleapwhen.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\..\..\libntp\caltontp.c
 # End Source File
 # Begin Source File