diff options
author | fvogel <fvogelnew1@free.fr> | 2020-03-29 17:31:26 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2020-03-29 17:31:26 (GMT) |
commit | c07206a21afa2200252c5ed91ec78821d5980aaf (patch) | |
tree | c37e2a002ced33aed7aac188a6a970ba6ed90171 /generic/tkCanvArc.c | |
parent | 4956905e806f57e734630c226b4d52266414f671 (diff) | |
download | tk-c07206a21afa2200252c5ed91ec78821d5980aaf.zip tk-c07206a21afa2200252c5ed91ec78821d5980aaf.tar.gz tk-c07206a21afa2200252c5ed91ec78821d5980aaf.tar.bz2 |
Fix [3134d697c8]: Reduce unnecessary code checks in canvas postscript code (patch from Emiliano Gavilan).
Diffstat (limited to 'generic/tkCanvArc.c')
-rw-r--r-- | generic/tkCanvArc.c | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index 0cf611a..6952f4d 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.c @@ -2087,18 +2087,14 @@ ArcToPostscript( ang1, ang2); Tcl_ResetResult(interp); - if (Tk_CanvasPsColor(interp, canvas, fillColor) != TCL_OK) { - goto error; - } + Tk_CanvasPsColor(interp, canvas, fillColor); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); if (fillStipple != None) { Tcl_AppendToObj(psObj, "clip ", -1); Tcl_ResetResult(interp); - if (Tk_CanvasPsStipple(interp, canvas, fillStipple) != TCL_OK) { - goto error; - } + Tk_CanvasPsStipple(interp, canvas, fillStipple); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); if (arcPtr->outline.gc != NULL) { @@ -2124,9 +2120,7 @@ ArcToPostscript( ang1, ang2); Tcl_ResetResult(interp); - if (Tk_CanvasPsOutline(canvas, itemPtr, &arcPtr->outline) != TCL_OK) { - goto error; - } + Tk_CanvasPsOutline(canvas, itemPtr, &arcPtr->outline); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); if (arcPtr->style != ARC_STYLE) { @@ -2139,18 +2133,14 @@ ArcToPostscript( } else { Tk_CanvasPsPath(interp, canvas, arcPtr->outlinePtr, PIE_OUTLINE1_PTS); - if (Tk_CanvasPsColor(interp, canvas, color) != TCL_OK) { - goto error; - } + Tk_CanvasPsColor(interp, canvas, color); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); if (stipple != None) { Tcl_AppendToObj(psObj, "clip ", -1); Tcl_ResetResult(interp); - if (Tk_CanvasPsStipple(interp, canvas, stipple) !=TCL_OK){ - goto error; - } + Tk_CanvasPsStipple(interp, canvas, stipple); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); } else { Tcl_AppendToObj(psObj, "fill\n", -1); @@ -2162,18 +2152,14 @@ ArcToPostscript( arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS, PIE_OUTLINE2_PTS); } - if (Tk_CanvasPsColor(interp, canvas, color) != TCL_OK) { - goto error; - } + Tk_CanvasPsColor(interp, canvas, color); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); if (stipple != None) { Tcl_AppendToObj(psObj, "clip ", -1); Tcl_ResetResult(interp); - if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) { - goto error; - } + Tk_CanvasPsStipple(interp, canvas, stipple); Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp)); } else { Tcl_AppendToObj(psObj, "fill\n", -1); @@ -2189,11 +2175,6 @@ ArcToPostscript( Tcl_AppendObjToObj(Tcl_GetObjResult(interp), psObj); Tcl_DecrRefCount(psObj); return TCL_OK; - - error: - Tcl_DiscardInterpState(interpState); - Tcl_DecrRefCount(psObj); - return TCL_ERROR; } /* |