Commit 4513e539 authored by Rob Latham's avatar Rob Latham Committed by Kenneth Raffenetti
Browse files

clean up 64-to-32 bit casts

many many places where a 64 bit value is stored in a 32 bit value
Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <>
parent 67b0e1e8
......@@ -26,8 +26,8 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
ADIO_Offset n_etypes_in_filetype, n_filetypes, etype_in_filetype;
ADIO_Offset abs_off_in_filetype=0;
ADIO_Offset size_in_filetype, sum;
MPI_Count filetype_size;
int etype_size, filetype_is_contig;
MPI_Count filetype_size, etype_size;
int filetype_is_contig;
MPI_Aint filetype_extent;
......@@ -35,7 +35,7 @@ ADIO_Offset ADIOI_GEN_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
etype_size = fd->etype_size;
if (filetype_is_contig) off = fd->disp + (ADIO_Offset)etype_size * offset;
if (filetype_is_contig) off = fd->disp + etype_size * offset;
else {
flat_file = ADIOI_Flatlist;
while (flat_file->type != fd->filetype) flat_file = flat_file->next;
......@@ -25,8 +25,12 @@ static int type_create_contiguous_x(MPI_Count count,
int blocklens[2];
MPI_Datatype types[2];
MPI_Count c = count/INT_MAX;
MPI_Count r = count%INT_MAX;
/* truly stupendously large counts will overflow an integer with this math,
* but that is a problem for a few decades from now. Sorry, few decades
* from now! */
ADIOI_Assert(count/INT_MAX == (int)(count/INT_MAX));
int c = (int)(count/INT_MAX); /* OK to cast until 'count' is 256 bits */
int r = count%INT_MAX;
MPI_Type_vector(c, INT_MAX, INT_MAX, oldtype, &chunks);
MPI_Type_contiguous(r, oldtype, &remainder);
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