summaryrefslogtreecommitdiff
path: root/astro
diff options
context:
space:
mode:
authorHidetoshi Shimokawa <simokawa@FreeBSD.org>1999-01-03 08:42:20 +0000
committerHidetoshi Shimokawa <simokawa@FreeBSD.org>1999-01-03 08:42:20 +0000
commit1b5f38c70f6f18a56546fff5d5c31d4b15f7502d (patch)
treebc7503ce77c188e0a39f55fc0c97f9cc2890e070 /astro
parent- fix time_t conflicts on alpha (diff)
Fix time() conflicts on alpha.
- disable "long time()". - suppress warnings of time.c.
Diffstat (limited to 'astro')
-rw-r--r--astro/ephem/files/patch-ai97
1 files changed, 92 insertions, 5 deletions
diff --git a/astro/ephem/files/patch-ai b/astro/ephem/files/patch-ai
index 4e21c91b8bd6..007efb6fa346 100644
--- a/astro/ephem/files/patch-ai
+++ b/astro/ephem/files/patch-ai
@@ -1,7 +1,7 @@
-*** time.c.orig Sat Mar 14 23:22:29 1992
---- time.c Wed Apr 23 13:15:42 1997
+*** time.c.orig Sun Mar 15 07:22:29 1992
+--- time.c Sun Jan 3 17:28:45 1999
***************
-*** 13,20 ****
+*** 13,37 ****
* returning 0.
*/
@@ -10,10 +10,80 @@
#ifdef VMS
#undef TZA
#undef TZB
---- 13,18 ----
+ #endif
+
+ #include <stdio.h>
+ #include <time.h>
+
+ #include "astro.h"
+ #include "circum.h"
+
+ extern char *strncpy();
+ #ifndef VMS
+ extern long time();
+ #endif
+
+! static long c0;
+ static double mjd0;
+
+ /* save current mjd and corresponding system clock for use by inc_mjd().
+--- 13,42 ----
+ * returning 0.
+ */
+
+ #ifdef VMS
+ #undef TZA
+ #undef TZB
+ #endif
+
+ #include <stdio.h>
++ #include <string.h>
+ #include <time.h>
+
++ #if (defined(__unix__) || defined(unix)) && !defined(USG)
++ #include <sys/param.h>
++ #endif
++
+ #include "astro.h"
+ #include "circum.h"
+
++ #if !(defined(BSD) && BSD >= 199306)
+ extern char *strncpy();
+ #ifndef VMS
+ extern long time();
+ #endif
++ #endif
+
+! static time_t c0;
+ static double mjd0;
+
+ /* save current mjd and corresponding system clock for use by inc_mjd().
+***************
+*** 49,57 ****
+ time_fromsys (np)
+ Now *np;
+ {
+ extern struct tm *gmtime(), *localtime();
+ struct tm *tp;
+! long c;
+ double day, hr;
+
+ (void) time (&c);
+--- 54,64 ----
+ time_fromsys (np)
+ Now *np;
+ {
++ #if !(defined(BSD) && BSD >= 199306)
+ extern struct tm *gmtime(), *localtime();
++ #endif
+ struct tm *tp;
+! time_t c;
+ double day, hr;
+
+ (void) time (&c);
***************
*** 62,68 ****
---- 60,71 ----
+--- 69,80 ----
sex_dec (tp->tm_hour, tp->tm_min, tp->tm_sec, &hr);
mjd = day + hr/24.0;
tp = localtime (&c);
@@ -26,3 +96,20 @@
} else {
/* if gmtime() doesn't work, we assume the timezone stuff won't
* either, so we just use what it is and leave it alone. Some
+***************
+*** 114,120 ****
+ double inc;
+ {
+ if (inc == RTC) {
+! long c;
+ (void) time (&c);
+ mjd = mjd0 + (c - c0)/SPD;
+ } else
+--- 126,132 ----
+ double inc;
+ {
+ if (inc == RTC) {
+! time_t c;
+ (void) time (&c);
+ mjd = mjd0 + (c - c0)/SPD;
+ } else