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

Merge declaration and definition.

parent ae7916e8
......@@ -330,7 +330,7 @@ long cdiInqTimeSize(int streamID)
}
static
int cdiInqContents(stream_t * streamptr)
int cdiInqContents(stream_t *streamptr)
{
int status = 0;
......@@ -593,14 +593,16 @@ int streamOpenID(const char *filename, char filemode, int filetype, int resH)
return streamID;
}
static int streamOpen(const char *filename, const char *filemode, int filetype)
static
int streamOpen(const char *filename, const char *filemode, int filetype)
{
if (!filemode || strlen(filemode) != 1) return CDI_EINVAL;
return streamOpenID(filename, (char)tolower(filemode[0]),
filetype, CDI_UNDEFID);
}
static int streamOpenA(const char *filename, const char *filemode, int filetype)
static
int streamOpenA(const char *filename, const char *filemode, int filetype)
{
int fileID = CDI_UNDEFID;
int streamID = CDI_ESYSTEM;
......@@ -893,8 +895,8 @@ void streamDefaultValue ( stream_t * streamptr )
streamptr->gribContainers = NULL;
}
static stream_t *stream_new_entry(int resH)
static
stream_t *stream_new_entry(int resH)
{
stream_t *streamptr;
......@@ -914,8 +916,7 @@ static stream_t *stream_new_entry(int resH)
}
void
cdiStreamCloseDefaultDelegate(stream_t *streamptr, int recordBufIsToBeDeleted)
void cdiStreamCloseDefaultDelegate(stream_t *streamptr, int recordBufIsToBeDeleted)
{
int fileID = streamptr->fileID;
int filetype = streamptr->filetype;
......@@ -980,7 +981,8 @@ cdiStreamCloseDefaultDelegate(stream_t *streamptr, int recordBufIsToBeDeleted)
}
static void deallocate_sleveltable_t(sleveltable_t *entry)
static
void deallocate_sleveltable_t(sleveltable_t *entry)
{
if (entry->recordID) Free(entry->recordID);
if (entry->lindex) Free(entry->lindex);
......@@ -1004,7 +1006,6 @@ The function @func{streamClose} closes an open dataset.
*/
void streamClose(int streamID)
{
int index;
stream_t *streamptr = stream_to_pointer(streamID);
if ( CDI_Debug )
......@@ -1029,7 +1030,7 @@ void streamClose(int streamID)
streamptr->filetype = 0;
if ( streamptr->filename ) Free(streamptr->filename);
for ( index = 0; index < streamptr->nvars; index++ )
for ( int index = 0; index < streamptr->nvars; index++ )
{
sleveltable_t *pslev = streamptr->vars[index].recordTable;
unsigned nsub = streamptr->vars[index].subtypeSize >= 0
......@@ -1043,7 +1044,7 @@ void streamClose(int streamID)
Free(streamptr->vars);
streamptr->vars = NULL;
for ( index = 0; index < streamptr->ntsteps; ++index )
for ( int index = 0; index < streamptr->ntsteps; ++index )
{
if ( streamptr->tsteps[index].records )
Free(streamptr->tsteps[index].records);
......@@ -1070,13 +1071,12 @@ void streamClose(int streamID)
stream_delete_entry(streamptr);
}
static void stream_delete_entry(stream_t *streamptr)
static
void stream_delete_entry(stream_t *streamptr)
{
int idx;
xassert ( streamptr );
idx = streamptr->self;
int idx = streamptr->self;
Free( streamptr );
reshRemove ( idx, &streamOps );
......@@ -1233,6 +1233,7 @@ int streamDefTimestep(int streamID, int tsID)
return myStreamDefTimestep_(streamptr, tsID);
}
int streamInqCurTimestepID(int streamID)
{
stream_t *streamptr = stream_to_pointer(streamID);
......@@ -1474,8 +1475,7 @@ void streamDefVlist(int streamID, int vlistID)
}
/* the single image implementation of streamDefVlist */
void
cdiStreamDefVlist_(int streamID, int vlistID)
void cdiStreamDefVlist_(int streamID, int vlistID)
{
stream_t *streamptr = stream_to_pointer(streamID);
......@@ -1581,29 +1581,26 @@ int streamTxCode(void)
return STREAM;
}
void
cdiStreamSetupVlist(stream_t *streamptr, int vlistID)
void cdiStreamSetupVlist(stream_t *streamptr, int vlistID)
{
void (*myStreamSetupVlist)(stream_t *streamptr, int vlistID)
= (void (*)(stream_t *, int))
namespaceSwitchGet(NSSWITCH_STREAM_SETUP_VLIST).func;
= (void (*)(stream_t *, int)) namespaceSwitchGet(NSSWITCH_STREAM_SETUP_VLIST).func;
myStreamSetupVlist(streamptr, vlistID);
}
void
cdiStreamSetupVlist_(stream_t *streamptr, int vlistID)
void cdiStreamSetupVlist_(stream_t *streamptr, int vlistID)
{
int nvars = vlistNvars(vlistID);
streamptr->vlistID = vlistID;
for (int varID = 0; varID < nvars; varID++ )
int nvars = vlistNvars(vlistID);
for ( int varID = 0; varID < nvars; varID++ )
{
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int tilesetID = vlistInqVarSubtype(vlistID, varID);
stream_new_var(streamptr, gridID, zaxisID, tilesetID);
if ( streamptr->have_missval )
vlistDefVarMissval(vlistID, varID,
vlistInqVarMissval(vlistID, varID));
vlistDefVarMissval(vlistID, varID, vlistInqVarMissval(vlistID, varID));
}
if (streamptr->filemode == 'w')
......@@ -1616,8 +1613,7 @@ cdiStreamSetupVlist_(stream_t *streamptr, int vlistID)
case FILETYPE_NC4C:
{
void (*myCdfDefVars)(stream_t *streamptr)
= (void (*)(stream_t *))
namespaceSwitchGet(NSSWITCH_CDF_STREAM_SETUP).func;
= (void (*)(stream_t *)) namespaceSwitchGet(NSSWITCH_CDF_STREAM_SETUP).func;
myCdfDefVars(streamptr);
}
break;
......
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