1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

- Fix build with gcc41

- Update maintainer's address

PR:		ports/108190
Submitted by:	Slaven Rezic <slaven@rezic.de> (maintainer)
This commit is contained in:
Pav Lucistnik 2007-01-24 23:18:05 +00:00
parent 66644b44ca
commit 409980699a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=183226
21 changed files with 469 additions and 231 deletions

View File

@ -12,7 +12,7 @@ MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= trevor
DISTNAME= ${PORTNAME}_${PORTVERSION}_unix
MAINTAINER= eserte@cs.tu-berlin.de
MAINTAINER= slaven@rezic.de
COMMENT= An interactive terminal-based astronomical ephemeris program
NO_WRKSUBDIR= yes

View File

@ -0,0 +1,12 @@
diff -u aa_hadec.c.orig aa_hadec.c
--- aa_hadec.c.orig Sat Mar 14 23:21:50 1992
+++ aa_hadec.c Sun Jan 21 20:33:08 2007
@@ -2,6 +2,8 @@
#include <math.h>
#include "astro.h"
+static aaha_aux (double lat, double x, double y, double *p, double *q);
+
/* given latitude (n+, radians), lat, altitude (up+, radians), alt, and
* azimuth (angle round to the east from north+, radians),
* return hour angle (radians), ha, and declination (radians), dec.

View File

@ -1,70 +1,62 @@
*** io.c.orig Wed Apr 3 13:26:53 1996
--- io.c Wed Apr 3 15:13:25 1996
***************
*** 35,50 ****
/* then if you defined UNIX you must use one of these ways to do non-blocking
* tty reads
*/
! #define USE_FIONREAD
! /* #define USE_NDELAY */
/* #define USE_ATTSELECT */
/* #define USE_BSDSELECT */
/* and then if you defined UNIX you must also use one of these ways to control
* the tty modes.
*/
! #define USE_TERMIO
! /* #define USE_SGTTY */
/* if you defined TURBO_C you might want this too if screen io looks garbled */
/* #define USE_ANSISYS */
--- 35,50 ----
/* then if you defined UNIX you must use one of these ways to do non-blocking
* tty reads
*/
! /* #define USE_FIONREAD */
! #define USE_NDELAY
/* #define USE_ATTSELECT */
/* #define USE_BSDSELECT */
/* and then if you defined UNIX you must also use one of these ways to control
* the tty modes.
*/
! /* #define USE_TERMIO */
! #define USE_SGTTY
/* if you defined TURBO_C you might want this too if screen io looks garbled */
/* #define USE_ANSISYS */
***************
*** 199,209 ****
seqa[0] = c;
if (l > 1) {
extern unsigned alarm();
/* cautiously read rest of arrow sequence */
got_alrm = 0;
(void) signal (SIGALRM, on_alrm);
alarm(2);
! read (0, seqa+1, l-1);
alarm(0);
if (got_alrm)
return (c);
--- 199,217 ----
seqa[0] = c;
if (l > 1) {
extern unsigned alarm();
+ int ch_read, ch_expected, seqa_i;
/* cautiously read rest of arrow sequence */
got_alrm = 0;
(void) signal (SIGALRM, on_alrm);
alarm(2);
! /* to make the arrow keys work with FreeBSD ... */
! ch_expected = l-1;
! seqa_i = 1;
! while ((ch_read = read (0, seqa+seqa_i, ch_expected)) > 0 &&
! ch_read < ch_expected) {
! ch_expected -= ch_read;
! seqa_i += ch_read;
! }
alarm(0);
if (got_alrm)
return (c);
--- io.c.orig Sat Mar 14 23:22:07 1992
+++ io.c Sun Jan 21 20:46:00 2007
@@ -28,6 +28,17 @@
* need to #define VMS since it is inherent in the compiler.
*/
+#include <signal.h>
+#include <string.h>
+#include <stdlib.h>
+
+static on_alrm();
+static chk_arrow (register char c);
+static tload();
+static char *egetstr (char *name, char **sptr);
+static setuptty();
+
+
/* unless you are on VMS define one of these... */
#define UNIX
/* #define TURBO_C */
@@ -35,16 +46,16 @@
/* then if you defined UNIX you must use one of these ways to do non-blocking
* tty reads
*/
-#define USE_FIONREAD
-/* #define USE_NDELAY */
+/* #define USE_FIONREAD */
+#define USE_NDELAY
/* #define USE_ATTSELECT */
/* #define USE_BSDSELECT */
/* and then if you defined UNIX you must also use one of these ways to control
* the tty modes.
*/
-#define USE_TERMIO
-/* #define USE_SGTTY */
+/* #define USE_TERMIO */
+#define USE_SGTTY
/* if you defined TURBO_C you might want this too if screen io looks garbled */
/* #define USE_ANSISYS */
@@ -199,11 +210,19 @@
seqa[0] = c;
if (l > 1) {
extern unsigned alarm();
+ int ch_read, ch_expected, seqa_i;
/* cautiously read rest of arrow sequence */
got_alrm = 0;
(void) signal (SIGALRM, on_alrm);
alarm(2);
- read (0, seqa+1, l-1);
+ /* to make the arrow keys work with FreeBSD ... */
+ ch_expected = l-1;
+ seqa_i = 1;
+ while ((ch_read = read (0, seqa+seqa_i, ch_expected)) > 0 &&
+ ch_read < ch_expected) {
+ ch_expected -= ch_read;
+ seqa_i += ch_read;
+ }
alarm(0);
if (got_alrm)
return (c);

View File

@ -1,36 +1,41 @@
*** listing.c.orig Tue Apr 15 01:07:37 1997
--- listing.c Tue Apr 15 01:38:22 1997
***************
*** 12,22 ****
extern char *strcpy();
#ifdef VMS
#include <perror.h>
- #include <errno.h>
#else
extern char *sys_errlist[];
extern errno;
#endif
--- 12,31 ----
extern char *strcpy();
+ #if (defined(__unix__) || defined(unix)) && !defined(USG)
+ #include <sys/param.h>
+ #endif
+
+ #if defined(VMS) || defined(unix)
+ #include <errno.h>
+ #endif
+
#ifdef VMS
#include <perror.h>
#else
+ #ifndef BSD
extern char *sys_errlist[];
+ #endif
extern errno;
#endif
--- listing.c.orig Sat Mar 14 23:22:09 1992
+++ listing.c Sun Jan 21 20:48:40 2007
@@ -6,21 +6,36 @@
* format of the listing file is one line per screen update.
*/
+#include <string.h>
#include <stdio.h>
#include <math.h>
#include "screen.h"
-extern char *strcpy();
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
+#if defined(VMS) || defined(unix)
+#include <errno.h>
+#endif
#ifdef VMS
#include <perror.h>
-#include <errno.h>
#else
+#ifndef BSD
extern char *sys_errlist[];
+#endif
extern errno;
#endif
#define errsys (sys_errlist[errno])
+
+static lst_reset();
+static lst_select_fields();
+static lst_turn_off();
+static lst_turn_on();
+static lst_file();
+static display_listing_file(FILE *lfp);
#define TRACE(x) {FILE *fp = fopen("trace","a"); fprintf x; fclose(fp);}

View File

@ -1,55 +1,59 @@
*** main.c.orig Sat Mar 14 16:22:10 1992
--- main.c Fri Jan 14 09:56:45 2000
***************
*** 16,24 ****
#include <signal.h>
#include <setjmp.h>
#include <math.h>
! #ifdef VMS
#include <stdlib.h>
#endif
#include "astro.h"
#include "circum.h"
#include "screen.h"
--- 16,25 ----
#include <signal.h>
#include <setjmp.h>
#include <math.h>
! #if defined(VMS) || defined(unix)
#include <stdlib.h>
#endif
+ #include <time.h>
#include "astro.h"
#include "circum.h"
#include "screen.h"
***************
*** 51,57 ****
--- 52,62 ----
static jmp_buf fpe_err_jmp; /* used to recover from SIGFPE */
static char *cfgfile; /* !0 if -c used */
+ #ifdef unix
+ static char cfgdef[] = PREFIX "/share/ephem/ephem.cfg"; /* default configuration file name */
+ #else
static char cfgdef[] = "ephem.cfg"; /* default configuration file name */
+ #endif
static Now now; /* where when and how, right now */
static double tminc; /* hrs to inc time by each loop; RTC means use clock */
static int nstep; /* steps to go before stopping */
***************
*** 1006,1012 ****
*/
slp_sync()
{
! extern long time();
if (spause > 0 && !plot_ison() && !srch_ison() && !listing_ison()) {
int n;
--- 1011,1017 ----
*/
slp_sync()
{
! /*extern long time();*/
if (spause > 0 && !plot_ison() && !srch_ison() && !listing_ison()) {
int n;
--- main.c.orig Sat Mar 14 23:22:10 1992
+++ main.c Sun Jan 21 20:51:46 2007
@@ -16,15 +16,26 @@
#include <signal.h>
#include <setjmp.h>
#include <math.h>
-#ifdef VMS
+#if defined(VMS) || defined(unix)
#include <stdlib.h>
#endif
+#include <time.h>
#include "astro.h"
#include "circum.h"
#include "screen.h"
+#include <string.h>
+#include <stdlib.h>
-extern char *strncpy();
-extern char *getenv();
+static read_cfgfile();
+static void on_fpe();
+static read_fieldargs(int ac, char *av[]);
+static crack_fieldset(char *buf);
+static chg_fld(char *bp, int *fld);
+static print_tminc(int force);
+static print_alt(int howmuch);
+static print_nstep(int force);
+static print_spause(int force);
+static toggle_body(int p);
/* shorthands for fields of a Now structure, now.
* first undo the ones for a Now pointer from circum.h.
@@ -51,7 +62,11 @@
static jmp_buf fpe_err_jmp; /* used to recover from SIGFPE */
static char *cfgfile; /* !0 if -c used */
+#ifdef unix
+static char cfgdef[] = PREFIX "/share/ephem/ephem.cfg"; /* default configuration file name */
+#else
static char cfgdef[] = "ephem.cfg"; /* default configuration file name */
+#endif
static Now now; /* where when and how, right now */
static double tminc; /* hrs to inc time by each loop; RTC means use clock */
static int nstep; /* steps to go before stopping */
@@ -1006,12 +1021,12 @@
*/
slp_sync()
{
- extern long time();
+ /*extern long time();*/
if (spause > 0 && !plot_ison() && !srch_ison() && !listing_ison()) {
int n;
if (tminc == RTC) {
- long t;
+ time_t t;
(void) time (&t);
n = spause - (t % spause);
} else

View File

@ -1,33 +1,44 @@
*** objx.c.orig Tue Apr 15 01:07:37 1997
--- objx.c Tue Apr 15 01:33:17 1997
***************
*** 6,12 ****
#include <stdio.h>
#include <math.h>
#include <ctype.h>
! #ifdef VMS
#include <stdlib.h>
#endif
#include "astro.h"
--- 6,12 ----
#include <stdio.h>
#include <math.h>
#include <ctype.h>
! #if defined(VMS) || defined(unix)
#include <stdlib.h>
#endif
#include "astro.h"
***************
*** 16,22 ****
--- 16,26 ----
extern char *strcat(), *strcpy(), *strncpy(), *getenv();
static char *dbfile; /* !0 if set by -d option */
+ #ifdef unix
+ static char dbfdef[] = PREFIX "/share/ephem/ephem.db"; /* default database file name */
+ #else
static char dbfdef[] = "ephem.db"; /* default database file name */
+ #endif
/* structures to describe objects of various types.
*/
--- objx.c.orig Sat Mar 14 23:22:15 1992
+++ objx.c Sun Jan 21 20:59:07 2007
@@ -6,17 +6,20 @@
#include <stdio.h>
#include <math.h>
#include <ctype.h>
-#ifdef VMS
+#if defined(VMS) || defined(unix)
#include <stdlib.h>
#endif
+#include <string.h>
#include "astro.h"
#include "circum.h"
#include "screen.h"
-extern char *strcat(), *strcpy(), *strncpy(), *getenv();
-
static char *dbfile; /* !0 if set by -d option */
+#ifdef unix
+static char dbfdef[] = PREFIX "/share/ephem/ephem.db"; /* default database file name */
+#else
static char dbfdef[] = "ephem.db"; /* default database file name */
+#endif
/* structures to describe objects of various types.
*/
@@ -95,6 +98,17 @@
#define DY 0 /* decimal year flag for set_year() */
#define YMD 1 /* year/mon/day flag for set_year() */
+
+static nxt_db(char buf[], int blen, FILE *fp);
+static obj_dfixed(Obj *op, int ac, char *av[]);
+static obj_delliptical(Obj *op, int ac, char *av[]);
+static obj_dhyperbolic(Obj *op, int ac, char *av[]);
+static obj_dparabolic(Obj *op, int ac, char *av[]);
+static set_double(char *av[], int vn, char *pr, double *fp);
+static set_name(char *av[], char *np);
+static set_year(char *av[], int vn, char *pr, int type, double *yp);
+static crack_year(char *bp, double *p);
+static set_mag(char *av[], int vn, Mag *mp);
/* run when Objx or y is picked from menu.
* we tell which by the planet code.

View File

@ -1,36 +1,36 @@
*** plot.c.orig Tue Apr 15 01:07:37 1997
--- plot.c Tue Apr 15 02:42:45 1997
***************
*** 15,25 ****
extern char *strcpy();
#ifdef VMS
#include <perror.h>
- #include <errno.h>
#else
extern char *sys_errlist[];
extern errno;
#endif
--- 15,34 ----
extern char *strcpy();
+ #if (defined(__unix__) || defined(unix)) && !defined(USG)
+ #include <sys/param.h>
+ #endif
+
+ #if defined(VMS) || defined(unix)
+ #include <errno.h>
+ #endif
+
#ifdef VMS
#include <perror.h>
#else
+ #ifndef BSD
extern char *sys_errlist[];
+ #endif
extern errno;
#endif
--- plot.c.orig Sat Mar 14 23:22:20 1992
+++ plot.c Sun Jan 21 21:06:06 2007
@@ -10,16 +10,31 @@
*/
#include <stdio.h>
+#include <string.h>
#include <math.h>
#include "screen.h"
-extern char *strcpy();
+static plt_select_fields();
+static plt_turn_off();
+static plt_turn_on();
+static plt_file();
+static plot_cartesian(FILE *pfp);
+static plot_polar(FILE *pfp);
+
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
+#if defined(VMS) || defined(unix)
+#include <errno.h>
+#endif
#ifdef VMS
#include <perror.h>
-#include <errno.h>
#else
+#ifndef BSD
extern char *sys_errlist[];
+#endif
extern errno;
#endif

View File

@ -0,0 +1,16 @@
diff -u altj.c.orig altj.c
--- altj.c.orig Sat Mar 14 23:21:51 1992
+++ altj.c Sun Jan 21 20:32:47 2007
@@ -6,6 +6,12 @@
#include "circum.h"
#include "screen.h"
+static jupinfo (double d,
+ double *ix, double *ex, double *gx, double *cx,
+ double *iy, double *ey, double *gy, double *cy,
+ double *iz, double *ez, double *gz, double *cz,
+ double *sIcml, double *sIIcml);
+
altj_labels()
{
static char grs[] = "(GRS is at approximately 30 degs in System II)";

View File

@ -0,0 +1,17 @@
diff -u altmenus.c.orig altmenus.c
--- altmenus.c.orig Sat Mar 14 23:21:53 1992
+++ altmenus.c Sun Jan 21 20:31:43 2007
@@ -8,6 +8,13 @@
#include "circum.h"
#include "screen.h"
+static alt1_labels();
+static alt2_labels();
+static alt3_labels();
+static alt1_body (int p, int force, Now *np);
+static alt2_body (int p, int force, Now *np);
+static alt3_body (int p, int force, Now *np);
+
static int altmenu = F_MNU1; /* which alternate menu is up; one of F_MNUi */
static int alt2_stdhzn; /* whether to use STDHZN (aot ADPHZN) horizon algthm */
static int alt3_geoc; /* whether to use geocentric (aot topocentric) vantage*/

View File

@ -0,0 +1,12 @@
diff -u circum.c.orig circum.c
--- circum.c.orig Sat Mar 14 23:21:56 1992
+++ circum.c Sun Jan 21 20:33:31 2007
@@ -8,6 +8,8 @@
#include "circum.h"
#include "screen.h" /* just for SUN and MOON */
+static about_now (Now *n1, Now *n2, double dt);
+
/* find body p's circumstances now.
* to save some time the caller may specify a desired accuracy, in arc seconds.
* if, based on its mean motion, it would not have moved this much since the

View File

@ -0,0 +1,18 @@
diff -u compiler.c.orig compiler.c
--- compiler.c.orig Sun Jan 21 20:26:09 2007
+++ compiler.c Sun Jan 21 20:33:59 2007
@@ -13,6 +13,14 @@
#include <stdlib.h>
#endif
#include "screen.h"
+#include <stdio.h>
+#include <string.h>
+
+static next_token();
+static skip_double();
+static compile(int prec);
+static execute(double *result);
+static parse_fieldname();
/* parser tokens and opcodes, as necessary */
#define HALT 0 /* good value for HALT since program is inited to 0 */

View File

@ -0,0 +1,11 @@
--- constel.c.orig Sun Jan 21 20:40:59 2007
+++ constel.c Sun Jan 21 20:41:27 2007
@@ -3,6 +3,8 @@
#include "screen.h"
#include "circum.h"
+static confnd(double r, double d, double e, char **name);
+
/* print the constellation object p is in now as a prompt message.
*/
constellation_msg (p, np)

View File

@ -0,0 +1,11 @@
--- eq_ecl.c.orig Sun Jan 21 20:41:41 2007
+++ eq_ecl.c Sun Jan 21 20:42:16 2007
@@ -2,6 +2,8 @@
#include <math.h>
#include "astro.h"
+static ecleq_aux (int sw, double mjd, double x, double y, double *p, double *q);
+
#define EQtoECL 1
#define ECLtoEQ (-1)

View File

@ -0,0 +1,17 @@
--- mainmenu.c.orig Sun Jan 21 20:52:22 2007
+++ mainmenu.c Sun Jan 21 20:53:27 2007
@@ -2,10 +2,14 @@
*/
#include <stdio.h>
+#include <string.h>
#include <math.h>
#include "astro.h"
#include "circum.h"
#include "screen.h"
+
+static mm_calendar(Now *np, int force);
+static mm_nfmoon(double jd, double tzone, int m, int f);
/* #define PC_GRAPHICS */
#ifdef PC_GRAPHICS

View File

@ -0,0 +1,11 @@
--- moonnf.c.orig Sun Jan 21 20:53:58 2007
+++ moonnf.c Sun Jan 21 20:54:21 2007
@@ -2,6 +2,8 @@
#include <math.h>
#include "astro.h"
+static m(double t, double k, double *mjd);
+
#define unw(w,z) ((w)-floor((w)/(z))*(z))
/* given a modified Julian date, mjd, return the mjd of the new

View File

@ -0,0 +1,26 @@
--- plans.c.orig Sun Jan 21 21:00:06 2007
+++ plans.c Sun Jan 21 21:04:04 2007
@@ -2,6 +2,23 @@
#include <math.h>
#include "astro.h"
+static masun(double mjd, double *mas);
+static p_mercury(double map[], double *dl, double *dr);
+static p_venus(double t, double mas, double map[],
+ double *dl, double *dr, double *dml, double *dm);
+static p_mars(double mas, double map[],
+ double *dl, double *dr, double *dml, double *dm);
+static p_jupiter(double t, double s,
+ double *dml, double *ds, double *dm, double *da);
+static p_saturn(double t, double s,
+ double *dml, double *ds, double *dm, double *da, double *dhl);
+static p_uranus(double t, double s,
+ double *dl, double* dr, double* dml, double* ds,
+ double* dm, double* da, double* dhl);
+static p_neptune(double t, double s,
+ double* dl, double* dr, double* dml, double* ds,
+ double* dm, double* da, double* dhl);
+
#define TWOPI (2*PI)
#define mod2PI(x) ((x) - (long)((x)/TWOPI)*TWOPI)

View File

@ -0,0 +1,19 @@
--- riset_c.c.orig Sun Jan 21 21:07:04 2007
+++ riset_c.c Sun Jan 21 21:08:51 2007
@@ -6,6 +6,16 @@
#include "circum.h"
#include "screen.h" /* just for SUN and MOON */
+static iterative_riset(int p, Now *np, int hzn,
+ double *ltr, double *lts, double *ltt,
+ double *azr, double *azs, double *altt,
+ int *status);
+static stationary_riset(int p, double mjd0, Now *np, int hzn,
+ double *lstr, double *lsts, double *lstt,
+ double *azr, double *azs, double *altt,
+ int *status);
+static transit(double r, double d, Now *np, double *lstt, double *altt);
+
#define TRACE(x) {FILE *fp = fopen("trace","a"); fprintf x; fclose(fp);}
#define STDREF degrad(34./60.) /* nominal horizon refraction amount */

View File

@ -0,0 +1,12 @@
--- sel_fld.c.orig Sun Jan 21 21:09:19 2007
+++ sel_fld.c Sun Jan 21 21:10:03 2007
@@ -1,6 +1,9 @@
#include <stdio.h>
#include "screen.h"
+static move_cur(char dirchar, int flag, int *rp, int *cp);
+static int nearestfld(int r, int c, int flag);
+
/* define BANG if and only if your system supports the system() function.
*/
#define BANG

View File

@ -0,0 +1,18 @@
--- srch.c.orig Sun Jan 21 21:10:29 2007
+++ srch.c Sun Jan 21 21:11:37 2007
@@ -6,9 +6,14 @@
#include <stdio.h>
#include <math.h>
+#include <string.h>
#include "screen.h"
-extern char *strcpy();
+static set_function();
+static set_accuracy();
+static srch_minmax(double mjd, double v, double *tmincp);
+static srch_solve0(double mjd, double v, double *tmincp);
+static srch_binary(double mjd, double v, double *tmincp);
static int (*srch_f)();
static int srch_tmscalled;

View File

@ -0,0 +1,10 @@
--- utc_gst.c.orig Sun Jan 21 21:13:45 2007
+++ utc_gst.c Sun Jan 21 21:14:05 2007
@@ -1,5 +1,7 @@
#include "astro.h"
+static double tnaught(double mjd);
+
/* given a modified julian date, mjd, and a universally coordinated time, utc,
* return greenwich mean siderial time, *gst.
*/

View File

@ -0,0 +1,16 @@
--- watch.c.orig Sun Jan 21 21:14:29 2007
+++ watch.c Sun Jan 21 21:16:30 2007
@@ -51,6 +51,13 @@
static int trails; /* !0 if want to leave trails */
+static watch_sky(int style, Now *np, double tminc, int wbodies);
+static watch_solarsystem(Now *np, double tminc, int wbodies);
+static set_ss(LastDraw *lp, double dist, double lg, double lt, char tag);
+static set_screencoords(LastDraw lp[], int np);
+static safe_f_char(int r, int c, char tag);
+static int readwcmd(double tminc0, double *tminc, int *once);
+
watch (np, tminc, wbodies)
Now *np; /* time now and on each step */
double tminc; /* hrs to increment time by each step */