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

Handle errors in IEG record writing in lower level function.

parent 7982960e
......@@ -600,10 +600,9 @@ void iegDefRecord(stream_t *streamptr)
}
int iegWriteRecord(stream_t *streamptr, const double *data)
void iegWriteRecord(stream_t *streamptr, const double *data)
{
int fileID;
int status = 0;
int i, gridsize, gridID;
double refval;
iegrec_t *iegp = (iegrec_t*) streamptr->record->exsep;
......@@ -622,8 +621,6 @@ int iegWriteRecord(stream_t *streamptr, const double *data)
iegDefDataDP(iegp, data);
iegWrite(fileID, iegp);
return (status);
}
static
......
......@@ -12,7 +12,7 @@ int iegInqRecord(stream_t *streamptr, int *varID, int *levelID);
void iegDefRecord(stream_t *streamptr);
int iegCopyRecord(stream_t *streamptr2, stream_t *streamptr1);
void iegReadRecord(stream_t *streamptr, double *data, int *nmiss);
int iegWriteRecord(stream_t *streamptr, const double *data);
void iegWriteRecord(stream_t *streamptr, const double *data);
void iegReadVarDP (stream_t *streamptr, int varID, double *data, int *nmiss);
void iegWriteVarDP(stream_t *streamptr, int varID, const double *data);
......
......@@ -332,17 +332,13 @@ void streamReadRecord(int streamID, double *data, int *nmiss)
static void
stream_write_record(int streamID, int memtype, const void *data, int nmiss)
{
int status = 0;
int filetype;
stream_t *streamptr;
check_parg(data);
streamptr = stream_to_pointer(streamID);
stream_t *streamptr = stream_to_pointer(streamID);
stream_check_ptr(__func__, streamptr);
filetype = streamptr->filetype;
int filetype = streamptr->filetype;
switch (filetype)
{
......@@ -366,11 +362,9 @@ stream_write_record(int streamID, int memtype, const void *data, int nmiss)
#endif
#if defined (HAVE_LIBIEG)
case FILETYPE_IEG:
{
if ( memtype == MEMTYPE_FLOAT ) Error("iegWriteRecord not implemented for memtype float!");
status = iegWriteRecord(streamptr, (const double*) data);
break;
}
if ( memtype == MEMTYPE_FLOAT ) Error("iegWriteRecord not implemented for memtype float!");
iegWriteRecord(streamptr, (const double *)data);
break;
#endif
#if defined (HAVE_LIBNETCDF)
case FILETYPE_NC:
......
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