Merge branch 'master' into cmdentry
This commit is contained in:
commit
83ef7a7a72
|
|
@ -3,7 +3,7 @@ on:
|
|||
tags:
|
||||
- "*"
|
||||
|
||||
name: CI
|
||||
name: CI-appimage
|
||||
|
||||
jobs:
|
||||
build_appimage:
|
||||
|
|
@ -11,7 +11,7 @@ jobs:
|
|||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
simple_build_linux:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get Dependencies
|
||||
run: |
|
||||
sudo apt-get install -y tcl-dev tk-dev libcairo-dev
|
||||
|
|
@ -38,7 +38,7 @@ jobs:
|
|||
simple_build_wasm:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get Dependencies
|
||||
run: |
|
||||
git clone https://github.com/emscripten-core/emsdk.git
|
||||
|
|
@ -48,10 +48,10 @@ jobs:
|
|||
- name: Build
|
||||
run: |
|
||||
source ./emsdk/emsdk_env.sh
|
||||
emconfigure ./configure --without-cairo --without-opengl --without-x --disable-readline --target=asmjs-unknown-emscripten
|
||||
emconfigure ./configure --without-cairo --without-opengl --without-x --disable-readline --disable-compression --target=asmjs-unknown-emscripten
|
||||
emmake make
|
||||
- name: archive wasm bundle
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: magic-wasm-bundle
|
||||
path: |
|
||||
|
|
@ -59,7 +59,7 @@ jobs:
|
|||
# simple_build_mac:
|
||||
# runs-on: macos-11
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Get Dependencies
|
||||
# run: |
|
||||
# brew install --cask xquartz
|
||||
|
|
|
|||
6
INSTALL
6
INSTALL
|
|
@ -47,6 +47,12 @@ Autoconf Capsule Summary:
|
|||
Disable threaded X11 and OpenGL graphics.
|
||||
Normally enabled.
|
||||
|
||||
--disable-compression
|
||||
Disable reading and writing of compressed
|
||||
(gzipped) GDS files and reading of compressed
|
||||
.mag files. Normally enabled, if the zlib
|
||||
development package is installed.
|
||||
|
||||
Notes to Magic maintainers:
|
||||
--------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,17 @@ FROM centos/python-38-centos7:20210726-fad62e9
|
|||
|
||||
USER root
|
||||
|
||||
# CentOS7 went EOL on June 30, 2024 this builds out of vault.centos.org
|
||||
RUN ls -l /etc/yum.repos.d/ \
|
||||
&& cp /etc/yum.repos.d/CentOS-Base.repo /tmp/CentOS-Base.repo.old \
|
||||
&& sed -e 's/mirror.centos.org/vault.centos.org/g' -i /etc/yum.repos.d/*.repo \
|
||||
&& sed -e 's/^#.*baseurl=http/baseurl=http/g' -i /etc/yum.repos.d/*.repo \
|
||||
&& sed -e 's/^mirrorlist=http/#mirrorlist=http/g' -i /etc/yum.repos.d/*.repo \
|
||||
&& diff -u /tmp/CentOS-Base.repo.old /etc/yum.repos.d/CentOS-Base.repo; \
|
||||
yum clean all \
|
||||
&& yum -y update \
|
||||
&& rm -f /tmp/CentOS-Base.repo.old
|
||||
|
||||
# Build Dependencies
|
||||
RUN yum install -y cairo-devel freeglut-devel gcc make tcsh
|
||||
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ BinArray *bpBinArrayBuild(Rect bbox,
|
|||
|
||||
/* Added by Tim, 2/19/2024 */
|
||||
/* This line is not supposed to be needed? */
|
||||
if ((!subbin) && ((int)elements & BT_ARRAY)) return NULL;
|
||||
if ((!subbin) && ((pointertype)elements & BT_ARRAY)) return NULL;
|
||||
|
||||
if(BPD) DumpRect("#### bpBinArrayBuild, TOP bbox= ", &bbox);
|
||||
|
||||
|
|
|
|||
|
|
@ -506,23 +506,23 @@ static __inline__ void *BPEnumNext(BPEnum *bpe)
|
|||
switch (bpe->bpe_top->bps_state)
|
||||
{
|
||||
case BPS_BINS:
|
||||
if(e=bpEnumNextBINS(bpe, 0)) return e;
|
||||
if((e=bpEnumNextBINS(bpe, 0))) return e;
|
||||
break;
|
||||
|
||||
case BPS_BINS_INSIDE:
|
||||
if(e=bpEnumNextBINS(bpe, 1)) return e;
|
||||
if((e=bpEnumNextBINS(bpe, 1))) return e;
|
||||
break;
|
||||
|
||||
case BPS_INBOX:
|
||||
if(e=bpEnumNextINBOX(bpe, 0)) return e;
|
||||
if((e=bpEnumNextINBOX(bpe, 0))) return e;
|
||||
break;
|
||||
|
||||
case BPS_INBOX_INSIDE:
|
||||
if(e=bpEnumNextINBOX(bpe, 1)) return e;
|
||||
if((e=bpEnumNextINBOX(bpe, 1))) return e;
|
||||
break;
|
||||
|
||||
case BPS_HASH:
|
||||
if(e=bpEnumNextHASH(bpe)) return e;
|
||||
if((e=bpEnumNextHASH(bpe))) return e;
|
||||
break;
|
||||
|
||||
case BPS_DONE:
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ Rect BPBBox(BPlane *bp)
|
|||
e = BPEnumNext(&bpe);
|
||||
bp->bp_bbox = e->e_rect;
|
||||
|
||||
while(e = BPEnumNext(&bpe))
|
||||
while((e = BPEnumNext(&bpe)))
|
||||
{
|
||||
GeoIncludeRectInBBox(&e->e_rect, &bp->bp_bbox);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ calmaParseStructure(filename)
|
|||
char *filename; /* Name of the GDS file read */
|
||||
{
|
||||
static int structs[] = { CALMA_STRCLASS, CALMA_STRTYPE, -1 };
|
||||
int nbytes, rtype, nsrefs, osrefs, npaths;
|
||||
int nbytes = -1, rtype = 0, nsrefs, osrefs, npaths;
|
||||
char *strname = NULL;
|
||||
HashEntry *he;
|
||||
int timestampval = 0;
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ calmaReadR8(pd)
|
|||
|
||||
/* Extract the sign and exponent */
|
||||
exponent = dchars[0];
|
||||
if (isneg = (exponent & 0x80))
|
||||
if ((isneg = (exponent & 0x80)))
|
||||
exponent &= ~0x80;
|
||||
exponent -= 64;
|
||||
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ calmaElementBoundary()
|
|||
he = HashFind(&calmaDefInitHash, newname);
|
||||
if (!HashGetValue(he))
|
||||
{
|
||||
newdef = calmaFindCell(newname, NULL);
|
||||
newdef = calmaFindCell(newname, NULL, NULL);
|
||||
cifReadCellDef = newdef;
|
||||
DBCellClearDef(cifReadCellDef);
|
||||
DBCellSetAvail(cifReadCellDef);
|
||||
|
|
@ -503,7 +503,7 @@ calmaElementBox()
|
|||
void
|
||||
calmaElementPath()
|
||||
{
|
||||
int nbytes, rtype, extend1, extend2;
|
||||
int nbytes = -1, rtype = 0, extend1, extend2;
|
||||
int layer, dt, width, pathtype, ciftype, savescale;
|
||||
int xmin, ymin, xmax, ymax, temp;
|
||||
CIFPath *pathheadp, *pathp, *previousp;
|
||||
|
|
@ -673,7 +673,7 @@ calmaElementPath()
|
|||
he = HashFind(&calmaDefInitHash, newname);
|
||||
if (!HashGetValue(he))
|
||||
{
|
||||
newdef = calmaFindCell(newname, NULL);
|
||||
newdef = calmaFindCell(newname, NULL, NULL);
|
||||
cifReadCellDef = newdef;
|
||||
DBCellClearDef(cifReadCellDef);
|
||||
DBCellSetAvail(cifReadCellDef);
|
||||
|
|
@ -733,7 +733,7 @@ calmaElementText()
|
|||
{
|
||||
static int ignore[] = { CALMA_PATHTYPE, CALMA_WIDTH, -1 };
|
||||
char *textbody = NULL;
|
||||
int nbytes, rtype;
|
||||
int nbytes = -1, rtype = 0;
|
||||
int layer, textt, cifnum, textpres;
|
||||
TileType type;
|
||||
Rect r;
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ CalmaReadFile(file, filename)
|
|||
char *filename; /* The real name of the file read */
|
||||
{
|
||||
int k, version;
|
||||
char *libname = NULL, *libnameptr;
|
||||
char *libname = NULL, *libnameptr = NULL;
|
||||
MagWindow *mw;
|
||||
static int hdrSkip[] = { CALMA_FORMAT, CALMA_MASK, CALMA_ENDMASKS,
|
||||
CALMA_REFLIBS, CALMA_FONTS, CALMA_ATTRTABLE,
|
||||
|
|
@ -309,7 +309,11 @@ done:
|
|||
HashKill(&calmaDefInitHash);
|
||||
UndoEnable();
|
||||
|
||||
if (calmaErrorFile != NULL) fclose(calmaErrorFile);
|
||||
if (calmaErrorFile != NULL)
|
||||
{
|
||||
fclose(calmaErrorFile);
|
||||
calmaErrorFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -345,7 +349,7 @@ done:
|
|||
bool
|
||||
calmaParseUnits()
|
||||
{
|
||||
int nbytes, rtype;
|
||||
int nbytes, rtype = 0;
|
||||
double metersPerDBUnit;
|
||||
double userUnitsPerDBUnit;
|
||||
double cuPerDBUnit;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ static char rcsid[] __attribute__ ((unused)) ="$Header: /usr/cvsroot/magic-8.0/c
|
|||
#include <stdint.h>
|
||||
#include <stdlib.h> /* for random() */
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h> /* for htons() */
|
||||
|
|
@ -393,7 +394,7 @@ CalmaWrite(rootDef, f)
|
|||
good = !ferror(f);
|
||||
|
||||
/* See if any problems occurred */
|
||||
if (problems = (DBWFeedbackCount - oldCount))
|
||||
if ((problems = (DBWFeedbackCount - oldCount)))
|
||||
TxPrintf("%d problems occurred. See feedback entries.\n", problems);
|
||||
|
||||
/*
|
||||
|
|
@ -429,7 +430,7 @@ calmaDumpStructure(def, outf, calmaDefHash, filename)
|
|||
HashTable *calmaDefHash;
|
||||
char *filename;
|
||||
{
|
||||
int nbytes, rtype;
|
||||
int nbytes = -1, rtype = 0;
|
||||
char *strname = NULL, *newnameptr;
|
||||
HashEntry *he, *he2;
|
||||
CellDef *edef;
|
||||
|
|
@ -1440,7 +1441,7 @@ calmaOutFunc(def, f, cliprect)
|
|||
numports++;
|
||||
}
|
||||
}
|
||||
if (newll != NULL)
|
||||
if (ll != NULL)
|
||||
{
|
||||
/* Turn linked list into an array, then run qsort on it */
|
||||
/* to sort by port number. */
|
||||
|
|
@ -1769,7 +1770,7 @@ calmaOutStructName(type, def, f)
|
|||
}
|
||||
|
||||
/* Is the def name a legal Calma name? */
|
||||
for (cp = def->cd_name; c = (unsigned char) *cp; cp++)
|
||||
for (cp = def->cd_name; (c = (unsigned char) *cp); cp++)
|
||||
{
|
||||
if ((c > 127) || (table[c] == 0))
|
||||
goto bad;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ static char rcsid[] __attribute__ ((unused)) ="$Header: /usr/cvsroot/magic-8.0/c
|
|||
#include <stdint.h>
|
||||
#include <stdlib.h> /* for random() */
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h> /* for htons() */
|
||||
|
|
@ -369,7 +370,7 @@ CalmaWriteZ(rootDef, f)
|
|||
good = (nerr == 0) ? TRUE : FALSE;
|
||||
|
||||
/* See if any problems occurred */
|
||||
if (problems = (DBWFeedbackCount - oldCount))
|
||||
if ((problems = (DBWFeedbackCount - oldCount)))
|
||||
TxPrintf("%d problems occurred. See feedback entries.\n", problems);
|
||||
|
||||
/*
|
||||
|
|
@ -405,7 +406,7 @@ calmaDumpStructureZ(def, outf, calmaDefHash, filename)
|
|||
HashTable *calmaDefHash;
|
||||
char *filename;
|
||||
{
|
||||
int nbytes, rtype;
|
||||
int nbytes = -1, rtype = 0;
|
||||
char *strname = NULL, *newnameptr;
|
||||
HashEntry *he, *he2;
|
||||
CellDef *edef;
|
||||
|
|
@ -1605,7 +1606,7 @@ calmaOutStructNameZ(type, def, f)
|
|||
}
|
||||
|
||||
/* Is the def name a legal Calma name? */
|
||||
for (cp = def->cd_name; c = (unsigned char) *cp; cp++)
|
||||
for (cp = def->cd_name; (c = (unsigned char) *cp); cp++)
|
||||
{
|
||||
if ((c > 127) || (table[c] == 0))
|
||||
goto bad;
|
||||
|
|
|
|||
29
cif/CIFgen.c
29
cif/CIFgen.c
|
|
@ -1379,8 +1379,24 @@ cifBloatAllFunc(tile, bls)
|
|||
area.r_xtop *= locScale;
|
||||
area.r_ytop *= locScale;
|
||||
|
||||
DBNMPaintPlane(cifPlane, TiGetTypeExact(t), &area,
|
||||
CIFPaintTable, (PaintUndoInfo *) NULL);
|
||||
/* Diagonal: If expanding across the edge of a diagonal, */
|
||||
/* then just fill the whole tile. */
|
||||
|
||||
if (IsSplit(t))
|
||||
{
|
||||
TileType tt;
|
||||
tt = TiGetTypeExact(t);
|
||||
if ((tt & TT_SIDE) && (TTMaskHasType(connect, TiGetLeftType(t))))
|
||||
DBPaintPlane(cifPlane, &area, CIFPaintTable, (PaintUndoInfo *) NULL);
|
||||
else if (!(tt & TT_SIDE) && (TTMaskHasType(connect, TiGetRightType(t))))
|
||||
DBPaintPlane(cifPlane, &area, CIFPaintTable, (PaintUndoInfo *) NULL);
|
||||
else
|
||||
DBNMPaintPlane(cifPlane, TiGetTypeExact(t), &area,
|
||||
CIFPaintTable, (PaintUndoInfo *) NULL);
|
||||
}
|
||||
else
|
||||
DBNMPaintPlane(cifPlane, TiGetTypeExact(t), &area,
|
||||
CIFPaintTable, (PaintUndoInfo *) NULL);
|
||||
|
||||
/* Top */
|
||||
for (tp = RT(t); RIGHT(tp) > LEFT(t); tp = BL(tp))
|
||||
|
|
@ -1401,6 +1417,7 @@ cifBloatAllFunc(tile, bls)
|
|||
for (tp = TR(t); TOP(tp) > BOTTOM(t); tp = LB(tp))
|
||||
if (TTMaskHasType(connect, TiGetLeftType(tp)))
|
||||
PUSHTILE(tp, BloatStack);
|
||||
|
||||
}
|
||||
|
||||
/* Clear the tiles that were processed */
|
||||
|
|
@ -4140,11 +4157,13 @@ bridgeErase(brlims, area)
|
|||
}
|
||||
|
||||
for (t = 0; t < TT_MAXTYPES; t++, temps++)
|
||||
{
|
||||
if (TTMaskHasType(&brlims->co_cifMask, t))
|
||||
if (DBSrPaintArea((Tile *) NULL, *temps, area, &CIFSolidBits, cifPaintFunc, CIFEraseTable))
|
||||
return 0;
|
||||
|
||||
return 1; //Nothing found
|
||||
}
|
||||
|
||||
return 1; //Nothing found
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -4896,7 +4915,7 @@ CIFGenLayer(op, area, cellDef, origDef, temps, hier, clientdata)
|
|||
}
|
||||
netname = (char *)op->co_client;
|
||||
cifPlane = curPlane;
|
||||
ttype = CmdFindNetProc(netname, CIFDummyUse, &bbox, FALSE);
|
||||
ttype = CmdFindNetProc(netname, CIFDummyUse, &bbox, FALSE, NULL);
|
||||
if (ttype != TT_SPACE)
|
||||
{
|
||||
UndoDisable();
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ CIFInputRescale(n, d)
|
|||
CIFScalePlanes(n, d, cifCurReadPlanes);
|
||||
if (cifCurReadPlanes != cifEditCellPlanes)
|
||||
CIFScalePlanes(n, d, cifEditCellPlanes);
|
||||
if (cifEditCellPlanes != cifSubcellPlanes && cifCurReadPlanes != cifSubcellPlanes)
|
||||
if ((const Plane*)cifEditCellPlanes != (const Plane*)cifSubcellPlanes && cifCurReadPlanes != cifSubcellPlanes)
|
||||
CIFScalePlanes(n, d, cifSubcellPlanes);
|
||||
|
||||
CIFReadWarning("CIF style %s: units rescaled by factor of %d / %d\n",
|
||||
|
|
|
|||
|
|
@ -206,24 +206,24 @@ CIFCalmaLayerToCifLayer(layer, datatype, calmaStyle)
|
|||
|
||||
clt.clt_layer = layer;
|
||||
clt.clt_type = datatype;
|
||||
if (he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt))
|
||||
if ((he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt)))
|
||||
return ((spointertype) HashGetValue(he));
|
||||
|
||||
/* Try wildcarding the datatype */
|
||||
clt.clt_type = -1;
|
||||
if (he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt))
|
||||
if ((he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt)))
|
||||
return ((spointertype) HashGetValue(he));
|
||||
|
||||
/* Try wildcarding the layer */
|
||||
clt.clt_layer = -1;
|
||||
clt.clt_type = datatype;
|
||||
if (he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt))
|
||||
if ((he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt)))
|
||||
return ((spointertype) HashGetValue(he));
|
||||
|
||||
/* Try wildcarding them both, for a default value */
|
||||
clt.clt_layer = -1;
|
||||
clt.clt_type = -1;
|
||||
if (he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt))
|
||||
if ((he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt)))
|
||||
return ((spointertype) HashGetValue(he));
|
||||
|
||||
/* No luck */
|
||||
|
|
|
|||
|
|
@ -1253,7 +1253,7 @@ CIFCleanPath(pathHead)
|
|||
if (!path) return;
|
||||
}
|
||||
|
||||
while (next = path->cifp_next)
|
||||
while ((next = path->cifp_next))
|
||||
{
|
||||
if ((dir2 = CIFEdgeDirection(path, next)) == CIF_ZERO)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ cmwColor(w, cmd)
|
|||
}
|
||||
else if (cmd->tx_argc == 2)
|
||||
{
|
||||
if (sscanf(cmd->tx_argv[1], "%i", &color) == 0)
|
||||
if (sscanf(cmd->tx_argv[1], "%i", &color) != 1)
|
||||
{
|
||||
/* Invalid color---allow keywords "next" and "last" */
|
||||
crec = (CMWclientRec *) w->w_clientData;
|
||||
|
|
|
|||
|
|
@ -91,36 +91,36 @@ extern void CMWundoInit();
|
|||
|
||||
ColorBar colorBars[] =
|
||||
{
|
||||
"Red", CB_RED, STYLE_RED, {2000, 8000, 10000, 9000},
|
||||
{2000, 9500, 10000, 10500},
|
||||
"Green", CB_GREEN, STYLE_GREEN, {2000, 5000, 10000, 6000},
|
||||
{2000, 6500, 10000, 7500},
|
||||
"Blue", CB_BLUE, STYLE_BLUE, {2000, 2000, 10000, 3000},
|
||||
{2000, 3500, 10000, 4500},
|
||||
"Hue", CB_HUE, STYLE_YELLOW, {14000, 8000, 22000, 9000},
|
||||
{14000, 9500, 22000, 10500},
|
||||
"Saturation", CB_SAT, STYLE_GRAY, {14000, 5000, 22000, 6000},
|
||||
{14000, 6500, 22000, 7500},
|
||||
"Value", CB_VALUE, STYLE_BROWN1, {14000, 2000, 22000, 3000},
|
||||
{14000, 3500, 22000, 4500},
|
||||
0
|
||||
{"Red", CB_RED, STYLE_RED, {{ 2000, 8000}, {10000, 9000}},
|
||||
{{ 2000, 9500}, {10000, 10500}}},
|
||||
{"Green", CB_GREEN, STYLE_GREEN, {{ 2000, 5000}, {10000, 6000}},
|
||||
{{ 2000, 6500}, {10000, 7500}}},
|
||||
{"Blue", CB_BLUE, STYLE_BLUE, {{ 2000, 2000}, {10000, 3000}},
|
||||
{{ 2000, 3500}, {10000, 4500}}},
|
||||
{"Hue", CB_HUE, STYLE_YELLOW, {{14000, 8000}, {22000, 9000}},
|
||||
{{14000, 9500}, {22000, 10500}}},
|
||||
{"Saturation", CB_SAT, STYLE_GRAY, {{14000, 5000}, {22000, 6000}},
|
||||
{{14000, 6500}, {22000, 7500}}},
|
||||
{"Value", CB_VALUE, STYLE_BROWN1, {{14000, 2000}, {22000, 3000}},
|
||||
{{14000, 3500}, {22000, 4500}}},
|
||||
{0}
|
||||
};
|
||||
|
||||
ColorPump colorPumps[] =
|
||||
{
|
||||
CB_RED, -.0078, {500, 8000, 1500, 9000},
|
||||
CB_RED, .0078, {10500, 8000, 11500, 9000},
|
||||
CB_GREEN, -.0078, {500, 5000, 1500, 6000},
|
||||
CB_GREEN, .0078, {10500, 5000, 11500, 6000},
|
||||
CB_BLUE, -.0078, {500, 2000, 1500, 3000},
|
||||
CB_BLUE, .0078, {10500, 2000, 11500, 3000},
|
||||
CB_HUE, -.01, {12500, 8000, 13500, 9000},
|
||||
CB_HUE, .01, {22500, 8000, 23500, 9000},
|
||||
CB_SAT, -.01, {12500, 5000, 13500, 6000},
|
||||
CB_SAT, .01, {22500, 5000, 23500, 6000},
|
||||
CB_VALUE, -.01, {12500, 2000, 13500, 3000},
|
||||
CB_VALUE, .01, {22500, 2000, 23500, 3000},
|
||||
-1
|
||||
{CB_RED, -.0078, {{ 500, 8000}, { 1500, 9000}}},
|
||||
{CB_RED, .0078, {{10500, 8000}, {11500, 9000}}},
|
||||
{CB_GREEN, -.0078, {{ 500, 5000}, { 1500, 6000}}},
|
||||
{CB_GREEN, .0078, {{10500, 5000}, {11500, 6000}}},
|
||||
{CB_BLUE, -.0078, {{ 500, 2000}, { 1500, 3000}}},
|
||||
{CB_BLUE, .0078, {{10500, 2000}, {11500, 3000}}},
|
||||
{CB_HUE, -.01, {{12500, 8000}, {13500, 9000}}},
|
||||
{CB_HUE, .01, {{22500, 8000}, {23500, 9000}}},
|
||||
{CB_SAT, -.01, {{12500, 5000}, {13500, 6000}}},
|
||||
{CB_SAT, .01, {{22500, 5000}, {23500, 6000}}},
|
||||
{CB_VALUE, -.01, {{12500, 2000}, {13500, 3000}}},
|
||||
{CB_VALUE, .01, {{22500, 2000}, {23500, 3000}}},
|
||||
{-1}
|
||||
};
|
||||
|
||||
Rect cmwCurrentColorArea = {{6000, 12000}, {18000, 15000}};
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "tcltk/tclmagic.h"
|
||||
#include "utils/magic.h"
|
||||
|
|
@ -3683,7 +3684,7 @@ CmdCrash(w, cmd)
|
|||
MagWindow *w;
|
||||
TxCommand *cmd;
|
||||
{
|
||||
int option;
|
||||
int option = -1;
|
||||
char *filename = NULL;
|
||||
static char *cmdCrashOpt[] = {"save", "recover", 0};
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ cmdEditRedisplayFunc(w, area)
|
|||
MagWindow *w; /* Window containing edit cell. */
|
||||
Rect *area; /* Area to be redisplayed. */
|
||||
{
|
||||
static Rect origin = {-1, -1, 1, 1};
|
||||
static Rect origin = {{-1, -1}, {1, 1}};
|
||||
Rect tmp;
|
||||
DBWclientRec *crec = (DBWclientRec *) w->w_clientData;
|
||||
|
||||
|
|
|
|||
|
|
@ -1597,7 +1597,7 @@ CmdFindNetProc(nodename, use, rect, warn_not_found, isvalid)
|
|||
scx.scx_trans = GeoIdentityTransform;
|
||||
s = nodename;
|
||||
trans = GeoIdentityTransform;
|
||||
while (s2 = strchr(s, '/'))
|
||||
while ((s2 = strchr(s, '/')))
|
||||
{
|
||||
*s2 = '\0';
|
||||
DBTreeFindUse(s, scx.scx_use, &scx2);
|
||||
|
|
|
|||
|
|
@ -2324,8 +2324,9 @@ CmdDoProperty(def, cmd, argstart)
|
|||
if (locargc == 1)
|
||||
{
|
||||
/* print all properties and their values */
|
||||
DBPropEnum(def, printPropertiesFunc);
|
||||
DBPropEnum(def, printPropertiesFunc, NULL);
|
||||
}
|
||||
|
||||
else if (locargc == 2)
|
||||
{
|
||||
/* print the value of the indicated property */
|
||||
|
|
@ -2342,7 +2343,7 @@ CmdDoProperty(def, cmd, argstart)
|
|||
/* just return NULL if the property was not found. */
|
||||
if (strcmp(cmd->tx_argv[1], "list"))
|
||||
#endif
|
||||
TxError("Property name %s is not defined\n");
|
||||
TxError("Property name \"%s\" is not defined\n", cmd->tx_argv[1]);
|
||||
}
|
||||
}
|
||||
else if (locargc == 3)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
|
||||
|
|
@ -817,7 +818,7 @@ CmdSelect(w, cmd)
|
|||
* multiples types are pointed to, consecutive
|
||||
* selections will cycle through them.
|
||||
*/
|
||||
static Rect lastArea = {-100, -100, -200, -200};
|
||||
static Rect lastArea = {{-100, -100}, {-200, -200}};
|
||||
/* Used to remember region around what was
|
||||
* pointed at in the last select command: a
|
||||
* new selection in this area causes the next
|
||||
|
|
|
|||
|
|
@ -399,18 +399,18 @@ CmdParseLayers(s, mask)
|
|||
}
|
||||
special[] =
|
||||
{
|
||||
"$", LN_DOLLAR,
|
||||
"*", LN_ALL,
|
||||
"errors", LN_ERRORS,
|
||||
"labels", LN_LABELS,
|
||||
"subcell", LN_CELL,
|
||||
"connect", LN_CONNECT,
|
||||
0,
|
||||
{"$", LN_DOLLAR},
|
||||
{"*", LN_ALL},
|
||||
{"errors", LN_ERRORS},
|
||||
{"labels", LN_LABELS},
|
||||
{"subcell", LN_CELL},
|
||||
{"connect", LN_CONNECT},
|
||||
{0},
|
||||
};
|
||||
|
||||
|
||||
TTMaskZero(mask);
|
||||
while (c = *s++)
|
||||
while ((c = *s++))
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
|
|
@ -756,7 +756,7 @@ again:
|
|||
|
||||
if (strcmp(returnname, def->cd_name) != 0)
|
||||
{
|
||||
if (f = PaOpen(returnname, "r", DBSuffix, ".", (char *) NULL, &filename))
|
||||
if ((f = PaOpen(returnname, "r", DBSuffix, ".", (char *) NULL, &filename)))
|
||||
{
|
||||
(void) fclose(f);
|
||||
if (noninteractive) {
|
||||
|
|
|
|||
|
|
@ -415,10 +415,12 @@ CmdTech(w, cmd)
|
|||
|
||||
for (ctype = TT_TECHDEPBASE; ctype < DBNumUserLayers; ctype++)
|
||||
if (DBIsContact(ctype))
|
||||
{
|
||||
if (TTMaskHasType(&DBActiveLayerBits, ctype))
|
||||
DBUnlockContact(ctype);
|
||||
else
|
||||
DBLockContact(ctype);
|
||||
}
|
||||
|
||||
for (ctype = DBNumUserLayers; ctype < DBNumTypes; ctype++)
|
||||
{
|
||||
|
|
@ -981,7 +983,7 @@ CmdWhat(w, cmd)
|
|||
if (EditCellUse == NULL)
|
||||
{
|
||||
editNull = TRUE;
|
||||
EditCellUse = w->w_surfaceID;
|
||||
EditCellUse = (CellUse *)w->w_surfaceID;
|
||||
}
|
||||
|
||||
/* Find all the selected paint and print out the layer names. */
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
|||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
|
@ -976,7 +977,7 @@ cmdTsrFunc(tp)
|
|||
Tile *tp;
|
||||
{
|
||||
if (cmdTsearchDebug)
|
||||
TxPrintf("%x\n", tp);
|
||||
TxPrintf("%lx\n", (intmax_t) tp);
|
||||
numTilesFound++;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ DBCellFindDup(use, parent)
|
|||
|
||||
BPEnumInit(&bpe, parent->cd_cellPlane, &use->cu_bbox, BPE_EQUAL,
|
||||
"DBCellFindDup");
|
||||
while (dupUse = BPEnumNext(&bpe))
|
||||
while ((dupUse = BPEnumNext(&bpe)))
|
||||
if (dupUse->cu_def == use->cu_def)
|
||||
/* Transforms must be equal---Aligned bounding boxes are
|
||||
* an insufficient measure of exact overlap.
|
||||
|
|
|
|||
|
|
@ -603,7 +603,7 @@ DBFlattenInPlace(use, dest, xMask, dolabels, toplabels, doclear)
|
|||
{
|
||||
int savemask = scx.scx_use->cu_expandMask;
|
||||
scx.scx_use->cu_expandMask = CU_DESCEND_SPECIAL;
|
||||
DBCellCopyAllLabels(&scx, &DBAllTypeBits, CU_DESCEND_SPECIAL, dest);
|
||||
DBCellCopyAllLabels(&scx, &DBAllTypeBits, CU_DESCEND_SPECIAL, dest, NULL);
|
||||
scx.scx_use->cu_expandMask = savemask;
|
||||
}
|
||||
|
||||
|
|
@ -666,7 +666,7 @@ DBFlattenInPlace(use, dest, xMask, dolabels, toplabels, doclear)
|
|||
scx.scx_y++;
|
||||
scx.scx_x = use->cu_xlo;
|
||||
}
|
||||
else if (use->cu_yhi > use->cu_yhi)
|
||||
else if (use->cu_ylo > use->cu_yhi)
|
||||
{
|
||||
scx.scx_y--;
|
||||
scx.scx_x = use->cu_xlo;
|
||||
|
|
@ -1725,7 +1725,8 @@ DBCellCopyAllCells(scx, xMask, targetUse, pArea)
|
|||
|
||||
/* dbCellCopyCellsFunc() allows cells to be left with duplicate IDs */
|
||||
/* so generate unique IDs as needed now. */
|
||||
DBGenerateUniqueIds(targetUse->cu_def, FALSE);
|
||||
|
||||
if (targetUse != NULL) DBGenerateUniqueIds(targetUse->cu_def, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ DBCellDelete(cellname, force)
|
|||
/* so that WindUnload() will create a new one. */
|
||||
|
||||
if (!strcmp(cellname, UNNAMED))
|
||||
DBCellRename(cellname, "__UNNAMED__");
|
||||
DBCellRename(cellname, "__UNNAMED__", FALSE);
|
||||
|
||||
/* For all top-level cell uses, check if any windows have this */
|
||||
/* use. If so, load the window with (UNNAMED). */
|
||||
|
|
@ -1121,11 +1121,13 @@ DBUsePrint(CellName, who, dolist)
|
|||
celldef = DBCellLookDef(CellName);
|
||||
*lasthier = '/';
|
||||
}
|
||||
else
|
||||
else if (EditCellUse != NULL)
|
||||
{
|
||||
/* Referenced cellDef is the current edit def */
|
||||
celldef = EditCellUse->cu_def;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
switch (who)
|
||||
{
|
||||
|
|
@ -1601,7 +1603,7 @@ dbAbutmentUseFunc(selUse, use, transform, data)
|
|||
}
|
||||
|
||||
trans = &use->cu_transform;
|
||||
propvalue = DBPropGet(use->cu_def, "FIXED_BBOX", &found);
|
||||
propvalue = (char *)DBPropGet(use->cu_def, "FIXED_BBOX", &found);
|
||||
if (!found)
|
||||
bbox = use->cu_def->cd_bbox;
|
||||
else
|
||||
|
|
@ -1698,7 +1700,7 @@ DBCellNewDef(cellName)
|
|||
cellName = UNNAMED;
|
||||
|
||||
entry = HashFind(&dbCellDefTable, cellName);
|
||||
if (HashGetValue(entry) != (ClientData) NULL)
|
||||
if (HashGetValue(entry) != NULL)
|
||||
return ((CellDef *) NULL);
|
||||
|
||||
cellDef = DBCellDefAlloc();
|
||||
|
|
@ -1859,7 +1861,7 @@ DBCellRenameDef(cellDef, newName)
|
|||
ASSERT(HashGetValue(oldEntry) == (ClientData) cellDef, "DBCellRenameDef");
|
||||
|
||||
newEntry = HashFind(&dbCellDefTable, newName);
|
||||
if (HashGetValue(newEntry) != (ClientData) NULL)
|
||||
if (HashGetValue(newEntry) != NULL)
|
||||
return (FALSE);
|
||||
|
||||
HashSetValue(oldEntry, (ClientData) NULL);
|
||||
|
|
@ -2507,7 +2509,7 @@ DBUnLinkCell(use, parentDef)
|
|||
{
|
||||
HashEntry *he;
|
||||
|
||||
if (he = HashLookOnly(&parentDef->cd_idHash, use->cu_id))
|
||||
if ((he = HashLookOnly(&parentDef->cd_idHash, use->cu_id)))
|
||||
HashSetValue(he, (ClientData) NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ DBSrCellPlaneArea(BPlane *plane, Rect *rect, int (*func)(), ClientData arg)
|
|||
bpe = (BPEnum *)mallocMagic(sizeof(BPEnum));
|
||||
BPEnumInit(bpe, plane, rect, BPE_OVERLAP, "DBSrCellPlaneArea");
|
||||
|
||||
while (use = BPEnumNext(bpe))
|
||||
while ((use = BPEnumNext(bpe)))
|
||||
{
|
||||
if ((*func)(use, arg))
|
||||
{
|
||||
|
|
@ -1621,7 +1621,7 @@ dbTileScaleFunc(tile, scvals)
|
|||
if ((targetRect.r_xtop - targetRect.r_xbot == 0) ||
|
||||
(targetRect.r_ytop - targetRect.r_ybot == 0))
|
||||
{
|
||||
TxPrintf("Tile 0x%x at (%d, %d) has zero area after scaling: Removed.\n",
|
||||
TxPrintf("Tile %p at (%d, %d) has zero area after scaling: Removed.\n",
|
||||
tile, targetRect.r_xbot, targetRect.r_ybot);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2241,7 +2241,7 @@ DBMoveCell(cellDef, origx, origy)
|
|||
newplane = DBNewPlane((ClientData) TT_SPACE);
|
||||
DBClearPaintPlane(newplane);
|
||||
if (dbMovePlane(cellDef->cd_planes[pNum], newplane, pNum,
|
||||
origx, origy, FALSE))
|
||||
origx, origy))
|
||||
cellDef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP);
|
||||
DBFreePaintPlane(cellDef->cd_planes[pNum]);
|
||||
TiFreePlane(cellDef->cd_planes[pNum]);
|
||||
|
|
|
|||
158
database/DBio.c
158
database/DBio.c
|
|
@ -28,6 +28,8 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
|||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
|
|
@ -686,8 +688,8 @@ dbCellReadDef(f, cellDef, ignoreTech, dereference)
|
|||
freeMagic(argv[1]);
|
||||
freeMagic(argv[0]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (strcmp(DBTechName, tech))
|
||||
{
|
||||
|
|
@ -1070,7 +1072,7 @@ DBFileRecovery(filename)
|
|||
struct stat sbuf;
|
||||
uid_t userid = getuid();
|
||||
time_t recent = 0;
|
||||
char *snptr, *tempdir, tempname[256];
|
||||
char *snptr, *tempdir, tempname[1024];
|
||||
int pid;
|
||||
static char *actionNames[] = {"read", "cancel", 0 };
|
||||
char *prompt;
|
||||
|
|
@ -1096,7 +1098,8 @@ DBFileRecovery(filename)
|
|||
while ((dp = readdir(cwd)) != NULL)
|
||||
{
|
||||
char *doslash = (tempdir[strlen(tempdir) - 1] == '/') ? "" : "/";
|
||||
sprintf(tempname, "%s%s%s", tempdir, doslash, dp->d_name);
|
||||
int n = snprintf(tempname, sizeof(tempname), "%s%s%s", tempdir, doslash, dp->d_name);
|
||||
ASSERT(n < sizeof(tempname), "tempname");
|
||||
snptr = tempname + strlen(tempdir);
|
||||
if (!strncmp(snptr, "MAG", 3))
|
||||
{
|
||||
|
|
@ -1417,9 +1420,10 @@ dbReadOpen(cellDef, setFileName, dereference, errptr)
|
|||
|
||||
pptr = strrchr(sptr, '.');
|
||||
if (pptr != NULL)
|
||||
{
|
||||
if (strcmp(pptr, DBSuffix)) pptr = NULL;
|
||||
else
|
||||
*pptr = '\0';
|
||||
else *pptr = '\0';
|
||||
}
|
||||
|
||||
/* If dereferencing, then use search paths first */
|
||||
if (!dereference)
|
||||
|
|
@ -1594,7 +1598,7 @@ DBOpenOnly(cellDef, name, setFileName, errptr)
|
|||
*/
|
||||
int *errptr; /* Pointer to int to hold error value */
|
||||
{
|
||||
dbReadOpen(cellDef, name != NULL, setFileName, FALSE, errptr);
|
||||
dbReadOpen(cellDef, setFileName, FALSE, errptr);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1907,7 +1911,8 @@ badTransform:
|
|||
{
|
||||
char savepath[1024];
|
||||
strcpy(savepath, pathptr);
|
||||
sprintf(path, "%s/%s", cellDef->cd_file, savepath);
|
||||
int n = snprintf(path, sizeof(path), "%s/%s", cellDef->cd_file, savepath);
|
||||
ASSERT(n < sizeof(path), "path");
|
||||
}
|
||||
pathptr = &path[0];
|
||||
*slashptr = '/';
|
||||
|
|
@ -1973,6 +1978,123 @@ badTransform:
|
|||
}
|
||||
else if (!strcmp(cwddir, pathptr)) pathOK = TRUE;
|
||||
|
||||
/* Apply same check as done in DBWprocs, which is to check the
|
||||
* inode of the two files and declare the path okay if they are
|
||||
* the same. This avoids conflicts in files that are referenced
|
||||
* from two different places via different relative paths, or
|
||||
* through symbolic links.
|
||||
*/
|
||||
|
||||
if ((pathOK == FALSE) && strcmp(subCellDef->cd_file, pathptr)
|
||||
&& (dereference == FALSE) && (firstUse == TRUE))
|
||||
{
|
||||
struct stat statbuf;
|
||||
ino_t inode;
|
||||
|
||||
if (stat(subCellDef->cd_file, &statbuf) == 0)
|
||||
{
|
||||
inode = statbuf.st_ino;
|
||||
|
||||
if (stat(pathptr, &statbuf) == 0)
|
||||
{
|
||||
if (inode == statbuf.st_ino)
|
||||
pathOK = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((pathOK == FALSE) && strcmp(subCellDef->cd_file, pathptr)
|
||||
&& (dereference == FALSE) && (firstUse == TRUE))
|
||||
{
|
||||
/* See if both paths are inside a git repository, and both
|
||||
* git repositories have the same commit hash. Then the
|
||||
* two layouts can be considered equivalent. If the "git"
|
||||
* command fails for any reason, then ignore the error and
|
||||
* continue.
|
||||
*/
|
||||
char *sl1ptr, *sl2ptr;
|
||||
int link[2], nbytes, status;
|
||||
pid_t pid;
|
||||
char githash1[128];
|
||||
char githash2[128];
|
||||
char argstr[1024];
|
||||
|
||||
githash1[0] = '\0';
|
||||
githash2[0] = '\0';
|
||||
|
||||
/* Remove the file component */
|
||||
sl1ptr = strrchr(pathptr, '/');
|
||||
if (sl1ptr != NULL) *sl1ptr = '\0';
|
||||
|
||||
/* Check first file for a git hash */
|
||||
if (pipe(link) != -1)
|
||||
{
|
||||
FORK(pid);
|
||||
if (pid == 0)
|
||||
{
|
||||
dup2(link[1], STDOUT_FILENO);
|
||||
close(link[0]);
|
||||
close(link[1]);
|
||||
int n = snprintf(argstr, sizeof(argstr), "-C %s", pathptr);
|
||||
ASSERT(n < sizeof(argstr), "argstr");
|
||||
execlp("git", argstr, "rev-parse", "HEAD", NULL);
|
||||
_exit(122); /* see vfork man page for reason for _exit() */
|
||||
}
|
||||
else
|
||||
{
|
||||
close(link[1]);
|
||||
nbytes = read(link[0], githash1, sizeof(githash1));
|
||||
waitpid(pid, &status, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (sl1ptr != NULL) *sl1ptr = '/';
|
||||
|
||||
if (githash1[0] != '\0')
|
||||
{
|
||||
/* Check the second repository */
|
||||
|
||||
/* Remove the file component */
|
||||
sl2ptr = strrchr(subCellDef->cd_file, '/');
|
||||
if (sl2ptr != NULL) *sl2ptr = '\0';
|
||||
|
||||
/* Check first file for a git hash */
|
||||
if (pipe(link) != -1)
|
||||
{
|
||||
FORK(pid);
|
||||
if (pid == 0)
|
||||
{
|
||||
dup2(link[1], STDOUT_FILENO);
|
||||
close(link[0]);
|
||||
close(link[1]);
|
||||
sprintf(argstr, "-C %s", subCellDef->cd_file);
|
||||
execlp("git", argstr, "rev-parse", "HEAD", NULL);
|
||||
_exit(123); /* see vfork man page for reason for _exit() */
|
||||
}
|
||||
else
|
||||
{
|
||||
close(link[1]);
|
||||
nbytes = read(link[0], githash2, sizeof(githash2));
|
||||
waitpid(pid, &status, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (sl2ptr != NULL) *sl2ptr = '/';
|
||||
|
||||
if (githash2[0] != '\0')
|
||||
{
|
||||
/* Check if the repositories have the same hash */
|
||||
if (!strcmp(githash1, githash2))
|
||||
{
|
||||
TxPrintf("Cells %s in %s and %s have matching git repository"
|
||||
" commits and can be considered equivalent.\n",
|
||||
slashptr + 1, subCellDef->cd_file, pathptr);
|
||||
pathOK = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((pathOK == FALSE) && strcmp(subCellDef->cd_file, pathptr)
|
||||
&& (dereference == FALSE) && (firstUse == TRUE))
|
||||
{
|
||||
|
|
@ -1994,7 +2116,7 @@ badTransform:
|
|||
}
|
||||
else
|
||||
{
|
||||
char *newname = (char *)mallocMagic(strlen(cellname) + 6);
|
||||
char *newname = (char *)mallocMagic(strlen(cellname) + 7);
|
||||
int i = 0;
|
||||
|
||||
/* To do: Run checksum on file (not yet implemented) */
|
||||
|
|
@ -2002,7 +2124,7 @@ badTransform:
|
|||
|
||||
while (TRUE)
|
||||
{
|
||||
sprintf(newname, "%s#%d", cellname, i);
|
||||
sprintf(newname, "%s__%d", cellname, i);
|
||||
if (DBCellLookDef(newname) == NULL) break;
|
||||
i++;
|
||||
}
|
||||
|
|
@ -2031,7 +2153,7 @@ badTransform:
|
|||
/* default path but the new cell has a (different) path. */
|
||||
/* The paths only match if pathptr is the CWD. */
|
||||
|
||||
else if ((pathptr != NULL) && (*pathptr != '\0'))
|
||||
else if (*pathptr != '\0')
|
||||
{
|
||||
bool pathOK = FALSE;
|
||||
char *cwddir = getenv("PWD");
|
||||
|
|
@ -2071,7 +2193,7 @@ badTransform:
|
|||
}
|
||||
else
|
||||
{
|
||||
char *newname = (char *)mallocMagic(strlen(cellname) + 6);
|
||||
char *newname = (char *)mallocMagic(strlen(cellname) + 7);
|
||||
int i = 0;
|
||||
|
||||
/* To do: Run checksum on file (not yet implemented) */
|
||||
|
|
@ -2079,7 +2201,7 @@ badTransform:
|
|||
|
||||
while (TRUE)
|
||||
{
|
||||
sprintf(newname, "%s#%d", cellname, i);
|
||||
sprintf(newname, "%s__%d", cellname, i);
|
||||
if (DBCellLookDef(newname) == NULL) break;
|
||||
i++;
|
||||
}
|
||||
|
|
@ -2193,7 +2315,7 @@ dbReadProperties(cellDef, line, len, f, scalen, scaled)
|
|||
int scalen; /* Scale up by this factor */
|
||||
int scaled; /* Scale down by this factor */
|
||||
{
|
||||
char propertyname[128], propertyvalue[2048], *storedvalue;
|
||||
char propertyname[128], propertyvalue[2049], *storedvalue;
|
||||
char *pvalueptr;
|
||||
int ntok;
|
||||
unsigned int noeditflag;
|
||||
|
|
@ -2370,8 +2492,8 @@ dbReadProperties(cellDef, line, len, f, scalen, scaled)
|
|||
/* Skip forward four values in pvalueptr */
|
||||
for (n = 0; n < 4; n++)
|
||||
{
|
||||
while (!isspace(*pptr)) pptr++;
|
||||
while (isspace(*pptr) && (*pptr != '\0')) pptr++;
|
||||
while ((*pptr != '\0') && !isspace(*pptr)) pptr++;
|
||||
while ((*pptr != '\0') && isspace(*pptr)) pptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2917,7 +3039,7 @@ dbFgets(line, len, f)
|
|||
{
|
||||
char *cs;
|
||||
int l;
|
||||
int c;
|
||||
int c = EOF;
|
||||
|
||||
do
|
||||
{
|
||||
|
|
@ -3216,7 +3338,7 @@ dbGetPropFunc(key, value, propRec)
|
|||
propRec->keyValueList[propRec->idx] =
|
||||
(struct keyValuePair *)mallocMagic(sizeof(struct keyValuePair));
|
||||
propRec->keyValueList[propRec->idx]->key = key;
|
||||
propRec->keyValueList[propRec->idx]->value = value;
|
||||
propRec->keyValueList[propRec->idx]->value = (char *)value;
|
||||
propRec->idx++;
|
||||
|
||||
return 0;
|
||||
|
|
@ -3871,7 +3993,7 @@ DBCellWrite(cellDef, fileName)
|
|||
* If so, write to the temp file and then rename it after
|
||||
* we're done.
|
||||
*/
|
||||
if (tmpf = fopen(tmpname, "w"))
|
||||
if ((tmpf = fopen(tmpname, "w")))
|
||||
{
|
||||
result = DBCellWriteFile(cellDef, tmpf);
|
||||
(void) fclose(tmpf);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <math.h> /* For sin(), cos(), and round() functions */
|
||||
#include <ctype.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ DBSrLabelLoc(rootUse, name, func, cdarg)
|
|||
char csave;
|
||||
Rect r;
|
||||
|
||||
if (cp = strrchr(name, '/'))
|
||||
if ((cp = strrchr(name, '/')))
|
||||
{
|
||||
csave = *cp;
|
||||
*cp = '\0';
|
||||
|
|
|
|||
|
|
@ -283,6 +283,7 @@ DBPaintValid(cellDef, rect, mask, dinfo)
|
|||
|
||||
for (t = TT_SELECTBASE; t < DBNumUserLayers; t++)
|
||||
if (TTMaskHasType(&mmask, t))
|
||||
{
|
||||
if (DBIsContact(t))
|
||||
{
|
||||
tMask = DBResidueMask(t);
|
||||
|
|
@ -310,6 +311,7 @@ DBPaintValid(cellDef, rect, mask, dinfo)
|
|||
(t << 14) : t) : t);
|
||||
DBPaint(cellDef, rect, tloc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -382,6 +384,7 @@ DBEraseValid(cellDef, rect, mask, dinfo)
|
|||
|
||||
for (t = TT_SELECTBASE; t < DBNumUserLayers; t++)
|
||||
if (TTMaskHasType(&mmask, t))
|
||||
{
|
||||
if (DBIsContact(t))
|
||||
{
|
||||
tMask = DBResidueMask(t);
|
||||
|
|
@ -409,4 +412,5 @@ DBEraseValid(cellDef, rect, mask, dinfo)
|
|||
(t << 14) : t) : t);
|
||||
DBErase(cellDef, rect, tloc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ DBTechSetVersion(sectionName, argc, argv)
|
|||
major = minor = rev = 0;
|
||||
rmajor = rminor = rrev = 0;
|
||||
|
||||
if (sscanf(vstring, "%d.%d.%d", &rmajor, &rminor, &rrev) == 0)
|
||||
if (sscanf(vstring, "%d.%d.%d", &rmajor, &rminor, &rrev) != 3)
|
||||
{
|
||||
TechError("Badly formed magic version string, should be major.minor.rev\n");
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -70,28 +70,28 @@ TileTypeBitMask DBTechActiveLayerBits; /* Layers marked locked in the techfile *
|
|||
/* Table of default, builtin planes */
|
||||
DefaultPlane dbTechDefaultPlanes[] =
|
||||
{
|
||||
PL_ROUTER, "router",
|
||||
PL_DRC_ERROR, "designRuleError",
|
||||
PL_DRC_CHECK, "designRuleCheck",
|
||||
PL_M_HINT, "mhint",
|
||||
PL_F_HINT, "fhint",
|
||||
PL_R_HINT, "rhint",
|
||||
0, 0, 0
|
||||
{PL_ROUTER, "router"},
|
||||
{PL_DRC_ERROR, "designRuleError"},
|
||||
{PL_DRC_CHECK, "designRuleCheck"},
|
||||
{PL_M_HINT, "mhint"},
|
||||
{PL_F_HINT, "fhint"},
|
||||
{PL_R_HINT, "rhint"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
/* Table of default, builtin types */
|
||||
DefaultType dbTechDefaultTypes[] =
|
||||
{
|
||||
TT_SPACE, -1, "space", FALSE,
|
||||
TT_CHECKPAINT, PL_DRC_CHECK, "checkpaint,CP", FALSE,
|
||||
TT_CHECKSUBCELL, PL_DRC_CHECK, "checksubcell,CS", FALSE,
|
||||
TT_ERROR_P, PL_DRC_ERROR, "error_p,EP", FALSE,
|
||||
TT_ERROR_S, PL_DRC_ERROR, "error_s,ES", FALSE,
|
||||
TT_ERROR_PS, PL_DRC_ERROR, "error_ps,EPS", FALSE,
|
||||
TT_MAGNET, PL_M_HINT, "magnet,mag", TRUE,
|
||||
TT_FENCE, PL_F_HINT, "fence,f", TRUE,
|
||||
TT_ROTATE, PL_R_HINT, "rotate,r", TRUE,
|
||||
0, 0, NULL, 0
|
||||
{TT_SPACE, -1, "space", FALSE},
|
||||
{TT_CHECKPAINT, PL_DRC_CHECK, "checkpaint,CP", FALSE},
|
||||
{TT_CHECKSUBCELL, PL_DRC_CHECK, "checksubcell,CS", FALSE},
|
||||
{TT_ERROR_P, PL_DRC_ERROR, "error_p,EP", FALSE},
|
||||
{TT_ERROR_S, PL_DRC_ERROR, "error_s,ES", FALSE},
|
||||
{TT_ERROR_PS, PL_DRC_ERROR, "error_ps,EPS", FALSE},
|
||||
{TT_MAGNET, PL_M_HINT, "magnet,mag", TRUE},
|
||||
{TT_FENCE, PL_F_HINT, "fence,f", TRUE},
|
||||
{TT_ROTATE, PL_R_HINT, "rotate,r", TRUE},
|
||||
{0, 0, NULL, 0}
|
||||
};
|
||||
|
||||
/* Forward declarations */
|
||||
|
|
|
|||
|
|
@ -565,15 +565,15 @@ enumerate:
|
|||
theight = TOP(tp) - BOTTOM(tp);
|
||||
twidth = RIGHT(tp) - LEFT(tp);
|
||||
f1 = (rect->r_ybot > MINFINITY + 2) ?
|
||||
(TOP(tp) - rect->r_ybot) * twidth : DLONG_MAX;
|
||||
(dlong)(TOP(tp) - rect->r_ybot) * (dlong)twidth : DLONG_MAX;
|
||||
f2 = (rect->r_ytop < INFINITY - 2) ?
|
||||
(rect->r_ytop - BOTTOM(tp)) * twidth : DLONG_MAX;
|
||||
(dlong)(rect->r_ytop - BOTTOM(tp)) * (dlong)twidth : DLONG_MAX;
|
||||
|
||||
if (TTMaskHasType(mask, SplitLeftType(tp)))
|
||||
{
|
||||
/* !Outside-of-triangle check */
|
||||
f4 = (rect->r_xbot > MINFINITY + 2) ?
|
||||
(rect->r_xbot - LEFT(tp)) * theight : DLONG_MIN;
|
||||
(dlong)(rect->r_xbot - LEFT(tp)) * (dlong)theight : DLONG_MIN;
|
||||
if (SplitDirection(tp) ? (f1 > f4) : (f2 > f4))
|
||||
{
|
||||
TiSetBody(tp, (ClientData)((TileType)TiGetBody(tp)
|
||||
|
|
@ -587,7 +587,7 @@ enumerate:
|
|||
{
|
||||
/* !Outside-of-triangle check */
|
||||
f3 = (rect->r_xtop < INFINITY - 2) ?
|
||||
(RIGHT(tp) - rect->r_xtop) * theight : DLONG_MIN;
|
||||
(dlong)(RIGHT(tp) - rect->r_xtop) * (dlong)theight : DLONG_MIN;
|
||||
if (SplitDirection(tp) ? (f2 > f3) : (f1 > f3))
|
||||
{
|
||||
TiSetBody(tp, (ClientData)((TileType)TiGetBody(tp)
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ dbUndoSplitForw(us)
|
|||
{
|
||||
/* Create internal fracture */
|
||||
if (dbUndoLastCell == NULL) return;
|
||||
DBSplitTile(dbUndoLastCell->cd_planes[us->sue_plane], &us->sue_point,
|
||||
DBSplitTile(dbUndoLastCell->cd_planes[(unsigned char)us->sue_plane], &us->sue_point,
|
||||
us->sue_splitx);
|
||||
}
|
||||
|
||||
|
|
@ -276,7 +276,7 @@ dbUndoSplitBack(us)
|
|||
srect.r_ur.p_y = us->sue_point.p_y + 1;
|
||||
|
||||
/* Remove internal fracture and restore original split tile */
|
||||
DBMergeNMTiles0(dbUndoLastCell->cd_planes[us->sue_plane], &srect,
|
||||
DBMergeNMTiles0(dbUndoLastCell->cd_planes[(unsigned char)us->sue_plane], &srect,
|
||||
(PaintUndoInfo *)NULL, TRUE);
|
||||
}
|
||||
|
||||
|
|
@ -314,20 +314,20 @@ dbUndoPaintForw(up)
|
|||
loctype = (up->pue_oldtype & TT_LEFTMASK);
|
||||
dinfo = TT_DIAGONAL | (up->pue_oldtype & TT_DIRECTION);
|
||||
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdEraseTbl(loctype, up->pue_plane),
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdEraseTbl(loctype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
|
||||
loctype = (up->pue_oldtype & TT_RIGHTMASK) >> 14;
|
||||
dinfo |= TT_SIDE;
|
||||
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdEraseTbl(loctype, up->pue_plane),
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdEraseTbl(loctype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
}
|
||||
else
|
||||
DBPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], &up->pue_rect,
|
||||
DBStdEraseTbl(up->pue_oldtype, up->pue_plane),
|
||||
DBPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], &up->pue_rect,
|
||||
DBStdEraseTbl(up->pue_oldtype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
|
||||
if (up->pue_newtype & TT_DIAGONAL)
|
||||
|
|
@ -335,20 +335,20 @@ dbUndoPaintForw(up)
|
|||
loctype = (up->pue_newtype & TT_LEFTMASK);
|
||||
dinfo = TT_DIAGONAL | (up->pue_newtype & TT_DIRECTION);
|
||||
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdPaintTbl(loctype, up->pue_plane),
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdPaintTbl(loctype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
|
||||
loctype = (up->pue_newtype & TT_RIGHTMASK) >> 14;
|
||||
dinfo |= TT_SIDE;
|
||||
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdPaintTbl(loctype, up->pue_plane),
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdPaintTbl(loctype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
}
|
||||
else
|
||||
DBPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], &up->pue_rect,
|
||||
DBStdPaintTbl(up->pue_newtype, up->pue_plane),
|
||||
DBPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], &up->pue_rect,
|
||||
DBStdPaintTbl(up->pue_newtype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
endPaintFor:
|
||||
dbUndoUndid = TRUE;
|
||||
|
|
@ -368,20 +368,20 @@ dbUndoPaintBack(up)
|
|||
loctype = (up->pue_newtype & TT_LEFTMASK);
|
||||
dinfo = TT_DIAGONAL | (up->pue_newtype & TT_DIRECTION);
|
||||
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdEraseTbl(loctype, up->pue_plane),
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdEraseTbl(loctype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
|
||||
loctype = (up->pue_newtype & TT_RIGHTMASK) >> 14;
|
||||
dinfo |= TT_SIDE;
|
||||
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdEraseTbl(loctype, up->pue_plane),
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane],
|
||||
dinfo, &up->pue_rect, DBStdEraseTbl(loctype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
}
|
||||
else
|
||||
DBPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], &up->pue_rect,
|
||||
DBStdEraseTbl(up->pue_newtype, up->pue_plane),
|
||||
DBPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], &up->pue_rect,
|
||||
DBStdEraseTbl(up->pue_newtype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
|
||||
if (up->pue_oldtype & TT_DIAGONAL)
|
||||
|
|
@ -389,23 +389,23 @@ dbUndoPaintBack(up)
|
|||
loctype = (up->pue_oldtype & TT_LEFTMASK);
|
||||
dinfo = TT_DIAGONAL | (up->pue_oldtype & TT_DIRECTION);
|
||||
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], dinfo,
|
||||
&up->pue_rect, DBStdPaintTbl(loctype, up->pue_plane),
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], dinfo,
|
||||
&up->pue_rect, DBStdPaintTbl(loctype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
|
||||
loctype = (up->pue_oldtype & TT_RIGHTMASK) >> 14;
|
||||
dinfo |= TT_SIDE;
|
||||
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], dinfo,
|
||||
&up->pue_rect, DBStdPaintTbl(loctype, up->pue_plane),
|
||||
DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], dinfo,
|
||||
&up->pue_rect, DBStdPaintTbl(loctype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
|
||||
DBMergeNMTiles0(dbUndoLastCell->cd_planes[up->pue_plane],
|
||||
DBMergeNMTiles0(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane],
|
||||
&up->pue_rect, (PaintUndoInfo *)NULL, TRUE);
|
||||
}
|
||||
else
|
||||
DBPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], &up->pue_rect,
|
||||
DBStdPaintTbl(up->pue_oldtype, up->pue_plane),
|
||||
DBPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], &up->pue_rect,
|
||||
DBStdPaintTbl(up->pue_oldtype, (unsigned char)up->pue_plane),
|
||||
(PaintUndoInfo *) NULL);
|
||||
|
||||
endPaintBack:
|
||||
|
|
@ -788,9 +788,11 @@ dbUndoCellBack(up)
|
|||
break;
|
||||
case UNDO_CELL_PLACE:
|
||||
use = findUse(up, TRUE);
|
||||
DBUnLinkCell(use, up->cue_parent);
|
||||
DBDeleteCell(use);
|
||||
(void) DBCellDeleteUse(use);
|
||||
if (use) {
|
||||
DBUnLinkCell(use, up->cue_parent);
|
||||
DBDeleteCell(use);
|
||||
(void) DBCellDeleteUse(use);
|
||||
}
|
||||
DBReComputeBbox(up->cue_parent);
|
||||
DBWAreaChanged(up->cue_parent, &up->cue_bbox, DBW_ALLWINDOWS,
|
||||
(TileTypeBitMask *) NULL);
|
||||
|
|
@ -804,9 +806,11 @@ dbUndoCellBack(up)
|
|||
*/
|
||||
case UNDO_CELL_CLRID:
|
||||
use = findUse(up, FALSE); /* Find it with a NULL id */
|
||||
(void) DBReLinkCell(use, up->cue_id);
|
||||
DBWAreaChanged(up->cue_parent, &up->cue_bbox,
|
||||
(int) ~use->cu_expandMask, &DBAllButSpaceBits);
|
||||
if (use) {
|
||||
(void) DBReLinkCell(use, up->cue_id);
|
||||
DBWAreaChanged(up->cue_parent, &up->cue_bbox,
|
||||
(int) ~use->cu_expandMask, &DBAllButSpaceBits);
|
||||
}
|
||||
break;
|
||||
/*
|
||||
* The following is a hack.
|
||||
|
|
@ -817,16 +821,20 @@ dbUndoCellBack(up)
|
|||
*/
|
||||
case UNDO_CELL_SETID:
|
||||
use = findUse(up, TRUE); /* Find it with current id */
|
||||
DBUnLinkCell(use, up->cue_parent);
|
||||
freeMagic(use->cu_id);
|
||||
use->cu_id = (char *) NULL;
|
||||
if (use) {
|
||||
DBUnLinkCell(use, up->cue_parent);
|
||||
freeMagic(use->cu_id);
|
||||
use->cu_id = (char *) NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
case UNDO_CELL_LOCKDOWN:
|
||||
use = findUse(up, TRUE);
|
||||
use->cu_flags = up->cue_flags;
|
||||
DBWAreaChanged(up->cue_parent, &up->cue_bbox,
|
||||
if (use) {
|
||||
use->cu_flags = up->cue_flags;
|
||||
DBWAreaChanged(up->cue_parent, &up->cue_bbox,
|
||||
(int) ~use->cu_expandMask, &DBAllButSpaceBits);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,9 +192,9 @@ DBWPrintElements(cellDef, flagmask, reducer)
|
|||
char *etypes[] = {"rectangle", "line", "text"};
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&elementTable, &hs))
|
||||
while ((he = HashNext(&elementTable, &hs)))
|
||||
{
|
||||
if (elem = (DBWElement *)HashGetValue(he))
|
||||
if ((elem = (DBWElement *)HashGetValue(he)))
|
||||
{
|
||||
if ((elem->rootDef == cellDef) && (elem->flags & flagmask))
|
||||
{
|
||||
|
|
@ -292,9 +292,9 @@ DBWScaleElements(n, d)
|
|||
extern bool DBScalePoint(); /* Forward declaration */
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&elementTable, &hs))
|
||||
while ((he = HashNext(&elementTable, &hs)))
|
||||
{
|
||||
if (elem = (DBWElement *)HashGetValue(he))
|
||||
if ((elem = (DBWElement *)HashGetValue(he)))
|
||||
{
|
||||
/* scale area rectangle */
|
||||
DBScalePoint(&elem->area.r_ll, n, d);
|
||||
|
|
@ -630,24 +630,24 @@ DBWElementNames()
|
|||
HashEntry *he;
|
||||
|
||||
#ifndef MAGIC_WRAPPER
|
||||
TxPrintf(stdout, "Known elements:");
|
||||
TxPrintf("Known elements:");
|
||||
#endif
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&elementTable, &hs))
|
||||
while ((he = HashNext(&elementTable, &hs)))
|
||||
{
|
||||
if (elem = (DBWElement *)HashGetValue(he))
|
||||
if ((elem = (DBWElement *)HashGetValue(he)))
|
||||
{
|
||||
#ifdef MAGIC_WRAPPER
|
||||
Tcl_AppendElement(magicinterp, he->h_key.h_name);
|
||||
#else
|
||||
TxPrintf(stdout, " %s", he->h_key.h_name);
|
||||
TxPrintf(" %s", he->h_key.h_name);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef MAGIC_WRAPPER
|
||||
TxPrintf(stdout, "/n");
|
||||
TxPrintf("/n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
@ -672,27 +672,27 @@ DBWElementInbox(area)
|
|||
int sqdist;
|
||||
|
||||
#ifndef MAGIC_WRAPPER
|
||||
TxPrintf(stdout, "Element(s) inside box: ");
|
||||
TxPrintf("Element(s) inside box: ");
|
||||
#endif
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&elementTable, &hs))
|
||||
while ((he = HashNext(&elementTable, &hs)))
|
||||
{
|
||||
if (elem = (DBWElement *)HashGetValue(he))
|
||||
if ((elem = (DBWElement *)HashGetValue(he)))
|
||||
{
|
||||
if (GEO_SURROUND(area, &elem->area))
|
||||
{
|
||||
#ifdef MAGIC_WRAPPER
|
||||
Tcl_AppendElement(magicinterp, he->h_key.h_name);
|
||||
#else
|
||||
TxPrintf(stdout, " %s", he->h_key.h_name);
|
||||
TxPrintf(" %s", he->h_key.h_name);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef MAGIC_WRAPPER
|
||||
TxPrintf(stdout, "/n");
|
||||
TxPrintf("/n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ dbwUndoChangeEdit(ep)
|
|||
Rect area;
|
||||
CellUse *use;
|
||||
CellDef *editDef, *parent;
|
||||
static Rect origin = {-1, -1, 1, 1};
|
||||
static Rect origin = {{-1, -1}, {1, 1}};
|
||||
|
||||
/* Redisplay the old edit cell */
|
||||
GeoTransRect(&EditToRootTransform, &(EditCellUse->cu_def->cd_bbox), &area);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ DebugAddFlag(clientID, name)
|
|||
|
||||
if (id < 0 || id >= debugNumClients)
|
||||
{
|
||||
TxError("DebugAddFlag: bad client id %d (flag %s)\n", clientID, name);
|
||||
TxError("DebugAddFlag: bad client id %lu (flag %s)\n", clientID, name);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ DebugShow(clientID)
|
|||
|
||||
if (id < 0 || id >= debugNumClients)
|
||||
{
|
||||
TxError("DebugShow: bad client id %d\n", clientID);
|
||||
TxError("DebugShow: bad client id %lu\n", clientID);
|
||||
return;
|
||||
}
|
||||
dc = &debugClients[id];
|
||||
|
|
@ -208,7 +208,7 @@ DebugSet(clientID, argc, argv, value)
|
|||
|
||||
if (id < 0 || id >= debugNumClients)
|
||||
{
|
||||
TxError("DebugSet: bad client id %d\n", clientID);
|
||||
TxError("DebugSet: bad client id %lu\n", (unsigned long)clientID);
|
||||
return;
|
||||
}
|
||||
dc = &debugClients[id];
|
||||
|
|
|
|||
|
|
@ -141,8 +141,10 @@ HistAdd(name, ptrKeys, value)
|
|||
{
|
||||
Histogram * h;
|
||||
|
||||
if((h=histFind(name, ptrKeys))==(Histogram *) NULL)
|
||||
if((h=histFind(name, ptrKeys))==(Histogram *) NULL) {
|
||||
HistCreate(name, ptrKeys, 0, 20, 10);
|
||||
h=histFind(name, ptrKeys);
|
||||
}
|
||||
|
||||
h->hi_cum+=value;
|
||||
if(value < h->hi_lo)
|
||||
|
|
|
|||
|
|
@ -105,6 +105,10 @@ Attach a "property" (string key and value pair) to the edit cell
|
|||
are required to accommodate pins). Any set-back applied by the
|
||||
"lef write -hide <value>" option will be applied to this obstruction
|
||||
box.
|
||||
<DT> <B>flatten</B>
|
||||
<DD> This property is used in conjunction with the "flatten -doproperty"
|
||||
command option and marks the cell for flattening. Cells without
|
||||
this property defined will not be flattened.
|
||||
<DT> <B>device</B>
|
||||
<DD> This property declares that the cell is a device or contains a
|
||||
single device that is not a known extractable device defined in
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ extern int drcArrayYankFunc(), drcArrayOverlapFunc();
|
|||
|
||||
static DRCCookie drcArrayCookie = {
|
||||
0, 0, 0, 0,
|
||||
{ 0 }, { 0 },
|
||||
{ {0} }, { {0} },
|
||||
0, 0, 0,
|
||||
DRC_ARRAY_OVERLAP_TAG,
|
||||
(DRCCookie *) NULL
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ int dbDRCDebug = 0;
|
|||
|
||||
static DRCCookie drcOverlapCookie = {
|
||||
0, 0, 0, 0,
|
||||
{ 0 }, { 0 },
|
||||
{ {0} }, { {0} },
|
||||
0, 0, 0,
|
||||
DRC_OVERLAP_TAG,
|
||||
(DRCCookie *) NULL
|
||||
|
|
@ -176,7 +176,7 @@ areaCheck(tile, arg)
|
|||
unsigned int i;
|
||||
int sqx, sqy;
|
||||
int sdist = arg->dCD_radial & 0xfff;
|
||||
long sstest, ssdist = sdist * sdist;
|
||||
long sstest, ssdist = (long) sdist * sdist;
|
||||
|
||||
if ((arg->dCD_radial & RADIAL_NW) != 0)
|
||||
{
|
||||
|
|
@ -692,9 +692,15 @@ drcTile (tile, arg)
|
|||
cptr->drcc_dist++;
|
||||
|
||||
if (cptr->drcc_flags & DRC_REVERSE)
|
||||
{
|
||||
mrd = drcCanonicalMaxwidth(tpleft, GEO_WEST, arg, cptr);
|
||||
triggered = 0;
|
||||
}
|
||||
else if (firsttile)
|
||||
{
|
||||
mrd = drcCanonicalMaxwidth(tile, GEO_EAST, arg, cptr);
|
||||
triggered = 0;
|
||||
}
|
||||
if (!trigpending || (DRCCurStyle->DRCFlags
|
||||
& DRC_FLAGS_WIDEWIDTH_NONINCLUSIVE))
|
||||
cptr->drcc_dist--;
|
||||
|
|
@ -1089,9 +1095,15 @@ drcTile (tile, arg)
|
|||
cptr->drcc_dist++;
|
||||
|
||||
if (cptr->drcc_flags & DRC_REVERSE)
|
||||
{
|
||||
mrd = drcCanonicalMaxwidth(tpbot, GEO_SOUTH, arg, cptr);
|
||||
triggered = 0;
|
||||
}
|
||||
else if (firsttile)
|
||||
{
|
||||
mrd = drcCanonicalMaxwidth(tile, GEO_NORTH, arg, cptr);
|
||||
triggered = 0;
|
||||
}
|
||||
if (!trigpending || (DRCCurStyle->DRCFlags
|
||||
& DRC_FLAGS_WIDEWIDTH_NONINCLUSIVE))
|
||||
cptr->drcc_dist--;
|
||||
|
|
|
|||
|
|
@ -1076,7 +1076,7 @@ areaCifCheck(tile, arg)
|
|||
unsigned int i;
|
||||
int sqx, sqy;
|
||||
int sdist = arg->dCD_radial & 0xfff;
|
||||
long sstest, ssdist = sdist * sdist;
|
||||
long sstest, ssdist = (long) sdist * sdist;
|
||||
|
||||
if ((arg->dCD_radial & RADIAL_NW) != 0)
|
||||
{
|
||||
|
|
@ -1184,7 +1184,7 @@ drcCifArea(argc, argv)
|
|||
DRCCookie *dpnext, *dpnew;
|
||||
TileType i, j;
|
||||
int plane;
|
||||
int thislayer;
|
||||
int thislayer = -1;
|
||||
int scalefactor;
|
||||
|
||||
if (drcCifStyle == NULL)
|
||||
|
|
@ -1246,7 +1246,7 @@ drcCifMaxwidth(argc, argv)
|
|||
TileType i, j;
|
||||
int plane;
|
||||
int bend;
|
||||
int thislayer;
|
||||
int thislayer = -1;
|
||||
int scalefactor;
|
||||
|
||||
if (drcCifStyle == NULL)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static ClientData drcSubClientData;
|
|||
|
||||
static DRCCookie drcSubcellCookie = {
|
||||
0, 0, 0, 0,
|
||||
{ 0 }, { 0 },
|
||||
{ {0} }, { {0} },
|
||||
0, 0, 0,
|
||||
DRC_SUBCELL_OVERLAP_TAG,
|
||||
(DRCCookie *) NULL
|
||||
|
|
@ -68,7 +68,7 @@ static DRCCookie drcSubcellCookie = {
|
|||
|
||||
static DRCCookie drcInSubCookie = {
|
||||
0, 0, 0, 0,
|
||||
{ 0 }, { 0 },
|
||||
{ {0} }, { {0} },
|
||||
0, 0, 0,
|
||||
DRC_IN_SUBCELL_TAG,
|
||||
(DRCCookie *) NULL
|
||||
|
|
@ -82,7 +82,7 @@ static DRCCookie drcInSubCookie = {
|
|||
|
||||
static DRCCookie drcOffGridCookie = {
|
||||
0, 0, 0, 0,
|
||||
{ 0 }, { 0 },
|
||||
{ {0} }, { {0} },
|
||||
0, 0, 0,
|
||||
DRC_OFFGRID_TAG,
|
||||
(DRCCookie *) NULL
|
||||
|
|
@ -965,5 +965,5 @@ drcIncCount(def, area, rule, count)
|
|||
DRCCookie *rule;
|
||||
int *count;
|
||||
{
|
||||
*count++;
|
||||
(*count)++;
|
||||
}
|
||||
|
|
|
|||
138
drc/DRCtech.c
138
drc/DRCtech.c
|
|
@ -826,7 +826,7 @@ DRCTechLine(sectionName, argc, argv)
|
|||
|
||||
if (DRCStyleList == NULL)
|
||||
{
|
||||
char *locargv[2][10] = {"style", "default"};
|
||||
char *locargv[2][10] = {{"style"}, {"default"}};
|
||||
|
||||
if (DRCTechLine(sectionName, 2, locargv) == FALSE)
|
||||
return FALSE;
|
||||
|
|
@ -1022,53 +1022,53 @@ DRCTechAddRule(sectionName, argc, argv)
|
|||
int (*rk_proc)(); /* Procedure implementing this keyword */
|
||||
char *rk_err; /* Error message */
|
||||
} ruleKeys[] = {
|
||||
"angles", 4, 4, drcAngles,
|
||||
"layers 45|90 why",
|
||||
"edge", 8, 9, drcEdge,
|
||||
"layers1 layers2 distance okTypes cornerTypes cornerDistance why [plane]",
|
||||
"edge4way", 8, 9, drcEdge,
|
||||
"layers1 layers2 distance okTypes cornerTypes cornerDistance why [plane]",
|
||||
"exact_overlap", 2, 2, drcExactOverlap,
|
||||
"layers",
|
||||
"extend", 5, 6, drcExtend,
|
||||
"layers1 layers2 distance [option] why",
|
||||
"no_overlap", 3, 3, drcNoOverlap,
|
||||
"layers1 layers2",
|
||||
"option", 2, 2, drcOption,
|
||||
"option_name option_value",
|
||||
"overhang", 5, 5, drcOverhang,
|
||||
"layers1 layers2 distance why",
|
||||
"rect_only", 3, 3, drcRectOnly,
|
||||
"layers why",
|
||||
"spacing", 6, 7, drcSpacing,
|
||||
"layers1 layers2 separation [layers3] adjacency why",
|
||||
"stepsize", 2, 2, drcStepSize,
|
||||
"step_size",
|
||||
"surround", 6, 7, drcSurround,
|
||||
"layers1 layers2 distance presence why",
|
||||
"width", 4, 5, drcWidth,
|
||||
"layers width why",
|
||||
"widespacing", 7, 8, drcSpacing,
|
||||
"layers1 width layers2 separation adjacency why",
|
||||
"area", 5, 5, drcArea,
|
||||
"layers area horizon why",
|
||||
"off_grid", 4, 4, drcOffGrid,
|
||||
"layers pitch why",
|
||||
"maxwidth", 4, 5, drcMaxwidth,
|
||||
"layers maxwidth bends why",
|
||||
"cifstyle", 2, 2, drcCifSetStyle,
|
||||
"cif_style",
|
||||
"cifwidth", 4, 4, drcCifWidth,
|
||||
"layers width why",
|
||||
"cifspacing", 6, 6, drcCifSpacing,
|
||||
"layers1 layers2 separation adjacency why",
|
||||
"cifarea", 5, 5, drcCifArea,
|
||||
"layers area horizon why",
|
||||
"cifmaxwidth", 5, 5, drcCifMaxwidth,
|
||||
"layers maxwidth bends why",
|
||||
"rectangle", 5, 5, drcRectangle,
|
||||
"layers maxwidth [even|odd|any] why",
|
||||
0
|
||||
{"angles", 4, 4, drcAngles,
|
||||
"layers 45|90 why"},
|
||||
{"edge", 8, 9, drcEdge,
|
||||
"layers1 layers2 distance okTypes cornerTypes cornerDistance why [plane]"},
|
||||
{"edge4way", 8, 9, drcEdge,
|
||||
"layers1 layers2 distance okTypes cornerTypes cornerDistance why [plane]"},
|
||||
{"exact_overlap", 2, 2, drcExactOverlap,
|
||||
"layers"},
|
||||
{"extend", 5, 6, drcExtend,
|
||||
"layers1 layers2 distance [option] why"},
|
||||
{"no_overlap", 3, 3, drcNoOverlap,
|
||||
"layers1 layers2"},
|
||||
{"option", 2, 2, drcOption,
|
||||
"option_name option_value"},
|
||||
{"overhang", 5, 5, drcOverhang,
|
||||
"layers1 layers2 distance why"},
|
||||
{"rect_only", 3, 3, drcRectOnly,
|
||||
"layers why"},
|
||||
{"spacing", 6, 7, drcSpacing,
|
||||
"layers1 layers2 separation [layers3] adjacency why"},
|
||||
{"stepsize", 2, 2, drcStepSize,
|
||||
"step_size"},
|
||||
{"surround", 6, 7, drcSurround,
|
||||
"layers1 layers2 distance presence why"},
|
||||
{"width", 4, 5, drcWidth,
|
||||
"layers width why"},
|
||||
{"widespacing", 7, 8, drcSpacing,
|
||||
"layers1 width layers2 separation adjacency why"},
|
||||
{"area", 5, 5, drcArea,
|
||||
"layers area horizon why"},
|
||||
{"off_grid", 4, 4, drcOffGrid,
|
||||
"layers pitch why"},
|
||||
{"maxwidth", 4, 5, drcMaxwidth,
|
||||
"layers maxwidth bends why"},
|
||||
{"cifstyle", 2, 2, drcCifSetStyle,
|
||||
"cif_style"},
|
||||
{"cifwidth", 4, 4, drcCifWidth,
|
||||
"layers width why"},
|
||||
{"cifspacing", 6, 6, drcCifSpacing,
|
||||
"layers1 layers2 separation adjacency why"},
|
||||
{"cifarea", 5, 5, drcCifArea,
|
||||
"layers area horizon why"},
|
||||
{"cifmaxwidth", 5, 5, drcCifMaxwidth,
|
||||
"layers maxwidth bends why"},
|
||||
{"rectangle", 5, 5, drcRectangle,
|
||||
"layers maxwidth [even|odd|any] why"},
|
||||
{0}
|
||||
}, *rp;
|
||||
|
||||
drcRulesSpecified += 1;
|
||||
|
|
@ -1216,7 +1216,7 @@ drcExtend(argc, argv)
|
|||
for (j = 0; j < DBNumTypes; j++)
|
||||
{
|
||||
if (i == j) continue;
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pMask2))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pMask2)))
|
||||
{
|
||||
/* Edge depends on whether or not the extension is */
|
||||
/* on the same plane as the layer from which it is */
|
||||
|
|
@ -1365,7 +1365,7 @@ drcWidth(argc, argv)
|
|||
* and a type in 'set'.
|
||||
*/
|
||||
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
|
||||
{
|
||||
if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j))
|
||||
{
|
||||
|
|
@ -1468,7 +1468,7 @@ drcArea(argc, argv)
|
|||
* to the right of any edge between a type in '~set'
|
||||
* and a type in 'set'.
|
||||
*/
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
|
||||
{
|
||||
if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j))
|
||||
{
|
||||
|
|
@ -1540,7 +1540,7 @@ drcOffGrid(argc, argv)
|
|||
* to the right of any edge between a type in '~set'
|
||||
* and a type in 'set'.
|
||||
*/
|
||||
if (pset = (DBTypesOnSamePlane(i, j)))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j))))
|
||||
{
|
||||
if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j))
|
||||
{
|
||||
|
|
@ -1673,7 +1673,7 @@ drcMaxwidth(argc, argv)
|
|||
* to the right of any edge between a type in '~set'
|
||||
* and a type in 'set'.
|
||||
*/
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
|
||||
{
|
||||
if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j))
|
||||
{
|
||||
|
|
@ -1769,7 +1769,7 @@ drcAngles(argc, argv)
|
|||
{
|
||||
if (i == j) continue;
|
||||
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
|
||||
{
|
||||
/* Inside corners */
|
||||
if (TTMaskHasType(&set, i) && TTMaskHasType(&set2, j))
|
||||
|
|
@ -1916,7 +1916,7 @@ drcSpacing3(argc, argv)
|
|||
for (j = 0; j < DBNumTypes; j++)
|
||||
{
|
||||
if (i == j) continue;
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
|
||||
{
|
||||
if (TTMaskHasType(&set1, i) && TTMaskHasType(&set3, j))
|
||||
{
|
||||
|
|
@ -2096,7 +2096,7 @@ drcMaskSpacing(set1, set2, pmask1, pmask2, wwidth, distance, adjacency,
|
|||
for (j = 0; j < DBNumTypes; j++)
|
||||
{
|
||||
if (i == j) continue;
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask1))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask1)))
|
||||
{
|
||||
plane = LowestMaskBit(pset);
|
||||
|
||||
|
|
@ -2321,7 +2321,7 @@ drcMaskSpacing(set1, set2, pmask1, pmask2, wwidth, distance, adjacency,
|
|||
|
||||
if (needtrigger) continue;
|
||||
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask1))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask1)))
|
||||
{
|
||||
plane = LowestMaskBit(pset);
|
||||
|
||||
|
|
@ -2710,7 +2710,7 @@ drcEdge(argc, argv)
|
|||
for (j = 0; j < DBNumTypes; j++)
|
||||
{
|
||||
if (i == j) continue;
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pMask1))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pMask1)))
|
||||
{
|
||||
if (TTMaskHasType(&set1, i) && TTMaskHasType(&set2, j))
|
||||
{
|
||||
|
|
@ -2827,7 +2827,7 @@ drcOverhang(argc, argv)
|
|||
for (j = 0; j < DBNumTypes; j++)
|
||||
{
|
||||
if (i == j) continue;
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pMask2))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pMask2)))
|
||||
{
|
||||
if ((pset & pMask1) != 0)
|
||||
{
|
||||
|
|
@ -2941,7 +2941,7 @@ drcRectOnly(argc, argv)
|
|||
{
|
||||
if (i == j) continue;
|
||||
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
|
||||
{
|
||||
if (TTMaskHasType(&set1, i) && TTMaskHasType(&set2, j))
|
||||
{
|
||||
|
|
@ -3094,7 +3094,7 @@ drcSurround(argc, argv)
|
|||
|
||||
if (isDirectional)
|
||||
{
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
|
||||
{
|
||||
/* Directional surround is done entirely differently */
|
||||
|
||||
|
|
@ -3141,7 +3141,7 @@ drcSurround(argc, argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask2))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask2)))
|
||||
{
|
||||
if (TTMaskHasType(&set1, i) && TTMaskHasType(&set2, j))
|
||||
{
|
||||
|
|
@ -3178,7 +3178,7 @@ drcSurround(argc, argv)
|
|||
for (j = 0; j < DBNumTypes; j++)
|
||||
{
|
||||
if (i == j) continue; /* Ignore false edges */
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
|
||||
{
|
||||
if (TTMaskHasType(&setM, i) && TTMaskHasType(&set2, j))
|
||||
{
|
||||
|
|
@ -3212,7 +3212,7 @@ drcSurround(argc, argv)
|
|||
/* Add an extra rule when presence of the surrounding */
|
||||
/* layer is required. Rule is different if planes match. */
|
||||
|
||||
if (pset = pmask & pmask2)
|
||||
if ((pset = pmask & pmask2))
|
||||
{
|
||||
TTMaskZero(&invM);
|
||||
TTMaskSetMask(&invM, &setM);
|
||||
|
|
@ -3224,7 +3224,7 @@ drcSurround(argc, argv)
|
|||
for (j = 0; j < DBNumTypes; j++)
|
||||
{
|
||||
if (i == j) continue;
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask & pmask2))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask & pmask2)))
|
||||
{
|
||||
plane1 = LowestMaskBit(pset);
|
||||
if (TTMaskHasType(&setM, i) && TTMaskHasType(&invM, j))
|
||||
|
|
@ -3258,7 +3258,7 @@ drcSurround(argc, argv)
|
|||
for (j = 0; j < DBNumTypes; j++)
|
||||
{
|
||||
if (i == j) continue;
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pmask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
|
||||
{
|
||||
if (TTMaskHasType(&setM, i) && TTMaskHasType(&invM, j))
|
||||
{
|
||||
|
|
@ -3456,7 +3456,7 @@ drcRectangle(argc, argv)
|
|||
{
|
||||
if (i == j) continue;
|
||||
|
||||
if (pset = (DBTypesOnSamePlane(i, j) & pMask))
|
||||
if ((pset = (DBTypesOnSamePlane(i, j) & pMask)))
|
||||
{
|
||||
if (TTMaskHasType(&types, i) && TTMaskHasType(¬types, j))
|
||||
{
|
||||
|
|
@ -4138,7 +4138,7 @@ DRCTechScale(scalen, scaled)
|
|||
int scalegcf;
|
||||
|
||||
if (DRCCurStyle == NULL) return;
|
||||
else if (scalen == scaled == 1) return;
|
||||
else if (scalen == scaled) return;
|
||||
|
||||
/* Revert DRC rules to original (unscaled) values */
|
||||
drcScaleUp(DRCCurStyle, DRCCurStyle->DRCScaleFactorN);
|
||||
|
|
@ -4362,7 +4362,7 @@ DRCGetDefaultLayerSurround(ttype1, ttype2)
|
|||
cset = &cptr->drcc_corner;
|
||||
if (TTMaskHasType(set, TT_SPACE) && !TTMaskHasType(set, ttype1))
|
||||
if ((TTMaskHasType(cset, ttype2)) &&
|
||||
(cptr->drcc_flags && DRC_BOTHCORNERS) &&
|
||||
(cptr->drcc_flags & DRC_BOTHCORNERS) &&
|
||||
(cptr->drcc_edgeplane == cptr->drcc_plane) &&
|
||||
(cptr->drcc_dist == cptr->drcc_cdist))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h> /* for atof() */
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h> /* for sqrt() in bipolar L,W calculation */
|
||||
|
||||
|
|
@ -534,7 +535,7 @@ runexttosim:
|
|||
|
||||
if (err_result == TRUE)
|
||||
{
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return /* TCL_ERROR */;
|
||||
}
|
||||
|
||||
|
|
@ -548,7 +549,7 @@ runexttosim:
|
|||
if (w == (MagWindow *) NULL)
|
||||
{
|
||||
TxError("Point to a window or specify a cell name.\n");
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return /* TCL_ERROR */;
|
||||
}
|
||||
inName = ((CellUse *) w->w_surfaceID)->cu_def->cd_name;
|
||||
|
|
@ -585,7 +586,7 @@ runexttosim:
|
|||
#else
|
||||
TxError("exttosim: Unable to open file %s for writing\n", simesOutName);
|
||||
#endif
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return /* TCL_ERROR */;
|
||||
}
|
||||
if (!esNoAlias && (esAliasF = fopen(esAliasName, "w")) == NULL)
|
||||
|
|
@ -598,7 +599,7 @@ runexttosim:
|
|||
#else
|
||||
TxError("exttosim: Unable to open file %s for writing\n", esAliasName);
|
||||
#endif
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return /* TCL_ERROR */;
|
||||
}
|
||||
if (!esNoLabel && (esLabF = fopen(esLabelName, "w")) == NULL)
|
||||
|
|
@ -617,7 +618,7 @@ runexttosim:
|
|||
/* Read the hierarchical description of the input circuit */
|
||||
if (EFReadFile(inName, FALSE, esDoSimExtResis, FALSE, FALSE) == FALSE)
|
||||
{
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return /* TCL_ERROR */;
|
||||
}
|
||||
|
||||
|
|
@ -1338,8 +1339,8 @@ FILE *outf;
|
|||
suf = EFHNToStr(suffix);
|
||||
if (fetInfo[type].defSubs && strcasecmp(suf,fetInfo[type].defSubs) == 0) {
|
||||
l = strlen(suf) - 1;
|
||||
if ( ( EFOutputFlags & EF_TRIMGLOB ) && suf[l] =='!' ||
|
||||
( EFOutputFlags & EF_TRIMLOCAL ) && suf[l] == '#' )
|
||||
if ( (( EFOutputFlags & EF_TRIMGLOB ) && suf[l] =='!') ||
|
||||
(( EFOutputFlags & EF_TRIMLOCAL ) && suf[l] == '#') )
|
||||
suf[l] = '\0' ;
|
||||
if ( esFormat == SU )
|
||||
fprintf(outf, "S_");
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ char *s;
|
|||
return p;
|
||||
}
|
||||
|
||||
int parseAttr(str, a, p)
|
||||
void parseAttr(str, a, p)
|
||||
char *str;
|
||||
int *a, *p;
|
||||
{
|
||||
|
|
|
|||
|
|
@ -167,13 +167,13 @@ spcHierWriteParams(hc, dev, scale, l, w, sdM)
|
|||
fprintf(esSpiceF, " %s=", plist->parm_name);
|
||||
parmval = dev->dev_area;
|
||||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", parmval * scale * scale);
|
||||
fprintf(esSpiceF, "%g", (double)parmval * scale * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", parmval * scale * scale
|
||||
fprintf(esSpiceF, "%g", (double)parmval * scale * scale
|
||||
* esScale * esScale * plist->parm_scale
|
||||
* 1E-12);
|
||||
else
|
||||
esSIvalue(esSpiceF, 1.0E-12 * (parmval + plist->parm_offset)
|
||||
esSIvalue(esSpiceF, 1.0E-12 * ((double)parmval + plist->parm_offset)
|
||||
* scale * scale * esScale * esScale);
|
||||
}
|
||||
else
|
||||
|
|
@ -217,11 +217,11 @@ spcHierWriteParams(hc, dev, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", parmval * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", parmval * scale
|
||||
* esScale * plist->parm_scale * 1E-6);
|
||||
fprintf(esSpiceF, "%g", (double)parmval * (double)scale
|
||||
* (double)esScale * (double)plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, (parmval + plist->parm_offset)
|
||||
* scale * esScale * 1.0E-6);
|
||||
esSIvalue(esSpiceF, ((double)parmval + (double)plist->parm_offset)
|
||||
* (double)scale * (double)esScale * 1.0E-6);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -262,7 +262,7 @@ spcHierWriteParams(hc, dev, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", l * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", l * scale * esScale
|
||||
fprintf(esSpiceF, "%g", (double)l * scale * esScale
|
||||
* plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, 1.0E-6 * (l + plist->parm_offset)
|
||||
|
|
@ -286,7 +286,7 @@ spcHierWriteParams(hc, dev, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", dval * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", dval * scale * esScale
|
||||
fprintf(esSpiceF, "%g", (double)dval * scale * esScale
|
||||
* plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, (dval + plist->parm_offset)
|
||||
|
|
@ -304,7 +304,7 @@ spcHierWriteParams(hc, dev, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", w * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", w * scale * esScale
|
||||
fprintf(esSpiceF, "%g", (double)w * scale * esScale
|
||||
* plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, 1.0E-6 * (w + plist->parm_offset)
|
||||
|
|
@ -321,8 +321,8 @@ spcHierWriteParams(hc, dev, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", dev->dev_rect.r_xbot * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", dev->dev_rect.r_xbot * scale
|
||||
* esScale * plist->parm_scale * 1E-6);
|
||||
fprintf(esSpiceF, "%g", (double)dev->dev_rect.r_xbot * (double)scale
|
||||
* (double)esScale * (double)plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, (dev->dev_rect.r_xbot + plist->parm_offset)
|
||||
* scale * esScale * 1.0E-6);
|
||||
|
|
@ -332,8 +332,8 @@ spcHierWriteParams(hc, dev, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", dev->dev_rect.r_ybot * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", dev->dev_rect.r_ybot * scale
|
||||
* esScale * plist->parm_scale * 1E-6);
|
||||
fprintf(esSpiceF, "%g", (double)dev->dev_rect.r_ybot * (double)scale
|
||||
* (double)esScale * (double)plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, (dev->dev_rect.r_ybot + plist->parm_offset)
|
||||
* scale * esScale * 1.0E-6);
|
||||
|
|
@ -1409,7 +1409,7 @@ spcnodeHierVisit(hc, node, res, cap)
|
|||
hierName = (HierName *) node->efnode_name->efnn_hier;
|
||||
nsn = nodeSpiceHierName(hc, hierName);
|
||||
|
||||
if (esFormat == SPICE2 || esFormat == HSPICE && !strncmp(nsn, "z@", 2)) {
|
||||
if (esFormat == SPICE2 || (esFormat == HSPICE && !strncmp(nsn, "z@", 2))) {
|
||||
static char ntmp[MAX_STR_SIZE];
|
||||
|
||||
EFHNSprintf(ntmp, hierName);
|
||||
|
|
@ -1816,8 +1816,8 @@ esMakePorts(hc, cdata)
|
|||
/* matches a use. If not, then check if the part */
|
||||
/* the last opening bracket matches a known use. */
|
||||
|
||||
aptr = strrchr(portname, '[');
|
||||
*tptr = '\0';
|
||||
aptr = strrchr(portname, '[');
|
||||
is_array = FALSE;
|
||||
if (aptr != NULL)
|
||||
{
|
||||
|
|
@ -1874,11 +1874,13 @@ esMakePorts(hc, cdata)
|
|||
{
|
||||
nn->efnn_node->efnode_flags |= EF_PORT;
|
||||
nn->efnn_port = -1; // Will be sorted later
|
||||
}
|
||||
|
||||
// Diagnostic
|
||||
// TxPrintf("Port connection in %s from net %s to net %s (%s)\n",
|
||||
// def->def_name, locname, name, portname);
|
||||
// Diagnostic
|
||||
/* TxPrintf("Port connection in %s from net %s to "
|
||||
* "net %s (%s)\n",
|
||||
* def->def_name, locname, name, portname);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
/* Propagate the EF_SUBS_PORT flag */
|
||||
|
|
|
|||
|
|
@ -17,8 +17,10 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
|||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h> /* for atof() */
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h> /* for fabs() */
|
||||
|
||||
|
|
@ -168,8 +170,8 @@ esFormatSubs(outf, suf)
|
|||
if (outf)
|
||||
{
|
||||
l = strlen(suf) - 1;
|
||||
if ((EFOutputFlags & EF_TRIMGLOB ) && suf[l] == '!' ||
|
||||
(EFOutputFlags & EF_TRIMLOCAL) && suf[l] == '#')
|
||||
if (((EFOutputFlags & EF_TRIMGLOB ) && suf[l] == '!') ||
|
||||
((EFOutputFlags & EF_TRIMLOCAL) && suf[l] == '#'))
|
||||
suf[l] = '\0' ;
|
||||
if (EFOutputFlags & EF_CONVERTCOMMA)
|
||||
while ((specchar = strchr(suf, ',')) != NULL)
|
||||
|
|
@ -840,7 +842,7 @@ runexttospice:
|
|||
inName = EFArgs(argc, argv, &err_result, spcParseArgs, (ClientData) NULL);
|
||||
if (err_result == TRUE)
|
||||
{
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -878,7 +880,7 @@ runexttospice:
|
|||
if (EFReadFile(inName, esDoHierarchy, esDoExtResis, FALSE, TRUE)
|
||||
== FALSE)
|
||||
{
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -894,7 +896,7 @@ runexttospice:
|
|||
#else
|
||||
TxError("exttospice: Unable to open file %s for writing\n", spcesOutName);
|
||||
#endif
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1587,7 +1589,7 @@ subcktVisit(use, hierName, is_top)
|
|||
/* generated during topVisit(). */
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&def->def_nodes, &hs))
|
||||
while ((he = HashNext(&def->def_nodes, &hs)))
|
||||
{
|
||||
sname = (EFNodeName *) HashGetValue(he);
|
||||
if (sname == NULL) continue;
|
||||
|
|
@ -1618,7 +1620,7 @@ subcktVisit(use, hierName, is_top)
|
|||
nodeList[portidx] = (EFNodeName *)NULL;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&def->def_nodes, &hs))
|
||||
while ((he = HashNext(&def->def_nodes, &hs)))
|
||||
{
|
||||
sname = (EFNodeName *) HashGetValue(he);
|
||||
if (sname == NULL) continue;
|
||||
|
|
@ -1809,13 +1811,16 @@ topVisit(def, doStub)
|
|||
HashStartSearch(&hs);
|
||||
portmax = -1;
|
||||
|
||||
while (he = HashNext(&def->def_nodes, &hs))
|
||||
while ((he = HashNext(&def->def_nodes, &hs)))
|
||||
{
|
||||
sname = (EFNodeName *) HashGetValue(he);
|
||||
if (sname == NULL) continue;
|
||||
snode = sname->efnn_node;
|
||||
if ((!snode) || (!(snode->efnode_flags & EF_PORT))) continue;
|
||||
explicit = FALSE;
|
||||
portorder = snode->efnode_name->efnn_port;
|
||||
if (portorder > portmax) portmax = portorder;
|
||||
if (portorder != -1) explicit = TRUE;
|
||||
for (nodeName = sname; nodeName != NULL; nodeName = nodeName->efnn_next)
|
||||
{
|
||||
portorder = nodeName->efnn_port;
|
||||
|
|
@ -1855,7 +1860,7 @@ topVisit(def, doStub)
|
|||
sorted_ports[portorder] = NULL;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&def->def_nodes, &hs))
|
||||
while ((he = HashNext(&def->def_nodes, &hs)))
|
||||
{
|
||||
char stmp[MAX_STR_SIZE];
|
||||
int portidx;
|
||||
|
|
@ -2007,8 +2012,8 @@ spcWriteParams(dev, hierName, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", parmval * scale * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", parmval * scale * scale
|
||||
* esScale * esScale * plist->parm_scale
|
||||
fprintf(esSpiceF, "%g", (double)parmval * (double)scale * (double)scale
|
||||
* (double)esScale * (double)esScale * plist->parm_scale
|
||||
* 1E-12);
|
||||
else
|
||||
esSIvalue(esSpiceF, 1.0E-12 * (parmval + plist->parm_offset)
|
||||
|
|
@ -2074,7 +2079,7 @@ spcWriteParams(dev, hierName, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", parmval * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", parmval * scale
|
||||
fprintf(esSpiceF, "%g", (double)parmval * scale
|
||||
* esScale * plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, 1.0E-12 * (parmval + plist->parm_offset)
|
||||
|
|
@ -2138,7 +2143,7 @@ spcWriteParams(dev, hierName, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", l * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", l * scale * esScale
|
||||
fprintf(esSpiceF, "%g", (double)l * scale * esScale
|
||||
* plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, 1.0E-6 * (l + plist->parm_offset)
|
||||
|
|
@ -2162,7 +2167,7 @@ spcWriteParams(dev, hierName, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", dval * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", dval * scale * esScale
|
||||
fprintf(esSpiceF, "%g", (double)dval * scale * esScale
|
||||
* plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, (dval + plist->parm_offset)
|
||||
|
|
@ -2180,7 +2185,7 @@ spcWriteParams(dev, hierName, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", w * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", w * scale * esScale
|
||||
fprintf(esSpiceF, "%g", (double)w * scale * esScale
|
||||
* plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, 1.0E-6 * (w + plist->parm_offset)
|
||||
|
|
@ -2197,7 +2202,7 @@ spcWriteParams(dev, hierName, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", dev->dev_rect.r_xbot * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", dev->dev_rect.r_xbot * scale
|
||||
fprintf(esSpiceF, "%g", (double)dev->dev_rect.r_xbot * scale
|
||||
* esScale * plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, (dev->dev_rect.r_xbot + plist->parm_offset)
|
||||
|
|
@ -2208,8 +2213,8 @@ spcWriteParams(dev, hierName, scale, l, w, sdM)
|
|||
if (esScale < 0)
|
||||
fprintf(esSpiceF, "%g", dev->dev_rect.r_ybot * scale);
|
||||
else if (plist->parm_scale != 1.0)
|
||||
fprintf(esSpiceF, "%g", dev->dev_rect.r_ybot * scale
|
||||
* esScale * plist->parm_scale * 1E-6);
|
||||
fprintf(esSpiceF, "%g", (double)dev->dev_rect.r_ybot * (double)scale
|
||||
* (double)esScale * plist->parm_scale * 1E-6);
|
||||
else
|
||||
esSIvalue(esSpiceF, (dev->dev_rect.r_ybot + plist->parm_offset)
|
||||
* scale * esScale * 1.0E-6);
|
||||
|
|
@ -3648,7 +3653,7 @@ spcnodeVisit(node, res, cap)
|
|||
hierName = (HierName *) node->efnode_name->efnn_hier;
|
||||
nsn = nodeSpiceName(hierName, NULL);
|
||||
|
||||
if (esFormat == SPICE2 || esFormat == HSPICE && strncmp(nsn, "z@", 2)==0 ) {
|
||||
if (esFormat == SPICE2 || (esFormat == HSPICE && strncmp(nsn, "z@", 2)==0 )) {
|
||||
static char ntmp[MAX_STR_SIZE];
|
||||
|
||||
EFHNSprintf(ntmp, hierName);
|
||||
|
|
@ -3696,7 +3701,7 @@ nodeVisitDebug(node, res, cap)
|
|||
|
||||
hierName = (HierName *) node->efnode_name->efnn_hier;
|
||||
nsn = nodeSpiceName(hierName, NULL);
|
||||
TxError("** %s (%x)\n", nsn, node);
|
||||
TxError("** %s (%lx)\n", nsn, (intmax_t) node);
|
||||
|
||||
printf("\t client.name=%s, client.m_w=%p\n",
|
||||
((nodeClient *)node->efnode_client)->spiceNodeName,
|
||||
|
|
@ -3801,7 +3806,7 @@ EFHNSprintf(str, hierName)
|
|||
convertComma = (EFOutputFlags & EF_CONVERTCOMMA);
|
||||
convertEqual = (EFOutputFlags & EF_CONVERTEQUAL);
|
||||
convertBrackets = (EFOutputFlags & EF_CONVERTBRACKETS);
|
||||
while (c = *cp++)
|
||||
while ((c = *cp++))
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ main(argc, argv)
|
|||
|
||||
#ifdef free_all_mem
|
||||
EFFlatDone(NULL);
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
#endif /* free_all_mem */
|
||||
|
||||
printf("Memory used: %s\n", RunStats(RS_MEM, NULL, NULL));
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ runantennacheck:
|
|||
|
||||
if (err_result == TRUE)
|
||||
{
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return /* TCL_ERROR */;
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ runantennacheck:
|
|||
if (w == (MagWindow *) NULL)
|
||||
{
|
||||
TxError("Point to a window or specify a cell name.\n");
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return /* TCL_ERROR */;
|
||||
}
|
||||
inName = ((CellUse *) w->w_surfaceID)->cu_def->cd_name;
|
||||
|
|
@ -226,7 +226,7 @@ runantennacheck:
|
|||
TxPrintf("Reading extract file.\n");
|
||||
if (EFReadFile(inName, FALSE, FALSE, FALSE, FALSE) == FALSE)
|
||||
{
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
return /* TCL_ERROR */;
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +257,7 @@ runantennacheck:
|
|||
TxPrintf("Running antenna checks.\n");
|
||||
EFVisitDevs(antennacheckVisit, (ClientData)editUse);
|
||||
EFFlatDone(NULL);
|
||||
EFDone();
|
||||
EFDone(NULL);
|
||||
|
||||
TxPrintf("antennacheck finished.\n");
|
||||
freeMagic(EFDeviceTypes);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header$";
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h> /* for atof() */
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "utils/magic.h"
|
||||
#include "utils/geometry.h"
|
||||
|
|
@ -463,7 +464,7 @@ efBuildDist(def, driver, receiver, min, max)
|
|||
#endif /* notdef */
|
||||
|
||||
he = HashFind(&def->def_dists, (char *) &distKey);
|
||||
if (dist = (Distance *) HashGetValue(he))
|
||||
if ((dist = (Distance *) HashGetValue(he)))
|
||||
{
|
||||
/*
|
||||
* There was already an entry in the table; update it
|
||||
|
|
@ -659,7 +660,7 @@ efBuildEquiv(def, nodeName1, nodeName2, resist, isspice)
|
|||
* node that was just removed.
|
||||
*/
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&def->def_devs, &hs))
|
||||
while ((he = HashNext(&def->def_devs, &hs)))
|
||||
{
|
||||
Dev *dev;
|
||||
int n;
|
||||
|
|
@ -679,7 +680,7 @@ efBuildEquiv(def, nodeName1, nodeName2, resist, isspice)
|
|||
{
|
||||
nn2->efnn_refc += nn1->efnn_refc + 1;
|
||||
HashStartSearch(&hs);
|
||||
while (he1 = HashNext(&def->def_nodes, &hs))
|
||||
while ((he1 = HashNext(&def->def_nodes, &hs)))
|
||||
if ((EFNodeName *)HashGetValue(he1) == nn1)
|
||||
HashSetValue(he1, (char *)nn2);
|
||||
}
|
||||
|
|
@ -687,7 +688,7 @@ efBuildEquiv(def, nodeName1, nodeName2, resist, isspice)
|
|||
{
|
||||
nn1->efnn_refc += nn2->efnn_refc + 1;
|
||||
HashStartSearch(&hs);
|
||||
while (he2 = HashNext(&def->def_nodes, &hs))
|
||||
while ((he2 = HashNext(&def->def_nodes, &hs)))
|
||||
if ((EFNodeName *)HashGetValue(he2) == nn2)
|
||||
HashSetValue(he2, (char *)nn1);
|
||||
}
|
||||
|
|
@ -1045,7 +1046,7 @@ efBuildDevice(def, class, type, r, argc, argv)
|
|||
&& (ttype != extGetDevType(EFDevTypes[newdev->dev_type]))))
|
||||
{
|
||||
TxError("Device %s %s at (%d, %d) overlaps incompatible device %s %s!\n",
|
||||
extDevTable[class], type, r->r_xbot, r->r_ybot,
|
||||
extDevTable[(unsigned char)class], type, r->r_xbot, r->r_ybot,
|
||||
extDevTable[newdev->dev_class], EFDevTypes[newdev->dev_type]);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1053,7 +1054,7 @@ efBuildDevice(def, class, type, r, argc, argv)
|
|||
{
|
||||
TxError("Device %s %s at (%d, %d) overlaps device with incompatible"
|
||||
" number of terminals (%d vs. %d)!\n",
|
||||
extDevTable[class], type, r->r_xbot, r->r_ybot, nterminals,
|
||||
extDevTable[(unsigned char)class], type, r->r_xbot, r->r_ybot, nterminals,
|
||||
newdev->dev_nterm);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1757,7 +1758,7 @@ again:
|
|||
*dstp++ = ']';
|
||||
|
||||
/* Copy remainder of path */
|
||||
while (*dstp++ = *cp++)
|
||||
while ((*dstp++ = *cp++))
|
||||
/* Nothing */;
|
||||
|
||||
cnp->cn_name = StrDup((char **) NULL, newname);
|
||||
|
|
@ -1970,7 +1971,7 @@ efNodeMerge(node1ptr, node2ptr)
|
|||
keeping->efnode_num += removing->efnode_num;
|
||||
|
||||
/* Merge attribute lists */
|
||||
if (ap = removing->efnode_attrs)
|
||||
if ((ap = removing->efnode_attrs))
|
||||
{
|
||||
while (ap->efa_next)
|
||||
ap = ap->efa_next;
|
||||
|
|
@ -2059,8 +2060,8 @@ efFreeUseTable(table)
|
|||
EFNodeName *nn;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(table, &hs))
|
||||
if (use = (Use *) HashGetValue(he))
|
||||
while ((he = HashNext(table, &hs)))
|
||||
if ((use = (Use *) HashGetValue(he)))
|
||||
{
|
||||
if (use->use_id != NULL) freeMagic((char *)use->use_id);
|
||||
freeMagic(use);
|
||||
|
|
@ -2088,7 +2089,7 @@ efFreeDevTable(table)
|
|||
int n;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(table, &hs))
|
||||
while ((he = HashNext(table, &hs)))
|
||||
{
|
||||
dev = (Dev *)HashGetValue(he);
|
||||
for (n = 0; n < (int)dev->dev_nterm; n++)
|
||||
|
|
@ -2131,8 +2132,8 @@ efFreeNodeTable(table)
|
|||
EFNodeName *nn;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(table, &hs))
|
||||
if (nn = (EFNodeName *) HashGetValue(he))
|
||||
while ((he = HashNext(table, &hs)))
|
||||
if ((nn = (EFNodeName *) HashGetValue(he)))
|
||||
{
|
||||
for (hn = nn->efnn_hier; hn; hn = hn->hn_parent)
|
||||
(void) HashFind(&efFreeHashTable, (char *) hn);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ EFDone(func)
|
|||
int n;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&efDefHashTable, &hs))
|
||||
while ((he = HashNext(&efDefHashTable, &hs)))
|
||||
{
|
||||
def = (Def *) HashGetValue(he);
|
||||
freeMagic(def->def_name);
|
||||
|
|
@ -151,7 +151,7 @@ EFDone(func)
|
|||
/* Free up the parameter name tables for each device */
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&efDevParamTable, &hs))
|
||||
while ((he = HashNext(&efDevParamTable, &hs)))
|
||||
{
|
||||
DevParam *plist = (DevParam *)HashGetValue(he);
|
||||
while (plist != NULL)
|
||||
|
|
@ -164,7 +164,7 @@ EFDone(func)
|
|||
HashKill(&efDevParamTable);
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&efFreeHashTable, &hs))
|
||||
while ((he = HashNext(&efFreeHashTable, &hs)))
|
||||
{
|
||||
/* Keys of this table are entries to be free'd */
|
||||
freeMagic(he->h_key.h_ptr);
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ efAddNodes(hc, stdcell)
|
|||
* The name should only have been in the hash table already
|
||||
* if the node was marked with EF_DEVTERM as described above.
|
||||
*/
|
||||
if (oldname = (EFNodeName *) HashGetValue(he))
|
||||
if ((oldname = (EFNodeName *) HashGetValue(he)))
|
||||
{
|
||||
if (hierName != nn->efnn_hier)
|
||||
EFHNFree(hierName, hc->hc_hierName, HN_CONCAT);
|
||||
|
|
@ -795,7 +795,7 @@ efFlatGlob()
|
|||
* also adding it to the global hash table efNodeHashTable.
|
||||
*/
|
||||
HashStartSearch(&hs);
|
||||
while (heGlob = HashNext(&globalTable, &hs))
|
||||
while ((heGlob = HashNext(&globalTable, &hs)))
|
||||
{
|
||||
/*
|
||||
* Add the name to the flat node name hash table, and
|
||||
|
|
@ -927,7 +927,7 @@ efFlatKills(hc)
|
|||
/* Process all of our kill information */
|
||||
for (k = def->def_kills; k; k = k->kill_next)
|
||||
{
|
||||
if (he = EFHNConcatLook(hc->hc_hierName, k->kill_name, "kill"))
|
||||
if ((he = EFHNConcatLook(hc->hc_hierName, k->kill_name, "kill")))
|
||||
{
|
||||
nn = (EFNodeName *) HashGetValue(he);
|
||||
nn->efnn_node->efnode_flags |= EF_KILLED;
|
||||
|
|
@ -1149,12 +1149,12 @@ efFlatDists(hc)
|
|||
|
||||
/* Process our own distances */
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&hc->hc_use->use_def->def_dists, &hs))
|
||||
while ((he = HashNext(&hc->hc_use->use_def->def_dists, &hs)))
|
||||
{
|
||||
dist = (Distance *) HashGetValue(he);
|
||||
efHNBuildDistKey(hc->hc_hierName, dist, &distKey);
|
||||
heFlat = HashFind(&efDistHashTable, (char *) &distKey);
|
||||
if (distFlat = (Distance *) HashGetValue(heFlat))
|
||||
if ((distFlat = (Distance *) HashGetValue(heFlat)))
|
||||
{
|
||||
/*
|
||||
* This code differs from that in efBuildDist(), in that
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ efHierSrUses(hc, func, cdata)
|
|||
HashEntry *he;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&hc->hc_use->use_def->def_uses, &hs))
|
||||
while ((he = HashNext(&hc->hc_use->use_def->def_uses, &hs)))
|
||||
{
|
||||
u = (Use *)HashGetValue(he);
|
||||
newhc.hc_use = u;
|
||||
|
|
@ -258,7 +258,7 @@ EFHierSrDefs(hc, func, cdata)
|
|||
}
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&hc->hc_use->use_def->def_uses, &hs))
|
||||
while ((he = HashNext(&hc->hc_use->use_def->def_uses, &hs)))
|
||||
{
|
||||
u = (Use *)HashGetValue(he);
|
||||
newhc.hc_use = u;
|
||||
|
|
@ -486,7 +486,7 @@ efHierVisitDevs(hc, ca)
|
|||
|
||||
/* Visit all devices */
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&def->def_devs, &hs))
|
||||
while ((he = HashNext(&def->def_devs, &hs)))
|
||||
{
|
||||
dev = (Dev *)HashGetValue(he);
|
||||
if (efHierDevKilled(hc, dev, hc->hc_hierName))
|
||||
|
|
@ -679,7 +679,7 @@ EFHierVisitCaps(hc, capProc, cdata)
|
|||
/* efCapHashTable using efFlatCaps(). */
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&efCapHashTable, &hs))
|
||||
while ((he = HashNext(&efCapHashTable, &hs)))
|
||||
{
|
||||
ccap = CapHashGetValue(he);
|
||||
ck = (EFCoupleKey *) he->h_key.h_words;
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ efHNToStrFunc(hierName, dstp)
|
|||
}
|
||||
|
||||
srcp = hierName->hn_name;
|
||||
while (*dstp++ = *srcp++)
|
||||
while ((*dstp++ = *srcp++))
|
||||
/* Nothing */;
|
||||
|
||||
return --dstp;
|
||||
|
|
@ -581,7 +581,7 @@ efHNLexOrder(hierName1, hierName2)
|
|||
return 0;
|
||||
|
||||
if (hierName1->hn_parent)
|
||||
if (i = efHNLexOrder(hierName1->hn_parent, hierName2->hn_parent))
|
||||
if ((i = efHNLexOrder(hierName1->hn_parent, hierName2->hn_parent)))
|
||||
return i;
|
||||
|
||||
return strcmp(hierName1->hn_name, hierName2->hn_name);
|
||||
|
|
@ -629,7 +629,7 @@ efHNFromUse(hc, prefix)
|
|||
namePtr = name;
|
||||
srcp = u->use_id;
|
||||
dstp = name;
|
||||
while (*dstp++ = *srcp++)
|
||||
while ((*dstp++ = *srcp++))
|
||||
/* Nothing */;
|
||||
|
||||
/* Array subscript */
|
||||
|
|
@ -762,7 +762,7 @@ efHNInit(hierName, cp, endp)
|
|||
}
|
||||
else
|
||||
{
|
||||
while (*dstp++ = *cp)
|
||||
while ((*dstp++ = *cp))
|
||||
hashsum = HASHADDVAL(hashsum, *cp++);
|
||||
}
|
||||
|
||||
|
|
@ -974,7 +974,7 @@ efHNDump()
|
|||
}
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&efNodeHashTable, &hs))
|
||||
while ((he = HashNext(&efNodeHashTable, &hs)))
|
||||
fprintf(f, "%s\n", EFHNToStr((HierName *) he->h_key.h_ptr));
|
||||
|
||||
(void) fclose(f);
|
||||
|
|
|
|||
|
|
@ -71,32 +71,32 @@ static struct
|
|||
}
|
||||
keyTable[] =
|
||||
{
|
||||
"abstract", ABSTRACT, 0, /* defines a LEF-like view */
|
||||
"adjust", ADJUST, 4,
|
||||
"attr", ATTR, 8,
|
||||
"cap", CAP, 4,
|
||||
"device", DEVICE, 11, /* effectively replaces "fet" */
|
||||
"distance", DIST, 4,
|
||||
"equiv", EQUIV, 3,
|
||||
"fet", FET, 12, /* for backwards compatibility */
|
||||
"killnode", KILLNODE, 2,
|
||||
"merge", MERGE, 3,
|
||||
"node", NODE, 7,
|
||||
"parameters", PARAMETERS, 3,
|
||||
"port", PORT, 8,
|
||||
"primitive", PRIMITIVE, 0, /* defines a primitive device */
|
||||
"resist", RESISTOR, 4,
|
||||
"resistclasses", RESISTCLASS, 1,
|
||||
"rnode", RNODE, 5,
|
||||
"scale", SCALE, 4,
|
||||
"subcap", SUBCAP, 3,
|
||||
"substrate", SUBSTRATE, 3,
|
||||
"tech", TECH, 2,
|
||||
"timestamp", TIMESTAMP, 2,
|
||||
"use", USE, 9,
|
||||
"version", VERSION, 2,
|
||||
"style", EXT_STYLE, 2,
|
||||
0
|
||||
{"abstract", ABSTRACT, 0}, /* defines a LEF-like view */
|
||||
{"adjust", ADJUST, 4},
|
||||
{"attr", ATTR, 8},
|
||||
{"cap", CAP, 4},
|
||||
{"device", DEVICE, 11}, /* effectively replaces "fet" */
|
||||
{"distance", DIST, 4},
|
||||
{"equiv", EQUIV, 3},
|
||||
{"fet", FET, 12}, /* for backwards compatibility */
|
||||
{"killnode", KILLNODE, 2},
|
||||
{"merge", MERGE, 3},
|
||||
{"node", NODE, 7},
|
||||
{"parameters", PARAMETERS, 3},
|
||||
{"port", PORT, 8},
|
||||
{"primitive", PRIMITIVE, 0}, /* defines a primitive device */
|
||||
{"resist", RESISTOR, 4},
|
||||
{"resistclasses", RESISTCLASS, 1},
|
||||
{"rnode", RNODE, 5},
|
||||
{"scale", SCALE, 4},
|
||||
{"subcap", SUBCAP, 3},
|
||||
{"substrate", SUBSTRATE, 3},
|
||||
{"tech", TECH, 2},
|
||||
{"timestamp", TIMESTAMP, 2},
|
||||
{"use", USE, 9},
|
||||
{"version", VERSION, 2},
|
||||
{"style", EXT_STYLE, 2},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* Data shared with EFerror.c */
|
||||
|
|
@ -670,7 +670,7 @@ resistChanged:
|
|||
/* Read in each def that has not yet been read in */
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&def->def_uses, &hs))
|
||||
while ((he = HashNext(&def->def_uses, &hs)))
|
||||
{
|
||||
use = (Use *)HashGetValue(he);
|
||||
if ((use->use_def->def_flags & DEF_AVAILABLE) == 0)
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ efSymAddFile(name)
|
|||
|
||||
for (lineNum = 1; fgets(line, sizeof line, f); lineNum++)
|
||||
{
|
||||
if (cp = strchr(line, '\n'))
|
||||
if ((cp = strchr(line, '\n')))
|
||||
*cp = '\0';
|
||||
if (!efSymAdd(line))
|
||||
TxError("Error at line %d of %s\n", lineNum, name);
|
||||
|
|
@ -161,7 +161,7 @@ efSymAdd(str)
|
|||
}
|
||||
|
||||
value[-1] = '\0';
|
||||
if (he = HashLookOnly(&efSymHash, str))
|
||||
if ((he = HashLookOnly(&efSymHash, str)))
|
||||
{
|
||||
TxError("Symbol \"%s\" already defined\n", str);
|
||||
value[-1] = '=';
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ efVisitDevs(hc, ca)
|
|||
/* Visit our own devices */
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&def->def_devs, &hs))
|
||||
while ((he = HashNext(&def->def_devs, &hs)))
|
||||
{
|
||||
dev = (Dev *)HashGetValue(he);
|
||||
if (efDevKilled(dev, hc->hc_hierName))
|
||||
|
|
@ -624,7 +624,7 @@ EFVisitCaps(capProc, cdata)
|
|||
EFCapValue cap;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&efCapHashTable, &hs))
|
||||
while ((he = HashNext(&efCapHashTable, &hs)))
|
||||
{
|
||||
cap = CapHashGetValue(he);
|
||||
ck = (EFCoupleKey *) he->h_key.h_words;
|
||||
|
|
@ -789,7 +789,7 @@ EFNodeResist(node)
|
|||
if (v < 0.0) s = 0.0; else s = sqrt(v);
|
||||
|
||||
fperim = (float) perim;
|
||||
dresist = (fperim + s)/(fperim - s) * efResists[n];
|
||||
dresist = ((double)fperim + (double)s)/((double)fperim - (double)s) * efResists[n];
|
||||
if (dresist + (double) resist > (double) INT_MAX)
|
||||
resist = INT_MAX;
|
||||
else
|
||||
|
|
@ -878,7 +878,7 @@ EFHNOut(hierName, outf)
|
|||
trimLocal = (EFOutputFlags & EF_TRIMLOCAL);
|
||||
convComma = (EFOutputFlags & EF_CONVERTCOMMA);
|
||||
convBrackets = (EFOutputFlags & EF_CONVERTBRACKETS);
|
||||
while (c = *cp++)
|
||||
while ((c = *cp++))
|
||||
{
|
||||
if (*cp)
|
||||
{
|
||||
|
|
@ -894,9 +894,16 @@ EFHNOut(hierName, outf)
|
|||
}
|
||||
else switch (c)
|
||||
{
|
||||
case '!': if (!trimGlob) (void) putc(c, outf); break;
|
||||
case '#': if (trimLocal) break;
|
||||
default: (void) putc(c, outf); break;
|
||||
case '!':
|
||||
if (!trimGlob)
|
||||
(void) putc(c, outf);
|
||||
break;
|
||||
case '#':
|
||||
if (trimLocal)
|
||||
break;
|
||||
default:
|
||||
(void) putc(c, outf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -914,7 +921,7 @@ efHNOutPrefix(hierName, outf)
|
|||
efHNOutPrefix(hierName->hn_parent, outf);
|
||||
|
||||
cp = hierName->hn_name;
|
||||
while (c = *cp++)
|
||||
while ((c = *cp++))
|
||||
putc(c, outf);
|
||||
putc('/', outf);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -690,7 +690,7 @@ extArrayAdjust(ha, et1, et2)
|
|||
extHierAdjustments(ha, &ha->ha_cumFlat, et2, et2);
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&ha->ha_cumFlat.et_coupleHash, &hs))
|
||||
while ((he = HashNext(&ha->ha_cumFlat.et_coupleHash, &hs)))
|
||||
{
|
||||
cap = extGetCapValue(he) / ExtCurStyle->exts_capScale;
|
||||
if (cap == 0)
|
||||
|
|
@ -797,7 +797,7 @@ extArrayTileToNode(tp, pNum, et, ha, doHard)
|
|||
}
|
||||
|
||||
if (!DebugIsSet(extDebugID, extDebNoHard))
|
||||
if (reg = (LabRegion *) extArrayHardNode(tp, pNum, def, ha))
|
||||
if ((reg = (LabRegion *) extArrayHardNode(tp, pNum, def, ha)))
|
||||
goto found;
|
||||
|
||||
/* Blew it */
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ extBasic(def, outFile)
|
|||
if (propfound)
|
||||
{
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &llx))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &llx) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
llx *= ExtCurStyle->exts_unitsPerLambda;
|
||||
|
|
@ -397,7 +397,7 @@ extBasic(def, outFile)
|
|||
if (propfound)
|
||||
{
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &lly))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &lly) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
lly *= ExtCurStyle->exts_unitsPerLambda;
|
||||
|
|
@ -405,20 +405,24 @@ extBasic(def, outFile)
|
|||
if (propfound)
|
||||
{
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &urx))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &urx) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
{
|
||||
urx *= ExtCurStyle->exts_unitsPerLambda;
|
||||
if (urx <= llx) urx++;
|
||||
if (urx <= llx) urx++;
|
||||
}
|
||||
}
|
||||
if (propfound)
|
||||
{
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &ury))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &ury) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
{
|
||||
ury *= ExtCurStyle->exts_unitsPerLambda;
|
||||
if (ury <= lly) ury++;
|
||||
if (ury <= lly) ury++;
|
||||
}
|
||||
}
|
||||
if (propfound)
|
||||
{
|
||||
|
|
@ -427,14 +431,14 @@ extBasic(def, outFile)
|
|||
case DEV_FET:
|
||||
/* Read area */
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &w))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &w) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
w *= ExtCurStyle->exts_unitsPerLambda *
|
||||
ExtCurStyle->exts_unitsPerLambda;
|
||||
/* Read perimeter */
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &l))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &l) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
l *= ExtCurStyle->exts_unitsPerLambda;
|
||||
|
|
@ -444,13 +448,13 @@ extBasic(def, outFile)
|
|||
case DEV_BJT:
|
||||
/* Read width */
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &w))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &w) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
w *= ExtCurStyle->exts_unitsPerLambda;
|
||||
/* Read length */
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &l))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &l) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
l *= ExtCurStyle->exts_unitsPerLambda;
|
||||
|
|
@ -460,13 +464,13 @@ extBasic(def, outFile)
|
|||
{
|
||||
/* Read width */
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &w))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &w) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
w *= ExtCurStyle->exts_unitsPerLambda;
|
||||
/* Read length */
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &l))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &l) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
l *= ExtCurStyle->exts_unitsPerLambda;
|
||||
|
|
@ -479,14 +483,14 @@ extBasic(def, outFile)
|
|||
{
|
||||
/* Read area */
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &w))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &w) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
w *= ExtCurStyle->exts_unitsPerLambda *
|
||||
ExtCurStyle->exts_unitsPerLambda;
|
||||
/* Read perimeter */
|
||||
token = strtok(NULL, " ");
|
||||
if ((token == NULL) || !sscanf(token, "%d", &l))
|
||||
if ((token == NULL) || (sscanf(token, "%d", &l) != 1))
|
||||
propfound = FALSE;
|
||||
else
|
||||
l *= ExtCurStyle->exts_unitsPerLambda;
|
||||
|
|
@ -612,7 +616,7 @@ extSetResist(reg)
|
|||
reg->nreg_pa[n].pa_perim = perim = extResistPerim[n];
|
||||
if (area > 0 && perim > 0)
|
||||
{
|
||||
v = (double) (perim*perim - 16*area);
|
||||
v = (double) ((dlong)perim * perim - 16 * area);
|
||||
|
||||
/* Approximate by one square if v < 0 */
|
||||
if (v < 0) s = 0; else s = sqrt(v);
|
||||
|
|
@ -1022,7 +1026,7 @@ extFindDuplicateLabels(def, nreg)
|
|||
{
|
||||
r.r_ll = r.r_ur = ll2->ll_label->lab_rect.r_ll;
|
||||
r.r_xbot--, r.r_ybot--, r.r_xtop++, r.r_ytop++;
|
||||
extMakeNodeNumPrint(name, np2);
|
||||
extMakeNodeNumPrint(name, (LabRegion *)np2);
|
||||
(void) sprintf(message, badmesg, text, name);
|
||||
DBWFeedbackAdd(&r, message, def,
|
||||
1, STYLE_PALEHIGHLIGHTS);
|
||||
|
|
@ -1078,15 +1082,15 @@ ExtSortTerminals(tran, ll)
|
|||
{
|
||||
p1 = &(tran->tr_termpos[nsd]);
|
||||
p2 = &(tran->tr_termpos[nsd+1]);
|
||||
if( p2->pnum > p1->pnum )
|
||||
if (p2->pnum > p1->pnum)
|
||||
continue;
|
||||
else if( p2->pnum == p1->pnum )
|
||||
else if (p2->pnum == p1->pnum)
|
||||
{
|
||||
if( p2->pt.p_x > p1->pt.p_x )
|
||||
if (p2->pt.p_x > p1->pt.p_x)
|
||||
continue;
|
||||
else if( p2->pt.p_x == p1->pt.p_x && p2->pt.p_y > p1->pt.p_y )
|
||||
else if (p2->pt.p_x == p1->pt.p_x && p2->pt.p_y > p1->pt.p_y)
|
||||
continue;
|
||||
else if( p2->pt.p_x == p1->pt.p_x && p2->pt.p_y == p1->pt.p_y )
|
||||
else if (p2->pt.p_x == p1->pt.p_x && p2->pt.p_y == p1->pt.p_y)
|
||||
{
|
||||
TxPrintf("Extract error: Duplicate tile position, ignoring\n");
|
||||
continue;
|
||||
|
|
@ -2288,7 +2292,7 @@ extOutputDevices(def, transList, outFile)
|
|||
if (!TTMaskIsZero(&devptr->exts_deviceSubstrateTypes)
|
||||
&& (subsNode = extTransRec.tr_subsnode))
|
||||
{
|
||||
subsName = extNodeName(subsNode);
|
||||
subsName = extNodeName((LabRegion *)subsNode);
|
||||
}
|
||||
|
||||
#ifdef MAGIC_WRAPPER
|
||||
|
|
@ -2332,11 +2336,11 @@ extOutputDevices(def, transList, outFile)
|
|||
|
||||
/* gate */
|
||||
node = (NodeRegion *)extGetRegion(reg->treg_tile);
|
||||
fprintf(outFile, "\"%s\" ", extNodeName(node));
|
||||
fprintf(outFile, "\"%s\" ", extNodeName((LabRegion *)node));
|
||||
|
||||
/* First non-gate terminal */
|
||||
node = (NodeRegion *)extTransRec.tr_termnode[0];
|
||||
fprintf(outFile, "\"%s\"\n", extNodeName(node));
|
||||
fprintf(outFile, "\"%s\"\n", extNodeName((LabRegion *)node));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
|
@ -2355,7 +2359,7 @@ extOutputDevices(def, transList, outFile)
|
|||
{
|
||||
case DEV_FET: /* old style, perimeter & area */
|
||||
fprintf(outFile, "%s %s",
|
||||
extDevTable[devptr->exts_deviceClass],
|
||||
extDevTable[(unsigned char)devptr->exts_deviceClass],
|
||||
devptr->exts_deviceName);
|
||||
|
||||
fprintf(outFile, " %d %d %d %d",
|
||||
|
|
@ -2490,7 +2494,7 @@ extOutputDevices(def, transList, outFile)
|
|||
|
||||
devptr = extDevFindParamMatch(devptr, length, width);
|
||||
fprintf(outFile, "%s %s",
|
||||
extDevTable[devptr->exts_deviceClass],
|
||||
extDevTable[(unsigned char)devptr->exts_deviceClass],
|
||||
devptr->exts_deviceName);
|
||||
|
||||
fprintf(outFile, " %d %d %d %d",
|
||||
|
|
@ -2516,7 +2520,7 @@ extOutputDevices(def, transList, outFile)
|
|||
case DEV_PDIODE:
|
||||
devptr = extDevFindParamMatch(devptr, length, width);
|
||||
fprintf(outFile, "%s %s",
|
||||
extDevTable[devptr->exts_deviceClass],
|
||||
extDevTable[(unsigned char)devptr->exts_deviceClass],
|
||||
devptr->exts_deviceName);
|
||||
|
||||
fprintf(outFile, " %d %d %d %d",
|
||||
|
|
@ -2641,7 +2645,7 @@ extOutputDevices(def, transList, outFile)
|
|||
devptr = extDevFindParamMatch(devptr, length, width);
|
||||
|
||||
fprintf(outFile, "%s %s",
|
||||
extDevTable[devptr->exts_deviceClass],
|
||||
extDevTable[(unsigned char)devptr->exts_deviceClass],
|
||||
devptr->exts_deviceName);
|
||||
|
||||
fprintf(outFile, " %d %d %d %d",
|
||||
|
|
@ -2675,7 +2679,7 @@ extOutputDevices(def, transList, outFile)
|
|||
case DEV_CAPREV:
|
||||
case DEV_CSUBCKT:
|
||||
fprintf(outFile, "%s %s",
|
||||
extDevTable[devptr->exts_deviceClass],
|
||||
extDevTable[(unsigned char)devptr->exts_deviceClass],
|
||||
devptr->exts_deviceName);
|
||||
|
||||
fprintf(outFile, " %d %d %d %d",
|
||||
|
|
@ -2879,7 +2883,7 @@ extTransFindSubsFunc1(tile, noderecptr)
|
|||
if (tile->ti_client != (ClientData) extUnInit)
|
||||
{
|
||||
if ((noderecptr->region != (NodeRegion *)NULL) &&
|
||||
(noderecptr->region != tile->ti_client))
|
||||
((ClientData)noderecptr->region != tile->ti_client))
|
||||
TxError("Warning: Split substrate under device at (%d %d)\n",
|
||||
tile->ti_ll.p_x, tile->ti_ll.p_y);
|
||||
if (IsSplit(tile))
|
||||
|
|
@ -3476,17 +3480,17 @@ extTransPerimFunc(bp)
|
|||
|
||||
/* update the region tile position */
|
||||
|
||||
if( DBPlane(TiGetType(otile)) < pos->pnum )
|
||||
if (DBPlane(TiGetType(otile)) < pos->pnum)
|
||||
{
|
||||
pos->pnum = DBPlane(TiGetType(otile));
|
||||
pos->pt = otile->ti_ll;
|
||||
}
|
||||
else if( DBPlane(TiGetType(otile)) == pos->pnum )
|
||||
else if (DBPlane(TiGetType(otile)) == pos->pnum)
|
||||
{
|
||||
if( LEFT(otile) < pos->pt.p_x )
|
||||
if (LEFT(otile) < pos->pt.p_x)
|
||||
pos->pt = otile->ti_ll;
|
||||
else if( LEFT(otile) == pos->pt.p_x &&
|
||||
BOTTOM(otile) < pos->pt.p_y )
|
||||
else if (LEFT(otile) == pos->pt.p_x &&
|
||||
BOTTOM(otile) < pos->pt.p_y)
|
||||
pos->pt.p_y = BOTTOM(otile);
|
||||
}
|
||||
}
|
||||
|
|
@ -4566,7 +4570,7 @@ extNodeAreaFunc(tile, arg)
|
|||
}
|
||||
|
||||
/* Compute the resistance for the previous region */
|
||||
if (old = (NodeRegion *) arg->fra_region)
|
||||
if ((old = (NodeRegion *) arg->fra_region))
|
||||
if (ExtOptions & EXT_DORESISTANCE)
|
||||
extSetResist(old);
|
||||
|
||||
|
|
@ -4946,7 +4950,7 @@ donesides:
|
|||
* 1-lambda halo to find everything it overlaps or touches
|
||||
* on the other plane.
|
||||
*/
|
||||
if (pMask = DBAllConnPlanes[type])
|
||||
if ((pMask = DBAllConnPlanes[type]))
|
||||
{
|
||||
Rect biggerArea;
|
||||
bool is_split = IsSplit(tile);
|
||||
|
|
@ -5029,7 +5033,7 @@ extCapHashKill(ht)
|
|||
HashEntry *he;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(ht, &hs))
|
||||
while ((he = HashNext(ht, &hs)))
|
||||
{
|
||||
if (HashGetValue(he) != NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ extFileOpen(def, file, mode, prealfile)
|
|||
name = def->cd_file;
|
||||
ends = strrchr(def->cd_file, '/');
|
||||
if (ends == NULL) ends = def->cd_file;
|
||||
if (endp = strrchr(ends + 1, '.'))
|
||||
if ((endp = strrchr(ends + 1, '.')))
|
||||
{
|
||||
name = namebuf;
|
||||
len = endp - def->cd_file;
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ extRelocateSubstrateCoupling(table, subsnode)
|
|||
NodeRegion *rbp;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(table, &hs))
|
||||
while ((he = HashNext(table, &hs)))
|
||||
{
|
||||
cap = extGetCapValue(he);
|
||||
if (cap == 0) continue;
|
||||
|
|
@ -275,7 +275,7 @@ extOutputCoupling(table, outFile)
|
|||
CapValue cap; /* value of capacitance. */
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(table, &hs))
|
||||
while ((he = HashNext(table, &hs)))
|
||||
{
|
||||
cap = extGetCapValue(he) / ExtCurStyle->exts_capScale;
|
||||
if (cap == 0)
|
||||
|
|
@ -464,7 +464,7 @@ extAddOverlap(tbelow, ecpls)
|
|||
* Deduct the area shielded from the area of the overlap, so we adjust
|
||||
* the overlap capacitance correspondingly.
|
||||
*/
|
||||
if (ov.o_pmask = ExtCurStyle->exts_overlapShieldPlanes[ta][tb])
|
||||
if ((ov.o_pmask = ExtCurStyle->exts_overlapShieldPlanes[ta][tb]))
|
||||
{
|
||||
ov.o_tmask = ExtCurStyle->exts_overlapShieldTypes[ta][tb];
|
||||
for (pNum = PL_TECHDEPBASE; pNum < DBNumPlanes; pNum++)
|
||||
|
|
@ -963,7 +963,7 @@ extRemoveSubcap(bp, clip, esws)
|
|||
|
||||
if (dnear < 0) dnear = 0; /* Don't count underlap */
|
||||
mult = ExtCurStyle->exts_overlapMult[ta][0];
|
||||
snear = 0.6366 * atan(mult * dnear);
|
||||
snear = 0.6366 * atan((double)mult * dnear);
|
||||
|
||||
/* "snear" is the fractional portion of the fringe cap seen by */
|
||||
/* the substrate, so (1.0 - snear) is the part that is blocked. */
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ extHardSetLabel(scx, reg, arg)
|
|||
do { *dstp++ = *srcp++; } while (--prefixlen > 0);
|
||||
}
|
||||
srcp = text;
|
||||
while (*dstp++ = *srcp++) /* Nothing */;
|
||||
while ((*dstp++ = *srcp++)) /* Nothing */;
|
||||
|
||||
arg->hw_label = newlab;
|
||||
if (DebugIsSet(extDebugID, extDebHardWay))
|
||||
|
|
@ -455,7 +455,7 @@ extHardGenerateLabel(scx, reg, arg)
|
|||
do { *dstp++ = *srcp++; } while (--prefixlen > 0);
|
||||
}
|
||||
srcp = gen;
|
||||
while (*dstp++ = *srcp++) /* Nothing */;
|
||||
while ((*dstp++ = *srcp++)) /* Nothing */;
|
||||
arg->hw_label = newlab;
|
||||
if (DebugIsSet(extDebugID, extDebHardWay))
|
||||
TxPrintf("Hard way: generated label = \"%s\"\n", newlab->lab_text);
|
||||
|
|
|
|||
|
|
@ -737,7 +737,7 @@ extHierAdjustments(ha, cumFlat, oneFlat, lookFlat)
|
|||
if (ExtOptions & EXT_DOCOUPLING)
|
||||
{
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&oneFlat->et_coupleHash, &hs))
|
||||
while ((he = HashNext(&oneFlat->et_coupleHash, &hs)))
|
||||
{
|
||||
ckpOne = ((CoupleKey *) he->h_key.h_words);
|
||||
|
||||
|
|
@ -828,7 +828,7 @@ extOutputConns(table, outf)
|
|||
HashEntry *he;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(table, &hs))
|
||||
while ((he = HashNext(table, &hs)))
|
||||
{
|
||||
nfirst = (NodeName *) HashGetValue(he);
|
||||
|
||||
|
|
@ -838,7 +838,7 @@ extOutputConns(table, outf)
|
|||
* for a node appearing earlier in the table. If so, we need
|
||||
* only free the NodeName without any further processing.
|
||||
*/
|
||||
if (node = nfirst->nn_node)
|
||||
if ((node = nfirst->nn_node))
|
||||
{
|
||||
/*
|
||||
* If there are N names for this node, output N-1 merge lines.
|
||||
|
|
@ -848,13 +848,13 @@ extOutputConns(table, outf)
|
|||
/* Note 3/1/2017: Cap value no longer used */
|
||||
c = (node->node_cap) / ExtCurStyle->exts_capScale;
|
||||
nn = node->node_names;
|
||||
if (nnext = nn->nn_next)
|
||||
if ((nnext = nn->nn_next))
|
||||
{
|
||||
/* First merge */
|
||||
fprintf(outf, "merge \"%s\" \"%s\" %lg",
|
||||
nn->nn_name, nnext->nn_name, c);
|
||||
for (n = 0; n < ExtCurStyle->exts_numResistClasses; n++)
|
||||
fprintf(outf, " %d %d",
|
||||
fprintf(outf, " %"DLONG_PREFIX"d %d",
|
||||
node->node_pa[n].pa_area,
|
||||
node->node_pa[n].pa_perim);
|
||||
fprintf(outf, "\n");
|
||||
|
|
@ -862,7 +862,7 @@ extOutputConns(table, outf)
|
|||
nn->nn_node = (Node *) NULL; /* Processed */
|
||||
|
||||
/* Subsequent merges */
|
||||
for (nn = nnext; nnext = nn->nn_next; nn = nnext)
|
||||
for (nn = nnext; (nnext = nn->nn_next); nn = nnext)
|
||||
{
|
||||
fprintf(outf, "merge \"%s\" \"%s\"\n",
|
||||
nn->nn_name, nnext->nn_name);
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ extLength(rootUse, f)
|
|||
* be from a single cell.
|
||||
*/
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&extDriverHash, &hs))
|
||||
while ((he = HashNext(&extDriverHash, &hs)))
|
||||
{
|
||||
dList = extPathLabel(rootUse, he->h_key.h_name);
|
||||
HashSetValue(he, (ClientData) dList);
|
||||
|
|
@ -273,7 +273,7 @@ extLength(rootUse, f)
|
|||
* then compute and output the distance to each.
|
||||
*/
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&extDriverHash, &hs))
|
||||
while ((he = HashNext(&extDriverHash, &hs)))
|
||||
{
|
||||
/* Ignore drivers whose labels couldn't be found */
|
||||
dList = (Label *) HashGetValue(he);
|
||||
|
|
@ -875,7 +875,7 @@ extPathFlood(tile, p, distance, epa)
|
|||
* 1-lambda halo to find everything it overlaps or touches
|
||||
* on the other plane.
|
||||
*/
|
||||
if (pMask = DBAllConnPlanes[type])
|
||||
if ((pMask = DBAllConnPlanes[type]))
|
||||
{
|
||||
int saveplane = epa->epa_pNum;
|
||||
struct extPathFloodArg epfa;
|
||||
|
|
|
|||
|
|
@ -137,23 +137,23 @@ ExtInit()
|
|||
char *di_name;
|
||||
int *di_id;
|
||||
} debugFlags[] = {
|
||||
"areaenum", &extDebAreaEnum,
|
||||
"array", &extDebArray,
|
||||
"hardway", &extDebHardWay,
|
||||
"hiercap", &extDebHierCap,
|
||||
"hierareacap", &extDebHierAreaCap,
|
||||
"label", &extDebLabel,
|
||||
"length", &extDebLength,
|
||||
"neighbor", &extDebNeighbor,
|
||||
"noarray", &extDebNoArray,
|
||||
"nofeedback", &extDebNoFeedback,
|
||||
"nohard", &extDebNoHard,
|
||||
"nosubcell", &extDebNoSubcell,
|
||||
"perimeter", &extDebPerim,
|
||||
"resist", &extDebResist,
|
||||
"visonly", &extDebVisOnly,
|
||||
"yank", &extDebYank,
|
||||
0
|
||||
{"areaenum", &extDebAreaEnum},
|
||||
{"array", &extDebArray},
|
||||
{"hardway", &extDebHardWay},
|
||||
{"hiercap", &extDebHierCap},
|
||||
{"hierareacap", &extDebHierAreaCap},
|
||||
{"label", &extDebLabel},
|
||||
{"length", &extDebLength},
|
||||
{"neighbor", &extDebNeighbor},
|
||||
{"noarray", &extDebNoArray},
|
||||
{"nofeedback", &extDebNoFeedback},
|
||||
{"nohard", &extDebNoHard},
|
||||
{"nosubcell", &extDebNoSubcell},
|
||||
{"perimeter", &extDebPerim},
|
||||
{"resist", &extDebResist},
|
||||
{"visonly", &extDebVisOnly},
|
||||
{"yank", &extDebYank},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* Register ourselves with the debugging module */
|
||||
|
|
@ -496,7 +496,7 @@ ExtUnique(rootUse, option)
|
|||
|
||||
/* Now process all the cells we just found */
|
||||
nwarn = 0;
|
||||
while (def = (CellDef *) StackPop(extDefStack))
|
||||
while ((def = (CellDef *) StackPop(extDefStack)))
|
||||
{
|
||||
/* EXT_UNIQ_NOTOPPORTS: Use EXT_UNIQ_ALL on all cells other than the top */
|
||||
if ((option == EXT_UNIQ_NOTOPPORTS) &&
|
||||
|
|
@ -967,7 +967,7 @@ extExtractStack(stack, doExtract, rootDef)
|
|||
CellDef *def;
|
||||
struct saveList *newsl, *sl = (struct saveList *)NULL;
|
||||
|
||||
while (def = (CellDef *) StackPop(stack))
|
||||
while ((def = (CellDef *) StackPop(stack)))
|
||||
{
|
||||
def->cd_client = (ClientData) 0;
|
||||
if (!SigInterruptPending)
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ donesides:
|
|||
* 1-lambda halo to find everything it overlaps or touches
|
||||
* on the other plane.
|
||||
*/
|
||||
if (pMask = DBAllConnPlanes[type])
|
||||
if ((pMask = DBAllConnPlanes[type]))
|
||||
{
|
||||
TITORECT(tile, &pla.area);
|
||||
GEO_EXPAND(&pla.area, 1, &biggerArea);
|
||||
|
|
|
|||
|
|
@ -680,7 +680,7 @@ extSubtreeOutputCoupling(ha)
|
|||
char *name;
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&ha->ha_cumFlat.et_coupleHash, &hs))
|
||||
while ((he = HashNext(&ha->ha_cumFlat.et_coupleHash, &hs)))
|
||||
{
|
||||
cap = extGetCapValue(he) / ExtCurStyle->exts_capScale;
|
||||
if (cap == 0)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ static char sccsid[] = "@(#)ExtTech.c 4.8 MAGIC (Berkeley) 10/26/85";
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h> /* for strtod() */
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <math.h>
|
||||
#include <ctype.h> /* for isspace() */
|
||||
|
||||
|
|
@ -96,99 +97,99 @@ typedef struct
|
|||
} keydesc;
|
||||
|
||||
static keydesc keyTable[] = {
|
||||
"areacap", AREAC, 3, 3,
|
||||
"types capacitance",
|
||||
{"areacap", AREAC, 3, 3,
|
||||
"types capacitance"},
|
||||
|
||||
"contact", CONTACT, 3, 6,
|
||||
"type resistance",
|
||||
{"contact", CONTACT, 3, 6,
|
||||
"type resistance"},
|
||||
|
||||
"cscale", CSCALE, 2, 2,
|
||||
"capacitance-scalefactor",
|
||||
{"cscale", CSCALE, 2, 2,
|
||||
"capacitance-scalefactor"},
|
||||
|
||||
"defaultareacap", DEFAULTAREACAP, 4, 6,
|
||||
"types plane capacitance",
|
||||
{"defaultareacap", DEFAULTAREACAP, 4, 6,
|
||||
"types plane capacitance"},
|
||||
|
||||
"defaultoverlap", DEFAULTOVERLAP, 6, 6,
|
||||
"types plane otertypes otherplane capacitance",
|
||||
{"defaultoverlap", DEFAULTOVERLAP, 6, 6,
|
||||
"types plane otertypes otherplane capacitance"},
|
||||
|
||||
"defaultperimeter", DEFAULTPERIMETER, 4, 6,
|
||||
"types plane capacitance",
|
||||
{"defaultperimeter", DEFAULTPERIMETER, 4, 6,
|
||||
"types plane capacitance"},
|
||||
|
||||
"defaultsideoverlap", DEFAULTSIDEOVERLAP, 6, 6,
|
||||
"types plane othertypes otherplane capacitance",
|
||||
{"defaultsideoverlap", DEFAULTSIDEOVERLAP, 6, 6,
|
||||
"types plane othertypes otherplane capacitance"},
|
||||
|
||||
"defaultsidewall", DEFAULTSIDEWALL, 4, 5,
|
||||
"types plane capacitance [offset]",
|
||||
{"defaultsidewall", DEFAULTSIDEWALL, 4, 5,
|
||||
"types plane capacitance [offset]"},
|
||||
|
||||
"device", DEVICE, 4, 10,
|
||||
"device dev-type types options...",
|
||||
{"device", DEVICE, 4, 10,
|
||||
"device dev-type types options..."},
|
||||
|
||||
"fet", FET, 8, 9,
|
||||
"types terminal-types min-#-terminals name [subs-types] subs-node gscap gate-chan-cap",
|
||||
{"fet", FET, 8, 9,
|
||||
"types terminal-types min-#-terminals name [subs-types] subs-node gscap gate-chan-cap"},
|
||||
|
||||
"fetresist", FETRESIST, 4, 4,
|
||||
"type region ohms-per-square",
|
||||
{"fetresist", FETRESIST, 4, 4,
|
||||
"type region ohms-per-square"},
|
||||
|
||||
"fringeshieldhalo", FRINGESHIELDHALO, 2, 2,
|
||||
"distance",
|
||||
{"fringeshieldhalo", FRINGESHIELDHALO, 2, 2,
|
||||
"distance"},
|
||||
|
||||
"height", HEIGHT, 4, 4,
|
||||
"type height-above-subtrate thickness",
|
||||
{"height", HEIGHT, 4, 4,
|
||||
"type height-above-subtrate thickness"},
|
||||
|
||||
"antenna", ANTENNA, 4, 6,
|
||||
"type [calc-type] [antenna-ratio-proportional] antenna-ratio-const",
|
||||
{"antenna", ANTENNA, 4, 6,
|
||||
"type [calc-type] [antenna-ratio-proportional] antenna-ratio-const"},
|
||||
|
||||
"model", MODEL, 2, 3,
|
||||
"partial-cumulative [area-sidewall]",
|
||||
{"model", MODEL, 2, 3,
|
||||
"partial-cumulative [area-sidewall]"},
|
||||
|
||||
"tiedown", TIEDOWN, 2, 2,
|
||||
"types",
|
||||
{"tiedown", TIEDOWN, 2, 2,
|
||||
"types"},
|
||||
|
||||
"lambda", LAMBDA, 2, 2,
|
||||
"units-per-lambda",
|
||||
{"lambda", LAMBDA, 2, 2,
|
||||
"units-per-lambda"},
|
||||
|
||||
"overlap", OVERC, 4, 5,
|
||||
"toptypes bottomtypes capacitance [shieldtypes]",
|
||||
{"overlap", OVERC, 4, 5,
|
||||
"toptypes bottomtypes capacitance [shieldtypes]"},
|
||||
|
||||
"perimc", PERIMC, 4, 4,
|
||||
"intypes outtypes capacitance",
|
||||
{"perimc", PERIMC, 4, 4,
|
||||
"intypes outtypes capacitance"},
|
||||
|
||||
"planeorder", PLANEORDER, 3, 3,
|
||||
"plane index",
|
||||
"noplaneordering", NOPLANEORDER, 1, 1,
|
||||
"(no arguments needed)",
|
||||
{"planeorder", PLANEORDER, 3, 3,
|
||||
"plane index"},
|
||||
{"noplaneordering", NOPLANEORDER, 1, 1,
|
||||
"(no arguments needed)"},
|
||||
|
||||
"resist", RESIST, 3, 4,
|
||||
"types resistance",
|
||||
{"resist", RESIST, 3, 4,
|
||||
"types resistance"},
|
||||
|
||||
"rscale", RSCALE, 2, 2,
|
||||
"resistance-scalefactor",
|
||||
{"rscale", RSCALE, 2, 2,
|
||||
"resistance-scalefactor"},
|
||||
|
||||
"sidehalo", SIDEHALO, 2, 2,
|
||||
"distance",
|
||||
{"sidehalo", SIDEHALO, 2, 2,
|
||||
"distance"},
|
||||
|
||||
"sideoverlap", SIDEOVERLAP, 5, 6,
|
||||
"intypes outtypes ovtypes capacitance [shieldtypes]",
|
||||
{"sideoverlap", SIDEOVERLAP, 5, 6,
|
||||
"intypes outtypes ovtypes capacitance [shieldtypes]"},
|
||||
|
||||
"sidewall", SIDEWALL, 6, 7,
|
||||
"intypes outtypes neartypes fartypes capacitance [offset]",
|
||||
{"sidewall", SIDEWALL, 6, 7,
|
||||
"intypes outtypes neartypes fartypes capacitance [offset]"},
|
||||
|
||||
"step", STEP, 2, 2,
|
||||
"size",
|
||||
{"step", STEP, 2, 2,
|
||||
"size"},
|
||||
|
||||
"style", STYLE, 2, 4,
|
||||
"stylename",
|
||||
{"style", STYLE, 2, 4,
|
||||
"stylename"},
|
||||
|
||||
"substrate", SUBSTRATE, 3, 5,
|
||||
"types plane [subs-node]",
|
||||
{"substrate", SUBSTRATE, 3, 5,
|
||||
"types plane [subs-node]"},
|
||||
|
||||
"units", UNITS, 2, 2,
|
||||
"lambda|microns",
|
||||
{"units", UNITS, 2, 2,
|
||||
"lambda|microns"},
|
||||
|
||||
"variants", VARIANT, 2, 2,
|
||||
"style,...",
|
||||
{"variants", VARIANT, 2, 2,
|
||||
"style,..."},
|
||||
|
||||
0
|
||||
{0}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -202,43 +203,43 @@ static keydesc keyTable[] = {
|
|||
/* types are enumerated in extract.h */
|
||||
|
||||
static keydesc devTable[] = {
|
||||
"mosfet", DEV_MOSFET, 5, 10,
|
||||
"name gate-types src-types [drn-types] sub-types|None sub-node [gscap gccap]",
|
||||
{"mosfet", DEV_MOSFET, 5, 10,
|
||||
"name gate-types src-types [drn-types] sub-types|None sub-node [gscap gccap]"},
|
||||
|
||||
"bjt", DEV_BJT, 5, 5,
|
||||
"name base-types emitter-types collector-types",
|
||||
{"bjt", DEV_BJT, 5, 5,
|
||||
"name base-types emitter-types collector-types"},
|
||||
|
||||
"capacitor", DEV_CAP, 4, 8,
|
||||
"name top-types bottom-types [sub-types|None sub-node] [[perimcap] areacap]",
|
||||
{"capacitor", DEV_CAP, 4, 8,
|
||||
"name top-types bottom-types [sub-types|None sub-node] [[perimcap] areacap]"},
|
||||
|
||||
"capreverse", DEV_CAPREV, 4, 8,
|
||||
"name bottom-types top-types [sub-types|None sub-node] [[perimcap] areacap]",
|
||||
{"capreverse", DEV_CAPREV, 4, 8,
|
||||
"name bottom-types top-types [sub-types|None sub-node] [[perimcap] areacap]"},
|
||||
|
||||
"resistor", DEV_RES, 4, 6,
|
||||
"name|None res-types terminal-types [sub-types|None sub-node]",
|
||||
{"resistor", DEV_RES, 4, 6,
|
||||
"name|None res-types terminal-types [sub-types|None sub-node]"},
|
||||
|
||||
"diode", DEV_DIODE, 4, 6,
|
||||
"name pos-types neg-types [sub-types|None sub-node]",
|
||||
{"diode", DEV_DIODE, 4, 6,
|
||||
"name pos-types neg-types [sub-types|None sub-node]"},
|
||||
|
||||
"pdiode", DEV_PDIODE, 4, 6,
|
||||
"name pos-types neg-types [sub-types|None sub-node]",
|
||||
{"pdiode", DEV_PDIODE, 4, 6,
|
||||
"name pos-types neg-types [sub-types|None sub-node]"},
|
||||
|
||||
"ndiode", DEV_NDIODE, 4, 6,
|
||||
"name neg-types pos-types [sub-types|None sub-node]",
|
||||
{"ndiode", DEV_NDIODE, 4, 6,
|
||||
"name neg-types pos-types [sub-types|None sub-node]"},
|
||||
|
||||
"subcircuit", DEV_SUBCKT, 3, 11,
|
||||
"name dev-types [N] [term1-types ... termN-types [sub-types|None sub-node]] [options]",
|
||||
{"subcircuit", DEV_SUBCKT, 3, 11,
|
||||
"name dev-types [N] [term1-types ... termN-types [sub-types|None sub-node]] [options]"},
|
||||
|
||||
"rsubcircuit", DEV_RSUBCKT, 4, 7,
|
||||
"name dev-types terminal-types [sub-types|None sub-node] [options]",
|
||||
{"rsubcircuit", DEV_RSUBCKT, 4, 7,
|
||||
"name dev-types terminal-types [sub-types|None sub-node] [options]"},
|
||||
|
||||
"msubcircuit", DEV_MSUBCKT, 3, 11,
|
||||
"name dev-types [N] [term1-types ... termN-types [sub-types|None sub-node]] [options]",
|
||||
{"msubcircuit", DEV_MSUBCKT, 3, 11,
|
||||
"name dev-types [N] [term1-types ... termN-types [sub-types|None sub-node]] [options]"},
|
||||
|
||||
"csubcircuit", DEV_CSUBCKT, 4, 7,
|
||||
"name dev-types terminal-types [sub-types|None sub-node] [options]",
|
||||
{"csubcircuit", DEV_CSUBCKT, 4, 7,
|
||||
"name dev-types terminal-types [sub-types|None sub-node] [options]"},
|
||||
|
||||
0
|
||||
{0}
|
||||
};
|
||||
|
||||
#ifdef MAGIC_WRAPPER
|
||||
|
|
@ -2501,7 +2502,7 @@ ExtTechLine(sectionName, argc, argv)
|
|||
equal = TRUE;
|
||||
limitstr++;
|
||||
}
|
||||
if (sscanf(limitstr, "%lg", &dval) == 0)
|
||||
if (sscanf(limitstr, "%lg", &dval) != 1)
|
||||
{
|
||||
TxError("Non-numeric limit \"%s\" for parameter \"%c%s\".\n",
|
||||
limitstr, cond, argv[argc - 1]);
|
||||
|
|
@ -2976,7 +2977,7 @@ ExtTechLine(sectionName, argc, argv)
|
|||
ExtCurStyle->exts_antennaModel |= ANTENNAMODEL_CUMULATIVE;
|
||||
else
|
||||
TxError("Unknown antenna model \"%s\": Use \"partial\" or "
|
||||
"\"cumulative\"");
|
||||
"\"cumulative\"", argv[1]);
|
||||
|
||||
if (argc > 2)
|
||||
{
|
||||
|
|
@ -2986,7 +2987,7 @@ ExtTechLine(sectionName, argc, argv)
|
|||
ExtCurStyle->exts_antennaModel |= ANTENNAMODEL_SIDEWALL;
|
||||
else
|
||||
TxError("Unknown antenna model \"%s\": Use \"surface\" or "
|
||||
"\"sidewall\"");
|
||||
"\"sidewall\"", argv[2]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -128,22 +128,22 @@ ExtractTest(w, cmd)
|
|||
char *cmd_name;
|
||||
cmdType cmd_val;
|
||||
} cmds[] = {
|
||||
"clrdebug", CLRDEBUG,
|
||||
"clrlength", CLRLENGTH,
|
||||
"driver", DRIVER,
|
||||
"dump", DUMP,
|
||||
"interactions", INTERACTIONS,
|
||||
"intercount", INTERCOUNT,
|
||||
"parents", EXTPARENTS,
|
||||
"receiver", RECEIVER,
|
||||
"setdebug", SETDEBUG,
|
||||
"showdebug", SHOWDEBUG,
|
||||
"showparents", SHOWPARENTS,
|
||||
"showtech", SHOWTECH,
|
||||
"stats", STATS,
|
||||
"step", STEP,
|
||||
"times", TIME,
|
||||
0
|
||||
{"clrdebug", CLRDEBUG},
|
||||
{"clrlength", CLRLENGTH},
|
||||
{"driver", DRIVER},
|
||||
{"dump", DUMP},
|
||||
{"interactions", INTERACTIONS},
|
||||
{"intercount", INTERCOUNT},
|
||||
{"parents", EXTPARENTS},
|
||||
{"receiver", RECEIVER},
|
||||
{"setdebug", SETDEBUG},
|
||||
{"showdebug", SHOWDEBUG},
|
||||
{"showparents", SHOWPARENTS},
|
||||
{"showtech", SHOWTECH},
|
||||
{"stats", STATS},
|
||||
{"step", STEP},
|
||||
{"times", TIME},
|
||||
{0}
|
||||
};
|
||||
|
||||
if (cmd->tx_argc == 1)
|
||||
|
|
@ -191,11 +191,13 @@ ExtractTest(w, cmd)
|
|||
"Total interaction area processed = %ld (%.2f%%) / %ld (%.2f%%)\n",
|
||||
extSubtreeInteractionArea,
|
||||
((double) extSubtreeInteractionArea) / ((double) a1) * 100.0,
|
||||
areaInteraction,
|
||||
((double) areaInteraction) / ((double) a2) * 100.0);
|
||||
TxPrintf(
|
||||
"Clipped interaction area= %ld (%.2f%%) / %ld (%.2f%%)\n",
|
||||
extSubtreeClippedArea,
|
||||
((double) extSubtreeClippedArea) / ((double) a1) * 100.0,
|
||||
areaClipped,
|
||||
((double) areaClipped) / ((double) a2) * 100.0);
|
||||
extSubtreeTotalArea = 0;
|
||||
extSubtreeInteractionArea = 0;
|
||||
|
|
@ -452,7 +454,7 @@ extShowTech(name)
|
|||
out);
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
if (e = ExtCurStyle->exts_sideCoupleCap[s][t])
|
||||
if ((e = ExtCurStyle->exts_sideCoupleCap[s][t]))
|
||||
for ( ; e; e = e->ec_next)
|
||||
{
|
||||
fprintf(out, " COUPLE: ");
|
||||
|
|
@ -461,7 +463,7 @@ extShowTech(name)
|
|||
extShowMask(&e->ec_far, out);
|
||||
fprintf(out, ": %lf\n", e->ec_cap);
|
||||
}
|
||||
if (e = ExtCurStyle->exts_sideOverlapCap[s][t])
|
||||
if ((e = ExtCurStyle->exts_sideOverlapCap[s][t]))
|
||||
for ( ; e; e = e->ec_next)
|
||||
{
|
||||
fprintf(out, " OVERLAP: ");
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ ExtTimes(rootUse, f)
|
|||
*/
|
||||
TxPrintf("Computing individual cell statistics:\n"); TxFlush();
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&cellStatsTable, &hs))
|
||||
while ((he = HashNext(&cellStatsTable, &hs)))
|
||||
extTimesCellFunc((struct cellStats *) HashGetValue(he));
|
||||
|
||||
/*
|
||||
|
|
@ -223,7 +223,7 @@ ExtTimes(rootUse, f)
|
|||
*/
|
||||
TxPrintf("Computing hierarchical and incremental statistics:\n"); TxFlush();
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&cellStatsTable, &hs))
|
||||
while ((he = HashNext(&cellStatsTable, &hs)))
|
||||
extTimesIncrFunc((struct cellStats *) HashGetValue(he));
|
||||
|
||||
/*
|
||||
|
|
@ -232,7 +232,7 @@ ExtTimes(rootUse, f)
|
|||
*/
|
||||
TxPrintf("Computing summary statistics:\n"); TxFlush();
|
||||
HashStartSearch(&hs);
|
||||
while (he = HashNext(&cellStatsTable, &hs))
|
||||
while ((he = HashNext(&cellStatsTable, &hs)))
|
||||
{
|
||||
extTimesSummaryFunc((struct cellStats *) HashGetValue(he), f);
|
||||
freeMagic((char *) HashGetValue(he));
|
||||
|
|
|
|||
|
|
@ -164,7 +164,8 @@ extUniqueCell(def, option)
|
|||
|
||||
if (!(ll->ll_label->lab_flags & PORT_DIR_MASK))
|
||||
for (lltest = lastreg->lreg_labels; lltest; lltest = lltest->ll_next)
|
||||
if (!strcmp(lltest->ll_label->lab_text, text))
|
||||
if ((lltest->ll_label != NULL) &&
|
||||
(!strcmp(lltest->ll_label->lab_text, text)))
|
||||
if (lltest->ll_label->lab_flags & PORT_DIR_MASK)
|
||||
break;
|
||||
|
||||
|
|
@ -202,7 +203,7 @@ extMakeUnique(def, ll, lreg, lregList, labelHash, option)
|
|||
{
|
||||
static char *badmesg =
|
||||
"Non-global label \"%s\" attached to more than one unconnected node: %s";
|
||||
char *cpend, *text, name[1024], name2[1024], message[1024];
|
||||
char *cpend, *text, name[1024], name2[1024+32], message[1024];
|
||||
LabRegion *lp2;
|
||||
LabelList *ll2;
|
||||
int nsuffix, nwarn;
|
||||
|
|
@ -220,16 +221,20 @@ extMakeUnique(def, ll, lreg, lregList, labelHash, option)
|
|||
text = ll->ll_label->lab_text;
|
||||
if (option == EXT_UNIQ_ALL)
|
||||
goto makeUnique;
|
||||
else if ((option == EXT_UNIQ_NOPORTS || option == EXT_UNIQ_NOTOPPORTS) &&
|
||||
(ll->ll_label->lab_flags & PORT_DIR_MASK))
|
||||
else if ((option == EXT_UNIQ_NOPORTS || option == EXT_UNIQ_NOTOPPORTS)
|
||||
&& !(ll->ll_label->lab_flags & PORT_DIR_MASK))
|
||||
goto makeUnique;
|
||||
|
||||
cpend = strchr(text, '\0');
|
||||
if (cpend > text) cpend--;
|
||||
if (*cpend == '#') goto makeUnique;
|
||||
if (*cpend == '!') return 0;
|
||||
|
||||
/* Don't generate warnings about ports when given the "noports" or
|
||||
* "notopports" options.
|
||||
*/
|
||||
if (((option == EXT_UNIQ_NOPORTS) || (option == EXT_UNIQ_NOTOPPORTS))
|
||||
&& !(ll->ll_label->lab_flags & PORT_DIR_MASK))
|
||||
&& (ll->ll_label->lab_flags & PORT_DIR_MASK))
|
||||
return 0;
|
||||
|
||||
/* Generate a warning for each occurrence of this label */
|
||||
|
|
|
|||
|
|
@ -233,9 +233,9 @@ extHierLabelFunc(scx, label, tpath, targetDef)
|
|||
newlab->lab_flags = label->lab_flags;
|
||||
newlab->lab_port = label->lab_port;
|
||||
dstp = newlab->lab_text;
|
||||
for (srcp = tpath->tp_first; *dstp++ = *srcp++; )
|
||||
for (srcp = tpath->tp_first; (*dstp++ = *srcp++); )
|
||||
/* Nothing */;
|
||||
for (--dstp, srcp = label->lab_text; *dstp++ = *srcp++; )
|
||||
for (--dstp, srcp = label->lab_text; (*dstp++ = *srcp++); )
|
||||
/* Nothing */;
|
||||
|
||||
newlab->lab_next = targetDef->cd_labels;
|
||||
|
|
|
|||
|
|
@ -381,11 +381,17 @@ gaChannelStats(list)
|
|||
tot = &gaTotRiverCross;
|
||||
clear = &gaClearRiverCross;
|
||||
break;
|
||||
default: /* otherwise tot and clear is not intialized */
|
||||
tot = NULL;
|
||||
clear = NULL;
|
||||
break;
|
||||
}
|
||||
if (tot && clear) {
|
||||
gaPinStats(ch->gcr_tPins, ch->gcr_length, tot, clear);
|
||||
gaPinStats(ch->gcr_bPins, ch->gcr_length, tot, clear);
|
||||
gaPinStats(ch->gcr_lPins, ch->gcr_width, tot, clear);
|
||||
gaPinStats(ch->gcr_rPins, ch->gcr_width, tot, clear);
|
||||
}
|
||||
gaPinStats(ch->gcr_tPins, ch->gcr_length, tot, clear);
|
||||
gaPinStats(ch->gcr_bPins, ch->gcr_length, tot, clear);
|
||||
gaPinStats(ch->gcr_lPins, ch->gcr_width, tot, clear);
|
||||
gaPinStats(ch->gcr_rPins, ch->gcr_width, tot, clear);
|
||||
}
|
||||
|
||||
numTot = gaTotRiverCross + gaTotNormCross;
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ GARouteCmd(routeUse, netListName)
|
|||
CellUse *routeUse;
|
||||
char *netListName;
|
||||
{
|
||||
int errs;
|
||||
int errs = -1;
|
||||
NLNetList netList;
|
||||
GCRChannel *ch;
|
||||
NLNet *net;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ int gaNumSimplePaint, gaNumMazePaint, gaNumExtPaint;
|
|||
/* Forward declarations */
|
||||
int gaStemContainingChannelFunc();
|
||||
bool gaStemAssign();
|
||||
void gaStemGridRange();
|
||||
int gaStemGridRange();
|
||||
void gaStemPaint();
|
||||
bool gaStemNetClear();
|
||||
bool gaStemInternalFunc();
|
||||
|
|
@ -222,7 +222,7 @@ gaStemAssign(routeUse, doWarn, loc, term, net, netList)
|
|||
* See if this location lies inside a river-routing channel.
|
||||
* If it does, return the channel containing it.
|
||||
*/
|
||||
if (ch = gaStemContainingChannel(routeUse, doWarn, loc))
|
||||
if ((ch = gaStemContainingChannel(routeUse, doWarn, loc)))
|
||||
{
|
||||
if (ch->gcr_type != CHAN_HRIVER && ch->gcr_type != CHAN_VRIVER)
|
||||
goto fail;
|
||||
|
|
@ -347,7 +347,7 @@ gaStemContainingChannelFunc(tile, pCh)
|
|||
{
|
||||
GCRChannel *ch;
|
||||
|
||||
if (ch = (GCRChannel *) tile->ti_client)
|
||||
if ((ch = (GCRChannel *) tile->ti_client))
|
||||
{
|
||||
if (*pCh)
|
||||
{
|
||||
|
|
@ -869,7 +869,7 @@ gaStemNetClear(termArea, point, side, netList)
|
|||
* of 'r'.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
* 0 on success, -1 on error (no side effects).
|
||||
*
|
||||
* Side effects:
|
||||
* Sets *pMinGrid, *pMaxGrid, and *pStart.
|
||||
|
|
@ -877,7 +877,7 @@ gaStemNetClear(termArea, point, side, netList)
|
|||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
int
|
||||
gaStemGridRange(type, r, pMinGrid, pMaxGrid, pStart)
|
||||
int type;
|
||||
Rect *r;
|
||||
|
|
@ -914,7 +914,7 @@ gaStemGridRange(type, r, pMinGrid, pMaxGrid, pStart)
|
|||
default:
|
||||
{
|
||||
ASSERT(FALSE, "Bad channel type in gaStemGridRange");
|
||||
break;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
max = MAX(max, start);
|
||||
|
|
@ -922,6 +922,7 @@ gaStemGridRange(type, r, pMinGrid, pMaxGrid, pStart)
|
|||
*pMaxGrid = max;
|
||||
*pMinGrid = min;
|
||||
*pStart = start;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -98,10 +98,10 @@ GATest(w, cmd)
|
|||
char *cmd_name;
|
||||
cmdType cmd_val;
|
||||
} cmds[] = {
|
||||
"clrdebug", CLRDEBUG,
|
||||
"setdebug", SETDEBUG,
|
||||
"showdebug", SHOWDEBUG,
|
||||
0
|
||||
{"clrdebug", CLRDEBUG},
|
||||
{"setdebug", SETDEBUG},
|
||||
{"showdebug", SHOWDEBUG},
|
||||
{0}
|
||||
};
|
||||
|
||||
GAInit();
|
||||
|
|
@ -388,17 +388,17 @@ GAInit()
|
|||
char *di_name;
|
||||
int *di_id;
|
||||
} dflags[] = {
|
||||
"chanonly", &gaDebChanOnly,
|
||||
"chanstats", &gaDebChanStats,
|
||||
"maze", &gaDebMaze,
|
||||
"nosimple", &gaDebNoSimple,
|
||||
"paintstems", &gaDebPaintStems,
|
||||
"showchans", &gaDebShowChans,
|
||||
"showmaze", &gaDebShowMaze,
|
||||
"stems", &gaDebStems,
|
||||
"verbose", &gaDebVerbose,
|
||||
"noclean", &gaDebNoClean,
|
||||
0
|
||||
{"chanonly", &gaDebChanOnly},
|
||||
{"chanstats", &gaDebChanStats},
|
||||
{"maze", &gaDebMaze},
|
||||
{"nosimple", &gaDebNoSimple},
|
||||
{"paintstems", &gaDebPaintStems},
|
||||
{"showchans", &gaDebShowChans},
|
||||
{"showmaze", &gaDebShowMaze},
|
||||
{"stems", &gaDebStems},
|
||||
{"verbose", &gaDebVerbose},
|
||||
{"noclean", &gaDebNoClean},
|
||||
{0}
|
||||
};
|
||||
|
||||
if (gaInitialized)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
|
|||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/times.h>
|
||||
|
||||
|
|
@ -106,7 +107,7 @@ GCRRouteFromFile(fname)
|
|||
(void) GCRroute(ch);
|
||||
times(&tbuf2);
|
||||
TxPrintf("Time : %5.2fu %5.2fs\n", (tbuf2.tms_utime -
|
||||
tbuf1.tms_utime)/60.0, (tbuf2.tms_stime-tbuf1.tms_stime)*60);
|
||||
tbuf1.tms_utime)/60.0, (double)(tbuf2.tms_stime-tbuf1.tms_stime)*60);
|
||||
|
||||
gcrDumpResult(ch, GcrShowEnd);
|
||||
gcrShowMap(ch);
|
||||
|
|
@ -194,7 +195,7 @@ gcrMakeChannel(ch, fp)
|
|||
* p and P mean poly is blocked. Upper case means vacate the
|
||||
* column, lower case means vacate the track.
|
||||
*/
|
||||
if (fscanf(fp, "%s", s) != 1)
|
||||
if (fscanf(fp, "%24s", s) != 1)
|
||||
{
|
||||
TxError("Format error in router input file\n");
|
||||
return (FALSE);
|
||||
|
|
@ -372,14 +373,13 @@ gcrPrDensity(ch, chanDensity)
|
|||
{
|
||||
int i, diff;
|
||||
char name[256];
|
||||
FILE *fp;
|
||||
FILE *fp, *fp_always_close;
|
||||
|
||||
(void) sprintf(name, "dens.%d.%d.%d.%d",
|
||||
ch->gcr_area.r_xbot, ch->gcr_area.r_ybot,
|
||||
ch->gcr_area.r_xtop, ch->gcr_area.r_ytop);
|
||||
fp = fopen(name, "w");
|
||||
if (fp == NULL)
|
||||
fp = stdout;
|
||||
fp_always_close = fopen(name, "w");
|
||||
fp = fp_always_close ? fp_always_close : stdout;
|
||||
|
||||
fprintf(fp, "Chan width: %d\n", ch->gcr_width);
|
||||
fprintf(fp, "Chan length: %d\n", ch->gcr_length);
|
||||
|
|
@ -423,8 +423,8 @@ gcrPrDensity(ch, chanDensity)
|
|||
}
|
||||
|
||||
(void) fflush(fp);
|
||||
if (fp != stdout)
|
||||
(void) fclose(fp);
|
||||
if (fp_always_close != NULL)
|
||||
(void) fclose(fp_always_close);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -454,33 +454,33 @@ gcrDumpPins(ch)
|
|||
TxPrintf("LEFT PINS\n");
|
||||
for(i=0; i<=ch->gcr_width; i++)
|
||||
{
|
||||
TxPrintf("Location [%d]=%d: x=%d, y=%d, pNext=%d, pPrev=%d, id=%d\n",
|
||||
i, &pinArray[i], pinArray[i].gcr_x, pinArray[i].gcr_y,
|
||||
pinArray[i].gcr_pNext, pinArray[i].gcr_pPrev, pinArray[i].gcr_pId);
|
||||
TxPrintf("Location [%d]=%ld: x=%d, y=%d, pNext=%ld, pPrev=%ld, id=%ld\n",
|
||||
i, (intmax_t) &pinArray[i], pinArray[i].gcr_x, pinArray[i].gcr_y,
|
||||
(intmax_t) pinArray[i].gcr_pNext, (intmax_t) pinArray[i].gcr_pPrev, (intmax_t) pinArray[i].gcr_pId);
|
||||
}
|
||||
pinArray=ch->gcr_rPins;
|
||||
TxPrintf("RIGHT PINS\n");
|
||||
for(i=0; i<=ch->gcr_width; i++)
|
||||
{
|
||||
TxPrintf("Location [%d]=%d: x=%d, y=%d, pNext=%d, pPrev=%d, id=%d\n",
|
||||
i, &pinArray[i], pinArray[i].gcr_x, pinArray[i].gcr_y,
|
||||
pinArray[i].gcr_pNext, pinArray[i].gcr_pPrev, pinArray[i].gcr_pId);
|
||||
TxPrintf("Location [%d]=%ld: x=%d, y=%d, pNext=%ld, pPrev=%ld, id=%ld\n",
|
||||
i, (intmax_t) &pinArray[i], pinArray[i].gcr_x, pinArray[i].gcr_y,
|
||||
(intmax_t) pinArray[i].gcr_pNext, (intmax_t) pinArray[i].gcr_pPrev, (intmax_t) pinArray[i].gcr_pId);
|
||||
}
|
||||
pinArray=ch->gcr_bPins;
|
||||
TxPrintf("BOTTOM PINS\n");
|
||||
for(i=0; i<=ch->gcr_length; i++)
|
||||
{
|
||||
TxPrintf("Location [%d]=%d: x=%d, y=%d, pNext=%d, pPrev=%d, id=%d\n",
|
||||
i, &pinArray[i], pinArray[i].gcr_x, pinArray[i].gcr_y,
|
||||
pinArray[i].gcr_pNext, pinArray[i].gcr_pPrev, pinArray[i].gcr_pId);
|
||||
TxPrintf("Location [%d]=%ld: x=%d, y=%d, pNext=%ld, pPrev=%ld, id=%ld\n",
|
||||
i, (intmax_t) &pinArray[i], pinArray[i].gcr_x, pinArray[i].gcr_y,
|
||||
(intmax_t) pinArray[i].gcr_pNext, (intmax_t) pinArray[i].gcr_pPrev, (intmax_t) pinArray[i].gcr_pId);
|
||||
}
|
||||
pinArray=ch->gcr_tPins;
|
||||
TxPrintf("TOP PINS\n");
|
||||
for(i=0; i<=ch->gcr_length; i++)
|
||||
{
|
||||
TxPrintf("Location [%d]=%d: x=%d, y=%d, pNext=%d, pPrev=%d, id=%d\n",
|
||||
i, &pinArray[i], pinArray[i].gcr_x, pinArray[i].gcr_y,
|
||||
pinArray[i].gcr_pNext, pinArray[i].gcr_pPrev, pinArray[i].gcr_pId);
|
||||
TxPrintf("Location [%d]=%ld: x=%d, y=%d, pNext=%ld, pPrev=%ld, id=%ld\n",
|
||||
i, (intmax_t) &pinArray[i], pinArray[i].gcr_x, pinArray[i].gcr_y,
|
||||
(intmax_t) pinArray[i].gcr_pNext, (intmax_t) pinArray[i].gcr_pPrev, (intmax_t) pinArray[i].gcr_pId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -507,9 +507,9 @@ gcrDumpPinList(pin, dir)
|
|||
{
|
||||
if (pin)
|
||||
{
|
||||
TxPrintf("Location (%d, %d)=%x: pNext=%d, pPrev=%d, id=%d\n",
|
||||
pin->gcr_x, pin->gcr_y, pin,
|
||||
pin->gcr_pNext, pin->gcr_pPrev, pin->gcr_pId);
|
||||
TxPrintf("Location (%d, %d)=%lx: pNext=%ld, pPrev=%ld, id=%ld\n",
|
||||
pin->gcr_x, pin->gcr_y, (intmax_t) pin,
|
||||
(intmax_t) pin->gcr_pNext, (intmax_t) pin->gcr_pPrev, (intmax_t) pin->gcr_pId);
|
||||
if (dir) gcrDumpPinList(pin->gcr_pNext, dir);
|
||||
else gcrDumpPinList(pin->gcr_pPrev, dir);
|
||||
}
|
||||
|
|
@ -635,7 +635,7 @@ void gcrPrintCol(ch, i, showResult)
|
|||
}
|
||||
else TxPrintf("#");
|
||||
}
|
||||
else if ((res[i][j] & GCRU) || j != 0 && (res[i][j-1] & GCRU))
|
||||
else if ((res[i][j] & GCRU) || (j != 0 && (res[i][j-1] & GCRU)))
|
||||
{
|
||||
if((res[i][j]&GCRCC) && (!(res[i][j]&(GCRBLKM|GCRBLKP))))
|
||||
{
|
||||
|
|
@ -978,8 +978,12 @@ gcrShowMap(ch)
|
|||
while (1)
|
||||
{
|
||||
TxPrintf("Field selector (0 terminates): ");
|
||||
if(!scanf("%d", &field)) /*typed something funny*/
|
||||
if(scanf("%d", &field) != 1) /*typed something funny or EOF*/
|
||||
{
|
||||
if (feof(stdin)) {
|
||||
TxPrintf("End of input detected. Terminating.\n");
|
||||
return;
|
||||
}
|
||||
TxPrintf("Bad input. Legal responses are\n");
|
||||
TxPrintf(" GCRBLKM 1\n");
|
||||
TxPrintf(" GCRBLKP 2\n");
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ gcrUnlinkPin(pin)
|
|||
{
|
||||
GCRNet *net;
|
||||
|
||||
if (net = pin->gcr_pId)
|
||||
if ((net = pin->gcr_pId))
|
||||
{
|
||||
ASSERT(pin == net->gcr_lPin, "gcrUnlinkPin");
|
||||
net->gcr_lPin = pin->gcr_pNext;
|
||||
|
|
|
|||
|
|
@ -203,14 +203,14 @@ void
|
|||
gcrDumpChannel(ch)
|
||||
GCRChannel * ch;
|
||||
{
|
||||
char name[20];
|
||||
char name[32];
|
||||
int track, col, netCount = 0, gcrNetName();
|
||||
short res;
|
||||
GCRNet * net, * netNames[500];
|
||||
FILE * fp, * fopen();
|
||||
|
||||
netNames[0]=(GCRNet *) 0;
|
||||
(void) sprintf(name, "channel.%p", ch);
|
||||
(void) snprintf(name, sizeof(name), "channel.%p", ch);
|
||||
if((fp = fopen(name, "w")) == NULL)
|
||||
{
|
||||
TxError("Can't open file %s to dump channel.\n", name);
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ int pixsize;
|
|||
{
|
||||
Point *tp;
|
||||
int np, nptotal;
|
||||
int i, j;
|
||||
int i, j = 0;
|
||||
static int maxnp = 0;
|
||||
FontChar *ccur;
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ Point *p; /* screen pos of lower left corner */
|
|||
}
|
||||
}
|
||||
if ((!anyObscure) && (GEO_SURROUND(&grCurClip, &bBox)) ) {
|
||||
int *pixelp, x, y, thisp, lastp;
|
||||
int *pixelp, x, y, thisp, lastp = -1;
|
||||
int color, red, green, blue, mask;
|
||||
|
||||
/* no clipping, try to go quickly */
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ char *libPath; /* a library search path */
|
|||
while (fgets(inputLine, 128, f) != NULL)
|
||||
{
|
||||
argc = sscanf(inputLine, "%*d %*d %*d %d", &newmax);
|
||||
if (argc == 0)
|
||||
if (argc <= 0)
|
||||
{
|
||||
/* Allow comment lines */
|
||||
if (*inputLine == '#') continue;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ extern void GrClipTriangle();
|
|||
* lintpick happy!
|
||||
*/
|
||||
|
||||
global Rect GrCrossRect = {-GR_CROSSSIZE, -GR_CROSSSIZE, GR_CROSSSIZE, GR_CROSSSIZE};
|
||||
global Rect GrCrossRect = {{-GR_CROSSSIZE, -GR_CROSSSIZE}, {GR_CROSSSIZE, GR_CROSSSIZE}};
|
||||
global int GrNumClipBoxes = 0; /* for benchmarking */
|
||||
global int grCurDStyle;
|
||||
global unsigned char GrGridMultiple = 1;
|
||||
|
|
@ -434,7 +434,7 @@ GrClipLine(x1, y1, x2, y2)
|
|||
{
|
||||
Point p1, p2;
|
||||
Rect c;
|
||||
bool ok1, ok2;
|
||||
bool ok1 = FALSE, ok2 = FALSE;
|
||||
c = ob->r_r;
|
||||
c.r_xbot--; c.r_ybot--;
|
||||
c.r_xtop++; c.r_ytop++;
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ styleBuildDisplayStyle(line, version)
|
|||
*/
|
||||
|
||||
/* Allow colors to be specified by index or by name */
|
||||
if (sscanf(colorName, ((version > 6) ? "%i" : "%o"), &color) == 0)
|
||||
if (sscanf(colorName, ((version > 6) ? "%i" : "%o"), &color) <= 0)
|
||||
color = GrNameToColor(colorName);
|
||||
|
||||
newstyle->style.mask = (mask & grBitPlaneMask);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ global int GrPixelCorrect = 1;
|
|||
/* The following rectangle is describes the display area and is available
|
||||
* to the user of this module.
|
||||
*/
|
||||
global Rect GrScreenRect = {0, 0, 0, 0};
|
||||
global Rect GrScreenRect = {{0, 0}, {0, 0}};
|
||||
|
||||
/*
|
||||
* Interrupt status for the timer. In TCL, this is used for graphics
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@
|
|||
|
||||
GLubyte **grOGLStipples;
|
||||
HashTable grOGLWindowTable;
|
||||
Display *grXdpy;
|
||||
extern Display *grXdpy; /* grX11thread.c */
|
||||
GLXContext grXcontext;
|
||||
int grXscrn;
|
||||
int pipeRead, pipeWrite;
|
||||
int Xhelper;
|
||||
Visual *grVisual;
|
||||
extern int grXscrn; /* grX11su1.c */
|
||||
extern int pipeRead, pipeWrite; /* grX11su1.c */
|
||||
extern int Xhelper; /* grX11su1.c */
|
||||
extern Visual *grVisual; /* grX11su1.c */
|
||||
|
||||
#ifdef HAVE_PTHREADS
|
||||
extern int writePipe;
|
||||
|
|
@ -375,7 +375,7 @@ glTransYs(int wy)
|
|||
* Set the OpenGL viewport (projection matrix) for the current window
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
void
|
||||
oglSetProjection(llx, lly, width, height)
|
||||
int llx, lly, width, height;
|
||||
{
|
||||
|
|
@ -434,7 +434,7 @@ pipehandler()
|
|||
int key;
|
||||
XKeyPressedEvent *KeyPressedEvent = (XKeyPressedEvent *) &xevent;
|
||||
|
||||
entry = HashLookOnly(&grOGLWindowTable, KeyPressedEvent->window);
|
||||
entry = HashLookOnly(&grOGLWindowTable, (char *)KeyPressedEvent->window);
|
||||
mw = (entry) ? (MagWindow *)HashGetValue(entry) : 0;
|
||||
|
||||
event = TxNewEvent();
|
||||
|
|
@ -457,7 +457,7 @@ pipehandler()
|
|||
|
||||
XButtonEvent *ButtonEvent = (XButtonEvent *) &xevent;
|
||||
|
||||
entry = HashLookOnly(&grOGLWindowTable, ButtonEvent->window);
|
||||
entry = HashLookOnly(&grOGLWindowTable, (char *)ButtonEvent->window);
|
||||
mw = (entry) ? (MagWindow *)HashGetValue(entry) : 0;
|
||||
|
||||
event = TxNewEvent();
|
||||
|
|
@ -504,7 +504,7 @@ pipehandler()
|
|||
width = ConfigureEvent->width;
|
||||
height = ConfigureEvent->height;
|
||||
|
||||
entry = HashLookOnly(&grOGLWindowTable, ConfigureEvent->window);
|
||||
entry = HashLookOnly(&grOGLWindowTable, (char *)ConfigureEvent->window);
|
||||
mw = (entry) ? (MagWindow *)HashGetValue(entry) : 0;
|
||||
|
||||
screenRect.r_xbot = ConfigureEvent->x;
|
||||
|
|
@ -525,7 +525,7 @@ pipehandler()
|
|||
case VisibilityNotify: {
|
||||
XVisibilityEvent *VisEvent = (XVisibilityEvent*) &xevent;
|
||||
|
||||
entry = HashLookOnly(&grOGLWindowTable, VisEvent->window);
|
||||
entry = HashLookOnly(&grOGLWindowTable, (char *)VisEvent->window);
|
||||
mw = (entry)?(MagWindow *)HashGetValue(entry):0;
|
||||
|
||||
switch(VisEvent->state)
|
||||
|
|
@ -555,8 +555,10 @@ pipehandler()
|
|||
XEvent discard;
|
||||
XExposeEvent *ExposeEvent = (XExposeEvent*) &xevent;
|
||||
|
||||
entry = HashLookOnly(&grOGLWindowTable, ExposeEvent->window);
|
||||
entry = HashLookOnly(&grOGLWindowTable, (char *)ExposeEvent->window);
|
||||
mw = (entry) ? (MagWindow *)HashGetValue(entry) : 0;
|
||||
if (!mw)
|
||||
break;
|
||||
|
||||
screenRect.r_xbot = ExposeEvent->x;
|
||||
screenRect.r_xtop = ExposeEvent->x + ExposeEvent->width;
|
||||
|
|
@ -584,7 +586,7 @@ pipehandler()
|
|||
|
||||
XAnyEvent *AnyEvent = (XAnyEvent *) &xevent;
|
||||
|
||||
entry = HashLookOnly(&grOGLWindowTable, AnyEvent->window);
|
||||
entry = HashLookOnly(&grOGLWindowTable, (char *)AnyEvent->window);
|
||||
mw = (entry)?(MagWindow *)HashGetValue(entry):0;
|
||||
|
||||
SigDisableInterrupts();
|
||||
|
|
@ -718,14 +720,16 @@ oglSetDisplay (dispType, outFileName, mouseFileName)
|
|||
grSetCharSizePtr = groglSetCharSize;
|
||||
grFillPolygonPtr = groglFillPolygon;
|
||||
|
||||
if (execFailed) {
|
||||
if (execFailed)
|
||||
{
|
||||
TxError("Execution failed!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TxAdd1InputDevice(fileno(stdin), grOGLWStdin, (ClientData) NULL);
|
||||
|
||||
if(!GrOGLInit()){
|
||||
if (!GrOGLInit())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
GrScreenRect.r_xbot = 0;
|
||||
|
|
@ -848,7 +852,7 @@ GrOGLCreate(w, name)
|
|||
glXMakeCurrent(grXdpy, (GLXDrawable)wind, grXcontext);
|
||||
|
||||
w->w_grdata = (ClientData) wind;
|
||||
entry = HashFind(&grOGLWindowTable, wind);
|
||||
entry = HashFind(&grOGLWindowTable, (char *)wind);
|
||||
HashSetValue(entry,w);
|
||||
XDefineCursor(grXdpy, wind, oglCurrent.cursor);
|
||||
GrOGLIconUpdate(w, w->w_caption);
|
||||
|
|
@ -910,7 +914,7 @@ GrOGLDelete(w)
|
|||
HashEntry *entry;
|
||||
|
||||
xw = (Window) w->w_grdata;
|
||||
entry = HashLookOnly(&grOGLWindowTable,xw);
|
||||
entry = HashLookOnly(&grOGLWindowTable, (char *)xw);
|
||||
HashSetValue(entry,NULL);
|
||||
|
||||
XDestroyWindow(grXdpy, xw);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ extern HashTable grOGLWindowTable;
|
|||
extern Display *grXdpy;
|
||||
extern int grXscrn;
|
||||
|
||||
Cursor grCursors[MAX_CURSORS];
|
||||
extern Cursor grCursors[MAX_CURSORS]; /* grX11su5.c */
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1079,7 +1079,7 @@ char *name;
|
|||
static int WindowNumber = 0;
|
||||
HashEntry *entry;
|
||||
char *windowplace;
|
||||
char windowname[10];
|
||||
char windowname[32];
|
||||
int x = w->w_frameArea.r_xbot;
|
||||
int y = grTransYs(w->w_frameArea.r_ytop);
|
||||
int width = w->w_frameArea.r_xtop - w->w_frameArea.r_xbot;
|
||||
|
|
@ -1090,7 +1090,7 @@ char *name;
|
|||
WindSeparateRedisplay(w);
|
||||
|
||||
sprintf(windowname, ".magic%d", WindowNumber + 1);
|
||||
if (windowplace = XGetDefault(grXdpy, "magic", windowname))
|
||||
if ((windowplace = XGetDefault(grXdpy, "magic", windowname)))
|
||||
{
|
||||
XParseGeometry(windowplace, &x, &y,
|
||||
(unsigned int *)&width, (unsigned int *)&height);
|
||||
|
|
@ -1106,7 +1106,7 @@ char *name;
|
|||
grAttributes.background_pixel = WhitePixel(grXdpy, grXscrn);
|
||||
grAttributes.border_pixel = BlackPixel(grXdpy, grXscrn);
|
||||
|
||||
if (tktop = Tk_MainWindow(magicinterp))
|
||||
if ((tktop = Tk_MainWindow(magicinterp)))
|
||||
{
|
||||
if (!WindowNumber)
|
||||
{
|
||||
|
|
@ -1490,7 +1490,7 @@ char *text;
|
|||
XSetClassHint( grXdpy, wind, &class);
|
||||
if (text)
|
||||
{
|
||||
if (brack = strchr(text, '['))
|
||||
if ((brack = strchr(text, '[')))
|
||||
{
|
||||
brack--;
|
||||
*brack = 0;
|
||||
|
|
@ -1499,7 +1499,7 @@ char *text;
|
|||
*brack = ' ';
|
||||
return;
|
||||
}
|
||||
if (brack = strrchr(text, ' ')) text = brack + 1;
|
||||
if ((brack = strrchr(text, ' '))) text = brack + 1;
|
||||
XSetIconName(grXdpy, wind, text);
|
||||
XStoreName(grXdpy, wind, text);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ int cursorNum; /* The cursor number as defined in the display
|
|||
tcairoCurrent.cursor = grCursors[cursorNum];
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (entry = HashNext(&grTCairoWindowTable, &hs))
|
||||
while ((entry = HashNext(&grTCairoWindowTable, &hs)))
|
||||
{
|
||||
if (HashGetValue(entry))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -599,7 +599,7 @@ keys_and_buttons:
|
|||
idxmax = (nbytes == 0) ? 1 : nbytes;
|
||||
for (idx = 0; idx < idxmax; idx++)
|
||||
{
|
||||
if (inChar[idx] == 3) /* Ctrl-C interrupt */
|
||||
if (nbytes > 0 && inChar[idx] == 3) /* Ctrl-C interrupt */
|
||||
{
|
||||
if (SigInterruptPending)
|
||||
MainExit(0); /* double Ctrl-C */
|
||||
|
|
@ -1081,7 +1081,7 @@ GrTOGLCreate(w, name)
|
|||
static int WindowNumber = 0;
|
||||
HashEntry *entry;
|
||||
char *windowplace;
|
||||
char windowname[10];
|
||||
char windowname[32];
|
||||
int x = w->w_frameArea.r_xbot;
|
||||
int y = glTransYs(w->w_frameArea.r_ytop);
|
||||
int width = w->w_frameArea.r_xtop - w->w_frameArea.r_xbot;
|
||||
|
|
@ -1092,7 +1092,7 @@ GrTOGLCreate(w, name)
|
|||
WindSeparateRedisplay(w);
|
||||
|
||||
sprintf(windowname, ".magic%d", WindowNumber + 1);
|
||||
if (windowplace = XGetDefault(grXdpy, "magic", windowname))
|
||||
if ((windowplace = XGetDefault(grXdpy, "magic", windowname)))
|
||||
{
|
||||
XParseGeometry(windowplace,&x,&y,
|
||||
(unsigned int *)&width,(unsigned int *)&height);
|
||||
|
|
@ -1108,7 +1108,7 @@ GrTOGLCreate(w, name)
|
|||
grAttributes.background_pixel = WhitePixel(grXdpy,grXscrn);
|
||||
grAttributes.border_pixel = BlackPixel(grXdpy,grXscrn);
|
||||
|
||||
if (tktop = Tk_MainWindow(magicinterp))
|
||||
if ((tktop = Tk_MainWindow(magicinterp)))
|
||||
{
|
||||
if (!WindowNumber)
|
||||
{
|
||||
|
|
@ -1539,7 +1539,7 @@ GrTOGLIconUpdate(w,text) /* See Blt code */
|
|||
XSetClassHint( grXdpy, wind, &class);
|
||||
if (text)
|
||||
{
|
||||
if (brack = strchr(text,'['))
|
||||
if ((brack = strchr(text,'[')))
|
||||
{
|
||||
brack--;
|
||||
*brack = 0;
|
||||
|
|
@ -1548,7 +1548,7 @@ GrTOGLIconUpdate(w,text) /* See Blt code */
|
|||
*brack = ' ';
|
||||
return;
|
||||
}
|
||||
if (brack = strrchr(text,' ')) text = brack+1;
|
||||
if ((brack = strrchr(text,' '))) text = brack+1;
|
||||
XSetIconName(grXdpy,wind,text);
|
||||
XStoreName(grXdpy,wind,text);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,6 +228,7 @@ GrTOGLTextSize(text, size, r)
|
|||
font = grXLargeFont;
|
||||
break;
|
||||
default:
|
||||
font = NULL;
|
||||
TxError("%s%d\n", "GrTOGLTextSize: Unknown character size ",
|
||||
size );
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ GrTOGLSetCursor(cursorNum)
|
|||
toglCurrent.cursor = grCursors[cursorNum];
|
||||
|
||||
HashStartSearch(&hs);
|
||||
while (entry = HashNext(&grTOGLWindowTable,&hs))
|
||||
while ((entry = HashNext(&grTOGLWindowTable,&hs)))
|
||||
{
|
||||
if (HashGetValue(entry))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ GrTkInit(dispType)
|
|||
}
|
||||
else
|
||||
{
|
||||
TxPrintf("Using %s, VisualID 0x%x depth %d\n",
|
||||
TxPrintf("Using %s, VisualID 0x%lx depth %d\n",
|
||||
visual_type[grvisual_get[gritems].class],
|
||||
grvisual_get[gritems].visualid,
|
||||
grvisual_get[gritems].depth);
|
||||
|
|
@ -1308,7 +1308,7 @@ GrTkCreate(w, name)
|
|||
static int WindowNumber = 0;
|
||||
HashEntry *entry;
|
||||
char *windowplace;
|
||||
char windowname[10];
|
||||
char windowname[32];
|
||||
int x = w->w_frameArea.r_xbot;
|
||||
int y = grMagicToXs(w->w_frameArea.r_ytop);
|
||||
int width = w->w_frameArea.r_xtop - w->w_frameArea.r_xbot;
|
||||
|
|
@ -1322,7 +1322,7 @@ GrTkCreate(w, name)
|
|||
WindSeparateRedisplay(w);
|
||||
|
||||
sprintf(windowname, ".magic%d", WindowNumber + 1);
|
||||
if (windowplace = XGetDefault(grXdpy, "magic", windowname))
|
||||
if ((windowplace = XGetDefault(grXdpy, "magic", windowname)))
|
||||
{
|
||||
XParseGeometry(windowplace,&x,&y,
|
||||
(unsigned int *)&width,(unsigned int *)&height);
|
||||
|
|
@ -1339,7 +1339,7 @@ GrTkCreate(w, name)
|
|||
if(grClass == 3) grDepth = 8; /* Needed since grDisplay.depth is reset
|
||||
to 7 if Pseudocolor */
|
||||
|
||||
if (tktop = Tk_MainWindow(magicinterp))
|
||||
if ((tktop = Tk_MainWindow(magicinterp)))
|
||||
{
|
||||
if (!WindowNumber)
|
||||
{
|
||||
|
|
@ -1754,7 +1754,7 @@ GrTkIconUpdate(w, text) /* See Blt code */
|
|||
class.res_class = "magic";
|
||||
|
||||
XSetClassHint( grXdpy, wind, &class);
|
||||
if (brack = strchr(text,'['))
|
||||
if ((brack = strchr(text,'[')))
|
||||
{
|
||||
brack--;
|
||||
*brack = 0;
|
||||
|
|
@ -1763,7 +1763,7 @@ GrTkIconUpdate(w, text) /* See Blt code */
|
|||
*brack = ' ';
|
||||
return;
|
||||
}
|
||||
if (brack = strrchr(text,' ')) text = brack+1;
|
||||
if ((brack = strrchr(text,' '))) text = brack+1;
|
||||
XSetIconName(grXdpy,wind,text);
|
||||
XStoreName(grXdpy,wind,text);
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue