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

cdf_read: removed limitation of nmiss_ to INT_MAX [Bug #8691].

parent 43ff5095
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
* using EXSE library version 1.4.1 * using EXSE library version 1.4.1
* Version 1.9.6 released * Version 1.9.6 released
2018-10-11 Uwe Schulzweida
* cdf_read: removed limitation of nmiss_ to INT_MAX [Bug #8691]
2018-10-08 Uwe Schulzweida 2018-10-08 Uwe Schulzweida
* NetCDF: Fix xyz dim order for unstructured grids without coordinates * NetCDF: Fix xyz dim order for unstructured grids without coordinates
......
...@@ -504,9 +504,7 @@ void cdfReadVarDP(stream_t *streamptr, int varID, double *data, size_t *nmiss) ...@@ -504,9 +504,7 @@ void cdfReadVarDP(stream_t *streamptr, int varID, double *data, size_t *nmiss)
validRange[0] = DBL_MIN, validRange[1] = DBL_MAX; validRange[0] = DBL_MIN, validRange[1] = DBL_MAX;
double addoffset = vlistInqVarAddoffset(vlistID, varID); double addoffset = vlistInqVarAddoffset(vlistID, varID);
double scalefactor = vlistInqVarScalefactor(vlistID, varID); double scalefactor = vlistInqVarScalefactor(vlistID, varID);
size_t nmiss_ = cdfDoInputDataTransformationDP(size, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]); *nmiss = cdfDoInputDataTransformationDP(size, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]);
assert(nmiss_ <= INT_MAX);
*nmiss = (int)nmiss_;
} }
static static
...@@ -536,9 +534,7 @@ void cdfReadVarSP(stream_t *streamptr, int varID, float *data, size_t *nmiss) ...@@ -536,9 +534,7 @@ void cdfReadVarSP(stream_t *streamptr, int varID, float *data, size_t *nmiss)
validRange[0] = DBL_MIN, validRange[1] = DBL_MAX; validRange[0] = DBL_MIN, validRange[1] = DBL_MAX;
double addoffset = vlistInqVarAddoffset(vlistID, varID); double addoffset = vlistInqVarAddoffset(vlistID, varID);
double scalefactor = vlistInqVarScalefactor(vlistID, varID); double scalefactor = vlistInqVarScalefactor(vlistID, varID);
size_t nmiss_ = cdfDoInputDataTransformationSP(size, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]); *nmiss = cdfDoInputDataTransformationSP(size, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]);
assert(nmiss_ <= INT_MAX);
*nmiss = (int)nmiss_;
} }
...@@ -602,9 +598,7 @@ void cdfReadVarSliceDP(stream_t *streamptr, int varID, int levelID, double *data ...@@ -602,9 +598,7 @@ void cdfReadVarSliceDP(stream_t *streamptr, int varID, int levelID, double *data
validRange[0] = DBL_MIN, validRange[1] = DBL_MAX; validRange[0] = DBL_MIN, validRange[1] = DBL_MAX;
double addoffset = vlistInqVarAddoffset(vlistID, varID); double addoffset = vlistInqVarAddoffset(vlistID, varID);
double scalefactor = vlistInqVarScalefactor(vlistID, varID); double scalefactor = vlistInqVarScalefactor(vlistID, varID);
size_t nmiss_ = cdfDoInputDataTransformationDP(gridsize, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]); *nmiss = cdfDoInputDataTransformationDP(gridsize, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]);
assert(nmiss_ <= INT_MAX);
*nmiss = (int)nmiss_;
} }
static static
...@@ -659,9 +653,7 @@ void cdfReadVarSliceSP(stream_t *streamptr, int varID, int levelID, float *data, ...@@ -659,9 +653,7 @@ void cdfReadVarSliceSP(stream_t *streamptr, int varID, int levelID, float *data,
validRange[0] = DBL_MIN, validRange[1] = DBL_MAX; validRange[0] = DBL_MIN, validRange[1] = DBL_MAX;
double addoffset = vlistInqVarAddoffset(vlistID, varID); double addoffset = vlistInqVarAddoffset(vlistID, varID);
double scalefactor = vlistInqVarScalefactor(vlistID, varID); double scalefactor = vlistInqVarScalefactor(vlistID, varID);
size_t nmiss_ = cdfDoInputDataTransformationSP(gridsize, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]); *nmiss = cdfDoInputDataTransformationSP(gridsize, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]);
assert(nmiss_ <= INT_MAX);
*nmiss = (int)nmiss_;
} }
...@@ -758,9 +750,7 @@ void cdfReadVarSliceDPPart(stream_t *streamptr, int varID, int levelID, int varT ...@@ -758,9 +750,7 @@ void cdfReadVarSliceDPPart(stream_t *streamptr, int varID, int levelID, int varT
validRange[0] = DBL_MIN, validRange[1] = DBL_MAX; validRange[0] = DBL_MIN, validRange[1] = DBL_MAX;
double addoffset = vlistInqVarAddoffset(vlistID, varID); double addoffset = vlistInqVarAddoffset(vlistID, varID);
double scalefactor = vlistInqVarScalefactor(vlistID, varID); double scalefactor = vlistInqVarScalefactor(vlistID, varID);
size_t nmiss_ = cdfDoInputDataTransformationDP(length, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]); *nmiss = cdfDoInputDataTransformationDP(length, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]);
assert(nmiss_ <= INT_MAX);
*nmiss = (size_t)nmiss_;
} }
void cdfReadVarSliceSPPart(stream_t *streamptr, int varID, int levelID, int varType, int startpoint, size_t length, float *data, size_t *nmiss) void cdfReadVarSliceSPPart(stream_t *streamptr, int varID, int levelID, int varType, int startpoint, size_t length, float *data, size_t *nmiss)
...@@ -827,9 +817,7 @@ void cdfReadVarSliceSPPart(stream_t *streamptr, int varID, int levelID, int varT ...@@ -827,9 +817,7 @@ void cdfReadVarSliceSPPart(stream_t *streamptr, int varID, int levelID, int varT
validRange[0] = DBL_MIN, validRange[1] = DBL_MAX; validRange[0] = DBL_MIN, validRange[1] = DBL_MAX;
float addoffset = vlistInqVarAddoffset(vlistID, varID); float addoffset = vlistInqVarAddoffset(vlistID, varID);
float scalefactor = vlistInqVarScalefactor(vlistID, varID); float scalefactor = vlistInqVarScalefactor(vlistID, varID);
size_t nmiss_ = cdfDoInputDataTransformationSP(length, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]); *nmiss = cdfDoInputDataTransformationSP(length, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]);
assert(nmiss_ <= INT_MAX);
*nmiss = (size_t)nmiss_;
} }
static static
...@@ -915,9 +903,7 @@ void cdfReadVarDPPart(stream_t *streamptr, int varID, int varType, int startpoin ...@@ -915,9 +903,7 @@ void cdfReadVarDPPart(stream_t *streamptr, int varID, int varType, int startpoin
validRange[0] = DBL_MIN, validRange[1] = DBL_MAX; validRange[0] = DBL_MIN, validRange[1] = DBL_MAX;
double addoffset = vlistInqVarAddoffset(vlistID, varID); double addoffset = vlistInqVarAddoffset(vlistID, varID);
double scalefactor = vlistInqVarScalefactor(vlistID, varID); double scalefactor = vlistInqVarScalefactor(vlistID, varID);
size_t nmiss_ = cdfDoInputDataTransformationDP(size, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]); *nmiss = cdfDoInputDataTransformationDP(size, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]);
assert(nmiss_ <= INT_MAX);
*nmiss = (size_t)nmiss_;
} }
void cdfReadVarSPPart(stream_t *streamptr, int varID, int varType, int startpoint, size_t length, float *data, size_t *nmiss) void cdfReadVarSPPart(stream_t *streamptr, int varID, int varType, int startpoint, size_t length, float *data, size_t *nmiss)
...@@ -959,9 +945,7 @@ void cdfReadVarSPPart(stream_t *streamptr, int varID, int varType, int startpoin ...@@ -959,9 +945,7 @@ void cdfReadVarSPPart(stream_t *streamptr, int varID, int varType, int startpoin
validRange[0] = DBL_MIN, validRange[1] = DBL_MAX; validRange[0] = DBL_MIN, validRange[1] = DBL_MAX;
float addoffset = vlistInqVarAddoffset(vlistID, varID); float addoffset = vlistInqVarAddoffset(vlistID, varID);
float scalefactor = vlistInqVarScalefactor(vlistID, varID); float scalefactor = vlistInqVarScalefactor(vlistID, varID);
size_t nmiss_ = cdfDoInputDataTransformationSP(size, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]); *nmiss = cdfDoInputDataTransformationSP(size, data, haveMissVal, missval, scalefactor, addoffset, validRange[0], validRange[1]);
assert(nmiss_ <= INT_MAX);
*nmiss = (size_t)nmiss_;
} }
static static
......
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