Skip to content

Commit f0ecd92

Browse files
committed
warning: implicit conversion loses integer precision
1 parent 845909c commit f0ecd92

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

utils/dat2decomp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int add_decomp(int ncid,
150150
else if (ndims == 3)
151151
printf("label D%d: dims = %lld x %lld x %lld (in C order)\n", label, dims[2], dims[1], dims[0]);
152152
}
153-
dimX = dims[0]; /* the least significant dimension */
153+
dimX = (int)dims[0]; /* the least significant dimension */
154154

155155
/* gsize is total number of elements in the global array */
156156
gsize = dims[0];

utils/dat2nc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int add_decomp(int ncid, const char *infname, int label) {
147147
else if (ndims == 3)
148148
printf("label D%d: dims = %lld x %lld x %lld (in C order)\n", label, dims[2], dims[1], dims[0]);
149149
}
150-
dimX = dims[0]; /* the least significant dimension */
150+
dimX = (int)dims[0]; /* the least significant dimension */
151151

152152
/* gsize is total number of elements in the global array */
153153
gsize = dims[0];

utils/pnetcdf_blob_replay.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ int set_decomp(int ncid,
199199
/* number of dimensions, dimension IDs, and dimension sizes */
200200
err = ncmpi_inq_attlen(ncid, varid, "global_dimids", &tmp);
201201
CHECK_VAR_ERR(ncid, varid)
202-
dp->ndims = tmp;
202+
dp->ndims = (int)tmp;
203203
int dimids[3]; /* number of fix-sized dimensions is <= 3 */
204204
err = ncmpi_get_att(ncid, varid, "global_dimids", dimids);
205205
CHECK_VAR_ERR(ncid, varid)
@@ -349,7 +349,7 @@ int copy_dims(int in_ncid,
349349
err = ncmpi_inq_dim(in_ncid, i, name, dims+i);
350350
CHECK_NC_ERR
351351

352-
int name_len = strlen(name);
352+
size_t name_len = strlen(name);
353353
if (strcmp(name, "nblobs") == 0 ||
354354
(name[0] == 'D' && strcmp(name+name_len-7, ".nelems") == 0) ||
355355
(name[0] == 'D' && strcmp(name+name_len-10, ".max_nreqs") == 0))
@@ -453,7 +453,7 @@ int set_vars(int in_ncid,
453453

454454
#ifndef NUM_DECOMP_AUX_VARS
455455
/* skip copying decomposition variables */
456-
int name_len = strlen(name);
456+
size_t name_len = strlen(name);
457457
if ((name[0] == 'D' && name_len > 6 && strcmp(name+name_len-6, ".nreqs" ) == 0) ||
458458
(name[0] == 'D' && name_len > 11 && strcmp(name+name_len-11,".blob_start") == 0) ||
459459
(name[0] == 'D' && name_len > 11 && strcmp(name+name_len-11,".blob_count") == 0) ||
@@ -491,7 +491,7 @@ int set_vars(int in_ncid,
491491
}
492492
else if (err == NC_NOERR) {
493493
/* define variable using the global dimensions */
494-
var[i].ndims = tmp;
494+
var[i].ndims = (int)tmp;
495495
err = ncmpi_get_att_int(in_ncid, i, "global_dimids", dimids);
496496
CHECK_VAR_ERR(in_ncid, i)
497497
err = ncmpi_def_var(out_ncid, name, xtype, var[i].ndims, dimids,

0 commit comments

Comments
 (0)