diff options
author | Steve Bennett <steveb@workware.net.au> | 2012-05-10 09:52:08 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2012-05-10 10:39:29 +1000 |
commit | 72a577998daa5edb99f6af1fc4820372e5563141 (patch) | |
tree | e93e6c057c007e5861acadaa00792fc7743bf70a | |
parent | 50d6304037f9d77c96c2ddecc4bfacf3fa289f84 (diff) | |
download | jimtcl-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.def | 1 | ||||
-rw-r--r-- | jim.c | 14 |
2 files changed, 10 insertions, 5 deletions
@@ -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: @@ -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; |