Commit 70087c9c authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Change datatype of nmiss to size_t.

parent 6bb7c48e
......@@ -802,7 +802,7 @@ void cdfWriteGridTraj(stream_t *streamptr, int gridID)
static
void cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dtype, size_t nvals, size_t xsize, size_t ysize,
bool swapxy, size_t *start, size_t *count, int memtype, const void *data, int nmiss)
bool swapxy, size_t *start, size_t *count, int memtype, const void *data, size_t nmiss)
{
const double *pdata_dp = (const double *) data;
double *mdata_dp = NULL;
......@@ -978,7 +978,7 @@ 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)
void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data, size_t nmiss)
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
......@@ -1073,7 +1073,7 @@ 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)
const int rect[][2], const void *data, size_t nmiss)
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
......@@ -1174,7 +1174,7 @@ 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)
void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, size_t nmiss)
{
if ( streamptr->accessmode == 0 ) cdfEndDef(streamptr);
......@@ -1263,7 +1263,7 @@ void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtyp
}
void cdf_write_record(stream_t *streamptr, int memtype, const void *data, int nmiss)
void cdf_write_record(stream_t *streamptr, int memtype, const void *data, size_t nmiss)
{
int varID = streamptr->record->varID;
int levelID = streamptr->record->levelID;
......
......@@ -391,30 +391,30 @@ int streamInqNvars(int streamID);
/* STREAM var I/O routines (random access) */
/* streamWriteVar: Write a variable */
void streamWriteVar(int streamID, int varID, const double data[], int nmiss);
void streamWriteVarF(int streamID, int varID, const float data[], int nmiss);
void streamWriteVar(int streamID, int varID, const double data[], size_t nmiss);
void streamWriteVarF(int streamID, int varID, const float data[], size_t nmiss);
/* streamReadVar: Read a variable */
void streamReadVar(int streamID, int varID, double data[], int *nmiss);
void streamReadVarF(int streamID, int varID, float data[], int *nmiss);
/* streamWriteVarSlice: Write a horizontal slice of a variable */
void streamWriteVarSlice(int streamID, int varID, int levelID, const double data[], int nmiss);
void streamWriteVarSliceF(int streamID, int varID, int levelID, const float data[], int nmiss);
void streamWriteVarSlice(int streamID, int varID, int levelID, const double data[], size_t nmiss);
void streamWriteVarSliceF(int streamID, int varID, int levelID, const float data[], size_t nmiss);
/* streamReadVarSlice: Read a horizontal slice of a variable */
void streamReadVarSlice(int streamID, int varID, int levelID, double data[], int *nmiss);
void streamReadVarSliceF(int streamID, int varID, int levelID, float data[], int *nmiss);
void streamWriteVarChunk(int streamID, int varID, const int rect[3][2], const double data[], int nmiss);
void streamWriteVarChunk(int streamID, int varID, const int rect[3][2], const double data[], size_t nmiss);
/* STREAM record I/O routines (sequential access) */
void streamDefRecord(int streamID, int varID, int levelID);
void streamInqRecord(int streamID, int *varID, int *levelID);
void streamWriteRecord(int streamID, const double data[], int nmiss);
void streamWriteRecordF(int streamID, const float data[], int nmiss);
void streamWriteRecord(int streamID, const double data[], size_t nmiss);
void streamWriteRecordF(int streamID, const float data[], size_t nmiss);
void streamReadRecord(int streamID, double data[], int *nmiss);
void streamReadRecordF(int streamID, float data[], int *nmiss);
void streamCopyRecord(int streamIDdest, int streamIDsrc);
......
......@@ -442,11 +442,11 @@ void
cdiStreamDefVlist_(int streamID, int vlistID);
int
cdiStreamWriteVar_(int streamID, int varID, int memtype, const void *data, int nmiss);
cdiStreamWriteVar_(int streamID, int varID, int memtype, const void *data, size_t nmiss);
void
cdiStreamWriteVarChunk_(int streamID, int varID, int memtype,
const int rect[][2], const void *data, int nmiss);
const int rect[][2], const void *data, size_t nmiss);
void
cdiStreamCloseDefaultDelegate(stream_t *streamptr,
int recordBufIsToBeDeleted);
......
......@@ -49,12 +49,12 @@ void pioWriteTimestep(void);
void cdiPioRDMAProgress(void);
void streamWriteVarPart (int streamID, int varID,
const void *data, int nmiss,
const void *data, size_t nmiss,
Xt_idxlist partDesc);
void streamWriteScatteredVarPart(int streamID, int varID, const void *data,
int numBlocks, const int blocklengths[],
const int displacements[],
int nmiss, Xt_idxlist partDesc);
size_t nmiss, Xt_idxlist partDesc);
/* cdiPioCSRLastN: return role codes appropriate to use the last
\textit{nProcsIO} tasks as I/O servers */
int cdiPioCSRLastN(MPI_Comm commSuper, int IOMode, int nProcsIO);
......
......@@ -55,12 +55,12 @@ static int cdiPioInit_fwrap(int commSuper, int confResH, int *pioNamespace)
FCALLSCFUN3 (INT, cdiPioInit_fwrap, CDIPIOINIT, cdipioinit, INT, INT, PINT)
FCALLSCSUB0 (pioWriteTimestep, PIOWRITETIMESTEP, piowritetimestep)
FCALLSCSUB0 (cdiPioRDMAProgress, CDIPIORDMAPROGRESS, cdipiordmaprogress)
static void streamWriteVarPart_fwrap(int streamID, int varID, const void *data, int nmiss, void *partDesc)
static void streamWriteVarPart_fwrap(int streamID, int varID, const void *data, size_t nmiss, void *partDesc)
{
streamWriteVarPart(streamID, varID, data, nmiss, (*(Xt_idxlist *)partDesc));
}
FCALLSCSUB5 (streamWriteVarPart_fwrap, STREAMWRITEVARPART, streamwritevarpart, INT, INT, PVOID, INT, PVOID)
static void streamWriteScatteredVarPart_fwrap(int streamID, int varID, const void *data, int numBlocks, const int blocklengths[], const int displacements[], int nmiss, void *partDesc)
static void streamWriteScatteredVarPart_fwrap(int streamID, int varID, const void *data, int numBlocks, const int blocklengths[], const int displacements[], size_t nmiss, void *partDesc)
{
streamWriteScatteredVarPart(streamID, varID, data, numBlocks, blocklengths, displacements, nmiss, (*(Xt_idxlist *)partDesc));
}
......
......@@ -19,7 +19,7 @@
static
size_t grbEncode(int filetype, int memtype, int varID, int levelID, int vlistID, int gridID, int zaxisID,
int date, int time, int tsteptype, int numavg,
size_t datasize, const void *data, int nmiss, void **gribbuffer,
size_t datasize, const void *data, size_t nmiss, void **gribbuffer,
int comptype, void *gribContainer)
{
size_t nbytes = 0;
......@@ -153,7 +153,7 @@ void grbCopyRecord(stream_t * streamptr2, stream_t * streamptr1)
if (scanModeIN != cdiGribDataScanningMode.value)
{
//int zip;
int nmiss = 0;
size_t nmiss = 0;
int vlistID = streamptr1->vlistID;
int varID = streamptr1->tsteps[tsID].records[recID].varID;
......@@ -186,7 +186,7 @@ void grbCopyRecord(stream_t * streamptr2, stream_t * streamptr1)
//grb_write_var_slice(streamptr, varID, levelID, memtype, ((double*)data)+levelID*gridsize, nmiss);
//grb_write_var(streamptr2, varID, MEMTYPE_DOUBLE, data, nmiss);
//grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss)
//grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data, size_t nmiss)
//grb_write_var_slice(streamptr2, varID, levelID, MEMTYPE_DOUBLE, (const void *) data, nmiss);
free(data);
......@@ -217,7 +217,7 @@ void grbCopyRecord(stream_t * streamptr2, stream_t * streamptr1)
}
void grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss)
void grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, size_t nmiss)
{
void *gribbuffer = NULL;
void *gc = NULL;
......@@ -285,7 +285,7 @@ void grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtyp
}
void grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss)
void grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data, size_t nmiss)
{
int vlistID = streamptr->vlistID,
gridID = vlistInqVarGrid(vlistID, varID),
......@@ -300,7 +300,7 @@ void grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data
{
const float *restrict fdata = ((const float *)data)+levelID*gridsize;
int nmiss_slice = 0;
size_t nmiss_slice = 0;
if ( nmiss )
for ( size_t i = 0; i < chunkLen; ++i )
nmiss_slice += DBL_IS_EQUAL(fdata[i], missval);
......@@ -312,7 +312,7 @@ void grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data
{
const double *restrict ddata = ((const double *)data)+levelID*gridsize;
int nmiss_slice = 0;
size_t nmiss_slice = 0;
if ( nmiss )
for ( size_t i = 0; i < chunkLen; ++i )
nmiss_slice += DBL_IS_EQUAL(ddata[i], missval);
......@@ -322,7 +322,7 @@ void grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data
}
void grb_write_record(stream_t *streamptr, int memtype, const void *data, int nmiss)
void grb_write_record(stream_t *streamptr, int memtype, const void *data, size_t nmiss)
{
int varID = streamptr->record->varID;
int levelID = streamptr->record->levelID;
......
......@@ -129,12 +129,12 @@ cdiPioClientStreamDefVlist_(int streamID, int vlistID)
static void
cdiPioClientStreamWriteVar_(int streamID, int varID, int memtype,
const void *data, int nmiss)
const void *data, size_t nmiss)
__attribute__((noreturn));
static void
cdiPioClientStreamWriteVar_(int streamID, int varID, int memtype,
const void *data, int nmiss)
const void *data, size_t nmiss)
{
(void)streamID; (void)varID; (void)memtype; (void)data; (void)nmiss;
xabort("parallel writing requires explicit partition information,"
......@@ -144,7 +144,7 @@ cdiPioClientStreamWriteVar_(int streamID, int varID, int memtype,
static void
cdiPioClientStreamWriteVarChunk_(int streamID, int varID, int memtype,
const int rect[][2],
const void *data, int nmiss)
const void *data, size_t nmiss)
{
/* todo: handle transmission of float data */
if (memtype != MEMTYPE_DOUBLE)
......@@ -170,7 +170,7 @@ cdiPioClientStreamWriteVarChunk_(int streamID, int varID, int memtype,
static void
cdiPioClientStreamWriteVarPart(int streamID, int varID, const void *data,
int nmiss, Xt_idxlist partDesc)
size_t nmiss, Xt_idxlist partDesc)
{
pioBufferPartData(streamID, varID, data, nmiss, partDesc);
}
......@@ -180,7 +180,7 @@ cdiPioClientStreamWriteScatteredVarPart(int streamID, int varID,
const void *data,
int numBlocks, const int blocklengths[],
const int displacements[],
int nmiss, Xt_idxlist partDesc)
size_t nmiss, Xt_idxlist partDesc)
{
cdiPioBufferPartDataGather(streamID, varID, data, numBlocks,
blocklengths, displacements, nmiss, partDesc);
......
......@@ -286,7 +286,7 @@ cdiPioRDMAProgress(void)
static void
pioBufferPartData_(int streamID, int varID,
const void *packData, valPackFunc packDataFunc,
int nmiss, Xt_idxlist partDesc)
size_t nmiss, Xt_idxlist partDesc)
{
size_t streamIdx = indexOfID(&openStreams, streamID);
xassert(streamIdx != SIZE_MAX);
......@@ -309,7 +309,7 @@ pioBufferPartData_(int streamID, int varID,
void
pioBufferPartData(int streamID, int varID, const double *data,
int nmiss, Xt_idxlist partDesc)
size_t nmiss, Xt_idxlist partDesc)
{
int chunk = xt_idxlist_get_num_indices(partDesc);
xassert(chunk <= INT_MAX);
......@@ -368,7 +368,7 @@ void
cdiPioBufferPartDataGather(int streamID, int varID, const double *data,
int numBlocks, const int blocklengths[],
const int displacements[],
int nmiss, Xt_idxlist partDesc)
size_t nmiss, Xt_idxlist partDesc)
{
xassert(numBlocks >= 0);
pioBufferPartData_(streamID, varID,
......@@ -684,7 +684,7 @@ void pioWriteTimestep(void)
void
streamWriteVarPart(int streamID, int varID, const void *data,
int nmiss, Xt_idxlist partDesc)
size_t nmiss, Xt_idxlist partDesc)
{
if ( CDI_Debug ) Message("streamID = %d varID = %d", streamID, varID);
......@@ -692,7 +692,7 @@ streamWriteVarPart(int streamID, int varID, const void *data,
xassert(chunk == 0 || data);
void (*myStreamWriteVarPart)(int streamID, int varID, const void *data,
int nmiss, Xt_idxlist partDesc)
size_t nmiss, Xt_idxlist partDesc)
= (void (*)(int, int, const void *, int, Xt_idxlist))
namespaceSwitchGet(NSSWITCH_STREAM_WRITE_VAR_PART_).func;
......@@ -706,7 +706,7 @@ void
streamWriteScatteredVarPart(int streamID, int varID, const void *data,
int numBlocks, const int blocklengths[],
const int displacements[],
int nmiss, Xt_idxlist partDesc)
size_t nmiss, Xt_idxlist partDesc)
{
if ( CDI_Debug ) Message("streamID = %d varID = %d", streamID, varID);
......@@ -717,7 +717,7 @@ streamWriteScatteredVarPart(int streamID, int varID, const void *data,
const void *data,
int numBlocks, const int blocklengths[],
const int displacements[],
int nmiss, Xt_idxlist partDesc)
size_t nmiss, Xt_idxlist partDesc)
= (void (*)(int, int, const void *, int, const int[], const int[], int,
Xt_idxlist))
namespaceSwitchGet(NSSWITCH_STREAM_WRITE_SCATTERED_VAR_PART_).func;
......
......@@ -13,12 +13,12 @@
void
pioBufferPartData(int streamID, int varID, const double *data,
int nmiss, Xt_idxlist partDesc);
size_t nmiss, Xt_idxlist partDesc);
void
cdiPioBufferPartDataGather(int streamID, int varID, const double *data,
int numBlocks, const int blocklengths[],
const int displacements[],
int nmiss, Xt_idxlist partDesc);
size_t nmiss, Xt_idxlist partDesc);
void pioBufferFuncCall(int streamID,
struct winHeaderEntry header,
......
......@@ -303,7 +303,7 @@ countVarChunkMissingVals(int vlistID, int varID,
struct streamMapping *mapping,
int chunkLen, const double *restrict data)
{
int nmiss = 0;
size_t nmiss = 0;
if (mapping->hasMissing[varID])
{
double missval = vlistInqVarMissval(vlistID, varID);
......@@ -450,7 +450,7 @@ writeNetCDFStream(size_t streamIdx,
xt_idxlist_delete(preWriteChunk);
}
/* count missing values if appropriate */
int nmiss
size_t nmiss
= countVarChunkMissingVals(vlistID, varID, mapping,
PPM_extents_size(3, varChunk),
data);
......@@ -553,7 +553,7 @@ writeNetCDFStream(size_t streamIdx,
gatherArray(headerIdx, streamIdx, data, dstList, conf);
if (writerRank == collRank)
{
int nmiss = countVarChunkMissingVals(vlistID, varID,
size_t nmiss = countVarChunkMissingVals(vlistID, varID,
mapping, varSize, data);
streamWriteVar(streamID, varID, data, nmiss);
}
......@@ -1053,7 +1053,7 @@ writeGribStream(size_t streamIdx,
varIdx += varID != prevVarID;
size_t recordSize = writtenRecords[recordIdx].dataSize;
size_t nvals = recordSize / sizeof (double);
int nmiss
size_t nmiss
= countVarChunkMissingVals(vlistID, varID, mapping, (int)nvals,
data + recordDataOfs);
streamWriteVarSlice(streamID, varID, level, data + recordDataOfs, nmiss);
......
......@@ -19,16 +19,16 @@ void cdfCopyRecord(stream_t *streamptr2, stream_t *streamptr1);
void cdfDefineAttributes(int vlistID, int varID, int fileID, int ncvarID);
void cdf_read_record(stream_t *streamptr, int memtype, void *data, int *nmiss);
void cdf_write_record(stream_t *streamptr, int memtype, const void *data, int nmiss);
void cdf_write_record(stream_t *streamptr, int memtype, const void *data, size_t nmiss);
void cdf_read_var(stream_t *streamptr, int varID, int memtype, void *data, int *nmiss);
void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss);
void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data, size_t nmiss);
void cdf_read_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, 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_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, size_t nmiss);
void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
const int rect[][2], const void *data, int nmiss);
const int rect[][2], const void *data, size_t nmiss);
void cdfDefVarDeflate(int ncid, int ncvarid, int deflate_level);
void cdfDefTime(stream_t* streamptr);
......
......@@ -35,7 +35,7 @@ void cdfCopyRecord(stream_t *streamptr2, stream_t *streamptr1)
void *data = Malloc(datasize * (memtype == MEMTYPE_DOUBLE ? sizeof(double) : sizeof(float)));
int nmiss;
size_t nmiss;
cdf_read_record(streamptr1, memtype, data, &nmiss);
cdf_write_record(streamptr2, memtype, data, nmiss);
......
......@@ -2082,7 +2082,7 @@ void cgribexDefEnsembleVar(int *isec1, int vlistID, int varID)
#if defined (HAVE_LIBCGRIBEX)
size_t cgribexEncode(int memtype, int varID, int levelID, int vlistID, int gridID, int zaxisID,
int vdate, int vtime, int tsteptype, int numavg,
size_t datasize, const void *data, int nmiss, void *gribbuffer, size_t gribbuffersize)
size_t datasize, const void *data, size_t nmiss, void *gribbuffer, size_t gribbuffersize)
{
int iret = 0, iword = 0;
int isec0[2], isec1[4096], isec2[4096], isec3[2], isec4[512];
......
......@@ -10,7 +10,7 @@ int cgribexDecode(int memtype, void *gribbuffer, size_t gribsize, void *data, si
size_t cgribexEncode(int memtype, int varID, int levelID, int vlistID, int gridID, int zaxisID,
int vdate, int vtime, int tsteptype, int numavg,
size_t datasize, const void *data, int nmiss, void *gribbuffer, size_t gribbuffersize);
size_t datasize, const void *data, size_t nmiss, void *gribbuffer, size_t gribbuffersize);
void *cgribex_handle_new_from_meassage(void *gribbuffer, size_t recsize);
void cgribex_handle_delete(void *gh);
......
......@@ -13,14 +13,14 @@ int grbInqTimestep(stream_t *streamptr, int tsID);
int grbInqRecord(stream_t *streamptr, int *varID, int *levelID);
void grbDefRecord(stream_t *streamptr);
void grb_read_record(stream_t *streamptr, int memtype, void *data, int *nmiss);
void grb_write_record(stream_t *streamptr, int memtype, const void *data, int nmiss);
void grb_write_record(stream_t *streamptr, int memtype, const void *data, size_t nmiss);
void grbCopyRecord(stream_t *streamptr2, stream_t *streamptr1);
void grb_read_var(stream_t *streamptr, int varID, int memtype, void *data, int *nmiss);
void grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss);
void grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data, size_t nmiss);
void grb_read_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, void *data, int *nmiss);
void grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss);
void grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, size_t nmiss);
int grib1ltypeToZaxisType(int grib_ltype);
int grib2ltypeToZaxisType(int grib_ltype);
......
......@@ -1896,7 +1896,7 @@ getGribApiCompTypeMsg(int comptype, size_t gridsize)
static
void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype, bool lieee, int datatype, int nmiss, int gcinit)
void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype, bool lieee, int datatype, size_t nmiss, int gcinit)
{
UNUSED(nmiss);
bool lrotated = false;
......@@ -3023,7 +3023,7 @@ void gribapiSetExtMode(grib_handle *gh, int gridID, size_t datasize, const doubl
size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
int vdate, int vtime, int tsteptype, int numavg,
size_t datasize, const double *data, int nmiss, void **gribbuffer, size_t *gribbuffersize,
size_t datasize, const double *data, size_t nmiss, void **gribbuffer, size_t *gribbuffersize,
int comptype, void *gribContainer)
{
size_t recsize = 0;
......
......@@ -14,7 +14,7 @@ int gribapiDecode(void *gribbuffer, size_t gribsize, double *data, size_t datasi
size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
int vdate, int vtime, int tsteptype, int numavg,
size_t datasize, const double *data, int nmiss, void **gribbuffer, size_t *gribbuffersize,
size_t datasize, const double *data, size_t nmiss, void **gribbuffer, size_t *gribbuffersize,
int ljpeg, void *gribContainer);
int gribapiGetScanningMode(grib_handle *gh);
......
......@@ -14,7 +14,7 @@
/* the single image implementation */
int cdiStreamWriteVar_(int streamID, int varID, int memtype, const void *data, int nmiss)
int cdiStreamWriteVar_(int streamID, int varID, int memtype, const void *data, size_t nmiss)
{
// May fail if memtype == MEMTYPE_FLOAT and the file format does not support single precision writing.
// A value > 0 is returned in this case, otherwise it returns zero.
......@@ -91,7 +91,7 @@ int cdiStreamWriteVar_(int streamID, int varID, int memtype, const void *data, i
@Function streamWriteVar
@Title Write a variable
@Prototype void streamWriteVar(int streamID, int varID, const double *data, int nmiss)
@Prototype void streamWriteVar(int streamID, int varID, const double *data, size_t nmiss)
@Parameter
@Item streamID Stream ID, from a previous call to @fref{streamOpenWrite}.
@Item varID Variable identifier.
......@@ -103,9 +103,9 @@ The function streamWriteVar writes the values of one time step of a variable to
The values are converted to the external data type of the variable, if necessary.
@EndFunction
*/
void streamWriteVar(int streamID, int varID, const double *data, int nmiss)
void streamWriteVar(int streamID, int varID, const double *data, size_t nmiss)
{
void (*myCdiStreamWriteVar_)(int streamID, int varID, int memtype, const void *data, int nmiss)
void (*myCdiStreamWriteVar_)(int streamID, int varID, int memtype, const void *data, size_t nmiss)
= (void (*)(int, int, int, const void *, int))
namespaceSwitchGet(NSSWITCH_STREAM_WRITE_VAR_).func;
......@@ -116,7 +116,7 @@ void streamWriteVar(int streamID, int varID, const double *data, int nmiss)
@Function streamWriteVarF
@Title Write a variable
@Prototype void streamWriteVarF(int streamID, int varID, const float *data, int nmiss)
@Prototype void streamWriteVarF(int streamID, int varID, const float *data, size_t nmiss)
@Parameter
@Item streamID Stream ID, from a previous call to @fref{streamOpenWrite}.
@Item varID Variable identifier.
......@@ -128,9 +128,9 @@ The function streamWriteVarF writes the values of one time step of a variable to
The values are converted to the external data type of the variable, if necessary.
@EndFunction
*/
void streamWriteVarF(int streamID, int varID, const float *data, int nmiss)
void streamWriteVarF(int streamID, int varID, const float *data, size_t nmiss)
{
int (*myCdiStreamWriteVar_)(int streamID, int varID, int memtype, const void *data, int nmiss)
int (*myCdiStreamWriteVar_)(int streamID, int varID, int memtype, const void *data, size_t nmiss)
= (int (*)(int, int, int, const void *, int))
namespaceSwitchGet(NSSWITCH_STREAM_WRITE_VAR_).func;
......@@ -150,7 +150,7 @@ void streamWriteVarF(int streamID, int varID, const float *data, int nmiss)
}
static
int cdiStreamWriteVarSlice(int streamID, int varID, int levelID, int memtype, const void *data, int nmiss)
int cdiStreamWriteVarSlice(int streamID, int varID, int levelID, int memtype, const void *data, size_t nmiss)
{
// May fail if memtype == MEMTYPE_FLOAT and the file format does not support single precision writing.
// A value > 0 is returned in this case, otherwise it returns zero.
......@@ -225,7 +225,7 @@ int cdiStreamWriteVarSlice(int streamID, int varID, int levelID, int memtype, co
@Function streamWriteVarSlice
@Title Write a horizontal slice of a variable
@Prototype void streamWriteVarSlice(int streamID, int varID, int levelID, const double *data, int nmiss)
@Prototype void streamWriteVarSlice(int streamID, int varID, int levelID, const double *data, size_t nmiss)
@Parameter
@Item streamID Stream ID, from a previous call to @fref{streamOpenWrite}.
@Item varID Variable identifier.
......@@ -238,7 +238,7 @@ The function streamWriteVarSlice writes the values of a horizontal slice of a va
The values are converted to the external data type of the variable, if necessary.
@EndFunction
*/
void streamWriteVarSlice(int streamID, int varID, int levelID, const double *data, int nmiss)
void streamWriteVarSlice(int streamID, int varID, int levelID, const double *data, size_t nmiss)
{
cdiStreamWriteVarSlice(streamID, varID, levelID, MEMTYPE_DOUBLE, (const void *) data, nmiss);
}
......@@ -247,7 +247,7 @@ void streamWriteVarSlice(int streamID, int varID, int levelID, const double *dat
@Function streamWriteVarSliceF
@Title Write a horizontal slice of a variable
@Prototype void streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data, int nmiss)
@Prototype void streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data, size_t nmiss)
@Parameter
@Item streamID Stream ID, from a previous call to @fref{streamOpenWrite}.
@Item varID Variable identifier.
......@@ -260,7 +260,7 @@ The function streamWriteVarSliceF writes the values of a horizontal slice of a v
The values are converted to the external data type of the variable, if necessary.
@EndFunction
*/
void streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data, int nmiss)
void streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data, size_t nmiss)
{
if ( cdiStreamWriteVarSlice(streamID, varID, levelID, MEMTYPE_FLOAT, (const void *) data, nmiss) )
{
......@@ -276,10 +276,10 @@ void streamWriteVarSliceF(int streamID, int varID, int levelID, const float *dat
void streamWriteVarChunk(int streamID, int varID,
const int rect[][2], const double *data, int nmiss)
const int rect[][2], const double *data, size_t nmiss)
{
void (*myCdiStreamWriteVarChunk_)(int streamID, int varID, int memtype,
const int rect[][2], const void *data, int nmiss)
const int rect[][2], const void *data, size_t nmiss)
= (void (*)(int, int, int, const int [][2], const void *, int))
namespaceSwitchGet(NSSWITCH_STREAM_WRITE_VAR_CHUNK_).func;
myCdiStreamWriteVarChunk_(streamID, varID, MEMTYPE_DOUBLE, rect, data, nmiss);
......@@ -287,7 +287,7 @@ void streamWriteVarChunk(int streamID, int varID,
/* single image implementation */
void cdiStreamWriteVarChunk_(int streamID, int varID, int memtype,
const int rect[][2], const void *data, int nmiss)
const int rect[][2], const void *data, size_t nmiss)
{
if ( CDI_Debug ) Message("streamID = %d varID = %d", streamID, varID);
......@@ -333,7 +333,7 @@ void cdiStreamWriteVarChunk_(int streamID, int varID, int memtype,
}
static
int stream_write_record(int streamID, int memtype, const void *data, int nmiss)
int stream_write_record(int streamID, int memtype, const void *data, size_t nmiss)
{
// May fail if memtype == MEMTYPE_FLOAT and the file format does not support single precision writing.
// A value > 0 is returned in this case, otherwise it returns zero.
......@@ -393,7 +393,7 @@ int stream_write_record(int streamID, int memtype, const void *data, int nmiss)
@Function streamWriteRecord
@Title Write a horizontal slice of a variable
@Prototype void streamWriteRecord(int streamID, const double *data, int nmiss)
@Prototype void streamWriteRecord(int streamID, const double *data, size_t nmiss)
@Parameter
@Item streamID Stream ID, from a previous call to @fref{streamOpenWrite}.
@Item data Pointer to a block of double precision floating point data values to be written.
......@@ -404,13 +404,13 @@ The function streamWriteRecord writes the values of a horizontal slice (record)
The values are converted to the external data type of the variable, if necessary.
@EndFunction
*/
void streamWriteRecord(int streamID, const double *data, int nmiss)
void streamWriteRecord(int streamID, const double *data, size_t nmiss)
{
stream_write_record(streamID, MEMTYPE_DOUBLE, (const void *) data, nmiss);
}
void streamWriteRecordF(int streamID, const float *data, int nmiss)
void streamWriteRecordF(int streamID, const float *data, size_t nmiss)
{
if ( stream_write_record(streamID, MEMTYPE_FLOAT, (const void *) data, nmiss) )
{
......
Markdown is supported
</