Commit 16f64d3e authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add static const specification to immutable string table.

parent 486e4609
......@@ -578,7 +578,7 @@ int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen, char
/* GRID routines */
void gridName(int gridtype, char *gridname);
char *gridNamePtr(int gridtype);
const char *gridNamePtr(int gridtype);
void gridCompress(int gridID);
......
......@@ -279,7 +279,7 @@ void stream_check_ptr(const char *caller, stream_t *streamptr);
int streamInqFileID(int streamID);
int zaxisInqLevelID(int zaxisID, double level);
char *gridNamePtr(int gridtype);
const char *gridNamePtr(int gridtype);
char *zaxisNamePtr(int leveltype);
void streamCheckID(const char *caller, int streamID);
......
......@@ -26,7 +26,9 @@
#endif
char *Grids[] = {
/* the value in the second pair of brackets must match the length of
* the longest string (including terminating NUL) */
static const char Grids[][17] = {
/* 0 */ "undefined",
/* 1 */ "generic",
/* 2 */ "gaussian",
......@@ -531,9 +533,9 @@ void gridDestroyP ( void * gridptr )
}
char *gridNamePtr(int gridtype)
const char *gridNamePtr(int gridtype)
{
char *name;
const char *name;
int size = (int) (sizeof(Grids)/sizeof(char *));
if ( gridtype >= 0 && gridtype < size )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment