From 764d26f06209cbc6e11cf85af13f1d0eb0f9b901 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 18 Jan 1997 20:11:05 +0000 Subject: [PATCH] (get_date): Change prototype to reflect const'ness of parameters. Indent cpp-directives to reflect nesting. --- lib/getdate.y | 45 +++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/lib/getdate.y b/lib/getdate.y index d26f086ee8..be5e362048 100644 --- 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 @@ typedef enum _MERIDIAN { ** 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 @@ difftm (a, b) 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 @@ get_date (p, now) } Start = mktime (&tm); } - + if (Start == (time_t) -1) return Start; } -- 2.30.2