Skip to content

Commit

Permalink
Performance improvement in tkOldConfig.c. See [610a73a179]. Backport …
Browse files Browse the repository at this point in the history
…some formatting from 9.0
  • Loading branch information
jan.nijtmans committed Aug 29, 2024
2 parents 609726a + 737f644 commit fc24ab8
Show file tree
Hide file tree
Showing 16 changed files with 412 additions and 408 deletions.
5 changes: 3 additions & 2 deletions generic/tk3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,10 @@ Tk_GetRelief(
relief = TK_RELIEF_SUNKEN;
} else {
if (interp) {
int ambigeous = (c == 'r' || c == 's') && (name[1] == '\0');
Tcl_SetObjResult(interp,
Tcl_ObjPrintf("bad relief \"%.50s\": must be %s",
name, "flat, groove, raised, ridge, solid, or sunken"));
Tcl_ObjPrintf("%s relief \"%.50s\": must be %s",
ambigeous ? "ambigeous" : "bad", name, "flat, groove, raised, ridge, solid, or sunken"));
Tcl_SetErrorCode(interp, "TK", "VALUE", "RELIEF", (char *)NULL);
}
return TCL_ERROR;
Expand Down
2 changes: 1 addition & 1 deletion generic/tkCanvArc.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ ArcCoords(
}
}
if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0],
&arcPtr->bbox[0]) != TCL_OK)
&arcPtr->bbox[0]) != TCL_OK)
|| (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1],
&arcPtr->bbox[1]) != TCL_OK)
|| (Tk_CanvasGetCoordFromObj(interp, canvas, objv[2],
Expand Down
2 changes: 1 addition & 1 deletion generic/tkCanvImg.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ ImageCoords(
if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0],
&imgPtr->x) != TCL_OK)
|| (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1],
&imgPtr->y) != TCL_OK)) {
&imgPtr->y) != TCL_OK)) {
return TCL_ERROR;
}
ComputeImageBbox(canvas, imgPtr);
Expand Down
4 changes: 2 additions & 2 deletions generic/tkCanvPoly.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ ComputePolygonBbox(
if (index < 0) {
index += (polyPtr->numPoints - polyPtr->autoClosed) * 2;
}
tsoffset->xoffset = (int) (polyPtr->coordPtr[index] + 0.5);
tsoffset->xoffset = (int) (polyPtr->coordPtr[index] + 0.5);
tsoffset->yoffset = (int) (polyPtr->coordPtr[index+1] + 0.5);
} else {
if (tsoffset->flags & TK_OFFSET_LEFT) {
Expand Down Expand Up @@ -1100,7 +1100,7 @@ PolygonInsert(
* [5fb8145997].
*/

double width;
double width;
int j;

itemPtr->redraw_flags |= TK_ITEM_DONT_REDRAW;
Expand Down
Loading

0 comments on commit fc24ab8

Please sign in to comment.