From 503a6bc1907f54e251acdc0594984e0d9bb9a727 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sun, 18 Oct 2020 14:28:23 -0400 Subject: [PATCH] Corrected the (minor) problem caused by the slightly different handling of an alias that defines only one type (which is treated like it would be if it were declared on the same line as the original type declaration), such that the alias name does not become the default name for the layer (which is the one that ends up showing in the title bar when hovering over the layer toolbar icon). Mainly the problem showed up as "nwell" for the sky130A process appearing in the toolbar as "allwellplane". --- database/DBtechname.c | 3 +++ database/DBtechtype.c | 6 ++++-- database/databaseInt.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/database/DBtechname.c b/database/DBtechname.c index df052581..5cf97b1b 100644 --- a/database/DBtechname.c +++ b/database/DBtechname.c @@ -451,6 +451,9 @@ DBTechPrintTypes(mask, dolist) for (p = dbTypeNameLists.sn_next; p != &dbTypeNameLists; p = p->sn_next) { + /* Ignore aliases */ + if (p->sn_alias) continue; + if (((TileType)(spointertype) p->sn_value) == i) { if (dolist) diff --git a/database/DBtechtype.c b/database/DBtechtype.c index 5eeb9d1f..e7fe51ed 100644 --- a/database/DBtechtype.c +++ b/database/DBtechtype.c @@ -760,7 +760,7 @@ dbTechNameAdd(name, cdata, ptable, alias) *cp = '\0'; if (*(cp = onename)) { - if ((current = dbTechNameAddOne(cp, cdata, FALSE, ptable)) == NULL) + if ((current = dbTechNameAddOne(cp, cdata, FALSE, alias, ptable)) == NULL) return (NULL); if (first == NULL) first = current->sn_name; @@ -793,10 +793,11 @@ dbTechNameAdd(name, cdata, ptable, alias) */ NameList * -dbTechNameAddOne(name, cdata, isPrimary, ptable) +dbTechNameAddOne(name, cdata, isPrimary, isAlias, ptable) char *name; /* Name to be added */ ClientData cdata; /* Client value associated with this name */ bool isPrimary; /* TRUE if this is the primary abbreviation */ + bool isAlias; /* TRUE if this name is an alias */ NameList *ptable; /* Table of names to which we're adding this */ { int cmp; @@ -817,6 +818,7 @@ dbTechNameAddOne(name, cdata, isPrimary, ptable) new->sn_name = StrDup((char **) NULL, name); new->sn_value = cdata; new->sn_primary = isPrimary; + new->sn_alias = isAlias; /* Link this entry in to the list before 'tbl' */ new->sn_next = tbl; diff --git a/database/databaseInt.h b/database/databaseInt.h index 5f631cfb..eda67bed 100644 --- a/database/databaseInt.h +++ b/database/databaseInt.h @@ -81,6 +81,7 @@ typedef struct namelist char *sn_name; /* Text of name */ ClientData sn_value; /* Value (TileType or plane number) */ bool sn_primary; /* If TRUE, this is the primary name */ + bool sn_alias; /* If TRUE, this is an alias name */ } NameList; typedef struct