Commit faa0c900 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Change return type of getter modelInqNamePtr.

parent 2f845221
......@@ -992,7 +992,7 @@ int modelDef(int instID, int modelgribID, const char *name);
int modelInq(int instID, int modelgribID, char *name);
int modelInqInstitut(int modelID);
int modelInqGribID(int modelID);
char *modelInqNamePtr(int modelID);
const char *modelInqNamePtr(int modelID);
/* Table routines */
......
......@@ -4,7 +4,7 @@
!
! Author:
! -------
! Uwe Schulzweida, MPI-MET, Hamburg, September 2014
! Uwe Schulzweida, MPI-MET, Hamburg, November 2014
!
INTEGER CDI_MAX_NAME
......
! This file was automatically generated, don't edit!
!
! Fortran interface for CDI library version 1.6.3
! Fortran interface for CDI library version 1.6.4
!
! Author:
! -------
! Uwe Schulzweida, MPI-MET, Hamburg, January 2014
! Uwe Schulzweida, MPI-MET, Hamburg, November 2014
!
!
......
......@@ -237,7 +237,7 @@ int modelInqGribID(int modelID)
}
char *modelInqNamePtr(int modelID)
const char *modelInqNamePtr(int modelID)
{
model_t *modelptr = NULL;
......
......@@ -8182,7 +8182,7 @@ static void cdfDefSource(stream_t *streamptr)
if ( modelID != UNDEFID )
{
char *longname = modelInqNamePtr(modelID);
const char *longname = modelInqNamePtr(modelID);
if ( longname )
{
size_t len = strlen(longname);
......
......@@ -378,9 +378,10 @@ static int tableFromEnv(int modelID, int tablenum)
char tablename[256] = {'\0'};
int tablenamefound = 0;
if ( modelInqNamePtr(modelID) )
const char *modelName;
if ( (modelName = modelInqNamePtr(modelID)) )
{
strcpy(tablename, modelInqNamePtr(modelID));
strcpy(tablename, modelName);
if ( tablenum )
{
size_t len = strlen(tablename);
......@@ -486,9 +487,10 @@ int tableInq(int modelID, int tablenum, const char *tablename)
{
if ( modelID != UNDEFID )
{
if ( modelInqNamePtr(modelID) )
const char *modelName;
if ( (modelName = modelInqNamePtr(modelID)) )
{
strcpy(tablefile, modelInqNamePtr(modelID));
strcpy(tablefile, modelName);
size_t len = strlen(tablefile);
for ( size_t i = 0; i < len; i++)
if ( tablefile[i] == '.' ) tablefile[i] = '\0';
......@@ -605,7 +607,8 @@ void tableWrite(const char *ptfile, int tableID)
FILE *ptfp;
int tablenum, modelID, instID = CDI_UNDEFID;
int center = 0, subcenter = 0;
char *instnameptr = NULL, *modelnameptr = NULL;
char *instnameptr = NULL;
const char *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