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

moved check of accessmode to cdf_write.c

parent 65b80767
......@@ -976,6 +976,8 @@ void cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dty
void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss)
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
size_t xsize = 0, ysize = 0;
size_t size;
size_t start[5];
......@@ -1070,6 +1072,8 @@ void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data
void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
const int rect[][2], const void *data, int nmiss)
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
int xid = UNDEFID, yid = UNDEFID;
size_t xsize = 0, ysize = 0;
size_t start[5];
......@@ -1170,6 +1174,8 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss)
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
size_t xsize = 0, ysize = 0;
size_t start[5];
size_t count[5];
......
......@@ -68,7 +68,6 @@ void cdiStreamWriteVar_(int streamID, int varID, int memtype, const void *data,
case FILETYPE_NC4:
case FILETYPE_NC4C:
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
cdf_write_var(streamptr, varID, memtype, data, nmiss);
break;
}
......@@ -187,7 +186,6 @@ void cdiStreamWriteVarSlice(int streamID, int varID, int levelID, int memtype, c
case FILETYPE_NC2:
case FILETYPE_NC4:
case FILETYPE_NC4C:
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
cdf_write_var_slice(streamptr, varID, levelID, memtype, data, nmiss);
break;
#endif
......@@ -296,7 +294,6 @@ cdiStreamWriteVarChunk_(int streamID, int varID, int memtype,
case FILETYPE_NC2:
case FILETYPE_NC4:
case FILETYPE_NC4C:
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
cdf_write_var_chunk(streamptr, varID, memtype, rect, data, nmiss);
break;
#endif
......
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