Commit 26d58960 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Change return type of getter institutInqNamePtr.

parent faa0c900
......@@ -983,7 +983,7 @@ int institutInq(int center, int subcenter, const char *name, const char *lon
int institutInqNumber(void);
int institutInqCenter(int instID);
int institutInqSubcenter(int instID);
char *institutInqNamePtr(int instID);
const char *institutInqNamePtr(int instID);
char *institutInqLongnamePtr(int instID);
/* Model routines */
......
......@@ -227,7 +227,7 @@ int institutInqSubcenter(int instID)
}
char *institutInqNamePtr(int instID)
const char *institutInqNamePtr(int instID)
{
institute_t * instituteptr = NULL;
......
......@@ -8225,7 +8225,6 @@ static void cdfDefGlobalAtts(stream_t *streamptr)
static void cdfDefLocalAtts(stream_t *streamptr)
{
int varID, instID, fileID;
char *name;
size_t len;
int ncvarid;
int vlistID;
......@@ -8246,7 +8245,7 @@ static void cdfDefLocalAtts(stream_t *streamptr)
if ( instID != UNDEFID )
{
ncvarid = streamptr->vars[varID].ncvarid;
name = institutInqNamePtr(instID);
const char *name = institutInqNamePtr(instID);
if ( name )
{
len = strlen(name);
......
......@@ -394,9 +394,10 @@ static int tableFromEnv(int modelID, int tablenum)
int instID = modelInqInstitut(modelID);
if ( instID != UNDEFID )
{
if ( institutInqNamePtr(instID) )
const char *instName;
if ( (instName = institutInqNamePtr(instID)) )
{
strcpy(tablename, institutInqNamePtr(instID));
strcpy(tablename, instName);
if ( tablenum )
{
size_t len = strlen(tablename);
......@@ -607,8 +608,7 @@ void tableWrite(const char *ptfile, int tableID)
FILE *ptfp;
int tablenum, modelID, instID = CDI_UNDEFID;
int center = 0, subcenter = 0;
char *instnameptr = NULL;
const char *modelnameptr = NULL;
const char *instnameptr = NULL, *modelnameptr = NULL;
if ( CDI_Debug )
Message("write parameter table %d to %s", tableID, ptfile);
......
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