From cf0f9311ab49e55912cbadc7e24ebd44e188e42d Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Mon, 17 Feb 2025 09:52:39 +0000 Subject: [PATCH] plowFindWidthBack() pass by-pointer const TileTypeBitMask* instead of by-value sizeof(TileTypeBitMask) == 32 --- plow/PlowJogs.c | 2 +- plow/PlowTest.c | 2 +- plow/PlowWidth.c | 12 ++++++------ plow/plowInt.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plow/PlowJogs.c b/plow/PlowJogs.c index 63bbf530..3df6c452 100644 --- a/plow/PlowJogs.c +++ b/plow/PlowJogs.c @@ -353,7 +353,7 @@ plowProcessJogFunc(edge, area) * all of the LHS of the jog. */ TTMaskSetOnlyType(&mask, edge->e_ltype); - width = plowFindWidthBack(&newedge, mask, area, (Rect *) NULL); + width = plowFindWidthBack(&newedge, &mask, area, (Rect *) NULL); r.r_xtop = newedge.e_x; r.r_xbot = newedge.e_x - width - 1; r.r_ytop = newedge.e_ytop; diff --git a/plow/PlowTest.c b/plow/PlowTest.c index ab2b7d6e..49b3fcd3 100644 --- a/plow/PlowTest.c +++ b/plow/PlowTest.c @@ -294,7 +294,7 @@ PlowTest(w, cmd) editArea.r_ybot, editArea.r_ytop); saveDef = plowYankDef; plowYankDef = def; - (void) plowFindWidthBack(&edge, okTypes, &def->cd_bbox, &editArea); + (void) plowFindWidthBack(&edge, &okTypes, &def->cd_bbox, &editArea); plowYankDef = saveDef; GeoTransRect(&EditToRootTransform, &editArea, &rootBox); ToolMoveBox(TOOL_BL, &rootBox.r_ll, FALSE, rootBoxDef); diff --git a/plow/PlowWidth.c b/plow/PlowWidth.c index d1af6bfe..5de5ff6d 100644 --- a/plow/PlowWidth.c +++ b/plow/PlowWidth.c @@ -320,13 +320,12 @@ clipright: */ int -plowFindWidthBack(edge, types, bbox, prect) - Edge *edge; /* Edge along the RHS of this material */ - TileTypeBitMask types; /* Types whose width is being computed. Note - * that this set is passed by value. +plowFindWidthBack( + Edge *edge, /* Edge along the RHS of this material */ + const TileTypeBitMask *typesp,/* Types whose width is being computed. */ - Rect *bbox; /* Bounding box of the cell */ - Rect *prect; /* (Debugging only): if this is non-NULL, + Rect *bbox, /* Bounding box of the cell */ + Rect *prect) /* (Debugging only): if this is non-NULL, * the rectangle it points to is filled * in with the rectangle found by this * algorithm to be the largest containing @@ -334,6 +333,7 @@ plowFindWidthBack(edge, types, bbox, prect) * set 'types'. */ { + TileTypeBitMask types = *typesp; /* TTMaskCopy(&types, typesp); */ Plane *plane = plowYankDef->cd_planes[edge->e_pNum]; TileTypeBitMask ctypes; struct wclip wc; diff --git a/plow/plowInt.h b/plow/plowInt.h index a9f3512d..fbd0d575 100644 --- a/plow/plowInt.h +++ b/plow/plowInt.h @@ -258,7 +258,7 @@ extern int plowAtomize(); extern void plowCleanupJogs(); extern void plowDebugEdge(); extern int plowFindWidth(Edge *edge, const TileTypeBitMask *typesp, Rect *bbox, Rect *prect); -extern int plowFindWidthBack(); +extern int plowFindWidthBack(Edge *edge, const TileTypeBitMask *typesp, Rect *bbox, Rect *prect); extern int plowGenRandom(); extern void plowQueueDone(); extern void plowQueueInit();