summaryrefslogtreecommitdiffstats
path: root/src/H5Dcontig.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-05-07 20:52:36 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-05-07 20:52:36 (GMT)
commitdb543f1a23194e81d0a984c346398e72bf4be87f (patch)
tree87ca6828a7687d0a5a88534f80d77e2ecc91c04b /src/H5Dcontig.c
parent36a0b8e3dd1c325c201c4cd5a094df8a3588fa9a (diff)
downloadhdf5-db543f1a23194e81d0a984c346398e72bf4be87f.zip
hdf5-db543f1a23194e81d0a984c346398e72bf4be87f.tar.gz
hdf5-db543f1a23194e81d0a984c346398e72bf4be87f.tar.bz2
[svn-r6823] Purpose:
Code Improvements/Bug Fixes Description: Comparison of equality of a double/float variable to 0.0 is not guaranteed to work and is bad practice. In H5Fcontig.c, a warning was given by a statement like: x = (++x) % y; This could be confusing to a compiler I suppose. In H5RS.c, a typedef of a structure was being tagged by the compiler as "useless" because it had the form: typedef struct foo { int var1; /* ... */ }; /* <--- note no name for this typedef */ The statement "typedef struct foo foo" is already in the header file. Solution: Test that the absolute value of the variable is < a very small positive number. Changed "x = (++x) % y" to "++x; x %= y;" instead. Removed the "typedef" from the structure in the H5RS.c file. Platforms tested: Modi4 (Parallel & Fortran) Verbena (C++ & Fortran) Arabica (Fortran) Misc. update:
Diffstat (limited to 'src/H5Dcontig.c')
-rw-r--r--src/H5Dcontig.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index a9fe574..2593d83 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -222,7 +222,8 @@ H5F_contig_fill(H5F_t *f, hid_t dxpl_id, struct H5O_layout_t *layout,
elmt_size, size, addr, buf)<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset");
} /* end if */
- mpi_round=(++mpi_round)%mpi_size;
+ ++mpi_round;
+ mpi_round %= mpi_size;
/* Indicate that blocks are being written */
blocks_written=1;