tcl8.6.patch 3.3 KB

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