summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-15 13:34:51 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-15 13:34:51 (GMT)
commitebf7aa78ca18f687fe743101bc1457465a8ade04 (patch)
tree2df89698f16092565e1dbc66c0718880a7655642
parent458337a57e04538b5ccfc312e9c0cfc7da8cbbcd (diff)
downloadtk-ebf7aa78ca18f687fe743101bc1457465a8ade04.zip
tk-ebf7aa78ca18f687fe743101bc1457465a8ade04.tar.gz
tk-ebf7aa78ca18f687fe743101bc1457465a8ade04.tar.bz2
Change Tk_FreeStyleFromObj (undocumented, nop) into a macro. So, stub-enabled extensions won't call this function any more.
Some code cleanup in tkConfig.c
-rw-r--r--generic/tkConfig.c20
-rw-r--r--generic/tkDecls.h2
-rw-r--r--generic/tkStubInit.c1
-rw-r--r--generic/tkStyle.c1
4 files changed, 10 insertions, 14 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 7f35038..5639de4 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -849,11 +849,9 @@ DoObjConfig(
if (nullOK && ObjectIsEmpty(valuePtr)) {
valuePtr = NULL;
newPixels = 0;
- } else {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr,
- &newPixels) != TCL_OK) {
- return TCL_ERROR;
- }
+ } else if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr,
+ &newPixels) != TCL_OK) {
+ return TCL_ERROR;
}
if (internalPtr != NULL) {
*((int *) oldInternalPtr) = *((int *) internalPtr);
@@ -867,11 +865,9 @@ DoObjConfig(
if (nullOK && ObjectIsEmpty(valuePtr)) {
valuePtr = NULL;
newWin = NULL;
- } else {
- if (TkGetWindowFromObj(interp, tkwin, valuePtr,
- &newWin) != TCL_OK) {
- return TCL_ERROR;
- }
+ } else if (TkGetWindowFromObj(interp, tkwin, valuePtr,
+ &newWin) != TCL_OK) {
+ return TCL_ERROR;
}
if (internalPtr != NULL) {
*((Tk_Window *) oldInternalPtr) = *((Tk_Window *) internalPtr);
@@ -1405,8 +1401,6 @@ Tk_RestoreSavedOptions(
CLANG_ASSERT(internalPtr);
switch (specPtr->type) {
case TK_OPTION_BOOLEAN:
- *((int *) internalPtr) = *((int *) ptr);
- break;
case TK_OPTION_INT:
*((int *) internalPtr) = *((int *) ptr);
break;
@@ -1642,8 +1636,6 @@ FreeResources(
if (internalFormExists) {
Tk_FreeStyle(*((Tk_Style *) internalPtr));
*((Tk_Style *) internalPtr) = NULL;
- } else if (objPtr != NULL) {
- Tk_FreeStyleFromObj(objPtr);
}
break;
case TK_OPTION_BITMAP:
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index 2072930..56af6d3 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -1750,6 +1750,8 @@ extern const TkStubs *tkStubsPtr;
EXTERN void Tk_MainExW(int argc, wchar_t **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
#endif
+#undef Tk_FreeStyleFromObj
+#define Tk_FreeStyleFromObj(objPtr) ((void)(objPtr))
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 210bb5f..ef418e7 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -46,6 +46,7 @@ MODULE_SCOPE const TkStubs tkStubs;
#undef XGrabServer
#undef XFree
#undef XFlush
+#undef Tk_FreeStyleFromObj
#define TkUnusedStubEntry 0
#define TkpCmapStressed_ TkpCmapStressed
diff --git a/generic/tkStyle.c b/generic/tkStyle.c
index 14bae66..8068404 100644
--- a/generic/tkStyle.c
+++ b/generic/tkStyle.c
@@ -1447,6 +1447,7 @@ Tk_GetStyleFromObj(
*
*---------------------------------------------------------------------------
*/
+#undef Tk_FreeStyleFromObj
void
Tk_FreeStyleFromObj(
TCL_UNUSED(Tcl_Obj *))