diff options
author | rsc <devnull@localhost> | 2005-01-04 22:10:43 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-04 22:10:43 +0000 |
commit | 2ce287bb130ff77a6547a582fe7df6a28aefedfb (patch) | |
tree | 392c185adad14cfec0316f00fe9d3f12ab3b021d /src/cmd/astro | |
parent | 372e9667dfd5fcce89be447b5bbc169c8a43322e (diff) | |
download | plan9port-2ce287bb130ff77a6547a582fe7df6a28aefedfb.tar.gz plan9port-2ce287bb130ff77a6547a582fe7df6a28aefedfb.tar.bz2 plan9port-2ce287bb130ff77a6547a582fe7df6a28aefedfb.zip |
don't use (){} struct constructor
Diffstat (limited to 'src/cmd/astro')
-rw-r--r-- | src/cmd/astro/comet.c | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/src/cmd/astro/comet.c b/src/cmd/astro/comet.c index bfd11dc0..3d6bc2b2 100644 --- a/src/cmd/astro/comet.c +++ b/src/cmd/astro/comet.c @@ -2,22 +2,37 @@ #define MAXE (.999) /* cant do hyperbolas */ +struct elem +{ + double t; /* time of perihelion */ + double q; /* perihelion distance */ + double e; /* eccentricity */ + double i; /* inclination */ + double w; /* argument of perihelion */ + double o; /* longitude of ascending node */ +}; + +struct elem +mkelem(double t, double q, double e, double i, double w, double o) +{ + struct elem el; + + el.t = t; + el.q = q; + el.e = e; + el.i = i; + el.w = w; + el.o = o; + return el; +} + void comet(void) { double pturbl, pturbb, pturbr; double lograd; double dele, enom, vnom, nd, sl; - - struct elem - { - double t; /* time of perihelion */ - double q; /* perihelion distance */ - double e; /* eccentricity */ - double i; /* inclination */ - double w; /* argument of perihelion */ - double o; /* longitude of ascending node */ - } elem; + struct elem elem; /* elem = (struct elem) { @@ -73,15 +88,14 @@ comet(void) 151.0510, 83.1909, }; /*C/1999 S4 (Linear) */ - elem=(struct elem) - { + elem = mkelem( etdate(2002, 3, 18.9784), 0.5070601, 0.990111, 28.12106, 34.6666, - 93.1206, - }; /*C/2002 C1 (Ikeya-Zhang) */ + 93.1206 + ); /*C/2002 C1 (Ikeya-Zhang) */ ecc = elem.e; if(ecc > MAXE) |