diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-10-18 20:03:47 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-10-18 20:03:47 (GMT) |
commit | 9729a518b49a2217307c3c7ce9b33b064fc83147 (patch) | |
tree | 28b22bf7d1972b4a537bcec377778147c976420c /tools/lib/h5diff_array.c | |
parent | 1bc858b1b889ae2d0eeca463646592d195db8c94 (diff) | |
download | hdf5-9729a518b49a2217307c3c7ce9b33b064fc83147.zip hdf5-9729a518b49a2217307c3c7ce9b33b064fc83147.tar.gz hdf5-9729a518b49a2217307c3c7ce9b33b064fc83147.tar.bz2 |
[svn-r24332] Bring revision #24330 from revise_chunks. h5committested.
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r-- | tools/lib/h5diff_array.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 96b508d..7dba0e5 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -109,7 +109,7 @@ static hbool_t not_comparable; if(0 == (A) && 0 == (B)) \ both_zero = TRUE; \ if(0 != (A)) \ - per = (double)ABS((double)(B - A) / (double)A); \ + per = (double)ABS((double)((B) - (A)) / (double)(A)); \ else \ not_comparable = TRUE; \ } @@ -119,16 +119,16 @@ static hbool_t not_comparable; per = -1; \ not_comparable = FALSE; \ both_zero = FALSE; \ - if(A == 0 && B == 0) \ + if((A) == 0 && (B) == 0) \ both_zero = TRUE; \ - if(A != 0) \ - per = ABS((double)((TYPE)(B - A)) / (double)A) ; \ + if((A) != 0) \ + per = ABS((double)((TYPE)((B) - (A))) / (double)(A)) ; \ else \ not_comparable = TRUE; \ } -# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b)) +#define PDIFF(a,b) (((b) > (a)) ? ((b) - (a)) : ((a) -(b))) typedef struct mcomp_t { @@ -890,9 +890,8 @@ static hsize_t diff_datum(void *_mem1, /* calculate the number of array elements */ for (u = 0, nelmts = 1; u < (unsigned)ndims; u++) nelmts *= adims[u]; - for (u = 0; u < nelmts; u++) - { - nfound+=diff_datum( + for (u = 0; u < nelmts; u++) { + nfound += diff_datum( mem1 + u * size, mem2 + u * size, /* offset */ memb_type, @@ -907,7 +906,7 @@ static hsize_t diff_datum(void *_mem1, container1_id, container2_id, ph, members); - } + } H5Tclose(memb_type); } break; |