From a67b8cc3956a0a2782827532948ae90ad2ac1aa4 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sun, 18 Oct 2020 14:03:15 -0400 Subject: [PATCH] Corrected an error in the "bloat-all" operator of the CIF generation, which was failing to clear tiles in the layout of the "processed" state, leading to unpredicatable results if the same layout layer is used in a subsequent CIF operation. --- VERSION | 2 +- cif/CIFgen.c | 74 +++++++++++++++++++++++++++++----------------------- 2 files changed, 43 insertions(+), 33 deletions(-) diff --git a/VERSION b/VERSION index e57c01d5..6aac87ef 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.69 +8.3.70 diff --git a/cif/CIFgen.c b/cif/CIFgen.c index 618598b2..cde2142d 100644 --- a/cif/CIFgen.c +++ b/cif/CIFgen.c @@ -1024,6 +1024,27 @@ endbloat: STACKPUSH((ClientData) (tp), stack); \ } +/* + *------------------------------------------------------- + * + * cifProcessResetFunc -- + * + * Unmark tiles + * + * Results: Return 0 to keep the search going. + * + *------------------------------------------------------- + */ + +int +cifProcessResetFunc(tile, clientData) + Tile *tile; + ClientData clientData; /* unused */ +{ + tile->ti_client = (ClientData) CIF_UNPROCESSED; + return 0; +} + /* *------------------------------------------------------- * @@ -1260,6 +1281,21 @@ cifBloatAllFunc(tile, bls) STACKPUSH(tp, BloatStack); } } + + /* Reset marked tiles */ + + if (bloats->bl_plane < 0) /* Bloat types are CIF types */ + { + temps = bls->temps; + for (ttype = 0; ttype < TT_MAXTYPES; ttype++, temps++) + if (bloats->bl_distance[ttype] > 0) + (void) DBSrPaintArea((Tile *)NULL, *temps, &TiPlaneRect, + &CIFSolidBits, cifProcessResetFunc, (ClientData)NULL); + } + else + DBSrPaintArea((Tile *)NULL, def->cd_planes[bloats->bl_plane], &TiPlaneRect, + &connect, cifProcessResetFunc, (ClientData)NULL); + return 0; /* Keep the search alive. . . */ } @@ -2188,28 +2224,6 @@ cifSquaresStripFunc(tile, stripsData) return 0; } - -/* - *------------------------------------------------------- - * - * cifSquaresResetFunc -- - * - * Unmark tiles - * - * Results: Return 0 to keep the search going. - * - *------------------------------------------------------- - */ - -int -cifSquaresResetFunc(tile, clientData) - Tile *tile; - ClientData clientData; /* unused */ -{ - tile->ti_client = (ClientData) CIF_UNPROCESSED; - return 0; -} - /* *------------------------------------------------------- * @@ -2387,10 +2401,6 @@ cifRectBoundingBox(op, cellDef, plane) } } } - - /* Clear all the tiles that were processed */ - DBSrPaintArea((Tile *)NULL, plane, &TiPlaneRect, &CIFSolidBits, - cifSquaresResetFunc, (ClientData)NULL); } /* @@ -2725,7 +2735,7 @@ cifSquaresFillArea(op, cellDef, plane) /* Clear all the tiles that were processed */ DBSrPaintArea((Tile *)NULL, plane, &TiPlaneRect, &CIFSolidBits, - cifSquaresResetFunc, (ClientData)NULL); + cifProcessResetFunc, (ClientData)NULL); } /* @@ -3088,7 +3098,7 @@ cifSlotsFillArea(op, cellDef, plane) /* Clear all the tiles that were processed */ DBSrPaintArea((Tile *)NULL, plane, &TiPlaneRect, &CIFSolidBits, - cifSquaresResetFunc, (ClientData)NULL); + cifProcessResetFunc, (ClientData)NULL); } /* @@ -4848,11 +4858,11 @@ CIFGenLayer(op, area, cellDef, origDef, temps, clientdata) cifPlane = nextPlane; cifScale = 1; /* First copy the existing paint into the target plane */ - (void) DBSrPaintArea((Tile *) NULL, curPlane, &TiPlaneRect, - &CIFSolidBits, cifPaintFunc, (ClientData)CIFPaintTable); + DBSrPaintArea((Tile *) NULL, curPlane, &TiPlaneRect, + &CIFSolidBits, cifPaintFunc, (ClientData)CIFPaintTable); + DBSrPaintArea((Tile *) NULL, curPlane, &TiPlaneRect, + &DBSpaceBits, cifCloseFunc, (ClientData)&curPlane); - (void) DBSrPaintArea((Tile *) NULL, curPlane, &TiPlaneRect, - &DBSpaceBits, cifCloseFunc, (ClientData)&curPlane); temp = curPlane; curPlane = nextPlane; nextPlane = temp;