| 1 |
Description: Patch replaces the direct usage of deprecated interp->result |
| 2 |
by Tcl_SetResult() and Tcl_GetStringResult() calls making it possible |
| 3 |
to build using Tcl/Tk 8.6. |
| 4 |
Last-Modified: Fri, 04 Jul 2014 09:20:48 +0400 |
| 5 |
|
| 6 |
--- a/generic/bltScrollbar.c |
| 7 |
+++ b/generic/bltScrollbar.c |
| 8 |
@@ -588,7 +588,7 @@ |
| 9 |
} else { |
| 10 |
fraction = ((double)pixels / (double)barWidth); |
| 11 |
} |
| 12 |
|
| 13 |
+ sprintf(Tcl_GetStringResult(interp), "%g", fraction); |
| 14 |
} else if ((c == 'f') && (strncmp(argv[1], "fraction", length) == 0)) { |
| 15 |
int x, y, pos, barWidth; |
| 16 |
double fraction; |
| 17 |
--- a/generic/bltTed.c |
| 18 |
+++ b/generic/bltTed.c |
| 19 |
@@ -1504,7 +1504,7 @@ |
| 20 |
tablePtr->flags |= ARRANGE_PENDING; |
| 21 |
Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr); |
| 22 |
} |
| 23 |
|
| 24 |
+ Tcl_SetResult(interp, (char*)Tk_PathName(tedPtr->tkwin), TCL_VOLATILE); |
| 25 |
tedPtr->flags |= LAYOUT_PENDING; |
| 26 |
EventuallyRedraw(tedPtr); |
| 27 |
return TCL_OK; |
| 28 |
@@ -1678,7 +1678,7 @@ |
| 29 |
tedPtr->activeRectArr[4].width = grip - 1; |
| 30 |
tedPtr->activeRectArr[4].height = grip - 1; |
| 31 |
|
| 32 |
|
| 33 |
+ Tcl_SetResult(interp, (char*)Tk_PathName(entryPtr->tkwin), TCL_VOLATILE); |
| 34 |
active = 1; |
| 35 |
break; |
| 36 |
} |
| 37 |
@@ -1751,7 +1751,7 @@ |
| 38 |
tablePtr->flags |= ARRANGE_PENDING; |
| 39 |
Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr); |
| 40 |
} |
| 41 |
|
| 42 |
+ Tcl_SetResult(interp, (char*)Tk_PathName(tedPtr->tkwin), TCL_VOLATILE); |
| 43 |
tedPtr->flags |= LAYOUT_PENDING; |
| 44 |
EventuallyRedraw(tedPtr); |
| 45 |
return TCL_OK; |
| 46 |
--- a/generic/bltVecMath.c |
| 47 |
+++ b/generic/bltVecMath.c |
| 48 |
@@ -834,20 +834,20 @@ |
| 49 |
if ((errno == EDOM) || (value != value)) { |
| 50 |
Tcl_AppendResult(interp, "domain error: argument not in valid range", |
| 51 |
(char *)NULL); |
| 52 |
|
| 53 |
+ Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", Tcl_GetStringResult(interp), |
| 54 |
(char *)NULL); |
| 55 |
} else if ((errno == ERANGE) || IS_INF(value)) { |
| 56 |
if (value == 0.0) { |
| 57 |
Tcl_AppendResult(interp, |
| 58 |
"floating-point value too small to represent", |
| 59 |
(char *)NULL); |
| 60 |
|
| 61 |
+ Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", Tcl_GetStringResult(interp), |
| 62 |
(char *)NULL); |
| 63 |
} else { |
| 64 |
Tcl_AppendResult(interp, |
| 65 |
"floating-point value too large to represent", |
| 66 |
(char *)NULL); |
| 67 |
|
| 68 |
+ Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", Tcl_GetStringResult(interp), |
| 69 |
(char *)NULL); |
| 70 |
} |
| 71 |
} else { |
| 72 |
@@ -856,7 +856,7 @@ |
| 73 |
sprintf(buf, "%d", errno); |
| 74 |
Tcl_AppendResult(interp, "unknown floating-point error, ", |
| 75 |
"errno = ", buf, (char *)NULL); |
| 76 |
|
| 77 |
+ Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", Tcl_GetStringResult(interp), |
| 78 |
(char *)NULL); |
| 79 |
} |
| 80 |
} |
| 81 |
--- a/generic/bltTreeCmd.c |
| 82 |
+++ b/generic/bltTreeCmd.c |
| 83 |
@@ -8560,7 +8560,7 @@ |
| 84 |
if (result == TCL_CONTINUE ) continue; |
| 85 |
if (result == TCL_ERROR) { |
| 86 |
Tcl_AppendResult(interp, |
| 87 |
|
| 88 |
+ "\n (\"tree foreach\" body line ", Blt_Itoa(Tcl_GetErrorLine(interp)), ")\n", 0); |
| 89 |
break; |
| 90 |
} |
| 91 |
if (result != TCL_OK) { |