Commit 95d7bdc7 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Fix implicit conversions, trailing whitespace and unused argument.

parent 425a8bc5
......@@ -1023,14 +1023,14 @@ void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data
count[ndims] = 1;
ndims++;
}
if ( zid != UNDEFID )
{
start[ndims] = 0;
count[ndims] = (size_t)zaxisInqSize(zaxisID);
ndims++;
}
if ( yid != UNDEFID )
{
start[ndims] = 0;
......@@ -1039,7 +1039,7 @@ void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data
count[ndims] = size;
ndims++;
}
if ( xid != UNDEFID )
{
start[ndims] = 0;
......@@ -1063,7 +1063,7 @@ void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data
if ( nmiss > 0 ) cdfDefVarMissval(streamptr, varID, dtype, 1);
size_t nvals = gridInqSize(gridID)*zaxisInqSize(zaxisID);
size_t nvals = (size_t)(gridInqSize(gridID)) * (size_t)(zaxisInqSize(zaxisID));
cdf_write_var_data(fileID, vlistID, varID, ncvarid, dtype, nvals, xsize, ysize, swapxy, start, count, memtype, data, nmiss);
}
......@@ -1165,7 +1165,7 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
if ( nmiss > 0 ) cdfDefVarMissval(streamptr, varID, dtype, 1);
size_t nvals = gridInqSize(gridID)*zaxisInqSize(zaxisID);
size_t nvals = (size_t)(gridInqSize(gridID)) * (size_t)(zaxisInqSize(zaxisID));
cdf_write_var_data(fileID, vlistID, varID, ncvarid, dtype, nvals,
xsize, ysize, swapxy, start, count, memtype, data, nmiss);
......@@ -1255,7 +1255,7 @@ void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtyp
if ( nmiss > 0 ) cdfDefVarMissval(streamptr, varID, dtype, 1);
size_t nvals = gridInqSize(gridID);
size_t nvals = (size_t)(gridInqSize(gridID));
cdf_write_var_data(fileID, vlistID, varID, ncvarid, dtype, nvals, xsize, ysize, swapxy, start, count, memtype, data, nmiss);
}
......
......@@ -141,7 +141,7 @@ void grb_read_record(stream_t * streamptr, int memtype, void *data, int *nmiss)
streamptr->tsteps[tsID].records[recID].zip = grbUnzipRecord(gribbuffer, &recsize);
grbDecode(filetype, memtype, gribbuffer, (int)recsize, data, gridsize, streamptr->unreduced, nmiss, missval, vlistID, varID);
grbDecode(filetype, memtype, gribbuffer, (int)recsize, data, (size_t)gridsize, streamptr->unreduced, nmiss, missval, vlistID, varID);
}
......@@ -187,7 +187,7 @@ void grb_read_var(stream_t * streamptr, int varID, int memtype, void *data, int
else
datap = (double*)data + levelID*gridsize;
grbDecode(filetype, memtype, gribbuffer, (int)recsize, datap, gridsize,
grbDecode(filetype, memtype, gribbuffer, (int)recsize, datap, (size_t)gridsize,
streamptr->unreduced, &imiss, missval, vlistID, varID);
*nmiss += imiss;
......@@ -231,7 +231,7 @@ void grb_read_var_slice(stream_t *streamptr, int varID, int levelID, int memtype
streamptr->tsteps[tsID].records[recID].zip = grbUnzipRecord(gribbuffer, &recsize);
double missval = vlistInqVarMissval(vlistID, varID);
grbDecode(filetype, memtype, gribbuffer, (int)recsize, data, gridsize, streamptr->unreduced, nmiss, missval, vlistID, varID);
grbDecode(filetype, memtype, gribbuffer, (int)recsize, data, (size_t)gridsize, streamptr->unreduced, nmiss, missval, vlistID, varID);
fileSetPos(fileID, currentfilepos, SEEK_SET);
}
......
......@@ -203,25 +203,27 @@ cdiPioGetPageSize(bool largePageAlign)
bool nameAssigned = false;
#if HAVE_DECL__SC_LARGE_PAGESIZE || HAVE_DECL__SC_PAGE_SIZE || HAVE_DECL__SC_PAGESIZE
int name;
#if HAVE_DECL__SC_LARGE_PAGESIZE
# if HAVE_DECL__SC_LARGE_PAGESIZE
if (largePageAlign)
{
name = _SC_LARGE_PAGESIZE;
nameAssigned = true;
}
else
#endif
# else
(void)largePageAlign;
# endif
{
#if HAVE_DECL__SC_PAGESIZE || HAVE_DECL__SC_PAGE_SIZE
# if HAVE_DECL__SC_PAGESIZE || HAVE_DECL__SC_PAGE_SIZE
name =
#if HAVE_DECL__SC_PAGESIZE
# if HAVE_DECL__SC_PAGESIZE
_SC_PAGESIZE
#elif HAVE_DECL__SC_PAGE_SIZE
# elif HAVE_DECL__SC_PAGE_SIZE
_SC_PAGE_SIZE
#endif
# endif
;
nameAssigned = true;
#endif
# endif
}
if (nameAssigned)
pagesize = sysconf(name);
......
......@@ -1342,16 +1342,16 @@ int cgribexDecode(int memtype, void *gribbuffer, int gribsize, void *data, long
*nmiss = 0;
if ( memtype == MEMTYPE_FLOAT )
{
float *dataf = (float*) data;
float *restrict dataf = (float*) data;
for ( long i = 0; i < datasize; i++ )
if ( (fabs(dataf[i]-undef_pds) < undef_eps) || IS_EQUAL(dataf[i],FSEC3_MissVal) ) {
dataf[i] = missval;
dataf[i] = (float)missval;
(*nmiss)++;
}
}
else
{
double *datad = (double*) data;
double *restrict datad = (double*) data;
for ( long i = 0; i < datasize; i++ )
if ( (fabs(datad[i]-undef_pds) < undef_eps) || IS_EQUAL(datad[i],FSEC3_MissVal) ) {
datad[i] = missval;
......
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