Commit d15c4289 authored by Rob Latham's avatar Rob Latham Committed by Pavan Balaji
Browse files

A round of 64-to-32 warning squashes



formatting fixes and type promotions to chip away at the 1500 lines of
warnings that pop up with clang's -Wshorten-64-to-32 flag.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@mcs.anl.gov>
parent 6f267e79
......@@ -28,8 +28,8 @@ ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
int i, n_etypes_in_filetype, n_filetypes, etype_in_filetype;
ADIO_Offset abs_off_in_filetype=0, sum;
int size_in_filetype;
int filetype_size, etype_size, filetype_is_contig;
MPI_Aint filetype_extent;
int filetype_size, filetype_is_contig;
MPI_Aint etype_size, filetype_extent;
*error_code = MPI_SUCCESS;
......
......@@ -134,7 +134,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type,
ADIOI_Flatlist_node *flat_mem_p = NULL, *flat_file_p = NULL;
int memtype_sz = -1;
int memtype_is_contig = -1;
int filetype_sz = -1;
ADIO_Offset filetype_sz = -1;
#ifdef AGGREGATION_PROFILE
MPE_Log_event (5014, 0, NULL);
......@@ -157,7 +157,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type,
}
MPI_Type_extent(fd->filetype, &filetype_extent);
MPI_Type_size(fd->filetype, &filetype_sz);
MPI_Type_size_x(fd->filetype, &filetype_sz);
if (filetype_extent == filetype_sz) {
flat_file_p = ADIOI_Add_contig_flattened(fd->filetype);
flat_file_p->blocklens[0] = memtype_sz*count;
......
......@@ -172,7 +172,7 @@ static void ADIO_FileSysType_parentdir(const char *filename, char **dirnamep)
* but this code doesn't care if the target is really there
* or not.
*/
int namelen;
ssize_t namelen;
char *linkbuf;
linkbuf = ADIOI_Malloc(PATH_MAX+1);
......
......@@ -18,7 +18,7 @@ void ADIOI_BG_Get_shared_fp(ADIO_File fd, int size, ADIO_Offset *shared_fp, int
shared_fp by the number of etypes to be accessed (incr) in the read
or write following this function. */
void ADIOI_NFS_Get_shared_fp(ADIO_File fd, int incr, ADIO_Offset *shared_fp,
void ADIOI_NFS_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp,
int *error_code);
void ADIO_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp,
......
......@@ -701,11 +701,11 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype,
ADIO_Offset *st_offset, ADIO_Offset *end_offset)
{
int filetype_size, buftype_size, etype_size;
int i, sum;
int sum;
MPI_Aint filetype_extent;
ADIO_Offset total_io;
int filetype_is_contig;
int remainder;
ADIO_Offset i, remainder;
ADIOI_Flatlist_node *flat_file;
ADIO_Offset st_byte_off, end_byte_off;
......
......@@ -219,7 +219,7 @@ int ADIOI_GEN_aio_poll_fn(void *extra_state, MPI_Status *status)
else if (errno == ECANCELED) {
/* TODO: unsure how to handle this */
} else if (errno == 0) {
int n = aio_return(aio_req->aiocbp);
ssize_t n = aio_return(aio_req->aiocbp);
aio_req->nbytes = n;
errcode = MPI_Grequest_complete(aio_req->req);
/* --BEGIN ERROR HANDLING-- */
......@@ -278,7 +278,7 @@ int ADIOI_GEN_aio_wait_fn(int count, void ** array_of_states,
continue;
errno = aio_error(aio_reqlist[i]->aiocbp);
if (errno == 0) {
int n = aio_return(aio_reqlist[i]->aiocbp);
ssize_t n = aio_return(aio_reqlist[i]->aiocbp);
aio_reqlist[i]->nbytes = n;
errcode = MPI_Grequest_complete(aio_reqlist[i]->req);
if (errcode != MPI_SUCCESS) {
......@@ -323,8 +323,7 @@ int ADIOI_GEN_aio_query_fn(void *extra_state, MPI_Status *status)
aio_req = (ADIOI_AIO_Request *)extra_state;
MPI_Status_set_elements(status, MPI_BYTE, aio_req->nbytes);
MPI_Status_set_elements_x(status, MPI_BYTE, aio_req->nbytes);
/* can never cancel so always true */
MPI_Status_set_cancelled(status, 0);
......
......@@ -22,7 +22,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count,
ADIO_Offset n_filetypes, etype_in_filetype;
ADIO_Offset abs_off_in_filetype=0;
unsigned bufsize, filetype_size, buftype_size, size_in_filetype;
int etype_size;
ADIO_Offset etype_size;
MPI_Aint filetype_extent, buftype_extent;
int buf_count, buftype_is_contig, filetype_is_contig;
ADIO_Offset userbuf_off;
......
......@@ -530,9 +530,10 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype
for (i=0; i<nprocs; i++) count[i] = recv_size[i] = 0;
for (m=ntimes; m<max_ntimes; m++) {
ADIOI_Assert(size == (int)size);
/* nothing to recv, but check for send. */
ADIOI_W_Exchange_data(fd, buf, write_buf, flat_buf, offset_list,
len_list, send_size, recv_size, off, size, count,
len_list, send_size, recv_size, off, (int)size, count,
start_pos, partial_recv,
sent_to_proc, nprocs, myrank,
buftype_is_contig, contig_access_count,
......@@ -659,7 +660,8 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf,
else { /* coalesce the sorted offset-length pairs */
for (i=1; i<sum; i++) {
if (srt_off[i] <= srt_off[0] + srt_len[0]) {
int new_len = srt_off[i] + srt_len[i] - srt_off[0];
/* ok to cast: operating on cb_buffer_size chunks */
int new_len = (int)srt_off[i] + srt_len[i] - (int)srt_off[0];
if (new_len > srt_len[0]) srt_len[0] = new_len;
}
else
......@@ -929,7 +931,8 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
ADIOI_Assert((curr_to_proc[p] + len - done_to_proc[p]) == (unsigned)(curr_to_proc[p] + len - done_to_proc[p]));
buf_incr = curr_to_proc[p] + len - done_to_proc[p];
ADIOI_Assert((done_to_proc[p] + size) == (unsigned)(done_to_proc[p] + size));
curr_to_proc[p] = done_to_proc[p] + size;
/* ok to cast: bounded by cb buffer size */
curr_to_proc[p] = done_to_proc[p] + (int)size;
ADIOI_BUF_COPY
}
else {
......
......@@ -31,8 +31,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count,
off_t err_lseek=-1;
ssize_t err=-1;
ADIO_Offset fwr_size=0, bwr_size, new_bwr_size, new_fwr_size, i_offset, num;
unsigned bufsize;
int n_etypes_in_filetype;
ADIO_Offset bufsize, n_etypes_in_filetype;
ADIO_Offset n_filetypes, etype_in_filetype, size, sum;
ADIO_Offset abs_off_in_filetype=0, size_in_filetype;
MPI_Count filetype_size, etype_size, buftype_size;
......
......@@ -119,9 +119,8 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
ADIOI_Flatlist_node *flat_buf, *flat_file;
ADIO_Offset i_offset, sum, size_in_filetype;
int i, j, k, st_index=0;
int n_etypes_in_filetype;
ADIO_Offset num, size, n_filetypes, etype_in_filetype, st_n_filetypes;
ADIO_Offset abs_off_in_filetype=0;
ADIO_Offset n_etypes_in_filetype, abs_off_in_filetype=0;
MPI_Count filetype_size, etype_size, buftype_size;
MPI_Aint filetype_extent, buftype_extent;
int buf_count, buftype_is_contig, filetype_is_contig;
......
......@@ -20,7 +20,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count,
ADIO_Offset bwr_size, fwr_size=0, sum, size_in_filetype;
int b_index;
unsigned bufsize;
int n_etypes_in_filetype;
ADIO_Offset n_etypes_in_filetype;
ADIO_Offset size, n_filetypes, etype_in_filetype;
ADIO_Offset abs_off_in_filetype=0, req_len;
MPI_Count filetype_size, etype_size, buftype_size;
......
......@@ -666,7 +666,7 @@ static int get_max_procs(int cb_nodes)
if (token != AGG_WILDCARD && token != AGG_STRING) return -1;
if (token == AGG_WILDCARD) max_procs = cb_nodes;
else if (token == AGG_STRING) {
max_procs = strtol(yylval, &errptr, 10);
max_procs = (int)strtol(yylval, &errptr, 10);
if (*errptr != '\0') {
/* some garbage value; default to 1 */
max_procs = 1;
......
......@@ -61,7 +61,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
flat->count = ADIOI_Count_contiguous_blocks(datatype, &curr_index);
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: count %#z, cur_idx = %#X\n",flat->count,curr_index);
DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: count %llX, cur_idx = %#llX\n",flat->count,curr_index);
#endif
/* DBG_FPRINTF(stderr, "%d\n", flat->count);*/
......@@ -107,13 +107,13 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
ADIO_Offset st_offset, MPI_Count *curr_index)
{
int i, j, k, m, n, num, basic_num, prev_index;
int i, k, m, n, basic_num;
int combiner, old_combiner, old_is_contig;
int nints, nadds, ntypes, old_nints, old_nadds, old_ntypes;
/* By using ADIO_Offset we preserve +/- sign and
avoid >2G integer arithmetic problems */
ADIO_Offset top_count;
MPI_Count old_size;
MPI_Count j, old_size, prev_index, num;
MPI_Aint old_extent;/* Assume extents are non-negative */
int *ints;
MPI_Aint *adds; /* Make no assumptions about +/- sign on these */
......@@ -125,7 +125,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
MPI_Type_get_contents(datatype, nints, nadds, ntypes, ints, adds, types);
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: st_offset %#llX, curr_index %#X\n",st_offset,*curr_index);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: st_offset %#llX, curr_index %#llX\n",st_offset,*curr_index);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: nints %#X, nadds %#X, ntypes %#X\n",nints, nadds, ntypes);
for(i=0; i< nints; ++i)
{
......@@ -194,12 +194,12 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
types[0],
&dtype);
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY <ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#X);\n",
DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY <ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#llX);\n",
0, flat->indices[0], 0, flat->blocklens[0], st_offset, *curr_index);
#endif
ADIOI_Flatten(dtype, flat, st_offset, curr_index);
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY >ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#X);\n",
DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY >ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#llX);\n",
0, flat->indices[0], 0, flat->blocklens[0], st_offset, *curr_index);
#endif
MPI_Type_free(&dtype);
......@@ -226,7 +226,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
MPI_Type_size_x(types[0], &old_size);
flat->blocklens[j] = top_count * old_size;
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
}
......@@ -242,7 +242,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->indices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent;
flat->blocklens[j] = flat->blocklens[j-num];
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: derived flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: derived flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]);
#endif
j++;
}
......@@ -615,7 +615,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
MPI_Type_size_x(types[n], &old_size);
flat->blocklens[j] = blocklength * old_size;
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",n,adds[n],j, flat->indices[j], j, flat->blocklens[j]);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",n,adds[n],j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
}
......@@ -632,7 +632,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->indices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent;
flat->blocklens[j] = flat->blocklens[j-num];
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple old_extent "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",old_extent,j, flat->indices[j], j, flat->blocklens[j]);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple old_extent "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",old_extent,j, flat->indices[j], j, flat->blocklens[j]);
#endif
j++;
}
......@@ -655,7 +655,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->blocklens[j] = 0;
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
......@@ -677,7 +677,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->blocklens[j] = old_size;
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
......@@ -689,7 +689,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->blocklens[j] = 0;
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",1,adds[1],j, flat->indices[j], j, flat->blocklens[j]);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",1,adds[1],j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
......@@ -717,7 +717,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
ADIOI_Free(types);
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: return st_offset %#llX, curr_index %#X\n",st_offset,*curr_index);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: return st_offset %#llX, curr_index %#llX\n",st_offset,*curr_index);
#endif
}
......@@ -740,8 +740,8 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i
*curr_index = blks;
return blks;
#else
int i, n, num, basic_num, prev_index;
MPI_Count count=0;
int i, n;
MPI_Count count=0, prev_index, num, basic_num;
int top_count, combiner, old_combiner, old_is_contig;
int nints, nadds, ntypes, old_nints, old_nadds, old_ntypes;
int *ints;
......
......@@ -16,8 +16,8 @@ void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset)
{
ADIOI_Flatlist_node *flat_file;
int i, flag;
MPI_Count filetype_size;
int etype_size, filetype_is_contig;
MPI_Count filetype_size, etype_size;
int filetype_is_contig;
MPI_Aint filetype_extent;
ADIO_Offset disp, byte_offset, sum=0, size_in_file, n_filetypes, frd_size;
......
......@@ -143,7 +143,8 @@ int ADIOI_Info_check_and_install_true(ADIO_File fd, MPI_Info info, const char *k
int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *key,
char **local_cache, char *funcname, int *error_code)
{
int flag, len;
int flag;
size_t len;
char *value;
value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
......
......@@ -26,7 +26,8 @@
void ADIOI_Shfp_fname(ADIO_File fd, int rank)
{
double tm;
int i, len;
int i;
int len;
char *slash, *ptr, tmp[128];
int pid = 0;
......@@ -60,7 +61,8 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank)
slash = strrchr(fd->shared_fp_fname, '/');
#endif
ADIOI_Strncpy(slash + 1, ".", 2);
len = 256 - (slash+2 - fd->shared_fp_fname);
/* ok to cast: file names bounded by PATH_MAX and NAME_MAX */
len = (int) (256 - (slash+2 - fd->shared_fp_fname));
ADIOI_Strncpy(slash + 2, ptr + 1, len);
}
......
......@@ -314,7 +314,8 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
" vector to vec: do=" MPI_AINT_FMT_DEC_SPEC
", dp=%p"
", len=" MPI_AINT_FMT_DEC_SPEC
", ind=%d, ct=" MPI_AINT_FMT_DEC_SPEC
", ind=" MPI_AINT_FMT_DEC_SPEC
", ct=" MPI_AINT_FMT_DEC_SPEC
", blksz=" MPI_AINT_FMT_DEC_SPEC
", str=" MPI_AINT_FMT_DEC_SPEC
", blks=" MPI_AINT_FMT_DEC_SPEC,
......
......@@ -237,7 +237,7 @@ static void genvlist_help_fn(void)
static HYD_status genvlist_fn(char *arg, char ***argv)
{
int len;
size_t len;
HYD_status status = HYD_SUCCESS;
if (reading_config_file && HYD_server_info.user_global.global_env.prop) {
......@@ -684,7 +684,7 @@ static void envlist_help_fn(void)
static HYD_status envlist_fn(char *arg, char ***argv)
{
int len;
size_t len;
struct HYD_exec *exec;
HYD_status status = HYD_SUCCESS;
......@@ -1632,7 +1632,8 @@ static HYD_status parse_args(char **t_argv)
HYD_status HYD_uii_mpx_get_parameters(char **t_argv)
{
int ret, len;
int ret;
size_t len;
char **argv = t_argv;
char *progname = *argv;
char *post, *loc, *tmp[HYD_NUM_TMP_STRINGS], *conf_file;
......
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