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

Adjust parameter type.

* Using long yields larger range of consistent comparisons.
parent d580e96f
No related branches found
No related tags found
2 merge requests!91Add alternative code path for huge buffers.,!89Miscellaneous fixes and CDI-PIO improvements
......@@ -768,10 +768,10 @@ calc_chunksize_y(int chunkType, size_t gridsize, size_t xsize, size_t ysize)
}
size_t
calc_chunksize_x(int chunkType, int chunkSize, size_t xsize, bool yIsUndefined)
calc_chunksize_x(int chunkType, long chunkSize, size_t xsize, bool yIsUndefined)
{
if (chunkType == CDI_CHUNK_AUTO && yIsUndefined)
return (chunkSize > 0 && chunkSize < (int) xsize) ? (size_t) chunkSize : ((xsize <= chunkSizeMin) ? xsize : chunkSizeMin);
return (chunkSize > 0 && (size_t) chunkSize < xsize) ? (size_t) chunkSize : ((xsize <= chunkSizeMin) ? xsize : chunkSizeMin);
else
return calc_chunksize(chunkSizeLim, xsize);
}
......
......@@ -58,7 +58,7 @@ void cdf_create_records(stream_t *streamptr, size_t tsID);
#define ChunkSizeMax 65536
#define ChunkSizeLim 16777216
size_t calc_chunksize_x(int chunkType, int chunkSize, size_t xsize, bool yIsUndefined);
size_t calc_chunksize_x(int chunkType, long chunkSize, size_t xsize, bool yIsUndefined);
size_t calc_chunksize_y(int chunkType, size_t gridsize, size_t xsize, size_t ysize);
#endif
......
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