summaryrefslogtreecommitdiffstats
path: root/tools/h5import/h5import.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5import/h5import.c')
-rw-r--r--tools/h5import/h5import.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 9617df3..c71aeef 100644
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -5,12 +5,10 @@
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "hdf5.h"
@@ -1439,7 +1437,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
#endif
if (HDstrcmp("H5T_VARIABLE;", temp)) {
char *more = temp;
- ival = HDstrtol(more, &more, 10);
+ ival = (int)HDstrtol(more, &more, 10);
if (getInputSize(in, ival) == -1) {
(void) HDfprintf(stderr, err5b, infile);
goto error;
@@ -2279,13 +2277,13 @@ static int parseDimensions(struct Input *in, char *strm)
HDstrncpy(temp, strm, sizeof(temp));
temp[sizeof(temp) - 1] = '\0';
in->sizeOfDimension[i++]
- = HDstrtol(HDstrtok (temp, delimiter), NULL, BASE_10);
+ = HDstrtoull(HDstrtok (temp, delimiter), NULL, BASE_10);
while (1) {
token = HDstrtok (NULL, delimiter);
if (token == NULL)
break;
- in->sizeOfDimension[i++] = HDstrtol(token, NULL, BASE_10);
+ in->sizeOfDimension[i++] = HDstrtoull(token, NULL, BASE_10);
}
return (0);
}
@@ -3121,7 +3119,7 @@ static int getRank(struct Input *in, FILE *strm)
/* same as getChunkedDimensionSizes. But defined separately for extensibility */
static int getDimensionSizes(struct Input *in, FILE *strm)
{
- int ival;
+ unsigned long long ullval;
int i = 0;
const char *err1 = "Unable to allocate dynamic memory.\n";
@@ -3132,8 +3130,8 @@ static int getDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%d", (&ival)) == 1)
- in->sizeOfDimension[i++] = ival;
+ while (fscanf(strm, "%llu", (&ullval)) == 1)
+ in->sizeOfDimension[i++] = ullval;
if (in->rank != i) {
(void) HDfprintf(stderr, "%s", err2);
@@ -3144,7 +3142,7 @@ static int getDimensionSizes(struct Input *in, FILE *strm)
/* same as getDimensionSizes. But defined separately for extensibility */
static int getChunkedDimensionSizes(struct Input *in, FILE *strm)
{
- int ival;
+ unsigned long long ullval;
int i = 0;
const char *err1 = "Unable to allocate dynamic memory.\n";
@@ -3156,8 +3154,8 @@ static int getChunkedDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%d", (&ival)) == 1)
- in->sizeOfChunk[i++] = ival;
+ while (fscanf(strm, "%llu", (&ullval)) == 1)
+ in->sizeOfChunk[i++] = ullval;
if (in->rank != i) {
(void) HDfprintf(stderr, "%s", err2);
@@ -3174,7 +3172,7 @@ static int getChunkedDimensionSizes(struct Input *in, FILE *strm)
static int getMaximumDimensionSizes(struct Input *in, FILE *strm)
{
- int ival;
+ long long llval;
int i = 0;
const char *err1 = "Unable to allocate dynamic memory.\n";
@@ -3186,11 +3184,11 @@ static int getMaximumDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%d", (&ival)) == 1) {
- if (ival == -1)
+ while (fscanf(strm, "%lld", (&llval)) == 1) {
+ if (llval == -1)
in->maxsizeOfDimension[i++] = H5S_UNLIMITED;
else
- in->maxsizeOfDimension[i++] = ival;
+ in->maxsizeOfDimension[i++] = (hsize_t)llval;
}
if (in->rank != i) {
@@ -3927,7 +3925,7 @@ static int process(struct Options *opt)
return (-1);
}
HDfclose(extfile);
- H5Pset_external(proplist, in->externFilename, (off_t) 0, numOfElements * in->inputSize / 8);
+ H5Pset_external(proplist, in->externFilename, (off_t)0, numOfElements * (hsize_t)in->inputSize / 8);
}
/* create dataspace */