gaMazeRoute() pass by-pointer const TileTypeBitMask* instead of by-value

sizeof(TileTypeBitMask) == 32
This commit is contained in:
Darryl L. Miles 2025-02-17 09:48:41 +00:00 committed by Tim Edwards
parent 97189f6219
commit 6db34b6aa9
3 changed files with 14 additions and 11 deletions

View File

@ -180,27 +180,28 @@ GAMazeInitParms()
*/ */
bool bool
gaMazeRoute(routeUse, terminalLoc, pinPoint, pinLayerMask, side, writeFlag) gaMazeRoute(
CellUse *routeUse; /* Cell to route in - top level cell visible CellUse *routeUse, /* Cell to route in - top level cell visible
* to router and also cell route is painted * to router and also cell route is painted
* into. All subcells are treated as expanded * into. All subcells are treated as expanded
* by the router, i.e. their contents are * by the router, i.e. their contents are
* examined. And routing across the tops of * examined. And routing across the tops of
* subcells is permitted. * subcells is permitted.
*/ */
NLTermLoc *terminalLoc; /* Terminal to connect to - somewhere in NLTermLoc *terminalLoc, /* Terminal to connect to - somewhere in
* interior of cell */ * interior of cell */
Point *pinPoint; /* Point to connect from (on edge of cell) */ Point *pinPoint, /* Point to connect from (on edge of cell) */
TileTypeBitMask pinLayerMask; /* layer at pin (no more than one const TileTypeBitMask *pinLayerMaskp,/* layer at pin (no more than one
* bit should correspond to a known * bit should correspond to a known
* routing layer) * routing layer)
*/ */
int side; /* side of cell destPoint lies on */ int side, /* side of cell destPoint lies on */
bool writeFlag; /* If non-null, paint back result (into bool writeFlag) /* If non-null, paint back result (into
* routeUse), otherwise just check if * routeUse), otherwise just check if
* route is possible. * route is possible.
*/ */
{ {
TileTypeBitMask pinLayerMask = *pinLayerMaskp; // TTMaskCopy(&pinLayerMask, pinLayerMaskp);
Rect routeBounds; Rect routeBounds;
bool done = FALSE; bool done = FALSE;

View File

@ -731,9 +731,9 @@ hardway:
TTMaskSetOnlyType(&polyMask, RtrPolyType); TTMaskSetOnlyType(&polyMask, RtrPolyType);
TTMaskSetOnlyType(&metalMask, RtrMetalType); TTMaskSetOnlyType(&metalMask, RtrMetalType);
if(gaMazeRoute(routeUse, terminalLoc, gridPoint, polyMask, side, if(gaMazeRoute(routeUse, terminalLoc, gridPoint, &polyMask, side,
writeFlag) && writeFlag) &&
gaMazeRoute(routeUse, terminalLoc, gridPoint, metalMask, side, gaMazeRoute(routeUse, terminalLoc, gridPoint, &metalMask, side,
writeFlag)) writeFlag))
{ {
gaNumMazeStem++; gaNumMazeStem++;
@ -1123,7 +1123,7 @@ gaStemPaint(routeUse, terminalLoc)
goto totalLoss; goto totalLoss;
if(gaMazeRoute(routeUse, terminalLoc, pinPoint, pinLayerMask, side, if(gaMazeRoute(routeUse, terminalLoc, pinPoint, &pinLayerMask, side,
writeResult)) writeResult))
{ {
gaNumMazePaint++; gaNumMazePaint++;

View File

@ -22,6 +22,7 @@
#define _GAROUTER_H #define _GAROUTER_H
#include "grouter/grouter.h" #include "grouter/grouter.h"
#include "utils/netlist.h" /* NLTermLoc */
/* /*
* The following structure describes "simple stems" -- routes * The following structure describes "simple stems" -- routes
@ -88,7 +89,8 @@ extern ClientData gaDebugID; /* Our identity with the debugging module */
extern GCRChannel *gaStemContainingChannel(); extern GCRChannel *gaStemContainingChannel();
extern GCRPin *gaStemCheckPin(); extern GCRPin *gaStemCheckPin();
extern int gaAlwaysOne(); extern int gaAlwaysOne();
extern bool gaMazeRoute(); extern bool gaMazeRoute(CellUse *routeUse, NLTermLoc *terminalLoc, Point *pinPoint,
const TileTypeBitMask *pinLayerMaskp, int side, bool writeFlag);
/* Exported procedures */ /* Exported procedures */
extern int GARoute(); extern int GARoute();