summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclClock.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c
index d46058f..13bf229 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclClock.c,v 1.5 1999/09/21 04:20:39 hobbs Exp $
+ * RCS: @(#) $Id: tclClock.c,v 1.6 2000/01/08 02:31:22 ericm Exp $
*/
#include "tcl.h"
@@ -69,6 +69,9 @@ Tcl_ClockObjCmd (client, interp, objc, objv)
static char *switches[] =
{"clicks", "format", "scan", "seconds", (char *) NULL};
+ enum command { COMMAND_CLICKS, COMMAND_FORMAT, COMMAND_SCAN,
+ COMMAND_SECONDS
+ };
static char *formatSwitches[] = {"-format", "-gmt", (char *) NULL};
static char *scanSwitches[] = {"-base", "-gmt", (char *) NULL};
@@ -82,8 +85,8 @@ Tcl_ClockObjCmd (client, interp, objc, objv)
!= TCL_OK) {
return TCL_ERROR;
}
- switch (index) {
- case 0: { /* clicks */
+ switch ((enum command) index) {
+ case COMMAND_CLICKS: { /* clicks */
int forceMilli = 0;
if (objc == 3) {
@@ -114,7 +117,8 @@ Tcl_ClockObjCmd (client, interp, objc, objv)
}
return TCL_OK;
}
- case 1: /* format */
+
+ case COMMAND_FORMAT: /* format */
if ((objc < 3) || (objc > 7)) {
wrongFmtArgs:
Tcl_WrongNumArgs(interp, 2, objv,
@@ -153,7 +157,8 @@ Tcl_ClockObjCmd (client, interp, objc, objv)
}
return FormatClock(interp, (unsigned long) clockVal, useGMT,
format);
- case 2: /* scan */
+
+ case COMMAND_SCAN: /* scan */
if ((objc < 3) || (objc > 7)) {
wrongScanArgs:
Tcl_WrongNumArgs(interp, 2, objv,
@@ -215,7 +220,8 @@ Tcl_ClockObjCmd (client, interp, objc, objv)
Tcl_SetLongObj(resultPtr, (long) clockVal);
return TCL_OK;
- case 3: /* seconds */
+
+ case COMMAND_SECONDS: /* seconds */
if (objc != 2) {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;