Add a forgotten new patch, that addresses compatibility with against

newer versions of Tcl (8.5+)
This commit is contained in:
Mikhail Teterin 2010-01-23 02:14:39 +00:00
parent 039bd0bff4
commit ff0aabc76a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=248384

View file

@ -0,0 +1,146 @@
--- src/bltNsUtil.h 2002-07-18 02:35:32.000000000 -0400
+++ src/bltNsUtil.h 2010-01-16 11:39:20.000000000 -0500
@@ -47,7 +47,8 @@
#endif
-
+#if TCL_MAJOR_VERSION < 8 || TCL_MINOR_VERSION < 5
EXTERN Tcl_Command Tcl_FindCommand _ANSI_ARGS_((Tcl_Interp *interp,
char *name, Tcl_Namespace *nsPtr, int flags));
+#endif
#define NS_SEARCH_NONE (0)
@@ -64,15 +65,19 @@
EXTERN Tcl_Namespace *Tcl_GetGlobalNamespace _ANSI_ARGS_((Tcl_Interp *interp));
-#if (TCL_MAJOR_VERSION >= 8)
+#if TCL_MAJOR_VERSION == 8
+# if TCL_MINOR_VERSION < 5
EXTERN Tcl_Namespace *Tcl_CreateNamespace _ANSI_ARGS_((Tcl_Interp *interp,
- char *name, ClientData clientData, Tcl_NamespaceDeleteProc *nsDelProc));
-
-EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_((Tcl_Namespace *nsPtr));
+ const char *name, ClientData clientData,
+ Tcl_NamespaceDeleteProc *nsDelProc));
EXTERN Tcl_Namespace *Tcl_FindNamespace _ANSI_ARGS_((Tcl_Interp *interp,
- char *name, Tcl_Namespace *context, int flags));
+ const char *name, Tcl_Namespace *context, int flags));
+
+EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Namespace *nsPtr,
+ const char *pattern, int resetFlag));
+# endif
-EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr,
- char *name, int resetFlag));
+EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_((Tcl_Namespace *nsPtr));
EXTERN Tcl_Var Tcl_FindNamespaceVar _ANSI_ARGS_((Tcl_Interp *interp, char *name,
@@ -87,5 +92,5 @@
Tcl_Interp *interp, CONST char *varName, int flags));
-#endif /* TCL_MAJOR_VERSION >= 8 */
+#endif /* TCL_MAJOR_VERSION == 8 */
--- src/bltCanvEps.c 2002-08-15 01:22:10.000000000 -0400
+++ src/bltCanvEps.c 2010-01-16 23:36:39.000000000 -0500
@@ -324,5 +324,5 @@
int width, int height, int imgWidth, int imgHeight));
static int EpsCoords _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item * itemPtr, int argc, char **argv));
+ Tk_Item * itemPtr, int argc, Tcl_Obj * const objv[]));
static int EpsToArea _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * itemPtr,
double *rectPtr));
@@ -331,7 +331,7 @@
static void ComputeEpsBbox _ANSI_ARGS_((Tk_Canvas canvas, EpsItem *imgPtr));
static int ConfigureEps _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item * itemPtr, int argc, char **argv, int flags));
+ Tk_Item * itemPtr, int argc, Tcl_Obj * const objv[], int flags));
static int CreateEps _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
- struct Tk_Item * itemPtr, int argc, char **argv));
+ struct Tk_Item * itemPtr, int argc, Tcl_Obj * const objv[]));
static void DeleteEps _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * itemPtr,
Display *display));
@@ -916,5 +916,5 @@
*/
static int
-CreateEps(interp, canvas, itemPtr, argc, argv)
+CreateEps(interp, canvas, itemPtr, argc, objv)
Tcl_Interp *interp; /* Interpreter for error reporting. */
Tk_Canvas canvas; /* Canvas to hold new item. */
@@ -922,5 +922,5 @@
* has been initialized by caller. */
int argc; /* Number of arguments in argv. */
- char **argv; /* Arguments describing rectangle. */
+ Tcl_Obj * const objv[]; /* Arguments describing rectangle. */
{
EpsItem *epsPtr = (EpsItem *)itemPtr;
@@ -972,10 +972,9 @@
* Process the arguments to fill in the item record.
*/
-
- if ((Tk_CanvasGetCoord(interp, canvas, argv[0], &(epsPtr->x)) != TCL_OK) ||
- (Tk_CanvasGetCoord(interp, canvas, argv[1], &(epsPtr->y)) != TCL_OK)) {
+ if ((Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[0]), &(epsPtr->x)) != TCL_OK) ||
+ (Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[1]), &(epsPtr->y)) != TCL_OK)) {
return TCL_ERROR;
}
- if (ConfigureEps(interp, canvas, itemPtr, argc - 2, argv + 2, 0)
+ if (ConfigureEps(interp, canvas, itemPtr, argc - 2, objv + 2, 0)
!= TCL_OK) {
DeleteEps(canvas, itemPtr, Tk_Display(tkwin));
@@ -1039,10 +1038,10 @@
*/
static int
-ConfigureEps(interp, canvas, itemPtr, argc, argv, flags)
+ConfigureEps(interp, canvas, itemPtr, argc, objv, flags)
Tcl_Interp *interp; /* Used for error reporting. */
Tk_Canvas canvas; /* Canvas containing itemPtr. */
Tk_Item *itemPtr; /* EPS item to reconfigure. */
int argc; /* Number of elements in argv. */
- char **argv; /* Arguments describing things to configure. */
+ Tcl_Obj * const objv[]; /* Arguments describing things to configure. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
@@ -1053,4 +1052,9 @@
GC newGC;
int width, height;
+ char *argv[argc];
+ int i;
+
+ for (i = 0; i < argc; i++)
+ argv[i] = Tcl_GetString(objv[i]);
tkwin = Tk_CanvasTkwin(canvas);
@@ -1193,5 +1197,5 @@
*/
static int
-EpsCoords(interp, canvas, itemPtr, argc, argv)
+EpsCoords(interp, canvas, itemPtr, argc, objv)
Tcl_Interp *interp; /* Used for error reporting. */
Tk_Canvas canvas; /* Canvas containing item. */
@@ -1200,5 +1204,5 @@
int argc; /* Number of coordinates supplied in
* argv. */
- char **argv; /* Array of coordinates: x1, y1,
+ Tcl_Obj * const objv[]; /* Array of coordinates: x1, y1,
* x2, y2, ... */
{
@@ -1213,6 +1217,6 @@
double x, y; /* Don't overwrite old coordinates on errors */
- if ((Tk_CanvasGetCoord(interp, canvas, argv[0], &x) != TCL_OK) ||
- (Tk_CanvasGetCoord(interp, canvas, argv[1], &y) != TCL_OK)) {
+ if ((Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[0]), &x) != TCL_OK) ||
+ (Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[1]), &y) != TCL_OK)) {
return TCL_ERROR;
}
@@ -1714,5 +1718,5 @@
Tk_CreateItemType(&epsItemType);
/* Initialize custom canvas option routines. */
- tagsOption.parseProc = Tk_CanvasTagsParseProc;
+ tagsOption.parseProc = (Tk_OptionParseProc *)Tk_CanvasTagsParseProc;
tagsOption.printProc = Tk_CanvasTagsPrintProc;
}