Change char * to const char *

This commit is contained in:
Evan Miller 2020-08-20 15:46:06 -04:00
parent 0f017883f6
commit e743949e47
2 changed files with 4 additions and 4 deletions

View File

@ -470,7 +470,7 @@ void mdb_free_catalog(MdbHandle *mdb);
GPtrArray *mdb_read_catalog(MdbHandle *mdb, int obj_type);
MdbCatalogEntry *mdb_get_catalogentry_by_name(MdbHandle *mdb, const gchar* name);
void mdb_dump_catalog(MdbHandle *mdb, int obj_type);
char *mdb_get_objtype_string(int obj_type);
const char *mdb_get_objtype_string(int obj_type);
/* table.c */
MdbTableDef *mdb_alloc_tabledef(MdbCatalogEntry *entry);

View File

@ -18,10 +18,10 @@
#include "mdbtools.h"
char *
const char *
mdb_get_objtype_string(int obj_type)
{
static char *type_name[] = {"Form",
static const char *type_name[] = {"Form",
"Table",
"Macro",
"System Table",
@ -35,7 +35,7 @@ static char *type_name[] = {"Form",
"Database"
};
if (obj_type > 11) {
if (obj_type >= (int)(sizeof(type_name)/sizeof(type_name[0]))) {
return NULL;
} else {
return type_name[obj_type];