mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-22 14:17:43 +02:00
Added checks for GDS scalefactor (DBU) both when reading GDS in
"gds readonly true" mode and when writing a GDS file in full-dump mode. Reading or writing a file with an incompatible DBU is now prohibited. This is not a great solution, as it forces the original file to be rewritten with a different DBU. Preferably there should be code to scale the units during a dump, but that needs to be coded.
This commit is contained in:
+10
-4
@@ -706,7 +706,7 @@ calmaFullDump(def, fi, outf, filename)
|
||||
|
||||
static int hdrSkip[] = { CALMA_FORMAT, CALMA_MASK, CALMA_ENDMASKS,
|
||||
CALMA_REFLIBS, CALMA_FONTS, CALMA_ATTRTABLE,
|
||||
CALMA_STYPTABLE, CALMA_GENERATIONS, CALMA_UNITS, -1 };
|
||||
CALMA_STYPTABLE, CALMA_GENERATIONS, -1 };
|
||||
static int skipBeforeLib[] = { CALMA_LIBDIRSIZE, CALMA_SRFNAME,
|
||||
CALMA_LIBSECUR, -1 };
|
||||
|
||||
@@ -722,11 +722,17 @@ calmaFullDump(def, fi, outf, filename)
|
||||
calmaSkipSet(skipBeforeLib);
|
||||
if (!calmaReadStringRecord(CALMA_LIBNAME, &libname)) goto done;
|
||||
|
||||
// NOTE: CALMA_UNITS needs to be parsed to determine if units in
|
||||
// the input file are compatible with units being used in the output
|
||||
// file.
|
||||
calmaSkipSet(hdrSkip);
|
||||
|
||||
// CALMA_UNITS needs to be parsed to determine if units in the
|
||||
// input file are compatible with units being used in the output
|
||||
// file.
|
||||
if (calmaParseUnits() == FALSE)
|
||||
{
|
||||
TxError("Error: Library %s has incompatible database units!\n", libname);
|
||||
return;
|
||||
}
|
||||
|
||||
// Record the GDS library so it will not be processed again.
|
||||
he = HashFind(&calmaLibHash, filename);
|
||||
if ((char *)HashGetValue(he) != NULL)
|
||||
|
||||
Reference in New Issue
Block a user