diff options
author | Steve Bennett <steveb@workware.net.au> | 2024-08-28 14:41:13 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2025-07-16 09:34:08 +1000 |
commit | e5faa1eb5d11ca5c26ee3f28f5377a1dbdaad23e (patch) | |
tree | e69322034baba2aca32e37f166752f2c9de3b21b | |
parent | 9e0bab17753c5222c37228ce10be67ea56c17a5e (diff) | |
download | jimtcl-e5faa1eb5d11ca5c26ee3f28f5377a1dbdaad23e.zip jimtcl-e5faa1eb5d11ca5c26ee3f28f5377a1dbdaad23e.tar.gz jimtcl-e5faa1eb5d11ca5c26ee3f28f5377a1dbdaad23e.tar.bz2 |
core: remove unused fields and bump ABI
Now various fields in Jim_Interp and Jim_CallFrame are unused
so remove them and bump the ABI version to prevent loading
of incompatible extensions.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | jim.c | 8 | ||||
-rw-r--r-- | jim.h | 9 |
2 files changed, 6 insertions, 11 deletions
@@ -6065,12 +6065,12 @@ static void JimSetStackTrace(Jim_Interp *interp, Jim_Obj *stackTraceObj) Jim_IncrRefCount(stackTraceObj); Jim_DecrRefCount(interp, interp->stackTrace); interp->stackTrace = stackTraceObj; - interp->errorFlag = 1; + interp->hasErrorStackTrace = 1; } static void JimSetErrorStack(Jim_Interp *interp, ScriptObj *script) { - if (!interp->errorFlag) { + if (!interp->hasErrorStackTrace) { int i; Jim_Obj *stackTrace = Jim_NewListObj(interp, NULL, 0); @@ -11289,7 +11289,7 @@ int Jim_EvalObj(Jim_Interp *interp, Jim_Obj *scriptObjPtr) JimPushEvalFrame(interp, &frame, scriptObjPtr); /* Collect a new error stack trace if an error occurs */ - interp->errorFlag = 0; + interp->hasErrorStackTrace = 0; argv = sargv; /* Execute every command sequentially until the end of the script @@ -14985,7 +14985,7 @@ wrongargs: else { exitCode = Jim_EvalObj(interp, argv[idx]); /* Once caught, a new error will set a stack trace again */ - interp->errorFlag = 0; + interp->hasErrorStackTrace = 0; } interp->signal_level -= sig; @@ -125,7 +125,7 @@ extern "C" { * ---------------------------------------------------------------------------*/ /* Increment this every time the public ABI changes */ -#define JIM_ABI_VERSION 101 +#define JIM_ABI_VERSION 102 #define JIM_OK 0 #define JIM_ERR 1 @@ -439,8 +439,6 @@ typedef struct Jim_CallFrame { Jim_Obj *procBodyObjPtr; /* body object of the running procedure */ struct Jim_CallFrame *next; /* Callframes are in a linked list */ Jim_Obj *nsObj; /* Namespace for this proc call frame */ - Jim_Obj *unused_fileNameObj; - int unused_line; Jim_Stack *localCommands; /* commands to be destroyed when the call frame is destroyed */ struct Jim_Obj *tailcallObj; /* Pending tailcall invocation */ struct Jim_Cmd *tailcallCmd; /* Resolved command for pending tailcall invocation */ @@ -540,7 +538,6 @@ typedef struct Jim_PrngState { * ---------------------------------------------------------------------------*/ typedef struct Jim_Interp { Jim_Obj *result; /* object returned by the last command called. */ - int unused_errorLine; /* Error line where an error occurred. */ Jim_Obj *currentFilenameObj; /* filename of current Jim_EvalFile() */ int break_level; /* break/continue level */ int maxCallFrameDepth; /* Used for infinite loop detection. */ @@ -568,11 +565,9 @@ typedef struct Jim_Interp { int safeexpr; /* Set when evaluating a "safe" expression, no var subst or command eval */ Jim_Obj *liveList; /* Linked list of all the live objects. */ Jim_Obj *freeList; /* Linked list of all the unused objects. */ - Jim_Obj *unused_currentScriptObj; /* Script currently in execution. */ Jim_EvalFrame topEvalFrame; /* dummy top evaluation frame */ Jim_EvalFrame *evalFrame; /* evaluation stack */ int procLevel; - Jim_Obj * const *unused_argv; Jim_Obj *nullScriptObj; /* script representation of an empty string */ Jim_Obj *emptyObj; /* Shared empty string object. */ Jim_Obj *trueObj; /* Shared true int object. */ @@ -591,7 +586,7 @@ typedef struct Jim_Interp { Jim_Obj *defer; /* "jim::defer" */ Jim_Obj *traceCmdObj; /* If non-null, execution trace command to invoke */ int unknown_called; /* The unknown command has been invoked */ - int errorFlag; /* Set if an error occurred during execution. */ + int hasErrorStackTrace; /* If a stack trace has been set due to an error during execution. */ void *cmdPrivData; /* Used to pass the private data pointer to a command. It is set to what the user specified via Jim_CreateCommand(). */ |