Commit 981b8736 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdi_create_records: changed argument type to stream_t

parent e0838ab1
...@@ -1438,7 +1438,7 @@ int streamDefTimestep(int streamID, int tsID) ...@@ -1438,7 +1438,7 @@ int streamDefTimestep(int streamID, int tsID)
&& time_is_varying ) && time_is_varying )
cdfDefTimestep(streamID, tsID); cdfDefTimestep(streamID, tsID);
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
return (streamptr->ntsteps); return (streamptr->ntsteps);
} }
......
...@@ -833,7 +833,7 @@ int cgribexScanTimestep2(int streamID) ...@@ -833,7 +833,7 @@ int cgribexScanTimestep2(int streamID)
fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET); fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecords = streamptr->tsteps[tsID].nallrecs; nrecords = streamptr->tsteps[tsID].nallrecs;
streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int)); streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
...@@ -1110,7 +1110,7 @@ int cgribexScanTimestep(int streamID) ...@@ -1110,7 +1110,7 @@ int cgribexScanTimestep(int streamID)
gribbuffer = (unsigned char *) streamptr->record->buffer; gribbuffer = (unsigned char *) streamptr->record->buffer;
buffersize = streamptr->record->buffersize; buffersize = streamptr->record->buffersize;
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecs = streamptr->tsteps[1].nrecs; nrecs = streamptr->tsteps[1].nrecs;
......
...@@ -529,7 +529,7 @@ int extScanTimestep2(int streamID) ...@@ -529,7 +529,7 @@ int extScanTimestep2(int streamID)
fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET); fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecords = streamptr->tsteps[0].nallrecs; nrecords = streamptr->tsteps[0].nallrecs;
streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int)); streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
...@@ -540,9 +540,9 @@ int extScanTimestep2(int streamID) ...@@ -540,9 +540,9 @@ int extScanTimestep2(int streamID)
for ( recID = 0; recID < nrecords; recID++ ) for ( recID = 0; recID < nrecords; recID++ )
{ {
varID = streamptr->tsteps[0].records[recID].varID; varID = streamptr->tsteps[0].records[recID].varID;
streamptr->tsteps[tsID].records[recID].position = streamptr->tsteps[tsID].records[recID].position =
streamptr->tsteps[0].records[recID].position; streamptr->tsteps[0].records[recID].position;
streamptr->tsteps[tsID].records[recID].size = streamptr->tsteps[tsID].records[recID].size =
streamptr->tsteps[0].records[recID].size; streamptr->tsteps[0].records[recID].size;
} }
...@@ -718,7 +718,7 @@ int extScanTimestep(int streamID) ...@@ -718,7 +718,7 @@ int extScanTimestep(int streamID)
if ( streamptr->tsteps[tsID].recordSize == 0 ) if ( streamptr->tsteps[tsID].recordSize == 0 )
{ {
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecs = streamptr->tsteps[1].nrecs; nrecs = streamptr->tsteps[1].nrecs;
......
...@@ -1324,7 +1324,7 @@ int gribapiScanTimestep2(int streamID) ...@@ -1324,7 +1324,7 @@ int gribapiScanTimestep2(int streamID)
fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET); fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecords = streamptr->tsteps[tsID].nallrecs; nrecords = streamptr->tsteps[tsID].nallrecs;
streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int)); streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
...@@ -1626,7 +1626,7 @@ int gribapiScanTimestep(int streamID) ...@@ -1626,7 +1626,7 @@ int gribapiScanTimestep(int streamID)
gribbuffer = (unsigned char *) streamptr->record->buffer; gribbuffer = (unsigned char *) streamptr->record->buffer;
buffersize = streamptr->record->buffersize; buffersize = streamptr->record->buffersize;
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecs = streamptr->tsteps[1].nrecs; nrecs = streamptr->tsteps[1].nrecs;
......
...@@ -1046,7 +1046,7 @@ int iegScanTimestep2(int streamID) ...@@ -1046,7 +1046,7 @@ int iegScanTimestep2(int streamID)
fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET); fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecords = streamptr->tsteps[0].nallrecs; nrecords = streamptr->tsteps[0].nallrecs;
streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int)); streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
...@@ -1057,9 +1057,9 @@ int iegScanTimestep2(int streamID) ...@@ -1057,9 +1057,9 @@ int iegScanTimestep2(int streamID)
for ( recID = 0; recID < nrecords; recID++ ) for ( recID = 0; recID < nrecords; recID++ )
{ {
varID = streamptr->tsteps[0].records[recID].varID; varID = streamptr->tsteps[0].records[recID].varID;
streamptr->tsteps[tsID].records[recID].position = streamptr->tsteps[tsID].records[recID].position =
streamptr->tsteps[0].records[recID].position; streamptr->tsteps[0].records[recID].position;
streamptr->tsteps[tsID].records[recID].size = streamptr->tsteps[tsID].records[recID].size =
streamptr->tsteps[0].records[recID].size; streamptr->tsteps[0].records[recID].size;
} }
...@@ -1239,7 +1239,7 @@ int iegScanTimestep(int streamID) ...@@ -1239,7 +1239,7 @@ int iegScanTimestep(int streamID)
if ( streamptr->tsteps[tsID].recordSize == 0 ) if ( streamptr->tsteps[tsID].recordSize == 0 )
{ {
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecs = streamptr->tsteps[1].nrecs; nrecs = streamptr->tsteps[1].nrecs;
......
...@@ -295,7 +295,7 @@ void cdi_generate_vars(stream_t *streamptr); ...@@ -295,7 +295,7 @@ void cdi_generate_vars(stream_t *streamptr);
void vlist_check_contents(int vlistID); void vlist_check_contents(int vlistID);
void cdiCreateRecords(int streamID, int tsID); void cdi_create_records(stream_t *streamptr, int tsID);
int recordNewEntry(stream_t *streamptr, int tsID); int recordNewEntry(stream_t *streamptr, int tsID);
......
...@@ -494,21 +494,16 @@ void streamCopyRecord(int streamID2, int streamID1) ...@@ -494,21 +494,16 @@ void streamCopyRecord(int streamID2, int streamID1)
} }
void cdiCreateRecords(int streamID, int tsID) void cdi_create_records(stream_t *streamptr, int tsID)
{ {
int nrecords, maxrecords; int nrecords, maxrecords;
int nvars, varID, recID; int nvars, varID, recID;
record_t *records; record_t *records;
int vlistID; int vlistID;
stream_t *streamptr;
streamptr = stream_to_pointer(streamID);
stream_check_ptr(__func__, streamptr);
if ( streamptr->tsteps[tsID].records ) return; if ( streamptr->tsteps[tsID].records ) return;
vlistID = streamInqVlist(streamID); vlistID = streamptr->vlistID;
if ( tsID == 0 ) if ( tsID == 0 )
{ {
......
...@@ -529,7 +529,7 @@ int srvScanTimestep2(int streamID) ...@@ -529,7 +529,7 @@ int srvScanTimestep2(int streamID)
fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET); fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecords = streamptr->tsteps[0].nallrecs; nrecords = streamptr->tsteps[0].nallrecs;
streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int)); streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
...@@ -717,7 +717,7 @@ int srvScanTimestep(int streamID) ...@@ -717,7 +717,7 @@ int srvScanTimestep(int streamID)
if ( streamptr->tsteps[tsID].recordSize == 0 ) if ( streamptr->tsteps[tsID].recordSize == 0 )
{ {
cdiCreateRecords(streamID, tsID); cdi_create_records(streamptr, tsID);
nrecs = streamptr->tsteps[1].nrecs; nrecs = streamptr->tsteps[1].nrecs;
......
Markdown is supported
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