Gave up on attempting to separate out slashes in instance names

from slashes in hierarchical names.  Magic does not allow slashes
in names when using "identify", so the simplest solution is just
to prohibit them in names being read from GDS files, and replace
them with underscores to make them magic-compatible.  Changing
GDS names always has repercussions on things like back-annotating
delays, so it should probably be revisited in the future.
This commit is contained in:
Tim Edwards 2021-02-24 14:41:35 -05:00
parent a61026588c
commit f2af326368
1 changed files with 17 additions and 0 deletions

View File

@ -48,6 +48,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
int calmaNonManhattan;
int CalmaFlattenLimit = 10;
int NameConvertErrors = 0;
extern HashTable calmaDefInitHash;
@ -836,8 +837,24 @@ calmaElementSref(filename)
READI2(propAttrType);
if (propAttrType == CALMA_PROP_USENAME)
{
char *s;
if (!calmaReadStringRecord(CALMA_PROPVALUE, &useid))
return -1;
/* Magic prohibits comma and slash from use names */
for (s = useid; *s; s++)
if (*s == '/' || *s == ',')
{
if (NameConvertErrors < 100)
TxPrintf("\"%c\" character cannot be used in instance name; "
"converting to underscore\n", *s);
else if (NameConvertErrors == 100)
TxPrintf("More than 100 character changes; not reporting"
" further errors.\n");
*s = '_';
NameConvertErrors++;
}
}
else if (propAttrType == CALMA_PROP_ARRAY_LIMITS)
{