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

Change declaration of return type.

* cdf_write_var_slice will never return an error code but call
  on internal error handling.
parent 97778598
......@@ -1852,12 +1852,9 @@ void cdiStreamWriteVarSlice(int streamID, int varID, int levelID, int memtype, c
case FILETYPE_NC2:
case FILETYPE_NC4:
case FILETYPE_NC4C:
{
int ierr = 0;
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
ierr = cdf_write_var_slice(streamptr, varID, levelID, memtype, data, nmiss);
break;
}
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
cdf_write_var_slice(streamptr, varID, levelID, memtype, data, nmiss);
break;
#endif
default:
{
......
......@@ -3551,8 +3551,8 @@ void cdfReadVarDP(stream_t *streamptr, int varID, double *data, int *nmiss)
}
#if defined(HAVE_LIBNETCDF)
static
int cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dtype, long nvals, size_t xsize, size_t ysize, int swapxy, size_t *start, size_t *count, int memtype, const void *data, int nmiss)
static void
cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dtype, long nvals, size_t xsize, size_t ysize, int swapxy, size_t *start, size_t *count, int memtype, const void *data, int nmiss)
{
long i, j;
const double *pdata_dp = (const double *) data;
......@@ -3728,8 +3728,6 @@ int cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dtyp
if ( sdata_dp ) free(sdata_dp);
if ( mdata_sp ) free(mdata_sp);
if ( sdata_sp ) free(sdata_sp);
return (0);
}
#endif
......@@ -4234,7 +4232,7 @@ void cdfReadVarSliceDP(stream_t *streamptr, int varID, int levelID, double *data
}
int cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss)
void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss)
{
#if defined (HAVE_LIBNETCDF)
int fileID;
......@@ -4345,7 +4343,6 @@ int cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype
cdf_write_var_data(fileID, vlistID, varID, ncvarid, dtype, nvals, xsize, ysize, swapxy, start, count, memtype, data, nmiss);
#endif
return (0);
}
#if defined (HAVE_LIBNETCDF)
......
......@@ -21,7 +21,7 @@ void cdfReadVarDP(stream_t *streamptr, int varID, double *data, int *nmiss);
void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss);
void cdfReadVarSliceDP(stream_t *streamptr, int varID, int levelID, double *data, int *nmiss);
int cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss);
void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss);
void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
const int rect[][2], const void *data, int nmiss);
......
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