-/* $NetBSD: pom.c,v 1.12 1999/09/14 20:00:07 jsm Exp $ */
+/* $NetBSD: pom.c,v 1.20 2010/12/05 04:34:22 pgoyette Exp $ */
/*
* Copyright (c) 1989, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#include <sys/cdefs.h>
#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
- The Regents of the University of California. All rights reserved.\n");
+__COPYRIGHT("@(#) Copyright (c) 1989, 1993\
+ The Regents of the University of California. All rights reserved.");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pom.c,v 1.12 1999/09/14 20:00:07 jsm Exp $");
+__RCSID("$NetBSD: pom.c,v 1.20 2010/12/05 04:34:22 pgoyette Exp $");
#endif
#endif /* not lint */
#define Pzero 36.340410 /* lunar mean long of perigee at EPOCH */
#define Nzero 318.510107 /* lunar mean long of node at EPOCH */
-void adj360 __P((double *));
-double dtor __P((double));
-int main __P((int, char *[]));
-double potm __P((double));
-time_t parsetime __P((char *));
-void badformat __P((void)) __attribute__((__noreturn__));
+int main(int, char *[]);
+static void adj360(double *);
+static double dtor(double);
+static double potm(double);
+static time_t parsetime(char *);
+static void badformat(void) __dead;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
time_t tmpt, now;
double days, today, tomorrow;
today);
}
}
- exit(0);
+
+ return EXIT_SUCCESS;
}
/*
* potm --
* return phase of the moon
*/
-double
-potm(days)
- double days;
+static double
+potm(double days)
{
double N, Msol, Ec, LambdaSol, l, Mm, Ev, Ac, A3, Mmprime;
double A4, lprime, V, ldprime, D, Nm;
* dtor --
* convert degrees to radians
*/
-double
-dtor(deg)
- double deg;
+static double
+dtor(double deg)
{
return(deg * PI / 180);
}
* adj360 --
* adjust value so 0 <= deg <= 360
*/
-void
-adj360(deg)
- double *deg;
+static void
+adj360(double *deg)
{
for (;;)
if (*deg < 0)
}
#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;
-time_t
-parsetime(p)
- char *p;
+static time_t
+parsetime(char *p)
{
struct tm *lt;
int bigyear;
int yearset = 0;
time_t tval;
- unsigned char *t;
+ char *t;
for (t = p; *t; ++t) {
- if (isdigit(*t))
+ if (isdigit((unsigned char) *t))
continue;
badformat();
}
return (tval);
}
-void
-badformat()
+static void
+badformat(void)
{
warnx("illegal time format");
- (void)fprintf(stderr, "usage: pom [[[[[cc]yy]mm]dd]HH]\n");
- exit(1);
+ (void)fprintf(stderr, "usage: %s [[[[[cc]yy]mm]dd]HH]\n",
+ getprogname());
+ exit(EXIT_FAILURE);
}