database: DBTypeLongNameTbl() constify data (const char*)

This commit is contained in:
Darryl L. Miles 2025-08-25 11:19:15 +01:00 committed by R. Timothy Edwards
parent 6d8c3eee1a
commit dc45242d46
3 changed files with 4 additions and 4 deletions

View File

@ -232,7 +232,7 @@ showTech(
fprintf(outf, "\n");
fprintf(outf, "Types:\n");
for (i = 0; i < DBNumTypes; i++) {
int pl ; char *spl ;
int pl ; const char *spl ;
pl = DBPlane(i);
spl = ( pl <= 0 || pl > DBNumPlanes ) ? "??" : DBPlaneLongName(pl);
@ -1047,7 +1047,7 @@ CmdWatch(
pNum = DBTechNamePlane(cmd->tx_argv[1]);
if (pNum < 0)
{
char *cp;
const char *cp;
TxError("Unrecognized plane: %s. Legal names are:\n",
cmd->tx_argv[1]);
for(pNum=0; pNum < PL_MAXTYPES; pNum++) {

View File

@ -38,7 +38,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
/* Types and their names */
int DBNumTypes;
char *DBTypeLongNameTbl[NT];
const char *DBTypeLongNameTbl[NT];
int DBTypePlaneTbl[NT]; /* Normally accessed as macro "DBPlane(x)" */
NameList dbTypeNameLists = {NULL, NULL, NULL, (ClientData)0, FALSE};
HashTable DBTypeAliasTable;

View File

@ -1121,7 +1121,7 @@ extern int DBTypePlaneTbl[TT_MAXTYPES];
extern PlaneMask DBTypePlaneMaskTbl[TT_MAXTYPES];
/* Gives the long name for each tile type: */
extern char *DBTypeLongNameTbl[TT_MAXTYPES];
extern const char *DBTypeLongNameTbl[TT_MAXTYPES];
/* Gives a short name for a tile type: */
extern const char *DBTypeShortName(TileType type);