diff --git a/VERSION b/VERSION index 6022050e..8ca3c547 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.2.187 +8.2.188 diff --git a/commands/CmdCD.c b/commands/CmdCD.c index d91da3a6..0d31dff3 100644 --- a/commands/CmdCD.c +++ b/commands/CmdCD.c @@ -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) diff --git a/dbwind/DBWprocs.c b/dbwind/DBWprocs.c index 95458ec0..2bf4fca1 100644 --- a/dbwind/DBWprocs.c +++ b/dbwind/DBWprocs.c @@ -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. diff --git a/drc/DRCmain.c b/drc/DRCmain.c index 2b365224..09d6e2d9 100644 --- a/drc/DRCmain.c +++ b/drc/DRCmain.c @@ -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. */ diff --git a/windows/windMove.c b/windows/windMove.c index 0f91b5f4..d1420ef8 100644 --- a/windows/windMove.c +++ b/windows/windMove.c @@ -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);