summaryrefslogtreecommitdiff
path: root/graphics/tclblt/patches/tcl8.6.patch
blob: e760a7a4486490ca037ed73770b8676905ae2401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Description: Patch replaces the direct usage of deprecated interp->result
    by Tcl_SetResult() and Tcl_GetStringResult() calls making it possible
    to build using Tcl/Tk 8.6.
Last-Modified: Fri, 04 Jul 2014 09:20:48 +0400

--- a/generic/bltScrollbar.c
+++ b/generic/bltScrollbar.c
@@ -588,7 +588,7 @@
 	} else {
 	    fraction = ((double)pixels / (double)barWidth);
 	}
-	sprintf(interp->result, "%g", fraction);
+	sprintf(Tcl_GetStringResult(interp), "%g", fraction);
     } else if ((c == 'f') && (strncmp(argv[1], "fraction", length) == 0)) {
 	int x, y, pos, barWidth;
 	double fraction;
--- a/generic/bltTed.c
+++ b/generic/bltTed.c
@@ -1504,7 +1504,7 @@
 	tablePtr->flags |= ARRANGE_PENDING;
 	Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr);
     }
-    interp->result = Tk_PathName(tedPtr->tkwin);
+    Tcl_SetResult(interp, (char*)Tk_PathName(tedPtr->tkwin), TCL_VOLATILE);
     tedPtr->flags |= LAYOUT_PENDING;
     EventuallyRedraw(tedPtr);
     return TCL_OK;
@@ -1678,7 +1678,7 @@
 	    tedPtr->activeRectArr[4].width = grip - 1;
 	    tedPtr->activeRectArr[4].height = grip - 1;
 
-	    interp->result = Tk_PathName(entryPtr->tkwin);
+	    Tcl_SetResult(interp, (char*)Tk_PathName(entryPtr->tkwin), TCL_VOLATILE);
 	    active = 1;
 	    break;
 	}
@@ -1751,7 +1751,7 @@
 	tablePtr->flags |= ARRANGE_PENDING;
 	Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr);
     }
-    interp->result = Tk_PathName(tedPtr->tkwin);
+    Tcl_SetResult(interp, (char*)Tk_PathName(tedPtr->tkwin), TCL_VOLATILE);
     tedPtr->flags |= LAYOUT_PENDING;
     EventuallyRedraw(tedPtr);
     return TCL_OK;
--- a/generic/bltVecMath.c
+++ b/generic/bltVecMath.c
@@ -834,20 +834,20 @@
     if ((errno == EDOM) || (value != value)) {
 	Tcl_AppendResult(interp, "domain error: argument not in valid range",
 	    (char *)NULL);
-	Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", interp->result,
+	Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", Tcl_GetStringResult(interp),
 	    (char *)NULL);
     } else if ((errno == ERANGE) || IS_INF(value)) {
 	if (value == 0.0) {
 	    Tcl_AppendResult(interp, 
 			     "floating-point value too small to represent",
 		(char *)NULL);
-	    Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", interp->result,
+	    Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", Tcl_GetStringResult(interp),
 		(char *)NULL);
 	} else {
 	    Tcl_AppendResult(interp, 
 			     "floating-point value too large to represent",
 		(char *)NULL);
-	    Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", interp->result,
+	    Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", Tcl_GetStringResult(interp),
 		(char *)NULL);
 	}
     } else {
@@ -856,7 +856,7 @@
 	sprintf(buf, "%d", errno);
 	Tcl_AppendResult(interp, "unknown floating-point error, ",
 	    "errno = ", buf, (char *)NULL);
-	Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", interp->result,
+	Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", Tcl_GetStringResult(interp),
 	    (char *)NULL);
     }
 }
--- a/generic/bltTreeCmd.c
+++ b/generic/bltTreeCmd.c
@@ -8560,7 +8560,7 @@
         if (result == TCL_CONTINUE ) continue;
 	if (result == TCL_ERROR) {
             Tcl_AppendResult(interp,
-            "\n    (\"tree foreach\" body line ", Blt_Itoa(interp->errorLine), ")\n", 0);
+            "\n    (\"tree foreach\" body line ", Blt_Itoa(Tcl_GetErrorLine(interp)), ")\n", 0);
              break;
         }
         if (result != TCL_OK) {