From ad6ecb5bbb66ffc16ab620b0a44dca47ee129e0a Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Sat, 4 Jan 2025 09:00:08 +0000 Subject: [PATCH] lef/*.h: constify string function arguments --- lef/defRead.c | 2 +- lef/lef.h | 2 +- lef/lefInt.h | 14 +++++++------- lef/lefRead.c | 12 ++++++------ lef/lefTech.c | 2 +- lef/lefWrite.c | 12 ++++++------ 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lef/defRead.c b/lef/defRead.c index e5ed39f9..8610a4d3 100644 --- a/lef/defRead.c +++ b/lef/defRead.c @@ -2385,7 +2385,7 @@ enum def_sections {DEF_VERSION = 0, DEF_NAMESCASESENSITIVE, void DefRead( - char *inName, + const char *inName, bool dolabels, bool annotate, bool noblockage) diff --git a/lef/lef.h b/lef/lef.h index 427751ac..1d64c5e6 100644 --- a/lef/lef.h +++ b/lef/lef.h @@ -14,7 +14,7 @@ /* Procedures for reading the technology file: */ extern void LefTechInit(void); -extern bool LefTechLine(char *sectionName, int argc, char *argv[]); +extern bool LefTechLine(const char *sectionName, int argc, char *argv[]); extern void LefTechScale(int scalen, int scaled); extern void LefTechSetDefaults(void); diff --git a/lef/lefInt.h b/lef/lefInt.h index d0c4f2c0..16060b33 100644 --- a/lef/lefInt.h +++ b/lef/lefInt.h @@ -143,24 +143,24 @@ extern linkedNetName *lefIgnoreNets; extern int lefDefInitFunc(CellDef *def); extern int lefDefPushFunc(CellUse *use, bool *recurse); -extern FILE *lefFileOpen(CellDef *def, char *file, char *suffix, char *mode, char **prealfile); +extern FILE *lefFileOpen(CellDef *def, const char *file, const char *suffix, const char *mode, char **prealfile); extern int LefParseEndStatement(FILE *f, const char *match); extern void LefSkipSection(FILE *f, const char *section); extern void LefEndStatement(FILE *f); -extern CellDef *lefFindCell(char *name); +extern CellDef *lefFindCell(const char *name); extern char *LefNextToken(FILE *f, bool ignore_eol); extern char *LefLower(char *token); extern LinkedRect *LefReadGeometry(CellDef *lefMacro, FILE *f, float oscale, bool do_list, bool is_imported); -extern void LefEstimate(int processed, int total, char *item_name); -extern lefLayer *LefRedefined(lefLayer *lefl, char *redefname); +extern void LefEstimate(int processed, int total, const char *item_name); +extern lefLayer *LefRedefined(lefLayer *lefl, const char *redefname); extern void LefAddViaGeometry(FILE *f, lefLayer *lefl, TileType curlayer, float oscale); extern void LefGenViaGeometry(FILE *f, lefLayer *lefl, int sizex, int sizey, int spacex, int spacey, int encbx, int encby, int enctx, int encty, int rows, int cols, TileType tlayer, TileType clayer, TileType blayer, float oscale); extern Rect *LefReadRect(FILE *f, TileType curlayer, float oscale); extern TileType LefReadLayer(FILE *f, bool obstruct); -extern void LefReadLayerSection(FILE *f, char *lname, int mode, lefLayer *lefl); +extern void LefReadLayerSection(FILE *f, const char *lname, int mode, lefLayer *lefl); extern LefMapping *defMakeInverseLayerMap(bool do_vias); @@ -168,8 +168,8 @@ extern LefMapping *defMakeInverseLayerMap(bool do_vias); extern void LefError(int type, const char *fmt, ...) ATTR_FORMAT_PRINTF_2; /* C99 compat */ -extern void LefRead(char *inName, bool importForeign, bool doAnnotate, int lefTimestamp); -extern void DefRead(char *inName, bool dolabels, bool annotate, bool noblockage); +extern void LefRead(const char *inName, bool importForeign, bool doAnnotate, int lefTimestamp); +extern void DefRead(const char *inName, bool dolabels, bool annotate, bool noblockage); extern void LefWriteAll(CellUse *rootUse, bool writeTopCell, bool lefTech, int lefHide, int lefPinOnly, bool lefTopLayer, bool lefDoMaster, bool recurse); diff --git a/lef/lefRead.c b/lef/lefRead.c index b2fb3ce5..378d4481 100644 --- a/lef/lefRead.c +++ b/lef/lefRead.c @@ -85,7 +85,7 @@ void LefEstimate( int processed, int total, - char *item_name) + const char *item_name) { static int check_interval, partition; static struct timeval tv_start; @@ -140,7 +140,7 @@ void LefEstimate( int processed, int total, - char *item_name) + const char *item_name) { static int check_interval, partition; static struct timeval tv_start; @@ -574,7 +574,7 @@ LefSkipSection( CellDef * lefFindCell( - char *name) /* Name of the cell to search for */ + const char *name) /* Name of the cell to search for */ { HashEntry *h; CellDef *def; @@ -638,7 +638,7 @@ LefLower( lefLayer * LefRedefined( lefLayer *lefl, - char *redefname) + const char *redefname) { lefLayer *slef, *newlefl; char *altName; @@ -2656,7 +2656,7 @@ enum lef_layer_keys {LEF_LAYER_TYPE=0, LEF_LAYER_WIDTH, void LefReadLayerSection( FILE *f, /* LEF file being read */ - char *lname, /* name of the layer */ + const char *lname, /* name of the layer */ int mode, /* layer, via, or viarule */ lefLayer *lefl) /* pointer to layer info */ { @@ -2892,7 +2892,7 @@ enum lef_sections {LEF_VERSION = 0, void LefRead( - char *inName, + const char *inName, bool importForeign, bool doAnnotate, int lefTimestamp) diff --git a/lef/lefTech.c b/lef/lefTech.c index 75c3401c..8e58c2f4 100644 --- a/lef/lefTech.c +++ b/lef/lefTech.c @@ -203,7 +203,7 @@ lefRemoveGeneratedVias(void) bool LefTechLine( - char *sectionName, /* Name of this section (unused). */ + const char *sectionName, /* Name of this section (unused). */ int argc, /* Number of arguments on line. */ char *argv[]) /* Pointers to fields of line. */ { diff --git a/lef/lefWrite.c b/lef/lefWrite.c index 49178868..57439d3c 100644 --- a/lef/lefWrite.c +++ b/lef/lefWrite.c @@ -151,21 +151,21 @@ lefFileOpen( CellDef *def, /* Cell whose .lef file is to be written. Should * be NULL if file is being opened for reading. */ - char *file, /* If non-NULL, open 'name'.lef; otherwise, + const char *file, /* If non-NULL, open 'name'.lef; otherwise, * derive filename from 'def' as described * above. */ - char *suffix, /* Either ".lef" for LEF files or ".def" for DEF files */ - char *mode, /* Either "r" or "w", the mode in which the LEF/DEF + const char *suffix, /* Either ".lef" for LEF files or ".def" for DEF files */ + const char *mode, /* Either "r" or "w", the mode in which the LEF/DEF * file is to be opened. */ char **prealfile) /* If this is non-NULL, it gets set to point to * a string holding the name of the LEF/DEF file. */ { - char namebuf[512], *name, *endp, *ends; - char *locsuffix; - char *pptr; + const char *name, *ends, *endp; + char namebuf[512]; + const char *locsuffix; int len; FILE *rfile;