From db098b8fd93fa7cbb4af72d00b2ecc51ec6e7ca8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 22 May 2024 21:12:15 +0000 Subject: clock option re-ordering --- generic/tclClock.c | 37 +++++++++++++++++-------------------- generic/tclClockFmt.c | 8 ++++---- generic/tclStrIdxTree.c | 7 +++---- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/generic/tclClock.c b/generic/tclClock.c index c0fe59a..cbcacf2 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -83,8 +83,7 @@ static int ConvertLocalToUTCUsingTable(Tcl_Interp *, Tcl_WideInt *rangesVal); static int ConvertLocalToUTCUsingC(Tcl_Interp *, TclDateFields *, int); -static int ClockConfigureObjCmd(void *clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); +static Tcl_ObjCmdProc ClockConfigureObjCmd; static void GetYearWeekDay(TclDateFields *, int); static void GetGregorianEraYearDay(TclDateFields *, int); static void GetMonthDay(TclDateFields *); @@ -941,7 +940,8 @@ TimezoneLoaded( * * ClockConfigureObjCmd -- * - * This function is invoked to process the Tcl "::clock::configure" (internal) command. + * This function is invoked to process the Tcl "::tcl::unsupported::clock::configure" + * (internal, unsupported) command. * * Usage: * ::tcl::unsupported::clock::configure ?-option ?value?? @@ -964,19 +964,16 @@ ClockConfigureObjCmd( { ClockClientData *dataPtr = (ClockClientData *)clientData; static const char *const options[] = { - "-system-tz", "-setup-tz", "-default-locale", "-current-locale", - "-clear", + "-default-locale", "-clear", "-current-locale", "-year-century", "-century-switch", "-min-year", "-max-year", "-max-jdn", "-validate", - "-init-complete", - NULL + "-init-complete", "-setup-tz", "-system-tz", NULL }; enum optionInd { - CLOCK_SYSTEM_TZ, CLOCK_SETUP_TZ, CLOCK_DEFAULT_LOCALE, CLOCK_CURRENT_LOCALE, - CLOCK_CLEAR_CACHE, + CLOCK_DEFAULT_LOCALE, CLOCK_CLEAR_CACHE, CLOCK_CURRENT_LOCALE, CLOCK_YEAR_CENTURY, CLOCK_CENTURY_SWITCH, CLOCK_MIN_YEAR, CLOCK_MAX_YEAR, CLOCK_MAX_JDN, CLOCK_VALIDATE, - CLOCK_INIT_COMPLETE + CLOCK_INIT_COMPLETE, CLOCK_SETUP_TZ, CLOCK_SYSTEM_TZ }; int optionIndex; /* Index of an option. */ Tcl_Size i; @@ -4571,16 +4568,16 @@ ClockSafeCatchCmd( Tcl_Obj *const objv[]) { typedef struct { - int status; /* return code status */ - int flags; /* Each remaining field saves the */ - int returnLevel; /* corresponding field of the Interp */ - int returnCode; /* struct. These fields taken together are */ - Tcl_Obj *errorInfo; /* the "state" of the interp. */ - Tcl_Obj *errorCode; - Tcl_Obj *returnOpts; - Tcl_Obj *objResult; - Tcl_Obj *errorStack; - int resetErrorStack; + int status; /* return code status */ + int flags; /* Each remaining field saves the */ + int returnLevel; /* corresponding field of the Interp */ + int returnCode; /* struct. These fields taken together are */ + Tcl_Obj *errorInfo; /* the "state" of the interp. */ + Tcl_Obj *errorCode; + Tcl_Obj *returnOpts; + Tcl_Obj *objResult; + Tcl_Obj *errorStack; + int resetErrorStack; } InterpState; Interp *iPtr = (Interp *)interp; diff --git a/generic/tclClockFmt.c b/generic/tclClockFmt.c index 9b32020..1c7461c 100644 --- a/generic/tclClockFmt.c +++ b/generic/tclClockFmt.c @@ -249,7 +249,7 @@ Clock_itoaw( val /= 10; *p-- = '0' + c; } while (val > 0); - /* fulling with pad-char */ + /* filling with pad-char */ while (p >= buf) { *p-- = padchar; } @@ -290,7 +290,7 @@ Clock_itoaw( if (padchar != '0') { *p-- = '-'; } - /* fulling with pad-char */ + /* filling with pad-char */ while (p >= buf + 1) { *p-- = padchar; } @@ -347,7 +347,7 @@ Clock_witoaw( val /= 10; *p-- = '0' + c; } while (val > 0); - /* fulling with pad-char */ + /* filling with pad-char */ while (p >= buf) { *p-- = padchar; } @@ -398,7 +398,7 @@ Clock_witoaw( if (padchar != '0') { *p-- = '-'; } - /* fulling with pad-char */ + /* filling with pad-char */ while (p >= buf + 1) { *p-- = padchar; } diff --git a/generic/tclStrIdxTree.c b/generic/tclStrIdxTree.c index 1c4cff3..e9ba362 100644 --- a/generic/tclStrIdxTree.c +++ b/generic/tclStrIdxTree.c @@ -479,16 +479,15 @@ TclStrIdxTreePrint( int TclStrIdxTreeTestObjCmd( - ClientData clientData, Tcl_Interp *interp, + void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { const char *cs, *cin, *ret; static const char *const options[] = { - "index", "puts-index", "findequal", - NULL + "findequal", "index", "puts-index", NULL }; enum optionInd { - O_INDEX, O_PUTS_INDEX, O_FINDEQUAL + O_FINDEQUAL, O_INDEX, O_PUTS_INDEX }; int optionIndex; -- cgit v0.12