Skip to content
Snippets Groups Projects
Commit cee15588 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Merge declarations and initializations in srv_add_record.

parent e331c313
No related branches found
No related tags found
No related merge requests found
...@@ -206,25 +206,17 @@ static ...@@ -206,25 +206,17 @@ static
void srv_add_record(stream_t *streamptr, int param, int level, int xsize, int ysize, void srv_add_record(stream_t *streamptr, int param, int level, int xsize, int ysize,
size_t recsize, off_t position, int prec) size_t recsize, off_t position, int prec)
{ {
int leveltype; int vlistID = streamptr->vlistID;
int gridID = CDI_UNDEFID; int tsID = streamptr->curTsID;
int levelID = 0; int recID = recordNewEntry(streamptr, tsID);
int tsID, recID, varID; record_t *record = &streamptr->tsteps[tsID].records[recID];
int datatype;
record_t *record;
grid_t grid;
int vlistID;
vlistID = streamptr->vlistID; record->size = recsize;
tsID = streamptr->curTsID; record->position = position;
recID = recordNewEntry(streamptr, tsID); record->param = param;
record = &streamptr->tsteps[tsID].records[recID]; record->ilevel = level;
(*record).size = recsize;
(*record).position = position;
(*record).param = param;
(*record).ilevel = level;
grid_t grid;
memset(&grid, 0, sizeof(grid_t)); memset(&grid, 0, sizeof(grid_t));
grid.type = GRID_GENERIC; grid.type = GRID_GENERIC;
grid.size = xsize*ysize; grid.size = xsize*ysize;
...@@ -232,21 +224,24 @@ void srv_add_record(stream_t *streamptr, int param, int level, int xsize, int ys ...@@ -232,21 +224,24 @@ void srv_add_record(stream_t *streamptr, int param, int level, int xsize, int ys
grid.ysize = ysize; grid.ysize = ysize;
grid.xvals = NULL; grid.xvals = NULL;
grid.yvals = NULL; grid.yvals = NULL;
gridID = varDefGrid(vlistID, &grid, 0); int gridID = varDefGrid(vlistID, &grid, 0);
/* /*
if ( level == 0 ) leveltype = ZAXIS_SURFACE; if ( level == 0 ) leveltype = ZAXIS_SURFACE;
else leveltype = ZAXIS_GENERIC; else leveltype = ZAXIS_GENERIC;
*/ */
leveltype = ZAXIS_GENERIC; int leveltype = ZAXIS_GENERIC;
int datatype = srvInqDatatype(prec);
datatype = srvInqDatatype(prec); int levelID = 0;
int varID;
varAddRecord(recID, param, gridID, leveltype, 0, level, 0, 0, 0, varAddRecord(recID, param, gridID, leveltype, 0, level, 0, 0, 0,
datatype, &varID, &levelID, TSTEP_INSTANT, 0, 0, -1, NULL, NULL, NULL, NULL); datatype, &varID, &levelID, TSTEP_INSTANT, 0, 0, -1, NULL, NULL, NULL, NULL);
xassert(varID <= SHRT_MAX && levelID <= SHRT_MAX); xassert(varID <= SHRT_MAX && levelID <= SHRT_MAX);
(*record).varID = (short)varID; record->varID = (short)varID;
(*record).levelID = (short)levelID; record->levelID = (short)levelID;
streamptr->tsteps[tsID].nallrecs++; streamptr->tsteps[tsID].nallrecs++;
streamptr->nrecs++; streamptr->nrecs++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment