Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.
This commit is contained in:
parent
226d80b821
commit
cbeb0b26e4
492 changed files with 3218 additions and 3167 deletions
|
|
@ -1,8 +1,10 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
|
||||
//#pragma varargck type "R" double
|
||||
//#pragma varargck type "D" double
|
||||
#ifdef VARARGCK
|
||||
#pragma varargck type "R" double
|
||||
#pragma varargck type "D" double
|
||||
#endif
|
||||
|
||||
typedef struct Obj1 Obj1;
|
||||
typedef struct Obj2 Obj2;
|
||||
|
|
@ -20,7 +22,7 @@ enum
|
|||
DARK = 1<<0,
|
||||
SIGNIF = 1<<1,
|
||||
PTIME = 1<<2,
|
||||
LIGHT = 1<<3,
|
||||
LIGHT = 1<<3
|
||||
};
|
||||
|
||||
struct Obj1
|
||||
|
|
@ -150,7 +152,7 @@ extern double cosx(double, int, int, int, int, double);
|
|||
extern double dist(Obj1*, Obj1*);
|
||||
extern double dsrc(double, Tim*, int);
|
||||
extern void dtsetup(double, Tim*);
|
||||
//extern int evcomp(void*, void*);
|
||||
/*extern int evcomp(void*, void*);*/
|
||||
extern void event(char*, char*, char*, double, int);
|
||||
extern void evflush(void);
|
||||
extern double fmod(double, double);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Obj2* objlst[] =
|
|||
&onept,
|
||||
&oplut,
|
||||
&ocomet,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
struct idata
|
||||
|
|
@ -35,7 +35,7 @@ struct idata
|
|||
"Uranus", "uranus", uran,
|
||||
"Neptune", "neptune", nept,
|
||||
"Pluto", "pluto", plut,
|
||||
"Comet", "comet", comet,
|
||||
"Comet", "comet", comet
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -52,12 +52,12 @@ loop:
|
|||
d = dist(&eobj1->point[i], &eobj2->point[i]);
|
||||
print("dist %s to %s = %.4f\n", eobj1->name, eobj2->name, d);
|
||||
}
|
||||
// if(flags['p']) {
|
||||
// pdate(d);
|
||||
// print(" ");
|
||||
// ptime(d);
|
||||
// print("\n");
|
||||
// }
|
||||
/* if(flags['p']) { */
|
||||
/* pdate(d); */
|
||||
/* print(" "); */
|
||||
/* ptime(d); */
|
||||
/* print("\n"); */
|
||||
/* } */
|
||||
if(flags['p'] || flags['e'])
|
||||
break;
|
||||
d += deld;
|
||||
|
|
@ -151,8 +151,8 @@ args(int argc, char *argv[])
|
|||
if(flags['j'])
|
||||
print("jday = %.4f\n", day);
|
||||
deltat = day * .001704;
|
||||
if(deltat > 32.184) // assume date is utc1
|
||||
deltat = 32.184; // correct by leap sec
|
||||
if(deltat > 32.184) /* assume date is utc1 */
|
||||
deltat = 32.184; /* correct by leap sec */
|
||||
if(flags['t'])
|
||||
deltat = readdt();
|
||||
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ double mercfp[] =
|
|||
0.160e-6, 2.1241,
|
||||
0.134e-6, 5.1260,
|
||||
0.347e-6, 5.1620,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
char merccp[] =
|
||||
|
|
@ -332,5 +332,5 @@ char merccp[] =
|
|||
0, 2,
|
||||
-1, 2,
|
||||
2, 3,
|
||||
1, 3,
|
||||
1, 3
|
||||
};
|
||||
|
|
|
|||
|
|
@ -286,5 +286,5 @@ Moontab moontab[] =
|
|||
-.0130, 4,0,0,-2,
|
||||
0.0115, 3,-1,0,0,
|
||||
-.0141, 2,0,-2,-2,
|
||||
0, 0,0,0,0,
|
||||
0, 0,0,0,0
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
static double elem[] =
|
||||
{
|
||||
36525.0, // [0] eday of epoc
|
||||
36525.0, /* [0] eday of epoc */
|
||||
|
||||
30.06896348, // [1] semi major axis (au)
|
||||
0.00858587, // [2] eccentricity
|
||||
1.76917, // [3] inclination (deg)
|
||||
131.72169, // [4] longitude of the ascending node (deg)
|
||||
44.97135, // [5] longitude of perihelion (deg)
|
||||
304.88003, // [6] mean longitude (deg)
|
||||
30.06896348, /* [1] semi major axis (au) */
|
||||
0.00858587, /* [2] eccentricity */
|
||||
1.76917, /* [3] inclination (deg) */
|
||||
131.72169, /* [4] longitude of the ascending node (deg) */
|
||||
44.97135, /* [5] longitude of perihelion (deg) */
|
||||
304.88003, /* [6] mean longitude (deg) */
|
||||
|
||||
-0.00125196, // [1+6] (au/julian century)
|
||||
0.0000251, // [2+6] (e/julian century)
|
||||
-3.64, // [3+6] (arcsec/julian century)
|
||||
-151.25, // [4+6] (arcsec/julian century)
|
||||
-844.43, // [5+6] (arcsec/julian century)
|
||||
786449.21, // [6+6] (arcsec/julian century)
|
||||
-0.00125196, /* [1+6] (au/julian century) */
|
||||
0.0000251, /* [2+6] (e/julian century) */
|
||||
-3.64, /* [3+6] (arcsec/julian century) */
|
||||
-151.25, /* [4+6] (arcsec/julian century) */
|
||||
-844.43, /* [5+6] (arcsec/julian century) */
|
||||
786449.21, /* [6+6] (arcsec/julian century) */
|
||||
};
|
||||
|
||||
void
|
||||
|
|
@ -32,12 +32,12 @@ nept(void)
|
|||
|
||||
double cy;
|
||||
|
||||
cy = (eday - elem[0]) / 36525.; // per julian century
|
||||
cy = (eday - elem[0]) / 36525.; /* per julian century */
|
||||
|
||||
mrad = elem[1] + elem[1+6]*cy;
|
||||
ecc = elem[2] + elem[2+6]*cy;
|
||||
|
||||
cy = cy / 3600; // arcsec/deg per julian century
|
||||
cy = cy / 3600; /* arcsec/deg per julian century */
|
||||
incl = elem[3] + elem[3+6]*cy;
|
||||
node = elem[4] + elem[4+6]*cy;
|
||||
argp = elem[5] + elem[5+6]*cy;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ double nutfp[] =
|
|||
.0183, 0,
|
||||
.0113, 0,
|
||||
-.0050, 0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
char nutcp[] =
|
||||
|
|
@ -67,5 +67,5 @@ char nutcp[] =
|
|||
2,2,0,
|
||||
1,2,0,
|
||||
2,2,1,
|
||||
2,2,-1,
|
||||
2,2,-1
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ char* month[] =
|
|||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December",
|
||||
"December"
|
||||
};
|
||||
|
||||
double
|
||||
|
|
@ -163,13 +163,13 @@ pstime(double d)
|
|||
lambda = 0;
|
||||
beta = 0;
|
||||
|
||||
// uses lambda, beta, rad, motion
|
||||
// sets alpha, delta, rp
|
||||
/* uses lambda, beta, rad, motion */
|
||||
/* sets alpha, delta, rp */
|
||||
|
||||
helio();
|
||||
|
||||
// uses alpha, delta, rp
|
||||
// sets ra, decl, lha, decl2, az, el
|
||||
/* uses alpha, delta, rp */
|
||||
/* sets ra, decl, lha, decl2, az, el */
|
||||
|
||||
geo();
|
||||
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
static double elem[] =
|
||||
{
|
||||
36525.0, // [0] eday of epoc
|
||||
36525.0, /* [0] eday of epoc */
|
||||
|
||||
39.48168677, // [1] semi major axis (au)
|
||||
0.24880766, // [2] eccentricity
|
||||
17.14175, // [3] inclination (deg)
|
||||
110.30347, // [4] longitude of the ascending node (deg)
|
||||
224.06676, // [5] longitude of perihelion (deg)
|
||||
238.92881, // [6] mean longitude (deg)
|
||||
39.48168677, /* [1] semi major axis (au) */
|
||||
0.24880766, /* [2] eccentricity */
|
||||
17.14175, /* [3] inclination (deg) */
|
||||
110.30347, /* [4] longitude of the ascending node (deg) */
|
||||
224.06676, /* [5] longitude of perihelion (deg) */
|
||||
238.92881, /* [6] mean longitude (deg) */
|
||||
|
||||
-0.00076912, // [1+6] (au/julian century)
|
||||
0.00006465, // [2+6] (e/julian century)
|
||||
11.07, // [3+6] (arcsec/julian century)
|
||||
-37.33, // [4+6] (arcsec/julian century)
|
||||
-132.25, // [5+6] (arcsec/julian century)
|
||||
522747.90, // [6+6] (arcsec/julian century)
|
||||
-0.00076912, /* [1+6] (au/julian century) */
|
||||
0.00006465, /* [2+6] (e/julian century) */
|
||||
11.07, /* [3+6] (arcsec/julian century) */
|
||||
-37.33, /* [4+6] (arcsec/julian century) */
|
||||
-132.25, /* [5+6] (arcsec/julian century) */
|
||||
522747.90, /* [6+6] (arcsec/julian century) */
|
||||
};
|
||||
|
||||
void
|
||||
|
|
@ -32,12 +32,12 @@ plut(void)
|
|||
|
||||
double cy;
|
||||
|
||||
cy = (eday - elem[0]) / 36525.; // per julian century
|
||||
cy = (eday - elem[0]) / 36525.; /* per julian century */
|
||||
|
||||
mrad = elem[1] + elem[1+6]*cy;
|
||||
ecc = elem[2] + elem[2+6]*cy;
|
||||
|
||||
cy = cy / 3600; // arcsec/deg per julian century
|
||||
cy = cy / 3600; /* arcsec/deg per julian century */
|
||||
incl = elem[3] + elem[3+6]*cy;
|
||||
node = elem[4] + elem[4+6]*cy;
|
||||
argp = elem[5] + elem[5+6]*cy;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
char* satlst[] =
|
||||
{
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
struct
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ char* solstr[] =
|
|||
"Fall equinox",
|
||||
"Winter solstice",
|
||||
"Spring equinox",
|
||||
"Summer solstice",
|
||||
"Summer solstice"
|
||||
};
|
||||
|
||||
struct
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ double sunfp[] =
|
|||
-1.33e-6, 0,
|
||||
0.37e-6, 0,
|
||||
0.36e-6, 0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
char suncp[] =
|
||||
{
|
||||
|
|
@ -238,5 +238,5 @@ char suncp[] =
|
|||
1,0,0,
|
||||
1,-1,0,
|
||||
1,1,0,
|
||||
1,0,-1,
|
||||
1,0,-1
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
static double elem[] =
|
||||
{
|
||||
36525.0, // [0] eday of epoc
|
||||
36525.0, /* [0] eday of epoc */
|
||||
|
||||
19.19126393, // [1] semi major axis (au)
|
||||
0.04716771, // [2] eccentricity
|
||||
0.76986, // [3] inclination (deg)
|
||||
74.22988, // [4] longitude of the ascending node (deg)
|
||||
170.96424, // [5] longitude of perihelion (deg)
|
||||
313.23218, // [6] mean longitude (deg)
|
||||
19.19126393, /* [1] semi major axis (au) */
|
||||
0.04716771, /* [2] eccentricity */
|
||||
0.76986, /* [3] inclination (deg) */
|
||||
74.22988, /* [4] longitude of the ascending node (deg) */
|
||||
170.96424, /* [5] longitude of perihelion (deg) */
|
||||
313.23218, /* [6] mean longitude (deg) */
|
||||
|
||||
0.00152025, // [1+6] (au/julian century)
|
||||
-0.00019150, // [2+6] (e/julian century)
|
||||
-2.09, // [3+6] (arcsec/julian century)
|
||||
-1681.40, // [4+6] (arcsec/julian century)
|
||||
1312.56, // [5+6] (arcsec/julian century)
|
||||
1542547.79, // [6+6] (arcsec/julian century)
|
||||
0.00152025, /* [1+6] (au/julian century) */
|
||||
-0.00019150, /* [2+6] (e/julian century) */
|
||||
-2.09, /* [3+6] (arcsec/julian century) */
|
||||
-1681.40, /* [4+6] (arcsec/julian century) */
|
||||
1312.56, /* [5+6] (arcsec/julian century) */
|
||||
1542547.79, /* [6+6] (arcsec/julian century) */
|
||||
};
|
||||
|
||||
void
|
||||
|
|
@ -32,12 +32,12 @@ uran(void)
|
|||
|
||||
double cy;
|
||||
|
||||
cy = (eday - elem[0]) / 36525.; // per julian century
|
||||
cy = (eday - elem[0]) / 36525.; /* per julian century */
|
||||
|
||||
mrad = elem[1] + elem[1+6]*cy;
|
||||
ecc = elem[2] + elem[2+6]*cy;
|
||||
|
||||
cy = cy / 3600; // arcsec/deg per julian century
|
||||
cy = cy / 3600; /* arcsec/deg per julian century */
|
||||
incl = elem[3] + elem[3+6]*cy;
|
||||
node = elem[4] + elem[4+6]*cy;
|
||||
argp = elem[5] + elem[5+6]*cy;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ double venfp[] =
|
|||
0.717e-6, 2.2969,
|
||||
2.991e-6, 2.0611,
|
||||
1.335e-6, 0.9628,
|
||||
0.,
|
||||
0.
|
||||
};
|
||||
|
||||
char vencp[] =
|
||||
|
|
@ -56,5 +56,5 @@ char vencp[] =
|
|||
4,-5,0,0,
|
||||
2,0,-3,0,
|
||||
1,0,0,-1,
|
||||
2,0,0,-2,
|
||||
2,0,0,-2
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue