aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2012-05-10 09:52:08 +1000
committerSteve Bennett <steveb@workware.net.au>2012-05-10 10:39:29 +1000
commit72a577998daa5edb99f6af1fc4820372e5563141 (patch)
treee93e6c057c007e5861acadaa00792fc7743bf70a
parent50d6304037f9d77c96c2ddecc4bfacf3fa289f84 (diff)
downloadjimtcl-72a577998daa5edb99f6af1fc4820372e5563141.zip
jimtcl-72a577998daa5edb99f6af1fc4820372e5563141.tar.gz
jimtcl-72a577998daa5edb99f6af1fc4820372e5563141.tar.bz2
Fix a compiler warning with namespaces disabled
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--auto.def1
-rw-r--r--jim.c14
2 files changed, 10 insertions, 5 deletions
diff --git a/auto.def b/auto.def
index e4010ee..96f76d9 100644
--- a/auto.def
+++ b/auto.def
@@ -36,6 +36,7 @@ options {
stdlib - Built-in commands including lassign, lambda, alias
syslog - System logging with syslog
tclcompat - Tcl compatible read, gets, puts, parray, case, ...
+ namespace - Tcl compatible namespace support
These are disabled by default:
diff --git a/jim.c b/jim.c
index d440539..3904ba9 100644
--- a/jim.c
+++ b/jim.c
@@ -13949,7 +13949,6 @@ static int Jim_InfoCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *arg
int cmd;
Jim_Obj *objPtr;
int mode = 0;
- int nons = 0;
static const char * const commands[] = {
"body", "statics", "commands", "procs", "channels", "exists", "globals", "level", "frame", "locals",
@@ -13964,16 +13963,21 @@ static int Jim_InfoCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *arg
INFO_RETURNCODES, INFO_REFERENCES, INFO_ALIAS
};
- if (argc < 2) {
- Jim_WrongNumArgs(interp, 1, argv, "subcommand ?args ...?");
- return JIM_ERR;
- }
+#ifdef jim_ext_namespace
+ int nons = 0;
+
if (argc > 2 && Jim_CompareStringImmediate(interp, argv[1], "-nons")) {
/* This is for internal use only */
argc--;
argv++;
nons = 1;
}
+#endif
+
+ if (argc < 2) {
+ Jim_WrongNumArgs(interp, 1, argv, "subcommand ?args ...?");
+ return JIM_ERR;
+ }
if (Jim_GetEnum(interp, argv[1], commands, &cmd, "subcommand", JIM_ERRMSG | JIM_ENUM_ABBREV)
!= JIM_OK) {
return JIM_ERR;