diff options
Diffstat (limited to 'generic/tclDate.c')
| -rw-r--r-- | generic/tclDate.c | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/generic/tclDate.c b/generic/tclDate.c index 41aa516..0bda22f 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -2291,6 +2291,10 @@ yyreturn: +MODULE_SCOPE int yychar; +MODULE_SCOPE YYSTYPE yylval; +MODULE_SCOPE int yynerrs; + /* * Month and day table. */ @@ -2320,7 +2324,7 @@ static const TABLE MonthDayTable[] = { { "thurs", tDAY, 4 }, { "friday", tDAY, 5 }, { "saturday", tDAY, 6 }, - { NULL, 0, 0 } + { NULL } }; /* @@ -2338,7 +2342,7 @@ static const TABLE UnitsTable[] = { { "min", tSEC_UNIT, 60 }, { "second", tSEC_UNIT, 1 }, { "sec", tSEC_UNIT, 1 }, - { NULL, 0, 0 } + { NULL } }; /* @@ -2370,7 +2374,7 @@ static const TABLE OtherTable[] = { { "ago", tAGO, 1 }, { "epoch", tEPOCH, 0 }, { "stardate", tSTARDATE, 0 }, - { NULL, 0, 0 } + { NULL } }; /* @@ -2456,7 +2460,7 @@ static const TABLE TimezoneTable[] = { /* ADDED BY Marco Nijdam */ { "dst", tDST, HOUR( 0) }, /* DST on (hour is ignored) */ /* End ADDED */ - { NULL, 0, 0 } + { NULL } }; /* @@ -2489,7 +2493,7 @@ static const TABLE MilitaryTable[] = { { "x", tZONE, HOUR( 11) }, { "y", tZONE, HOUR( 12) }, { "z", tZONE, HOUR( 0) }, - { NULL, 0, 0 } + { NULL } }; /* @@ -2503,19 +2507,19 @@ TclDateerror( const char *s) { Tcl_Obj* t; - Tcl_AppendToObj(infoPtr->messages, infoPtr->separatrix, TCL_STRLEN); - Tcl_AppendToObj(infoPtr->messages, s, TCL_STRLEN); - Tcl_AppendToObj(infoPtr->messages, " (characters ", TCL_STRLEN); + Tcl_AppendToObj(infoPtr->messages, infoPtr->separatrix, -1); + Tcl_AppendToObj(infoPtr->messages, s, -1); + Tcl_AppendToObj(infoPtr->messages, " (characters ", -1); t = Tcl_NewIntObj(location->first_column); Tcl_IncrRefCount(t); Tcl_AppendObjToObj(infoPtr->messages, t); Tcl_DecrRefCount(t); - Tcl_AppendToObj(infoPtr->messages, "-", TCL_STRLEN); + Tcl_AppendToObj(infoPtr->messages, "-", -1); t = Tcl_NewIntObj(location->last_column); Tcl_IncrRefCount(t); Tcl_AppendObjToObj(infoPtr->messages, t); Tcl_DecrRefCount(t); - Tcl_AppendToObj(infoPtr->messages, ")", TCL_STRLEN); + Tcl_AppendToObj(infoPtr->messages, ")", -1); infoPtr->separatrix = "\n"; } @@ -2686,7 +2690,7 @@ TclDatelex( location->first_column = yyInput - info->dateStart; for ( ; ; ) { - while (isspace(UCHAR(*yyInput))) { + while (TclIsSpaceProc(*yyInput)) { yyInput++; } @@ -2751,8 +2755,8 @@ int TclClockOldscanObjCmd( ClientData clientData, /* Unused */ Tcl_Interp *interp, /* Tcl interpreter */ - size_t objc, /* Count of parameters */ - Tcl_Obj *const *objv) /* Parameters */ + int objc, /* Count of paraneters */ + Tcl_Obj *CONST *objv) /* Parameters */ { Tcl_Obj *result, *resultElement; int yr, mo, da; @@ -2800,52 +2804,44 @@ TclClockOldscanObjCmd( if (status == 1) { Tcl_SetObjResult(interp, dateInfo.messages); Tcl_DecrRefCount(dateInfo.messages); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "PARSE", NULL); return TCL_ERROR; } else if (status == 2) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("memory exhausted", - TCL_STRLEN)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("memory exhausted", -1)); Tcl_DecrRefCount(dateInfo.messages); - Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); return TCL_ERROR; } else if (status != 0) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "unknown status returned from date parser. Please " - "report this error as a bug in Tcl.", TCL_STRLEN)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("Unknown status returned " + "from date parser. Please " + "report this error as a " + "bug in Tcl.", -1)); Tcl_DecrRefCount(dateInfo.messages); - Tcl_SetErrorCode(interp, "TCL", "BUG", NULL); return TCL_ERROR; } Tcl_DecrRefCount(dateInfo.messages); if (yyHaveDate > 1) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "more than one date in string", TCL_STRLEN)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetObjResult(interp, + Tcl_NewStringObj("more than one date in string", -1)); return TCL_ERROR; } if (yyHaveTime > 1) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "more than one time of day in string", TCL_STRLEN)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetObjResult(interp, + Tcl_NewStringObj("more than one time of day in string", -1)); return TCL_ERROR; } if (yyHaveZone > 1) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "more than one time zone in string", TCL_STRLEN)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetObjResult(interp, + Tcl_NewStringObj("more than one time zone in string", -1)); return TCL_ERROR; } if (yyHaveDay > 1) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "more than one weekday in string", TCL_STRLEN)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetObjResult(interp, + Tcl_NewStringObj("more than one weekday in string", -1)); return TCL_ERROR; } if (yyHaveOrdinalMonth > 1) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "more than one ordinal month in string", TCL_STRLEN)); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); + Tcl_SetObjResult(interp, + Tcl_NewStringObj("more than one ordinal month in string", -1)); return TCL_ERROR; } |
