Commit aaf5e677 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdoGetStreamName: changed return value from string to const char *.

parent 96d366c3
......@@ -103,9 +103,9 @@ static int ofiletype = -1;
static int DataType = -1;
static char *filename;
static char **ifiles;
static const char **ifiles;
static char *ifile = NULL;
static char *ofile = NULL;
static const char *ofile = NULL;
#ifdef AFTERBURNER
static char *ofile2 = NULL;
#endif
......@@ -328,7 +328,7 @@ after_SwitchFile(struct Control *globs)
globs->Multi--;
}
if (globs->Nfiles > 0) ifile = ifiles[--globs->Nfiles];
if (globs->Nfiles > 0) ifile = (char*) ifiles[--globs->Nfiles];
fprintf(stderr, " Continuation file: %s\n", ifile);
......@@ -2359,7 +2359,7 @@ afterburner(int argc, char *argv[])
{
if (globs->Multi > 0) Error("Namelist parameter MULTI works only with one inputfile");
ifiles = (char **) Malloc(globs->Nfiles * sizeof(char *));
ifiles = (const char **) Malloc(globs->Nfiles * sizeof(char *));
for (i = 0; i < globs->Nfiles; i++) ifiles[i] = argv[--fargcn];
}
......@@ -2427,16 +2427,16 @@ Afterburner(void *process)
ofileidx = nfiles;
ifile = strdup(cdoGetStreamName(0).c_str());
ofile = (char *) cdoGetStreamName(nfiles).c_str();
ifile = strdup(cdoGetStreamName(0));
ofile = cdoGetStreamName(nfiles);
globs->Nfiles = nfiles - 1;
if (globs->Nfiles > 0)
{
if (globs->Multi > 0) Error("Namelist parameter MULTI works only with one inputfile");
ifiles = (char **) Malloc(globs->Nfiles * sizeof(char *));
for (int i = 0; i < globs->Nfiles; ++i) ifiles[i] = (char *) cdoGetStreamName(--nfiles).c_str();
ifiles = (const char **) Malloc(globs->Nfiles * sizeof(char *));
for (int i = 0; i < globs->Nfiles; ++i) ifiles[i] = cdoGetStreamName(--nfiles);
for (int i = 0; i < globs->Nfiles; ++i) printf("files %d %s\n", i + 1, ifiles[i]);
}
......
......@@ -118,12 +118,12 @@ Arith(void *process)
if (ntsteps1 != 1 && ntsteps2 == 1)
{
filltype = FILL_VAR;
cdoPrint("Filling up stream2 >%s< by copying the first variable.", cdoGetStreamName(1).c_str());
cdoPrint("Filling up stream2 >%s< by copying the first variable.", cdoGetStreamName(1));
}
else
{
filltype = FILL_VARTS;
cdoPrint("Filling up stream2 >%s< by copying the first variable of each timestep.", cdoGetStreamName(1).c_str());
cdoPrint("Filling up stream2 >%s< by copying the first variable of each timestep.", cdoGetStreamName(1));
}
}
else if (lfill1)
......@@ -133,12 +133,12 @@ Arith(void *process)
if (ntsteps1 == 1 && ntsteps2 != 1)
{
filltype = FILL_VAR;
cdoPrint("Filling up stream1 >%s< by copying the first variable.", cdoGetStreamName(0).c_str());
cdoPrint("Filling up stream1 >%s< by copying the first variable.", cdoGetStreamName(0));
}
else
{
filltype = FILL_VARTS;
cdoPrint("Filling up stream1 >%s< by copying the first variable of each timestep.", cdoGetStreamName(0).c_str());
cdoPrint("Filling up stream1 >%s< by copying the first variable of each timestep.", cdoGetStreamName(0));
}
streamIDx1 = streamID2;
streamIDx2 = streamID1;
......@@ -172,12 +172,12 @@ Arith(void *process)
if (ntsteps1 != 1 && ntsteps2 == 1)
{
filltype = FILL_TS;
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoGetStreamName(1).c_str());
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoGetStreamName(1));
}
else if (ntsteps1 == 1 && ntsteps2 != 1)
{
filltype = FILL_TS;
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoGetStreamName(0).c_str());
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoGetStreamName(0));
streamIDx1 = streamID2;
streamIDx2 = streamID1;
vlistIDx1 = vlistID2;
......@@ -227,7 +227,7 @@ Arith(void *process)
if (filltype == FILL_NONE && streamIDx2 == streamID2)
{
filltype = FILL_FILE;
cdoPrint("Filling up stream2 >%s< by copying all timesteps.", cdoGetStreamName(1).c_str());
cdoPrint("Filling up stream2 >%s< by copying all timesteps.", cdoGetStreamName(1));
}
if (filltype == FILL_FILE)
......@@ -243,7 +243,7 @@ Arith(void *process)
vlistCompare(vlistID1, vlistID2, CMP_DIM);
nrecs2 = cdoStreamInqTimestep(streamIDx2, tsID2);
if (nrecs2 == 0) cdoAbort("Empty input stream %s!", cdoGetStreamName(1).c_str());
if (nrecs2 == 0) cdoAbort("Empty input stream %s!", cdoGetStreamName(1));
}
else
cdoAbort("Input streams have different number of timesteps!");
......
......@@ -175,7 +175,7 @@ CDIread(void *process)
tw = timer_val(timer_read) - tw0;
twsum += tw;
file_size = (double) fileSize(cdoGetStreamName(0).c_str());
file_size = (double) fileSize(cdoGetStreamName(0));
if (nruns > 1) snprintf(sinfo, sizeof(sinfo), "(run %d)", irun + 1);
......
......@@ -220,7 +220,7 @@ CDIwrite(void *process)
tw = timer_val(timer_write) - tw0;
twsum += tw;
file_size = (double) fileSize(cdoGetStreamName(0).c_str());
file_size = (double) fileSize(cdoGetStreamName(0));
if (nruns > 1) snprintf(sinfo, sizeof(sinfo), "(run %d)", irun + 1);
......
......@@ -861,7 +861,7 @@ maptab_via_cmd(char *tablename, list_t *pml, const char *origValue, int vlistID,
cdoAbort("ERROR! In variable mapping with table '%s':\n "
"Variable with '%s': '%s' configured via cmdline could not be "
"found in infile '%s'.",
tablename, key, origValue, cdoGetStreamName(0).c_str());
tablename, key, origValue, cdoGetStreamName(0));
list_t *kvl_maptab = maptab_search_miptab(pml, cmorName, miptabfreq, "cmor_name");
if (!kvl_maptab)
{
......@@ -1018,7 +1018,7 @@ addcharvar(keyValues_t *charvars, int vlistID, const char *key, struct mapping v
if (varIDs[i] == CDI_UNDEFID)
cdoAbort("ERROR! In merging variables to a variable with a character coordinate:\n Could not find "
"'%s' in infile '%s' to build a variable with character coordinate.",
charvars->values[i], cdoGetStreamName(0).c_str());
charvars->values[i], cdoGetStreamName(0));
}
int gridID = vlistInqVarGrid(vlistID, varIDs[0]);
......@@ -1030,7 +1030,7 @@ addcharvar(keyValues_t *charvars, int vlistID, const char *key, struct mapping v
if (cdoStreamIsPipe(0))
cdoAbort("ERROR! No variables can be merged to one character axis since you piped several cdo operators.");
int streamID2 = streamOpenRead(cdoGetStreamName(0).c_str());
int streamID2 = streamOpenRead(cdoGetStreamName(0));
if (ntsteps == -1)
{
ntsteps = 0;
......@@ -3402,7 +3402,7 @@ xcoord_vals[(j+1)*xlength-2] ) * 0.5;
/*
static void select_and_register_character_dimension(char *grid_file, int *axis_ids)
{
char *ifile = cdoGetStreamName(0).c_str();
char *ifile = cdoGetStreamName(0);
if ( ifile[0] == '-' )
cdoAbort("ERROR! Cdo cmor cannot register a character dimension when several cdo operators are piped.");
if ( strcmp(grid_file, "") == 0 )
......@@ -4142,7 +4142,7 @@ get_frequency(list_t *kvl, int streamID, int vlistID, int taxisID, int miptab_fr
*/
}
int streamID2 = streamOpenRead(cdoGetStreamName(0).c_str());
int streamID2 = streamOpenRead(cdoGetStreamName(0));
int vlistID2 = streamInqVlist(streamID2);
int taxisID2 = vlistInqTaxis(vlistID2);
if (ntsteps < 0)
......@@ -4636,7 +4636,7 @@ check_append_and_size(list_t *kvl, int vlistID, char *testIn, int ifreq, int cal
return 0;
}
int streamID2 = streamOpenRead(cdoGetStreamName(0).c_str());
int streamID2 = streamOpenRead(cdoGetStreamName(0));
int vlistID2 = streamInqVlist(streamID2);
int taxisID2 = vlistInqTaxis(vlistID2);
juldate_t firstdate = juldate_encode(calendar, taxisInqVdate(taxisID2), taxisInqVtime(taxisID2));
......@@ -5271,7 +5271,7 @@ read_maptab(list_t *kvl, int streamID, char *miptabfreq, struct mapping vars[])
keyValues_t *kvc = kvlist_search(kvl, "c");
keyValues_t *kvcn = kvlist_search(kvl, "cn");
int byteorder;
int filetype = cdiGetFiletype(cdoGetStreamName(0).c_str(), &byteorder);
int filetype = cdiGetFiletype(cdoGetStreamName(0), &byteorder);
if (maptab && maptabdir)
if (maptab[0] != '/')
......@@ -5769,11 +5769,11 @@ CMOR(void *process)
cdoPrint("2. Successfully found a MIP table '%s' and deduced a MIP table frequency '%s'.", mip_table,
miptab_freqptr);
if (cdoVerbose) cdoPrint("3. Start to open infile '%s'.", cdoGetStreamName(0).c_str());
if (cdoVerbose) cdoPrint("3. Start to open infile '%s'.", cdoGetStreamName(0));
int streamID = cdoStreamOpenRead(cdoStreamName(0));
int vlistID = cdoStreamInqVlist(streamID);
if (cdoVerbose) cdoPrint("3. Successfully opened infile '%s'.", cdoGetStreamName(0).c_str());
if (cdoVerbose) cdoPrint("3. Successfully opened infile '%s'.", cdoGetStreamName(0));
if (cdoVerbose) cdoPrint("4. Start to check attributes.");
/* Short keys from rtu, mt, gi must be included similar to global atts */
......
......@@ -55,7 +55,7 @@ Cat(void *process)
for (int indf = 0; indf < nfiles; ++indf)
{
if (cdoVerbose) cdoPrint("Process file: %s", cdoGetStreamName(indf).c_str());
if (cdoVerbose) cdoPrint("Process file: %s", cdoGetStreamName(indf));
if (cdoTimer) tw0 = timer_val(timer_cat);
int streamID1 = cdoStreamOpenRead(cdoStreamName(indf));
......@@ -75,7 +75,7 @@ Cat(void *process)
if (varID == nvars) ntsteps = 0;
}
bool file_exists = (!cdoOverwriteMode) ? fileExists(cdoGetStreamName(nfiles).c_str()) : false;
bool file_exists = (!cdoOverwriteMode) ? fileExists(cdoGetStreamName(nfiles)) : false;
if (file_exists)
{
streamID2 = cdoStreamOpenAppend(cdoStreamName(nfiles));
......@@ -92,7 +92,7 @@ Cat(void *process)
}
else
{
if (cdoVerbose) cdoPrint("Output file doesn't exist, creating: %s", cdoGetStreamName(nfiles).c_str());
if (cdoVerbose) cdoPrint("Output file doesn't exist, creating: %s", cdoGetStreamName(nfiles));
streamID2 = cdoStreamOpenWrite(cdoStreamName(nfiles), cdoFiletype());
......@@ -159,7 +159,7 @@ Cat(void *process)
pstreamClose(streamID1);
if (cdoTimer) tw = timer_val(timer_cat) - tw0;
if (cdoTimer) cdoPrint("Processed file: %s %.2f seconds", cdoGetStreamName(indf).c_str(), tw);
if (cdoTimer) cdoPrint("Processed file: %s %.2f seconds", cdoGetStreamName(indf), tw);
}
pstreamClose(streamID2);
......
......@@ -353,7 +353,7 @@ Collgrid(void *process)
cdoInitialize(process);
int nfiles = cdoStreamCnt() - 1;
const char *ofilename = cdoGetStreamName(nfiles).c_str();
const char *ofilename = cdoGetStreamName(nfiles);
if (!cdoOverwriteMode && fileExists(ofilename) && !userFileOverwrite(ofilename))
cdoAbort("Outputfile %s already exists!", ofilename);
......@@ -534,8 +534,8 @@ Collgrid(void *process)
{
int nrecs = cdoStreamInqTimestep(ef[fileID].streamID, tsID);
if (nrecs != nrecs0)
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID + 1, cdoGetStreamName(0).c_str(),
cdoGetStreamName(fileID).c_str());
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID + 1, cdoGetStreamName(0),
cdoGetStreamName(fileID));
}
taxisCopyTimestep(taxisID2, taxisID1);
......
......@@ -332,7 +332,7 @@ Command(void *process)
cdoInitialize(process);
gl_streamID = streamOpenRead(cdoGetStreamName(0).c_str());
gl_streamID = streamOpenRead(cdoGetStreamName(0));
command_init();
......
......@@ -85,13 +85,13 @@ Comp(void *process)
if (vlistNrecs(vlistID1) != 1 && vlistNrecs(vlistID2) == 1)
{
filltype = FILL_REC;
cdoPrint("Filling up stream2 >%s< by copying the first record.", cdoGetStreamName(1).c_str());
cdoPrint("Filling up stream2 >%s< by copying the first record.", cdoGetStreamName(1));
if (ntsteps2 != 1) cdoAbort("stream2 has more than 1 timestep!");
}
else if (vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1)
{
filltype = FILL_REC;
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoGetStreamName(0).c_str());
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoGetStreamName(0));
if (ntsteps1 != 1) cdoAbort("stream1 has more than 1 timestep!");
fillstream1 = true;
streamIDx1 = streamID2;
......@@ -122,12 +122,12 @@ Comp(void *process)
if (ntsteps1 != 1 && ntsteps2 == 1)
{
filltype = FILL_TS;
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoGetStreamName(1).c_str());
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoGetStreamName(1));
}
else if (ntsteps1 == 1 && ntsteps2 != 1)
{
filltype = FILL_TS;
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoGetStreamName(0).c_str());
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoGetStreamName(0));
fillstream1 = true;
streamIDx1 = streamID2;
streamIDx2 = streamID1;
......
......@@ -74,7 +74,7 @@ Cond(void *process)
if (vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1)
{
filltype = FILL_REC;
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoGetStreamName(0).c_str());
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoGetStreamName(0));
}
if (filltype == FILL_NONE) vlistCompare(vlistID1, vlistID2, CMP_DIM);
......@@ -88,7 +88,7 @@ Cond(void *process)
size_t gridsize = vlistGridsizeMax(vlistID2);
if (filltype == FILL_REC && gridsize != gridInqSize(vlistGrid(vlistID1, 0)))
cdoAbort("Stream1 >%s< has wrong gridsize!", cdoGetStreamName(0).c_str());
cdoAbort("Stream1 >%s< has wrong gridsize!", cdoGetStreamName(0));
std::vector<double> array1(gridsize);
std::vector<double> array2(gridsize);
......@@ -101,7 +101,7 @@ Cond(void *process)
if (ntsteps1 == 1 && ntsteps2 != 1)
{
filltype = FILL_TS;
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoGetStreamName(0).c_str());
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoGetStreamName(0));
nvars = vlistNvars(vlistID1);
vardata1.resize(nvars);
......
......@@ -68,7 +68,7 @@ Cond2(void *process)
if (vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1)
{
filltype = FILL_REC;
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoGetStreamName(0).c_str());
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoGetStreamName(0));
}
if (filltype == FILL_NONE) vlistCompare(vlistID1, vlistID2, CMP_DIM);
......@@ -85,7 +85,7 @@ Cond2(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
if (filltype == FILL_REC && gridsize != gridInqSize(vlistGrid(vlistID1, 0)))
cdoAbort("Stream1 >%s< has wrong gridsize!", cdoGetStreamName(0).c_str());
cdoAbort("Stream1 >%s< has wrong gridsize!", cdoGetStreamName(0));
std::vector<double> array1(gridsize);
std::vector<double> array2(gridsize);
......@@ -99,7 +99,7 @@ Cond2(void *process)
if (ntsteps1 == 1 && ntsteps2 != 1)
{
filltype = FILL_TS;
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoGetStreamName(0).c_str());
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoGetStreamName(0));
nvars = vlistNvars(vlistID1);
vardata1.resize(nvars);
......
......@@ -78,7 +78,7 @@ Copy(void *process)
int tsID2 = 0;
for (int indf = 0; indf < nfiles; indf++)
{
if (cdoVerbose) cdoPrint("Process file: %s", cdoGetStreamName(indf).c_str());
if (cdoVerbose) cdoPrint("Process file: %s", cdoGetStreamName(indf));
int streamID1 = cdoStreamOpenRead(cdoStreamName(indf));
......
......@@ -1526,9 +1526,9 @@ Echam5ini(void *process)
iniatts(&atts);
if (operatorID == IMPORT_E5ML)
nvars = import_e5ml(cdoGetStreamName(0).c_str(), &vars);
nvars = import_e5ml(cdoGetStreamName(0), &vars);
else if (operatorID == IMPORT_E5RES)
nvars = import_e5res(cdoGetStreamName(0).c_str(), &vars, &atts);
nvars = import_e5res(cdoGetStreamName(0), &vars, &atts);
else
cdoAbort("Operator not implemented!");
......@@ -1698,9 +1698,9 @@ Echam5ini(void *process)
pstreamClose(streamID1);
if (operatorID == EXPORT_E5ML)
export_e5ml(cdoGetStreamName(1).c_str(), vars, nvars, vdate, vtime, ntr);
export_e5ml(cdoGetStreamName(1), vars, nvars, vdate, vtime, ntr);
else if (operatorID == EXPORT_E5RES)
export_e5res(cdoGetStreamName(1).c_str(), vars, nvars);
export_e5res(cdoGetStreamName(1), vars, nvars);
else
cdoAbort("Operator not implemented!");
}
......
......@@ -159,7 +159,7 @@ Enlargegrid(void *process)
for (int index = 1; index < vlistNgrids(vlistID1); index++)
if (vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index)) ndiffgrids++;
if (ndiffgrids > 0) cdoAbort("Too many different grids in %s!", cdoGetStreamName(0).c_str());
if (ndiffgrids > 0) cdoAbort("Too many different grids in %s!", cdoGetStreamName(0));
int gridID1 = vlistGrid(vlistID1, 0);
......
......@@ -181,7 +181,7 @@ Ensstat(void *process)
if (cdoVerbose) cdoPrint("Ensemble over %d files.", nfiles);
const char *ofilename = cdoGetStreamName(nfiles).c_str();
const char *ofilename = cdoGetStreamName(nfiles);
if (!cdoOverwriteMode && fileExists(ofilename) && !userFileOverwrite(ofilename))
cdoAbort("Outputfile %s already exists!", ofilename);
......@@ -273,18 +273,18 @@ Ensstat(void *process)
if (nrecs == 0)
{
lwarning = true;
cdoWarning("Inconsistent ensemble file, too few time steps in %s!", cdoGetStreamName(fileID).c_str());
cdoWarning("Inconsistent ensemble file, too few time steps in %s!", cdoGetStreamName(fileID));
}
else if (nrecs0 == 0)
{
lwarning = true;
cdoWarning("Inconsistent ensemble file, too few time steps in %s!", cdoGetStreamName(0).c_str());
cdoWarning("Inconsistent ensemble file, too few time steps in %s!", cdoGetStreamName(0));
}
else
{
lerror = true;
cdoWarning("Inconsistent ensemble file, number of records at time step %d of %s and %s differ!", tsID + 1,
cdoGetStreamName(0).c_str(), cdoGetStreamName(fileID).c_str());
cdoGetStreamName(0), cdoGetStreamName(fileID));
}
goto CLEANUP;
}
......
......@@ -116,7 +116,7 @@ Ensstat3(void *process)
if (cdoVerbose) cdoPrint("Ensemble over %d files.", nfiles);
const char *ofilename = cdoGetStreamName(nfiles).c_str();
const char *ofilename = cdoGetStreamName(nfiles);
if (!cdoOverwriteMode && fileExists(ofilename) && !userFileOverwrite(ofilename))
cdoAbort("Outputfile %s already exists!", ofilename);
......@@ -254,10 +254,10 @@ Ensstat3(void *process)
if (nrecs != nrecs0)
{
if (nrecs == 0)
cdoAbort("Inconsistent ensemble file, too few time steps in %s!", cdoGetStreamName(fileID).c_str());
cdoAbort("Inconsistent ensemble file, too few time steps in %s!", cdoGetStreamName(fileID));
else
cdoAbort("Inconsistent ensemble file, number of records at time step %d of %s and %s differ!", tsID + 1,
cdoGetStreamName(0).c_str(), cdoGetStreamName(fileID).c_str());
cdoGetStreamName(0), cdoGetStreamName(fileID));
}
}
......
......@@ -188,7 +188,7 @@ Ensval(void *process)
gridDefXvals(gridID2, &xval);
gridDefYvals(gridID2, &yval);
const char *ofilebase = cdoGetStreamName(nfiles).c_str();
const char *ofilebase = cdoGetStreamName(nfiles);
const char *refname = cdoGetObase();
memset(file_suffix, 0, sizeof(file_suffix));
......@@ -262,8 +262,8 @@ Ensval(void *process)
streamID = ef[fileID].streamID;
nrecs = cdoStreamInqTimestep(streamID, tsID);
if (nrecs != nrecs0)
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID + 1, cdoGetStreamName(0).c_str(),
cdoGetStreamName(fileID).c_str());
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID + 1, cdoGetStreamName(0),
cdoGetStreamName(fileID));
}
for (stream = 0; stream < nostreams; stream++)
......
......@@ -112,7 +112,7 @@ Eofcoeff(void *process)
int neof = eofID;
if (cdoVerbose) cdoPrint("%s contains %i eof's", cdoGetStreamName(0).c_str(), neof);
if (cdoVerbose) cdoPrint("%s contains %i eof's", cdoGetStreamName(0), neof);
// Create 1x1 Grid for output
int gridID3 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID3, 1);
......
......@@ -109,7 +109,7 @@ Eofcoeff3d(void *process)
int neof = eofID;
if (cdoVerbose) cdoPrint("%s contains %i eof's", cdoGetStreamName(0).c_str(), neof);
if (cdoVerbose) cdoPrint("%s contains %i eof's", cdoGetStreamName(0), neof);
// Create 1x1 Grid for output
int gridID3 = gridCreate(GRID_LONLAT, 1);
gridDefXsize(gridID3, 1);
......
......@@ -254,8 +254,8 @@ dumpmap()
indxb.bigpnt = NULL;
indxb.bignum = 0;
mapfp = fopen(cdoGetStreamName(0).c_str(), "r");
if (mapfp == NULL) cdoAbort("Open failed on %s", cdoGetStreamName(0).c_str());
mapfp = fopen(cdoGetStreamName(0), "r");
if (mapfp == NULL) cdoAbort("Open failed on %s", cdoGetStreamName(0));
/* check the version number */
......@@ -975,12 +975,12 @@ Gradsdes(void *process)
int operatorID = cdoOperatorID();
const char *datfile = cdoGetStreamName(0).c_str();
const char *datfile = cdoGetStreamName(0);
size_t len = strlen(datfile);
char *ctlfile = (char *) Malloc(len + 10);
strcpy(ctlfile, datfile);
if (cdoGetStreamName(0).c_str()[0] == '-') cdoAbort("This operator does not work with pipes!");
if (cdoGetStreamName(0)[0] == '-') cdoAbort("This operator does not work with pipes!");
if (operatorID == DUMPMAP)
{
......@@ -998,7 +998,7 @@ Gradsdes(void *process)
}
else
{
if (fileSize(cdoGetStreamName(0).c_str()) > 2147483647L) map_version = 4;
if (fileSize(cdoGetStreamName(0)) > 2147483647L) map_version = 4;
}
if (cdoVerbose) cdoPrint("GrADS GRIB map version: %d", map_version);
......@@ -1127,7 +1127,7 @@ Gradsdes(void *process)
{
datfile = strrchr(datfile, '/');
if (datfile == 0)
datfile = cdoGetStreamName(0).c_str();
datfile = cdoGetStreamName(0);
else
datfile++;
fprintf(gdp, "DSET ^%s\n", datfile);
......
Supports Markdown
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