summaryrefslogtreecommitdiff
path: root/usr.sbin/eeprom/getdate.y
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-01 18:32:22 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-01 18:32:22 +0000
commitb8631172620c3e1542ebc475dc4e228eec355f70 (patch)
tree471c491c8ce666455cf445cdf6447f459b4dba37 /usr.sbin/eeprom/getdate.y
parentc2c17c2534be6163840ba4a11d5767f722f8c0a2 (diff)
ansi cleanup; khalek@linuxgamers.net
Diffstat (limited to 'usr.sbin/eeprom/getdate.y')
-rw-r--r--usr.sbin/eeprom/getdate.y47
1 files changed, 12 insertions, 35 deletions
diff --git a/usr.sbin/eeprom/getdate.y b/usr.sbin/eeprom/getdate.y
index 7ac3884f78e..8a361ed48be 100644
--- a/usr.sbin/eeprom/getdate.y
+++ b/usr.sbin/eeprom/getdate.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: getdate.y,v 1.5 2003/06/11 23:33:28 deraadt Exp $ */
+/* $OpenBSD: getdate.y,v 1.6 2004/08/01 18:32:18 deraadt Exp $ */
/*
** Originally written by Steven M. Bellovin <smb@research.att.com> while
@@ -489,19 +489,14 @@ static TABLE const MilitaryTable[] = {
/* ARGSUSED */
static int
-yyerror(s)
- char *s;
+yyerror(char *s)
{
return 0;
}
static time_t
-ToSeconds(Hours, Minutes, Seconds, Meridian)
- time_t Hours;
- time_t Minutes;
- time_t Seconds;
- MERIDIAN Meridian;
+ToSeconds(time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian)
{
if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59)
return -1;
@@ -534,15 +529,8 @@ ToSeconds(Hours, Minutes, Seconds, Meridian)
* A number from 0 to 99, which means a year from 1900 to 1999, or
* The actual year (>=100). */
static time_t
-Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
- time_t Month;
- time_t Day;
- time_t Year;
- time_t Hours;
- time_t Minutes;
- time_t Seconds;
- MERIDIAN Meridian;
- DSTMODE DSTmode;
+Convert(time_t Month, time_t Day, time_t Year, time_t Hours, time_t Minutes,
+ time_t Seconds, MERIDIAN Meridian, DSTMODE DSTmode)
{
static int DaysInMonth[12] = {
31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
@@ -587,9 +575,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
static time_t
-DSTcorrect(Start, Future)
- time_t Start;
- time_t Future;
+DSTcorrect(time_t Start, time_t Future)
{
time_t StartDay;
time_t FutureDay;
@@ -601,10 +587,7 @@ DSTcorrect(Start, Future)
static time_t
-RelativeDate(Start, DayOrdinal, DayNumber)
- time_t Start;
- time_t DayOrdinal;
- time_t DayNumber;
+RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber)
{
struct tm *tm;
time_t now;
@@ -618,9 +601,7 @@ RelativeDate(Start, DayOrdinal, DayNumber)
static time_t
-RelativeMonth(Start, RelMonth)
- time_t Start;
- time_t RelMonth;
+RelativeMonth(time_t Start, time_t RelMonth)
{
struct tm *tm;
time_t Month;
@@ -640,8 +621,7 @@ RelativeMonth(Start, RelMonth)
static int
-LookupWord(buff)
- char *buff;
+LookupWord(char *buff)
{
char *p;
char *q;
@@ -747,7 +727,7 @@ LookupWord(buff)
static int
-yylex()
+yylex(void)
{
char c;
char *p;
@@ -802,8 +782,7 @@ yylex()
/* Yield A - B, measured in seconds. */
static long
-difftm (a, b)
- struct tm *a, *b;
+difftm (struct tm *a, struct tm *b)
{
int ay = a->tm_year + (TM_YEAR_ORIGIN - 1);
int by = b->tm_year + (TM_YEAR_ORIGIN - 1);
@@ -823,9 +802,7 @@ difftm (a, b)
}
time_t
-get_date(p, now)
- char *p;
- struct timeb *now;
+get_date(char *p, struct timeb *now)
{
struct tm *tm, gmt;
struct timeb ftz;