Posted to tcl by schelte at Wed Oct 25 11:06:26 GMT 2023view raw
- Index: src/htmlcmd.c
- ==================================================================
- --- src/htmlcmd.c
- +++ src/htmlcmd.c
- @@ -378,13 +378,15 @@
- ClientData clientData; /* The HTML widget */
- Tcl_Interp *interp; /* The interpreter */
- int argc; /* Number of arguments */
- const char **argv; /* List of all arguments */
- {
- + char buf[32];
- HtmlWidget *htmlPtr = (HtmlWidget *) clientData;
- if (argc == 2) {
- - HtmlComputeHorizontalPosition(htmlPtr, interp->result);
- + HtmlComputeHorizontalPosition(htmlPtr, buf);
- + Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- else {
- int count;
- double fraction;
- int maxX = htmlPtr->maxX;
- @@ -434,12 +436,14 @@
- Tcl_Interp *interp; /* The interpreter */
- int argc; /* Number of arguments */
- const char **argv; /* List of all arguments */
- {
- HtmlWidget *htmlPtr = (HtmlWidget *) clientData;
- + char buf[32];
- if (argc == 2) {
- - HtmlComputeVerticalPosition(htmlPtr, interp->result);
- + HtmlComputeVerticalPosition(htmlPtr, buf);
- + Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- else if (argc == 3) {
- HtmlElement *p = HtmlAttrElem(htmlPtr, "name", argv[2]);
- if (p && p->anchor.y == 0) {
- HtmlLock(htmlPtr);
- @@ -746,11 +750,11 @@
- Tcl_AppendResult(interp, "unknown tag: \"", argv[3], "\"", 0);
- return TCL_ERROR;
- }
- if (argc == 4) {
- if (htmlPtr->zHandler[type] != 0) {
- - interp->result = htmlPtr->zHandler[type];
- + Tcl_SetResult(interp, htmlPtr->zHandler[type], TCL_STATIC);
- }
- }
- else {
- if (htmlPtr->zHandler[type] != 0) {
- HtmlFree(htmlPtr->zHandler[type]);
- @@ -783,11 +787,11 @@
- Tcl_AppendResult(interp, "malformed index: \"", argv[2], "\"", 0);
- }
- return TCL_ERROR;
- }
- if (!HtmlUnlock(htmlPtr) && p) {
- - sprintf(interp->result, "%d.%d", HtmlTokenNumber(p), i);
- + Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d.%d", HtmlTokenNumber(p), i));
- }
- else {
- }
- return TCL_OK;
- }
- Index: src/htmlimage.c
- ==================================================================
- --- src/htmlimage.c
- +++ src/htmlimage.c
- @@ -307,11 +307,11 @@
- Tcl_DStringFree(&cmd);
- if (HtmlUnlock(htmlPtr)) {
- HtmlFree(zSrc);
- return 0;
- }
- - zImageName = htmlPtr->interp->result;
- + zImageName = Tcl_GetStringResult(htmlPtr->interp);
- lenSrc = strlen(zSrc);
- lenW = strlen(zWidth);
- lenH = strlen(zHeight);
- pImage = HtmlAlloc(sizeof(HtmlImage) + lenSrc + lenW + lenH + 3);
- memset(pImage, 0, sizeof(HtmlImage));
- @@ -324,11 +324,11 @@
- pImage->zHeight = &pImage->zWidth[lenW + 1];
- strcpy(pImage->zHeight, zHeight);
- pImage->w = 0;
- pImage->h = 0;
- if (result == TCL_OK) {
- - HtmlAddImages(htmlPtr, p, pImage, htmlPtr->interp->result, 0);
- + HtmlAddImages(htmlPtr, p, pImage, Tcl_GetStringResult(htmlPtr->interp), 0);
- }
- else {
- Tcl_AddErrorInfo(htmlPtr->interp,
- "\n (\"-imagecommand\" command executed by html widget)");
- Tcl_BackgroundError(htmlPtr->interp);
- Index: src/htmlsizer.c
- ==================================================================
- --- src/htmlsizer.c
- +++ src/htmlsizer.c
- @@ -300,12 +300,12 @@
- return COLOR_Unvisited;
- }
- if (result != TCL_OK) {
- goto errorOut;
- }
- - result = Tcl_GetBoolean(htmlPtr->interp, htmlPtr->interp->result,
- - &isVisited);
- + result = Tcl_GetBoolean(htmlPtr->interp,
- + Tcl_GetStringResult(htmlPtr->interp), &isVisited);
- if (result != TCL_OK) {
- goto errorOut;
- }
- return isVisited ? COLOR_Visited : COLOR_Unvisited;
- @@ -924,11 +924,11 @@
- htmlPtr->inParse--;
- Tcl_DStringFree(&cmd);
- if (HtmlUnlock(htmlPtr))
- return;
- resstr = Tcl_GetByteArrayObj(Tcl_GetObjResult
- - (htmlPtr->interp->result),
- + (htmlPtr->interp),
- &reslen);
- if (result == 0 && resstr && reslen) {
- HtmlElement *b2 = p->pNext, *b3, *ps, *e1 = p, *e2 =
- b2, *e3;
- if (e2)
- @@ -1218,11 +1218,11 @@
- htmlPtr->inParse--;
- Tcl_DStringFree(&cmd);
- if (HtmlUnlock(htmlPtr))
- return;
- if (result == TCL_OK)
- - HtmlSetImageBg(htmlPtr, htmlPtr->interp, htmlPtr->interp->result, p);
- + HtmlSetImageBg(htmlPtr, htmlPtr->interp, Tcl_GetStringResult(htmlPtr->interp), p);
- Tcl_ResetResult(htmlPtr->interp);
- #endif
- }
- /*
- Index: src/htmlurl.c
- ==================================================================
- --- src/htmlurl.c
- +++ src/htmlurl.c
- @@ -252,11 +252,11 @@
- return zNew;
- }
- /*
- ** The input azSeries[] is a sequence of URIs. This command must
- -** resolve them all and put the result in the interp->result field
- +** resolve them all and put the result in the result value
- ** of the interpreter associated with the HTML widget. Return
- ** TCL_OK on success and TCL_ERROR if there is a failure.
- **
- ** This function can cause the HTML widget to be deleted or changed
- ** arbitrarily.
- @@ -427,12 +427,12 @@
- HtmlLock(htmlPtr);
- result = HtmlCallResolver(htmlPtr, azSeq);
- if (HtmlUnlock(htmlPtr))
- return 0;
- if (result == TCL_OK) {
- - zSrc = HtmlAlloc(strlen(htmlPtr->interp->result) + 1);
- + zSrc = HtmlAlloc(strlen(Tcl_GetStringResult(htmlPtr->interp)) + 1);
- if (zSrc)
- - strcpy(zSrc, htmlPtr->interp->result);
- + strcpy(zSrc, Tcl_GetStringResult(htmlPtr->interp));
- }
- Tcl_ResetResult(htmlPtr->interp);
- return zSrc;
- }
- Index: src/htmlwidget.c
- ==================================================================
- --- src/htmlwidget.c
- +++ src/htmlwidget.c
- @@ -1488,11 +1488,11 @@
- Tcl_AddErrorInfo(htmlPtr->interp,
- "\n (-fontcommand callback of HTML widget)");
- Tcl_BackgroundError(htmlPtr->interp);
- }
- else {
- - sprintf(name, "%.100s", htmlPtr->interp->result);
- + sprintf(name, "%.100s", Tcl_GetStringResult(htmlPtr->interp));
- }
- Tcl_ResetResult(htmlPtr->interp);
- }
- /*
- @@ -2290,13 +2290,13 @@
- }
- Tcl_InitHashTable(&htmlPtr->tokenHash, TCL_STRING_KEYS);
- htmlPtr->tokenCnt = Html_TypeCount;
- #ifdef _TCLHTML_
- - interp->result = arg1;
- + Tcl_SetResult(interp, arg1, TCL_VOLATILE);
- #else
- - interp->result = Tk_PathName(htmlPtr->tkwin);
- + Tcl_SetResult(interp, Tk_PathName(htmlPtr->tkwin), TCL_VOLATILE);
- #endif
- return TCL_OK;
- error:
- #ifndef _TCLHTML_