Corrected the last commit for fixing the "drc count" command option,
which had been changed a few months back to remove the individual cell count and only list the top level cell. The behavior has been changed a bit so that "list" returns values for the top level cell only, but "listall" returns a complete list. "drc list count total" gives the DRC count for the top cell, but "drc listall count total" gives the DRC count for everything (probably not very useful). Also: Implemented a behavior by request to automatically removed the (UNNAMED) cell whenever a new cell is loaded and the (UNNAMED) cell has not been modified.
This commit is contained in:
parent
458631df41
commit
b62efea43d
|
|
@ -3322,7 +3322,7 @@ CmdDrc(w, cmd)
|
|||
rootArea = w->w_surfaceArea;
|
||||
|
||||
rootUse = (CellUse *) window->w_surfaceID;
|
||||
dcl = DRCCount(rootUse, &rootArea);
|
||||
dcl = DRCCount(rootUse, &rootArea, doforall);
|
||||
while (dcl != NULL)
|
||||
{
|
||||
if (count_total >= 0)
|
||||
|
|
|
|||
|
|
@ -289,13 +289,14 @@ DBWloadWindow(window, name, ignoreTech, expand, dereference)
|
|||
bool expand; /* Indicates whether or not to expand the cell */
|
||||
bool dereference; /* If TRUE, ignore path references in the input */
|
||||
{
|
||||
CellDef *newEditDef;
|
||||
CellDef *newEditDef, *deleteDef;
|
||||
CellUse *newEditUse;
|
||||
void DisplayWindow();
|
||||
int res, newEdit, error_val;
|
||||
int xadd, yadd;
|
||||
Rect loadBox;
|
||||
char *rootname;
|
||||
bool isUnnamed;
|
||||
int UnexpandFunc(); /* forward declaration */
|
||||
|
||||
loadBox.r_xbot = loadBox.r_ybot = 0;
|
||||
|
|
@ -305,6 +306,19 @@ DBWloadWindow(window, name, ignoreTech, expand, dereference)
|
|||
newEdit = !WindSearch((WindClient) DBWclientID, (ClientData) NULL,
|
||||
(Rect *) NULL, dbwLoadFunc, (ClientData) window);
|
||||
|
||||
/* The (UNNAMED) cell generally gets in the way, so delete it if */
|
||||
/* any new cell is loaded and (UNNAMED) has no contents. */
|
||||
|
||||
if (window->w_surfaceID == (ClientData)NULL)
|
||||
deleteDef = NULL;
|
||||
else
|
||||
{
|
||||
deleteDef = ((CellUse *)window->w_surfaceID)->cu_def;
|
||||
if (strcmp(deleteDef->cd_name, "(UNNAMED)") ||
|
||||
deleteDef->cd_flags & (CDMODIFIED|CDBOXESCHANGED|CDSTAMPSCHANGED))
|
||||
deleteDef = NULL;
|
||||
}
|
||||
|
||||
if ((name == (char *) NULL) || (name[0] == '\0'))
|
||||
{
|
||||
/*
|
||||
|
|
@ -503,6 +517,12 @@ DBWloadWindow(window, name, ignoreTech, expand, dereference)
|
|||
if (newEdit)
|
||||
DBWAreaChanged(newEditDef, &newEditDef->cd_bbox, DBW_ALLWINDOWS,
|
||||
&DBAllButSpaceBits);
|
||||
|
||||
/* If the cell before loading was (UNNAMED) and it was */
|
||||
/* never modified, then delete it now. */
|
||||
|
||||
if (deleteDef != NULL)
|
||||
DBCellDelete(deleteDef->cd_name, TRUE);
|
||||
}
|
||||
|
||||
/* This function is called for each cell whose expansion status changed.
|
||||
|
|
|
|||
|
|
@ -748,9 +748,10 @@ drcCheckFunc(scx, cdarg)
|
|||
*/
|
||||
|
||||
DRCCountList *
|
||||
DRCCount(use, area)
|
||||
DRCCount(use, area, recurse)
|
||||
CellUse *use; /* Top-level use of hierarchy. */
|
||||
Rect *area; /* Area in which violations are counted. */
|
||||
bool recurse; /* If TRUE, count errors in all subcells */
|
||||
{
|
||||
DRCCountList *dcl, *newdcl;
|
||||
HashTable dupTable;
|
||||
|
|
@ -761,12 +762,19 @@ DRCCount(use, area)
|
|||
CellDef *def;
|
||||
extern int drcCountFunc();
|
||||
|
||||
/* Shouldn't happen? */
|
||||
if (!(use->cu_def->cd_flags & CDAVAILABLE)) return NULL;
|
||||
|
||||
/* Use a hash table to make sure that we don't output information
|
||||
* for any cell more than once.
|
||||
*/
|
||||
|
||||
HashInit(&dupTable, 16, HT_WORDKEYS);
|
||||
|
||||
/* Clearing CDAVAILABLE from cd_flags keeps the count from recursing */
|
||||
if (recurse == FALSE)
|
||||
use->cu_def->cd_flags &= ~CDAVAILABLE;
|
||||
|
||||
scx.scx_use = use;
|
||||
scx.scx_x = use->cu_xlo;
|
||||
scx.scx_y = use->cu_ylo;
|
||||
|
|
@ -794,6 +802,11 @@ DRCCount(use, area)
|
|||
}
|
||||
}
|
||||
HashKill(&dupTable);
|
||||
|
||||
/* Restore the CDAVAILABLE flag */
|
||||
if (recurse == FALSE)
|
||||
use->cu_def->cd_flags |= CDAVAILABLE;
|
||||
|
||||
return dcl;
|
||||
}
|
||||
|
||||
|
|
@ -833,6 +846,10 @@ drcCountFunc(scx, dupTable)
|
|||
|
||||
if ((scx->scx_use->cu_def->cd_flags & CDAVAILABLE) == 0) return 0;
|
||||
|
||||
/* Scan children recursively. */
|
||||
|
||||
DBCellSrArea(scx, drcCountFunc, (ClientData)dupTable);
|
||||
|
||||
/* As a special performance hack, if the complete cell area is
|
||||
* handled here, don't bother to look at any more array elements.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -290,6 +290,7 @@ WindCreate(client, frameArea, isHint, argc, argv)
|
|||
w->w_grdata2 = (ClientData) NULL;
|
||||
w->w_backingStore = (ClientData)NULL;
|
||||
w->w_redrawAreas = (ClientData) NULL;
|
||||
w->w_surfaceID = (ClientData) NULL;
|
||||
w->w_iconname = NULL;
|
||||
for (id = 0; ((1 << id) & windWindowMask) != 0; id++) /* advance id */ ;
|
||||
windWindowMask |= (1 << id);
|
||||
|
|
|
|||
Loading…
Reference in New Issue