diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 15:10:17 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 15:10:17 (GMT) |
commit | eb89d7b53ab95623ab454186a602e1cafc7391f0 (patch) | |
tree | ceafe458b3011e38853e765352d3c7e59bbecce1 /tools/lib/h5diff_dset.c | |
parent | 3e468e6ff65d540a439e99ea568a6bff7add7cea (diff) | |
download | hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.zip hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.gz hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.bz2 |
[svn-r22105] Description:
Bring r20557:22085 from trunk to this branch, also fixing some other
issues/failures in the branch simultaneously. The h5repack tests are still
failing, but Neil will be checking into those, so the branch can be fully
functional again.
Tested on:
Mac OSX/64 10.7.3 (amazon) w/debug
Diffstat (limited to 'tools/lib/h5diff_dset.c')
-rw-r--r-- | tools/lib/h5diff_dset.c | 85 |
1 files changed, 43 insertions, 42 deletions
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 230e7bb..c1ed429 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -313,36 +313,38 @@ hsize_t diff_datasetid( hid_t did1, * check for different signed/unsigned types *------------------------------------------------------------------------- */ - - sign1=H5Tget_sign(m_tid1); - sign2=H5Tget_sign(m_tid2); - if ( sign1 != sign2 ) + if (can_compare) { - if ((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + sign1=H5Tget_sign(m_tid1); + sign2=H5Tget_sign(m_tid2); + if ( sign1 != sign2 ) { - parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); - parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); + if ((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + { + parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); + parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); + } + + can_compare=0; + options->not_cmp=1; } - - can_compare=0; - options->not_cmp=1; } - + /* Check if type is either VLEN-data or VLEN-string to reclaim any * VLEN memory buffer later */ if( TRUE == h5tools_detect_vlen(m_tid1) ) vl_data = TRUE; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------ * only attempt to compare if possible *------------------------------------------------------------------------- */ if(can_compare) /* it is possible to compare */ { - /*------------------------------------------------------------------------- + /*----------------------------------------------------------------- * get number of elements - *------------------------------------------------------------------------- + *------------------------------------------------------------------ */ nelmts1 = 1; for(i = 0; i < rank1; i++) @@ -354,9 +356,9 @@ hsize_t diff_datasetid( hid_t did1, HDassert(nelmts1 == nelmts2); - /*------------------------------------------------------------------------- + /*----------------------------------------------------------------- * "upgrade" the smaller memory size - *------------------------------------------------------------------------- + *------------------------------------------------------------------ */ if(m_size1 != m_size2) { @@ -386,11 +388,10 @@ hsize_t diff_datasetid( hid_t did1, name2 = diff_basename(obj2_name); - /*------------------------------------------------------------------------- + /*---------------------------------------------------------------- * read/compare - *------------------------------------------------------------------------- + *----------------------------------------------------------------- */ - need = (size_t)(nelmts1 * m_size1); /* bytes needed */ if(need < H5TOOLS_MALLOCSIZE) { buf1 = HDmalloc(need); @@ -408,7 +409,7 @@ hsize_t diff_datasetid( hid_t did1, options, name1, name2, m_tid1, did1, did2); /* reclaim any VL memory, if necessary */ - if(vl_data) { + if(vl_data) { H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); } /* end if */ @@ -444,27 +445,27 @@ hsize_t diff_datasetid( hid_t did1, size = 1; sm_size[i - 1] = MIN(dims1[i - 1], size); sm_nbytes *= sm_size[i - 1]; - assert(sm_nbytes > 0); + HDassert(sm_nbytes > 0); } /* end for */ - /* malloc return code should be verified. + /* malloc return code should be verified. * If fail, need to handle the error. * This else branch should be recoded as a separate function. * Note that there are many "goto error" within this branch * that fails to address freeing other objects created here. - * E.g., sm_space. - */ - sm_buf1 = malloc((size_t)sm_nbytes); - assert(sm_buf1); - sm_buf2 = malloc((size_t)sm_nbytes); - assert(sm_buf2); + * E.g., sm_space. + */ + sm_buf1 = HDmalloc((size_t)sm_nbytes); + HDassert(sm_buf1); + sm_buf2 = HDmalloc((size_t)sm_nbytes); + HDassert(sm_buf2); sm_nelmts = sm_nbytes / p_type_nbytes; sm_space = H5Screate_simple(1, &sm_nelmts, NULL); /* the stripmine loop */ - memset(hs_offset, 0, sizeof hs_offset); - memset(zero, 0, sizeof zero); + HDmemset(hs_offset, 0, sizeof hs_offset); + HDmemset(zero, 0, sizeof zero); for(elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { /* calculate the hyperslab size */ @@ -528,19 +529,19 @@ hsize_t diff_datasetid( hid_t did1, /* free */ if(buf1 != NULL) { - free(buf1); + HDfree(buf1); buf1 = NULL; } /* end if */ if(buf2 != NULL) { - free(buf2); + HDfree(buf2); buf2 = NULL; } /* end if */ if(sm_buf1 != NULL) { - free(sm_buf1); + HDfree(sm_buf1); sm_buf1 = NULL; } /* end if */ if(sm_buf2 != NULL) { - free(sm_buf2); + HDfree(sm_buf2); sm_buf2 = NULL; } /* end if */ @@ -562,17 +563,17 @@ error: if (buf1!=NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data) H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); - free(buf1); + HDfree(buf1); buf1=NULL; } if (buf2!=NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data) H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); - free(buf2); + HDfree(buf2); buf2=NULL; } if (sm_buf1!=NULL) @@ -580,7 +581,7 @@ error: /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); - free(sm_buf1); + HDfree(sm_buf1); sm_buf1=NULL; } if (sm_buf2!=NULL) @@ -588,7 +589,7 @@ error: /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2); - free(sm_buf2); + HDfree(sm_buf2); sm_buf2=NULL; } @@ -694,7 +695,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ *------------------------------------------------------------------------- */ - assert(tclass1==tclass2); + HDassert(tclass1==tclass2); switch (tclass1) { case H5T_INTEGER: @@ -783,7 +784,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ *------------------------------------------------------------------------- */ - assert(rank1==rank2); + HDassert(rank1==rank2); for ( i=0; i<rank1; i++) { if (maxdim1 && maxdim2) |