summaryrefslogtreecommitdiffstats
path: root/lib/getdate.y
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/getdate.y (renamed from libmisc/getdate.y)23
1 files changed, 9 insertions, 14 deletions
diff --git a/libmisc/getdate.y b/lib/getdate.y
index 0c07f74..8cea2cc 100644
--- a/libmisc/getdate.y
+++ b/lib/getdate.y
@@ -12,9 +12,6 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
-# ifdef FORCE_ALLOCA_H
-# include <alloca.h>
-# endif
#endif
/* Since the code of getdate.y is not included in the Emacs executable
@@ -31,6 +28,7 @@
#include <ctype.h>
#include <time.h>
+#include "attr.h"
#include "getdate.h"
#include <string.h>
@@ -321,7 +319,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelYear += $1 * $2;
}
| tYEAR_UNIT {
- yyRelYear++;
+ yyRelYear += $1;
}
| tUNUMBER tMONTH_UNIT {
yyRelMonth += $1 * $2;
@@ -330,7 +328,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelMonth += $1 * $2;
}
| tMONTH_UNIT {
- yyRelMonth++;
+ yyRelMonth += $1;
}
| tUNUMBER tDAY_UNIT {
yyRelDay += $1 * $2;
@@ -339,7 +337,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelDay += $1 * $2;
}
| tDAY_UNIT {
- yyRelDay++;
+ yyRelDay += $1;
}
| tUNUMBER tHOUR_UNIT {
yyRelHour += $1 * $2;
@@ -348,7 +346,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelHour += $1 * $2;
}
| tHOUR_UNIT {
- yyRelHour++;
+ yyRelHour += $1;
}
| tUNUMBER tMINUTE_UNIT {
yyRelMinutes += $1 * $2;
@@ -357,7 +355,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelMinutes += $1 * $2;
}
| tMINUTE_UNIT {
- yyRelMinutes++;
+ yyRelMinutes += $1;
}
| tUNUMBER tSEC_UNIT {
yyRelSeconds += $1 * $2;
@@ -366,7 +364,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelSeconds += $1 * $2;
}
| tSEC_UNIT {
- yyRelSeconds++;
+ yyRelSeconds += $1;
}
;
@@ -572,7 +570,7 @@ static TABLE const MilitaryTable[] = {
-static int yyerror (unused const char *s)
+static int yyerror (MAYBE_UNUSED const char *s)
{
return 0;
}
@@ -925,11 +923,8 @@ time_t get_date (const char *p, const time_t *now)
#if defined (TEST)
-/* ARGSUSED */
int
-main (ac, av)
- int ac;
- char *av[];
+main(void)
{
char buff[MAX_BUFF_LEN + 1];
time_t d;