From 95605ebbd447ee0614941b1bb9e2d792917cb3c9 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 2 Nov 2022 09:48:39 -0400 Subject: [PATCH] Prevented checks from automatically treating two empty cells as black boxes. The check was supposed to check that both empty cells really are black box entries. --- VERSION | 2 +- tcltk/tclnetgen.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 9ff9ab7..67f7f06 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.239 +1.5.240 diff --git a/tcltk/tclnetgen.c b/tcltk/tclnetgen.c index 10c3355..aabcd27 100644 --- a/tcltk/tclnetgen.c +++ b/tcltk/tclnetgen.c @@ -2228,7 +2228,13 @@ _netcmp_compare(ClientData clientData, Fprintf(stdout, "\nCircuit 1 cell %s is a black box; will not flatten " "Circuit 2\n", name1); } - else if (hascontents1 || hascontents2) { + else if (!hascontents1 && !hascontents2 && (tp1->flags & CELL_PLACEHOLDER) + && (tp2->flags & CELL_PLACEHOLDER)) { + /* Two empty subcircuits, don't flatten anything */ + Fprintf(stdout, "\nCircuit 1 cell %s and Circuit 2 cell %s are black" + " boxes.\n", name1, name2); + } + else { FlattenUnmatched(tp1, name1, 1, 0); FlattenUnmatched(tp2, name2, 1, 0); DescribeContents(name1, fnum1, name2, fnum2); @@ -2241,10 +2247,6 @@ _netcmp_compare(ClientData clientData, DescribeContents(name1, fnum1, name2, fnum2); } } - else { /* Two empty subcircuits */ - Fprintf(stdout, "\nCircuit 1 cell %s and Circuit 2 cell %s are black" - " boxes.\n", name1, name2); - } CreateTwoLists(name1, fnum1, name2, fnum2, dolist); // Return the names of the two cells being compared, if doing "compare