diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-02-23 19:08:09 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-02-23 19:08:09 (GMT) |
commit | 0b4463911f951713d00b9c82f98773f147b6c73b (patch) | |
tree | c764d5d707278c88c709488aeb9046abafee69b4 /tools/lib | |
parent | 9974e02bc07585de4fdfc1f0b2803a7370e37b4e (diff) | |
download | hdf5-0b4463911f951713d00b9c82f98773f147b6c73b.zip hdf5-0b4463911f951713d00b9c82f98773f147b6c73b.tar.gz hdf5-0b4463911f951713d00b9c82f98773f147b6c73b.tar.bz2 |
[svn-r21974] Update HSIZE_T print statements to use correct macro.
Fix some more HD prefix issues in tools.
Tested: local linux
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5diff.c | 14 | ||||
-rw-r--r-- | tools/lib/h5diff_array.c | 64 | ||||
-rw-r--r-- | tools/lib/h5diff_dset.c | 42 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 10 | ||||
-rw-r--r-- | tools/lib/h5tools_dump.c | 92 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 14 | ||||
-rw-r--r-- | tools/lib/h5trav.c | 6 |
7 files changed, 121 insertions, 121 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index be20ed4..4ffee2b 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -154,7 +154,7 @@ void print_manager_output(void) } fflush(stdout); - memset(outBuff, 0, OUTBUFF_SIZE); + HDmemset(outBuff, 0, OUTBUFF_SIZE); outBuffOffset = 0; } else if( (outBuffOffset>0) && !g_Parallel) @@ -189,7 +189,7 @@ static void print_incoming_data(void) MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &incomingMessage, &Status); if(incomingMessage) { - memset(data, 0, PRINT_DATA_MAX_SIZE+1); + HDmemset(data, 0, PRINT_DATA_MAX_SIZE+1); MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &Status); printf("%s", data); @@ -531,7 +531,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, const char *ext_path; /* init linkinfo struct */ - memset(&lnk_info, 0, sizeof(h5tool_link_info_t)); + HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t)); if (!opts->follow_links) { @@ -1474,7 +1474,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end if */ h5diffdebug("done with if block\n"); - free(workerTasks); + HDfree(workerTasks); } #endif /* H5_HAVE_PARALLEL */ @@ -1938,7 +1938,7 @@ hsize_t diff(hid_t file1_id, *---------------------------------------------------------------------- */ case H5TRAV_TYPE_DATASET: - /* verbose (-v) and report (-r) mode */ + /* verbose (-v) and report (-r) mode */ if(options->m_verbose || options->m_report) { do_print_objname("dataset", path1, path2, options); @@ -1950,7 +1950,7 @@ hsize_t diff(hid_t file1_id, { nfound = diff_dataset(file1_id, file2_id, path1, path2, options); } - /* the rest (-c, none, ...) */ + /* the rest (-c, none, ...) */ else { nfound = diff_dataset(file1_id, file2_id, path1, path2, options); @@ -1958,7 +1958,7 @@ hsize_t diff(hid_t file1_id, if (nfound) { do_print_objname("dataset", path1, path2, options); - print_found(nfound); + print_found(nfound); } } break; diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 91b94b8..6437809 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -137,7 +137,7 @@ static int not_comparable; is_zero=1; \ } -# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b)) +# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b)) /*------------------------------------------------------------------------- * local prototypes @@ -260,7 +260,7 @@ hsize_t diff_array( void *_mem1, switch (type_class) { default: - assert(0); + HDassert(0); break; /*------------------------------------------------------------------------- @@ -440,10 +440,10 @@ hsize_t diff_datum(void *_mem1, switch (H5Tget_class(m_type)) { default: - assert(0); + HDassert(0); break; case H5T_TIME: - assert(0); + HDassert(0); break; /*------------------------------------------------------------------------- @@ -705,7 +705,7 @@ hsize_t diff_datum(void *_mem1, size = H5Tget_size(memb_type); ndims = H5Tget_array_ndims(m_type); H5Tget_array_dims2(m_type, adims); - assert(ndims >= 1 && ndims <= H5S_MAX_RANK); + HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* calculate the number of array elements */ for (u = 0, nelmts = 1; u <ndims; u++) @@ -897,7 +897,7 @@ hsize_t diff_datum(void *_mem1, { char temp1_char; char temp2_char; - assert(type_size==sizeof(char)); + HDassert(type_size==sizeof(char)); memcpy(&temp1_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ @@ -993,7 +993,7 @@ hsize_t diff_datum(void *_mem1, { unsigned char temp1_uchar; unsigned char temp2_uchar; - assert(type_size==sizeof(unsigned char)); + HDassert(type_size==sizeof(unsigned char)); memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -1092,7 +1092,7 @@ hsize_t diff_datum(void *_mem1, { short temp1_short; short temp2_short; - assert(type_size==sizeof(short)); + HDassert(type_size==sizeof(short)); memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); @@ -1191,7 +1191,7 @@ hsize_t diff_datum(void *_mem1, { unsigned short temp1_ushort; unsigned short temp2_ushort; - assert(type_size==sizeof(short)); + HDassert(type_size==sizeof(short)); memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); @@ -1291,7 +1291,7 @@ hsize_t diff_datum(void *_mem1, { int temp1_int; int temp2_int; - assert(type_size==sizeof(int)); + HDassert(type_size==sizeof(int)); memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); @@ -1389,7 +1389,7 @@ hsize_t diff_datum(void *_mem1, { unsigned int temp1_uint; unsigned int temp2_uint; - assert(type_size==sizeof(int)); + HDassert(type_size==sizeof(int)); memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); @@ -1487,7 +1487,7 @@ hsize_t diff_datum(void *_mem1, { long temp1_long; long temp2_long; - assert(type_size==sizeof(long)); + HDassert(type_size==sizeof(long)); memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); @@ -1587,7 +1587,7 @@ hsize_t diff_datum(void *_mem1, { unsigned long temp1_ulong; unsigned long temp2_ulong; - assert(type_size==sizeof(unsigned long)); + HDassert(type_size==sizeof(unsigned long)); memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); @@ -1686,7 +1686,7 @@ hsize_t diff_datum(void *_mem1, { long long temp1_llong; long long temp2_llong; - assert(type_size==sizeof(long long)); + HDassert(type_size==sizeof(long long)); memcpy(&temp1_llong, mem1, sizeof(long long)); memcpy(&temp2_llong, mem2, sizeof(long long)); @@ -1784,7 +1784,7 @@ hsize_t diff_datum(void *_mem1, { unsigned long long temp1_ullong; unsigned long long temp2_ullong; - assert(type_size==sizeof(unsigned long long)); + HDassert(type_size==sizeof(unsigned long long)); memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); @@ -1904,7 +1904,7 @@ hsize_t diff_datum(void *_mem1, int isnan1=0; int isnan2=0; - assert(type_size==sizeof(float)); + HDassert(type_size==sizeof(float)); memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); @@ -2117,7 +2117,7 @@ hsize_t diff_datum(void *_mem1, int isnan1=0; int isnan2=0; - assert(type_size==sizeof(double)); + HDassert(type_size==sizeof(double)); memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); @@ -2332,7 +2332,7 @@ hsize_t diff_datum(void *_mem1, int isnan2=0; - assert(type_size==sizeof(long double)); + HDassert(type_size==sizeof(long double)); memcpy(&temp1_double, mem1, sizeof(long double)); memcpy(&temp2_double, mem2, sizeof(long double)); @@ -2668,13 +2668,13 @@ hsize_t diff_region(hid_t obj1_id, */ if(nblocks1 > 0) { alloc_size = nblocks1 * ndims1 * 2 * sizeof(ptdata1[0]); - assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata1 = malloc((size_t)alloc_size); + ptdata1 = HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1); - ptdata2 = malloc((size_t)alloc_size); + ptdata2 = HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2); @@ -2723,13 +2723,13 @@ hsize_t diff_region(hid_t obj1_id, */ if(npoints1 > 0) { alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]); - assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata1 = malloc((size_t)alloc_size); + ptdata1 = HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1); - ptdata2 = malloc((size_t)alloc_size); + ptdata2 = HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2); @@ -5591,7 +5591,7 @@ int ull2float(unsigned long long ull_value, float *f_value) memcpy(f_value, buf, dst_size); if(buf) - free(buf); + HDfree(buf); return 0; @@ -5600,7 +5600,7 @@ error: H5Pclose(dxpl_id); } H5E_END_TRY; if(buf) - free(buf); + HDfree(buf); return -1; } @@ -5774,13 +5774,13 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) /*------------------------------------------------------------------------- - * Function: my_isnan + * Function: my_isnan * - * Purpose: Determines whether VAL points to NaN. + * Purpose: Determines whether VAL points to NaN. * - * Return: TRUE or FALSE + * Return: TRUE or FALSE * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 6, 1998 * * Modifications: @@ -5995,7 +5995,7 @@ void print_pos( int *ph, /* print header */ pos[i] = curr_pos/acc[i]; curr_pos -= acc[i]*pos[i]; } - assert( curr_pos == 0 ); + HDassert( curr_pos == 0 ); if ( rank > 0 ) { @@ -6048,7 +6048,7 @@ void print_char_pos( int *ph, /* print header */ pos[i] = curr_pos/acc[i]; curr_pos -= acc[i]*pos[i]; } - assert( curr_pos == 0 ); + HDassert( curr_pos == 0 ); parallel_print("[ " ); if ( rank > 0 ) diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 03ec067..bfb8429 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -409,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 */ @@ -445,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 */ @@ -529,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 */ @@ -565,7 +565,7 @@ error: /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); - free(buf1); + HDfree(buf1); buf1=NULL; } if (buf2!=NULL) @@ -573,7 +573,7 @@ error: /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); - free(buf2); + HDfree(buf2); buf2=NULL; } if (sm_buf1!=NULL) @@ -581,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) @@ -589,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; } @@ -695,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: @@ -784,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) diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index d3d386d..ef32cde 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1027,7 +1027,7 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) { int i; - assert(ctx->ndims); + HDassert(ctx->ndims); ctx->acc[ctx->ndims - 1] = 1; for (i = (ctx->ndims - 2); i >= 0; i--) { @@ -1362,7 +1362,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) size = H5Tget_size(memb); ndims = H5Tget_array_ndims(tid); H5Tget_array_dims2(tid, dims); - assert(ndims >= 1 && ndims <= H5S_MAX_RANK); + HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* calculate the number of array elements */ for (k = 0, nelmts = 1; k < ndims; k++) { @@ -1581,7 +1581,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); @@ -1708,7 +1708,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); alloc_size = npoints * ndims * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size))) HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); @@ -1726,7 +1726,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, stream, container, ndims, type_id, npoints, ptdata); done: - free(ptdata); + HDfree(ptdata); if(H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 06e3b2e..98945aa 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -448,10 +448,10 @@ h5tools_print_region_data_blocks(hid_t region_id, h5tools_context_t ctx; void *region_buf = NULL; - assert(info); - assert(cur_ctx); - assert(buffer); - assert(ptdata); + HDassert(info); + HDassert(cur_ctx); + HDassert(buffer); + HDassert(ptdata); HDmemset(&ctx, 0, sizeof(ctx)); /* Get the dataspace of the dataset */ @@ -608,9 +608,9 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, hid_t type_id = -1; int i; - assert(info); - assert(ctx); - assert(buffer); + HDassert(info); + HDassert(ctx); + HDassert(buffer); if((nblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed"); @@ -634,7 +634,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, h5tools_str_append(buffer, "REGION_TYPE BLOCK "); alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); @@ -650,12 +650,12 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, /* Start coordinates and opposite corner */ for (j = 0; j < ndims; j++) - h5tools_str_append(buffer, "%s%lu", j ? "," : "(", - (unsigned long) ptdata[i * 2 * ndims + j]); + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : "(", + ptdata[i * 2 * ndims + j]); for (j = 0; j < ndims; j++) - h5tools_str_append(buffer, "%s%lu", j ? "," : ")-(", - (unsigned long) ptdata[i * 2 * ndims + j + ndims]); + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : ")-(", + ptdata[i * 2 * ndims + j + ndims]); h5tools_str_append(buffer, ")"); } /* end for (i = 0; i < nblocks; i++) */ @@ -799,10 +799,10 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, void *region_buf = NULL; h5tools_context_t ctx; - assert(info); - assert(cur_ctx); - assert(buffer); - assert(ptdata); + HDassert(info); + HDassert(cur_ctx); + HDassert(buffer); + HDassert(ptdata); HDmemset(&ctx, 0, sizeof(ctx)); /* Allocate space for the dimension array */ @@ -929,9 +929,9 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, hid_t dtype; hid_t type_id; - assert(info); - assert(ctx); - assert(buffer); + HDassert(info); + HDassert(ctx); + HDassert(buffer); if((npoints = H5Sget_select_elem_npoints(region_space)) <= 0) H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed"); @@ -955,7 +955,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, h5tools_str_append(buffer, "REGION_TYPE POINT "); alloc_size = npoints * ndims * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size))) HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); @@ -970,8 +970,8 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, indx ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long) indx); for (loop_indx = 0; loop_indx < ndims; loop_indx++) - h5tools_str_append(buffer, "%s%lu", loop_indx ? "," : "(", - (unsigned long) (ptdata[indx * ndims + loop_indx])); + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, loop_indx ? "," : "(", + ptdata[indx * ndims + loop_indx]); h5tools_str_append(buffer, ")"); } /* end for (indx = 0; indx < npoints; indx++) */ @@ -1196,10 +1196,10 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c size = 1; sm_size[i - 1] = MIN(total_size[i - 1], size); sm_nbytes *= sm_size[i - 1]; - assert(sm_nbytes > 0); + HDassert(sm_nbytes > 0); } - assert(sm_nbytes == (hsize_t) ((size_t) sm_nbytes)); /*check for overflow*/ + HDassert(sm_nbytes == (hsize_t) ((size_t) sm_nbytes)); /*check for overflow*/ if(NULL == (sm_buf = (unsigned char *)HDmalloc((size_t) sm_nelmts * p_type_nbytes))) H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for strip-mine"); @@ -1582,14 +1582,14 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont size = 1; sm_size[i - 1] = MIN(total_size[i - 1], size); sm_nbytes *= sm_size[i - 1]; - assert(sm_nbytes > 0); + HDassert(sm_nbytes > 0); } } if(!sm_nbytes) goto done; - assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ + HDassert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes); sm_nelmts = sm_nbytes / p_type_nbytes; @@ -1700,7 +1700,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte if (nelmts == 0) return SUCCEED; /*nothing to print*/ if (ctx->ndims > 0) { - assert(ctx->p_max_idx[ctx->ndims - 1] == (hsize_t) ((int) ctx->p_max_idx[ctx->ndims - 1])); + HDassert(ctx->p_max_idx[ctx->ndims - 1] == (hsize_t) ((int) ctx->p_max_idx[ctx->ndims - 1])); ctx->size_last_dim = (int) (ctx->p_max_idx[ctx->ndims - 1]); } /* end if */ else @@ -2390,7 +2390,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ if(H5Tget_array_dims2(type, dims) >= 0) { /* Print array dimensions */ for (i = 0; i < ndims; i++) - h5tools_str_append(buffer, "[%d]", (int) dims[i]); + h5tools_str_append(buffer, "[" HSIZE_T_FORMAT "]", dims[i]); h5tools_str_append(buffer, " "); } @@ -2461,12 +2461,12 @@ h5tools_print_dataspace(FILE *stream, h5tools_str_t *buffer, const h5tool_format case H5S_SIMPLE: /* simple dataspace */ - h5tools_str_append(buffer, "%s %s { %s %" H5_PRINTF_LL_WIDTH "u", + h5tools_str_append(buffer, "%s %s { %s " HSIZE_T_FORMAT, h5tools_dump_header_format->dataspacedescriptionbegin, S_SIMPLE, h5tools_dump_header_format->dataspacedimbegin, size[0]); for(i = 1; i < ndims; i++) - h5tools_str_append(buffer, ", %" H5_PRINTF_LL_WIDTH "u", size[i]); + h5tools_str_append(buffer, ", " HSIZE_T_FORMAT, size[i]); h5tools_str_append(buffer, " %s / ", h5tools_dump_header_format->dataspacedimend); @@ -2474,14 +2474,14 @@ h5tools_print_dataspace(FILE *stream, h5tools_str_t *buffer, const h5tool_format h5tools_str_append(buffer, "%s %s", h5tools_dump_header_format->dataspacedimbegin, "H5S_UNLIMITED"); else - h5tools_str_append(buffer, "%s %" H5_PRINTF_LL_WIDTH "u", + h5tools_str_append(buffer, "%s " HSIZE_T_FORMAT, h5tools_dump_header_format->dataspacedimbegin, maxsize[0]); for(i = 1; i < ndims; i++) if(maxsize[i] == H5S_UNLIMITED) h5tools_str_append(buffer, ", %s", "H5S_UNLIMITED"); else - h5tools_str_append(buffer, ", %" H5_PRINTF_LL_WIDTH "u", maxsize[i]); + h5tools_str_append(buffer, ", " HSIZE_T_FORMAT, maxsize[i]); h5tools_str_append(buffer, " %s }", h5tools_dump_header_format->dataspacedimend); break; @@ -2539,7 +2539,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i if((snmembs = H5Tget_nmembers(type)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); nmembs = (unsigned)snmembs; - assert(nmembs > 0); + HDassert(nmembs > 0); if((super = H5Tget_super(type)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed"); @@ -2611,7 +2611,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" *strangely, unless use another pointer "copy".*/ copy = value + i * dst_size; - h5tools_str_append(buffer, "%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) ((void *) copy))); + h5tools_str_append(buffer, HSIZE_T_FORMAT, *((unsigned long long *) ((void *) copy))); } else { /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" @@ -2890,9 +2890,9 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_str_append(&buffer, "%s ", CHUNKED); rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize); - h5tools_str_append(&buffer, "%s %" H5_PRINTF_LL_WIDTH "u", h5tools_dump_header_format->dataspacedimbegin, chsize[0]); + h5tools_str_append(&buffer, "%s " HSIZE_T_FORMAT, h5tools_dump_header_format->dataspacedimbegin, chsize[0]); for(i = 1; i < rank; i++) - h5tools_str_append(&buffer, ", %" H5_PRINTF_LL_WIDTH "u", chsize[i]); + h5tools_str_append(&buffer, ", " HSIZE_T_FORMAT, chsize[i]); h5tools_str_append(&buffer, " %s", h5tools_dump_header_format->dataspacedimend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); @@ -2942,18 +2942,18 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if(storage_size != 0) ratio = (double) uncomp_size / (double) storage_size; - h5tools_str_append(&buffer, "SIZE %" H5_PRINTF_LL_WIDTH "u (%.3f:1 COMPRESSION)", storage_size, ratio); + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT" (%.3f:1 COMPRESSION)", storage_size, ratio); } else - h5tools_str_append(&buffer, "SIZE %" H5_PRINTF_LL_WIDTH "u", storage_size); + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); H5Sclose(sid); H5Tclose(tid); } else { - h5tools_str_append(&buffer, "SIZE %" H5_PRINTF_LL_WIDTH "u", storage_size); + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); } h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); @@ -2980,7 +2980,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "SIZE %" H5_PRINTF_LL_WIDTH "u", storage_size); + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); ctx->indent_level--; @@ -3026,7 +3026,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "FILENAME %s SIZE %" H5_PRINTF_LL_WIDTH "u", name, size); + h5tools_str_append(&buffer, "FILENAME %s SIZE " HSIZE_T_FORMAT, name, size); h5tools_str_append(&buffer, " OFFSET %ld", offset); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); } @@ -3062,7 +3062,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); - h5tools_str_append(&buffer,"SIZE %" H5_PRINTF_LL_WIDTH "u", storage_size); + h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); ctx->need_prefix = TRUE; @@ -3289,7 +3289,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_str_append(&buffer, "%s", "H5D_FILL_TIME_IFSET"); break; default: - assert(0); + HDassert(0); break; } h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); @@ -3346,7 +3346,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_str_append(&buffer, "%s", "H5D_ALLOC_TIME_LATE"); break; default: - assert(0); + HDassert(0); break; } h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); @@ -3823,11 +3823,11 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, nelmts *= size[i]; alloc_size = nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); - assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ if(alloc_size) { buf = HDmalloc((size_t)alloc_size); - assert(buf); + HDassert(buf); if (H5Aread(obj_id, p_type, buf) >= 0) if (display_char && H5Tget_size(type) == 1 && H5Tget_class(type) == H5T_INTEGER) { diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index e5e0d64..c3fbb1b 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -334,7 +334,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, ctx->pos[i] = curr_pos / ctx->acc[i]; curr_pos -= ctx->acc[i] * ctx->pos[i]; } - assert(curr_pos == 0); + HDassert(curr_pos == 0); /* Print the index values */ for (i = 0; i < (size_t) ndims; i++) { @@ -462,12 +462,12 @@ h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region, /* Start coordinates and opposite corner */ for (j = 0; j < ndims; j++) - h5tools_str_append(str, "%s%lu", j ? "," : "(", - (unsigned long) ptdata[i * 2 * ndims + j]); + h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", + ptdata[i * 2 * ndims + j]); for (j = 0; j < ndims; j++) - h5tools_str_append(str, "%s%lu", j ? "," : ")-(", - (unsigned long) ptdata[i * 2 * ndims + j + ndims]); + h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : ")-(", + ptdata[i * 2 * ndims + j + ndims]); h5tools_str_append(str, ")"); } @@ -522,8 +522,8 @@ h5tools_str_dump_region_points(h5tools_str_t *str, hid_t region, (unsigned long)i); for (j = 0; j < ndims; j++) - h5tools_str_append(str, "%s%lu", j ? "," : "(", - (unsigned long) (ptdata[i * ndims + j])); + h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", + (ptdata[i * ndims + j])); h5tools_str_append(str, ")"); } diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index c3cfddf..3bb8b3f 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -900,7 +900,7 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); printf(" %-10s %s -> %s\n", "link", path, targbuf); - free(targbuf); + HDfree(targbuf); } /* end if */ else printf(" %-10s %s ->\n", "link", path); @@ -913,12 +913,12 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) const char *objname; targbuf = HDmalloc(linfo->u.val_size + 1); - assert(targbuf); + HDassert(targbuf); H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname); printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); - free(targbuf); + HDfree(targbuf); } /* end if */ else printf(" %-10s %s ->\n", "ext link", path); |