Subject: Implement many Tcl_*Var* functions and Tcl_GetIndexFromObj as (faster/stack-saving) macros around resp their Tcl_*Var*2 equivalent and Tcl_GetIndexFromObjStruct

From: "jan.nijtmans" <[email-masked]>
Date: Fri, 19 Apr 2013 08:19:07 +0000

---
 ChangeLog             |  8 ++++++++
 generic/tclDecls.h    | 25 +++++++++++++++++++++++++
 generic/tclIndexObj.c |  1 +
 generic/tclVar.c      |  7 +++++++
 4 files changed, 41 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 2d39e97..4e159a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-04-18  Jan Nijtmans  <[email-masked]>
+
+	* generic/tclDecls.h: Implement Tcl_Pkg* functions as
+	(faster/stack-saving) macros around Tcl_Pkg*Ex functions.
+	The same for many Tcl_*Var* functions around their
+	Tcl_*Var*2 equivalent and Tcl_GetIndexFromObj around
+	Tcl_GetIndexFromObjStruct.
+
 2013-04-09  Reinhard Max  <[email-masked]>
 
 	* library/http/http.tcl (http::geturl): Allow URLs that don't have
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index a94cb0e..813c75c 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -4525,6 +4525,31 @@ extern TclStubs *tclStubsPtr;
 #undef Tcl_PkgRequire
 #define Tcl_PkgRequire(interp, name, version, exact) \
 	Tcl_PkgRequireEx(interp, name, version, exact, NULL)
+#undef Tcl_GetIndexFromObj
+#define Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr) \
+	Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, \
+	sizeof(char *), msg, flags, indexPtr)
+#undef Tcl_SetVar
+#define Tcl_SetVar(interp, varName, newValue, flags) \
+	Tcl_SetVar2(interp, varName, NULL, newValue, flags)
+#undef Tcl_UnsetVar
+#define Tcl_UnsetVar(interp, varName, flags) \
+	Tcl_UnsetVar2(interp, varName, NULL, flags)
+#undef Tcl_GetVar
+#define Tcl_GetVar(interp, varName, flags) \
+	Tcl_GetVar2(interp, varName, NULL, flags)
+#undef Tcl_TraceVar
+#define Tcl_TraceVar(interp, varName, flags, proc, clientData) \
+	Tcl_TraceVar2(interp, varName, NULL, flags, proc, clientData)
+#undef Tcl_UntraceVar
+#define Tcl_UntraceVar(interp, varName, flags, proc, clientData) \
+	Tcl_UntraceVar2(interp, varName, NULL, flags, proc, clientData)
+#undef Tcl_VarTraceInfo
+#define Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData) \
+	Tcl_VarTraceInfo2(interp, varName, NULL, flags, proc, prevClientData)
+#undef Tcl_UpVar
+#define Tcl_UpVar(interp, frameName, varName, localName, flags) \
+	Tcl_UpVar2(interp, frameName, varName, NULL, localName, flags)
 
 /*
  * Deprecated Tcl procedures:
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index 0103cdb..508148b 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -90,6 +90,7 @@ typedef struct {
  *----------------------------------------------------------------------
  */
 
+#undef Tcl_GetIndexFromObj
 int
 Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr)
     Tcl_Interp *interp; 	/* Used for error reporting if not NULL. */
diff --git a/generic/tclVar.c b/generic/tclVar.c
index c029877..e01ae64 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -1006,6 +1006,7 @@ TclLookupArrayElement(interp, arrayName, elName, flags, msg, createArray, create
  *----------------------------------------------------------------------
  */
 
+#undef Tcl_GetVar
 CONST char *
 Tcl_GetVar(interp, varName, flags)
     Tcl_Interp *interp;		/* Command interpreter in which varName is
@@ -1320,6 +1321,7 @@ Tcl_SetObjCmd(dummy, interp, objc, objv)
  *----------------------------------------------------------------------
  */
 
+#undef Tcl_SetVar
 CONST char *
 Tcl_SetVar(interp, varName, newValue, flags)
     Tcl_Interp *interp;		/* Command interpreter in which varName is
@@ -1918,6 +1920,7 @@ TclPtrIncrVar(interp, varPtr, arrayPtr, part1, part2, incrAmount, flags)
  *----------------------------------------------------------------------
  */
 
+#undef Tcl_UnsetVar
 int
 Tcl_UnsetVar(interp, varName, flags)
     Tcl_Interp *interp;		/* Command interpreter in which varName is
@@ -2222,6 +2225,7 @@ UnsetVarStruct(varPtr, arrayPtr, iPtr, part1, part2, flags)
  *----------------------------------------------------------------------
  */
 
+#undef Tcl_TraceVar
 int
 Tcl_TraceVar(interp, varName, flags, proc, clientData)
     Tcl_Interp *interp;		/* Interpreter in which variable is
@@ -2340,6 +2344,7 @@ Tcl_TraceVar2(interp, part1, part2, flags, proc, clientData)
  *----------------------------------------------------------------------
  */
 
+#undef Tcl_UntraceVar
 void
 Tcl_UntraceVar(interp, varName, flags, proc, clientData)
     Tcl_Interp *interp;		/* Interpreter containing variable. */
@@ -2485,6 +2490,7 @@ Tcl_UntraceVar2(interp, part1, part2, flags, proc, clientData)
  *----------------------------------------------------------------------
  */
 
+#undef Tcl_VarTraceInfo
 ClientData
 Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData)
     Tcl_Interp *interp;		/* Interpreter containing variable. */
@@ -3690,6 +3696,7 @@ ObjMakeUpvar(interp, framePtr, otherP1Ptr, otherP2, otherFlags, myName, myFlags,
  *----------------------------------------------------------------------
  */
 
+#undef Tcl_UpVar
 int
 Tcl_UpVar(interp, frameName, varName, localName, flags)
     Tcl_Interp *interp;		/* Command interpreter in which varName is
-- 
cgit v0.12