From 25f07e032603d465d333657ae2406f2017e3c848 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 3 Nov 2022 20:51:13 +0000 Subject: If compiled with -DTK_NO_DEPRECATED, make TK_CONFIG_OBJS mandatory. So, we could get rid of this flag in Tk 9.x (TIP upcoming!) --- generic/tkCanvas.c | 20 ++++++++++++++++++++ generic/tkOldConfig.c | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index cd96b6c..c77d33e 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -340,6 +340,9 @@ ItemConfigure( result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc, objv, TK_CONFIG_ARGV_ONLY); } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else const char **args = TkGetStringsFromObjs(objc, objv); result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr, @@ -347,6 +350,7 @@ ItemConfigure( if (args != NULL) { ckfree(args); } +#endif } return result; } @@ -389,6 +393,9 @@ ItemCoords( result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc, objv); } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else const char **args = TkGetStringsFromObjs(objc, objv); result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr, @@ -396,6 +403,7 @@ ItemCoords( if (args != NULL) { ckfree(args); } +#endif } return result; } @@ -415,6 +423,9 @@ ItemCreate( result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc-3, objv+3); } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else const char **args = TkGetStringsFromObjs(objc-3, objv+3); result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr, @@ -422,6 +433,7 @@ ItemCreate( if (args != NULL) { ckfree(args); } +#endif } return result; } @@ -481,8 +493,12 @@ ItemIndex( return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objPtr, indexPtr); } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr, itemPtr, (Tcl_Obj *) Tcl_GetString(objPtr), indexPtr); +#endif } } @@ -497,8 +513,12 @@ ItemInsert( itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr, beforeThis, toInsert); } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr, beforeThis, (Tcl_Obj *) Tcl_GetString(toInsert)); +#endif } } diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 442c7a6..cc52e8c 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -127,7 +127,11 @@ Tk_ConfigureWidget( if (flags & TK_CONFIG_OBJS) { arg = Tcl_GetString((Tcl_Obj *) *argv); } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else arg = *argv; +#endif } specPtr = FindConfigSpec(interp, staticSpecs, arg, needFlags, hateFlags); if (specPtr == NULL) { @@ -147,7 +151,11 @@ Tk_ConfigureWidget( if (flags & TK_CONFIG_OBJS) { arg = Tcl_GetString((Tcl_Obj *) argv[1]); } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else arg = argv[1]; +#endif } if (DoConfig(interp, tkwin, specPtr, arg, 0, widgRec) != TCL_OK) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( -- cgit v0.12