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

Remove int return value from functions always returning 0.

* The filetype-specific DefRecord functions fail by calling Error if a
  record cannot be created.
parent b4fa8027
......@@ -669,13 +669,8 @@ int cdfInqRecord(stream_t *streamptr, int *varID, int *levelID)
*/
int cdfDefRecord(stream_t *streamptr)
void cdfDefRecord(stream_t *streamptr)
{
int ierr = 0;
if ( streamptr->fileID < 0 ) ierr = 1;
return (ierr);
}
#if defined (HAVE_LIBNETCDF)
......
......@@ -10,7 +10,7 @@ int cdfInqHistorySize(stream_t *streamptr);
void cdfInqHistoryString(stream_t *streamptr, char *history);
void cdfEndDef(stream_t * streamptr);
int cdfDefRecord(stream_t * streamptr);
void cdfDefRecord(stream_t * streamptr);
int cdfCopyRecord(stream_t *streamptr2, stream_t *streamptr1);
......
......@@ -196,11 +196,10 @@ int extCopyRecord(stream_t *streamptr2, stream_t *streamptr1)
}
int extDefRecord(stream_t *streamptr)
void extDefRecord(stream_t *streamptr)
{
int gridID;
int header[4];
int status = 0;
int pdis, pcat, pnum;
extrec_t *extp = (extrec_t*) streamptr->record->exsep;
......@@ -215,8 +214,6 @@ int extDefRecord(stream_t *streamptr)
extDefDatatype(streamptr->record->prec, &extp->prec, &extp->number);
extDefHeader(extp, header);
return (status);
}
......
......@@ -9,7 +9,7 @@ int extInqContents(stream_t *streamptr);
int extInqTimestep(stream_t *streamptr, int tsID);
int extInqRecord(stream_t *streamptr, int *varID, int *levelID);
int extDefRecord(stream_t *streamptr);
void extDefRecord(stream_t *streamptr);
int extCopyRecord(stream_t *streamptr2, stream_t *streamptr1);
int extReadRecord(stream_t *streamptr, double *data, int *nmiss);
int extWriteRecord(stream_t *streamptr, const double *data);
......
......@@ -182,11 +182,8 @@ int grbInqRecord(stream_t * streamptr, int *varID, int *levelID)
}
*/
int grbDefRecord(stream_t * streamptr)
void grbDefRecord(stream_t * streamptr)
{
int status = 0;
return (status);
}
static
......
......@@ -7,7 +7,7 @@ int grbInqContents(stream_t * streamptr);
int grbInqTimestep(stream_t * streamptr, int tsID);
int grbInqRecord(stream_t * streamptr, int *varID, int *levelID);
int grbDefRecord(stream_t * streamptr);
void grbDefRecord(stream_t * streamptr);
int grbReadRecord(stream_t * streamptr, double *data, int *nmiss);
int grb_write_record(stream_t * streamptr, int memtype, const void *data, int nmiss);
int grbCopyRecord(stream_t * streamptr2, stream_t * streamptr1);
......
......@@ -16,6 +16,7 @@
#include "varscan.h"
#include "datetime.h"
#include "ieg.h"
#include "stream_ieg.h"
#include "vlist.h"
......@@ -556,9 +557,8 @@ int iegCopyRecord(stream_t *streamptr2, stream_t *streamptr1)
}
int iegDefRecord(stream_t *streamptr)
void iegDefRecord(stream_t *streamptr)
{
int status = 0;
int vlistID;
int gridID;
int date, time;
......@@ -598,8 +598,6 @@ int iegDefRecord(stream_t *streamptr)
datatype = streamptr->record->prec;
iegp->dprec = iegDefDatatype(datatype);
return (status);
}
......
......@@ -9,7 +9,7 @@ int iegInqContents(stream_t *streamptr);
int iegInqTimestep(stream_t *streamptr, int tsID);
int iegInqRecord(stream_t *streamptr, int *varID, int *levelID);
int iegDefRecord(stream_t *streamptr);
void iegDefRecord(stream_t *streamptr);
int iegCopyRecord(stream_t *streamptr2, stream_t *streamptr1);
int iegReadRecord(stream_t *streamptr, double *data, int *nmiss);
int iegWriteRecord(stream_t *streamptr, const double *data);
......
......@@ -197,7 +197,6 @@ void streamInqRecord(int streamID, int *varID, int *levelID)
void streamDefRecord(int streamID, int varID, int levelID)
{
int status = 0;
int filetype;
int param, gridID, zaxisID, level;
int tsID;
......@@ -241,52 +240,36 @@ void streamDefRecord(int streamID, int varID, int levelID)
#if defined (HAVE_LIBGRIB)
case FILETYPE_GRB:
case FILETYPE_GRB2:
{
/* FIXME: return value not inspected */
status = grbDefRecord(streamptr);
break;
}
grbDefRecord(streamptr);
break;
#endif
#if defined (HAVE_LIBSERVICE)
case FILETYPE_SRV:
{
/* FIXME: return value not inspected */
status = srvDefRecord(streamptr);
break;
}
srvDefRecord(streamptr);
break;
#endif
#if defined (HAVE_LIBEXTRA)
case FILETYPE_EXT:
{
/* FIXME: return value not inspected */
status = extDefRecord(streamptr);
break;
}
extDefRecord(streamptr);
break;
#endif
#if defined (HAVE_LIBIEG)
case FILETYPE_IEG:
{
/* FIXME: return value not inspected */
status = iegDefRecord(streamptr);
break;
}
iegDefRecord(streamptr);
break;
#endif
#if defined (HAVE_LIBNETCDF)
case FILETYPE_NC:
case FILETYPE_NC2:
case FILETYPE_NC4:
case FILETYPE_NC4C:
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
status = cdfDefRecord(streamptr);
break;
}
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
cdfDefRecord(streamptr);
break;
#endif
default:
{
Error("%s support not compiled in!", strfiletype(filetype));
break;
}
Error("%s support not compiled in!", strfiletype(filetype));
break;
}
}
......
......@@ -174,11 +174,10 @@ int srvCopyRecord(stream_t *streamptr2, stream_t *streamptr1)
}
int srvDefRecord(stream_t *streamptr)
void srvDefRecord(stream_t *streamptr)
{
int gridID;
int header[8];
int status = 0;
int xsize, ysize;
int datatype;
int pdis, pcat, pnum;
......@@ -213,8 +212,6 @@ int srvDefRecord(stream_t *streamptr)
srvp->dprec = srvDefDatatype(datatype);
srvDefHeader(srvp, header);
return (status);
}
......
......@@ -9,7 +9,7 @@ int srvInqContents(stream_t *streamptr);
int srvInqTimestep(stream_t *streamptr, int tsID);
int srvInqRecord(stream_t *streamptr, int *varID, int *levelID);
int srvDefRecord(stream_t *streamptr);
void srvDefRecord(stream_t *streamptr);
int srvCopyRecord(stream_t *streamptr2, stream_t *streamptr1);
int srvReadRecord(stream_t *streamptr, double *data, int *nmiss);
int srvWriteRecord(stream_t *streamptr, const double *data);
......
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