getdate.c (getdate_yyerr, getdate_yylex): Declare these functions static.
**
** Originally written by Steven M. Bellovin <smb@research.att.com> while
** at the University of North Carolina at Chapel Hill. Later tweaked by
**
** Originally written by Steven M. Bellovin <smb@research.att.com> while
** at the University of North Carolina at Chapel Hill. Later tweaked by
#if !defined(lint) && !defined(SABER)
static char RCS[] =
#if !defined(lint) && !defined(SABER)
static char RCS[] =
- "$Header: str2date.y,v 2.1 90/09/06 08:15:06 cronan Exp $";
+ "$Header: /w/src/cvsroot/shellutils/lib/getdate.y,v 1.1.1.1 1992/11/01 05:44:32 meyering Exp $";
#endif /* !defined(lint) && !defined(SABER) */
#endif /* !defined(lint) && !defined(SABER) */
%%
/* Month and day table. */
%%
/* Month and day table. */
-static TABLE MonthDayTable[] = {
+static TABLE const MonthDayTable[] = {
{ "january", tMONTH, 1 },
{ "february", tMONTH, 2 },
{ "march", tMONTH, 3 },
{ "january", tMONTH, 1 },
{ "february", tMONTH, 2 },
{ "march", tMONTH, 3 },
};
/* Time units table. */
};
/* Time units table. */
-static TABLE UnitsTable[] = {
+static TABLE const UnitsTable[] = {
{ "year", tMONTH_UNIT, 12 },
{ "month", tMONTH_UNIT, 1 },
{ "fortnight", tMINUTE_UNIT, 14 * 24 * 60 },
{ "year", tMONTH_UNIT, 12 },
{ "month", tMONTH_UNIT, 1 },
{ "fortnight", tMINUTE_UNIT, 14 * 24 * 60 },
};
/* Assorted relative-time words. */
};
/* Assorted relative-time words. */
-static TABLE OtherTable[] = {
+static TABLE const OtherTable[] = {
{ "tomorrow", tMINUTE_UNIT, 1 * 24 * 60 },
{ "yesterday", tMINUTE_UNIT, -1 * 24 * 60 },
{ "today", tMINUTE_UNIT, 0 },
{ "tomorrow", tMINUTE_UNIT, 1 * 24 * 60 },
{ "yesterday", tMINUTE_UNIT, -1 * 24 * 60 },
{ "today", tMINUTE_UNIT, 0 },
/* The timezone table. */
/* Some of these are commented out because a time_t can't store a float. */
/* The timezone table. */
/* Some of these are commented out because a time_t can't store a float. */
-static TABLE TimezoneTable[] = {
+static TABLE const TimezoneTable[] = {
{ "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */
{ "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */
{ "utc", tZONE, HOUR( 0) },
{ "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */
{ "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */
{ "utc", tZONE, HOUR( 0) },
};
/* Military timezone table. */
};
/* Military timezone table. */
-static TABLE MilitaryTable[] = {
+static TABLE const MilitaryTable[] = {
{ "a", tZONE, HOUR( 1) },
{ "b", tZONE, HOUR( 2) },
{ "c", tZONE, HOUR( 3) },
{ "a", tZONE, HOUR( 1) },
{ "b", tZONE, HOUR( 2) },
{ "c", tZONE, HOUR( 3) },
MERIDIAN Meridian;
DSTMODE DSTmode;
{
MERIDIAN Meridian;
DSTMODE DSTmode;
{
- static int DaysInMonth[12] = {
+ static int DaysInMonth[12] = {
31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
time_t tod;
31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
time_t tod;
{
register char *p;
register char *q;
{
register char *p;
register char *q;
+ register const TABLE *tp;
yylex()
{
register char c;
yylex()
{
register char c;
static int readname ();
/* List of shells to use if the shells file is missing. */
static int readname ();
/* List of shells to use if the shells file is missing. */
-static char *default_shells[] =
+static char const* const default_shells[] =
{
"/bin/sh", "/bin/csh", "/usr/bin/sh", "/usr/bin/csh", NULL
};
{
"/bin/sh", "/bin/csh", "/usr/bin/sh", "/usr/bin/csh", NULL
};
+static char const* const days[] =
{
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
};
{
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
};
+static char const * const months[] =
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"