# HG changeset patch # User Jim Meyering # Date 853618265 0 # Node ID 9c89b90524b825d9ffc47df5c317d608ef1d7364 # Parent 7e444dcdb9a4298c02cc743dc9ff71f3868c2121 (get_date): Change prototype to reflect const'ness of parameters. Indent cpp-directives to reflect nesting. diff --git a/lib/getdate.y b/lib/getdate.y --- a/lib/getdate.y +++ b/lib/getdate.y @@ -4,21 +4,17 @@ ** at the University of North Carolina at Chapel Hill. Later tweaked by ** a couple of people on Usenet. Completely overhauled by Rich $alz ** and Jim Berets in August, 1990; -** send any email to Rich. ** -** This grammar has 10 shift/reduce conflicts. +** This grammar has 13 shift/reduce conflicts. ** ** This code is in the public domain and has no copyright. */ -/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */ -/* SUPPRESS 288 on yyerrlab *//* Label unused */ #ifdef HAVE_CONFIG_H -#include - -#ifdef FORCE_ALLOCA_H -#include -#endif +# include +# ifdef FORCE_ALLOCA_H +# include +# endif #endif /* Since the code of getdate.y is not included in the Emacs executable @@ -28,7 +24,7 @@ problems if we try to write to a static variable, which I don't think this code needs to do. */ #ifdef emacs -#undef static +# undef static #endif #include @@ -55,22 +51,7 @@ host does not conform to Posix. */ #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) -#if defined (vms) -#include -#include -#else -#include -#ifdef TIME_WITH_SYS_TIME -#include -#include -#else -#ifdef HAVE_SYS_TIME_H -#include -#else -#include -#endif -#endif -#endif /* defined (vms) */ +#include "getdate.h" #if defined (STDC_HEADERS) || defined (USG) #include @@ -166,7 +147,7 @@ ** yacc had the %union construct.) Maybe someday; right now we only use ** the %union very rarely. */ -static char *yyInput; +static const char *yyInput; static int yyDayOrdinal; static int yyDayNumber; static int yyHaveDate; @@ -880,11 +861,11 @@ time_t get_date (p, now) - char *p; - time_t *now; + const char *p; + const time_t *now; { - struct tm tm, tm0, *tmp; - time_t Start; + struct tm tm, tm0, *tmp; + time_t Start; yyInput = p; Start = now ? *now : time ((time_t *) NULL); @@ -953,7 +934,7 @@ } Start = mktime (&tm); } - + if (Start == (time_t) -1) return Start; }