summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-06 13:12:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-06 13:12:11 (GMT)
commit9dd5a63f35590c88db321bf5f70429c61ed5a3b5 (patch)
tree0afcb7308752509fd30c1d9edbacd3e9868dd797
parent65254e27f9238b5be5dac497f9267fb484024829 (diff)
downloadtcl-9dd5a63f35590c88db321bf5f70429c61ed5a3b5.zip
tcl-9dd5a63f35590c88db321bf5f70429c61ed5a3b5.tar.gz
tcl-9dd5a63f35590c88db321bf5f70429c61ed5a3b5.tar.bz2
TIP #640: Remove Tcl_SaveResult (in Tcl 8.7 it's only removed when compiled with -DTCL_NO_DEPRECATED)
-rw-r--r--doc/SaveInterpState.3 (renamed from doc/SaveResult.3)0
-rw-r--r--generic/tcl.h2
-rw-r--r--generic/tclDecls.h29
-rw-r--r--generic/tclTest.c8
-rw-r--r--macosx/Tcl.xcodeproj/project.pbxproj4
-rw-r--r--win/tcl.dsp2
6 files changed, 20 insertions, 25 deletions
diff --git a/doc/SaveResult.3 b/doc/SaveInterpState.3
index 804f9ec..804f9ec 100644
--- a/doc/SaveResult.3
+++ b/doc/SaveInterpState.3
diff --git a/generic/tcl.h b/generic/tcl.h
index f17d43e..c8a76c5 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -817,6 +817,7 @@ typedef struct Tcl_Obj {
* typically allocated on the stack.
*/
+#ifndef TCL_NO_DEPRECATED
typedef struct Tcl_SavedResult {
char *result;
Tcl_FreeProc *freeProc;
@@ -826,6 +827,7 @@ typedef struct Tcl_SavedResult {
int appendUsed;
char resultSpace[200+1];
} Tcl_SavedResult;
+#endif
/*
*----------------------------------------------------------------------------
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 25adc95..62b9604 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -14,6 +14,10 @@
#include <stddef.h> /* for size_t */
+#ifdef TCL_NO_DEPRECATED
+# define Tcl_SavedResult void
+#endif /* TCL_NO_DEPRECATED */
+
#undef TCL_STORAGE_CLASS
#ifdef BUILD_tcl
# define TCL_STORAGE_CLASS DLLEXPORT
@@ -4231,30 +4235,8 @@ extern const TclStubs *tclStubsPtr;
#define Tcl_GlobalEval(interp, objPtr) \
Tcl_EvalEx(interp, objPtr, TCL_INDEX_NONE, TCL_EVAL_GLOBAL)
#undef Tcl_SaveResult
-static TCL_DEPRECATED_API("Use Tcl_SaveInterpState") void Tcl_SaveResult_(void) {}
-#define Tcl_SaveResult(interp, statePtr) \
- do { \
- Tcl_SaveResult_(); \
- (statePtr)->objResultPtr = Tcl_GetObjResult(interp); \
- Tcl_IncrRefCount((statePtr)->objResultPtr); \
- Tcl_SetObjResult(interp, Tcl_NewObj()); \
- } while(0)
#undef Tcl_RestoreResult
-static TCL_DEPRECATED_API("Use Tcl_RestoreInterpState") void Tcl_RestoreResult_(void) {}
-#define Tcl_RestoreResult(interp, statePtr) \
- do { \
- Tcl_RestoreResult_(); \
- Tcl_ResetResult(interp); \
- Tcl_SetObjResult(interp, (statePtr)->objResultPtr); \
- Tcl_DecrRefCount((statePtr)->objResultPtr); \
- } while(0)
#undef Tcl_DiscardResult
-static TCL_DEPRECATED_API("Use Tcl_DiscardInterpState") void Tcl_DiscardResult_(void) {}
-#define Tcl_DiscardResult(statePtr) \
- do { \
- Tcl_DiscardResult_(); \
- Tcl_DecrRefCount((statePtr)->objResultPtr); \
- } while(0)
#undef Tcl_SetResult
#define Tcl_SetResult(interp, result, freeProc) \
do { \
@@ -4492,6 +4474,9 @@ static TCL_DEPRECATED_API("Use Tcl_DiscardInterpState") void Tcl_DiscardResult_(
* Deprecated Tcl procedures:
*/
+#ifdef TCL_NO_DEPRECATED
+# undef Tcl_SavedResult
+#endif /* TCL_NO_DEPRECATED */
#undef Tcl_EvalObj
#define Tcl_EvalObj(interp, objPtr) \
Tcl_EvalObjEx(interp, objPtr, 0)
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 354ea9c..95f4d2f 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -145,7 +145,9 @@ typedef struct {
* was called for a result.
*/
+#ifndef TCL_NO_DEPRECATED
static int freeCount;
+#endif /* TCL_NO_DEPRECATED */
/*
* Boolean flag used by the "testsetmainloop" and "testexitmainloop" commands.
@@ -297,8 +299,10 @@ static Tcl_ObjCmdProc TestregexpObjCmd;
static Tcl_ObjCmdProc TestreturnObjCmd;
static void TestregexpXflags(const char *string,
int length, int *cflagsPtr, int *eflagsPtr);
+#ifndef TCL_NO_DEPRECATED
static Tcl_ObjCmdProc TestsaveresultCmd;
static void TestsaveresultFree(char *blockPtr);
+#endif /* TCL_NO_DEPRECATED */
static Tcl_CmdProc TestsetassocdataCmd;
static Tcl_CmdProc TestsetCmd;
static Tcl_CmdProc Testset2Cmd;
@@ -690,8 +694,10 @@ Tcltest_Init(
NULL, NULL);
Tcl_CreateObjCommand(interp, "testreturn", TestreturnObjCmd,
NULL, NULL);
+#ifndef TCL_NO_DEPRECATED
Tcl_CreateObjCommand(interp, "testsaveresult", TestsaveresultCmd,
NULL, NULL);
+#endif
Tcl_CreateCommand(interp, "testservicemode", TestServiceModeCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testsetassocdata", TestsetassocdataCmd,
@@ -5522,6 +5528,7 @@ Testset2Cmd(
*----------------------------------------------------------------------
*/
+#ifndef TCL_NO_DEPRECATED
static int
TestsaveresultCmd(
TCL_UNUSED(void *),
@@ -5635,6 +5642,7 @@ TestsaveresultFree(
{
freeCount++;
}
+#endif /* TCL_NO_DEPRECATED */
/*
*----------------------------------------------------------------------
diff --git a/macosx/Tcl.xcodeproj/project.pbxproj b/macosx/Tcl.xcodeproj/project.pbxproj
index 90896e2..4143128 100644
--- a/macosx/Tcl.xcodeproj/project.pbxproj
+++ b/macosx/Tcl.xcodeproj/project.pbxproj
@@ -376,7 +376,7 @@
F96D3E9108F272A6004A47F5 /* rename.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = rename.n; sourceTree = "<group>"; };
F96D3E9208F272A6004A47F5 /* return.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = return.n; sourceTree = "<group>"; };
F96D3E9308F272A6004A47F5 /* safe.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = safe.n; sourceTree = "<group>"; };
- F96D3E9408F272A6004A47F5 /* SaveResult.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SaveResult.3; sourceTree = "<group>"; };
+ F96D3E9408F272A6004A47F5 /* SaveInterpState.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SaveInterpState.3; sourceTree = "<group>"; };
F96D3E9508F272A6004A47F5 /* scan.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = scan.n; sourceTree = "<group>"; };
F96D3E9608F272A6004A47F5 /* seek.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = seek.n; sourceTree = "<group>"; };
F96D3E9708F272A6004A47F5 /* set.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = set.n; sourceTree = "<group>"; };
@@ -1123,7 +1123,7 @@
F96D3E9108F272A6004A47F5 /* rename.n */,
F96D3E9208F272A6004A47F5 /* return.n */,
F96D3E9308F272A6004A47F5 /* safe.n */,
- F96D3E9408F272A6004A47F5 /* SaveResult.3 */,
+ F96D3E9408F272A6004A47F5 /* SaveInterpState.3 */,
F96D3E9508F272A6004A47F5 /* scan.n */,
F96D3E9608F272A6004A47F5 /* seek.n */,
F93599D80DF1F98300E04F67 /* self.n */,
diff --git a/win/tcl.dsp b/win/tcl.dsp
index cc9d173..aff1000 100644
--- a/win/tcl.dsp
+++ b/win/tcl.dsp
@@ -760,7 +760,7 @@ SOURCE=..\doc\safe.n
# End Source File
# Begin Source File
-SOURCE=..\doc\SaveResult.3
+SOURCE=..\doc\SaveInterpState.3
# End Source File
# Begin Source File