summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5.c6
-rw-r--r--src/H5Dcontig.c3
-rw-r--r--src/H5Fcontig.c3
-rw-r--r--src/H5RS.c2
4 files changed, 9 insertions, 5 deletions
diff --git a/src/H5.c b/src/H5.c
index e40f7ca..e42f0da 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -1335,7 +1335,8 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds)
HDstrcpy(buf, " NaN");
} else {
bw = nbytes/nseconds;
- if (bw==0.0) {
+ if (fabs(bw) < 0.0000000001) {
+ /* That is == 0.0, but direct comparison between floats is bad */
HDstrcpy(buf, "0.000 B/s");
} else if (bw<1.0) {
sprintf(buf, "%10.4e", bw);
@@ -1450,7 +1451,8 @@ H5_trace (double *returning, const char *func, const char *type, ...)
}
/* Get tim for event */
- if (!first_time.etime)
+ if (fabs(first_time.etime) < 0.0000000001)
+ /* That is == 0.0, but direct comparison between floats is bad */
H5_timer_begin(&first_time);
if (H5_debug_g.ttimes) {
H5_timer_begin(&event_time);
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;
diff --git a/src/H5Fcontig.c b/src/H5Fcontig.c
index a9fe574..2593d83 100644
--- a/src/H5Fcontig.c
+++ b/src/H5Fcontig.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;
diff --git a/src/H5RS.c b/src/H5RS.c
index d710774..93ef3aa 100644
--- a/src/H5RS.c
+++ b/src/H5RS.c
@@ -31,7 +31,7 @@ static int interface_initialize_g = 0;
#define INTERFACE_INIT NULL
/* Private typedefs & structs */
-typedef struct H5RS_str_t {
+struct H5RS_str_t {
char *s; /* String to be reference counted */
unsigned wrapped; /* Indicates that the string to be ref-counted is not copied */
unsigned n; /* Reference count of number of pointers sharing string */