database: DBTechInitPlane() consumer (DBPlaneLongNameTbl constify)

This commit is contained in:
Darryl L. Miles 2025-08-25 11:13:38 +01:00 committed by R. Timothy Edwards
parent 5093182f4a
commit c8fe30398b
4 changed files with 7 additions and 7 deletions

View File

@ -1824,7 +1824,7 @@ CmdGoto(
/* are multiple layers drawn at the indicated point. */ /* are multiple layers drawn at the indicated point. */
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
Tcl_SetResult(magicinterp, DBTypeLongName(ttype), NULL); Tcl_SetResult(magicinterp, (char*)DBTypeLongName(ttype), NULL); /* Tcl treats as const */
#else #else
TxPrintf("node %s is type %s\n", s, DBTypeLongName(ttype)); TxPrintf("node %s is type %s\n", s, DBTypeLongName(ttype));
#endif #endif

View File

@ -2534,7 +2534,7 @@ CmdSetLabel(
else else
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
Tcl_SetResult(magicinterp, Tcl_SetResult(magicinterp,
DBTypeLongNameTbl[DefaultLabel->lab_type], (char*)DBTypeLongNameTbl[DefaultLabel->lab_type], /* Tcl treats as const */
TCL_VOLATILE); TCL_VOLATILE);
#else #else
TxPrintf("%s\n", DBTypeLongNameTbl[DefaultLabel->lab_type]); TxPrintf("%s\n", DBTypeLongNameTbl[DefaultLabel->lab_type]);

View File

@ -45,7 +45,7 @@ HashTable DBTypeAliasTable;
/* Planes and their names */ /* Planes and their names */
int DBNumPlanes; int DBNumPlanes;
char *DBPlaneLongNameTbl[PL_MAXTYPES]; const char *DBPlaneLongNameTbl[PL_MAXTYPES];
NameList dbPlaneNameLists = {NULL, NULL, NULL, (ClientData)0, FALSE}; NameList dbPlaneNameLists = {NULL, NULL, NULL, (ClientData)0, FALSE};
@ -116,10 +116,10 @@ NameList *dbTechNameAddOne();
*/ */
void void
DBTechInitPlane() DBTechInitPlane(void)
{ {
DefaultPlane *dpp; DefaultPlane *dpp;
char *cp; const char *cp;
/* Clear out any old information */ /* Clear out any old information */
if (dbPlaneNameLists.sn_next != NULL) if (dbPlaneNameLists.sn_next != NULL)

View File

@ -785,7 +785,7 @@ extern int DBTechNamePlane(), DBTechNoisyNamePlane();
extern PlaneMask DBTechNameMask(), DBTechNoisyNameMask(); extern PlaneMask DBTechNameMask(), DBTechNoisyNameMask();
extern PlaneMask DBTechTypesToPlanes(); extern PlaneMask DBTechTypesToPlanes();
extern bool DBTechTypesOnPlane(); extern bool DBTechTypesOnPlane();
extern void DBTechInitPlane(); extern void DBTechInitPlane(void);
extern void DBTypeInit(); extern void DBTypeInit();
extern void DBTechInitType(); extern void DBTechInitType();
extern void DBTechInitCompose(); extern void DBTechInitCompose();
@ -1059,7 +1059,7 @@ extern int DBNumPlanes;
extern HashTable DBTypeAliasTable; extern HashTable DBTypeAliasTable;
/* Gives the official long name of each plane: */ /* Gives the official long name of each plane: */
extern char *DBPlaneLongNameTbl[NP]; extern const char *DBPlaneLongNameTbl[NP];
/* Gives a short name for each plane: */ /* Gives a short name for each plane: */
extern const char *DBPlaneShortName(); extern const char *DBPlaneShortName();