K&R calma/*.c: bulk function implementation conversion

K&R obsolete syntax removal for C23 compatibility series
This commit is contained in:
Darryl L. Miles 2024-10-04 11:34:50 +01:00 committed by Tim Edwards
parent f3ace65a78
commit a9ea08a597
6 changed files with 258 additions and 248 deletions

View File

@ -96,8 +96,8 @@ typedef struct {
*/ */
OFFTYPE OFFTYPE
calmaSetPosition(sname) calmaSetPosition(
char *sname; char *sname)
{ {
OFFTYPE originalPos = 0, currentPos = 0; OFFTYPE originalPos = 0, currentPos = 0;
int nbytes, rtype; int nbytes, rtype;
@ -188,7 +188,7 @@ calmaSetPosition(sname)
*/ */
void void
calmaNextCell() calmaNextCell(void)
{ {
int nbytes, rtype; int nbytes, rtype;
@ -240,7 +240,7 @@ calmaNextCell()
*/ */
Plane ** Plane **
calmaExact() calmaExact(void)
{ {
int pNum; int pNum;
Plane *newplane; Plane *newplane;
@ -298,9 +298,9 @@ calmaExact()
*/ */
int int
calmaFlattenPolygonFunc(use, parent) calmaFlattenPolygonFunc(
CellUse *use; CellUse *use,
CellDef *parent; CellDef *parent)
{ {
int i; int i;
CellUse dummy; CellUse dummy;
@ -347,8 +347,8 @@ calmaFlattenPolygonFunc(use, parent)
*/ */
bool bool
calmaParseStructure(filename) calmaParseStructure(
char *filename; /* Name of the GDS file read */ char *filename) /* Name of the GDS file read */
{ {
static int structs[] = { CALMA_STRCLASS, CALMA_STRTYPE, -1 }; static int structs[] = { CALMA_STRCLASS, CALMA_STRTYPE, -1 };
int nbytes = -1, rtype = 0, nsrefs, osrefs, npaths; int nbytes = -1, rtype = 0, nsrefs, osrefs, npaths;
@ -675,9 +675,10 @@ syntaxerror:
*/ */
bool bool
calmaParseElement(filename, pnsrefs, pnpaths) calmaParseElement(
char *filename; char *filename,
int *pnsrefs, *pnpaths; int *pnsrefs,
int *pnpaths)
{ {
static int node[] = { CALMA_ELFLAGS, CALMA_PLEX, CALMA_LAYER, static int node[] = { CALMA_ELFLAGS, CALMA_PLEX, CALMA_LAYER,
CALMA_NODETYPE, CALMA_XY, -1 }; CALMA_NODETYPE, CALMA_XY, -1 };
@ -737,9 +738,9 @@ calmaParseElement(filename, pnsrefs, pnpaths)
*/ */
int int
calmaEnumFunc(tile, plane) calmaEnumFunc(
Tile *tile; Tile *tile,
int *plane; int *plane)
{ {
return 1; return 1;
} }
@ -764,8 +765,8 @@ calmaEnumFunc(tile, plane)
*/ */
int int
calmaElementSref(filename) calmaElementSref(
char *filename; char *filename)
{ {
int nbytes, rtype, cols, rows, nref, n, i, savescale; int nbytes, rtype, cols, rows, nref, n, i, savescale;
int xlo, ylo, xhi, yhi, xsep, ysep; int xlo, ylo, xhi, yhi, xsep, ysep;
@ -1232,9 +1233,9 @@ calmaElementSref(filename)
/* Callback function for determining if a cell has at least one subcell */ /* Callback function for determining if a cell has at least one subcell */
int int
gdsHasUses(use, clientdata) gdsHasUses(
CellUse *use; CellUse *use,
ClientData clientdata; ClientData clientdata)
{ {
return 1; return 1;
} }
@ -1242,9 +1243,9 @@ gdsHasUses(use, clientdata)
/* Callback function for copying paint from one CIF cell into another */ /* Callback function for copying paint from one CIF cell into another */
int int
gdsCopyPaintFunc(tile, gdsCopyRec) gdsCopyPaintFunc(
Tile *tile; Tile *tile,
GDSCopyRec *gdsCopyRec; GDSCopyRec *gdsCopyRec)
{ {
int pNum; int pNum;
TileType dinfo; TileType dinfo;
@ -1289,8 +1290,8 @@ gdsCopyPaintFunc(tile, gdsCopyRec)
*/ */
void void
calmaUniqueCell(sname) calmaUniqueCell(
char *sname; char *sname)
{ {
HashEntry *h; HashEntry *h;
CellDef *def, *testdef; CellDef *def, *testdef;
@ -1349,14 +1350,14 @@ calmaUniqueCell(sname)
*/ */
CellDef * CellDef *
calmaFindCell(name, was_called, predefined) calmaFindCell(
char *name; /* Name of desired cell */ char *name, /* Name of desired cell */
bool *was_called; /* If this cell is in the hash table, then it bool *was_called, /* If this cell is in the hash table, then it
* was instanced before it was defined. We * was instanced before it was defined. We
* need to know this so as to avoid flattening * need to know this so as to avoid flattening
* the cell if requested. * the cell if requested.
*/ */
bool *predefined; /* If this cell was in memory before the GDS bool *predefined) /* If this cell was in memory before the GDS
* file was read, then this flag gets set. * file was read, then this flag gets set.
*/ */
@ -1431,8 +1432,8 @@ calmaFindCell(name, was_called, predefined)
*/ */
CellDef * CellDef *
calmaLookCell(name) calmaLookCell(
char *name; /* Name of desired cell */ char *name) /* Name of desired cell */
{ {
HashEntry *h; HashEntry *h;

View File

@ -73,9 +73,9 @@ bool calmaSkipBytes(int nbytes);
*/ */
bool bool
calmaReadTransform(ptrans, name) calmaReadTransform(
Transform *ptrans; /* Fill in this transform */ Transform *ptrans, /* Fill in this transform */
char *name; /* Name of subcell (for errors) */ char *name) /* Name of subcell (for errors) */
{ {
int nbytes, rtype, flags, angle; int nbytes, rtype, flags, angle;
double dangle; double dangle;
@ -205,9 +205,9 @@ calmaReadTransform(ptrans, name)
*/ */
bool bool
calmaReadI2Record(type, pvalue) calmaReadI2Record(
int type; /* Type of record expected */ int type, /* Type of record expected */
int *pvalue; /* Store value here */ int *pvalue) /* Store value here */
{ {
int nbytes, rtype, n; int nbytes, rtype, n;
@ -250,9 +250,9 @@ eof:
*/ */
bool bool
calmaReadI4Record(type, pvalue) calmaReadI4Record(
int type; /* Type of record expected */ int type, /* Type of record expected */
int *pvalue; /* Store value here */ int *pvalue) /* Store value here */
{ {
int nbytes, rtype, n; int nbytes, rtype, n;
@ -298,9 +298,9 @@ eof:
*/ */
bool bool
calmaReadStampRecord(type, stampptr) calmaReadStampRecord(
int type; int type,
int *stampptr; int *stampptr)
{ {
int nbytes, rtype; int nbytes, rtype;
struct tm gds_timestamp; struct tm gds_timestamp;
@ -371,9 +371,9 @@ eof:
*/ */
bool bool
calmaReadStringRecord(type, str) calmaReadStringRecord(
int type; int type,
char **str; char **str)
{ {
int nbytes, rtype; int nbytes, rtype;
@ -420,8 +420,8 @@ eof:
*/ */
bool bool
calmaReadR8(pd) calmaReadR8(
double *pd; /* Store result in *pd */ double *pd) /* Store result in *pd */
{ {
int i, exponent; int i, exponent;
unsigned char dchars[8]; unsigned char dchars[8];
@ -489,8 +489,8 @@ calmaReadR8(pd)
*/ */
void void
calmaSkipSet(skipwhat) calmaSkipSet(
int *skipwhat; int *skipwhat)
{ {
int *skipp; int *skipp;
int nbytes, rtype; int nbytes, rtype;
@ -533,8 +533,8 @@ skipit:
*/ */
bool bool
calmaSkipExact(type) calmaSkipExact(
int type; int type)
{ {
int nbytes, rtype; int nbytes, rtype;
@ -579,8 +579,8 @@ eof:
*/ */
bool bool
calmaSkipTo(what) calmaSkipTo(
int what; int what)
{ {
int nbytes, rtype; int nbytes, rtype;
@ -615,8 +615,8 @@ calmaSkipTo(what)
*/ */
bool bool
calmaSkipBytes(nbytes) calmaSkipBytes(
int nbytes; /* Skip this many bytes */ int nbytes) /* Skip this many bytes */
{ {
while (nbytes-- > 0) while (nbytes-- > 0)
if (FGETC(calmaInputFile) < 0) if (FGETC(calmaInputFile) < 0)

View File

@ -82,8 +82,9 @@ bool calmaReadPath(CIFPath **pathheadpp, int iscale);
*/ */
void void
calmaInputRescale(n, d) calmaInputRescale(
int n, d; int n,
int d)
{ {
HashEntry *h; HashEntry *h;
HashSearch hs; HashSearch hs;
@ -135,9 +136,9 @@ calmaInputRescale(n, d)
*/ */
void void
calmaReadPoint(p, iscale) calmaReadPoint(
Point *p; Point *p,
int iscale; int iscale)
{ {
int rescale; int rescale;
@ -205,7 +206,7 @@ calmaReadPoint(p, iscale)
*/ */
void void
calmaElementBoundary() calmaElementBoundary(void)
{ {
int dt, layer, ciftype; int dt, layer, ciftype;
CIFPath *pathheadp; CIFPath *pathheadp;
@ -406,7 +407,7 @@ calmaElementBoundary()
*/ */
void void
calmaElementBox() calmaElementBox(void)
{ {
int nbytes, rtype, npoints, savescale; int nbytes, rtype, npoints, savescale;
int dt, layer, ciftype; int dt, layer, ciftype;
@ -501,7 +502,7 @@ calmaElementBox()
*/ */
void void
calmaElementPath() calmaElementPath(void)
{ {
int nbytes = -1, rtype = 0, extend1, extend2; int nbytes = -1, rtype = 0, extend1, extend2;
int layer, dt, width, pathtype, ciftype, savescale; int layer, dt, width, pathtype, ciftype, savescale;
@ -729,7 +730,7 @@ calmaElementPath()
*/ */
void void
calmaElementText() calmaElementText(void)
{ {
static int ignore[] = { CALMA_PATHTYPE, CALMA_WIDTH, -1 }; static int ignore[] = { CALMA_PATHTYPE, CALMA_WIDTH, -1 };
char *textbody = NULL; char *textbody = NULL;
@ -1108,9 +1109,9 @@ calmaElementText()
*/ */
bool bool
calmaReadPath(pathheadpp, iscale) calmaReadPath(
CIFPath **pathheadpp; CIFPath **pathheadpp,
int iscale; int iscale)
{ {
CIFPath path, *pathtailp, *newpathp; CIFPath path, *pathtailp, *newpathp;
int nbytes, rtype, npoints, savescale; int nbytes, rtype, npoints, savescale;
@ -1215,10 +1216,10 @@ calmaReadPath(pathheadpp, iscale)
*/ */
void void
calmaLayerError(mesg, layer, dt) calmaLayerError(
char *mesg; char *mesg,
int layer; int layer,
int dt; int dt)
{ {
CalmaLayerType clt; CalmaLayerType clt;
HashEntry *he; HashEntry *he;

View File

@ -167,9 +167,9 @@ int calmaElementIgnore[] = { CALMA_ELFLAGS, CALMA_PLEX, -1 };
*/ */
void void
CalmaReadFile(file, filename) CalmaReadFile(
FILETYPE file; /* File from which to read Calma */ FILETYPE file, /* File from which to read Calma */
char *filename; /* The real name of the file read */ char *filename) /* The real name of the file read */
{ {
int k, version; int k, version;
char *libname = NULL, *libnameptr = NULL; char *libname = NULL, *libnameptr = NULL;
@ -347,7 +347,7 @@ done:
*/ */
bool bool
calmaParseUnits() calmaParseUnits(void)
{ {
int nbytes, rtype = 0; int nbytes, rtype = 0;
double metersPerDBUnit; double metersPerDBUnit;
@ -458,7 +458,8 @@ calmaParseUnits()
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void CalmaReadError(char *format, ...) void
CalmaReadError(char *format, ...)
{ {
va_list args; va_list args;
OFFTYPE filepos; OFFTYPE filepos;
@ -515,9 +516,9 @@ void CalmaReadError(char *format, ...)
*/ */
void void
calmaUnexpected(wanted, got) calmaUnexpected(
int wanted; /* Type of record we wanted */ int wanted, /* Type of record we wanted */
int got; /* Type of record we got */ int got) /* Type of record we got */
{ {
CalmaReadError("Unexpected record type in input: \n"); CalmaReadError("Unexpected record type in input: \n");
@ -558,8 +559,8 @@ calmaUnexpected(wanted, got)
*/ */
char * char *
calmaRecordName(rtype) calmaRecordName(
int rtype; int rtype)
{ {
static char numeric[10]; static char numeric[10];
static char *calmaRecordNames[] = static char *calmaRecordNames[] =
@ -607,7 +608,7 @@ calmaRecordName(rtype)
*/ */
void void
CalmaTechInit() CalmaTechInit(void)
{ {
ASSERT(sizeof(FourByteInt)==4, "definition in calmaInt.h"); ASSERT(sizeof(FourByteInt)==4, "definition in calmaInt.h");
ASSERT(sizeof(TwoByteInt)==2, "definition in calmaInt.h"); ASSERT(sizeof(TwoByteInt)==2, "definition in calmaInt.h");

View File

@ -291,9 +291,9 @@ static char calmaMapTablePermissive[] =
*/ */
bool bool
CalmaWrite(rootDef, f) CalmaWrite(
CellDef *rootDef; /* Pointer to CellDef to be written */ CellDef *rootDef, /* Pointer to CellDef to be written */
FILE *f; /* Open output file */ FILE *f) /* Open output file */
{ {
int oldCount = DBWFeedbackCount, problems, nerr; int oldCount = DBWFeedbackCount, problems, nerr;
bool good; bool good;
@ -418,11 +418,11 @@ CalmaWrite(rootDef, f)
*/ */
bool bool
calmaDumpStructure(def, outf, calmaDefHash, filename) calmaDumpStructure(
CellDef *def; CellDef *def,
FILE *outf; FILE *outf,
HashTable *calmaDefHash; HashTable *calmaDefHash,
char *filename; char *filename)
{ {
int nbytes = -1, rtype = 0; int nbytes = -1, rtype = 0;
char *strname = NULL, *newnameptr; char *strname = NULL, *newnameptr;
@ -688,11 +688,11 @@ syntaxerror:
*/ */
void void
calmaFullDump(def, fi, outf, filename) calmaFullDump(
CellDef *def; CellDef *def,
FILETYPE fi; FILETYPE fi,
FILE *outf; FILE *outf,
char *filename; char *filename)
{ {
int version, rval; int version, rval;
char *libname = NULL, *testlib, uniqlibname[4]; char *libname = NULL, *testlib, uniqlibname[4];
@ -832,8 +832,8 @@ done:
*/ */
int int
calmaWriteInitFunc(def) calmaWriteInitFunc(
CellDef *def; CellDef *def)
{ {
def->cd_client = (ClientData) 0; def->cd_client = (ClientData) 0;
return (0); return (0);
@ -863,18 +863,18 @@ calmaWriteInitFunc(def)
*/ */
int int
calmaProcessUse(use, outf) calmaProcessUse(
CellUse *use; /* Process use->cu_def */ CellUse *use, /* Process use->cu_def */
FILE *outf; /* Stream file */ FILE *outf) /* Stream file */
{ {
return (calmaProcessDef(use->cu_def, outf, FALSE)); return (calmaProcessDef(use->cu_def, outf, FALSE));
} }
int int
calmaProcessDef(def, outf, do_library) calmaProcessDef(
CellDef *def; /* Output this def's children, then the def itself */ CellDef *def, /* Output this def's children, then the def itself */
FILE *outf; /* Stream file */ FILE *outf, /* Stream file */
bool do_library; /* If TRUE, output only children of def, but not def */ bool do_library) /* If TRUE, output only children of def, but not def */
{ {
char *filename; char *filename;
int polyidx; int polyidx;
@ -1295,10 +1295,10 @@ compport(const void *one, const void *two)
*/ */
void void
calmaOutFunc(def, f, cliprect) calmaOutFunc(
CellDef *def; /* Pointer to cell def to be written */ CellDef *def, /* Pointer to cell def to be written */
FILE *f; /* Open output file */ FILE *f, /* Open output file */
Rect *cliprect; /* Area to clip to (used for contact cells), Rect *cliprect) /* Area to clip to (used for contact cells),
* in CIF/GDS coordinates. * in CIF/GDS coordinates.
*/ */
{ {
@ -1490,9 +1490,9 @@ calmaOutFunc(def, f, cliprect)
*/ */
bool bool
calmaIsUseNameDefault(defName, useName) calmaIsUseNameDefault(
char *defName; char *defName,
char *useName; char *useName)
{ {
int idx, slen; int idx, slen;
char *sptr; char *sptr;
@ -1530,9 +1530,9 @@ calmaIsUseNameDefault(defName, useName)
*/ */
int int
calmaWriteUseFunc(use, f) calmaWriteUseFunc(
CellUse *use; CellUse *use,
FILE *f; FILE *f)
{ {
/* /*
* r90, r180, and r270 are Calma 8-byte real representations * r90, r180, and r270 are Calma 8-byte real representations
@ -1745,10 +1745,10 @@ calmaWriteUseFunc(use, f)
*/ */
void void
calmaOutStructName(type, def, f) calmaOutStructName(
int type; int type,
CellDef *def; CellDef *def,
FILE *f; FILE *f)
{ {
char *defname; char *defname;
unsigned char c; unsigned char c;
@ -1818,9 +1818,9 @@ bad:
*/ */
CellDef * CellDef *
calmaGetContactCell(type, lookOnly) calmaGetContactCell(
TileType type; /* magic contact tile type */ TileType type, /* magic contact tile type */
bool lookOnly; /* if true, don't generate any new cells */ bool lookOnly) /* if true, don't generate any new cells */
{ {
TileType j; TileType j;
char contactCellName[100]; char contactCellName[100];
@ -1871,14 +1871,16 @@ calmaGetContactCell(type, lookOnly)
*/ */
bool bool
CalmaGenerateArray(f, type, llx, lly, pitch, cols, rows) CalmaGenerateArray(
FILE *f; /* GDS output file */ FILE *f, /* GDS output file */
TileType type; /* Magic tile type of contact */ TileType type, /* Magic tile type of contact */
int llx, lly; /* Lower-left hand coordinate of the array int llx,
int lly, /* Lower-left hand coordinate of the array
* (centered on contact cut) * (centered on contact cut)
*/ */
int pitch; /* Pitch of the array elements */ int pitch, /* Pitch of the array elements */
int cols, rows; /* Number of array elements in X and Y */ int cols,
int rows) /* Number of array elements in X and Y */
{ {
CellDef *child; /* Cell definition of the contact cell */ CellDef *child; /* Cell definition of the contact cell */
int xxlate, yxlate; int xxlate, yxlate;
@ -1940,8 +1942,8 @@ CalmaGenerateArray(f, type, llx, lly, pitch, cols, rows)
*/ */
void void
calmaWriteContacts(f) calmaWriteContacts(
FILE *f; FILE *f)
{ {
TileType type; TileType type;
TileTypeBitMask tMask, *rMask; TileTypeBitMask tMask, *rMask;
@ -2026,7 +2028,7 @@ calmaWriteContacts(f)
*/ */
void void
calmaDelContacts() calmaDelContacts(void)
{ {
TileType type; TileType type;
CellDef *def; CellDef *def;
@ -2064,10 +2066,13 @@ calmaDelContacts()
*/ */
int int
calmaAddSegment(lbptr, poly_edge, p1x, p1y, p2x, p2y) calmaAddSegment(
LinkedBoundary **lbptr; LinkedBoundary **lbptr,
bool poly_edge; bool poly_edge,
int p1x, p1y, p2x, p2y; int p1x,
int p1y,
int p2x,
int p2y)
{ {
LinkedBoundary *newseg, *curseg, *stopseg; LinkedBoundary *newseg, *curseg, *stopseg;
bool startmatch = FALSE; bool startmatch = FALSE;
@ -2139,8 +2144,8 @@ calmaAddSegment(lbptr, poly_edge, p1x, p1y, p2x, p2y)
*/ */
void void
calmaRemoveDegenerate(blist) calmaRemoveDegenerate(
BoundaryTop *blist; BoundaryTop *blist)
{ {
bool segfound; bool segfound;
LinkedBoundary *stopseg, *curseg, *lastseg; LinkedBoundary *stopseg, *curseg, *lastseg;
@ -2196,8 +2201,8 @@ calmaRemoveDegenerate(blist)
*/ */
void void
calmaRemoveColinear(blist) calmaRemoveColinear(
BoundaryTop *blist; BoundaryTop *blist)
{ {
LinkedBoundary *stopseg, *curseg, *lastseg; LinkedBoundary *stopseg, *curseg, *lastseg;
BoundaryTop *bounds; BoundaryTop *bounds;
@ -2294,10 +2299,10 @@ calmaRemoveColinear(blist)
*/ */
void void
calmaMergeSegments(edge, blist, num_points) calmaMergeSegments(
LinkedBoundary *edge; LinkedBoundary *edge,
BoundaryTop **blist; BoundaryTop **blist,
int num_points; int num_points)
{ {
LinkedBoundary *stopseg, *curseg, *lastseg; LinkedBoundary *stopseg, *curseg, *lastseg;
LinkedBoundary *compstop, *compseg, *complast; LinkedBoundary *compstop, *compseg, *complast;
@ -2380,9 +2385,9 @@ make_new_bound:
*/ */
void void
calmaProcessBoundary(blist, cos) calmaProcessBoundary(
BoundaryTop *blist; BoundaryTop *blist,
calmaOutputStruct *cos; calmaOutputStruct *cos)
{ {
FILE *f = cos->f; FILE *f = cos->f;
LinkedBoundary *listtop, *lbref, *lbstop, *lbfree; LinkedBoundary *listtop, *lbref, *lbstop, *lbfree;
@ -2490,9 +2495,9 @@ calmaProcessBoundary(blist, cos)
*/ */
int int
calmaMergePaintFunc(tile, cos) calmaMergePaintFunc(
Tile *tile; /* Tile to be written out. */ Tile *tile, /* Tile to be written out. */
calmaOutputStruct *cos; /* Information needed by algorithm */ calmaOutputStruct *cos) /* Information needed by algorithm */
{ {
FILE *f = cos->f; FILE *f = cos->f;
Rect *clipArea = cos->area; Rect *clipArea = cos->area;
@ -2813,9 +2818,9 @@ done_searches:
*/ */
int int
calmaWritePaintFunc(tile, cos) calmaWritePaintFunc(
Tile *tile; /* Tile to be written out. */ Tile *tile, /* Tile to be written out. */
calmaOutputStruct *cos; /* File for output and clipping area */ calmaOutputStruct *cos) /* File for output and clipping area */
{ {
FILE *f = cos->f; FILE *f = cos->f;
Rect *clipArea = cos->area; Rect *clipArea = cos->area;
@ -2918,13 +2923,13 @@ calmaWritePaintFunc(tile, cos)
*/ */
void void
calmaWriteLabelFunc(lab, ltype, type, f) calmaWriteLabelFunc(
Label *lab; /* Label to output */ Label *lab, /* Label to output */
int ltype; /* CIF layer number to use for TEXT record */ int ltype, /* CIF layer number to use for TEXT record */
int type; /* CIF layer number to use for BOUNDARY record, int type, /* CIF layer number to use for BOUNDARY record,
* or -1 if not attached to a layer * or -1 if not attached to a layer
*/ */
FILE *f; /* Stream file */ FILE *f) /* Stream file */
{ {
Point p; Point p;
int calmanum, calmatype; int calmanum, calmatype;
@ -3089,9 +3094,9 @@ calmaWriteLabelFunc(lab, ltype, type, f)
*/ */
int int
calmaPaintLabelFunc(tile, cos) calmaPaintLabelFunc(
Tile *tile; /* Tile contains area for label. */ Tile *tile, /* Tile contains area for label. */
calmaOutputStruct *cos; /* File for output and clipping area */ calmaOutputStruct *cos) /* File for output and clipping area */
{ {
FILE *f = cos->f; FILE *f = cos->f;
Rect *clipArea = cos->area; Rect *clipArea = cos->area;
@ -3150,9 +3155,9 @@ calmaPaintLabelFunc(tile, cos)
*/ */
void void
calmaOutHeader(rootDef, f) calmaOutHeader(
CellDef *rootDef; CellDef *rootDef,
FILE *f; FILE *f)
{ {
static double useru = 0.001; static double useru = 0.001;
static double mum = 1.0e-9; static double mum = 1.0e-9;
@ -3211,9 +3216,9 @@ calmaOutHeader(rootDef, f)
*/ */
void void
calmaOutDate(t, f) calmaOutDate(
time_t t; /* Time (UNIX format) to be output */ time_t t, /* Time (UNIX format) to be output */
FILE *f; /* Stream file */ FILE *f) /* Stream file */
{ {
struct tm *datep = localtime(&t); struct tm *datep = localtime(&t);
@ -3246,10 +3251,10 @@ calmaOutDate(t, f)
*/ */
void void
calmaOutStringRecord(type, str, f) calmaOutStringRecord(
int type; /* Type of this record (data type is ASCII string) */ int type, /* Type of this record (data type is ASCII string) */
char *str; /* String to be output */ char *str, /* String to be output */
FILE *f; /* Stream file */ FILE *f) /* Stream file */
{ {
int len; int len;
unsigned char c; unsigned char c;
@ -3347,9 +3352,9 @@ calmaOutStringRecord(type, str, f)
*/ */
void void
calmaOutR8(d, f) calmaOutR8(
double d; /* Double value to write to output */ double d, /* Double value to write to output */
FILE *f; /* Stream file */ FILE *f) /* Stream file */
{ {
int c, i, sign, expon; int c, i, sign, expon;
@ -3422,9 +3427,9 @@ calmaOutR8(d, f)
*/ */
void void
calmaOut8(str, f) calmaOut8(
char *str; /* 8-byte string to be output */ char *str, /* 8-byte string to be output */
FILE *f; /* Stream file */ FILE *f) /* Stream file */
{ {
int i; int i;

View File

@ -271,9 +271,9 @@ static char calmaMapTablePermissive[] =
*/ */
bool bool
CalmaWriteZ(rootDef, f) CalmaWriteZ(
CellDef *rootDef; /* Pointer to CellDef to be written */ CellDef *rootDef, /* Pointer to CellDef to be written */
gzFile f; /* Open compressed output file */ gzFile f) /* Open compressed output file */
{ {
int oldCount = DBWFeedbackCount, problems, nerr; int oldCount = DBWFeedbackCount, problems, nerr;
bool good; bool good;
@ -399,11 +399,11 @@ CalmaWriteZ(rootDef, f)
*/ */
bool bool
calmaDumpStructureZ(def, outf, calmaDefHash, filename) calmaDumpStructureZ(
CellDef *def; CellDef *def,
gzFile outf; gzFile outf,
HashTable *calmaDefHash; HashTable *calmaDefHash,
char *filename; char *filename)
{ {
int nbytes = -1, rtype = 0; int nbytes = -1, rtype = 0;
char *strname = NULL, *newnameptr; char *strname = NULL, *newnameptr;
@ -669,11 +669,11 @@ syntaxerror:
*/ */
void void
calmaFullDumpZ(def, fi, outf, filename) calmaFullDumpZ(
CellDef *def; CellDef *def,
gzFile fi; gzFile fi,
gzFile outf; gzFile outf,
char *filename; char *filename)
{ {
int version, rval; int version, rval;
char *libname = NULL, *testlib, uniqlibname[4]; char *libname = NULL, *testlib, uniqlibname[4];
@ -817,18 +817,18 @@ done:
*/ */
int int
calmaProcessUseZ(use, outf) calmaProcessUseZ(
CellUse *use; /* Process use->cu_def */ CellUse *use, /* Process use->cu_def */
gzFile outf; /* Stream file */ gzFile outf) /* Stream file */
{ {
return (calmaProcessDefZ(use->cu_def, outf, FALSE)); return (calmaProcessDefZ(use->cu_def, outf, FALSE));
} }
int int
calmaProcessDefZ(def, outf, do_library) calmaProcessDefZ(
CellDef *def; /* Output this def's children, then the def itself */ CellDef *def, /* Output this def's children, then the def itself */
gzFile outf; /* Stream file */ gzFile outf, /* Stream file */
bool do_library; /* If TRUE, output only children of def, but not def */ bool do_library) /* If TRUE, output only children of def, but not def */
{ {
char *filename; char *filename;
int polyidx; int polyidx;
@ -1176,10 +1176,10 @@ calmaProcessDefZ(def, outf, do_library)
*/ */
void void
calmaOutFuncZ(def, f, cliprect) calmaOutFuncZ(
CellDef *def; /* Pointer to cell def to be written */ CellDef *def, /* Pointer to cell def to be written */
gzFile f; /* Open output file */ gzFile f, /* Open output file */
Rect *cliprect; /* Area to clip to (used for contact cells), Rect *cliprect) /* Area to clip to (used for contact cells),
* in CIF/GDS coordinates. * in CIF/GDS coordinates.
*/ */
{ {
@ -1371,9 +1371,9 @@ calmaOutFuncZ(def, f, cliprect)
*/ */
int int
calmaWriteUseFuncZ(use, f) calmaWriteUseFuncZ(
CellUse *use; CellUse *use,
gzFile f; gzFile f)
{ {
/* /*
* r90, r180, and r270 are Calma 8-byte real representations * r90, r180, and r270 are Calma 8-byte real representations
@ -1586,10 +1586,10 @@ calmaWriteUseFuncZ(use, f)
*/ */
void void
calmaOutStructNameZ(type, def, f) calmaOutStructNameZ(
int type; int type,
CellDef *def; CellDef *def,
gzFile f; gzFile f)
{ {
char *defname; char *defname;
unsigned char c; unsigned char c;
@ -1655,14 +1655,16 @@ bad:
*/ */
bool bool
CalmaGenerateArrayZ(f, type, llx, lly, pitch, cols, rows) CalmaGenerateArrayZ(
gzFile f; /* GDS output file */ gzFile f, /* GDS output file */
TileType type; /* Magic tile type of contact */ TileType type, /* Magic tile type of contact */
int llx, lly; /* Lower-left hand coordinate of the array int llx,
int lly, /* Lower-left hand coordinate of the array
* (centered on contact cut) * (centered on contact cut)
*/ */
int pitch; /* Pitch of the array elements */ int pitch, /* Pitch of the array elements */
int cols, rows; /* Number of array elements in X and Y */ int cols,
int rows) /* Number of array elements in X and Y */
{ {
CellDef *child; /* Cell definition of the contact cell */ CellDef *child; /* Cell definition of the contact cell */
int xxlate, yxlate; int xxlate, yxlate;
@ -1723,8 +1725,8 @@ CalmaGenerateArrayZ(f, type, llx, lly, pitch, cols, rows)
*/ */
void void
calmaWriteContactsZ(f) calmaWriteContactsZ(
gzFile f; gzFile f)
{ {
TileType type; TileType type;
TileTypeBitMask tMask, *rMask; TileTypeBitMask tMask, *rMask;
@ -1806,9 +1808,9 @@ calmaWriteContactsZ(f)
*/ */
void void
calmaProcessBoundaryZ(blist, cos) calmaProcessBoundaryZ(
BoundaryTop *blist; BoundaryTop *blist,
calmaOutputStructZ *cos; calmaOutputStructZ *cos)
{ {
gzFile f = cos->f; gzFile f = cos->f;
LinkedBoundary *listtop, *lbref, *lbstop, *lbfree; LinkedBoundary *listtop, *lbref, *lbstop, *lbfree;
@ -1886,9 +1888,9 @@ calmaProcessBoundaryZ(blist, cos)
*/ */
int int
calmaMergePaintFuncZ(tile, cos) calmaMergePaintFuncZ(
Tile *tile; /* Tile to be written out. */ Tile *tile, /* Tile to be written out. */
calmaOutputStructZ *cos; /* Information needed by algorithm */ calmaOutputStructZ *cos) /* Information needed by algorithm */
{ {
gzFile f = cos->f; gzFile f = cos->f;
Rect *clipArea = cos->area; Rect *clipArea = cos->area;
@ -2209,9 +2211,9 @@ done_searches:
*/ */
int int
calmaWritePaintFuncZ(tile, cos) calmaWritePaintFuncZ(
Tile *tile; /* Tile to be written out. */ Tile *tile, /* Tile to be written out. */
calmaOutputStructZ *cos; /* File for output and clipping area */ calmaOutputStructZ *cos) /* File for output and clipping area */
{ {
gzFile f = cos->f; gzFile f = cos->f;
Rect *clipArea = cos->area; Rect *clipArea = cos->area;
@ -2314,13 +2316,13 @@ calmaWritePaintFuncZ(tile, cos)
*/ */
void void
calmaWriteLabelFuncZ(lab, ltype, type, f) calmaWriteLabelFuncZ(
Label *lab; /* Label to output */ Label *lab, /* Label to output */
int ltype; /* CIF layer number to use for TEXT record */ int ltype, /* CIF layer number to use for TEXT record */
int type; /* CIF layer number to use for BOUNDARY record, int type, /* CIF layer number to use for BOUNDARY record,
* or -1 if not attached to a layer * or -1 if not attached to a layer
*/ */
gzFile f; /* Stream file */ gzFile f) /* Stream file */
{ {
Point p; Point p;
int calmanum, calmatype; int calmanum, calmatype;
@ -2485,9 +2487,9 @@ calmaWriteLabelFuncZ(lab, ltype, type, f)
*/ */
int int
calmaPaintLabelFuncZ(tile, cos) calmaPaintLabelFuncZ(
Tile *tile; /* Tile contains area for label. */ Tile *tile, /* Tile contains area for label. */
calmaOutputStructZ *cos; /* File for output and clipping area */ calmaOutputStructZ *cos) /* File for output and clipping area */
{ {
gzFile f = cos->f; gzFile f = cos->f;
Rect *clipArea = cos->area; Rect *clipArea = cos->area;
@ -2546,9 +2548,9 @@ calmaPaintLabelFuncZ(tile, cos)
*/ */
void void
calmaOutHeaderZ(rootDef, f) calmaOutHeaderZ(
CellDef *rootDef; CellDef *rootDef,
gzFile f; gzFile f)
{ {
static double useru = 0.001; static double useru = 0.001;
static double mum = 1.0e-9; static double mum = 1.0e-9;
@ -2607,9 +2609,9 @@ calmaOutHeaderZ(rootDef, f)
*/ */
void void
calmaOutDateZ(t, f) calmaOutDateZ(
time_t t; /* Time (UNIX format) to be output */ time_t t, /* Time (UNIX format) to be output */
gzFile f; /* Stream file */ gzFile f) /* Stream file */
{ {
struct tm *datep = localtime(&t); struct tm *datep = localtime(&t);
@ -2642,10 +2644,10 @@ calmaOutDateZ(t, f)
*/ */
void void
calmaOutStringRecordZ(type, str, f) calmaOutStringRecordZ(
int type; /* Type of this record (data type is ASCII string) */ int type, /* Type of this record (data type is ASCII string) */
char *str; /* String to be output */ char *str, /* String to be output */
gzFile f; /* Compressed stream file */ gzFile f) /* Compressed stream file */
{ {
int len; int len;
unsigned char c; unsigned char c;
@ -2743,9 +2745,9 @@ calmaOutStringRecordZ(type, str, f)
*/ */
void void
calmaOutR8Z(d, f) calmaOutR8Z(
double d; /* Double value to write to output */ double d, /* Double value to write to output */
gzFile f; /* Stream file */ gzFile f) /* Stream file */
{ {
int c, i, sign, expon; int c, i, sign, expon;
@ -2818,9 +2820,9 @@ calmaOutR8Z(d, f)
*/ */
void void
calmaOut8Z(str, f) calmaOut8Z(
char *str; /* 8-byte string to be output */ char *str, /* 8-byte string to be output */
gzFile f; /* Compressed stream file */ gzFile f) /* Compressed stream file */
{ {
int i; int i;