From d38fe20df6bdb30906b18cf01ee644c44ed5b944 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 11 May 2013 10:59:48 -0500 Subject: [svn-r23695] Description: Clean up warnings in H5Tconv.c (down to _only_ 9000 lines of output now!) Merge changes from Coverity branch back to trunk: r20684: Fix for coverity bug #1721 which was due to the fix for coverity bug #943. r20685: Use HDstrncpy. --gh r20761: Purpose: Fix valgrind issues Description: Free image_data and data as appropriate in test_image. r20762: Purpose: Fix coverity issue 600 Description: Add check for return value of H5O_close in H5Ocopy. Also cleaned up various warnings. r20763: Purpose: Fix valgrind issues with h5stat Description: Modified h5stat to free "iter" before exit, and free "hand" before exit if parse_command_line exits directly. r20764: fixed coverity issues: 69, 327, 614, 684, 685, 696, 697, 1681, 967, 826, 660, 80 r20765: Fixed coverity bug 668 Pulled x * y * z multiply out of malloc operand into a separate n_elements variable to quiet integer overflow warning. No actual integer overflow tests are performed since it's just a test program but I did add a check that n_elements is >= 1. I also changed an error condition from doing its own close and returning -1 to "goto out;" like the rest of the program. r20766: Fixed coverity bug 667 Pulled x * y * z multiply out of malloc operand into a separate n_elements variable to quiet integer overflow warning. No actual integer overflow tests are performed since it's just a test program. Tested on: Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN (h5committest upcoming) --- hl/test/test_image.c | 177 +++++++++----- src/H5Ocopy.c | 27 +-- src/H5R.c | 10 +- src/H5Tconv.c | 584 ++++++++++++++++++++++++++--------------------- src/H5Tvlen.c | 10 +- src/H5private.h | 6 +- test/H5srcdir.h | 11 +- test/h5test.c | 20 +- tools/h5jam/getub.c | 2 +- tools/h5stat/h5stat.c | 337 ++++++++++++++------------- tools/lib/h5diff_array.c | 6 +- tools/lib/h5tools.c | 16 +- tools/lib/h5tools_dump.c | 88 ++++--- 13 files changed, 731 insertions(+), 563 deletions(-) diff --git a/hl/test/test_image.c b/hl/test/test_image.c index a4a10e4..76acef8 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -100,24 +100,34 @@ static int test_simple(void) hssize_t npals; /* 8-bit image */ - unsigned char buf1 [ WIDTH*HEIGHT ]; + unsigned char *buf1 = NULL; unsigned char pal[ PAL_ENTRIES * 3 ]; /* palette array */ hsize_t pal_dims[2] = {PAL_ENTRIES,3}; /* palette dimensions */ /* 24-bit image */ - unsigned char buf2 [ WIDTH*HEIGHT*3 ]; + unsigned char *buf2 = NULL; /* read data */ - unsigned char buf1_out [ WIDTH*HEIGHT ]; - unsigned char buf2_out [ WIDTH*HEIGHT*3 ]; + unsigned char *buf1_out = NULL; + unsigned char *buf2_out = NULL; unsigned char pal_out[ PAL_ENTRIES * 3 ]; /* palette array */ hsize_t pal_dims_out[2]; /* palette dimensions */ + /* Allocate image buffers */ + buf1 = (unsigned char *)HDmalloc(WIDTH * HEIGHT); + HDassert(buf1); + buf2 = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3); + HDassert(buf2); + buf1_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT); + HDassert(buf1_out); + buf2_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3); + HDassert(buf2_out); + /* create an image */ space = WIDTH*HEIGHT / PAL_ENTRIES; for (i=0, j=0, n=0; i < WIDTH*HEIGHT; i++, j++ ) { - buf1[i] = n; + buf1[i] = (unsigned char)n; if ( j > space ) { n++; @@ -126,17 +136,13 @@ static int test_simple(void) } - /* create an image */ space = WIDTH*HEIGHT / 256; for (i=0, j=0, n=0; i < WIDTH*HEIGHT*3; i+=3, j++ ) { - unsigned char r, g, b; - - r = n; g = 0; b = 255-n; - buf2[i] = r; - buf2[i+1] = g; - buf2[i+2] = b; + buf2[i] = (unsigned char)n; + buf2[i+1] = 0; + buf2[i+2] = (unsigned char)(255 - n); if ( j > space ) { n++; @@ -150,9 +156,9 @@ static int test_simple(void) */ for ( i=0, n=0; i INT_MAX / jmax) + goto out; + if(imax * jmax > INT_MAX / kmax) + goto out; + + n_elements = imax * jmax * kmax; + + /* Test buffer sizes for overflow */ + if(n_elements > INT_MAX / (int)sizeof(unsigned char)) + goto out; + if(n_elements > INT_MAX / (int)sizeof(float)) + goto out; + + data = (float *)HDmalloc((size_t)n_elements * sizeof( float )); + HDassert(data); + image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof( unsigned char )); + HDassert(image_data); + + for ( i = 0; i < n_elements; i++ ) { fscanf( f, "%f ", &value ); data[i] = value; @@ -591,10 +633,8 @@ static int test_generate(void) TESTING2("make indexed image from all the data"); - for ( i = 0; i < imax * jmax * kmax; i++ ) - { + for ( i = 0; i < n_elements; i++ ) image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin )); - } /* Make the image */ if ((H5IMmake_image_8bit(fid,"All data",(hsize_t)imax,(hsize_t)jmax,image_data))<0) @@ -610,7 +650,7 @@ static int test_generate(void) TESTING2("make indexed image from land data"); - for ( i = 0; i < imax * jmax * kmax; i++ ) + for ( i = 0; i < n_elements; i++ ) { if ( data[i] < 0 ) image_data[i] = 0; @@ -632,7 +672,7 @@ static int test_generate(void) TESTING2("make indexed image from sea data"); - for ( i = 0; i < imax * jmax * kmax; i++ ) + for ( i = 0; i < n_elements; i++ ) { if ( data[i] > 0 ) image_data[i] = 0; @@ -675,12 +715,21 @@ static int test_generate(void) if (H5Fclose(fid)<0) goto out; + /* Release memory buffers */ + HDfree(data); + HDfree(image_data); + /* Indicate success */ return 0; /* error zone, gracefully close */ out: - HDfree(data); + /* Release memory buffers */ + if(data) + HDfree(data); + if(image_data) + HDfree(image_data); + H5E_BEGIN_TRY { H5Fclose(fid); } H5E_END_TRY; @@ -713,51 +762,71 @@ static int read_data( const char* fname, /*IN*/ int i, n; int color_planes; char str[20]; - FILE *f; + FILE *f = NULL; int w, h; + int n_elements; const char *data_file = H5_get_srcdir_filename(fname); + int ret_val = -1; /*------------------------------------------------------------------------- * read *------------------------------------------------------------------------- */ - f = HDfopen(data_file, "r"); - if ( f == NULL ) - { + if(NULL == (f = HDfopen(data_file, "r"))) { printf( "Could not open file %s. Try set $srcdir \n", data_file ); - return -1; + goto out; } - fscanf( f, "%s", str ); - fscanf( f, "%d", &color_planes ); - fscanf( f, "%s", str ); - fscanf( f, "%d", &h); - fscanf( f, "%s", str ); - fscanf( f, "%d", &w); + fscanf(f, "%s", str); + fscanf(f, "%d", &color_planes); + fscanf(f, "%s", str); + fscanf(f, "%d", &h); + fscanf(f, "%s", str); + fscanf(f, "%d", &w); *width = (hsize_t)w; *height = (hsize_t)h; - if ( image_data ) - { - HDfree( image_data ); - image_data=NULL; - } + /* Check product for overflow */ + if(w < 1 || h < 1 || color_planes < 1) + goto out; + if(w > INT_MAX / h) + goto out; + if(w * h > INT_MAX / color_planes) + goto out; - image_data = (unsigned char*) HDmalloc (w * h * color_planes * sizeof( unsigned char )); + /* Compute buffer size */ + n_elements = w * h * color_planes; - for (i = 0; i < h * w * color_planes ; i++) - { - fscanf( f, "%d",&n ); + /* Check buffer size for overflow */ + if(n_elements > INT_MAX / (int)sizeof(unsigned char)) + goto out; + + /* Release the buffer, if it was previously allocated */ + if(image_data) { + HDfree(image_data); + image_data = NULL; + } /* end if */ + + /* Allocate the image data buffer */ + image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char)); + + /* Read data elements */ + for(i = 0; i < n_elements; i++) { + fscanf(f, "%d",&n); image_data[i] = (unsigned char)n; - } - HDfclose(f); + } /* end for */ - return 1; + /* Indicate success */ + ret_val = 1; -} +out: + if(f) + HDfclose(f); + return ret_val; +} /* end read_data() */ /*------------------------------------------------------------------------- @@ -882,6 +951,6 @@ static int read_palette(const char* fname, /* close file */ HDfclose(file); - return nentries; + return (int)nentries; } diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index dc79e47..fc82407 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -286,9 +286,9 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, done: if(loc_found && H5G_loc_free(&src_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") - if(obj_open) - H5O_close(&src_oloc); + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + if(obj_open && H5O_close(&src_oloc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header") FUNC_LEAVE_API(ret_value) } /* end H5Ocopy() */ @@ -669,7 +669,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, } /* end if */ /* Add in destination's object header size now */ - dst_oh_size += H5O_SIZEOF_HDR(oh_dst); + dst_oh_size += (uint64_t)H5O_SIZEOF_HDR(oh_dst); /* Allocate space for chunk in destination file */ if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, dxpl_id, (hsize_t)dst_oh_size))) @@ -1284,7 +1284,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, H5O_loc_t dst_oloc; /* Copied object object location */ H5O_loc_t src_oloc; /* Temporary object location for source object */ H5G_loc_t dst_root_loc; /* The location of root group of the destination file */ - uint8_t *p; /* Pointer to OID to store */ + const uint8_t *q; /* Pointer to source OID to store */ + uint8_t *p; /* Pointer to destination OID to store */ size_t i; /* Local index variable */ herr_t ret_value = SUCCEED; @@ -1318,8 +1319,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, /* Making equivalent references in the destination file */ for(i = 0; i < ref_count; i++) { /* Set up for the object copy for the reference */ - p = (uint8_t *)(&src_ref[i]); - H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(src_oloc.addr)); + q = (uint8_t *)(&src_ref[i]); + H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(src_oloc.addr)); dst_oloc.addr = HADDR_UNDEF; /* Attempt to copy object from source to destination file */ @@ -1347,9 +1348,9 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, /* Making equivalent references in the destination file */ for(i = 0; i < ref_count; i++) { /* Get the heap ID for the dataset region */ - p = (uint8_t *)(&src_ref[i]); - H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + q = (const uint8_t *)(&src_ref[i]); + H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(hobjid.addr)); + UINT32DECODE(q, hobjid.idx); if(hobjid.addr != (haddr_t)0) { /* Get the dataset region from the heap (allocate inside routine) */ @@ -1357,8 +1358,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") /* Get the object oid for the dataset */ - p = (uint8_t *)buf; - H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(src_oloc.addr)); + q = (const uint8_t *)buf; + H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(src_oloc.addr)); dst_oloc.addr = HADDR_UNDEF; /* copy the object pointed by the ref to the destination */ @@ -1384,7 +1385,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, /* Set the dataset region reference info for the destination file */ p = (uint8_t *)(&dst_ref[i]); H5F_addr_encode(dst_oloc.file, &p, hobjid.addr); - INT32ENCODE(p, hobjid.idx); + UINT32ENCODE(p, hobjid.idx); /* Free the buffer allocated in H5HG_read() */ H5MM_xfree(buf); diff --git a/src/H5R.c b/src/H5R.c index d45947b..bf8ffba 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -295,7 +295,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 /* Serialize the heap ID and index for storage in the file */ p = (uint8_t *)ref; H5F_addr_encode(loc->oloc->file, &p, hobjid.addr); - INT32ENCODE(p, hobjid.idx); + UINT32ENCODE(p, hobjid.idx); /* Free the buffer we serialized data in */ H5MM_xfree(buf); @@ -439,7 +439,7 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, /* Get the heap ID for the dataset region */ p = (const uint8_t *)_ref; H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL))) @@ -637,7 +637,7 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) /* Get the heap ID for the dataset region */ p = (const uint8_t *)_ref; H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) @@ -772,7 +772,7 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, /* Get the heap ID for the dataset region */ p = (const uint8_t *)_ref; H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) @@ -916,7 +916,7 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty /* Get the heap ID for the dataset region */ p = (const uint8_t *)_ref; H5F_addr_decode(oloc.file, &p, &(hobjid.addr)); - INT32DECODE(p, hobjid.idx); + UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ if((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index b732817..ce0f736 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -189,7 +189,7 @@ * to the destination. SLU - 2005/06/29 */ #define H5T_CONV_Xx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -198,7 +198,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -211,16 +211,16 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Xx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ *(D) = (DT)(D_MIN); \ } else \ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ux_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -233,7 +233,7 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ux_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ } else \ *(D) = (DT)(*(S)); \ @@ -241,7 +241,7 @@ #define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_sU_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -266,7 +266,7 @@ #define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -283,7 +283,7 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_uS_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (sizeof(ST)==sizeof(DT) && *(S) > (D_MAX)) { \ + if (sizeof(ST)==sizeof(DT) && *(S) > (DT)(D_MAX)) { \ *(D) = (D_MAX); \ } else \ *(D) = (DT)(*(S)); \ @@ -291,17 +291,17 @@ #define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -314,7 +314,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) { \ + } else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -329,7 +329,7 @@ #define H5T_CONV_Su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) < 0) \ *(D) = 0; \ - else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) \ + else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ else \ *(D) = (DT)(*(S)); \ @@ -337,17 +337,17 @@ #define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -374,12 +374,12 @@ #define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -393,7 +393,7 @@ } #define H5T_CONV_us_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ - if(*(S) > (DT)(D_MAX)) \ + if(*(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ else \ *(D) = (DT)(*(S)); \ @@ -401,19 +401,19 @@ #define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } /* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN * when an overflow occurs, use the 'float' infinity values. */ #define H5T_CONV_Ff_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX)) { \ + if(*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -422,7 +422,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -435,9 +435,9 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ff_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX)) \ + if(*(S) > (ST)(D_MAX)) \ *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \ - else if (*(S) < (DT)(D_MIN)) \ + else if (*(S) < (ST)(D_MIN)) \ *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \ else \ *(D) = (DT)(*(S)); \ @@ -445,7 +445,7 @@ #define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_HI_LO_BIT_SET(TYP, V, LO, HI) { \ @@ -455,8 +455,8 @@ \ count = 0; \ for(u = 0; u < sizeof(TYP); u++) { \ - count = ((sizeof(TYP) - 1) - u) * 8; \ - p = ((V) >> count) & 0xff; \ + count = (((unsigned)sizeof(TYP) - 1) - u) * 8; \ + p = (unsigned char)((V) >> count); \ if(p > 0) { \ if(p & 0x80) \ count += 7; \ @@ -480,7 +480,7 @@ \ count = 0; \ for(u = 0; u < sizeof(TYP); u++) { \ - p = ((V) >> (u * 8)) & 0xff; \ + p = (unsigned char)((V) >> (u * 8)); \ if(p > 0) { \ count = u * 8; \ \ @@ -536,7 +536,7 @@ } #define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ } /* Quincey added the condition branch (else if (*(S) != (ST)((DT)(*(S))))). @@ -544,11 +544,11 @@ * of "INT_MAX". Compilers do roundup making this value "INT_MAX+1". This branch * is to check that situation and return exception for some compilers, mainly GCC. * The branch if (*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) == - * (DT)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under + * (ST)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under * the same situation the "int" doesn't overflow. SLU - 2005/9/12 */ #define H5T_CONV_Fx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) == (DT)(D_MAX))) { \ + if(*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -557,7 +557,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -580,28 +580,31 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Fx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX)) \ + if(*(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ - else if(*(S) < (DT)(D_MIN)) \ + else if(*(S) < (ST)(D_MIN)) \ *(D) = (DT)(D_MIN); \ else \ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ } /* Since all "no exception" cores do the same thing (assign the value in the * source location to the destination location, using casting), use one "core" * to do them all. */ +#ifndef H5_WANT_DCONV_EXCEPTION #define H5T_CONV_NO_EXCEPT_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ *(D) = (DT)(*(S)); \ } +#endif /* H5_WANT_DCONV_EXCEPTION */ + /* The main part of every integer hardware conversion macro */ -#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) \ +#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,PREC) \ { \ herr_t ret_value=SUCCEED; /* Return value */ \ \ @@ -609,13 +612,11 @@ \ { \ size_t elmtno; /*element number */ \ - size_t sprec; /*source precision */ \ - size_t dprec; /*destination precision */ \ + H5T_CONV_DECL_PREC(PREC) /*declare precision variables, or not */ \ uint8_t *src_buf; /*'raw' source buffer */ \ uint8_t *dst_buf; /*'raw' destination buffer */ \ ST *src, *s; /*source buffer */ \ DT *dst, *d; /*destination buffer */ \ - H5T_class_t tclass; /*datatype's class */ \ H5T_t *st, *dt; /*datatype descriptors */ \ ST src_aligned; /*source aligned type */ \ DT dst_aligned; /*destination aligned type */ \ @@ -647,8 +648,8 @@ case H5T_CONV_CONV: \ /* Initialize source & destination strides */ \ if (buf_stride) { \ - assert(buf_stride>=sizeof(ST)); \ - assert(buf_stride>=sizeof(DT)); \ + HDassert(buf_stride >= sizeof(ST)); \ + HDassert(buf_stride >= sizeof(DT)); \ s_stride = d_stride = (ssize_t)buf_stride; \ } else { \ s_stride = sizeof(ST); \ @@ -659,11 +660,11 @@ s_mv = H5T_NATIVE_##STYPE##_ALIGN_g>1 && \ ((size_t)buf%H5T_NATIVE_##STYPE##_ALIGN_g || \ /* Cray */ ((size_t)((ST*)buf)!=(size_t)buf) || \ - s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \ + (size_t)s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \ d_mv = H5T_NATIVE_##DTYPE##_ALIGN_g>1 && \ ((size_t)buf%H5T_NATIVE_##DTYPE##_ALIGN_g || \ /* Cray */ ((size_t)((DT*)buf)!=(size_t)buf) || \ - d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \ + (size_t)d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \ CI_INC_SRC(s_mv) \ CI_INC_DST(d_mv) \ \ @@ -679,19 +680,7 @@ if(NULL == (st = (H5T_t *)H5I_object(src_id)) || NULL == (dt = (H5T_t *)H5I_object(dst_id))) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to dereference datatype object ID") \ \ - /* Get source & destination precisions into a variable */ \ - tclass = st->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ - if(tclass == H5T_INTEGER) \ - sprec = st->shared->u.atomic.prec; \ - else \ - sprec = 1 + st->shared->u.atomic.u.f.msize; \ - tclass = dt->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ - if(tclass == H5T_INTEGER) \ - dprec = dt->shared->u.atomic.prec; \ - else \ - dprec = 1 + dt->shared->u.atomic.u.f.msize; \ + H5T_CONV_SET_PREC(PREC) /*init precision variables, or not */ \ \ /* The outer loop of the type conversion macro, controlling which */ \ /* direction the buffer is walked */ \ @@ -701,21 +690,21 @@ /* Compute the number of "safe" destination elements at */ \ /* the end of the buffer (Those which don't overlap with */ \ /* any source elements at the beginning of the buffer) */ \ - safe=nelmts-(((nelmts*s_stride)+(d_stride-1))/d_stride); \ + safe = nelmts - (((nelmts * (size_t)s_stride) + (size_t)(d_stride - 1)) / (size_t)d_stride); \ \ /* If we're down to the last few elements, just wrap up */ \ /* with a "real" reverse copy */ \ if(safe<2) { \ - src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-1)*s_stride); \ - dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-1)*d_stride); \ + src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride); \ + dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride); \ s_stride = -s_stride; \ d_stride = -d_stride; \ \ safe=nelmts; \ } /* end if */ \ else { \ - src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-safe)*s_stride); \ - dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-safe)*d_stride); \ + src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride); \ + dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride); \ } /* end else */ \ } /* end if */ \ else { \ @@ -757,6 +746,36 @@ done: \ FUNC_LEAVE_NOAPI(ret_value) \ } +/* Declare the source & destination precision variables */ +#define H5T_CONV_DECL_PREC(PREC) H5_GLUE(H5T_CONV_DECL_PREC_, PREC) + +#define H5T_CONV_DECL_PREC_Y \ + size_t sprec; /*source precision */ \ + size_t dprec; /*destination precision */ \ + H5T_class_t tclass; /*datatype's class */ + +#define H5T_CONV_DECL_PREC_N /*no precision variables */ + +/* Initialize the source & destination precision variables */ +#define H5T_CONV_SET_PREC(PREC) H5_GLUE(H5T_CONV_SET_PREC_, PREC) + +#define H5T_CONV_SET_PREC_Y \ + /* Get source & destination precisions into a variable */ \ + tclass = st->shared->type; \ + HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + if(tclass == H5T_INTEGER) \ + sprec = st->shared->u.atomic.prec; \ + else \ + sprec = 1 + st->shared->u.atomic.u.f.msize; \ + tclass = dt->shared->type; \ + HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + if(tclass == H5T_INTEGER) \ + dprec = dt->shared->u.atomic.prec; \ + else \ + dprec = 1 + dt->shared->u.atomic.u.f.msize; + +#define H5T_CONV_SET_PREC_N /*don't init precision variables */ + /* Macro defining action on source data which needs to be aligned (before main action) */ #define H5T_CONV_LOOP_PRE_SALIGN(ST) { \ HDmemcpy(&src_aligned, src, sizeof(ST)); \ @@ -903,7 +922,7 @@ typedef struct H5T_conv_struct_t { /* Conversion data for H5T__conv_enum() */ typedef struct H5T_enum_struct_t { int base; /*lowest `in' value */ - int length; /*num elements in arrays */ + unsigned length; /*num elements in arrays */ int *src2dst; /*map from src to dst index */ } H5T_enum_struct_t; @@ -1085,6 +1104,15 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") break; + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_STRING: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") } @@ -1402,6 +1430,9 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, H5_SWAP_BYTES(buf, 7, 8); } /* end for */ break; + + default: + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "invalid conversion size") } /* end switch */ break; @@ -1487,6 +1518,16 @@ H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ break; + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_STRING: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") } /* end switch */ @@ -1543,7 +1584,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */ - int direction; /*direction of traversal */ + ssize_t direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t olap; /*num overlapping elements */ size_t half_size; /*1/2 of total size for swapping*/ @@ -1620,6 +1661,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_rev = (uint8_t *)H5MM_calloc(src->shared->size); /* The conversion loop */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); for(elmtno = 0; elmtno < nelmts; elmtno++) { /* @@ -1703,6 +1747,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, TRUE); break; + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported LSB padding") } /* end switch */ @@ -1715,6 +1762,10 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_PAD_ONE: H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, TRUE); break; + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported MSB padding") } /* end switch */ @@ -1739,12 +1790,12 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(d == dbuf) HDmemcpy(dp, d, dst->shared->size); if(buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; + sp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ + dp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ } /* end if */ else { - sp += direction * src->shared->size; - dp += direction * dst->shared->size; + sp += direction * (ssize_t)src->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ + dp += direction * (ssize_t)dst->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ } /* end else */ } /* end for */ @@ -2062,20 +2113,6 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata) * Programmer: Robb Matzke * Thursday, January 22, 1998 * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is - * non-zero then convert one value at each memory location - * advancing BUF_STRIDE bytes each time; otherwise assume - * both source and destination values are packed. - * - * Robb Matzke, 2000-05-17 - * Added the BKG_STRIDE argument to fix a design bug. If - * BUF_STRIDE and BKG_STRIDE are both non-zero then each - * data element converted will be placed temporarily at a - * multiple of BKG_STRIDE in the BKG buffer; otherwise the - * BKG buffer is assumed to be a packed array of destination - * datatype. *------------------------------------------------------------------------- */ herr_t @@ -2091,7 +2128,8 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */ size_t offset; /*byte offset wrt struct */ - size_t src_delta; /*source stride */ + ssize_t src_delta; /*source stride */ + ssize_t bkg_delta; /*background stride */ size_t elmtno; unsigned u; /*counters */ int i; /*counters */ @@ -2149,17 +2187,22 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Direction of conversion and striding through background. */ if(buf_stride) { - src_delta = buf_stride; - if(!bkg_stride) - bkg_stride = dst->shared->size; + H5_ASSIGN_OVERFLOW(src_delta, buf_stride, size_t, ssize_t); + if(!bkg_stride) { + H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); + } /* end if */ + else + H5_ASSIGN_OVERFLOW(bkg_delta, bkg_stride, size_t, ssize_t); } /* end if */ else if(dst->shared->size <= src->shared->size) { - src_delta = src->shared->size; - bkg_stride = dst->shared->size; + H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); + H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); } /* end else-if */ else { - src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/ - bkg_stride = -(int)dst->shared->size; /*overflow shouldn't be possible*/ + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + src_delta = -(ssize_t)src->shared->size; + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + bkg_delta = -(ssize_t)dst->shared->size; xbuf += (nelmts - 1) * src->shared->size; xbkg += (nelmts - 1) * dst->shared->size; } /* end else */ @@ -2204,7 +2247,8 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * yet). Then copy the member to the destination offset in the * background buffer. */ - for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); + for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; /*subsetting*/ src_memb = src->shared->u.compnd.memb + i; @@ -2229,12 +2273,12 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Update pointers */ xbuf += src_delta; - xbkg += bkg_stride; + xbkg += bkg_delta; } /* end for */ - /* If the bkg_stride was set to -(dst->shared->size), make it positive now */ + /* If the bkg_delta was set to -(dst->shared->size), make it positive now */ if(buf_stride == 0 && dst->shared->size > src->shared->size) - bkg_stride = dst->shared->size; + H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); /* * Copy the background buffer back into the in-place conversion @@ -2243,7 +2287,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, for(xbuf = buf, xbkg = bkg, elmtno = 0; elmtno < nelmts; elmtno++) { HDmemmove(xbuf, xbkg, dst->shared->size); xbuf += buf_stride ? buf_stride : dst->shared->size; - xbkg += bkg_stride; + xbkg += bkg_delta; } /* end for */ break; @@ -2390,7 +2434,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, if(dst_memb->size > src_memb->size) offset += src_memb->size; } /* end for */ - for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); + for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; @@ -2509,7 +2554,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * is larger than the source) and them to their final position in the * bkg buffer. */ - for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); + for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; @@ -2605,7 +2651,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) j++; if(j >= dst->shared->u.enumer.nmembs) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source type is not a subset of destination type") - priv->src2dst[i] = j; + priv->src2dst[i] = (int)j; } /* end for */ /* @@ -2634,45 +2680,44 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * Because this is the optimized code, we won't fix it. It should still work in some * situations. SLU - 2011/5/24) */ - if (1==src->shared->size || sizeof(short)==src->shared->size || sizeof(int)==src->shared->size) { - for (i=0; ishared->u.enumer.nmembs; i++) { - if (1==src->shared->size) { - n = *((signed char*)(src->shared->u.enumer.value+i)); - } else if (sizeof(short)==src->shared->size) { - n = *((short*)(src->shared->u.enumer.value+i*src->shared->size)); - } else { - n = *((int*)(src->shared->u.enumer.value+i*src->shared->size)); - } - if (0==i) { + if(1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) { + for(i = 0; i < src->shared->u.enumer.nmembs; i++) { + if(1 == src->shared->size) + n = *((signed char *)(src->shared->u.enumer.value + i)); + else if (sizeof(short) == src->shared->size) + n = *((short *)(src->shared->u.enumer.value + i * src->shared->size)); + else + n = *((int *)(src->shared->u.enumer.value + i * src->shared->size)); + if(0 == i) { domain[0] = domain[1] = n; } else { domain[0] = MIN(domain[0], n); domain[1] = MAX(domain[1], n); } - } + } /* end for */ - length = (domain[1]-domain[0])+1; - if (src->shared->u.enumer.nmembs<2 || - (double)length/src->shared->u.enumer.nmembs<1.2) { + HDassert(domain[1] >= domain[0]); + length = (unsigned)(domain[1] - domain[0]) + 1; + if(src->shared->u.enumer.nmembs < 2 || + (double)length / src->shared->u.enumer.nmembs < (double)(1.2f)) { priv->base = domain[0]; priv->length = length; - if (NULL==(map=(int *)H5MM_malloc(length*sizeof(int)))) + if(NULL == (map = (int *)H5MM_malloc(length * sizeof(int)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - for (i=0; ishared->u.enumer.nmembs; i++) { - if (1==src->shared->size) { - n = *((signed char*)(src->shared->u.enumer.value+i)); - } else if (sizeof(short)==src->shared->size) { - n = *((short*)(src->shared->u.enumer.value+i*src->shared->size)); - } else { - n = *((int*)(src->shared->u.enumer.value+i*src->shared->size)); - } + for(i = 0; i < src->shared->u.enumer.nmembs; i++) { + if(1 == src->shared->size) + n = *((signed char *)(src->shared->u.enumer.value + i)); + else if(sizeof(short) == src->shared->size) + n = *((short *)(src->shared->u.enumer.value + i * src->shared->size)); + else + n = *((int *)(src->shared->u.enumer.value + i * src->shared->size)); n -= priv->base; - assert(n>=0 && nlength); - assert(map[n]<0); + HDassert(n >= 0 && (unsigned)n < priv->length); + HDassert(map[n] < 0); map[n] = priv->src2dst[i]; - } + } /* end for */ /* * Replace original src2dst array with our new one. The original @@ -2718,9 +2763,8 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */ - H5T_t *src_super = NULL, *dst_super = NULL; /*parent types for src and dst*/ uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */ - int src_delta, dst_delta; /*conversion strides */ + ssize_t src_delta, dst_delta; /*conversion strides */ int n; /*src value cast as native int */ H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv); H5P_genplist_t *plist; /*property list pointer */ @@ -2785,17 +2829,20 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Direction of conversion. */ if(buf_stride) { - src_delta = dst_delta = (int)buf_stride; + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + src_delta = dst_delta = (ssize_t)buf_stride; s = d = buf; } else if(dst->shared->size <= src->shared->size) { - src_delta = (int)src->shared->size; /*overflow shouldn't be possible*/ - dst_delta = (int)dst->shared->size; /*overflow shouldn't be possible*/ + H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); + H5_ASSIGN_OVERFLOW(dst_delta, dst->shared->size, size_t, ssize_t); s = d = buf; } else { - src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/ - dst_delta = -(int)dst->shared->size; /*overflow shouldn't be possible*/ - s = buf + (nelmts-1) * src->shared->size; - d = buf + (nelmts-1) * dst->shared->size; + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = -(ssize_t)src->shared->size; + dst_delta = -(ssize_t)dst->shared->size; + s = buf + (nelmts - 1) * src->shared->size; + d = buf + (nelmts - 1) * dst->shared->size; } /* Get the plist structure */ @@ -2822,28 +2869,29 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, else n = *((int*)s); n -= priv->base; - if(n < 0 || n >= priv->length || priv->src2dst[n] < 0) { + if(n < 0 || (unsigned)n >= priv->length || priv->src2dst[n] < 0) { /*overflow*/ except_ret = H5T_CONV_UNHANDLED; - if(cb_struct.func) { /*If user's exception handler is present, use it*/ + /*If user's exception handler is present, use it*/ + if(cb_struct.func) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, s, d, cb_struct.user_data); - } - if(except_ret == H5T_CONV_UNHANDLED) { + if(except_ret == H5T_CONV_UNHANDLED) HDmemset(d, 0xff, dst->shared->size); - } else if(except_ret == H5T_CONV_ABORT) + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - } else { + } else HDmemcpy(d, - dst->shared->u.enumer.value+priv->src2dst[n]*dst->shared->size, + dst->shared->u.enumer.value + (unsigned)priv->src2dst[n] * dst->shared->size, dst->shared->size); - } - } else { + } /* end if */ + else { /* Use O(log N) lookup */ - int lt = 0; - int rt = src->shared->u.enumer.nmembs; - int md, cmp; + unsigned lt = 0; + unsigned rt = src->shared->u.enumer.nmembs; + unsigned md; + int cmp; while(lt < rt) { md = (lt + rt) / 2; @@ -2858,22 +2906,22 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end while */ if(lt >= rt) { except_ret = H5T_CONV_UNHANDLED; - if(cb_struct.func) { /*If user's exception handler is present, use it*/ + /*If user's exception handler is present, use it*/ + if(cb_struct.func) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src, d, cb_struct.user_data); - } - if(except_ret == H5T_CONV_UNHANDLED) { + if(except_ret == H5T_CONV_UNHANDLED) HDmemset(d, 0xff, dst->shared->size); - } else if(except_ret == H5T_CONV_ABORT) + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") } /* end if */ - else { + else + HDassert(priv->src2dst[md] >= 0); HDmemcpy(d, - dst->shared->u.enumer.value+priv->src2dst[md]*dst->shared->size, + dst->shared->u.enumer.value + (unsigned)priv->src2dst[md] * dst->shared->size, dst->shared->size); - } /* end else */ - } + } /* end else */ } break; @@ -2906,7 +2954,7 @@ done: */ herr_t H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, + size_t UNUSED buf_stride, size_t UNUSED bkg_stride, void *_buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { H5T_t *src, *dst; /*src and dst datatypes */ @@ -3017,7 +3065,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_path_t *tpath = NULL; /* Type conversion path */ hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */ hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */ - hbool_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ + htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */ H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ @@ -3028,7 +3076,6 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, ssize_t s_stride, d_stride; /*src and dst strides */ ssize_t b_stride; /*bkg stride */ size_t safe; /*how many elements are safe to process in each pass */ - ssize_t seq_len; /*the number of elements in the current sequence*/ size_t bg_seq_len = 0; size_t src_base_size, dst_base_size;/*source & destination base size*/ void *conv_buf = NULL; /*temporary conversion buffer */ @@ -3116,12 +3163,13 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, noop_conv = TRUE; /* Check if we need a temporary buffer for this conversion */ - parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE); + if((parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_SYSTEM, FAIL, "internal error when detecting variable-length class") if(tpath->cdata.need_bkg || parent_is_vlen) { /* Set up initial background buffer */ tmp_buf_size = MAX(src_base_size, dst_base_size); if(NULL == (tmp_buf = H5FL_BLK_CALLOC(vlen_seq,tmp_buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for type conversion") } /* end if */ /* Get the allocation info */ @@ -3141,17 +3189,22 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, while(nelmts > 0) { /* Check if we need to go backwards through the buffer */ if(d_stride > s_stride) { + /* Sanity check */ + HDassert(s_stride > 0); + HDassert(d_stride > 0); + HDassert(b_stride >= 0); + /* Compute the number of "safe" destination elements at */ /* the end of the buffer (Those which don't overlap with */ /* any source elements at the beginning of the buffer) */ - safe = nelmts - (((nelmts * s_stride) + (d_stride - 1)) / d_stride); + safe = nelmts - (((nelmts * (size_t)s_stride) + ((size_t)d_stride - 1)) / (size_t)d_stride); /* If we're down to the last few elements, just wrap up */ /* with a "real" reverse copy */ if(safe < 2) { - s = (uint8_t *)buf + (nelmts - 1) * s_stride; - d = (uint8_t *)buf + (nelmts - 1) * d_stride; - b = (uint8_t *)bkg + (nelmts - 1) * b_stride; + s = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride; + d = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride; + b = (uint8_t *)bkg + (nelmts - 1) * (size_t)b_stride; s_stride = -s_stride; d_stride = -d_stride; b_stride = -b_stride; @@ -3159,9 +3212,9 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, safe = nelmts; } /* end if */ else { - s = (uint8_t *)buf + (nelmts - safe) * s_stride; - d = (uint8_t *)buf + (nelmts - safe) * d_stride; - b = (uint8_t *)bkg + (nelmts - safe) * b_stride; + s = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride; + d = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride; + b = (uint8_t *)bkg + (nelmts - safe) * (size_t)b_stride; } /* end else */ } /* end if */ else { @@ -3179,9 +3232,13 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't set VL data to 'nil'") } /* end if */ else { + ssize_t sseq_len; /* (signed) The number of elements in the current sequence*/ + size_t seq_len; /* The number of elements in the current sequence*/ + /* Get length of element sequences */ - if((seq_len = (*(src->shared->u.vlen.getlen))(s)) < 0) + if((sseq_len = (*(src->shared->u.vlen.getlen))(s)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "incorrect length") + seq_len = (size_t)sseq_len; /* If we are reading from memory and there is no conversion, just get the pointer to sequence */ if(write_to_file && noop_conv) { @@ -3230,7 +3287,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* If we are writing and there is a nested VL type, read * the sequence into the background buffer */ if(nested) { - uint8_t *tmp = b; + const uint8_t *tmp = b; UINT32DECODE(tmp, bg_seq_len); if(bg_seq_len > 0) { @@ -3240,40 +3297,40 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") HDmemset(tmp_buf, 0, tmp_buf_size); } /* end if */ - H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp, &(bg_hobjid.addr)); - INT32DECODE(tmp, bg_hobjid.idx); + H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(bg_hobjid.addr)); + UINT32DECODE(tmp, bg_hobjid.idx); if(NULL == H5HG_read(dst->shared->u.vlen.f, dxpl_id, &bg_hobjid, tmp_buf, NULL)) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "can't read VL sequence into background buffer") } /* end if */ /* If the sequence gets shorter, pad out the original sequence with zeros */ - if((ssize_t)bg_seq_len < seq_len) + if(bg_seq_len < seq_len) HDmemset((uint8_t *)tmp_buf + dst_base_size * bg_seq_len, 0, (seq_len - bg_seq_len) * dst_base_size); } /* end if */ /* Convert VL sequence */ - if(H5T_convert(tpath, tsrc_id, tdst_id, (size_t)seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) + if(H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ /* Write sequence to destination location */ - if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, (size_t)seq_len, dst_base_size) < 0) + if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, seq_len, dst_base_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't write VL data") if(!noop_conv) { /* For nested VL case, free leftover heap objects from the deeper level if the length of new data elements is shorter than the old data elements.*/ - if(nested && seq_len < (ssize_t)bg_seq_len) { + if(nested && seq_len < bg_seq_len) { size_t parent_seq_len; - uint8_t *tmp_p; + const uint8_t *tmp; size_t u; /* TMP_P is reset each time in the loop because DST_BASE_SIZE may include some data in addition to VL info. - SLU */ for(u = seq_len; u < bg_seq_len; u++) { - tmp_p = (uint8_t*)tmp_buf + u * dst_base_size; - UINT32DECODE(tmp_p, parent_seq_len); + tmp = (uint8_t *)tmp_buf + u * dst_base_size; + UINT32DECODE(tmp, parent_seq_len); if(parent_seq_len > 0) { - H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp_p, &(parent_hobjid.addr)); - INT32DECODE(tmp_p, parent_hobjid.idx); + H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(parent_hobjid.addr)); + UINT32DECODE(tmp, parent_hobjid.idx); if(H5HG_remove(dst->shared->u.vlen.f, dxpl_id, &parent_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") } /* end if */ @@ -3343,7 +3400,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ uint8_t *sp, *dp; /*source and dest traversal ptrs */ - size_t src_delta, dst_delta; /*source & destination stride */ + ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number counter */ unsigned u; /* local index variable */ @@ -3408,8 +3465,11 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Direction & size of buffer traversal. */ - src_delta = direction * (buf_stride ? buf_stride : src->shared->size); - dst_delta = direction * (buf_stride ? buf_stride : dst->shared->size); + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); /* Set up conversion path for base elements */ if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) { @@ -3499,6 +3559,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ + ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t half_size; /*half the type size */ @@ -3563,6 +3624,15 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } + /* + * Direction & size of buffer traversal. + */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") @@ -3575,18 +3645,18 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_rev = (uint8_t*)H5MM_calloc(src->shared->size); /* The conversion loop */ - for (elmtno=0; elmtno0) { + if(direction > 0) { s = sp; - d = elmtno= nelmts ? dbuf : dp; + d = elmtno + olap >= nelmts ? dbuf : dp; } #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ @@ -3844,16 +3914,13 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * If we had used a temporary buffer for the destination then we * should copy the value to the true destination buffer. */ - if (d==dbuf) - HDmemcpy (dp, d, dst->shared->size); - if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; - } else { - sp += direction * src->shared->size; - dp += direction * dst->shared->size; - } - } + if(d==dbuf) + HDmemcpy(dp, d, dst->shared->size); + + /* Advance source & destination pointers by delta amounts */ + sp += src_delta; + dp += dst_delta; + } /* end for */ break; @@ -3909,6 +3976,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_t *dst_p; /*destination datatype */ H5T_atomic_t src; /*atomic source info */ H5T_atomic_t dst; /*atomic destination info */ + ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*forward or backward traversal */ size_t elmtno; /*element number */ size_t half_size; /*half the type size */ @@ -3921,11 +3989,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ /* Conversion-related variables */ - hssize_t expo; /*exponent */ + int64_t expo; /*exponent */ hssize_t expo_max; /*maximum possible dst exponent */ size_t msize = 0; /*useful size of mantissa in src*/ size_t mpos; /*offset to useful mant is src */ - hssize_t sign; /*source sign bit value */ + uint64_t sign; /*source sign bit value */ size_t mrsh; /*amount to right shift mantissa*/ hbool_t carry = 0; /*carry after rounding mantissa */ size_t i; /*miscellaneous counters */ @@ -3991,6 +4059,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } + /* + * Direction & size of buffer traversal. + */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src_p->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst_p->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src_p->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst_p->shared->size); + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") @@ -4142,9 +4219,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; -#ifdef H5_VMS - } /*Temporary solution to handle VAX special values*/ -#else /*H5_VMS*/ +#ifndef H5_VMS /*Temporary solution to handle VAX special values*/ } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* NaN */ @@ -4169,15 +4244,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; - } #endif /*H5_VMS*/ + } /* * Get the exponent as an unsigned quantity from the section of * the source bit field where it's located. Don't worry about * the exponent bias yet. */ - expo = H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); + expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); if(expo==0) denormalized=TRUE; @@ -4189,10 +4264,9 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, implied = 1; mpos = src.u.f.mpos; mrsh = 0; - if (0==expo || H5T_NORM_NONE==src.u.f.norm) { - if ((bitno=H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, - H5T_BIT_MSB, TRUE))>0) { - msize = bitno; + if(0 == expo || H5T_NORM_NONE == src.u.f.norm) { + if((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) { + msize = (size_t)bitno; } else if (0==bitno) { msize = 1; H5T__bit_set(s, src.u.f.mpos, (size_t)1, FALSE); @@ -4200,8 +4274,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (H5T_NORM_IMPLIED==src.u.f.norm) { msize = src.u.f.msize; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* @@ -4215,13 +4288,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * the source exponent bias. */ if (0==expo || H5T_NORM_NONE==src.u.f.norm) { - assert(bitno>=0); - expo -= (src.u.f.ebias-1) + (src.u.f.msize-bitno); + HDassert(bitno>=0); + expo -= (int64_t)((src.u.f.ebias - 1) + (src.u.f.msize - (size_t)bitno)); } else if (H5T_NORM_IMPLIED==src.u.f.norm) { - expo -= src.u.f.ebias; + expo -= (int64_t)src.u.f.ebias; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* @@ -4236,7 +4308,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * bias and clipping by the minimum and maximum possible * destination exponent values. */ - expo += dst.u.f.ebias; + expo += (int64_t)dst.u.f.ebias; if (expo < -(hssize_t)(dst.u.f.msize)) { /* The exponent is way too small. Result is zero. */ @@ -4250,7 +4322,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * accomodate that value. The mantissa of course is no * longer normalized. */ - H5_ASSIGN_OVERFLOW(mrsh,(mrsh+1-expo),hssize_t,size_t); + mrsh += (size_t)(1 - expo); expo = 0; denormalized=TRUE; } else if (expo>=expo_max) { @@ -4289,20 +4361,20 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * mantissa bit is `1', else it is `10' binary. */ if (msize>0 && mrsh<=dst.u.f.msize && mrsh+msize>dst.u.f.msize) { - bitno = (ssize_t)(mrsh+msize - dst.u.f.msize); - assert(bitno>=0 && (size_t)bitno<=msize); - /*If the 1st bit being cut off is set and source isn't denormalized.*/ - if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && !denormalized) { - /*Don't do rounding if exponent is 111...110 and mantissa is 111...11. - *To do rounding and increment exponent in this case will create an infinity value.*/ - if((H5T__bit_find(s, mpos+bitno, msize-bitno, H5T_BIT_LSB, FALSE)>=0 || expo= 0 && (size_t)bitno <= msize); + /* If the 1st bit being cut off is set and source isn't denormalized.*/ + if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && !denormalized) { + /* Don't do rounding if exponent is 111...110 and mantissa is 111...11. + * To do rounding and increment exponent in this case will create an infinity value.*/ + if((H5T__bit_find(s, mpos + (size_t)bitno, msize - (size_t)bitno, H5T_BIT_LSB, FALSE) >= 0 || expo < expo_max - 1)) { + carry = (hbool_t)H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); + if(carry) implied = 2; } - } else if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && denormalized) - /*For either source or destination, denormalized value doesn't increment carry.*/ - H5T__bit_inc(s, mpos+bitno-1, 1+msize-bitno); + } else if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && denormalized) + /* For either source or destination, denormalized value doesn't increment carry.*/ + H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); } else carry=0; @@ -4420,15 +4492,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * should copy the value to the true destination buffer. */ next: - if (d==dbuf) - HDmemcpy (dp, d, dst_p->shared->size); - if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; - } else { - sp += direction * src_p->shared->size; - dp += direction * dst_p->shared->size; - } + if(d == dbuf) + HDmemcpy(dp, d, dst_p->shared->size); + + /* Advance source & destination pointers by delta amounts */ + sp += src_delta; + dp += dst_delta; } break; @@ -4474,7 +4543,8 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_t *src=NULL; /*source datatype */ H5T_t *dst=NULL; /*destination datatype */ - int direction; /*direction of traversal */ + ssize_t src_delta, dst_delta; /*source & destination stride */ + int direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t olap; /*num overlapping elements */ size_t nchars=0; /*number of characters copied */ @@ -4499,8 +4569,8 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset) || (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") - if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NPAD || - dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NPAD) + if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NSTR || + dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NSTR) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character padding") cdata->need_bkg = H5T_BKG_NO; break; @@ -4541,6 +4611,15 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } + /* + * Direction & size of buffer traversal. + */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); + /* Allocate the overlap buffer */ if(NULL == (dbuf = (uint8_t *)H5MM_malloc(dst->shared->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for string conversion") @@ -4613,6 +4692,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: case H5T_STR_ERROR: + default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source string padding method not supported") } /* end switch */ @@ -4648,6 +4728,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: case H5T_STR_ERROR: + default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "destination string padding method not supported") } /* end switch */ @@ -4655,15 +4736,12 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * If we used a temporary buffer for the destination then we * should copy the value to the true destination buffer. */ - if (d==dbuf) + if(d == dbuf) HDmemcpy(dp, d, dst->shared->size); - if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; - } else { - sp += direction * src->shared->size; - dp += direction * dst->shared->size; - } + + /* Advance source & destination pointers by delta amounts */ + sp += src_delta; + dp += dst_delta; } /* end for */ break; @@ -9044,8 +9122,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (H5T_NORM_IMPLIED==src.u.f.norm) { expo -= src.u.f.ebias; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* @@ -9548,8 +9625,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (H5T_NORM_NONE==dst.u.f.norm || H5T_NORM_IMPLIED==dst.u.f.norm) { expo = first + dst.u.f.ebias; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* Handle mantissa part here */ @@ -9629,7 +9705,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Check if the exponent is too big */ - expo_max = (hsize_t)HDpow((double)2.0, (double)dst.u.f.esize) - 1; + expo_max = (hsize_t)HDpow((double)2.0f, (double)dst.u.f.esize) - 1; if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index f497d1e..52a2cde 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -882,7 +882,7 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED /* Get the heap information */ H5F_addr_decode(f,(const uint8_t **)&vl,&(hobjid.addr)); - INT32DECODE(vl,hobjid.idx); + UINT32DECODE(vl,hobjid.idx); /* Check if this sequence actually has any data */ if(hobjid.addr>0) { @@ -935,7 +935,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED /* Get heap information */ H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr)); - INT32DECODE(bg, bg_hobjid.idx); + UINT32DECODE(bg, bg_hobjid.idx); /* Free heap object for old data */ if(bg_hobjid.addr > 0) { @@ -955,7 +955,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED /* Encode the heap information */ H5F_addr_encode(f, &vl, hobjid.addr); - INT32ENCODE(vl, hobjid.idx); + UINT32ENCODE(vl, hobjid.idx); done: FUNC_LEAVE_NOAPI(ret_value) @@ -997,7 +997,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* Get heap information */ H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr)); - INT32DECODE(bg, bg_hobjid.idx); + UINT32DECODE(bg, bg_hobjid.idx); /* Free heap object for old data */ if(bg_hobjid.addr > 0) { @@ -1012,7 +1012,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* Encode the "nil" heap pointer information */ H5F_addr_encode(f, &vl, (haddr_t)0); - INT32ENCODE(vl, 0); + UINT32ENCODE(vl, 0); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5private.h b/src/H5private.h index 78d3d9d..731a7f6 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2345,7 +2345,11 @@ func_init_failed: \ #define H5_GLUE4(w,x,y,z) w##x##y##z /* Compile-time "assert" macro */ -#define HDcompile_assert(e) do { enum { compile_assert__ = 1 / (e) }; } while(0) +#define HDcompile_assert(e) ((void)sizeof(char[ !!(e) ? 1 : -1])) +/* Variants that are correct, but generate compile-time warnings in some circumstances: + #define HDcompile_assert(e) do { enum { compile_assert__ = 1 / (e) }; } while(0) + #define HDcompile_assert(e) do { typedef struct { unsigned int b: (e); } x; } while(0) +*/ /* Private functions, not part of the publicly documented API */ H5_DLL herr_t H5_init_library(void); diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 8bc8780..202d050 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -50,10 +50,12 @@ static const char *H5_get_srcdir_filename(const char *filename) #ifdef H5_VMS if(filename[0] == '[') { char *tmp = filename; - srcdir_testpath[strlen(srcdir)-1] = '\0'; - strcat(srcdir_testpath, ++tmp); - } else - strcat(srcdir_testpath, filename); + + srcdir_testpath[HDstrlen(srcdir) - 1] = '\0'; + HDstrcat(srcdir_testpath, ++tmp); + } /* end if */ + else + HDstrcat(srcdir_testpath, filename); #else HDstrcat(srcdir_testpath, "/"); HDstrcat(srcdir_testpath, filename); @@ -84,4 +86,3 @@ static const char *H5_get_srcdir(void) } #endif /* _H5SRCDIR_H */ - diff --git a/test/h5test.c b/test/h5test.c index 91497e3..32d78bd 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1124,24 +1124,8 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ ssize_t nread; /* Number of bytes read in */ - char buf[READ_BUF_SIZE]; /* Buffer for copying data */ - char filename[FILENAME_BUF_SIZE] = ""; -#ifdef H5_VMS - HDstrcat(filename, origfilename); -#else - const char * srcdir = HDgetenv("srcdir"); /* The source directory */ - - /* Check for using the srcdir from configure time */ - if(NULL == srcdir) - srcdir = config_srcdir; - - if(srcdir && ((HDstrlen(srcdir) + - HDstrlen(origfilename) + 6) < FILENAME_BUF_SIZE)) { - HDstrcpy(filename, srcdir); - HDstrcat(filename, "/"); - } - HDstrcat(filename, origfilename); -#endif + char buf[READ_BUF_SIZE]; /* Buffer for copying data */ + const char *filename = H5_get_srcdir_filename(origfilename);; /* Get the test file name to copy */ /* Copy old file into temporary file */ if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) return -1; diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index f536605..d84f7f2 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -153,7 +153,7 @@ main (int argc, const char *argv[]) exit (EXIT_FAILURE); } - buf = malloc ((unsigned)(size + 1)); + buf = (char *)HDmalloc ((unsigned)(size + 1)); if (buf == NULL) { HDclose (fd); diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index a68760d..dcc2c08 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -136,7 +136,8 @@ static int display_object = FALSE; /* not implemented yet */ /* a structure for handling the order command-line parameters come in */ struct handler_t { - char *obj; + size_t obj_count; + char **obj; }; @@ -552,7 +553,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) if(type_found) (iter->dset_type_info[u].count)++; else { - unsigned curr_ntype = iter->dset_ntypes; + unsigned curr_ntype = (unsigned)iter->dset_ntypes; /* Increment # of datatypes seen for datasets */ iter->dset_ntypes++; @@ -670,9 +671,11 @@ obj_stats(const char *path, const H5O_info_t *oi, const char *already_visited, break; case H5O_TYPE_NAMED_DATATYPE: - datatype_stats(iter, oi); + datatype_stats(iter, oi); break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: /* Gather statistics about this type of object */ iter->uniq_others++; @@ -710,6 +713,9 @@ lnk_stats(const char UNUSED *path, const H5L_info_t *li, void *_iter) iter->uniq_links++; break; + case H5L_TYPE_HARD: + case H5L_TYPE_MAX: + case H5L_TYPE_ERROR: default: /* Gather statistics about this type of object */ iter->uniq_others++; @@ -740,19 +746,19 @@ freespace_stats(hid_t fid, iter_t *iter) /* Query section information */ if((nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, 0, NULL)) < 0) - return(FAIL); + return(FAIL); else if(nsects) { - if(NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)))) - return(FAIL); - nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); - HDassert(nsects); + if(NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)))) + return(FAIL); + nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); + HDassert(nsects); } /* end else-if */ for(u = 0; u < (size_t)nsects; u++) { unsigned bin; /* "bin" the number of objects falls in */ - if(sect_info[u].size < SIZE_SMALL_SECTS) - (iter->num_small_sects[(size_t)sect_info[u].size])++; + if(sect_info[u].size < SIZE_SMALL_SECTS) + (iter->num_small_sects[(size_t)sect_info[u].size])++; /* Add section size to proper bin */ bin = ceil_log10((unsigned long)sect_info[u].size); @@ -781,6 +787,35 @@ freespace_stats(hid_t fid, iter_t *iter) /*------------------------------------------------------------------------- + * Function: hand_free + * + * Purpose: Free handler structure + * + * Return: Success: 0 + * + * Failure: Never fails + * + *------------------------------------------------------------------------- + */ +static void +hand_free(struct handler_t *hand) +{ + if(hand) { + unsigned u; + + for(u = 0; u < hand->obj_count; u++) + if(hand->obj[u]) { + HDfree(hand->obj[u]); + hand->obj[u] = NULL; + } /* end if */ + hand->obj_count = 0; + HDfree(hand->obj); + HDfree(hand); + } /* end if */ +} /* end hand_free() */ + + +/*------------------------------------------------------------------------- * Function: parse_command_line * * Purpose: Parses command line and sets up global variable to control output @@ -794,50 +829,25 @@ freespace_stats(hid_t fid, iter_t *iter) * *------------------------------------------------------------------------- */ -static struct handler_t * -parse_command_line(int argc, const char *argv[]) +static int +parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) { - int opt, i; + int opt; + unsigned u; struct handler_t *hand = NULL; - /* Allocate space to hold the command line info */ - if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) { - error_msg("unable to parse command line arguments \n"); - goto error; - } - /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch ((char)opt) { + while((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + switch((char)opt) { case 'h': usage(h5tools_getprogname()); h5tools_setstatus(EXIT_SUCCESS); - if (hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } - - free(hand); - hand = NULL; - } goto done; break; case 'V': print_version(h5tools_getprogname()); h5tools_setstatus(EXIT_SUCCESS); - if (hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } - - free(hand); - hand = NULL; - } goto done; break; @@ -894,45 +904,52 @@ parse_command_line(int argc, const char *argv[]) case 'O': display_all = FALSE; display_object = TRUE; - for(i = 0; i < argc; i++) - if(!hand[i].obj) { - hand[i].obj = HDstrdup(opt_arg); - break; + + /* Allocate space to hold the command line info */ + if(NULL == (hand = (struct handler_t *)HDcalloc((size_t)1, sizeof(struct handler_t)))) { + error_msg("unable to allocate memory for object struct\n"); + goto error; + } /* end if */ + + /* Allocate space to hold the object strings */ + hand->obj_count = (size_t)argc; + if(NULL == (hand->obj = (char **)HDcalloc((size_t)argc, sizeof(char *)))) { + error_msg("unable to allocate memory for object array\n"); + goto error; + } /* end if */ + + /* Store object names */ + for(u = 0; u < hand->obj_count; u++) + if(NULL == (hand->obj[u] = HDstrdup(opt_arg))) { + error_msg("unable to allocate memory for object name\n"); + goto error; } /* end if */ break; default: usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); goto error; } /* end switch */ } /* end while */ /* check for file name to be processed */ - if (argc <= opt_ind) { + if(argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); goto error; } /* end if */ + /* Set handler structure */ + *hand_ret = hand; + done: - return hand; + return 0; error: - if (hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } - - free(hand); - hand = NULL; - } + hand_free(hand); h5tools_setstatus(EXIT_FAILURE); - return hand; + return -1; } @@ -947,32 +964,39 @@ error: * *------------------------------------------------------------------------- */ -static herr_t +static void iter_free(iter_t *iter) { /* Clear array of bins for group counts */ - if(iter->group_bins) - free(iter->group_bins); - iter->group_bins = NULL; + if(iter->group_bins) { + HDfree(iter->group_bins); + iter->group_bins = NULL; + } /* end if */ + /* Clear array of bins for attribute counts */ - if(iter->attr_bins) - free(iter->attr_bins); - iter->attr_bins = NULL; + if(iter->attr_bins) { + HDfree(iter->attr_bins); + iter->attr_bins = NULL; + } /* end if */ + /* Clear dataset datatype information found */ - if(iter->dset_type_info) - free(iter->dset_type_info); - iter->dset_type_info = NULL; + if(iter->dset_type_info) { + HDfree(iter->dset_type_info); + iter->dset_type_info = NULL; + } /* end if */ + /* Clear array of bins for dataset dimensions */ - if(iter->dset_dim_bins) - free(iter->dset_dim_bins); - iter->dset_dim_bins = NULL; - /* Clear array of bins for free-space section sizes */ - if(iter->sect_bins) - free(iter->sect_bins); - iter->sect_bins = NULL; + if(iter->dset_dim_bins) { + HDfree(iter->dset_dim_bins); + iter->dset_dim_bins = NULL; + } /* end if */ - return 0; -} + /* Clear array of bins for free-space section sizes */ + if(iter->sect_bins) { + HDfree(iter->sect_bins); + iter->sect_bins = NULL; + } /* end if */ +} /* end iter_free() */ /*------------------------------------------------------------------------- @@ -1428,7 +1452,7 @@ print_storage_summary(const iter_t *iter) { hsize_t total_meta = 0; hsize_t unaccount = 0; - float percent = 0.0; + double percent = 0.0f; HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]); printf("Summary of file space information:\n"); @@ -1451,7 +1475,7 @@ print_storage_summary(const iter_t *iter) HDfprintf(stdout, " File metadata: %Hu bytes\n", total_meta); HDfprintf(stdout, " Raw data: %Hu bytes\n", iter->dset_storage_size); - percent = ((float)iter->free_space / (float)iter->filesize) * 100; + percent = ((double)iter->free_space / (double)iter->filesize) * (double)100.0f; HDfprintf(stdout, " Amount/Percent of tracked free space: %Hu bytes/%3.1f%\n", iter->free_space, percent); @@ -1584,10 +1608,7 @@ main(int argc, const char *argv[]) iter_t iter; const char *fname = NULL; hid_t fid = -1; - hid_t fcpl; struct handler_t *hand = NULL; - H5F_info2_t finfo; - int i; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -1598,97 +1619,91 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - if((hand = parse_command_line(argc, argv))==NULL) { - goto done; - } - - fname = argv[opt_ind]; - - printf("Filename: %s\n", fname); - HDmemset(&iter, 0, sizeof(iter)); - fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); - if(fid < 0) { - error_msg("unable to open file \"%s\"\n", fname); - h5tools_setstatus(EXIT_FAILURE); + if(parse_command_line(argc, argv, &hand) < 0) goto done; - } /* end if */ - /* Initialize iter structure */ - iter.fid = fid; - - if(H5Fget_filesize(fid, &iter.filesize) < 0) - warn_msg("Unable to retrieve file size\n"); - HDassert(iter.filesize != 0); - - /* Get storge info for file-level structures */ - if(H5Fget_info2(fid, &finfo) < 0) - warn_msg("Unable to retrieve file info\n"); - else { - iter.super_size = finfo.super.super_size; - iter.super_ext_size = finfo.super.super_ext_size; - iter.SM_hdr_storage_size = finfo.sohm.hdr_size; - iter.SM_index_storage_size = finfo.sohm.msgs_info.index_size; - iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size; - iter.free_space = finfo.free.tot_space; - iter.free_hdr = finfo.free.meta_size; - } /* end else */ - - if((fcpl = H5Fget_create_plist(fid)) < 0) - warn_msg("Unable to retrieve file creation property\n"); - - if(H5Pget_userblock(fcpl, &iter.ublk_size) < 0) - warn_msg("Unable to retrieve userblock size\n"); + fname = argv[opt_ind]; - if(H5Pget_file_space(fcpl, &iter.fs_strategy, &iter.fs_threshold) < 0) - warn_msg("Unable to retrieve file space information\n"); - HDassert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES); + /* Check for filename given */ + if(fname) { + hid_t fcpl; + H5F_info2_t finfo; - /* get information for free-space sections */ - if(freespace_stats(fid, &iter) < 0) - warn_msg("Unable to retrieve freespace info\n"); + printf("Filename: %s\n", fname); - /* Walk the objects or all file */ - if(display_object) { - unsigned u; + fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); + if(fid < 0) { + error_msg("unable to open file \"%s\"\n", fname); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } /* end if */ - u = 0; - while(hand[u].obj) { - if (h5trav_visit(fid, hand[u].obj, TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) - warn_msg("Unable to traverse object \"%s\"\n", hand[u].obj); + /* Initialize iter structure */ + iter.fid = fid; + + if(H5Fget_filesize(fid, &iter.filesize) < 0) + warn_msg("Unable to retrieve file size\n"); + HDassert(iter.filesize != 0); + + /* Get storge info for file-level structures */ + if(H5Fget_info2(fid, &finfo) < 0) + warn_msg("Unable to retrieve file info\n"); + else { + iter.super_size = finfo.super.super_size; + iter.super_ext_size = finfo.super.super_ext_size; + iter.SM_hdr_storage_size = finfo.sohm.hdr_size; + iter.SM_index_storage_size = finfo.sohm.msgs_info.index_size; + iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size; + iter.free_space = finfo.free.tot_space; + iter.free_hdr = finfo.free.meta_size; + } /* end else */ + + if((fcpl = H5Fget_create_plist(fid)) < 0) + warn_msg("Unable to retrieve file creation property\n"); + + if(H5Pget_userblock(fcpl, &iter.ublk_size) < 0) + warn_msg("Unable to retrieve userblock size\n"); + + if(H5Pget_file_space(fcpl, &iter.fs_strategy, &iter.fs_threshold) < 0) + warn_msg("Unable to retrieve file space information\n"); + HDassert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES); + + /* get information for free-space sections */ + if(freespace_stats(fid, &iter) < 0) + warn_msg("Unable to retrieve freespace info\n"); + + /* Walk the objects or all file */ + if(display_object) { + unsigned u; + + for(u = 0; u < hand->obj_count; u++) { + if(h5trav_visit(fid, hand->obj[u], TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) + warn_msg("Unable to traverse object \"%s\"\n", hand->obj[u]); + else + print_statistics(hand->obj[u], &iter); + } /* end for */ + } /* end if */ + else { + if(h5trav_visit(fid, "/", TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) + warn_msg("Unable to traverse objects/links in file \"%s\"\n", fname); else - print_statistics(hand[u].obj, &iter); - u++; - } /* end while */ + print_statistics("/", &iter); + } /* end else */ } /* end if */ - else { - if (h5trav_visit(fid, "/", TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) - warn_msg("Unable to traverse objects/links in file \"%s\"\n", fname); - else - print_statistics("/", &iter); - } /* end else */ done: - if(hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } + hand_free(hand); - free(hand); - hand = NULL; + /* Free iter structure */ + iter_free(&iter); - /* Free iter structure */ - iter_free(&iter); - - if(fid >= 0 && H5Fclose(fid) < 0) { - error_msg("unable to close file \"%s\"\n", fname); - h5tools_setstatus(EXIT_FAILURE); - } - } + if(fid >= 0 && H5Fclose(fid) < 0) { + error_msg("unable to close file \"%s\"\n", fname); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ leave(h5tools_getstatus()); -} +} /* end main() */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 528fc40..96b508d 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -5783,17 +5783,19 @@ static int ull2float(unsigned long long ull_value, float *f_value) { hid_t dxpl_id; - unsigned char *buf; + unsigned char *buf = NULL; size_t src_size; size_t dst_size; h5difftrace("ull2float start\n"); if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0) - return -1; + goto error; src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); buf = (unsigned char*)HDcalloc(1, MAX(src_size, dst_size)); + if(!buf) + goto error; HDmemcpy(buf, &ull_value, src_size); diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 5f4227c..3e9c43e 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -527,16 +527,18 @@ h5tools_detect_vlen_str(hid_t tid) } } else if(tclass == H5T_COMPOUND) { - int i = 0; - int n = H5Tget_nmembers(tid); + unsigned nmembs; + int snmembs = H5Tget_nmembers(tid); + unsigned u; - if(n < 0) { - n = ret; + if(snmembs < 0) { + ret = FAIL; goto done; } + nmembs = (unsigned)snmembs; - for(i = 0; i < n; i++) { - hid_t mtid = H5Tget_member_type(tid, i); + for(u = 0; u < nmembs; u++) { + hid_t mtid = H5Tget_member_type(tid, u); ret = h5tools_detect_vlen_str(mtid); if((ret == TRUE) || (ret < 0)) { @@ -1150,6 +1152,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t s = *(char**) mem; if (s != NULL) size = HDstrlen(s); + else + H5E_THROW(FAIL, H5E_tools_min_id_g, "NULL string"); } else { s = (char *) mem; diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index d6cd0a0..b3c8f5e 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -188,7 +188,7 @@ table_t *h5dump_type_table = NULL; /*type table reference for datatype dump */ static int h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx, h5tools_str_t *buffer/*string into which to render */, size_t ncols, - int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); + unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata); hbool_t h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, const h5tool_format_t *info, @@ -419,7 +419,7 @@ static int h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx, h5tools_str_t *buffer/*string into which to render */, size_t ncols, - int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata) + unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata) { hbool_t dimension_break = TRUE; hsize_t *dims1 = NULL; @@ -432,9 +432,9 @@ h5tools_print_region_data_blocks(hid_t region_id, unsigned int region_flags; /* buffer extent flags */ hsize_t numelem; hsize_t numindex; - size_t jndx; unsigned indx; - int type_size; + unsigned jndx; + size_t type_size; int ret_value = SUCCEED; hid_t mem_space = -1; hid_t sid1 = -1; @@ -447,6 +447,7 @@ h5tools_print_region_data_blocks(hid_t region_id, HDassert(ptdata); HDmemset(&ctx, 0, sizeof(ctx)); + /* Get the dataspace of the dataset */ if((sid1 = H5Dget_space(region_id)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); @@ -463,7 +464,7 @@ h5tools_print_region_data_blocks(hid_t region_id, } /* Create dataspace for reading buffer */ - if((mem_space = H5Screate_simple(ndims, dims1, NULL)) < 0) + if((mem_space = H5Screate_simple((int)ndims, dims1, NULL)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); if((type_size = H5Tget_size(type_id)) == 0) @@ -504,7 +505,7 @@ h5tools_print_region_data_blocks(hid_t region_id, HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); /* assume entire data space to be printed */ - for (indx = 0; indx < (size_t) ctx.ndims; indx++) + for (indx = 0; indx < (unsigned)ctx.ndims; indx++) ctx.p_min_idx[indx] = start[indx]; init_acc_pos(&ctx, total_size); @@ -513,11 +514,11 @@ h5tools_print_region_data_blocks(hid_t region_id, if (blkndx == nblocks - 1) region_flags |= END_OF_DATA; - for (indx = 0; indx < (size_t)ctx.ndims; indx++) + for (indx = 0; indx < (unsigned)ctx.ndims; indx++) ctx.p_max_idx[indx] = dims1[indx]; curr_pos = 0; - ctx.sm_pos = blkndx*2*ndims; + ctx.sm_pos = blkndx * 2 * ndims; ctx.size_last_dim = dims1[ndims-1]; h5tools_region_simple_prefix(stream, info, &ctx, curr_pos, ptdata, 0); @@ -540,7 +541,7 @@ h5tools_print_region_data_blocks(hid_t region_id, if(FALSE == dimension_break) elmtno = 0; - } /* end for (jndx = 0; jndx < numelem; jndx++, region_elmtno++, ctx.cur_elmt++) */ + } /* end for (numindex = 0; numindex < numelem; numindex++, elmtno++, ctx.cur_elmt++) */ ctx.indent_level--; } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ @@ -593,24 +594,28 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, { HERR_INIT(hbool_t, TRUE) hbool_t dimension_break = TRUE; - hssize_t nblocks; + hssize_t snblocks; + hsize_t nblocks; hsize_t alloc_size; hsize_t *ptdata = NULL; - int ndims; + int sndims; + unsigned ndims; hid_t dtype = -1; hid_t type_id = -1; - int i; + hsize_t u; HDassert(info); HDassert(ctx); HDassert(buffer); - if((nblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) + if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed"); + nblocks = (hsize_t)snblocks; /* Print block information */ - if((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) + if((sndims = H5Sget_simple_extent_ndims(region_space)) < 0) H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + ndims = (unsigned)sndims; /* Render the region { element begin */ h5tools_str_reset(buffer); @@ -635,27 +640,26 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, //HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); } - H5_CHECK_OVERFLOW(nblocks, hssize_t, hsize_t); - if(H5Sget_select_hyper_blocklist(region_space, (hsize_t) 0, (hsize_t) nblocks, ptdata) < 0) + if(H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0) HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Rget_select_hyper_blocklist failed"); - for (i = 0; i < nblocks; i++) { - int j; + for(u = 0; u < nblocks; u++) { + unsigned v; h5tools_str_append(buffer, info->dset_blockformat_pre, - i ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long) i); + u ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)u); /* Start coordinates and opposite corner */ - for (j = 0; j < ndims; j++) - h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : "(", - ptdata[i * 2 * ndims + j]); + for (v = 0; v < ndims; v++) + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, v ? "," : "(", + ptdata[u * 2 * ndims + v]); - for (j = 0; j < ndims; j++) - h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : ")-(", - ptdata[i * 2 * ndims + j + ndims]); + for (v = 0; v < ndims; v++) + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, v ? "," : ")-(", + ptdata[u * 2 * ndims + v + ndims]); h5tools_str_append(buffer, ")"); - } /* end for (i = 0; i < nblocks; i++) */ + } /* end for (u = 0; u < nblocks; u++) */ dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); /* Render the region datatype info and indices element end */ @@ -2222,12 +2226,16 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ /* Change the endianness and see if they're equal. */ order = H5Tget_order(tmp_type); - if (order == H5T_ORDER_LE) - H5Tset_order(str_type, H5T_ORDER_LE); - else if (order == H5T_ORDER_BE) - H5Tset_order(str_type, H5T_ORDER_BE); - - if (H5Tequal(tmp_type, str_type)) { + if(order == H5T_ORDER_LE) { + if(H5Tset_order(str_type, H5T_ORDER_LE) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); + } /* end if */ + else if(order == H5T_ORDER_BE) { + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); + } /* end if */ + + if(H5Tequal(tmp_type, str_type)) { h5tools_str_append(buffer, "H5T_C_S1;"); goto found_string_type; } @@ -2249,12 +2257,16 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ /* Change the endianness and see if they're equal. */ order = H5Tget_order(tmp_type); - if (order == H5T_ORDER_LE) - H5Tset_order(str_type, H5T_ORDER_LE); - else if (order == H5T_ORDER_BE) - H5Tset_order(str_type, H5T_ORDER_BE); - - if (H5Tequal(tmp_type, str_type)) { + if(order == H5T_ORDER_LE) { + if(H5Tset_order(str_type, H5T_ORDER_LE) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); + } /* end if */ + else if(order == H5T_ORDER_BE) { + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); + } /* end if */ + + if(H5Tequal(tmp_type, str_type)) { h5tools_str_append(buffer, "H5T_FORTRAN_S1;"); goto found_string_type; } -- cgit v0.12 From 7922ae388e429ee09242523683f01f75ae6a12f9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 13 May 2013 13:16:01 -0500 Subject: [svn-r23698] Description: Revert r23695, which breaks big-endian tests on ostrich, etc. Will investigate and submit correction later. Tested on: BE & LE Linux systems (ostrich, koala, jam, emu) --- src/H5Tconv.c | 584 +++++++++++++++++++++++++--------------------------------- 1 file changed, 254 insertions(+), 330 deletions(-) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index ce0f736..b732817 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -189,7 +189,7 @@ * to the destination. SLU - 2005/06/29 */ #define H5T_CONV_Xx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (ST)(D_MAX)) { \ + if (*(S) > (DT)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -198,7 +198,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (ST)(D_MIN)) { \ + } else if (*(S) < (DT)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -211,16 +211,16 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Xx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (ST)(D_MAX)) { \ + if (*(S) > (DT)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ - } else if (*(S) < (ST)(D_MIN)) { \ + } else if (*(S) < (DT)(D_MIN)) { \ *(D) = (DT)(D_MIN); \ } else \ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ux_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (ST)(D_MAX)) { \ + if (*(S) > (DT)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -233,7 +233,7 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ux_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (ST)(D_MAX)) { \ + if (*(S) > (DT)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ } else \ *(D) = (DT)(*(S)); \ @@ -241,7 +241,7 @@ #define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_sU_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -266,7 +266,7 @@ #define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -283,7 +283,7 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_uS_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (sizeof(ST)==sizeof(DT) && *(S) > (DT)(D_MAX)) { \ + if (sizeof(ST)==sizeof(DT) && *(S) > (D_MAX)) { \ *(D) = (D_MAX); \ } else \ *(D) = (DT)(*(S)); \ @@ -291,17 +291,17 @@ #define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -314,7 +314,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) { \ + } else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -329,7 +329,7 @@ #define H5T_CONV_Su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) < 0) \ *(D) = 0; \ - else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) \ + else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) \ *(D) = (DT)(D_MAX); \ else \ *(D) = (DT)(*(S)); \ @@ -337,17 +337,17 @@ #define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -374,12 +374,12 @@ #define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ - if (*(S) > (ST)(D_MAX)) { \ + if (*(S) > (DT)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -393,7 +393,7 @@ } #define H5T_CONV_us_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ - if(*(S) > (ST)(D_MAX)) \ + if(*(S) > (DT)(D_MAX)) \ *(D) = (DT)(D_MAX); \ else \ *(D) = (DT)(*(S)); \ @@ -401,19 +401,19 @@ #define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } /* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN * when an overflow occurs, use the 'float' infinity values. */ #define H5T_CONV_Ff_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (ST)(D_MAX)) { \ + if(*(S) > (DT)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -422,7 +422,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (ST)(D_MIN)) { \ + } else if (*(S) < (DT)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -435,9 +435,9 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ff_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (ST)(D_MAX)) \ + if(*(S) > (DT)(D_MAX)) \ *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \ - else if (*(S) < (ST)(D_MIN)) \ + else if (*(S) < (DT)(D_MIN)) \ *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \ else \ *(D) = (DT)(*(S)); \ @@ -445,7 +445,7 @@ #define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_HI_LO_BIT_SET(TYP, V, LO, HI) { \ @@ -455,8 +455,8 @@ \ count = 0; \ for(u = 0; u < sizeof(TYP); u++) { \ - count = (((unsigned)sizeof(TYP) - 1) - u) * 8; \ - p = (unsigned char)((V) >> count); \ + count = ((sizeof(TYP) - 1) - u) * 8; \ + p = ((V) >> count) & 0xff; \ if(p > 0) { \ if(p & 0x80) \ count += 7; \ @@ -480,7 +480,7 @@ \ count = 0; \ for(u = 0; u < sizeof(TYP); u++) { \ - p = (unsigned char)((V) >> (u * 8)); \ + p = ((V) >> (u * 8)) & 0xff; \ if(p > 0) { \ count = u * 8; \ \ @@ -536,7 +536,7 @@ } #define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ + H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } /* Quincey added the condition branch (else if (*(S) != (ST)((DT)(*(S))))). @@ -544,11 +544,11 @@ * of "INT_MAX". Compilers do roundup making this value "INT_MAX+1". This branch * is to check that situation and return exception for some compilers, mainly GCC. * The branch if (*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) == - * (ST)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under + * (DT)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under * the same situation the "int" doesn't overflow. SLU - 2005/9/12 */ #define H5T_CONV_Fx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \ + if(*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) == (DT)(D_MAX))) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -557,7 +557,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (ST)(D_MIN)) { \ + } else if (*(S) < (DT)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -580,31 +580,28 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Fx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (ST)(D_MAX)) \ + if(*(S) > (DT)(D_MAX)) \ *(D) = (DT)(D_MAX); \ - else if(*(S) < (ST)(D_MIN)) \ + else if(*(S) < (DT)(D_MIN)) \ *(D) = (DT)(D_MIN); \ else \ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ + H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } /* Since all "no exception" cores do the same thing (assign the value in the * source location to the destination location, using casting), use one "core" * to do them all. */ -#ifndef H5_WANT_DCONV_EXCEPTION #define H5T_CONV_NO_EXCEPT_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ *(D) = (DT)(*(S)); \ } -#endif /* H5_WANT_DCONV_EXCEPTION */ - /* The main part of every integer hardware conversion macro */ -#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,PREC) \ +#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) \ { \ herr_t ret_value=SUCCEED; /* Return value */ \ \ @@ -612,11 +609,13 @@ \ { \ size_t elmtno; /*element number */ \ - H5T_CONV_DECL_PREC(PREC) /*declare precision variables, or not */ \ + size_t sprec; /*source precision */ \ + size_t dprec; /*destination precision */ \ uint8_t *src_buf; /*'raw' source buffer */ \ uint8_t *dst_buf; /*'raw' destination buffer */ \ ST *src, *s; /*source buffer */ \ DT *dst, *d; /*destination buffer */ \ + H5T_class_t tclass; /*datatype's class */ \ H5T_t *st, *dt; /*datatype descriptors */ \ ST src_aligned; /*source aligned type */ \ DT dst_aligned; /*destination aligned type */ \ @@ -648,8 +647,8 @@ case H5T_CONV_CONV: \ /* Initialize source & destination strides */ \ if (buf_stride) { \ - HDassert(buf_stride >= sizeof(ST)); \ - HDassert(buf_stride >= sizeof(DT)); \ + assert(buf_stride>=sizeof(ST)); \ + assert(buf_stride>=sizeof(DT)); \ s_stride = d_stride = (ssize_t)buf_stride; \ } else { \ s_stride = sizeof(ST); \ @@ -660,11 +659,11 @@ s_mv = H5T_NATIVE_##STYPE##_ALIGN_g>1 && \ ((size_t)buf%H5T_NATIVE_##STYPE##_ALIGN_g || \ /* Cray */ ((size_t)((ST*)buf)!=(size_t)buf) || \ - (size_t)s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \ + s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \ d_mv = H5T_NATIVE_##DTYPE##_ALIGN_g>1 && \ ((size_t)buf%H5T_NATIVE_##DTYPE##_ALIGN_g || \ /* Cray */ ((size_t)((DT*)buf)!=(size_t)buf) || \ - (size_t)d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \ + d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \ CI_INC_SRC(s_mv) \ CI_INC_DST(d_mv) \ \ @@ -680,7 +679,19 @@ if(NULL == (st = (H5T_t *)H5I_object(src_id)) || NULL == (dt = (H5T_t *)H5I_object(dst_id))) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to dereference datatype object ID") \ \ - H5T_CONV_SET_PREC(PREC) /*init precision variables, or not */ \ + /* Get source & destination precisions into a variable */ \ + tclass = st->shared->type; \ + HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + if(tclass == H5T_INTEGER) \ + sprec = st->shared->u.atomic.prec; \ + else \ + sprec = 1 + st->shared->u.atomic.u.f.msize; \ + tclass = dt->shared->type; \ + HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + if(tclass == H5T_INTEGER) \ + dprec = dt->shared->u.atomic.prec; \ + else \ + dprec = 1 + dt->shared->u.atomic.u.f.msize; \ \ /* The outer loop of the type conversion macro, controlling which */ \ /* direction the buffer is walked */ \ @@ -690,21 +701,21 @@ /* Compute the number of "safe" destination elements at */ \ /* the end of the buffer (Those which don't overlap with */ \ /* any source elements at the beginning of the buffer) */ \ - safe = nelmts - (((nelmts * (size_t)s_stride) + (size_t)(d_stride - 1)) / (size_t)d_stride); \ + safe=nelmts-(((nelmts*s_stride)+(d_stride-1))/d_stride); \ \ /* If we're down to the last few elements, just wrap up */ \ /* with a "real" reverse copy */ \ if(safe<2) { \ - src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride); \ - dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride); \ + src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-1)*s_stride); \ + dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-1)*d_stride); \ s_stride = -s_stride; \ d_stride = -d_stride; \ \ safe=nelmts; \ } /* end if */ \ else { \ - src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride); \ - dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride); \ + src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-safe)*s_stride); \ + dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-safe)*d_stride); \ } /* end else */ \ } /* end if */ \ else { \ @@ -746,36 +757,6 @@ done: \ FUNC_LEAVE_NOAPI(ret_value) \ } -/* Declare the source & destination precision variables */ -#define H5T_CONV_DECL_PREC(PREC) H5_GLUE(H5T_CONV_DECL_PREC_, PREC) - -#define H5T_CONV_DECL_PREC_Y \ - size_t sprec; /*source precision */ \ - size_t dprec; /*destination precision */ \ - H5T_class_t tclass; /*datatype's class */ - -#define H5T_CONV_DECL_PREC_N /*no precision variables */ - -/* Initialize the source & destination precision variables */ -#define H5T_CONV_SET_PREC(PREC) H5_GLUE(H5T_CONV_SET_PREC_, PREC) - -#define H5T_CONV_SET_PREC_Y \ - /* Get source & destination precisions into a variable */ \ - tclass = st->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ - if(tclass == H5T_INTEGER) \ - sprec = st->shared->u.atomic.prec; \ - else \ - sprec = 1 + st->shared->u.atomic.u.f.msize; \ - tclass = dt->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ - if(tclass == H5T_INTEGER) \ - dprec = dt->shared->u.atomic.prec; \ - else \ - dprec = 1 + dt->shared->u.atomic.u.f.msize; - -#define H5T_CONV_SET_PREC_N /*don't init precision variables */ - /* Macro defining action on source data which needs to be aligned (before main action) */ #define H5T_CONV_LOOP_PRE_SALIGN(ST) { \ HDmemcpy(&src_aligned, src, sizeof(ST)); \ @@ -922,7 +903,7 @@ typedef struct H5T_conv_struct_t { /* Conversion data for H5T__conv_enum() */ typedef struct H5T_enum_struct_t { int base; /*lowest `in' value */ - unsigned length; /*num elements in arrays */ + int length; /*num elements in arrays */ int *src2dst; /*map from src to dst index */ } H5T_enum_struct_t; @@ -1104,15 +1085,6 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") break; - case H5T_NO_CLASS: - case H5T_TIME: - case H5T_STRING: - case H5T_OPAQUE: - case H5T_COMPOUND: - case H5T_ENUM: - case H5T_VLEN: - case H5T_ARRAY: - case H5T_NCLASSES: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") } @@ -1430,9 +1402,6 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, H5_SWAP_BYTES(buf, 7, 8); } /* end for */ break; - - default: - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "invalid conversion size") } /* end switch */ break; @@ -1518,16 +1487,6 @@ H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ break; - case H5T_NO_CLASS: - case H5T_TIME: - case H5T_STRING: - case H5T_OPAQUE: - case H5T_COMPOUND: - case H5T_REFERENCE: - case H5T_ENUM: - case H5T_VLEN: - case H5T_ARRAY: - case H5T_NCLASSES: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") } /* end switch */ @@ -1584,7 +1543,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */ - ssize_t direction; /*direction of traversal */ + int direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t olap; /*num overlapping elements */ size_t half_size; /*1/2 of total size for swapping*/ @@ -1661,9 +1620,6 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_rev = (uint8_t *)H5MM_calloc(src->shared->size); /* The conversion loop */ - H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); - H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); - H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); for(elmtno = 0; elmtno < nelmts; elmtno++) { /* @@ -1747,9 +1703,6 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, TRUE); break; - case H5T_PAD_ERROR: - case H5T_PAD_BACKGROUND: - case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported LSB padding") } /* end switch */ @@ -1762,10 +1715,6 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_PAD_ONE: H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, TRUE); break; - - case H5T_PAD_ERROR: - case H5T_PAD_BACKGROUND: - case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported MSB padding") } /* end switch */ @@ -1790,12 +1739,12 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(d == dbuf) HDmemcpy(dp, d, dst->shared->size); if(buf_stride) { - sp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ - dp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ + sp += direction * buf_stride; + dp += direction * buf_stride; } /* end if */ else { - sp += direction * (ssize_t)src->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ - dp += direction * (ssize_t)dst->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ + sp += direction * src->shared->size; + dp += direction * dst->shared->size; } /* end else */ } /* end for */ @@ -2113,6 +2062,20 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata) * Programmer: Robb Matzke * Thursday, January 22, 1998 * + * Modifications: + * Robb Matzke, 1999-06-16 + * Added support for non-zero strides. If BUF_STRIDE is + * non-zero then convert one value at each memory location + * advancing BUF_STRIDE bytes each time; otherwise assume + * both source and destination values are packed. + * + * Robb Matzke, 2000-05-17 + * Added the BKG_STRIDE argument to fix a design bug. If + * BUF_STRIDE and BKG_STRIDE are both non-zero then each + * data element converted will be placed temporarily at a + * multiple of BKG_STRIDE in the BKG buffer; otherwise the + * BKG buffer is assumed to be a packed array of destination + * datatype. *------------------------------------------------------------------------- */ herr_t @@ -2128,8 +2091,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */ size_t offset; /*byte offset wrt struct */ - ssize_t src_delta; /*source stride */ - ssize_t bkg_delta; /*background stride */ + size_t src_delta; /*source stride */ size_t elmtno; unsigned u; /*counters */ int i; /*counters */ @@ -2187,22 +2149,17 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Direction of conversion and striding through background. */ if(buf_stride) { - H5_ASSIGN_OVERFLOW(src_delta, buf_stride, size_t, ssize_t); - if(!bkg_stride) { - H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); - } /* end if */ - else - H5_ASSIGN_OVERFLOW(bkg_delta, bkg_stride, size_t, ssize_t); + src_delta = buf_stride; + if(!bkg_stride) + bkg_stride = dst->shared->size; } /* end if */ else if(dst->shared->size <= src->shared->size) { - H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); - H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); + src_delta = src->shared->size; + bkg_stride = dst->shared->size; } /* end else-if */ else { - H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); - src_delta = -(ssize_t)src->shared->size; - H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); - bkg_delta = -(ssize_t)dst->shared->size; + src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/ + bkg_stride = -(int)dst->shared->size; /*overflow shouldn't be possible*/ xbuf += (nelmts - 1) * src->shared->size; xbkg += (nelmts - 1) * dst->shared->size; } /* end else */ @@ -2247,8 +2204,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * yet). Then copy the member to the destination offset in the * background buffer. */ - H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); - for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; /*subsetting*/ src_memb = src->shared->u.compnd.memb + i; @@ -2273,12 +2229,12 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Update pointers */ xbuf += src_delta; - xbkg += bkg_delta; + xbkg += bkg_stride; } /* end for */ - /* If the bkg_delta was set to -(dst->shared->size), make it positive now */ + /* If the bkg_stride was set to -(dst->shared->size), make it positive now */ if(buf_stride == 0 && dst->shared->size > src->shared->size) - H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); + bkg_stride = dst->shared->size; /* * Copy the background buffer back into the in-place conversion @@ -2287,7 +2243,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, for(xbuf = buf, xbkg = bkg, elmtno = 0; elmtno < nelmts; elmtno++) { HDmemmove(xbuf, xbkg, dst->shared->size); xbuf += buf_stride ? buf_stride : dst->shared->size; - xbkg += bkg_delta; + xbkg += bkg_stride; } /* end for */ break; @@ -2434,8 +2390,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, if(dst_memb->size > src_memb->size) offset += src_memb->size; } /* end for */ - H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); - for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; @@ -2554,8 +2509,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * is larger than the source) and them to their final position in the * bkg buffer. */ - H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); - for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; @@ -2651,7 +2605,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) j++; if(j >= dst->shared->u.enumer.nmembs) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source type is not a subset of destination type") - priv->src2dst[i] = (int)j; + priv->src2dst[i] = j; } /* end for */ /* @@ -2680,44 +2634,45 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * Because this is the optimized code, we won't fix it. It should still work in some * situations. SLU - 2011/5/24) */ - if(1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) { - for(i = 0; i < src->shared->u.enumer.nmembs; i++) { - if(1 == src->shared->size) - n = *((signed char *)(src->shared->u.enumer.value + i)); - else if (sizeof(short) == src->shared->size) - n = *((short *)(src->shared->u.enumer.value + i * src->shared->size)); - else - n = *((int *)(src->shared->u.enumer.value + i * src->shared->size)); - if(0 == i) { + if (1==src->shared->size || sizeof(short)==src->shared->size || sizeof(int)==src->shared->size) { + for (i=0; ishared->u.enumer.nmembs; i++) { + if (1==src->shared->size) { + n = *((signed char*)(src->shared->u.enumer.value+i)); + } else if (sizeof(short)==src->shared->size) { + n = *((short*)(src->shared->u.enumer.value+i*src->shared->size)); + } else { + n = *((int*)(src->shared->u.enumer.value+i*src->shared->size)); + } + if (0==i) { domain[0] = domain[1] = n; } else { domain[0] = MIN(domain[0], n); domain[1] = MAX(domain[1], n); } - } /* end for */ + } - HDassert(domain[1] >= domain[0]); - length = (unsigned)(domain[1] - domain[0]) + 1; - if(src->shared->u.enumer.nmembs < 2 || - (double)length / src->shared->u.enumer.nmembs < (double)(1.2f)) { + length = (domain[1]-domain[0])+1; + if (src->shared->u.enumer.nmembs<2 || + (double)length/src->shared->u.enumer.nmembs<1.2) { priv->base = domain[0]; priv->length = length; - if(NULL == (map = (int *)H5MM_malloc(length * sizeof(int)))) + if (NULL==(map=(int *)H5MM_malloc(length*sizeof(int)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - for(i = 0; i < length; i++) + for (i=0; ishared->u.enumer.nmembs; i++) { - if(1 == src->shared->size) - n = *((signed char *)(src->shared->u.enumer.value + i)); - else if(sizeof(short) == src->shared->size) - n = *((short *)(src->shared->u.enumer.value + i * src->shared->size)); - else - n = *((int *)(src->shared->u.enumer.value + i * src->shared->size)); + for (i=0; ishared->u.enumer.nmembs; i++) { + if (1==src->shared->size) { + n = *((signed char*)(src->shared->u.enumer.value+i)); + } else if (sizeof(short)==src->shared->size) { + n = *((short*)(src->shared->u.enumer.value+i*src->shared->size)); + } else { + n = *((int*)(src->shared->u.enumer.value+i*src->shared->size)); + } n -= priv->base; - HDassert(n >= 0 && (unsigned)n < priv->length); - HDassert(map[n] < 0); + assert(n>=0 && nlength); + assert(map[n]<0); map[n] = priv->src2dst[i]; - } /* end for */ + } /* * Replace original src2dst array with our new one. The original @@ -2763,8 +2718,9 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */ + H5T_t *src_super = NULL, *dst_super = NULL; /*parent types for src and dst*/ uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */ - ssize_t src_delta, dst_delta; /*conversion strides */ + int src_delta, dst_delta; /*conversion strides */ int n; /*src value cast as native int */ H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv); H5P_genplist_t *plist; /*property list pointer */ @@ -2829,20 +2785,17 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Direction of conversion. */ if(buf_stride) { - H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); - src_delta = dst_delta = (ssize_t)buf_stride; + src_delta = dst_delta = (int)buf_stride; s = d = buf; } else if(dst->shared->size <= src->shared->size) { - H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); - H5_ASSIGN_OVERFLOW(dst_delta, dst->shared->size, size_t, ssize_t); + src_delta = (int)src->shared->size; /*overflow shouldn't be possible*/ + dst_delta = (int)dst->shared->size; /*overflow shouldn't be possible*/ s = d = buf; } else { - H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); - H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); - src_delta = -(ssize_t)src->shared->size; - dst_delta = -(ssize_t)dst->shared->size; - s = buf + (nelmts - 1) * src->shared->size; - d = buf + (nelmts - 1) * dst->shared->size; + src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/ + dst_delta = -(int)dst->shared->size; /*overflow shouldn't be possible*/ + s = buf + (nelmts-1) * src->shared->size; + d = buf + (nelmts-1) * dst->shared->size; } /* Get the plist structure */ @@ -2869,29 +2822,28 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, else n = *((int*)s); n -= priv->base; - if(n < 0 || (unsigned)n >= priv->length || priv->src2dst[n] < 0) { + if(n < 0 || n >= priv->length || priv->src2dst[n] < 0) { /*overflow*/ except_ret = H5T_CONV_UNHANDLED; - /*If user's exception handler is present, use it*/ - if(cb_struct.func) + if(cb_struct.func) { /*If user's exception handler is present, use it*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, s, d, cb_struct.user_data); + } - if(except_ret == H5T_CONV_UNHANDLED) + if(except_ret == H5T_CONV_UNHANDLED) { HDmemset(d, 0xff, dst->shared->size); - else if(except_ret == H5T_CONV_ABORT) + } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - } else + } else { HDmemcpy(d, - dst->shared->u.enumer.value + (unsigned)priv->src2dst[n] * dst->shared->size, + dst->shared->u.enumer.value+priv->src2dst[n]*dst->shared->size, dst->shared->size); - } /* end if */ - else { + } + } else { /* Use O(log N) lookup */ - unsigned lt = 0; - unsigned rt = src->shared->u.enumer.nmembs; - unsigned md; - int cmp; + int lt = 0; + int rt = src->shared->u.enumer.nmembs; + int md, cmp; while(lt < rt) { md = (lt + rt) / 2; @@ -2906,22 +2858,22 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end while */ if(lt >= rt) { except_ret = H5T_CONV_UNHANDLED; - /*If user's exception handler is present, use it*/ - if(cb_struct.func) + if(cb_struct.func) { /*If user's exception handler is present, use it*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src, d, cb_struct.user_data); + } - if(except_ret == H5T_CONV_UNHANDLED) + if(except_ret == H5T_CONV_UNHANDLED) { HDmemset(d, 0xff, dst->shared->size); - else if(except_ret == H5T_CONV_ABORT) + } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") } /* end if */ - else - HDassert(priv->src2dst[md] >= 0); + else { HDmemcpy(d, - dst->shared->u.enumer.value + (unsigned)priv->src2dst[md] * dst->shared->size, + dst->shared->u.enumer.value+priv->src2dst[md]*dst->shared->size, dst->shared->size); - } /* end else */ + } /* end else */ + } } break; @@ -2954,7 +2906,7 @@ done: */ herr_t H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t UNUSED buf_stride, size_t UNUSED bkg_stride, void *_buf, + size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { H5T_t *src, *dst; /*src and dst datatypes */ @@ -3065,7 +3017,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_path_t *tpath = NULL; /* Type conversion path */ hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */ hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */ - htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ + hbool_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */ H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ @@ -3076,6 +3028,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, ssize_t s_stride, d_stride; /*src and dst strides */ ssize_t b_stride; /*bkg stride */ size_t safe; /*how many elements are safe to process in each pass */ + ssize_t seq_len; /*the number of elements in the current sequence*/ size_t bg_seq_len = 0; size_t src_base_size, dst_base_size;/*source & destination base size*/ void *conv_buf = NULL; /*temporary conversion buffer */ @@ -3163,13 +3116,12 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, noop_conv = TRUE; /* Check if we need a temporary buffer for this conversion */ - if((parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_SYSTEM, FAIL, "internal error when detecting variable-length class") + parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE); if(tpath->cdata.need_bkg || parent_is_vlen) { /* Set up initial background buffer */ tmp_buf_size = MAX(src_base_size, dst_base_size); if(NULL == (tmp_buf = H5FL_BLK_CALLOC(vlen_seq,tmp_buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for type conversion") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") } /* end if */ /* Get the allocation info */ @@ -3189,22 +3141,17 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, while(nelmts > 0) { /* Check if we need to go backwards through the buffer */ if(d_stride > s_stride) { - /* Sanity check */ - HDassert(s_stride > 0); - HDassert(d_stride > 0); - HDassert(b_stride >= 0); - /* Compute the number of "safe" destination elements at */ /* the end of the buffer (Those which don't overlap with */ /* any source elements at the beginning of the buffer) */ - safe = nelmts - (((nelmts * (size_t)s_stride) + ((size_t)d_stride - 1)) / (size_t)d_stride); + safe = nelmts - (((nelmts * s_stride) + (d_stride - 1)) / d_stride); /* If we're down to the last few elements, just wrap up */ /* with a "real" reverse copy */ if(safe < 2) { - s = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride; - d = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride; - b = (uint8_t *)bkg + (nelmts - 1) * (size_t)b_stride; + s = (uint8_t *)buf + (nelmts - 1) * s_stride; + d = (uint8_t *)buf + (nelmts - 1) * d_stride; + b = (uint8_t *)bkg + (nelmts - 1) * b_stride; s_stride = -s_stride; d_stride = -d_stride; b_stride = -b_stride; @@ -3212,9 +3159,9 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, safe = nelmts; } /* end if */ else { - s = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride; - d = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride; - b = (uint8_t *)bkg + (nelmts - safe) * (size_t)b_stride; + s = (uint8_t *)buf + (nelmts - safe) * s_stride; + d = (uint8_t *)buf + (nelmts - safe) * d_stride; + b = (uint8_t *)bkg + (nelmts - safe) * b_stride; } /* end else */ } /* end if */ else { @@ -3232,13 +3179,9 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't set VL data to 'nil'") } /* end if */ else { - ssize_t sseq_len; /* (signed) The number of elements in the current sequence*/ - size_t seq_len; /* The number of elements in the current sequence*/ - /* Get length of element sequences */ - if((sseq_len = (*(src->shared->u.vlen.getlen))(s)) < 0) + if((seq_len = (*(src->shared->u.vlen.getlen))(s)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "incorrect length") - seq_len = (size_t)sseq_len; /* If we are reading from memory and there is no conversion, just get the pointer to sequence */ if(write_to_file && noop_conv) { @@ -3287,7 +3230,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* If we are writing and there is a nested VL type, read * the sequence into the background buffer */ if(nested) { - const uint8_t *tmp = b; + uint8_t *tmp = b; UINT32DECODE(tmp, bg_seq_len); if(bg_seq_len > 0) { @@ -3297,40 +3240,40 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") HDmemset(tmp_buf, 0, tmp_buf_size); } /* end if */ - H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(bg_hobjid.addr)); - UINT32DECODE(tmp, bg_hobjid.idx); + H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp, &(bg_hobjid.addr)); + INT32DECODE(tmp, bg_hobjid.idx); if(NULL == H5HG_read(dst->shared->u.vlen.f, dxpl_id, &bg_hobjid, tmp_buf, NULL)) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "can't read VL sequence into background buffer") } /* end if */ /* If the sequence gets shorter, pad out the original sequence with zeros */ - if(bg_seq_len < seq_len) + if((ssize_t)bg_seq_len < seq_len) HDmemset((uint8_t *)tmp_buf + dst_base_size * bg_seq_len, 0, (seq_len - bg_seq_len) * dst_base_size); } /* end if */ /* Convert VL sequence */ - if(H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) + if(H5T_convert(tpath, tsrc_id, tdst_id, (size_t)seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ /* Write sequence to destination location */ - if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, seq_len, dst_base_size) < 0) + if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, (size_t)seq_len, dst_base_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't write VL data") if(!noop_conv) { /* For nested VL case, free leftover heap objects from the deeper level if the length of new data elements is shorter than the old data elements.*/ - if(nested && seq_len < bg_seq_len) { + if(nested && seq_len < (ssize_t)bg_seq_len) { size_t parent_seq_len; - const uint8_t *tmp; + uint8_t *tmp_p; size_t u; /* TMP_P is reset each time in the loop because DST_BASE_SIZE may include some data in addition to VL info. - SLU */ for(u = seq_len; u < bg_seq_len; u++) { - tmp = (uint8_t *)tmp_buf + u * dst_base_size; - UINT32DECODE(tmp, parent_seq_len); + tmp_p = (uint8_t*)tmp_buf + u * dst_base_size; + UINT32DECODE(tmp_p, parent_seq_len); if(parent_seq_len > 0) { - H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(parent_hobjid.addr)); - UINT32DECODE(tmp, parent_hobjid.idx); + H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp_p, &(parent_hobjid.addr)); + INT32DECODE(tmp_p, parent_hobjid.idx); if(H5HG_remove(dst->shared->u.vlen.f, dxpl_id, &parent_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") } /* end if */ @@ -3400,7 +3343,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ uint8_t *sp, *dp; /*source and dest traversal ptrs */ - ssize_t src_delta, dst_delta; /*source & destination stride */ + size_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number counter */ unsigned u; /* local index variable */ @@ -3465,11 +3408,8 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Direction & size of buffer traversal. */ - H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); - H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); - H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); - src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); - dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); + src_delta = direction * (buf_stride ? buf_stride : src->shared->size); + dst_delta = direction * (buf_stride ? buf_stride : dst->shared->size); /* Set up conversion path for base elements */ if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) { @@ -3559,7 +3499,6 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ - ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t half_size; /*half the type size */ @@ -3624,15 +3563,6 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } - /* - * Direction & size of buffer traversal. - */ - H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); - H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); - H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); - src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); - dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); - /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") @@ -3645,18 +3575,18 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_rev = (uint8_t*)H5MM_calloc(src->shared->size); /* The conversion loop */ - for(elmtno = 0; elmtno < nelmts; elmtno++) { + for (elmtno=0; elmtno 0) { + if (direction>0) { s = sp; - d = elmtno < olap ? dbuf : dp; + d = elmtno= nelmts ? dbuf : dp; + d = elmtno+olap >= nelmts ? dbuf : dp; } #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ @@ -3914,13 +3844,16 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * If we had used a temporary buffer for the destination then we * should copy the value to the true destination buffer. */ - if(d==dbuf) - HDmemcpy(dp, d, dst->shared->size); - - /* Advance source & destination pointers by delta amounts */ - sp += src_delta; - dp += dst_delta; - } /* end for */ + if (d==dbuf) + HDmemcpy (dp, d, dst->shared->size); + if (buf_stride) { + sp += direction * buf_stride; + dp += direction * buf_stride; + } else { + sp += direction * src->shared->size; + dp += direction * dst->shared->size; + } + } break; @@ -3976,7 +3909,6 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_t *dst_p; /*destination datatype */ H5T_atomic_t src; /*atomic source info */ H5T_atomic_t dst; /*atomic destination info */ - ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*forward or backward traversal */ size_t elmtno; /*element number */ size_t half_size; /*half the type size */ @@ -3989,11 +3921,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ /* Conversion-related variables */ - int64_t expo; /*exponent */ + hssize_t expo; /*exponent */ hssize_t expo_max; /*maximum possible dst exponent */ size_t msize = 0; /*useful size of mantissa in src*/ size_t mpos; /*offset to useful mant is src */ - uint64_t sign; /*source sign bit value */ + hssize_t sign; /*source sign bit value */ size_t mrsh; /*amount to right shift mantissa*/ hbool_t carry = 0; /*carry after rounding mantissa */ size_t i; /*miscellaneous counters */ @@ -4059,15 +3991,6 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } - /* - * Direction & size of buffer traversal. - */ - H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); - H5_CHECK_OVERFLOW(src_p->shared->size, size_t, ssize_t); - H5_CHECK_OVERFLOW(dst_p->shared->size, size_t, ssize_t); - src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src_p->shared->size); - dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst_p->shared->size); - /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") @@ -4219,7 +4142,9 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; -#ifndef H5_VMS /*Temporary solution to handle VAX special values*/ +#ifdef H5_VMS + } /*Temporary solution to handle VAX special values*/ +#else /*H5_VMS*/ } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* NaN */ @@ -4244,15 +4169,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; -#endif /*H5_VMS*/ } +#endif /*H5_VMS*/ /* * Get the exponent as an unsigned quantity from the section of * the source bit field where it's located. Don't worry about * the exponent bias yet. */ - expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); + expo = H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); if(expo==0) denormalized=TRUE; @@ -4264,9 +4189,10 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, implied = 1; mpos = src.u.f.mpos; mrsh = 0; - if(0 == expo || H5T_NORM_NONE == src.u.f.norm) { - if((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) { - msize = (size_t)bitno; + if (0==expo || H5T_NORM_NONE==src.u.f.norm) { + if ((bitno=H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, + H5T_BIT_MSB, TRUE))>0) { + msize = bitno; } else if (0==bitno) { msize = 1; H5T__bit_set(s, src.u.f.mpos, (size_t)1, FALSE); @@ -4274,7 +4200,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (H5T_NORM_IMPLIED==src.u.f.norm) { msize = src.u.f.msize; } else { - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") + assert("normalization method not implemented yet" && 0); + HDabort(); } /* @@ -4288,12 +4215,13 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * the source exponent bias. */ if (0==expo || H5T_NORM_NONE==src.u.f.norm) { - HDassert(bitno>=0); - expo -= (int64_t)((src.u.f.ebias - 1) + (src.u.f.msize - (size_t)bitno)); + assert(bitno>=0); + expo -= (src.u.f.ebias-1) + (src.u.f.msize-bitno); } else if (H5T_NORM_IMPLIED==src.u.f.norm) { - expo -= (int64_t)src.u.f.ebias; + expo -= src.u.f.ebias; } else { - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") + assert("normalization method not implemented yet" && 0); + HDabort(); } /* @@ -4308,7 +4236,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * bias and clipping by the minimum and maximum possible * destination exponent values. */ - expo += (int64_t)dst.u.f.ebias; + expo += dst.u.f.ebias; if (expo < -(hssize_t)(dst.u.f.msize)) { /* The exponent is way too small. Result is zero. */ @@ -4322,7 +4250,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * accomodate that value. The mantissa of course is no * longer normalized. */ - mrsh += (size_t)(1 - expo); + H5_ASSIGN_OVERFLOW(mrsh,(mrsh+1-expo),hssize_t,size_t); expo = 0; denormalized=TRUE; } else if (expo>=expo_max) { @@ -4361,20 +4289,20 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * mantissa bit is `1', else it is `10' binary. */ if (msize>0 && mrsh<=dst.u.f.msize && mrsh+msize>dst.u.f.msize) { - bitno = (ssize_t)(mrsh + msize - dst.u.f.msize); - HDassert(bitno >= 0 && (size_t)bitno <= msize); - /* If the 1st bit being cut off is set and source isn't denormalized.*/ - if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && !denormalized) { - /* Don't do rounding if exponent is 111...110 and mantissa is 111...11. - * To do rounding and increment exponent in this case will create an infinity value.*/ - if((H5T__bit_find(s, mpos + (size_t)bitno, msize - (size_t)bitno, H5T_BIT_LSB, FALSE) >= 0 || expo < expo_max - 1)) { - carry = (hbool_t)H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); - if(carry) + bitno = (ssize_t)(mrsh+msize - dst.u.f.msize); + assert(bitno>=0 && (size_t)bitno<=msize); + /*If the 1st bit being cut off is set and source isn't denormalized.*/ + if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && !denormalized) { + /*Don't do rounding if exponent is 111...110 and mantissa is 111...11. + *To do rounding and increment exponent in this case will create an infinity value.*/ + if((H5T__bit_find(s, mpos+bitno, msize-bitno, H5T_BIT_LSB, FALSE)>=0 || exposhared->size); - - /* Advance source & destination pointers by delta amounts */ - sp += src_delta; - dp += dst_delta; + if (d==dbuf) + HDmemcpy (dp, d, dst_p->shared->size); + if (buf_stride) { + sp += direction * buf_stride; + dp += direction * buf_stride; + } else { + sp += direction * src_p->shared->size; + dp += direction * dst_p->shared->size; + } } break; @@ -4543,8 +4474,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_t *src=NULL; /*source datatype */ H5T_t *dst=NULL; /*destination datatype */ - ssize_t src_delta, dst_delta; /*source & destination stride */ - int direction; /*direction of traversal */ + int direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t olap; /*num overlapping elements */ size_t nchars=0; /*number of characters copied */ @@ -4569,8 +4499,8 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset) || (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") - if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NSTR || - dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NSTR) + if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NPAD || + dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NPAD) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character padding") cdata->need_bkg = H5T_BKG_NO; break; @@ -4611,15 +4541,6 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } - /* - * Direction & size of buffer traversal. - */ - H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); - H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); - H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); - src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); - dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); - /* Allocate the overlap buffer */ if(NULL == (dbuf = (uint8_t *)H5MM_malloc(dst->shared->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for string conversion") @@ -4692,7 +4613,6 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: case H5T_STR_ERROR: - default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source string padding method not supported") } /* end switch */ @@ -4728,7 +4648,6 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: case H5T_STR_ERROR: - default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "destination string padding method not supported") } /* end switch */ @@ -4736,12 +4655,15 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * If we used a temporary buffer for the destination then we * should copy the value to the true destination buffer. */ - if(d == dbuf) + if (d==dbuf) HDmemcpy(dp, d, dst->shared->size); - - /* Advance source & destination pointers by delta amounts */ - sp += src_delta; - dp += dst_delta; + if (buf_stride) { + sp += direction * buf_stride; + dp += direction * buf_stride; + } else { + sp += direction * src->shared->size; + dp += direction * dst->shared->size; + } } /* end for */ break; @@ -9122,7 +9044,8 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (H5T_NORM_IMPLIED==src.u.f.norm) { expo -= src.u.f.ebias; } else { - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") + assert("normalization method not implemented yet" && 0); + HDabort(); } /* @@ -9625,7 +9548,8 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (H5T_NORM_NONE==dst.u.f.norm || H5T_NORM_IMPLIED==dst.u.f.norm) { expo = first + dst.u.f.ebias; } else { - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") + assert("normalization method not implemented yet" && 0); + HDabort(); } /* Handle mantissa part here */ @@ -9705,7 +9629,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Check if the exponent is too big */ - expo_max = (hsize_t)HDpow((double)2.0f, (double)dst.u.f.esize) - 1; + expo_max = (hsize_t)HDpow((double)2.0, (double)dst.u.f.esize) - 1; if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ -- cgit v0.12 From b0235a2610b4ce744153f4d16a21dc5cd88d7616 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 15 May 2013 08:38:41 -0500 Subject: [svn-r23707] Vagrind memleak: bufferes only cleaned up if there was an error. --- hl/test/test_image.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 76acef8..38f1830 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -289,6 +289,15 @@ static int test_simple(void) *------------------------------------------------------------------------- */ + if(buf1) + HDfree(buf1); + if(buf2) + HDfree(buf2); + if(buf1_out) + HDfree(buf1_out); + if(buf2_out) + HDfree(buf2_out); + /* Close the file. */ if(H5Fclose( fid ) < 0) goto out; -- cgit v0.12 From c09748b14e9d0d2a099dab8fbba6002fd5281537 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 19 May 2013 03:39:09 -0500 Subject: [svn-r23708] Snapshot version 1.9 release 151 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index bb77343..f328ecb 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.151 currently under development +HDF5 version 1.9.152 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 103da91..d86c4b7 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 141 +LT_VERS_REVISION = 142 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index ac9fc70..b6533b3 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 141 +LT_VERS_REVISION = 142 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 7520cc4..3e15760 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.151. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.152. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.151' -PACKAGE_STRING='HDF5 1.9.151' +PACKAGE_VERSION='1.9.152' +PACKAGE_STRING='HDF5 1.9.152' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1486,7 +1486,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.151 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.152 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1556,7 +1556,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.151:";; + short | recursive ) echo "Configuration of HDF5 1.9.152:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.151 +HDF5 configure 1.9.152 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.151, which was +It was created by HDF5 $as_me 1.9.152, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3678,7 +3678,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.151' + VERSION='1.9.152' cat >>confdefs.h <<_ACEOF @@ -31632,7 +31632,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.151 +HDF5 config.lt 1.9.152 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33762,7 +33762,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.151, which was +This file was extended by HDF5 $as_me 1.9.152, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33828,7 +33828,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.151 +HDF5 config.status 1.9.152 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 87e1cea..30aeb09 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.151], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.152], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index bae0cae..f47a11e 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 141 +LT_VERS_REVISION = 142 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 717e0ae..2abf918 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 141 +LT_VERS_REVISION = 142 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index ff77de7..4e00046 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 141 +LT_VERS_REVISION = 142 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 70e0bbe..c2bd053 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 141 +LT_VERS_REVISION = 142 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9961c55..ac36a02 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.151 currently under development +HDF5 version 1.9.152 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 88d8984..c30e156 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 151 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 152 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.151" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.152" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 5617634..54ddca3 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 141 +LT_VERS_REVISION = 142 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index b45125f..50ee0b3 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.151" +#define H5_PACKAGE_STRING "HDF5 1.9.152" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.151" +#define H5_PACKAGE_VERSION "1.9.152" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.151" +#define H5_VERSION "1.9.152" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 7a3f473c04684c756c5398878b8b715320af94c1 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 20 May 2013 15:48:18 -0500 Subject: [svn-r23710] I added H5Pencdec.c to make.com. I added H5_HAVE_DIRENT_H H5_HAVE_LIBDL H5_HAVE_SETJMP to h5pubconf.h. Not tested yet. --- vms/src/h5pubconf.h | 9 +++++++++ vms/src/make.com | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 50ee0b3..33d52da 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -99,6 +99,9 @@ /* Define if the direct I/O virtual file driver should be compiled */ /* #undef H5_HAVE_DIRECT */ +/* Define to 1 if you have the header file. */ +#define H5_HAVE_DIRENT_H 1 + /* Define to 1 if you have the header file. */ #define H5_HAVE_DLFCN_H 1 @@ -196,6 +199,9 @@ /* Define to 1 if you have the header file. */ /* #undef H5_HAVE_IO_H */ +/* Define to 1 if you have the `dl' library (-ldl). */ +#define H5_HAVE_LIBDL 1 + /* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ /* #undef H5_HAVE_LIBDMALLOC */ @@ -274,6 +280,9 @@ /* Define to 1 if you have the `rand_r' function. */ /* #define H5_HAVE_RAND_R 1 */ +/* Define to 1 if you have the `setjmp' function. */ +#define H5_HAVE_SETJMP 1 + /* Define to 1 if you have the header file. */ #define H5_HAVE_SETJMP_H 1 diff --git a/vms/src/make.com b/vms/src/make.com index bd1f55c..cdf0f4a 100644 --- a/vms/src/make.com +++ b/vms/src/make.com @@ -57,7 +57,7 @@ $ cobj1= "H5MFaggr, H5MF, H5MFdbg, H5MFsection, H5MM,"+- "H5O, H5Ocache, H5Ochunk, H5Ocont, H5Ocopy, H5Odbg, H5Odrvinfo, H5Odtype, H5Oefl, H5Ofill, H5Ofsinfo,"+- "H5Oginfo, H5Olayout, H5Olinfo, H5Olink, H5Omessage, H5Omtime, H5Oname, H5Onull, H5Opline,"+- "H5Orefcount, H5Osdspace, H5Oshared, H5Oshmesg, H5Ostab, H5Otest, H5Ounknown,"+- - "H5Pacpl, H5P, H5Pdapl, H5Pdcpl, H5Pdeprec, H5Pdxpl, H5Pfapl, H5Pfcpl, H5Pfmpl, H5Pgcpl, H5Pint,"+- + "H5Pacpl, H5P, H5Pdapl, H5Pdcpl, H5Pdeprec, H5Pdxpl, H5Pencdec, H5Pfapl, H5Pfcpl, H5Pfmpl, H5Pgcpl, H5Pint,"+- "H5Plapl, H5Plcpl, H5Pocpl, H5Pocpypl, H5Pstrcpl, H5Ptest,"+- "H5R, H5RC, H5Rdeprec, H5RS, H5Sall, H5S, H5Sdbg, H5Shyper, H5SL, H5SMbtree2, H5SM, H5SMcache,"+- "H5SMmessage, H5Smpio, H5SMtest, H5Snone, H5Spoint, H5Sselect, H5ST, H5Stest,"+- -- cgit v0.12 From 424a41f878b9ac91f9411dcabc1b8358c7634ea1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 21 May 2013 12:30:54 -0500 Subject: [svn-r23713] Description: Clean up warnings, switch library code to use Standard C/POSIX wrapper macros, remove internal calls to API routines, update checkapi and checkposix scripts. Tested on: Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN Big-Endian Linux/64 (ostrich) --- bin/checkapi | 66 +++-- bin/checkposix | 145 ++++++----- src/H5.c | 4 +- src/H5C.c | 10 +- src/H5CS.c | 14 +- src/H5D.c | 47 ++-- src/H5Dchunk.c | 10 +- src/H5Dint.c | 12 +- src/H5Dio.c | 7 +- src/H5Dmpio.c | 39 ++- src/H5Dpkg.h | 11 +- src/H5F.c | 21 +- src/H5FD.c | 10 +- src/H5FDcore.c | 2 +- src/H5FDdirect.c | 90 +++---- src/H5FDfamily.c | 16 +- src/H5FDint.c | 2 +- src/H5FDlog.c | 2 +- src/H5FDmpi.c | 34 ++- src/H5FDmpio.c | 52 ++-- src/H5FDmpiposix.c | 4 +- src/H5FO.c | 28 +-- src/H5Fmpi.c | 6 +- src/H5Fpkg.h | 1 - src/H5Fprivate.h | 1 + src/H5Gname.c | 14 +- src/H5HG.c | 8 +- src/H5HP.c | 134 +++++----- src/H5MM.c | 4 +- src/H5Oefl.c | 4 +- src/H5Olayout.c | 2 +- src/H5Oname.c | 14 +- src/H5Ostab.c | 16 +- src/H5PL.c | 4 +- src/H5Pdcpl.c | 21 +- src/H5Pfapl.c | 2 +- src/H5Pint.c | 2 +- src/H5Pocpl.c | 2 +- src/H5S.c | 10 +- src/H5SL.c | 42 ++-- src/H5Sall.c | 54 ++-- src/H5Sselect.c | 52 ++-- src/H5T.c | 74 +++--- src/H5Tconv.c | 627 ++++++++++++++++++++++++++--------------------- src/H5Tenum.c | 20 +- src/H5Tfields.c | 12 +- src/H5Tfixed.c | 2 +- src/H5Tnative.c | 53 ++-- src/H5Toffset.c | 12 +- src/H5Tprecis.c | 12 +- src/H5V.c | 146 +++++------ src/H5Vprivate.h | 2 +- src/H5Z.c | 235 ++++++++++++------ src/H5Zfletcher32.c | 2 +- src/H5Zprivate.h | 3 +- src/H5Zscaleoffset.c | 4 +- src/H5Zszip.c | 20 +- src/H5Ztrans.c | 68 ++--- src/H5detect.c | 98 ++++---- src/H5make_libsettings.c | 6 +- src/H5private.h | 3 + src/H5system.c | 4 +- src/H5timer.c | 10 +- src/H5trace.c | 10 +- test/links_env.c | 1 - 65 files changed, 1329 insertions(+), 1114 deletions(-) diff --git a/bin/checkapi b/bin/checkapi index d21863b..b4a08e8 100755 --- a/bin/checkapi +++ b/bin/checkapi @@ -17,33 +17,51 @@ require 5.003; # Purpose: insures that API functions aren't called internally. # Usage: checkapi H5*.c -my $comment = 0; -while (<>) { +my $filename = ""; +my $lastname = ""; - # Remove comments within the line. - s/\/\*.*?\*\///g; +if(<>) { + while (<>) { + if($ARGV =~ /\//) { + ($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/); + } else { + ($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/); + } - # Process comment begin and end tokens on this line. - $comment-- if /\*\//; # count comment ends - next if $comment; # skip line if in comment - $comment++ if /\/\*/; # count comment starts - s/(.*)\/\*.*/$1/; # remove comments that begin on this line + if($filename =~ /H5FDmulti|H5FDstdio/) { + if($filename ne $lastname) { + print "$ARGV is exempt from checking\n"; + $lastname = $filename; + } + } else { + # Get rid of comments by removing the inside part. + s|/\*.*?\*/||g; + if ($in_comment) { + if (/\*\//) { + s|.*?\*/||; + $in_comment = 0; + } else { + $_="\n"; + } + } elsif (m|/\*|) { + s|/\*.*||; + $in_comment = 1; + } - # Remove character strings - s/\\.//g; # remove escaped characters - s/\".*?\"//g; # remove string constants + # Remove character strings + s/\\.//g; # remove escaped characters + s/\".*?\"//g; # remove string constants - # Disregard the following hits - next if /^H5/; - next if /^\#/; - next if /FUNC_ENTER(_NOINIT)*/; + # Disregard the following hits + next if /^H5/; + next if /^\#/; + next if /FUNC_ENTER(_NOINIT)*/; - next unless /(H5[A-Z]{1,2}[a-z]\w*)/; - print "$ARGV:$.: $1\n"; -} continue { - if (eof) { - print "$ARGV:$.: bad comment nesting\n" if $comment; - $comment = 0; - close ARGV; # reset line number - } + next unless /(H5[A-Z]{1,2}[a-z]\w*)/; + print "$ARGV:$.: $1\n"; + } + } continue { + close ARGV if eof; # reset line number + } } + diff --git a/bin/checkposix b/bin/checkposix index b295d7d..e3617e5 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -27,60 +27,93 @@ require 5.003; # use `next-error' (usually bound to M-`) to find each name # violation. -while (<>) { - - # Get rid of comments by removing the inside part. - s|/\*.*?\*/||g; - if ($in_comment) { - if (/\*\//) { - s|.*?\*/||; - $in_comment = 0; - } else { - $_="\n"; - } - } elsif (m|/\*|) { - s|/\*.*||; - $in_comment = 1; - } - - # Get rid of string constants if they begin and end on this line. - s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g; - - # Get rid of preprocessor directives - s/^\#.*//; - - # Now find all function calls on this line - while (($name)=/\b([a-gi-z_A-GI-Z]\w*)\s*\(/) { - $_ = $'; - - # Ignore C statements that look sort of like function - # calls. - next if $name =~ /^(if|for|return|sizeof|switch|while|void)$/; - - # Ignore things that get misdetected because of the simplified - # parsing that takes place here. - next if $name =~ /^int$/; - - # These are really HDF5 functions/macros even though they don't - # start with `h' or `H'. - next if $name =~ /^FUNC_(ENTER|LEAVE)(_INIT)?$/; - next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)$/; - next if $name =~ /^(MIN3?|MAX3?|NELMTS|BOUND|CONSTR)$/; - next if $name =~ /^IS_H5FD_MPIO$/; - next if $name =~ /^addr_defined$/; - - # These functions/macros are exempt. - next if $name =~ /^(assert|main|[fs]?printf|va_(start|arg|end))$/; - - # These are MPI function calls. Ignore them. - next if $name =~ /^MPI_/; - - # These are POSIX threads function calls. Ignore them. - next if $name =~ /^pthread_/; - - print "$ARGV:$.: $name\n"; - } - -} continue { - close ARGV if eof; +if(<>) { + if($ARGV =~ /\//) { + ($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/); + } else { + ($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/); + } + + if($filename =~ /H5FDmulti|H5FDstdio/) { + print "$ARGV is exempt from using Standard library macro wrappers\n"; + } else { + while (<>) { + + # Get rid of comments by removing the inside part. + s|/\*.*?\*/||g; + if ($in_comment) { + if (/\*\//) { + s|.*?\*/||; + $in_comment = 0; + } else { + $_="\n"; + } + } elsif (m|/\*|) { + s|/\*.*||; + $in_comment = 1; + } + + # Get rid of string constants if they begin and end on this line. + s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g; + + # Get rid of preprocessor directives + s/^\#.*//; + + # Skip callbacks invoked as methods in a struct + next if $_ =~ /\b(\)?->|\.)\(?([a-z_A-Z]\w*)\s*\(/; + + # Now find all function calls on this line which don't start with 'H' + while (($name)=/\b([a-z_A-GI-Z]\w*)\s*\(/) { + $_ = $'; + + # Ignore C statements that look sort of like function + # calls. + next if $name =~ /^(if|for|offsetof|return|sizeof|switch|while|void)$/; + + # Ignore things that get misdetected because of the simplified + # parsing that takes place here. + next if $name =~ /^(int|herr_t|_term_interface)$/; + + # These are really HDF5 functions/macros even though they don't + # start with `h' or `H'. + next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NOFS|_NOCLEAR|_NOINIT)?(_NOFUNC|_TAG)?$/; + next if $name =~ /^(BEGIN|END)_FUNC$/; + next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)(_VAR)?$/; + next if $name =~ /^CI_(PRINT_STATS|INC_SRC|INC_DST)$/; + next if $name =~ /^(ABS|ADDR_OVERFLOW|ALL_MEMBERS|BOUND|CONSTR|DETECT_[I|F|M]|DOWN)$/; + next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/; + next if $name =~ /^(UNIQUE_MEMBERS)$/; + next if $name =~ /^(IS_H5FD_MPIO|IS_H5FD_MPIPOSIX)$/; + next if $name =~ /^addr_defined$/; + + # These functions/macros are exempt. + next if $name =~ /^(main|[fs]?printf|va_(start|arg|end))$/; + + # These are Windows system calls. Ignore them. + next if $name =~ /^(_get_osfhandle|GetFileInformationByHandle|SetFilePointer|GetLastError|SetEndOfFile)$/; + next if $name =~ /^(FindNextFile|FindClose|_tzset|Wgettimeofday|GetSystemTimeAsFileTime|Wgetlogin|GetUserName)$/; + + # These are GPFS function calls. Ignore them. + next if $name =~ /^gpfs_fcntl$/; + + # These are MPI function calls. Ignore them. + next if $name =~ /^(MPI_|MPE_)/; + + # These are POSIX threads function calls. Ignore them. + next if $name =~ /^pthread_/; + + # These are Windows threads function calls. Ignore them. + next if $name =~ /^(_beginthread|(Initialize|Enter|Leave)CriticalSection|TlsAlloc)$/; + + # These are zlib & szlib function calls. Ignore them. + next if $name =~ /^(inflate|SZ_)/; + next if $name =~ /^compress2$/; + + print "$ARGV:$.: $name\n"; + } + + } continue { + close ARGV if eof; # reset line number + } + } } diff --git a/src/H5.c b/src/H5.c index 25525a4..03d82a8 100644 --- a/src/H5.c +++ b/src/H5.c @@ -144,7 +144,7 @@ H5_init_library(void) MPI_Initialized(&mpi_initialized); if (mpi_initialized){ mpe_code = MPE_Init_log(); - assert(mpe_code >=0); + HDassert(mpe_code >=0); H5_MPEinit_g = TRUE; } } @@ -309,7 +309,7 @@ H5_term_library(void) MPI_Initialized(&mpi_initialized); if(mpi_initialized) { mpe_code = MPE_Finish_log("h5log"); - assert(mpe_code >=0); + HDassert(mpe_code >=0); } /* end if */ H5_MPEinit_g = FALSE; /* turn it off no matter what */ } /* end if */ diff --git a/src/H5C.c b/src/H5C.c index fa385fa..0946af9 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -479,10 +479,10 @@ H5C_apply_candidate_list(H5F_t * f, sprintf(&(tbl_buf[0]), "candidate list = "); for ( i = 0; i < num_candidates; i++ ) { - sprintf(&(tbl_buf[strlen(tbl_buf)]), " 0x%llx", + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx", (long long)(*(candidates_list_ptr + i))); } - sprintf(&(tbl_buf[strlen(tbl_buf)]), "\n"); + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ @@ -539,8 +539,8 @@ H5C_apply_candidate_list(H5F_t * f, tbl_buf[i] = '\0'; sprintf(&(tbl_buf[0]), "candidate assignment table = "); for(i = 0; i <= mpi_size; i++) - sprintf(&(tbl_buf[strlen(tbl_buf)]), " %d", candidate_assignment_table[i]); - sprintf(&(tbl_buf[strlen(tbl_buf)]), "\n"); + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %d", candidate_assignment_table[i]); + sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); HDfprintf(stdout, "%s:%d: flush entries [%d, %d].\n", @@ -814,7 +814,7 @@ H5C_apply_candidate_list(H5F_t * f, entries_cleared, entries_flushed); HDfprintf(stdout, "%s:%d: done.\n", FUNC, mpi_rank); - fsync(stdout); + HDfsync(stdout); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ /* ====================================================================== * diff --git a/src/H5CS.c b/src/H5CS.c index c2ca49b..4ccd0f8 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -173,7 +173,7 @@ H5CS_print(FILE *stream) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - assert(fstack); + HDassert(fstack); H5CS_print_stack(fstack, stream); @@ -205,8 +205,8 @@ H5CS_push(const char *func_name) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - assert (fstack); - assert (func_name); + HDassert(fstack); + HDassert(func_name); /* * Push the function if there's room. Otherwise just increment count @@ -242,8 +242,8 @@ H5CS_pop(void) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - assert (fstack); - assert (fstack->nused>0); + HDassert(fstack); + HDassert(fstack->nused>0); /* Pop the function. */ fstack->nused--; @@ -276,7 +276,7 @@ H5CS_copy_stack(H5CS_t *new_stack) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - HDassert (old_stack); + HDassert(old_stack); /* Copy old stack to new one, duplicating the strings */ for(u = 0; u < old_stack->nused; u++) @@ -310,7 +310,7 @@ H5CS_close_stack(H5CS_t *stack) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - HDassert (stack); + HDassert(stack); /* Free strings on stack */ for(u = 0; u < stack->nused; u++) diff --git a/src/H5D.c b/src/H5D.c index d81d4c7..f47a84c 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -105,7 +105,7 @@ H5D__init_pub_interface(void) * properties (DCPL_ID). * * All arguments are copied into the dataset, so the caller is - * allowed to derive new types, data spaces, and creation + * allowed to derive new types, dataspaces, and creation * parameters from the old ones and reuse them in calls to * create other datasets. * @@ -191,7 +191,7 @@ done: * properties (DCPL_ID). * * All arguments are copied into the dataset, so the caller is - * allowed to derive new types, data spaces, and creation + * allowed to derive new types, dataspaces, and creation * parameters from the old ones and reuse them in calls to * create other datasets. * @@ -409,9 +409,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Dget_space * - * Purpose: Returns a copy of the file data space for a dataset. + * Purpose: Returns a copy of the file dataspace for a dataset. * - * Return: Success: ID for a copy of the data space. The data + * Return: Success: ID for a copy of the dataspace. The data * space should be released by calling * H5Sclose(). * @@ -436,13 +436,13 @@ H5Dget_space(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") - /* Read the data space message and return a data space object */ + /* Read the dataspace message and return a dataspace object */ if(NULL == (space = H5S_copy(dset->shared->space, FALSE, TRUE))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get data space") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace") /* Create an atom */ if((ret_value = H5I_register (H5I_DATASPACE, space, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace") done: if(ret_value < 0) { @@ -459,7 +459,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Dget_space_status * - * Purpose: Returns the status of data space allocation. + * Purpose: Returns the status of dataspace allocation. * * Return: * Success: Non-negative @@ -483,7 +483,7 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) if(NULL==(dset=(H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") - /* Read data space address and return */ + /* Read dataspace address and return */ if(H5D__get_space_status(dset, allocation, H5AC_ind_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get space status") @@ -573,10 +573,6 @@ hid_t H5Dget_create_plist(hid_t dset_id) { H5D_t *dataset; /* Dataset structure */ - H5P_genplist_t *dcpl_plist; /* Dataset's DCPL */ - H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */ - H5O_fill_t copied_fill; /* Fill value to tweak */ - hid_t new_dcpl_id = FAIL; hid_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1030,6 +1026,9 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size) { H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0, 0}; + H5D_t *dset; /* Dataset for operation */ + H5S_t *fspace = NULL; /* Dataset's dataspace */ + H5S_t *mspace = NULL; /* Memory dataspace */ char bogus; /* bogus value to pass to H5Diterate() */ H5S_t *space; /* Dataspace for iteration */ H5P_genclass_t *pclass; /* Property class */ @@ -1043,21 +1042,25 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, if(H5I_DATASET != H5I_get_type(dataset_id) || H5I_DATATYPE != H5I_get_type(type_id) || size == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument") + if(NULL == (dset = (H5D_t *)H5I_object(dataset_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace") if(!(H5S_has_extent(space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set") - /* Save the dataset ID */ - vlen_bufsize.dataset_id = dataset_id; + /* Save the dataset */ + vlen_bufsize.dset = dset; - /* Get a copy of the dataspace ID */ - if((vlen_bufsize.fspace_id = H5Dget_space(dataset_id)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy dataspace") + /* Get a copy of the dataset's dataspace */ + if(NULL == (fspace = H5S_copy(dset->shared->space, FALSE, TRUE))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to get dataspace") + vlen_bufsize.fspace = fspace; /* Create a scalar for the memory dataspace */ - if((vlen_bufsize.mspace_id = H5Screate(H5S_SCALAR)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't create dataspace") + if(NULL == (mspace = H5S_create(H5S_SCALAR))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace") + vlen_bufsize.mspace = mspace; /* Grab the temporary buffers required */ if(NULL == (vlen_bufsize.fl_tbuf = H5FL_BLK_MALLOC(vlen_fl_buf, (size_t)1))) @@ -1092,9 +1095,9 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, *size = vlen_bufsize.size; done: - if(vlen_bufsize.fspace_id > 0 && H5I_dec_ref(vlen_bufsize.fspace_id) < 0) + if(fspace && H5S_close(fspace) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") - if(vlen_bufsize.mspace_id > 0 && H5I_dec_ref(vlen_bufsize.mspace_id) < 0) + if(mspace && H5S_close(mspace) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") if(vlen_bufsize.fl_tbuf != NULL) vlen_bufsize.fl_tbuf = H5FL_BLK_FREE(vlen_fl_buf, vlen_bufsize.fl_tbuf); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 31e3179..2838a39 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -1206,7 +1206,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t FUNC_ENTER_STATIC /* Sanity check */ - assert(fm->f_ndims>0); + HDassert(fm->f_ndims>0); /* Get number of elements selected in file */ sel_points = fm->nelmts; @@ -1383,7 +1383,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) FUNC_ENTER_STATIC /* Sanity check */ - assert(fm->f_ndims>0); + HDassert(fm->f_ndims>0); /* Check for all I/O going to a single chunk */ if(H5SL_count(fm->sel_chunks)==1) { @@ -1394,7 +1394,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) /* Get pointer to chunk's information */ chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); - assert(chunk_info); + HDassert(chunk_info); /* Just point at the memory dataspace & selection */ /* (Casting away const OK -QAK) */ @@ -1413,7 +1413,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") /* Calculate the adjustment for memory selection from file selection */ - assert(fm->m_ndims==fm->f_ndims); + HDassert(fm->m_ndims==fm->f_ndims); for(u=0; uf_ndims; u++) { H5_CHECK_OVERFLOW(file_sel_start[u],hsize_t,hssize_t); H5_CHECK_OVERFLOW(mem_sel_start[u],hsize_t,hssize_t); @@ -1427,7 +1427,7 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) /* Get pointer to chunk's information */ chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); - assert(chunk_info); + HDassert(chunk_info); /* Copy the information */ diff --git a/src/H5Dint.c b/src/H5Dint.c index f313e52..5545a98 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -374,7 +374,7 @@ H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) FUNC_ENTER_PACKAGE /* Check args */ - assert(cache); + HDassert(cache); /* Check for the default DXPL */ if(dxpl_id==H5P_DATASET_XFER_DEFAULT) @@ -2052,18 +2052,18 @@ H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, c /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object(type_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a datatype") /* Make certain there is enough fixed-length buffer available */ if(NULL == (vlen_bufsize->fl_tbuf = H5FL_BLK_REALLOC(vlen_fl_buf, vlen_bufsize->fl_tbuf, H5T_get_size(dt)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't resize tbuf") + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't resize tbuf") /* Select point to read in */ - if(H5Sselect_elements(vlen_bufsize->fspace_id, H5S_SELECT_SET, (size_t)1, point) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't select point") + if(H5S_select_elements(vlen_bufsize->fspace, H5S_SELECT_SET, (size_t)1, point) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't select point") /* Read in the point (with the custom VL memory allocator) */ - if(H5Dread(vlen_bufsize->dataset_id, type_id, vlen_bufsize->mspace_id, vlen_bufsize->fspace_id, vlen_bufsize->xfer_pid, vlen_bufsize->fl_tbuf) < 0) + if(H5D__read(vlen_bufsize->dset, type_id, vlen_bufsize->mspace, vlen_bufsize->fspace, vlen_bufsize->xfer_pid, vlen_bufsize->fl_tbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read point") done: diff --git a/src/H5Dio.c b/src/H5Dio.c index df1c4a3..9b2f8ff 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -52,9 +52,6 @@ /********************/ /* Internal I/O routines */ -static herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, - void *buf/*out*/); static herr_t H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, const void *buf); @@ -384,7 +381,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/) { @@ -416,7 +413,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* check args */ HDassert(dataset && dataset->oloc.file); diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 900ad6a..4d4c2bf 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -648,42 +648,49 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf } /* end else */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY +{ + H5P_genplist_t *plist; /* Property list pointer */ htri_t check_prop; int new_value; + /* Get the dataset transfer property list */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->dxpl_id))) + HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + /*** Test collective chunk user-input optimization APIs. ***/ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); if(check_prop > 0) { if(H5D_ONE_LINK_CHUNK_IO == io_option) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } /* end if */ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME); if(check_prop > 0) { if(H5D_MULTI_CHUNK_IO == io_option) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &new_value) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } /* end if */ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME); if(check_prop > 0) { if(H5D_ONE_LINK_CHUNK_IO_MORE_OPT == io_option) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &new_value) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } /* end if */ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME); if(check_prop > 0) { if(temp_not_link_io) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &new_value) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } /* end if */ +} #endif /* step 2: Go ahead to do IO.*/ @@ -1713,19 +1720,26 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, HDmemcpy(chunk_addr, tempbuf, sizeof(haddr_t) * total_chunks); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME); +{ + H5P_genplist_t *plist; /* Property list pointer */ + + /* Get the dataset transfer property list */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->dxpl_id))) + HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME); if(check_prop > 0) { for(ic = 0; ic < total_chunks; ic++) { if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { new_value = 0; - if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &new_value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") break; } /* end if */ } /* end for */ } /* end if */ - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME); + check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME); if(check_prop > 0) { int temp_count = 0; @@ -1737,10 +1751,11 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, } /* end for */ if(temp_count == 0) { new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, &new_value) < 0) + if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, &new_value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") } /* end if */ } /* end if */ +} #endif done: diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index ed6da8f..7e6eb4b 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -479,9 +479,9 @@ typedef struct H5D_fill_buf_info_t { /* Internal data structure for computing variable-length dataset's total size */ typedef struct { - hid_t dataset_id; /* ID of the dataset we are working on */ - hid_t fspace_id; /* ID of the file dataset's dataspace we are working on */ - hid_t mspace_id; /* ID of the memory dataset's dataspace we are working on */ + H5D_t *dset; /* Dataset for operation */ + H5S_t *fspace; /* Dataset's dataspace for operation */ + H5S_t *mspace; /* Memory dataspace for operation */ void *fl_tbuf; /* Ptr to the temporary buffer we are using for fixed-length data */ void *vl_tbuf; /* Ptr to the temporary buffer we are using for VL data */ hid_t xfer_pid; /* ID of the dataset xfer property list */ @@ -547,6 +547,11 @@ H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id); H5_DLL herr_t H5D__mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags); H5_DLL herr_t H5D__flush_real(H5D_t *dataset, hid_t dxpl_id); +/* Internal I/O routines */ +H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, + const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, + void *buf/*out*/); + /* Functions that perform direct serial I/O operations */ H5_DLL herr_t H5D__select_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, diff --git a/src/H5F.c b/src/H5F.c index 12c25cd..6c220aa 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -2369,8 +2369,10 @@ H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *na } /* end else */ done: - if(new_fapl_id > 0 && H5Pclose(new_fapl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL") + /* Close the property list */ + if(new_fapl_id > 0) + if(H5I_dec_app_ref(new_fapl_id) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL") FUNC_LEAVE_NOAPI(ret_value) } /* H5F_build_actual_name() */ @@ -2597,16 +2599,15 @@ done: * david.pitt@bigpond.com * Apr 27, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5Fget_filesize(hid_t file_id, hsize_t *size) { - H5F_t *file; /* File object for file ID */ - haddr_t eof; /* End of file address */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File object for file ID */ + haddr_t eof; /* End of file address */ + haddr_t base_addr; /* Base address for the file */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", file_id, size); @@ -2616,10 +2617,12 @@ H5Fget_filesize(hid_t file_id, hsize_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Go get the actual file size */ - if(HADDR_UNDEF == (eof = H5FDget_eof(file->shared->lf))) + if(HADDR_UNDEF == (eof = H5FD_get_eof(file->shared->lf))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size") + base_addr = H5FD_get_base_addr(file->shared->lf); - *size = (hsize_t)eof; + if(size) + *size = (hsize_t)(eof + base_addr); /* Convert relative base address for file to absolute address */ done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5FD.c b/src/H5FD.c index b359d78..b38b904 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -490,7 +490,7 @@ H5FD_sb_size(H5FD_t *file) FUNC_ENTER_NOAPI(0) - assert(file && file->cls); + HDassert(file && file->cls); if(file->cls->sb_size) ret_value = (file->cls->sb_size)(file); @@ -528,7 +528,7 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) FUNC_ENTER_NOAPI(FAIL) - assert(file && file->cls); + HDassert(file && file->cls); if(file->cls->sb_encode && (file->cls->sb_encode)(file, name/*out*/, buf/*out*/) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed") @@ -690,7 +690,7 @@ H5FD_fapl_get(H5FD_t *file) FUNC_ENTER_NOAPI(NULL) - assert(file); + HDassert(file); if(file->cls->fapl_get) ret_value = (file->cls->fapl_get)(file); @@ -1197,8 +1197,8 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) FUNC_ENTER_API(FAIL) H5TRACE2("Is", "*xx", f, flags); - assert(f); - assert(flags); + HDassert(f); + HDassert(flags); ret_value = H5FD_query(f, flags); diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 43c8945..74aeed3 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -211,7 +211,7 @@ H5FD_core_init(void) FUNC_ENTER_NOAPI(FAIL) - if(H5I_VFL != H5Iget_type(H5FD_CORE_g)) + if(H5I_VFL != H5I_get_type(H5FD_CORE_g)) H5FD_CORE_g = H5FD_register(&H5FD_core_g,sizeof(H5FD_class_t),FALSE); /* Set return value */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 9715bc1..079554d 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -104,36 +104,8 @@ typedef struct H5FD_direct_t { } H5FD_direct_t; /* - * This driver supports systems that have the lseek64() function by defining - * some macros here so we don't have to have conditional compilations later - * throughout the code. - * - * file_offset_t: The datatype for file offsets, the second argument of - * the lseek() or lseek64() call. - * - * file_seek: The function which adjusts the current file position, - * either lseek() or lseek64(). - */ -/* adding for windows NT file system support. */ - -#ifdef H5_HAVE_LSEEK64 -# define file_offset_t off64_t -# define file_seek lseek64 -# define file_truncate ftruncate64 -#elif defined (H5_HAVE_WIN32_API) -# /*MSVC*/ -# define file_offset_t __int64 -# define file_seek _lseeki64 -# define file_truncate _chsize -#else -# define file_offset_t off_t -# define file_seek lseek -# define file_truncate HDftruncate -#endif - -/* * These macros check for overflow of various quantities. These macros - * assume that file_offset_t is signed and haddr_t and size_t are unsigned. + * assume that HDoff_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument @@ -146,13 +118,13 @@ typedef struct H5FD_direct_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(file_offset_t)-1))-1) +#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \ ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ HADDR_UNDEF==(A)+(Z) || \ - (file_offset_t)((A)+(Z))<(file_offset_t)(A)) + (HDoff_t)((A)+(Z))<(HDoff_t)(A)) /* Prototypes */ static herr_t H5FD_direct_term(void); @@ -454,7 +426,7 @@ H5FD_direct_fapl_copy(const void *_old_fa) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(new_fa); + HDassert(new_fa); /* Copy the general information */ HDmemcpy(new_fa, old_fa, sizeof(H5FD_direct_fapl_t)); @@ -500,7 +472,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd FUNC_ENTER_NOAPI_NOINIT /* Sanity check on file offsets */ - assert(sizeof(file_offset_t)>=sizeof(size_t)); + HDassert(sizeof(HDoff_t)>=sizeof(size_t)); /* Check arguments */ if (!name || !*name) @@ -568,26 +540,26 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed") if(o_flags & O_CREAT) { - if(write(file->fd, (void*)buf1, sizeof(int))<0) { - if(write(file->fd, (void*)buf2, file->fa.fbsize)<0) + if(HDwrite(file->fd, (void*)buf1, sizeof(int))<0) { + if(HDwrite(file->fd, (void*)buf2, file->fa.fbsize)<0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "file system may not support Direct I/O") else file->fa.must_align = TRUE; } else { file->fa.must_align = FALSE; - file_truncate(file->fd, (file_offset_t)0); + HDftruncate(file->fd, (HDoff_t)0); } } else { - if(read(file->fd, (void*)buf1, sizeof(int))<0) { - if(read(file->fd, (void*)buf2, file->fa.fbsize)<0) + if(HDread(file->fd, (void*)buf1, sizeof(int))<0) { + if(HDread(file->fd, (void*)buf2, file->fa.fbsize)<0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "file system may not support Direct I/O") else file->fa.must_align = TRUE; } else { if(o_flags & O_RDWR) { - if(file_seek(file->fd, (file_offset_t)0, SEEK_SET) < 0) + if(HDlseek(file->fd, (HDoff_t)0, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to seek to proper position") - if(write(file->fd, (void *)buf1, sizeof(int))<0) + if(HDwrite(file->fd, (void *)buf1, sizeof(int))<0) file->fa.must_align = TRUE; else file->fa.must_align = FALSE; @@ -911,8 +883,8 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha FUNC_ENTER_NOAPI_NOINIT - assert(file && file->pub.cls); - assert(buf); + HDassert(file && file->pub.cls); + HDassert(buf); /* Check for overflow conditions */ if (HADDR_UNDEF==addr) @@ -941,7 +913,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha if(!_must_align || ((addr%_fbsize==0) && (size%_fbsize==0) && ((size_t)buf%_boundary==0))) { /* Seek to the correct location */ if ((addr!=file->pos || OP_READ!=file->op) && - file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) + HDlseek(file->fd, (HDoff_t)addr, SEEK_SET)<0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") /* Read the aligned data in file first, being careful of interrupted * system calls and partial results. */ @@ -956,8 +928,8 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha HDmemset(buf, 0, size); break; } - assert(nbytes>=0); - assert((size_t)nbytes<=size); + HDassert(nbytes>=0); + HDassert((size_t)nbytes<=size); H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); size -= (size_t)nbytes; H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); @@ -980,7 +952,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha /* look for the aligned position for reading the data */ HDassert(!(((addr / _fbsize) * _fbsize) % _fbsize)); - if(file_seek(file->fd, (file_offset_t)((addr / _fbsize) * _fbsize), + if(HDlseek(file->fd, (HDoff_t)((addr / _fbsize) * _fbsize), SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") @@ -1099,8 +1071,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h FUNC_ENTER_NOAPI_NOINIT - assert(file && file->pub.cls); - assert(buf); + HDassert(file && file->pub.cls); + HDassert(buf); /* Check for overflow conditions */ if (HADDR_UNDEF==addr) @@ -1129,7 +1101,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h if(!_must_align || ((addr%_fbsize==0) && (size%_fbsize==0) && ((size_t)buf%_boundary==0))) { /* Seek to the correct location */ if ((addr!=file->pos || OP_WRITE!=file->op) && - file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) + HDlseek(file->fd, (HDoff_t)addr, SEEK_SET)<0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") while (size>0) { @@ -1138,8 +1110,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h } while (-1==nbytes && EINTR==errno); if (-1==nbytes) /* error */ HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") - assert(nbytes>0); - assert((size_t)nbytes<=size); + HDassert(nbytes>0); + HDassert((size_t)nbytes<=size); H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); size -= (size_t)nbytes; H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); @@ -1165,7 +1137,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "HDposix_memalign failed") /* look for the right position for reading or writing the data */ - if(file_seek(file->fd, (file_offset_t)write_addr, SEEK_SET) < 0) + if(HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") p3 = buf; @@ -1207,8 +1179,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h /* Seek to the last block, for reading */ HDassert(!((write_addr + write_size - _fbsize) % _fbsize)); - if(file_seek(file->fd, - (file_offset_t)(write_addr + write_size - _fbsize), + if(HDlseek(file->fd, + (HDoff_t)(write_addr + write_size - _fbsize), SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") } /* end if */ @@ -1218,7 +1190,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h if(p1) { HDassert(!(read_size % _fbsize)); do { - nbytes = read(file->fd, p1, read_size); + nbytes = HDread(file->fd, p1, read_size); } while (-1==nbytes && EINTR==errno); if (-1==nbytes) /* error */ @@ -1245,7 +1217,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h /*look for the aligned position for writing the data*/ HDassert(!(write_addr % _fbsize)); - if(file_seek(file->fd, (file_offset_t)write_addr, SEEK_SET) < 0) + if(HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") /* @@ -1317,7 +1289,7 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing FUNC_ENTER_NOAPI_NOINIT - assert(file); + HDassert(file); /* Extend the file to make sure it's large enough */ if (file->eoa!=file->eof) { @@ -1335,7 +1307,7 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing if(SetEndOfFile((HANDLE)filehandle)==0) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #else /* H5_HAVE_WIN32_API */ - if (-1==file_truncate(file->fd, (file_offset_t)file->eoa)) + if (-1==HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ @@ -1350,7 +1322,7 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing /*Even though eof is equal to eoa, file is still truncated because Direct I/O *write introduces some extra data for alignment. */ - if (-1==file_truncate(file->fd, (file_offset_t)file->eof)) + if (-1==HDftruncate(file->fd, (HDoff_t)file->eof)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") } diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index dc535a2..75c75ad 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -187,19 +187,19 @@ H5FD_family_init_interface(void) hid_t H5FD_family_init(void) { - hid_t ret_value=H5FD_FAMILY_g; /* Return value */ + hid_t ret_value = H5FD_FAMILY_g; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - if (H5I_VFL!=H5Iget_type(H5FD_FAMILY_g)) - H5FD_FAMILY_g = H5FD_register(&H5FD_family_g,sizeof(H5FD_class_t),FALSE); + if(H5I_VFL != H5I_get_type(H5FD_FAMILY_g)) + H5FD_FAMILY_g = H5FD_register(&H5FD_family_g, sizeof(H5FD_class_t), FALSE); /* Set return value */ - ret_value=H5FD_FAMILY_g; + ret_value = H5FD_FAMILY_g; done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* H5FD_family_init() */ /*--------------------------------------------------------------------------- @@ -416,7 +416,7 @@ H5FD_family_fapl_copy(const void *_old_fa) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy the fields of the structure */ - memcpy(new_fa, old_fa, sizeof(H5FD_family_fapl_t)); + HDmemcpy(new_fa, old_fa, sizeof(H5FD_family_fapl_t)); /* Deep copy the property list objects in the structure */ if(old_fa->memb_fapl_id==H5P_FILE_ACCESS_DEFAULT) { @@ -1176,7 +1176,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si tempreq = SIZET_MAX; req = MIN(size, (size_t)tempreq); - assert(unmembs); + HDassert(unmembs); if (H5FDread(file->memb[u], type, dxpl_id, sub, req, buf)<0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "member file read failed") @@ -1245,7 +1245,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s tempreq = SIZET_MAX; req = MIN(size, (size_t)tempreq); - assert(unmembs); + HDassert(unmembs); if (H5FDwrite(file->memb[u], type, dxpl_id, sub, req, buf)<0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "member file write failed") diff --git a/src/H5FDint.c b/src/H5FDint.c index 09af4ed..c9e9a67 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -298,7 +298,7 @@ H5FD_get_eof(const H5FD_t *file) /* Dispatch to driver */ if(file->cls->get_eof) { if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eof request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed") } /* end if */ else ret_value = file->maxaddr; diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 81d050d..cb04b80 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -795,7 +795,7 @@ H5FD_log_close(H5FD_t *_file) if(file->fa.flags & H5FD_LOG_FLAVOR) file->flavor = (unsigned char *)H5MM_xfree(file->flavor); if(file->logfp != stderr) - fclose(file->logfp); + HDfclose(file->logfp); } /* end if */ /* Release the file info */ diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 295e3c9f..86a5d39 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -57,10 +57,10 @@ H5FD_mpi_get_rank(const H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) - assert(file); + HDassert(file); cls = (const H5FD_class_mpi_t *)(file->cls); - assert(cls); - assert(cls->get_rank); /* All MPI drivers must implement this */ + HDassert(cls); + HDassert(cls->get_rank); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((ret_value=(cls->get_rank)(file))<0) @@ -95,10 +95,10 @@ H5FD_mpi_get_size(const H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) - assert(file); + HDassert(file); cls = (const H5FD_class_mpi_t *)(file->cls); - assert(cls); - assert(cls->get_size); /* All MPI drivers must implement this */ + HDassert(cls); + HDassert(cls->get_size); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((ret_value=(cls->get_size)(file))<0) @@ -133,10 +133,10 @@ H5FD_mpi_get_comm(const H5FD_t *file) FUNC_ENTER_NOAPI(MPI_COMM_NULL) - assert(file); + HDassert(file); cls = (const H5FD_class_mpi_t *)(file->cls); - assert(cls); - assert(cls->get_comm); /* All MPI drivers must implement this */ + HDassert(cls); + HDassert(cls->get_comm); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((ret_value=(cls->get_comm)(file))==MPI_COMM_NULL) @@ -217,7 +217,7 @@ H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(mpi_off); + HDassert(mpi_off); /* Convert the HDF5 address into an MPI offset */ *mpi_off = (MPI_Offset)addr; @@ -373,8 +373,8 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file) FUNC_ENTER_NOAPI(FAIL) - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); /* Portably initialize MPI status variable */ HDmemset(&rcvstat,0,sizeof(MPI_Status)); @@ -427,14 +427,12 @@ H5FD_mpio_signal_right_neighbor(H5FD_t *_file) FUNC_ENTER_NOAPI(FAIL) - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); - if (file->mpi_rank != (file->mpi_size-1)) { - if (MPI_SUCCESS != (mpi_code=MPI_Send(&msgbuf, 0/*empty msg*/, MPI_CHAR, - file->mpi_rank+1, 0, file->comm))) + if(file->mpi_rank != (file->mpi_size - 1)) + if(MPI_SUCCESS != (mpi_code=MPI_Send(&msgbuf, 0/*empty msg*/, MPI_CHAR, file->mpi_rank + 1, 0, file->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mpi_code) - } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 878bf82..f23a3b5 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -825,10 +825,10 @@ H5FD_mpio_fapl_free(void *_fa) if (H5FD_mpio_Debug[(int)'t']) fprintf(stderr, "in H5FD_mpio_fapl_free\n"); #endif - assert(fa); + HDassert(fa); /* Free the internal communicator and INFO object */ - assert(MPI_COMM_NULL!=fa->comm); + HDassert(MPI_COMM_NULL!=fa->comm); H5FD_mpi_comm_info_free(&fa->comm, &fa->info); H5MM_xfree(fa); @@ -1167,8 +1167,8 @@ H5FD_mpio_close(H5FD_t *_file) if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "Entering H5FD_mpio_close\n"); #endif - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); /* MPI_File_close sets argument to MPI_FILE_NULL */ if (MPI_SUCCESS != (mpi_code=MPI_File_close(&(file->f)/*in,out*/))) @@ -1257,8 +1257,8 @@ H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->eoa) } @@ -1292,8 +1292,8 @@ H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); file->eoa = addr; @@ -1337,8 +1337,8 @@ H5FD_mpio_get_eof(const H5FD_t *_file) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->eof) } @@ -1468,12 +1468,12 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "Entering H5FD_mpio_read\n" ); #endif - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); - assert(buf); + HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); + HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); + HDassert(buf); /* Portably initialize MPI status variable */ HDmemset(&mpi_stat,0,sizeof(MPI_Status)); @@ -1752,12 +1752,12 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "Entering H5FD_mpio_write\n" ); #endif - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); /* Make certain we have the correct type of property list */ - assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); - assert(buf); + HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); + HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); + HDassert(buf); /* Portably initialize MPI status variable */ HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); @@ -2058,8 +2058,8 @@ H5FD_mpio_mpi_rank(const H5FD_t *_file) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->mpi_rank) } /* end H5FD_mpio_mpi_rank() */ @@ -2087,8 +2087,8 @@ H5FD_mpio_mpi_size(const H5FD_t *_file) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->mpi_size) } /* end H5FD_mpio_mpi_size() */ @@ -2117,8 +2117,8 @@ H5FD_mpio_communicator(const H5FD_t *_file) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); + HDassert(file); + HDassert(H5FD_MPIO==file->pub.driver_id); FUNC_LEAVE_NOAPI(file->comm) } diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 978494e..7248dff 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -263,8 +263,8 @@ H5FD_mpiposix_init(void) FUNC_ENTER_NOAPI(FAIL) - if (H5I_VFL != H5Iget_type(H5FD_MPIPOSIX_g)) - H5FD_MPIPOSIX_g = H5FD_register((const H5FD_class_t *)&H5FD_mpiposix_g,sizeof(H5FD_class_mpi_t),FALSE); + if(H5I_VFL != H5I_get_type(H5FD_MPIPOSIX_g)) + H5FD_MPIPOSIX_g = H5FD_register((const H5FD_class_t *)&H5FD_mpiposix_g, sizeof(H5FD_class_mpi_t), FALSE); /* Set return value */ ret_value = H5FD_MPIPOSIX_g; diff --git a/src/H5FO.c b/src/H5FO.c index ace66ec..a6c47cb 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -78,8 +78,8 @@ H5FO_create(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - assert(f); - assert(f->shared); + HDassert(f); + HDassert(f->shared); /* Create container used to store open object info */ if((f->shared->open_objs = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL) @@ -166,11 +166,11 @@ H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - assert(f); - assert(f->shared); - assert(f->shared->open_objs); - assert(H5F_addr_defined(addr)); - assert(obj); + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->open_objs); + HDassert(H5F_addr_defined(addr)); + HDassert(obj); /* Allocate new opened object information structure */ if((open_obj=H5FL_MALLOC(H5FO_open_obj_t))==NULL) @@ -269,10 +269,10 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - assert(f); - assert(f->shared); - assert(f->shared->open_objs); - assert(H5F_addr_defined(addr)); + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->open_objs); + HDassert(H5F_addr_defined(addr)); /* Get the object node from the container */ if(NULL != (open_obj = (H5FO_open_obj_t *)H5SL_search(f->shared->open_objs, &addr))) @@ -352,9 +352,9 @@ H5FO_dest(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - assert(f); - assert(f->shared); - assert(f->shared->open_objs); + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->open_objs); /* Check if the object info set is empty */ if(H5SL_count(f->shared->open_objs)!=0) diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 07d29f2..4d3ca34 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -101,7 +101,7 @@ H5F_mpi_get_rank(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) - assert(f && f->shared); + HDassert(f && f->shared); /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_rank(f->shared->lf)) < 0) @@ -135,7 +135,7 @@ H5F_mpi_get_comm(const H5F_t *f) FUNC_ENTER_NOAPI(MPI_COMM_NULL) - assert(f && f->shared); + HDassert(f && f->shared); /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_comm(f->shared->lf))==MPI_COMM_NULL) @@ -169,7 +169,7 @@ H5F_mpi_get_size(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) - assert(f && f->shared); + HDassert(f && f->shared); /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_size(f->shared->lf)) < 0) diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 334879c..beb7e88 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -303,7 +303,6 @@ H5_DLL herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing); H5_DLL herr_t H5F_close_mounts(H5F_t *f); H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key); H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); -H5_DLL herr_t H5F_flush_mounts(H5F_t *f, hid_t dxpl_id); /* Superblock related routines */ H5_DLL herr_t H5F_super_init(H5F_t *f, hid_t dxpl_id); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index e1e1b05..afad362 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -616,6 +616,7 @@ H5_DLL herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, H5_DLL hbool_t H5F_is_mount(const H5F_t *file); H5_DLL hbool_t H5F_has_mount(const H5F_t *file); H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc/*in,out*/); +H5_DLL herr_t H5F_flush_mounts(H5F_t *f, hid_t dxpl_id); /* Functions that operate on blocks of bytes wrt super block */ H5_DLL herr_t H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, diff --git a/src/H5Gname.c b/src/H5Gname.c index 72da498..1d2644b 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -135,7 +135,7 @@ H5G__component(const char *name, size_t *size_p) { FUNC_ENTER_PACKAGE_NOERR - assert(name); + HDassert(name); while ('/' == *name) name++; @@ -236,13 +236,13 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) /* Get component of each name */ fullpath=H5RS_get_str(fullpath_r); - assert(fullpath); + HDassert(fullpath); fullpath=H5G__component(fullpath,&nchars1); - assert(fullpath); + HDassert(fullpath); prefix=H5RS_get_str(prefix_r); - assert(prefix); + HDassert(prefix); prefix=H5G__component(prefix,&nchars2); - assert(prefix); + HDassert(prefix); /* Check if we have a real string for each component */ while(*fullpath && *prefix) { @@ -256,9 +256,9 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) /* Get next component of each name */ fullpath=H5G__component(fullpath,&nchars1); - assert(fullpath); + HDassert(fullpath); prefix=H5G__component(prefix,&nchars2); - assert(prefix); + HDassert(prefix); } /* end if */ else HGOTO_DONE(FALSE) diff --git a/src/H5HG.c b/src/H5HG.c index 7a90475..d55eaab 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -191,7 +191,7 @@ HDmemset(heap->chunk, 0, size); /* The freespace object */ heap->obj[0].size = size - H5HG_SIZEOF_HDR(f); - assert(H5HG_ISALIGNED(heap->obj[0].size)); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); heap->obj[0].nrefs = 0; heap->obj[0].begin = p; UINT16ENCODE(p, 0); /*object ID*/ @@ -372,7 +372,7 @@ H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) UINT16ENCODE(p, 0); /*nrefs*/ UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH (f, p, heap->obj[0].size); - assert(H5HG_ISALIGNED(heap->obj[0].size)); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); } /* end else-if */ else { /* @@ -381,7 +381,7 @@ H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) */ heap->obj[0].size -= need; heap->obj[0].begin += need; - assert(H5HG_ISALIGNED(heap->obj[0].size)); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); } /* Mark the heap as dirty */ @@ -475,7 +475,7 @@ HDmemset(new_chunk + heap->size, 0, need); UINT16ENCODE(p, 0); /*nrefs*/ UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH(f, p, heap->obj[0].size); - assert(H5HG_ISALIGNED(heap->obj[0].size)); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); /* Resize the heap in the cache */ if(H5AC_resize_entry(heap, heap->size) < 0) diff --git a/src/H5HP.c b/src/H5HP.c index 335fde2..f6fb20c 100644 --- a/src/H5HP.c +++ b/src/H5HP.c @@ -342,7 +342,7 @@ H5HP_create(H5HP_type_t heap_type) FUNC_ENTER_NOAPI(NULL) /* Check args */ - assert(heap_type==H5HP_MIN_HEAP || heap_type==H5HP_MAX_HEAP); + HDassert(heap_type==H5HP_MIN_HEAP || heap_type==H5HP_MAX_HEAP); /* Allocate ref-counted string structure */ if((new_heap=H5FL_MALLOC(H5HP_t))==NULL) @@ -416,15 +416,15 @@ H5HP_count(const H5HP_t *heap) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(heap); + HDassert(heap); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Return the number of objects in the heap */ H5_CHECK_OVERFLOW(heap->nobjs,size_t,ssize_t); @@ -463,16 +463,16 @@ H5HP_insert(H5HP_t *heap, int val, void *obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(obj); + HDassert(heap); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Increment number of objects in heap */ heap->nobjs++; @@ -507,11 +507,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_insert() */ @@ -542,16 +542,16 @@ H5HP_top(const H5HP_t *heap, int *val) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(heap); - assert(val); + HDassert(heap); + HDassert(val); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Get value of the top object in the heap */ *val=heap->heap[1].val; @@ -589,24 +589,24 @@ H5HP_remove(H5HP_t *heap, int *val, void **obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(val); - assert(obj); + HDassert(heap); + HDassert(val); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Check if there are any objects on the heap to remove */ if(heap->nobjs==0) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "heap is empty"); /* Get the information for the top object on the heap */ - assert(heap->heap[1].obj->heap_loc==1); + HDassert(heap->heap[1].obj->heap_loc==1); *val=heap->heap[1].val; *obj=heap->heap[1].obj; @@ -634,11 +634,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_remove() */ @@ -675,20 +675,20 @@ H5HP_change(H5HP_t *heap, int val, void *_obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(obj); + HDassert(heap); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Get the location of the object in the heap */ obj_loc=obj->heap_loc; - assert(obj_loc>0 && obj_loc<=heap->nobjs); + HDassert(obj_loc>0 && obj_loc<=heap->nobjs); /* Change the heap object's priority */ old_val=heap->heap[obj_loc].val; @@ -720,11 +720,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_change() */ @@ -760,20 +760,20 @@ H5HP_incr(H5HP_t *heap, unsigned amt, void *_obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(obj); + HDassert(heap); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Get the location of the object in the heap */ obj_loc = obj->heap_loc; - assert(obj_loc > 0 && obj_loc <= heap->nobjs); + HDassert(obj_loc > 0 && obj_loc <= heap->nobjs); /* Change the heap object's priority */ heap->heap[obj_loc].val += (int)amt; @@ -792,11 +792,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_incr() */ @@ -832,20 +832,20 @@ H5HP_decr(H5HP_t *heap, unsigned amt, void *_obj) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(heap); - assert(obj); + HDassert(heap); + HDassert(obj); /* Check internal consistency */ /* (Pre-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); /* Get the location of the object in the heap */ obj_loc=obj->heap_loc; - assert(obj_loc>0 && obj_loc<=heap->nobjs); + HDassert(obj_loc>0 && obj_loc<=heap->nobjs); /* Change the heap object's priority */ heap->heap[obj_loc].val-=amt; @@ -864,11 +864,11 @@ done: /* Check internal consistency */ /* (Post-condition) */ - assert(heap->nobjsnalloc); - assert(heap->heap); - assert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || + HDassert(heap->nobjsnalloc); + HDassert(heap->heap); + HDassert((heap->type==H5HP_MAX_HEAP && heap->heap[0].val==INT_MAX) || (heap->type==H5HP_MIN_HEAP && heap->heap[0].val==INT_MIN)); - assert(heap->heap[0].obj==NULL); + HDassert(heap->heap[0].obj==NULL); FUNC_LEAVE_NOAPI(ret_value); } /* end H5HP_decr() */ diff --git a/src/H5MM.c b/src/H5MM.c index 23ef9f9..caeac37 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -59,7 +59,7 @@ H5MM_malloc(size_t size) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(size); + HDassert(size); FUNC_LEAVE_NOAPI(HDmalloc(size)); } /* end H5MM_malloc() */ @@ -92,7 +92,7 @@ H5MM_calloc(size_t size) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(size); + HDassert(size); FUNC_LEAVE_NOAPI(HDcalloc(1,size)); } /* end H5MM_calloc() */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index db9066e..487b6f4 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -118,9 +118,9 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, /* Number of slots */ UINT16DECODE(p, mesg->nalloc); - assert(mesg->nalloc>0); + HDassert(mesg->nalloc>0); UINT16DECODE(p, mesg->nused); - assert(mesg->nused <= mesg->nalloc); + HDassert(mesg->nused <= mesg->nalloc); /* Heap address */ H5F_addr_decode(f, &p, &(mesg->heap_addr)); diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 6326fd9..4c43873 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -127,7 +127,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, /* Layout class */ mesg->type = (H5D_layout_t)*p++; - assert(H5D_CONTIGUOUS == mesg->type || H5D_CHUNKED == mesg->type || H5D_COMPACT == mesg->type); + HDassert(H5D_CONTIGUOUS == mesg->type || H5D_CHUNKED == mesg->type || H5D_COMPACT == mesg->type); /* Reserved bytes */ p += 5; diff --git a/src/H5Oname.c b/src/H5Oname.c index c1cb8c8..5ca05e1 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -228,8 +228,8 @@ H5O_name_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void * FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); + HDassert(f); + HDassert(mesg); ret_value = mesg->s ? HDstrlen(mesg->s) + 1 : 0; @@ -294,11 +294,11 @@ H5O_name_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); - assert(stream); - assert(indent >= 0); - assert(fwidth >= 0); + HDassert(f); + HDassert(mesg); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); fprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth, "Name:", diff --git a/src/H5Ostab.c b/src/H5Ostab.c index d05c7c2..f7c77bc 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -149,9 +149,9 @@ H5O_stab_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(p); - assert(stab); + HDassert(f); + HDassert(p); + HDassert(stab); /* encode */ H5F_addr_encode(f, &p, stab->btree_addr); @@ -433,11 +433,11 @@ H5O_stab_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(stab); - assert(stream); - assert(indent >= 0); - assert(fwidth >= 0); + HDassert(f); + HDassert(stab); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "B-tree address:", stab->btree_addr); diff --git a/src/H5PL.c b/src/H5PL.c index 07e90af..7a8a296 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -415,7 +415,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) /* Get info for directory entry */ if(HDstat(pathname, &my_stat) == -1) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", strerror(errno)) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", HDstrerror(errno)) /* If it is a directory, skip it */ if(S_ISDIR(my_stat.st_mode)) @@ -437,7 +437,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) done: if(dirp) if(HDclosedir(dirp) < 0) - HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno)) + HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", HDstrerror(errno)) if(pathname) pathname = (char *)H5MM_xfree(pathname); diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index b3090ab..66c1757 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1669,13 +1669,6 @@ done: * Programmer: Kent Yang * Tuesday, April 1, 2003 * - * Modifications: - * - * Nat Furrer and James Laird - * June 30, 2004 - * Now ensures that SZIP encoding is enabled - * SZIP defaults to k13 compression - * *------------------------------------------------------------------------- */ herr_t @@ -1685,22 +1678,22 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) H5P_genplist_t *plist; /* Property list pointer */ unsigned cd_values[2]; /* Filter parameters */ unsigned int config_flags; - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIuIu", plist_id, options_mask, pixels_per_block); - if(H5Zget_filter_info(H5Z_FILTER_SZIP, &config_flags) < 0) + if(H5Z_get_filter_info(H5Z_FILTER_SZIP, &config_flags) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't get filter info") - if(! (config_flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED)) + if(!(config_flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED)) HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled.") /* Check arguments */ - if ((pixels_per_block%2)==1) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is not even") - if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large") + if((pixels_per_block % 2) == 1) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is not even") + if(pixels_per_block > H5_SZIP_MAX_PIXELS_PER_BLOCK) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large") /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index befec84..a416b00 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -2289,7 +2289,7 @@ H5P_file_image_info_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UN HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "image_free callback failed") } /* end if */ else - free(info.buffer); + HDfree(info.buffer); } /* end if */ /* Free udata if it exists */ diff --git a/src/H5Pint.c b/src/H5Pint.c index 88c3247..13cc3c1 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -2681,7 +2681,7 @@ done: PURPOSE Internal routine to query the existance of a property in a property list. USAGE - herr_t H5P_exist_plist(plist, name) + htri_t H5P_exist_plist(plist, name) const H5P_genplist_t *plist; IN: Property list to check const char *name; IN: Name of property to check for RETURNS diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index f80e4e7..2166020 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -1453,7 +1453,7 @@ H5P_get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/, /* Filter configuration (assume filter ID has already been checked) */ if(filter_config) - H5Zget_filter_info(filter->id, filter_config); + H5Z_get_filter_info(filter->id, filter_config); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5P_get_filter() */ diff --git a/src/H5S.c b/src/H5S.c index 7ef1da4..2eebba4 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -324,7 +324,7 @@ H5S_extent_release(H5S_extent_t *extent) FUNC_ENTER_NOAPI(FAIL) - assert(extent); + HDassert(extent); /* Release extent */ if(extent->type == H5S_SIMPLE) { @@ -725,7 +725,7 @@ H5S_get_npoints_max(const H5S_t *ds) FUNC_ENTER_NOAPI(0) /* check args */ - assert(ds); + HDassert(ds); switch (H5S_GET_EXTENT_TYPE(ds)) { case H5S_NULL: @@ -755,7 +755,7 @@ H5S_get_npoints_max(const H5S_t *ds) case H5S_NO_CLASS: default: - assert("unknown dataspace class" && 0); + HDassert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)") } @@ -1434,7 +1434,7 @@ H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], FUNC_ENTER_NOAPI(NULL) /* Check arguments */ - assert(rank <=H5S_MAX_RANK); + HDassert(rank <=H5S_MAX_RANK); /* Create the space and set the extent */ if(NULL==(ret_value=H5S_create(H5S_SIMPLE))) @@ -1712,7 +1712,7 @@ H5S_get_simple_extent_type(const H5S_t *space) FUNC_ENTER_NOAPI(H5S_NO_CLASS) - assert(space); + HDassert(space); ret_value=H5S_GET_EXTENT_TYPE(space); diff --git a/src/H5SL.c b/src/H5SL.c index 7581858..5c46fd4 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -754,7 +754,7 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -940,7 +940,7 @@ H5SL_count(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -978,8 +978,8 @@ H5SL_insert(H5SL_t *slist, void *item, const void *key) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1025,8 +1025,8 @@ H5SL_add(H5SL_t *slist, void *item, const void *key) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1252,8 +1252,8 @@ H5SL_search(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1341,8 +1341,8 @@ H5SL_less(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1535,8 +1535,8 @@ H5SL_find(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); - assert(key); + HDassert(slist); + HDassert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1806,7 +1806,7 @@ H5SL_first(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -1840,7 +1840,7 @@ H5SL_next(H5SL_node_t *slist_node) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist_node); + HDassert(slist_node); /* Check internal consistency */ /* (Pre-condition) */ @@ -1874,7 +1874,7 @@ H5SL_prev(H5SL_node_t *slist_node) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist_node); + HDassert(slist_node); /* Check internal consistency */ /* (Pre-condition) */ @@ -1909,7 +1909,7 @@ H5SL_last(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -1943,7 +1943,7 @@ H5SL_item(H5SL_node_t *slist_node) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist_node); + HDassert(slist_node); /* Check internal consistency */ /* (Pre-condition) */ @@ -2040,7 +2040,7 @@ H5SL_release(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2086,7 +2086,7 @@ H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2132,7 +2132,7 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2169,7 +2169,7 @@ H5SL_close(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(slist); + HDassert(slist); /* Check internal consistency */ /* (Pre-condition) */ diff --git a/src/H5Sall.c b/src/H5Sall.c index 8d56c80..19d1efc 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -118,8 +118,8 @@ H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space)); - assert (iter); + HDassert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space)); + HDassert (iter); /* Initialize the number of elements to iterate over */ iter->elmt_left=H5S_GET_SELECT_NPOINTS(space); @@ -158,8 +158,8 @@ H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert (iter); - assert (coords); + HDassert (iter); + HDassert (coords); /* Calculate the coordinates for the current iterator offset */ if(H5V_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0) @@ -193,9 +193,9 @@ H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); - assert (start); - assert (end); + HDassert (iter); + HDassert (start); + HDassert (end); for(u=0; urank; u++) { /* Set the start of the 'all' block */ @@ -231,7 +231,7 @@ H5S_all_iter_nelmts (const H5S_sel_iter_t *iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); + HDassert (iter); FUNC_LEAVE_NOAPI(iter->elmt_left) } /* H5S_all_iter_nelmts() */ @@ -260,7 +260,7 @@ H5S_all_iter_has_next_block (const H5S_sel_iter_t UNUSED *iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); + HDassert (iter); FUNC_LEAVE_NOAPI(FALSE) } /* H5S_all_iter_has_next_block() */ @@ -290,8 +290,8 @@ H5S_all_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); - assert (nelem>0); + HDassert (iter); + HDassert (nelem>0); /* Increment the iterator */ iter->u.all.elmt_offset+=nelem; @@ -324,7 +324,7 @@ H5S_all_iter_next_block(H5S_sel_iter_t UNUSED *iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); + HDassert (iter); FUNC_LEAVE_NOAPI(FAIL) } /* H5S_all_iter_next_block() */ @@ -353,7 +353,7 @@ H5S_all_iter_release (H5S_sel_iter_t UNUSED * iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert (iter); + HDassert (iter); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_all_iter_release() */ @@ -450,7 +450,7 @@ H5S_all_is_valid (const H5S_t UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S_all_is_valid() */ @@ -480,7 +480,7 @@ H5S_all_serial_size (const H5S_t UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); /* Basic number of bytes required to serialize point selection: * + + + @@ -514,7 +514,7 @@ H5S_all_serialize (const H5S_t *space, uint8_t *buf) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); /* Store the preamble information */ UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ @@ -671,7 +671,7 @@ H5S_all_is_contiguous(const H5S_t UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); FUNC_LEAVE_NOAPI(TRUE) } /* H5S_all_is_contiguous() */ @@ -700,7 +700,7 @@ H5S_all_is_single(const H5S_t UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); FUNC_LEAVE_NOAPI(TRUE) } /* H5S_all_is_single() */ @@ -731,7 +731,7 @@ H5S_all_is_regular(const H5S_t UNUSED *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); FUNC_LEAVE_NOAPI(TRUE) } /* H5S_all_is_regular() */ @@ -955,14 +955,14 @@ H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_i FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); - assert(iter); - assert(maxseq>0); - assert(maxelem>0); - assert(nseq); - assert(nelem); - assert(off); - assert(len); + HDassert(space); + HDassert(iter); + HDassert(maxseq>0); + HDassert(maxelem>0); + HDassert(nseq); + HDassert(nelem); + HDassert(off); + HDassert(len); /* Determine the actual number of elements to use */ H5_CHECK_OVERFLOW(iter->elmt_left,hsize_t,size_t); diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 9a993a5..1eb0cbc 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -112,8 +112,8 @@ H5S_select_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(dst); - assert(src); + HDassert(dst); + HDassert(src); /* Copy regular fields */ dst->select=src->select; @@ -152,7 +152,7 @@ H5S_select_release(H5S_t *ds) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(ds); + HDassert(ds); /* Call the selection type's release function */ ret_value=(*ds->select.type->release)(ds); @@ -224,7 +224,7 @@ H5S_select_serial_size(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); /* Call the selection type's serial_size function */ ret_value=(*space->select.type->serial_size)(space); @@ -262,8 +262,8 @@ H5S_select_serialize(const H5S_t *space, uint8_t *buf) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); - assert(buf); + HDassert(space); + HDassert(buf); /* Call the selection type's serialize function */ ret_value=(*space->select.type->serialize)(space,buf); @@ -413,7 +413,7 @@ H5S_select_valid(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(space); + HDassert(space); ret_value = (*space->select.type->is_valid)(space); @@ -452,7 +452,7 @@ H5S_select_deserialize (H5S_t *space, const uint8_t *buf) FUNC_ENTER_NOAPI(FAIL) - assert(space); + HDassert(space); tbuf=buf; UINT32DECODE(tbuf, sel_type); @@ -571,9 +571,9 @@ H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); - assert(start); - assert(end); + HDassert(space); + HDassert(start); + HDassert(end); ret_value = (*space->select.type->bounds)(space,start,end); @@ -650,7 +650,7 @@ H5S_select_is_contiguous(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); ret_value = (*space->select.type->is_contiguous)(space); @@ -687,7 +687,7 @@ H5S_select_is_single(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); ret_value = (*space->select.type->is_single)(space); @@ -724,7 +724,7 @@ H5S_select_is_regular(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); ret_value = (*space->select.type->is_regular)(space); @@ -929,8 +929,8 @@ H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(sel_iter); - assert(coords); + HDassert(sel_iter); + HDassert(coords); /* Call iter_coords routine for selection type */ ret_value = (*sel_iter->type->iter_coords)(sel_iter,coords); @@ -971,9 +971,9 @@ H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) FUNC_ENTER_NOAPI_NOINIT_NOINIT_NOERR /* Check args */ - assert(iter); - assert(start); - assert(end); + HDassert(iter); + HDassert(start); + HDassert(end); /* Call iter_block routine for selection type */ ret_value = (*iter->type->iter_block)(iter,start,end); @@ -1011,7 +1011,7 @@ H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(sel_iter); + HDassert(sel_iter); /* Call iter_nelmts routine for selection type */ ret_value = (*sel_iter->type->iter_nelmts)(sel_iter); @@ -1050,7 +1050,7 @@ H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter) FUNC_ENTER_NOAPI_NOINIT_NOINIT_NOERR /* Check args */ - assert(iter); + HDassert(iter); /* Call iter_has_next_block routine for selection type */ ret_value = (*iter->type->iter_has_next_block)(iter); @@ -1090,8 +1090,8 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(iter); - assert(nelem>0); + HDassert(iter); + HDassert(nelem>0); /* Call iter_next routine for selection type */ ret_value = (*iter->type->iter_next)(iter,nelem); @@ -1135,7 +1135,7 @@ H5S_select_iter_next_block(H5S_sel_iter_t *iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(iter); + HDassert(iter); /* Call iter_next_block routine for selection type */ ret_value = (*iter->type->iter_next_block)(iter); @@ -1173,7 +1173,7 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(sel_iter); + HDassert(sel_iter); /* Call selection type-specific release routine */ ret_value = (*sel_iter->type->iter_release)(sel_iter); @@ -1387,7 +1387,7 @@ H5S_get_select_type(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - assert(space); + HDassert(space); /* Set return value */ ret_value=H5S_GET_SELECT_TYPE(space); diff --git a/src/H5T.c b/src/H5T.c index 65460ed..080af8e 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1349,7 +1349,7 @@ H5T_init_interface(void) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)") /* ========== Datatype Creation Property Class Initialization ============*/ - assert(H5P_CLS_DATATYPE_CREATE_g!=-1); + HDassert(H5P_CLS_DATATYPE_CREATE_g!=-1); /* Get the pointer to group creation class */ if(NULL == (crt_pclass = (H5P_genclass_t *)H5I_object(H5P_CLS_DATATYPE_CREATE_g))) @@ -1914,7 +1914,7 @@ H5T_get_class(const H5T_t *dt, htri_t internal) FUNC_ENTER_NOAPI(H5T_NO_CLASS) - assert(dt); + HDassert(dt); /* Externally, a VL string is a string; internally, a VL string is a VL. */ if(internal) { @@ -2271,7 +2271,7 @@ H5T_get_super(const H5T_t *dt) FUNC_ENTER_NOAPI(NULL) - assert(dt); + HDassert(dt); if (!dt->shared->parent) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type"); @@ -2319,11 +2319,11 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(src); - assert(dst); - assert(func); - assert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers); - assert(name && *name); + HDassert(src); + HDassert(dst); + HDassert(func); + HDassert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers); + HDassert(name && *name); if(H5T_PERS_HARD == pers) { /* Only bother to register the path if it's not a no-op path (for this machine) */ @@ -2369,7 +2369,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, */ for (i=1; iis_hard || @@ -3435,7 +3435,7 @@ H5T_lock (H5T_t *dt, hbool_t immutable) FUNC_ENTER_NOAPI(FAIL) - assert (dt); + HDassert (dt); switch (dt->shared->state) { case H5T_STATE_TRANSIENT: @@ -3709,10 +3709,10 @@ H5T_set_size(H5T_t *dt, size_t size) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(dt); - assert(size!=0); - assert(H5T_REFERENCE!=dt->shared->type); - assert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); + HDassert(dt); + HDassert(size!=0); + HDassert(H5T_REFERENCE!=dt->shared->type); + HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { if (H5T_set_size(dt->shared->parent, size)<0) @@ -3841,12 +3841,12 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_VLEN: case H5T_ARRAY: case H5T_REFERENCE: - assert("can't happen" && 0); + HDassert("can't happen" && 0); case H5T_NO_CLASS: case H5T_NCLASSES: - assert("invalid type" && 0); + HDassert("invalid type" && 0); default: - assert("not implemented yet" && 0); + HDassert("not implemented yet" && 0); } /* Commit (if we didn't convert this type to a VL string) */ @@ -3893,7 +3893,7 @@ H5T_get_size(const H5T_t *dt) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(dt); + HDassert(dt); FUNC_LEAVE_NOAPI(dt->shared->size) } @@ -3999,9 +3999,9 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #ifdef H5T_DEBUG /* I don't quite trust the code above yet :-) --RPM */ for (u=0; ushared->u.compnd.nmembs-1; u++) { - assert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, + HDassert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, dt1->shared->u.compnd.memb[idx1[u + 1]].name)); - assert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name, + HDassert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name, dt2->shared->u.compnd.memb[idx2[u + 1]].name)); } #endif @@ -4079,9 +4079,9 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #ifdef H5T_DEBUG /* I don't quite trust the code above yet :-) --RPM */ for (u=0; ushared->u.enumer.nmembs-1; u++) { - assert(HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], + HDassert(HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], dt1->shared->u.enumer.name[idx1[u+1]])); - assert(HDstrcmp(dt2->shared->u.enumer.name[idx2[u]], + HDassert(HDstrcmp(dt2->shared->u.enumer.name[idx2[u]], dt2->shared->u.enumer.name[idx2[u+1]])); } #endif @@ -4137,10 +4137,10 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) break; case H5T_VLEN: - assert(dt1->shared->u.vlen.type>H5T_VLEN_BADTYPE && dt1->shared->u.vlen.typeshared->u.vlen.type>H5T_VLEN_BADTYPE && dt2->shared->u.vlen.typeshared->u.vlen.loc>=H5T_LOC_BADLOC && dt1->shared->u.vlen.locshared->u.vlen.loc>=H5T_LOC_BADLOC && dt2->shared->u.vlen.locshared->u.vlen.type>H5T_VLEN_BADTYPE && dt1->shared->u.vlen.typeshared->u.vlen.type>H5T_VLEN_BADTYPE && dt2->shared->u.vlen.typeshared->u.vlen.loc>=H5T_LOC_BADLOC && dt1->shared->u.vlen.locshared->u.vlen.loc>=H5T_LOC_BADLOC && dt2->shared->u.vlen.locshared->u.vlen.type==H5T_VLEN_SEQUENCE && @@ -4300,14 +4300,14 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) case H5R_BADTYPE: case H5R_MAXTYPE: - assert("invalid type" && 0); + HDassert("invalid type" && 0); default: - assert("not implemented yet" && 0); + HDassert("not implemented yet" && 0); } break; default: - assert("not implemented yet" && 0); + HDassert("not implemented yet" && 0); } break; } /* end switch */ @@ -4633,7 +4633,7 @@ H5T_path_noop(const H5T_path_t *p) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(p); + HDassert(p); FUNC_LEAVE_NOAPI(p->is_noop || (p->is_hard && 0==H5T_cmp(p->src, p->dst, FALSE))) } /* end H5T_path_noop() */ @@ -4702,7 +4702,7 @@ H5T_path_bkg(const H5T_path_t *p) { FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(p); + HDassert(p); FUNC_LEAVE_NOAPI(p->cdata.need_bkg) } /* end H5T_path_bkg() */ @@ -4918,7 +4918,7 @@ H5T_is_immutable(const H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) - assert(dt); + HDassert(dt); if(dt->shared->state == H5T_STATE_IMMUTABLE) ret_value = TRUE; @@ -4951,7 +4951,7 @@ H5T_is_named(const H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) - assert(dt); + HDassert(dt); if(dt->shared->state == H5T_STATE_OPEN || dt->shared->state == H5T_STATE_NAMED) ret_value = TRUE; @@ -4988,7 +4988,7 @@ H5T_get_ref_type(const H5T_t *dt) FUNC_ENTER_NOAPI(H5R_BADTYPE) - assert(dt); + HDassert(dt); if(dt->shared->type==H5T_REFERENCE) ret_value=dt->shared->u.atomic.u.r.rtype; @@ -5022,7 +5022,7 @@ H5T_is_sensible(const H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) - assert(dt); + HDassert(dt); switch(dt->shared->type) { case H5T_COMPOUND: @@ -5087,8 +5087,8 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) FUNC_ENTER_NOAPI(FAIL) - assert(dt); - assert(loc>=H5T_LOC_BADLOC && loc=H5T_LOC_BADLOC && locshared->force_conv) { diff --git a/src/H5Tconv.c b/src/H5Tconv.c index b732817..9ff0f00 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -189,7 +189,7 @@ * to the destination. SLU - 2005/06/29 */ #define H5T_CONV_Xx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -198,7 +198,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -211,16 +211,16 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Xx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ *(D) = (DT)(D_MIN); \ } else \ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ux_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -233,7 +233,7 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ux_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ *(D) = (DT)(D_MAX); \ } else \ *(D) = (DT)(*(S)); \ @@ -241,7 +241,7 @@ #define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_sU_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -266,7 +266,7 @@ #define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_sU, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -283,7 +283,7 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_uS_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if (sizeof(ST)==sizeof(DT) && *(S) > (D_MAX)) { \ + if (sizeof(ST)==sizeof(DT) && *(S) > (DT)(D_MAX)) { \ *(D) = (D_MAX); \ } else \ *(D) = (DT)(*(S)); \ @@ -291,17 +291,17 @@ #define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_uS, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Xx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -314,7 +314,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) { \ + } else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -329,7 +329,7 @@ #define H5T_CONV_Su_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ if(*(S) < 0) \ *(D) = 0; \ - else if (sizeof(ST)>sizeof(DT) && *(S) > (DT)(D_MAX)) \ + else if (sizeof(ST)>sizeof(DT) && *(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ else \ *(D) = (DT)(*(S)); \ @@ -337,17 +337,17 @@ #define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -374,12 +374,12 @@ #define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_su, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ - if (*(S) > (DT)(D_MAX)) { \ + if (*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -393,7 +393,7 @@ } #define H5T_CONV_us_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ /* Assumes memory format of unsigned & signed integers is same */ \ - if(*(S) > (DT)(D_MAX)) \ + if(*(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ else \ *(D) = (DT)(*(S)); \ @@ -401,19 +401,19 @@ #define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_us, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } /* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN * when an overflow occurs, use the 'float' infinity values. */ #define H5T_CONV_Ff_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX)) { \ + if(*(S) > (ST)(D_MAX)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -422,7 +422,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -435,9 +435,9 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Ff_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX)) \ + if(*(S) > (ST)(D_MAX)) \ *(D) = (H5T_NATIVE_FLOAT_POS_INF_g); \ - else if (*(S) < (DT)(D_MIN)) \ + else if (*(S) < (ST)(D_MIN)) \ *(D) = (H5T_NATIVE_FLOAT_NEG_INF_g); \ else \ *(D) = (DT)(*(S)); \ @@ -445,7 +445,7 @@ #define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ HDcompile_assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ff, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ } #define H5T_HI_LO_BIT_SET(TYP, V, LO, HI) { \ @@ -455,8 +455,8 @@ \ count = 0; \ for(u = 0; u < sizeof(TYP); u++) { \ - count = ((sizeof(TYP) - 1) - u) * 8; \ - p = ((V) >> count) & 0xff; \ + count = (((unsigned)sizeof(TYP) - 1) - u) * 8; \ + p = (unsigned char)((V) >> count); \ if(p > 0) { \ if(p & 0x80) \ count += 7; \ @@ -480,7 +480,7 @@ \ count = 0; \ for(u = 0; u < sizeof(TYP); u++) { \ - p = ((V) >> (u * 8)) & 0xff; \ + p = (unsigned char)((V) >> (u * 8)); \ if(p > 0) { \ count = u * 8; \ \ @@ -536,7 +536,7 @@ } #define H5T_CONV_xF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xF, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ } /* Quincey added the condition branch (else if (*(S) != (ST)((DT)(*(S))))). @@ -544,11 +544,11 @@ * of "INT_MAX". Compilers do roundup making this value "INT_MAX+1". This branch * is to check that situation and return exception for some compilers, mainly GCC. * The branch if (*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) == - * (DT)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under + * (ST)(D_MAX))) is for some compilers like Sun, HP, IBM, and SGI where under * the same situation the "int" doesn't overflow. SLU - 2005/9/12 */ #define H5T_CONV_Fx_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX) || (sprec < dprec && *(S) == (DT)(D_MAX))) { \ + if(*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -557,7 +557,7 @@ else if(except_ret == H5T_CONV_ABORT) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ - } else if (*(S) < (DT)(D_MIN)) { \ + } else if (*(S) < (ST)(D_MIN)) { \ H5T_conv_ret_t except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, \ src_id, dst_id, S, D, cb_struct.user_data); \ if(except_ret == H5T_CONV_UNHANDLED) \ @@ -580,28 +580,31 @@ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Fx_NOEX_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ - if(*(S) > (DT)(D_MAX)) \ + if(*(S) > (ST)(D_MAX)) \ *(D) = (DT)(D_MAX); \ - else if(*(S) < (DT)(D_MIN)) \ + else if(*(S) < (ST)(D_MIN)) \ *(D) = (DT)(D_MIN); \ else \ *(D) = (DT)(*(S)); \ } #define H5T_CONV_Fx(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ - H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ } /* Since all "no exception" cores do the same thing (assign the value in the * source location to the destination location, using casting), use one "core" * to do them all. */ +#ifndef H5_WANT_DCONV_EXCEPTION #define H5T_CONV_NO_EXCEPT_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ *(D) = (DT)(*(S)); \ } +#endif /* H5_WANT_DCONV_EXCEPTION */ + /* The main part of every integer hardware conversion macro */ -#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) \ +#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,PREC) \ { \ herr_t ret_value=SUCCEED; /* Return value */ \ \ @@ -609,13 +612,11 @@ \ { \ size_t elmtno; /*element number */ \ - size_t sprec; /*source precision */ \ - size_t dprec; /*destination precision */ \ + H5T_CONV_DECL_PREC(PREC) /*declare precision variables, or not */ \ uint8_t *src_buf; /*'raw' source buffer */ \ uint8_t *dst_buf; /*'raw' destination buffer */ \ ST *src, *s; /*source buffer */ \ DT *dst, *d; /*destination buffer */ \ - H5T_class_t tclass; /*datatype's class */ \ H5T_t *st, *dt; /*datatype descriptors */ \ ST src_aligned; /*source aligned type */ \ DT dst_aligned; /*destination aligned type */ \ @@ -647,8 +648,8 @@ case H5T_CONV_CONV: \ /* Initialize source & destination strides */ \ if (buf_stride) { \ - assert(buf_stride>=sizeof(ST)); \ - assert(buf_stride>=sizeof(DT)); \ + HDassert(buf_stride >= sizeof(ST)); \ + HDassert(buf_stride >= sizeof(DT)); \ s_stride = d_stride = (ssize_t)buf_stride; \ } else { \ s_stride = sizeof(ST); \ @@ -659,11 +660,11 @@ s_mv = H5T_NATIVE_##STYPE##_ALIGN_g>1 && \ ((size_t)buf%H5T_NATIVE_##STYPE##_ALIGN_g || \ /* Cray */ ((size_t)((ST*)buf)!=(size_t)buf) || \ - s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \ + (size_t)s_stride%H5T_NATIVE_##STYPE##_ALIGN_g); \ d_mv = H5T_NATIVE_##DTYPE##_ALIGN_g>1 && \ ((size_t)buf%H5T_NATIVE_##DTYPE##_ALIGN_g || \ /* Cray */ ((size_t)((DT*)buf)!=(size_t)buf) || \ - d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \ + (size_t)d_stride%H5T_NATIVE_##DTYPE##_ALIGN_g); \ CI_INC_SRC(s_mv) \ CI_INC_DST(d_mv) \ \ @@ -679,19 +680,7 @@ if(NULL == (st = (H5T_t *)H5I_object(src_id)) || NULL == (dt = (H5T_t *)H5I_object(dst_id))) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to dereference datatype object ID") \ \ - /* Get source & destination precisions into a variable */ \ - tclass = st->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ - if(tclass == H5T_INTEGER) \ - sprec = st->shared->u.atomic.prec; \ - else \ - sprec = 1 + st->shared->u.atomic.u.f.msize; \ - tclass = dt->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ - if(tclass == H5T_INTEGER) \ - dprec = dt->shared->u.atomic.prec; \ - else \ - dprec = 1 + dt->shared->u.atomic.u.f.msize; \ + H5T_CONV_SET_PREC(PREC) /*init precision variables, or not */ \ \ /* The outer loop of the type conversion macro, controlling which */ \ /* direction the buffer is walked */ \ @@ -701,21 +690,21 @@ /* Compute the number of "safe" destination elements at */ \ /* the end of the buffer (Those which don't overlap with */ \ /* any source elements at the beginning of the buffer) */ \ - safe=nelmts-(((nelmts*s_stride)+(d_stride-1))/d_stride); \ + safe = nelmts - (((nelmts * (size_t)s_stride) + (size_t)(d_stride - 1)) / (size_t)d_stride); \ \ /* If we're down to the last few elements, just wrap up */ \ /* with a "real" reverse copy */ \ if(safe<2) { \ - src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-1)*s_stride); \ - dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-1)*d_stride); \ + src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride); \ + dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride); \ s_stride = -s_stride; \ d_stride = -d_stride; \ \ safe=nelmts; \ } /* end if */ \ else { \ - src = (ST *)(src_buf = (uint8_t*)buf+(nelmts-safe)*s_stride); \ - dst = (DT *)(dst_buf = (uint8_t*)buf+(nelmts-safe)*d_stride); \ + src = (ST *)(src_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride); \ + dst = (DT *)(dst_buf = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride); \ } /* end else */ \ } /* end if */ \ else { \ @@ -757,6 +746,36 @@ done: \ FUNC_LEAVE_NOAPI(ret_value) \ } +/* Declare the source & destination precision variables */ +#define H5T_CONV_DECL_PREC(PREC) H5_GLUE(H5T_CONV_DECL_PREC_, PREC) + +#define H5T_CONV_DECL_PREC_Y \ + size_t sprec; /*source precision */ \ + size_t dprec; /*destination precision */ \ + H5T_class_t tclass; /*datatype's class */ + +#define H5T_CONV_DECL_PREC_N /*no precision variables */ + +/* Initialize the source & destination precision variables */ +#define H5T_CONV_SET_PREC(PREC) H5_GLUE(H5T_CONV_SET_PREC_, PREC) + +#define H5T_CONV_SET_PREC_Y \ + /* Get source & destination precisions into a variable */ \ + tclass = st->shared->type; \ + HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + if(tclass == H5T_INTEGER) \ + sprec = st->shared->u.atomic.prec; \ + else \ + sprec = 1 + st->shared->u.atomic.u.f.msize; \ + tclass = dt->shared->type; \ + HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + if(tclass == H5T_INTEGER) \ + dprec = dt->shared->u.atomic.prec; \ + else \ + dprec = 1 + dt->shared->u.atomic.u.f.msize; + +#define H5T_CONV_SET_PREC_N /*don't init precision variables */ + /* Macro defining action on source data which needs to be aligned (before main action) */ #define H5T_CONV_LOOP_PRE_SALIGN(ST) { \ HDmemcpy(&src_aligned, src, sizeof(ST)); \ @@ -903,7 +922,7 @@ typedef struct H5T_conv_struct_t { /* Conversion data for H5T__conv_enum() */ typedef struct H5T_enum_struct_t { int base; /*lowest `in' value */ - int length; /*num elements in arrays */ + unsigned length; /*num elements in arrays */ int *src2dst; /*map from src to dst index */ } H5T_enum_struct_t; @@ -1085,6 +1104,15 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") break; + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_STRING: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") } @@ -1402,6 +1430,9 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, H5_SWAP_BYTES(buf, 7, 8); } /* end for */ break; + + default: + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "invalid conversion size") } /* end switch */ break; @@ -1487,6 +1518,16 @@ H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ break; + case H5T_NO_CLASS: + case H5T_TIME: + case H5T_STRING: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported") } /* end switch */ @@ -1543,7 +1584,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */ - int direction; /*direction of traversal */ + ssize_t direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t olap; /*num overlapping elements */ size_t half_size; /*1/2 of total size for swapping*/ @@ -1620,6 +1661,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_rev = (uint8_t *)H5MM_calloc(src->shared->size); /* The conversion loop */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); for(elmtno = 0; elmtno < nelmts; elmtno++) { /* @@ -1703,6 +1747,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, TRUE); break; + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported LSB padding") } /* end switch */ @@ -1715,6 +1762,10 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_PAD_ONE: H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, TRUE); break; + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported MSB padding") } /* end switch */ @@ -1739,12 +1790,12 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(d == dbuf) HDmemcpy(dp, d, dst->shared->size); if(buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; + sp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ + dp += direction * (ssize_t)buf_stride; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ } /* end if */ else { - sp += direction * src->shared->size; - dp += direction * dst->shared->size; + sp += direction * (ssize_t)src->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ + dp += direction * (ssize_t)dst->shared->size; /* Note that cast is checked with H5_CHECK_OVERFLOW, above */ } /* end else */ } /* end for */ @@ -2062,20 +2113,6 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata) * Programmer: Robb Matzke * Thursday, January 22, 1998 * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is - * non-zero then convert one value at each memory location - * advancing BUF_STRIDE bytes each time; otherwise assume - * both source and destination values are packed. - * - * Robb Matzke, 2000-05-17 - * Added the BKG_STRIDE argument to fix a design bug. If - * BUF_STRIDE and BKG_STRIDE are both non-zero then each - * data element converted will be placed temporarily at a - * multiple of BKG_STRIDE in the BKG buffer; otherwise the - * BKG buffer is assumed to be a packed array of destination - * datatype. *------------------------------------------------------------------------- */ herr_t @@ -2091,7 +2128,8 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */ size_t offset; /*byte offset wrt struct */ - size_t src_delta; /*source stride */ + ssize_t src_delta; /*source stride */ + ssize_t bkg_delta; /*background stride */ size_t elmtno; unsigned u; /*counters */ int i; /*counters */ @@ -2149,17 +2187,22 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Direction of conversion and striding through background. */ if(buf_stride) { - src_delta = buf_stride; - if(!bkg_stride) - bkg_stride = dst->shared->size; + H5_ASSIGN_OVERFLOW(src_delta, buf_stride, size_t, ssize_t); + if(!bkg_stride) { + H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); + } /* end if */ + else + H5_ASSIGN_OVERFLOW(bkg_delta, bkg_stride, size_t, ssize_t); } /* end if */ else if(dst->shared->size <= src->shared->size) { - src_delta = src->shared->size; - bkg_stride = dst->shared->size; + H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); + H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); } /* end else-if */ else { - src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/ - bkg_stride = -(int)dst->shared->size; /*overflow shouldn't be possible*/ + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + src_delta = -(ssize_t)src->shared->size; + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + bkg_delta = -(ssize_t)dst->shared->size; xbuf += (nelmts - 1) * src->shared->size; xbkg += (nelmts - 1) * dst->shared->size; } /* end else */ @@ -2204,7 +2247,8 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * yet). Then copy the member to the destination offset in the * background buffer. */ - for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); + for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; /*subsetting*/ src_memb = src->shared->u.compnd.memb + i; @@ -2229,12 +2273,12 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Update pointers */ xbuf += src_delta; - xbkg += bkg_stride; + xbkg += bkg_delta; } /* end for */ - /* If the bkg_stride was set to -(dst->shared->size), make it positive now */ + /* If the bkg_delta was set to -(dst->shared->size), make it positive now */ if(buf_stride == 0 && dst->shared->size > src->shared->size) - bkg_stride = dst->shared->size; + H5_ASSIGN_OVERFLOW(bkg_delta, dst->shared->size, size_t, ssize_t); /* * Copy the background buffer back into the in-place conversion @@ -2243,7 +2287,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, for(xbuf = buf, xbkg = bkg, elmtno = 0; elmtno < nelmts; elmtno++) { HDmemmove(xbuf, xbkg, dst->shared->size); xbuf += buf_stride ? buf_stride : dst->shared->size; - xbkg += bkg_stride; + xbkg += bkg_delta; } /* end for */ break; @@ -2390,7 +2434,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, if(dst_memb->size > src_memb->size) offset += src_memb->size; } /* end for */ - for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); + for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; @@ -2509,7 +2554,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * is larger than the source) and them to their final position in the * bkg buffer. */ - for(i = src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); + for(i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if(src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; @@ -2605,7 +2651,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) j++; if(j >= dst->shared->u.enumer.nmembs) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source type is not a subset of destination type") - priv->src2dst[i] = j; + priv->src2dst[i] = (int)j; } /* end for */ /* @@ -2634,45 +2680,44 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * Because this is the optimized code, we won't fix it. It should still work in some * situations. SLU - 2011/5/24) */ - if (1==src->shared->size || sizeof(short)==src->shared->size || sizeof(int)==src->shared->size) { - for (i=0; ishared->u.enumer.nmembs; i++) { - if (1==src->shared->size) { - n = *((signed char*)(src->shared->u.enumer.value+i)); - } else if (sizeof(short)==src->shared->size) { - n = *((short*)(src->shared->u.enumer.value+i*src->shared->size)); - } else { - n = *((int*)(src->shared->u.enumer.value+i*src->shared->size)); - } - if (0==i) { + if(1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) { + for(i = 0; i < src->shared->u.enumer.nmembs; i++) { + if(1 == src->shared->size) + n = *((signed char *)(src->shared->u.enumer.value + i)); + else if (sizeof(short) == src->shared->size) + n = *((short *)(src->shared->u.enumer.value + i * src->shared->size)); + else + n = *((int *)(src->shared->u.enumer.value + i * src->shared->size)); + if(0 == i) { domain[0] = domain[1] = n; } else { domain[0] = MIN(domain[0], n); domain[1] = MAX(domain[1], n); } - } + } /* end for */ - length = (domain[1]-domain[0])+1; - if (src->shared->u.enumer.nmembs<2 || - (double)length/src->shared->u.enumer.nmembs<1.2) { + HDassert(domain[1] >= domain[0]); + length = (unsigned)(domain[1] - domain[0]) + 1; + if(src->shared->u.enumer.nmembs < 2 || + (double)length / src->shared->u.enumer.nmembs < (double)(1.2f)) { priv->base = domain[0]; priv->length = length; - if (NULL==(map=(int *)H5MM_malloc(length*sizeof(int)))) + if(NULL == (map = (int *)H5MM_malloc(length * sizeof(int)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - for (i=0; ishared->u.enumer.nmembs; i++) { - if (1==src->shared->size) { - n = *((signed char*)(src->shared->u.enumer.value+i)); - } else if (sizeof(short)==src->shared->size) { - n = *((short*)(src->shared->u.enumer.value+i*src->shared->size)); - } else { - n = *((int*)(src->shared->u.enumer.value+i*src->shared->size)); - } + for(i = 0; i < src->shared->u.enumer.nmembs; i++) { + if(1 == src->shared->size) + n = *((signed char *)(src->shared->u.enumer.value + i)); + else if(sizeof(short) == src->shared->size) + n = *((short *)(src->shared->u.enumer.value + i * src->shared->size)); + else + n = *((int *)(src->shared->u.enumer.value + i * src->shared->size)); n -= priv->base; - assert(n>=0 && nlength); - assert(map[n]<0); + HDassert(n >= 0 && (unsigned)n < priv->length); + HDassert(map[n] < 0); map[n] = priv->src2dst[i]; - } + } /* end for */ /* * Replace original src2dst array with our new one. The original @@ -2718,9 +2763,8 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */ - H5T_t *src_super = NULL, *dst_super = NULL; /*parent types for src and dst*/ uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */ - int src_delta, dst_delta; /*conversion strides */ + ssize_t src_delta, dst_delta; /*conversion strides */ int n; /*src value cast as native int */ H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv); H5P_genplist_t *plist; /*property list pointer */ @@ -2785,17 +2829,20 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Direction of conversion. */ if(buf_stride) { - src_delta = dst_delta = (int)buf_stride; + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + src_delta = dst_delta = (ssize_t)buf_stride; s = d = buf; } else if(dst->shared->size <= src->shared->size) { - src_delta = (int)src->shared->size; /*overflow shouldn't be possible*/ - dst_delta = (int)dst->shared->size; /*overflow shouldn't be possible*/ + H5_ASSIGN_OVERFLOW(src_delta, src->shared->size, size_t, ssize_t); + H5_ASSIGN_OVERFLOW(dst_delta, dst->shared->size, size_t, ssize_t); s = d = buf; } else { - src_delta = -(int)src->shared->size; /*overflow shouldn't be possible*/ - dst_delta = -(int)dst->shared->size; /*overflow shouldn't be possible*/ - s = buf + (nelmts-1) * src->shared->size; - d = buf + (nelmts-1) * dst->shared->size; + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = -(ssize_t)src->shared->size; + dst_delta = -(ssize_t)dst->shared->size; + s = buf + (nelmts - 1) * src->shared->size; + d = buf + (nelmts - 1) * dst->shared->size; } /* Get the plist structure */ @@ -2822,28 +2869,29 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, else n = *((int*)s); n -= priv->base; - if(n < 0 || n >= priv->length || priv->src2dst[n] < 0) { + if(n < 0 || (unsigned)n >= priv->length || priv->src2dst[n] < 0) { /*overflow*/ except_ret = H5T_CONV_UNHANDLED; - if(cb_struct.func) { /*If user's exception handler is present, use it*/ + /*If user's exception handler is present, use it*/ + if(cb_struct.func) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, s, d, cb_struct.user_data); - } - if(except_ret == H5T_CONV_UNHANDLED) { + if(except_ret == H5T_CONV_UNHANDLED) HDmemset(d, 0xff, dst->shared->size); - } else if(except_ret == H5T_CONV_ABORT) + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - } else { + } else HDmemcpy(d, - dst->shared->u.enumer.value+priv->src2dst[n]*dst->shared->size, + dst->shared->u.enumer.value + (unsigned)priv->src2dst[n] * dst->shared->size, dst->shared->size); - } - } else { + } /* end if */ + else { /* Use O(log N) lookup */ - int lt = 0; - int rt = src->shared->u.enumer.nmembs; - int md, cmp; + unsigned lt = 0; + unsigned rt = src->shared->u.enumer.nmembs; + unsigned md; + int cmp; while(lt < rt) { md = (lt + rt) / 2; @@ -2858,22 +2906,23 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end while */ if(lt >= rt) { except_ret = H5T_CONV_UNHANDLED; - if(cb_struct.func) { /*If user's exception handler is present, use it*/ + /*If user's exception handler is present, use it*/ + if(cb_struct.func) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src, d, cb_struct.user_data); - } - if(except_ret == H5T_CONV_UNHANDLED) { + if(except_ret == H5T_CONV_UNHANDLED) HDmemset(d, 0xff, dst->shared->size); - } else if(except_ret == H5T_CONV_ABORT) + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") } /* end if */ else { + HDassert(priv->src2dst[md] >= 0); HDmemcpy(d, - dst->shared->u.enumer.value+priv->src2dst[md]*dst->shared->size, + dst->shared->u.enumer.value + (unsigned)priv->src2dst[md] * dst->shared->size, dst->shared->size); } /* end else */ - } + } /* end else */ } break; @@ -2906,7 +2955,7 @@ done: */ herr_t H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, + size_t UNUSED buf_stride, size_t UNUSED bkg_stride, void *_buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { H5T_t *src, *dst; /*src and dst datatypes */ @@ -3017,7 +3066,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_path_t *tpath = NULL; /* Type conversion path */ hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */ hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */ - hbool_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ + htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */ H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ @@ -3028,7 +3077,6 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, ssize_t s_stride, d_stride; /*src and dst strides */ ssize_t b_stride; /*bkg stride */ size_t safe; /*how many elements are safe to process in each pass */ - ssize_t seq_len; /*the number of elements in the current sequence*/ size_t bg_seq_len = 0; size_t src_base_size, dst_base_size;/*source & destination base size*/ void *conv_buf = NULL; /*temporary conversion buffer */ @@ -3116,12 +3164,13 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, noop_conv = TRUE; /* Check if we need a temporary buffer for this conversion */ - parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE); + if((parent_is_vlen = H5T_detect_class(dst->shared->parent, H5T_VLEN, FALSE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_SYSTEM, FAIL, "internal error when detecting variable-length class") if(tpath->cdata.need_bkg || parent_is_vlen) { /* Set up initial background buffer */ tmp_buf_size = MAX(src_base_size, dst_base_size); if(NULL == (tmp_buf = H5FL_BLK_CALLOC(vlen_seq,tmp_buf_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for type conversion") } /* end if */ /* Get the allocation info */ @@ -3141,17 +3190,22 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, while(nelmts > 0) { /* Check if we need to go backwards through the buffer */ if(d_stride > s_stride) { + /* Sanity check */ + HDassert(s_stride > 0); + HDassert(d_stride > 0); + HDassert(b_stride >= 0); + /* Compute the number of "safe" destination elements at */ /* the end of the buffer (Those which don't overlap with */ /* any source elements at the beginning of the buffer) */ - safe = nelmts - (((nelmts * s_stride) + (d_stride - 1)) / d_stride); + safe = nelmts - (((nelmts * (size_t)s_stride) + ((size_t)d_stride - 1)) / (size_t)d_stride); /* If we're down to the last few elements, just wrap up */ /* with a "real" reverse copy */ if(safe < 2) { - s = (uint8_t *)buf + (nelmts - 1) * s_stride; - d = (uint8_t *)buf + (nelmts - 1) * d_stride; - b = (uint8_t *)bkg + (nelmts - 1) * b_stride; + s = (uint8_t *)buf + (nelmts - 1) * (size_t)s_stride; + d = (uint8_t *)buf + (nelmts - 1) * (size_t)d_stride; + b = (uint8_t *)bkg + (nelmts - 1) * (size_t)b_stride; s_stride = -s_stride; d_stride = -d_stride; b_stride = -b_stride; @@ -3159,9 +3213,9 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, safe = nelmts; } /* end if */ else { - s = (uint8_t *)buf + (nelmts - safe) * s_stride; - d = (uint8_t *)buf + (nelmts - safe) * d_stride; - b = (uint8_t *)bkg + (nelmts - safe) * b_stride; + s = (uint8_t *)buf + (nelmts - safe) * (size_t)s_stride; + d = (uint8_t *)buf + (nelmts - safe) * (size_t)d_stride; + b = (uint8_t *)bkg + (nelmts - safe) * (size_t)b_stride; } /* end else */ } /* end if */ else { @@ -3179,9 +3233,13 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't set VL data to 'nil'") } /* end if */ else { + ssize_t sseq_len; /* (signed) The number of elements in the current sequence*/ + size_t seq_len; /* The number of elements in the current sequence*/ + /* Get length of element sequences */ - if((seq_len = (*(src->shared->u.vlen.getlen))(s)) < 0) + if((sseq_len = (*(src->shared->u.vlen.getlen))(s)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "incorrect length") + seq_len = (size_t)sseq_len; /* If we are reading from memory and there is no conversion, just get the pointer to sequence */ if(write_to_file && noop_conv) { @@ -3230,7 +3288,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* If we are writing and there is a nested VL type, read * the sequence into the background buffer */ if(nested) { - uint8_t *tmp = b; + const uint8_t *tmp = b; UINT32DECODE(tmp, bg_seq_len); if(bg_seq_len > 0) { @@ -3240,40 +3298,40 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") HDmemset(tmp_buf, 0, tmp_buf_size); } /* end if */ - H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp, &(bg_hobjid.addr)); - INT32DECODE(tmp, bg_hobjid.idx); + H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(bg_hobjid.addr)); + UINT32DECODE(tmp, bg_hobjid.idx); if(NULL == H5HG_read(dst->shared->u.vlen.f, dxpl_id, &bg_hobjid, tmp_buf, NULL)) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "can't read VL sequence into background buffer") } /* end if */ /* If the sequence gets shorter, pad out the original sequence with zeros */ - if((ssize_t)bg_seq_len < seq_len) + if(bg_seq_len < seq_len) HDmemset((uint8_t *)tmp_buf + dst_base_size * bg_seq_len, 0, (seq_len - bg_seq_len) * dst_base_size); } /* end if */ /* Convert VL sequence */ - if(H5T_convert(tpath, tsrc_id, tdst_id, (size_t)seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) + if(H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ /* Write sequence to destination location */ - if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, (size_t)seq_len, dst_base_size) < 0) + if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, seq_len, dst_base_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't write VL data") if(!noop_conv) { /* For nested VL case, free leftover heap objects from the deeper level if the length of new data elements is shorter than the old data elements.*/ - if(nested && seq_len < (ssize_t)bg_seq_len) { + if(nested && seq_len < bg_seq_len) { size_t parent_seq_len; - uint8_t *tmp_p; + const uint8_t *tmp; size_t u; /* TMP_P is reset each time in the loop because DST_BASE_SIZE may include some data in addition to VL info. - SLU */ for(u = seq_len; u < bg_seq_len; u++) { - tmp_p = (uint8_t*)tmp_buf + u * dst_base_size; - UINT32DECODE(tmp_p, parent_seq_len); + tmp = (uint8_t *)tmp_buf + u * dst_base_size; + UINT32DECODE(tmp, parent_seq_len); if(parent_seq_len > 0) { - H5F_addr_decode(dst->shared->u.vlen.f, (const uint8_t **)&tmp_p, &(parent_hobjid.addr)); - INT32DECODE(tmp_p, parent_hobjid.idx); + H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(parent_hobjid.addr)); + UINT32DECODE(tmp, parent_hobjid.idx); if(H5HG_remove(dst->shared->u.vlen.f, dxpl_id, &parent_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") } /* end if */ @@ -3343,7 +3401,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ uint8_t *sp, *dp; /*source and dest traversal ptrs */ - size_t src_delta, dst_delta; /*source & destination stride */ + ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number counter */ unsigned u; /* local index variable */ @@ -3408,8 +3466,11 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Direction & size of buffer traversal. */ - src_delta = direction * (buf_stride ? buf_stride : src->shared->size); - dst_delta = direction * (buf_stride ? buf_stride : dst->shared->size); + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); /* Set up conversion path for base elements */ if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) { @@ -3499,6 +3560,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ + ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t half_size; /*half the type size */ @@ -3563,6 +3625,15 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } + /* + * Direction & size of buffer traversal. + */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") @@ -3575,25 +3646,25 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_rev = (uint8_t*)H5MM_calloc(src->shared->size); /* The conversion loop */ - for (elmtno=0; elmtno0) { + if(direction > 0) { s = sp; - d = elmtno= nelmts ? dbuf : dp; + d = elmtno + olap >= nelmts ? dbuf : dp; } #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d==dbuf) { - assert ((dp>=sp && dpshared->size) || (sp>=dp && spshared->size)); + HDassert((dp>=sp && dpshared->size) || (sp>=dp && spshared->size)); } else { - assert ((dpshared->size<=sp) || (spshared->size<=dp)); + HDassert((dpshared->size<=sp) || (spshared->size<=dp)); } #endif @@ -3817,11 +3888,11 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Set padding areas in destination. */ if (dst->shared->u.atomic.offset>0) { - assert(H5T_PAD_ZERO==dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad); + HDassert(H5T_PAD_ZERO==dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad); H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad)); } if (dst->shared->u.atomic.offset+dst->shared->u.atomic.prec!=8*dst->shared->size) { - assert (H5T_PAD_ZERO==dst->shared->u.atomic.msb_pad || H5T_PAD_ONE==dst->shared->u.atomic.msb_pad); + HDassert(H5T_PAD_ZERO==dst->shared->u.atomic.msb_pad || H5T_PAD_ONE==dst->shared->u.atomic.msb_pad); H5T__bit_set (d, dst->shared->u.atomic.offset+dst->shared->u.atomic.prec, 8*dst->shared->size - (dst->shared->u.atomic.offset+ dst->shared->u.atomic.prec), (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.msb_pad)); @@ -3844,16 +3915,13 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * If we had used a temporary buffer for the destination then we * should copy the value to the true destination buffer. */ - if (d==dbuf) - HDmemcpy (dp, d, dst->shared->size); - if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; - } else { - sp += direction * src->shared->size; - dp += direction * dst->shared->size; - } - } + if(d==dbuf) + HDmemcpy(dp, d, dst->shared->size); + + /* Advance source & destination pointers by delta amounts */ + sp += src_delta; + dp += dst_delta; + } /* end for */ break; @@ -3909,6 +3977,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_t *dst_p; /*destination datatype */ H5T_atomic_t src; /*atomic source info */ H5T_atomic_t dst; /*atomic destination info */ + ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*forward or backward traversal */ size_t elmtno; /*element number */ size_t half_size; /*half the type size */ @@ -3921,11 +3990,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ /* Conversion-related variables */ - hssize_t expo; /*exponent */ + int64_t expo; /*exponent */ hssize_t expo_max; /*maximum possible dst exponent */ size_t msize = 0; /*useful size of mantissa in src*/ size_t mpos; /*offset to useful mant is src */ - hssize_t sign; /*source sign bit value */ + uint64_t sign; /*source sign bit value */ size_t mrsh; /*amount to right shift mantissa*/ hbool_t carry = 0; /*carry after rounding mantissa */ size_t i; /*miscellaneous counters */ @@ -3991,6 +4060,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } + /* + * Direction & size of buffer traversal. + */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src_p->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst_p->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src_p->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst_p->shared->size); + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") @@ -4022,10 +4100,10 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d==dbuf) { - assert ((dp>=sp && dpshared->size) || + HDassert((dp>=sp && dpshared->size) || (sp>=dp && spshared->size)); } else { - assert ((dpshared->size<=sp) || + HDassert((dpshared->size<=sp) || (spshared->size<=dp)); } #endif @@ -4044,7 +4122,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } else if (H5T_ORDER_VAX==src.order) { tsize = src_p->shared->size; - assert(0 == tsize % 2); + HDassert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = s[i]; @@ -4142,9 +4220,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; -#ifdef H5_VMS - } /*Temporary solution to handle VAX special values*/ -#else /*H5_VMS*/ +#ifndef H5_VMS /*Temporary solution to handle VAX special values*/ } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* NaN */ @@ -4169,15 +4245,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; - } #endif /*H5_VMS*/ + } /* * Get the exponent as an unsigned quantity from the section of * the source bit field where it's located. Don't worry about * the exponent bias yet. */ - expo = H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); + expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); if(expo==0) denormalized=TRUE; @@ -4189,10 +4265,9 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, implied = 1; mpos = src.u.f.mpos; mrsh = 0; - if (0==expo || H5T_NORM_NONE==src.u.f.norm) { - if ((bitno=H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, - H5T_BIT_MSB, TRUE))>0) { - msize = bitno; + if(0 == expo || H5T_NORM_NONE == src.u.f.norm) { + if((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) { + msize = (size_t)bitno; } else if (0==bitno) { msize = 1; H5T__bit_set(s, src.u.f.mpos, (size_t)1, FALSE); @@ -4200,8 +4275,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (H5T_NORM_IMPLIED==src.u.f.norm) { msize = src.u.f.msize; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* @@ -4215,13 +4289,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * the source exponent bias. */ if (0==expo || H5T_NORM_NONE==src.u.f.norm) { - assert(bitno>=0); - expo -= (src.u.f.ebias-1) + (src.u.f.msize-bitno); + HDassert(bitno>=0); + expo -= (int64_t)((src.u.f.ebias - 1) + (src.u.f.msize - (size_t)bitno)); } else if (H5T_NORM_IMPLIED==src.u.f.norm) { - expo -= src.u.f.ebias; + expo -= (int64_t)src.u.f.ebias; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* @@ -4236,7 +4309,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * bias and clipping by the minimum and maximum possible * destination exponent values. */ - expo += dst.u.f.ebias; + expo += (int64_t)dst.u.f.ebias; if (expo < -(hssize_t)(dst.u.f.msize)) { /* The exponent is way too small. Result is zero. */ @@ -4250,7 +4323,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * accomodate that value. The mantissa of course is no * longer normalized. */ - H5_ASSIGN_OVERFLOW(mrsh,(mrsh+1-expo),hssize_t,size_t); + mrsh += (size_t)(1 - expo); expo = 0; denormalized=TRUE; } else if (expo>=expo_max) { @@ -4289,20 +4362,20 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * mantissa bit is `1', else it is `10' binary. */ if (msize>0 && mrsh<=dst.u.f.msize && mrsh+msize>dst.u.f.msize) { - bitno = (ssize_t)(mrsh+msize - dst.u.f.msize); - assert(bitno>=0 && (size_t)bitno<=msize); - /*If the 1st bit being cut off is set and source isn't denormalized.*/ - if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && !denormalized) { - /*Don't do rounding if exponent is 111...110 and mantissa is 111...11. - *To do rounding and increment exponent in this case will create an infinity value.*/ - if((H5T__bit_find(s, mpos+bitno, msize-bitno, H5T_BIT_LSB, FALSE)>=0 || expo= 0 && (size_t)bitno <= msize); + /* If the 1st bit being cut off is set and source isn't denormalized.*/ + if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && !denormalized) { + /* Don't do rounding if exponent is 111...110 and mantissa is 111...11. + * To do rounding and increment exponent in this case will create an infinity value.*/ + if((H5T__bit_find(s, mpos + (size_t)bitno, msize - (size_t)bitno, H5T_BIT_LSB, FALSE) >= 0 || expo < expo_max - 1)) { + carry = (hbool_t)H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); + if(carry) implied = 2; } - } else if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && denormalized) - /*For either source or destination, denormalized value doesn't increment carry.*/ - H5T__bit_inc(s, mpos+bitno-1, 1+msize-bitno); + } else if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && denormalized) + /* For either source or destination, denormalized value doesn't increment carry.*/ + H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); } else carry=0; @@ -4379,11 +4452,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Set external padding areas */ if (dst.offset>0) { - assert (H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); + HDassert(H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); H5T__bit_set (d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); } if (dst.offset+dst.prec!=8*dst_p->shared->size) { - assert (H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); + HDassert(H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); H5T__bit_set (d, dst.offset+dst.prec, 8*dst_p->shared->size - (dst.offset+dst.prec), (hbool_t)(H5T_PAD_ONE==dst.msb_pad)); } @@ -4401,7 +4474,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } else if (H5T_ORDER_VAX==dst.order && reverse) { tsize = dst_p->shared->size; - assert(0 == tsize % 2); + HDassert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = d[i]; @@ -4420,15 +4493,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * should copy the value to the true destination buffer. */ next: - if (d==dbuf) - HDmemcpy (dp, d, dst_p->shared->size); - if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; - } else { - sp += direction * src_p->shared->size; - dp += direction * dst_p->shared->size; - } + if(d == dbuf) + HDmemcpy(dp, d, dst_p->shared->size); + + /* Advance source & destination pointers by delta amounts */ + sp += src_delta; + dp += dst_delta; } break; @@ -4474,7 +4544,8 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { H5T_t *src=NULL; /*source datatype */ H5T_t *dst=NULL; /*destination datatype */ - int direction; /*direction of traversal */ + ssize_t src_delta, dst_delta; /*source & destination stride */ + int direction; /*direction of traversal */ size_t elmtno; /*element number */ size_t olap; /*num overlapping elements */ size_t nchars=0; /*number of characters copied */ @@ -4499,8 +4570,8 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset) || (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") - if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NPAD || - dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NPAD) + if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NSTR || + dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NSTR) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character padding") cdata->need_bkg = H5T_BKG_NO; break; @@ -4541,6 +4612,15 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } + /* + * Direction & size of buffer traversal. + */ + H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); + H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); + src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); + dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); + /* Allocate the overlap buffer */ if(NULL == (dbuf = (uint8_t *)H5MM_malloc(dst->shared->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for string conversion") @@ -4562,12 +4642,12 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (src->shared->size==dst->shared->size || buf_stride) { - assert(s==d); + HDassert(s==d); } else if (d==dbuf) { - assert((dp>=sp && dpshared->size) || + HDassert((dp>=sp && dpshared->size) || (sp>=dp && spshared->size)); } else { - assert((dpshared->size<=sp) || + HDassert((dpshared->size<=sp) || (spshared->size<=dp)); } #endif @@ -4613,6 +4693,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: case H5T_STR_ERROR: + default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "source string padding method not supported") } /* end switch */ @@ -4648,6 +4729,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: case H5T_STR_ERROR: + default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "destination string padding method not supported") } /* end switch */ @@ -4655,15 +4737,12 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * If we used a temporary buffer for the destination then we * should copy the value to the true destination buffer. */ - if (d==dbuf) + if(d == dbuf) HDmemcpy(dp, d, dst->shared->size); - if (buf_stride) { - sp += direction * buf_stride; - dp += direction * buf_stride; - } else { - sp += direction * src->shared->size; - dp += direction * dst->shared->size; - } + + /* Advance source & destination pointers by delta amounts */ + sp += src_delta; + dp += dst_delta; } /* end for */ break; @@ -8865,10 +8944,10 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d==dbuf) { - assert ((dp>=sp && dpshared->size) || + HDassert((dp>=sp && dpshared->size) || (sp>=dp && spshared->size)); } else { - assert ((dpshared->size<=sp) || + HDassert((dpshared->size<=sp) || (spshared->size<=dp)); } #endif @@ -8886,7 +8965,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } else if (H5T_ORDER_VAX==src.order) { tsize = src_p->shared->size; - assert(0 == tsize % 2); + HDassert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = s[i]; @@ -9044,8 +9123,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (H5T_NORM_IMPLIED==src.u.f.norm) { expo -= src.u.f.ebias; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* @@ -9247,11 +9325,11 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Set padding areas in destination. */ if (dst.offset>0) { - assert (H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); + HDassert(H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); } if (dst.offset+dst.prec!=8*dst_p->shared->size) { - assert (H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); + HDassert(H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); H5T__bit_set(d, dst.offset+dst.prec, 8*dst_p->shared->size - (dst.offset+ dst.prec), (hbool_t)(H5T_PAD_ONE==dst.msb_pad)); @@ -9459,10 +9537,10 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d==dbuf) { - assert ((dp>=sp && dpshared->size) || + HDassert((dp>=sp && dpshared->size) || (sp>=dp && spshared->size)); } else { - assert ((dpshared->size<=sp) || + HDassert((dpshared->size<=sp) || (spshared->size<=dp)); } #endif @@ -9548,8 +9626,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (H5T_NORM_NONE==dst.u.f.norm || H5T_NORM_IMPLIED==dst.u.f.norm) { expo = first + dst.u.f.ebias; } else { - assert("normalization method not implemented yet" && 0); - HDabort(); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } /* Handle mantissa part here */ @@ -9629,7 +9706,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Check if the exponent is too big */ - expo_max = (hsize_t)HDpow((double)2.0, (double)dst.u.f.esize) - 1; + expo_max = (hsize_t)HDpow((double)2.0f, (double)dst.u.f.esize) - 1; if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ @@ -9687,7 +9764,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } else if (H5T_ORDER_VAX==dst.order && reverse) { tsize = dst_p->shared->size; - assert(0 == tsize % 2); + HDassert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = d[i]; @@ -9762,8 +9839,8 @@ H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(s); - assert(size); + HDassert(s); + HDassert(size); if (H5T_ORDER_VAX == order) { for (i = 0; i < size; i += 2) { diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 8e4e8a2..2b7563b 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -127,14 +127,14 @@ H5T__enum_create(const H5T_t *parent) FUNC_ENTER_PACKAGE - assert(parent); + HDassert(parent); /* Build new type */ if(NULL == (ret_value = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") ret_value->shared->type = H5T_ENUM; ret_value->shared->parent = H5T_copy(parent, H5T_COPY_ALL); - assert(ret_value->shared->parent); + HDassert(ret_value->shared->parent); ret_value->shared->size = ret_value->shared->parent->shared->size; done: @@ -220,9 +220,9 @@ H5T__enum_insert(const H5T_t *dt, const char *name, const void *value) FUNC_ENTER_PACKAGE - assert(dt); - assert(name && *name); - assert(value); + HDassert(dt); + HDassert(name && *name); + HDassert(value); /* The name and value had better not already exist */ for (i=0; ishared->u.enumer.nmembs; i++) { @@ -322,8 +322,8 @@ H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/) { FUNC_ENTER_PACKAGE_NOERR - assert(dt); - assert(value); + HDassert(dt); + HDassert(value); HDmemcpy(value, dt->shared->u.enumer.value + membno*dt->shared->size, dt->shared->size); @@ -563,9 +563,9 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(dt && H5T_ENUM==dt->shared->type); - assert(name && *name); - assert(value); + HDassert(dt && H5T_ENUM==dt->shared->type); + HDassert(name && *name); + HDassert(value); /* Sanity check */ if (dt->shared->u.enumer.nmembs == 0) diff --git a/src/H5Tfields.c b/src/H5Tfields.c index 163bab3..0e0d4e7 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -202,7 +202,7 @@ H5T__get_member_name(H5T_t const *dt, unsigned membno) FUNC_ENTER_PACKAGE - assert(dt); + HDassert(dt); switch (dt->shared->type) { case H5T_COMPOUND: @@ -435,8 +435,8 @@ H5T__sort_name(const H5T_t *dt, int *map) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - assert(dt); - assert(H5T_COMPOUND==dt->shared->type || H5T_ENUM==dt->shared->type); + HDassert(dt); + HDassert(H5T_COMPOUND==dt->shared->type || H5T_ENUM==dt->shared->type); /* Use a bubble sort because we can short circuit */ if (H5T_COMPOUND==dt->shared->type) { @@ -462,7 +462,7 @@ H5T__sort_name(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i=0; ishared->u.compnd.memb[i].name, + HDassert(HDstrcmp(dt->shared->u.compnd.memb[i].name, dt->shared->u.compnd.memb[i+1].name)<0); } #endif @@ -472,7 +472,7 @@ H5T__sort_name(const H5T_t *dt, int *map) dt->shared->u.enumer.sorted = H5T_SORT_NAME; nmembs = dt->shared->u.enumer.nmembs; size = dt->shared->size; - assert(size<=sizeof(tbuf)); + HDassert(size<=sizeof(tbuf)); for (i=nmembs-1, swapped=TRUE; i>0 && swapped; --i) { for (j=0, swapped=FALSE; jshared->u.enumer.name[j], @@ -502,7 +502,7 @@ H5T__sort_name(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i=0; ishared->u.enumer.name[i], dt->shared->u.enumer.name[i+1])<0); + HDassert(HDstrcmp(dt->shared->u.enumer.name[i], dt->shared->u.enumer.name[i+1])<0); #endif } } diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index 51737eb..b2401d4 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -113,7 +113,7 @@ H5T_get_sign(H5T_t const *dt) FUNC_ENTER_NOAPI(H5T_SGN_ERROR) - assert(dt); + HDassert(dt); /* Defer to parent */ while(dt->shared->parent) diff --git a/src/H5Tnative.c b/src/H5Tnative.c index b9192f9..e7d1351 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -172,7 +172,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig FUNC_ENTER_NOAPI(NULL) - assert(dtype); + HDassert(dtype); if(H5T_NO_CLASS == (h5_class = H5T_get_class(dtype, FALSE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid class") @@ -355,6 +355,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig case H5T_ENUM: { + H5T_path_t *tpath; /* Type conversion info */ hid_t super_type_id, nat_super_type_id; /* Don't need to do anything special for alignment, offset since the ENUM type usually is integer. */ @@ -380,6 +381,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if(NULL == (new_type = H5T__enum_create(nat_super_type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create enum type") + /* Find the conversion function */ + if(NULL == (tpath = H5T_path_find(super_type, nat_super_type, NULL, NULL, H5P_DEFAULT, FALSE))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types") + /* Retrieve member info and insert members into new enum type */ if((snmemb = H5T_get_nmembers(dtype)) <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "enumerate data type doesn't have any member") @@ -391,7 +396,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") HDmemcpy(memb_value, tmp_memb_value, H5T_get_size(super_type)); - if(H5Tconvert(super_type_id, nat_super_type_id, (size_t)1, memb_value, NULL, H5P_DEFAULT) < 0) + if(H5T_convert(tpath, super_type_id, nat_super_type_id, (size_t)1, (size_t)0, (size_t)0, memb_value, NULL, H5P_DEFAULT) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") if(H5T__enum_insert(new_type, memb_name, memb_value) < 0) @@ -402,10 +407,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig tmp_memb_value = H5MM_xfree(tmp_memb_value); /* Close base type */ - if(H5Tclose(nat_super_type_id) < 0) + if(H5I_dec_app_ref(nat_super_type_id) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") - /* Close super type */ - if(H5Tclose(super_type_id) < 0) + /* Close super type */ + if(H5I_dec_app_ref(super_type_id) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") ret_value = new_type; @@ -571,19 +576,19 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, FUNC_ENTER_NOAPI(NULL) if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { - if(prec <= H5Tget_precision(H5T_NATIVE_SCHAR)) { + if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) { match = H5T_NATIVE_INT_MATCH_CHAR; native_size = sizeof(char); - } else if(prec<=H5Tget_precision(H5T_NATIVE_SHORT)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SHORT_g))) { match = H5T_NATIVE_INT_MATCH_SHORT; native_size = sizeof(short); - } else if(prec<=H5Tget_precision(H5T_NATIVE_INT)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_INT_g))) { match = H5T_NATIVE_INT_MATCH_INT; native_size = sizeof(int); - } else if(prec <= H5Tget_precision(H5T_NATIVE_LONG)) { + } else if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LONG_g))) { match = H5T_NATIVE_INT_MATCH_LONG; native_size = sizeof(long); - } else if(prec <= H5Tget_precision(H5T_NATIVE_LLONG)) { + } else if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LLONG_g))) { match = H5T_NATIVE_INT_MATCH_LLONG; native_size = sizeof(long long); } else { /* If no native type matches the querried datatype, simply choose the type of biggest size. */ @@ -591,16 +596,16 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, native_size = sizeof(long long); } } else if(direction == H5T_DIR_DESCEND) { - if(prec > H5Tget_precision(H5T_NATIVE_LONG)) { + if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LONG_g))) { match = H5T_NATIVE_INT_MATCH_LLONG; native_size = sizeof(long long); - } else if(prec > H5Tget_precision(H5T_NATIVE_INT)) { + } else if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_INT_g))) { match = H5T_NATIVE_INT_MATCH_LONG; native_size = sizeof(long); - } else if(prec > H5Tget_precision(H5T_NATIVE_SHORT)) { + } else if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SHORT_g))) { match = H5T_NATIVE_INT_MATCH_INT; native_size = sizeof(int); - } else if(prec > H5Tget_precision(H5T_NATIVE_SCHAR)) { + } else if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) { match = H5T_NATIVE_INT_MATCH_SHORT; native_size = sizeof(short); } else { @@ -710,7 +715,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig FUNC_ENTER_NOAPI(NULL) - assert(size>0); + HDassert(size>0); if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(size<=sizeof(float)) { @@ -786,7 +791,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig } /* end switch */ /* Create new native type */ - assert(tid>=0); + HDassert(tid>=0); if(NULL==(dt=(H5T_t *)H5I_object(tid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL) @@ -829,19 +834,19 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a FUNC_ENTER_NOAPI(NULL) if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { - if(prec<=H5Tget_precision(H5T_NATIVE_B8)) { + if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) { tid = H5T_NATIVE_B8; native_size = 1; align = H5T_NATIVE_UINT8_ALIGN_g; - } else if(prec<=H5Tget_precision(H5T_NATIVE_B16)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B16_g))) { tid = H5T_NATIVE_B16; native_size = 2; align = H5T_NATIVE_UINT16_ALIGN_g; - } else if(prec<=H5Tget_precision(H5T_NATIVE_B32)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B32_g))) { tid = H5T_NATIVE_B32; native_size = 4; align = H5T_NATIVE_UINT32_ALIGN_g; - } else if(prec<=H5Tget_precision(H5T_NATIVE_B64)) { + } else if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B64_g))) { tid = H5T_NATIVE_B64; native_size = 8; align = H5T_NATIVE_UINT64_ALIGN_g; @@ -851,15 +856,15 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a align = H5T_NATIVE_UINT64_ALIGN_g; } } else if(direction == H5T_DIR_DESCEND) { - if(prec>H5Tget_precision(H5T_NATIVE_B32)) { + if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B32_g))) { tid = H5T_NATIVE_B64; native_size = 8; align = H5T_NATIVE_UINT64_ALIGN_g; - } else if(prec>H5Tget_precision(H5T_NATIVE_B16)) { + } else if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B16_g))) { tid = H5T_NATIVE_B32; native_size = 4; align = H5T_NATIVE_UINT32_ALIGN_g; - } else if(prec>H5Tget_precision(H5T_NATIVE_B8)) { + } else if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) { tid = H5T_NATIVE_B16; native_size = 2; align = H5T_NATIVE_UINT16_ALIGN_g; @@ -871,7 +876,7 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a } /* Create new native type */ - assert(tid>=0); + HDassert(tid>=0); if(NULL==(dt=(H5T_t *)H5I_object(tid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") diff --git a/src/H5Toffset.c b/src/H5Toffset.c index bea8d2b..ea4b3b5 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -272,12 +272,12 @@ H5T_set_offset(const H5T_t *dt, size_t offset) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(dt); - assert(H5T_STRING!=dt->shared->type || 0==offset); - assert(H5T_REFERENCE!=dt->shared->type); - assert(H5T_OPAQUE!=dt->shared->type); - assert(H5T_COMPOUND!=dt->shared->type); - assert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); + HDassert(dt); + HDassert(H5T_STRING!=dt->shared->type || 0==offset); + HDassert(H5T_REFERENCE!=dt->shared->type); + HDassert(H5T_OPAQUE!=dt->shared->type); + HDassert(H5T_COMPOUND!=dt->shared->type); + HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { if (H5T_set_offset(dt->shared->parent, offset)<0) diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index c5ac186..b3975af 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -236,12 +236,12 @@ H5T_set_precision(const H5T_t *dt, size_t prec) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(dt); - assert(prec>0); - assert(H5T_OPAQUE!=dt->shared->type); - assert(H5T_COMPOUND!=dt->shared->type); - assert(H5T_STRING!=dt->shared->type); - assert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); + HDassert(dt); + HDassert(prec>0); + HDassert(H5T_OPAQUE!=dt->shared->type); + HDassert(H5T_COMPOUND!=dt->shared->type); + HDassert(H5T_STRING!=dt->shared->type); + HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { if (H5T_set_precision(dt->shared->parent, prec)<0) diff --git a/src/H5V.c b/src/H5V.c index 2697822..3277b90 100644 --- a/src/H5V.c +++ b/src/H5V.c @@ -78,7 +78,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - assert(1 == H5V_vector_reduce_product(0, NULL)); + HDassert(1 == H5V_vector_reduce_product(0, NULL)); /* * Combine adjacent memory accesses @@ -127,8 +127,8 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - assert(1 == H5V_vector_reduce_product(0, NULL)); - assert (*elmt_size>0); + HDassert(1 == H5V_vector_reduce_product(0, NULL)); + HDassert(*elmt_size>0); /* * Combine adjacent memory accesses @@ -267,48 +267,48 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(n <= H5V_HYPER_NDIMS); - assert(size); - assert(total_size); - assert(stride); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(size); + HDassert(total_size); + HDassert(stride); /* init */ - assert(n>0); + HDassert(n>0); stride[n-1] = 1; skip = offset ? offset[n-1] : 0; switch(n) { case 2: /* 1-D dataset */ - assert (total_size[1]>=size[1]); + HDassert(total_size[1]>=size[1]); stride[0] = total_size[1]-size[1]; /*overflow checked*/ acc = total_size[1]; skip += acc * (offset ? offset[0] : 0); break; case 3: /* 2-D dataset */ - assert (total_size[2]>=size[2]); + HDassert(total_size[2]>=size[2]); stride[1] = total_size[2]-size[2]; /*overflow checked*/ acc = total_size[2]; skip += acc * (offset ? (hsize_t)offset[1] : 0); - assert (total_size[1]>=size[1]); + HDassert(total_size[1]>=size[1]); stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/ acc *= total_size[1]; skip += acc * (offset ? (hsize_t)offset[0] : 0); break; case 4: /* 3-D dataset */ - assert (total_size[3]>=size[3]); + HDassert(total_size[3]>=size[3]); stride[2] = total_size[3]-size[3]; /*overflow checked*/ acc = total_size[3]; skip += acc * (offset ? (hsize_t)offset[2] : 0); - assert (total_size[2]>=size[2]); + HDassert(total_size[2]>=size[2]); stride[1] = acc * (total_size[2] - size[2]); /*overflow checked*/ acc *= total_size[2]; skip += acc * (offset ? (hsize_t)offset[1] : 0); - assert (total_size[1]>=size[1]); + HDassert(total_size[1]>=size[1]); stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/ acc *= total_size[1]; skip += acc * (offset ? (hsize_t)offset[0] : 0); @@ -317,7 +317,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, default: /* others */ for (i=(int)(n-2), acc=1; i>=0; --i) { - assert (total_size[i+1]>=size[i+1]); + HDassert(total_size[i+1]>=size[i+1]); stride[i] = acc * (total_size[i+1] - size[i+1]); /*overflow checked*/ acc *= total_size[i+1]; skip += acc * (offset ? (hsize_t)offset[i] : 0); @@ -474,14 +474,14 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size, FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(n > 0 && n <= H5V_HYPER_NDIMS); - assert(_size); - assert(total_size); - assert(dst); + HDassert(n > 0 && n <= H5V_HYPER_NDIMS); + HDassert(_size); + HDassert(total_size); + HDassert(dst); #ifndef NDEBUG for (u = 0; u < n; u++) { - assert(_size[u] > 0); - assert(total_size[u] > 0); + HDassert(_size[u] > 0); + HDassert(total_size[u] > 0); } #endif @@ -560,17 +560,17 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(n > 0 && n <= H5V_HYPER_NDIMS); - assert(_size); - assert(dst_size); - assert(src_size); - assert(dst); - assert(src); + HDassert(n > 0 && n <= H5V_HYPER_NDIMS); + HDassert(_size); + HDassert(dst_size); + HDassert(src_size); + HDassert(dst); + HDassert(src); #ifndef NDEBUG for (u = 0; u < n; u++) { - assert(_size[u] > 0); - assert(dst_size[u] > 0); - assert(src_size[u] > 0); + HDassert(_size[u] > 0); + HDassert(dst_size[u] > 0); + HDassert(src_size[u] > 0); } #endif @@ -589,7 +589,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, int ii; /*counter */ /* init */ - assert(n>0); + HDassert(n>0); dst_stride[n-1] = 1; src_stride[n-1] = 1; dst_start = dst_offset ? dst_offset[n-1] : 0; @@ -598,8 +598,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, /* Unroll loop for common cases */ switch(n) { case 2: - assert (dst_size[1]>=size[1]); - assert (src_size[1]>=size[1]); + HDassert(dst_size[1]>=size[1]); + HDassert(src_size[1]>=size[1]); dst_stride[0] = dst_size[1] - size[1]; /*overflow checked*/ src_stride[0] = src_size[1] - size[1]; /*overflow checked*/ dst_acc = dst_size[1]; @@ -609,8 +609,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, break; case 3: - assert (dst_size[2]>=size[2]); - assert (src_size[2]>=size[2]); + HDassert(dst_size[2]>=size[2]); + HDassert(src_size[2]>=size[2]); dst_stride[1] = dst_size[2] - size[2]; /*overflow checked*/ src_stride[1] = src_size[2] - size[2]; /*overflow checked*/ dst_acc = dst_size[2]; @@ -618,8 +618,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0); src_start += src_acc * (src_offset ? src_offset[1] : 0); - assert (dst_size[1]>=size[1]); - assert (src_size[1]>=size[1]); + HDassert(dst_size[1]>=size[1]); + HDassert(src_size[1]>=size[1]); dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/ dst_acc *= dst_size[1]; @@ -629,8 +629,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, break; case 4: - assert (dst_size[3]>=size[3]); - assert (src_size[3]>=size[3]); + HDassert(dst_size[3]>=size[3]); + HDassert(src_size[3]>=size[3]); dst_stride[2] = dst_size[3] - size[3]; /*overflow checked*/ src_stride[2] = src_size[3] - size[3]; /*overflow checked*/ dst_acc = dst_size[3]; @@ -638,8 +638,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, dst_start += dst_acc * (dst_offset ? dst_offset[2] : 0); src_start += src_acc * (src_offset ? src_offset[2] : 0); - assert (dst_size[2]>=size[2]); - assert (src_size[2]>=size[2]); + HDassert(dst_size[2]>=size[2]); + HDassert(src_size[2]>=size[2]); dst_stride[1] = dst_acc * (dst_size[2] - size[2]); /*overflow checked*/ src_stride[1] = src_acc * (src_size[2] - size[2]); /*overflow checked*/ dst_acc *= dst_size[2]; @@ -647,8 +647,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0); src_start += src_acc * (src_offset ? src_offset[1] : 0); - assert (dst_size[1]>=size[1]); - assert (src_size[1]>=size[1]); + HDassert(dst_size[1]>=size[1]); + HDassert(src_size[1]>=size[1]); dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/ dst_acc *= dst_size[1]; @@ -660,8 +660,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, default: /* others */ for (ii=(int)(n-2), dst_acc=1, src_acc=1; ii>=0; --ii) { - assert (dst_size[ii+1]>=size[ii+1]); - assert (src_size[ii+1]>=size[ii+1]); + HDassert(dst_size[ii+1]>=size[ii+1]); + HDassert(src_size[ii+1]>=size[ii+1]); dst_stride[ii] = dst_acc * (dst_size[ii+1] - size[ii+1]); /*overflow checked*/ src_stride[ii] = src_acc * (src_size[ii+1] - size[ii+1]); /*overflow checked*/ dst_acc *= dst_size[ii+1]; @@ -713,7 +713,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size < SIZET_MAX); + HDassert(elmt_size < SIZET_MAX); H5V_vector_cpy(n, idx, size); nelmts = H5V_vector_reduce_product(n, size); @@ -729,7 +729,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, if (--idx[j]) carry = FALSE; else { - assert(size); + HDassert(size); idx[j] = size[j]; } /* end else */ } @@ -775,7 +775,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size0); - assert(src_n>0); + HDassert(elmt_size < SIZET_MAX); + HDassert(dst_n>0); + HDassert(src_n>0); H5V_vector_cpy(dst_n, dst_idx, dst_size); H5V_vector_cpy(src_n, src_idx, src_size); @@ -937,7 +937,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, if (--dst_idx[j]) carry = FALSE; else { - assert(dst_size); + HDassert(dst_size); dst_idx[j] = dst_size[j]; } /* end else */ } @@ -946,7 +946,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, if (--src_idx[j]) carry = FALSE; else { - assert(src_size); + HDassert(src_size); src_idx[j] = src_size[j]; } /* end else */ } @@ -983,10 +983,10 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (dst); - assert (src); - assert (size < SIZET_MAX && size > 0); - assert (count < SIZET_MAX && count > 0); + HDassert(dst); + HDassert(src); + HDassert(size < SIZET_MAX && size > 0); + HDassert(count < SIZET_MAX && count > 0); HDmemcpy(dst, src, size); /* copy first item */ @@ -1038,9 +1038,9 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(n <= H5V_HYPER_NDIMS); - assert(total_size); - assert(down); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(total_size); + HDassert(down); /* Build the sizes of each dimension in the array */ /* (From fastest to slowest) */ @@ -1084,9 +1084,9 @@ H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(n <= H5V_HYPER_NDIMS); - assert(acc); - assert(offset); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(acc); + HDassert(offset); /* Compute offset in array */ for (i=(int)(n-1), ret_value=0; i>=0; --i) @@ -1124,9 +1124,9 @@ H5V_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset) FUNC_ENTER_NOAPI((HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */ - assert(n <= H5V_HYPER_NDIMS); - assert(total_size); - assert(offset); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(total_size); + HDassert(offset); /* Build the sizes of each dimension in the array */ if(H5V_array_down(n,total_size,acc_arr)<0) @@ -1278,10 +1278,10 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - assert(ndims <= H5V_HYPER_NDIMS); - assert(coord); - assert(chunk); - assert(chunk_idx); + HDassert(ndims <= H5V_HYPER_NDIMS); + HDassert(coord); + HDassert(chunk); + HDassert(chunk_idx); /* Compute the scaled coordinates for actual coordinates */ for(u=0; uH5Z_FILTER_MAX) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if (id H5Z_FILTER_MAX) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") + if(id < H5Z_FILTER_RESERVED) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") /* Do it */ - if (H5Z_unregister (id)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") + if(H5Z_unregister(id) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") done: FUNC_LEAVE_API(ret_value) @@ -409,12 +405,10 @@ done: * Programmer: Quincey Koziol * Thursday, November 14, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5Z_unregister (H5Z_filter_t filter_id) +H5Z_unregister(H5Z_filter_t filter_id) { size_t filter_index; /* Local index variable for filter */ H5Z_object_t object; @@ -422,7 +416,7 @@ H5Z_unregister (H5Z_filter_t filter_id) FUNC_ENTER_NOAPI(FAIL) - assert (filter_id>=0 && filter_id<=H5Z_FILTER_MAX); + HDassert(filter_id>=0 && filter_id<=H5Z_FILTER_MAX); /* Is the filter already registered? */ for (filter_index=0; filter_indexfilter_id)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") - break; + /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and + * let H5Z_unregister return failure. + */ + if(filter_in_pline) { + object->found = TRUE; + ret_value = TRUE; + } /* end if */ - case H5I_DATASET: - if((ocpl_id = H5D_get_create_plist(obj_ptr)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get dataset creation property list") - - break; +done: + if(ocpl_id > 0) + if(H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") - default: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid object") - } /* end switch */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z__check_unregister_group_cb() */ - /* Get the plist structure of object creation */ - if(NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + +/*------------------------------------------------------------------------- + * Function: H5Z__check_unregister_dset_cb + * + * Purpose: The callback function for H5Z_unregister. It iterates + * through all opened objects. If the object is a dataset + * or a group and it uses the filter to be unregistered, the + * function returns TRUE. + * + * Return: TRUE if the object uses the filter. + * FALSE otherwise. + * + * Programmer: Raymond Lu + * 6 May 2013 + * + *------------------------------------------------------------------------- + */ +static int +H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t UNUSED obj_id, void *key) +{ + hid_t ocpl_id = -1; + H5Z_object_t *object = (H5Z_object_t *)key; + htri_t filter_in_pline = FALSE; + int ret_value = FALSE; /* Return value */ - /* Check if the object creation property list uses the filter */ - if((filter_in_pline = H5P_filter_in_pline(plist, object->filter_id)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't check filter in pipeline") + FUNC_ENTER_STATIC - /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and let - * H5Z_unregister return failure */ + HDassert(obj_ptr); + + /* Get the dataset creation property */ + if((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") + + /* Check if the filter is in the dataset creation property list */ + if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + + /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and + * let H5Z_unregister return failure. + */ if(filter_in_pline) { object->found = TRUE; ret_value = TRUE; - } + } /* end if */ done: + if(ocpl_id > 0) + if(H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_get_object_cb() */ +} /* end H5Z__check_unregister_dset_cb() */ /*------------------------------------------------------------------------- - * Function: H5Z_get_file_cb + * Function: H5Z__flush_file_cb * * Purpose: The callback function for H5Z_unregister. It iterates * through all opened files and flush them. @@ -553,11 +617,11 @@ done: *------------------------------------------------------------------------- */ static int -H5Z_get_file_cb(void *obj_ptr, hid_t obj_id, void *key) +H5Z__flush_file_cb(void *obj_ptr, hid_t UNUSED obj_id, void UNUSED *key) { int ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(obj_ptr); @@ -565,12 +629,12 @@ H5Z_get_file_cb(void *obj_ptr, hid_t obj_id, void *key) * if the file is opened for write */ if(H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { if(H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_get_file_cb() */ +} /* end H5Z__flush_file_cb() */ /*------------------------------------------------------------------------- @@ -1238,12 +1302,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - assert(0==(flags & ~((unsigned)H5Z_FLAG_INVMASK))); - assert(filter_mask); - assert(nbytes && *nbytes>0); - assert(buf_size && *buf_size>0); - assert(buf && *buf); - assert(!pline || pline->nused0); + HDassert(buf_size && *buf_size>0); + HDassert(buf && *buf); + HDassert(!pline || pline->nusednused; i>0; --i) { @@ -1393,8 +1457,8 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - assert(pline); - assert(filter>=0 && filter<=H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter>=0 && filter<=H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for(idx=0; idxnused; idx++) @@ -1438,8 +1502,8 @@ H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) - assert(pline); - assert(filter>=0 && filter<=H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter>=0 && filter<=H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for(idx=0; idxnused; idx++) @@ -1480,7 +1544,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - assert(pline); + HDassert(pline); /* Iterate through all the filters in pipeline */ for(i=0; inused; i++) { @@ -1602,15 +1666,44 @@ done: herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) { - H5Z_class2_t *fclass; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE2("e", "Zf*Iu", filter, filter_config_flags); + /* Get the filter info */ + if(H5Z_get_filter_info(filter, filter_config_flags) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Zget_filter_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5Z_get_filter_info + * + * Purpose: Gets information about a pipeline data filter and stores it + * in filter_config_flags. + * + * Return: zero on success / negative on failure + * + * Programmer: Quincey Koziol + * Saturday, May 11, 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) +{ + H5Z_class2_t *fclass; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) + /* Look up the filter class info */ if(NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Filter not defined") + HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ if(filter_config_flags != NULL) { @@ -1623,6 +1716,6 @@ H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) } /* end if */ done: - FUNC_LEAVE_API(ret_value) -} /* end H5Zget_filter_info() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z_get_filter_info() */ diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index d2ad965..8d2643d 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -87,7 +87,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U FUNC_ENTER_NOAPI(0) - assert(sizeof(uint32_t)>=4); + HDassert(sizeof(uint32_t)>=4); if (flags & H5Z_FLAG_REVERSE) { /* Read */ /* Do checksum if it's enabled for read; otherwise skip it diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 6c0a46f..bd5bef0 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -74,7 +74,6 @@ struct H5O_pline_t; /*forward decl*/ /* Internal API routines */ H5_DLL herr_t H5Z_init(void); H5_DLL herr_t H5Z_register(const H5Z_class2_t *cls); -H5_DLL herr_t H5Z_unregister(H5Z_filter_t id); H5_DLL herr_t H5Z_append(struct H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t cd_nelmts, const unsigned int cd_values[]); H5_DLL herr_t H5Z_modify(const struct H5O_pline_t *pline, H5Z_filter_t filter, @@ -93,8 +92,10 @@ H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_filter_in_pline(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline); +H5_DLL herr_t H5Z_unregister(H5Z_filter_t filter_id); H5_DLL htri_t H5Z_filter_avail(H5Z_filter_t id); H5_DLL herr_t H5Z_delete(struct H5O_pline_t *pline, H5Z_filter_t filter); +H5_DLL herr_t H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags); /* Data Transform Functions */ typedef struct H5Z_data_xform_t H5Z_data_xform_t; /* Defined in H5Ztrans.c */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 1538765..0aaff11 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -1164,7 +1164,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value minval |= minval_mask; } - assert(minbits <= p.size * 8); + HDassert(minbits <= p.size * 8); p.minbits = minbits; /* calculate size of output buffer after decompression */ @@ -1241,7 +1241,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed") } - assert(minbits <= p.size * 8); + HDassert(minbits <= p.size * 8); /* calculate buffer size after compression * minbits and minval are stored in the front of the compressed buffer diff --git a/src/H5Zszip.c b/src/H5Zszip.c index fd3d90c..4544ec3 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -198,7 +198,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Set "local" parameter for this dataset's "pixels-per-scanline" */ /* (Use the chunk's fastest changing dimension size) */ - assert(ndims > 0); + HDassert(ndims > 0); scanline = dims[ndims - 1]; /* Adjust scanline if it is smaller than number of pixels per block or @@ -288,13 +288,13 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* Sanity check to make certain that we haven't drifted out of date with * the mask options from the szlib.h header */ - assert(H5_SZIP_ALLOW_K13_OPTION_MASK==SZ_ALLOW_K13_OPTION_MASK); - assert(H5_SZIP_CHIP_OPTION_MASK==SZ_CHIP_OPTION_MASK); - assert(H5_SZIP_EC_OPTION_MASK==SZ_EC_OPTION_MASK); - assert(H5_SZIP_LSB_OPTION_MASK==SZ_LSB_OPTION_MASK); - assert(H5_SZIP_MSB_OPTION_MASK==SZ_MSB_OPTION_MASK); - assert(H5_SZIP_NN_OPTION_MASK==SZ_NN_OPTION_MASK); - assert(H5_SZIP_RAW_OPTION_MASK==SZ_RAW_OPTION_MASK); + HDassert(H5_SZIP_ALLOW_K13_OPTION_MASK==SZ_ALLOW_K13_OPTION_MASK); + HDassert(H5_SZIP_CHIP_OPTION_MASK==SZ_CHIP_OPTION_MASK); + HDassert(H5_SZIP_EC_OPTION_MASK==SZ_EC_OPTION_MASK); + HDassert(H5_SZIP_LSB_OPTION_MASK==SZ_LSB_OPTION_MASK); + HDassert(H5_SZIP_MSB_OPTION_MASK==SZ_MSB_OPTION_MASK); + HDassert(H5_SZIP_NN_OPTION_MASK==SZ_NN_OPTION_MASK); + HDassert(H5_SZIP_RAW_OPTION_MASK==SZ_RAW_OPTION_MASK); /* Check arguments */ if (cd_nelmts!=4) @@ -324,7 +324,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_out=nalloc; if(SZ_BufftoBuffDecompress(outbuf, &size_out, newbuf, nbytes-4, &sz_param) != SZ_OK) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "szip_filter: decompression failed") - assert(size_out==nalloc); + HDassert(size_out==nalloc); /* Free the input buffer */ H5MM_xfree(*buf); @@ -351,7 +351,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_out = nbytes; if(SZ_OK!= SZ_BufftoBuffCompress(dst, &size_out, *buf, nbytes, &sz_param)) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow") - assert(size_out<=nbytes); + HDassert(size_out<=nbytes); /* Free the input buffer */ H5MM_xfree(*buf); diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 498db03..f9e7186 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -378,7 +378,7 @@ H5Z_unget_token(H5Z_token *current) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(current); + HDassert(current); current->tok_type = current->tok_last_type; current->tok_begin = current->tok_last_begin; @@ -414,7 +414,7 @@ H5Z_get_token(H5Z_token *current) FUNC_ENTER_NOAPI_NOINIT /* check args */ - assert(current); + HDassert(current); /* Save the last position for possible ungets */ current->tok_last_type = current->tok_type; @@ -424,9 +424,9 @@ H5Z_get_token(H5Z_token *current) current->tok_begin = current->tok_end; while (current->tok_begin[0] != '\0') { - if (isspace(current->tok_begin[0])) { + if (HDisspace(current->tok_begin[0])) { /* ignore whitespace */ - } else if (isdigit(current->tok_begin[0]) || + } else if (HDisdigit(current->tok_begin[0]) || current->tok_begin[0] == '.') { current->tok_end = current->tok_begin; @@ -439,7 +439,7 @@ H5Z_get_token(H5Z_token *current) /* is number */ current->tok_type = H5Z_XFORM_INTEGER; - while (isdigit(current->tok_end[0])) + while (HDisdigit(current->tok_end[0])) ++current->tok_end; } @@ -458,7 +458,7 @@ H5Z_get_token(H5Z_token *current) if (current->tok_end[0] == '.') do { ++current->tok_end; - } while (isdigit(current->tok_end[0])); + } while (HDisdigit(current->tok_end[0])); if (current->tok_end[0] == 'e' || current->tok_end[0] == 'E') { @@ -468,29 +468,29 @@ H5Z_get_token(H5Z_token *current) current->tok_end[0] == '+') ++current->tok_end; - if (!isdigit(current->tok_end[0])) { + if (!HDisdigit(current->tok_end[0])) { current->tok_type = H5Z_XFORM_ERROR; HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, current, "Invalidly formatted floating point number") } - while (isdigit(current->tok_end[0])) + while (HDisdigit(current->tok_end[0])) ++current->tok_end; } /* Check that this is a properly formatted numerical value */ - if (isalpha(current->tok_end[0]) || current->tok_end[0] == '.') { + if (HDisalpha(current->tok_end[0]) || current->tok_end[0] == '.') { current->tok_type = H5Z_XFORM_ERROR; HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, current, "Invalidly formatted floating point number") } } break; - } else if (isalpha(current->tok_begin[0])) { + } else if (HDisalpha(current->tok_begin[0])) { /* is symbol */ current->tok_type = H5Z_XFORM_SYMBOL; current->tok_end = current->tok_begin; - while (isalnum(current->tok_end[0])) + while (HDisalnum(current->tok_end[0])) ++current->tok_end; break; @@ -995,7 +995,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size H5Z_XFORM_DO_OP5(short, array_size) else if(array_type == H5T_NATIVE_USHORT) H5Z_XFORM_DO_OP5(unsigned short, array_size) - else if( array_type == H5T_NATIVE_INT) + else if(array_type == H5T_NATIVE_INT) H5Z_XFORM_DO_OP5(int, array_size) else if(array_type == H5T_NATIVE_UINT) H5Z_XFORM_DO_OP5(unsigned int, array_size) @@ -1026,10 +1026,10 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size /* If it's a quadratic transform, we have no choice but to store multiple copies of the data */ else { for(i = 0; i < data_xform_prop->dat_val_pointers->num_ptrs; i++) { - if(NULL == (data_xform_prop->dat_val_pointers->ptr_dat_val[i] = (void*)H5MM_malloc(array_size * H5Tget_size(array_type)))) + if(NULL == (data_xform_prop->dat_val_pointers->ptr_dat_val[i] = (void*)H5MM_malloc(array_size * H5T_get_size((H5T_t *)H5I_object(array_type))))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "Ran out of memory trying to allocate space for data in data transform") - HDmemcpy(data_xform_prop->dat_val_pointers->ptr_dat_val[i], array, array_size * H5Tget_size(array_type)); + HDmemcpy(data_xform_prop->dat_val_pointers->ptr_dat_val[i], array, array_size * H5T_get_size((H5T_t *)H5I_object(array_type))); } /* end for */ } /* end else */ @@ -1037,7 +1037,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") if(data_xform_prop->dat_val_pointers->num_ptrs > 1) - HDmemcpy(array, res.value.dat_val, array_size * H5Tget_size(array_type)); + HDmemcpy(array, res.value.dat_val, array_size * H5T_get_size((H5T_t *)H5I_object(array_type))); /* Free the temporary arrays we used */ if(data_xform_prop->dat_val_pointers->num_ptrs > 1) @@ -1175,60 +1175,60 @@ H5Z_xform_find_type(const H5T_t* type) HDassert(type); /* Check for SHORT type */ - if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_SHORT, H5I_DATATYPE)) + if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_SHORT) /* Check for INT type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_INT, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_INT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_INT) /* Check for LONG type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_LONG, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_LONG) /* Check for LONGLONG type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_LLONG, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LLONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_LLONG) /* Check for UCHAR type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_UCHAR, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_UCHAR) /* Check for CHAR type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_CHAR, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_CHAR)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_CHAR) /* Check for SCHAR type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_SCHAR, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_SCHAR) /* Check for USHORT type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_USHORT, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_USHORT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_USHORT) /* Check for UINT type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_UINT, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_UINT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_UINT) /* Check for ULONG type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_ULONG, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_ULONG) /* Check for ULONGLONG type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_ULLONG, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_ULLONG)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_ULLONG) /* Check for FLOAT type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_FLOAT, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_FLOAT) /* Check for DOUBLE type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_DOUBLE, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_DOUBLE) #if H5_SIZEOF_LONG_DOUBLE !=0 /* Check for LONGDOUBLE type */ - else if((tmp = (H5T_t *)H5I_object_verify(H5T_NATIVE_LDOUBLE, H5I_DATATYPE)) + else if((tmp = (H5T_t *)H5I_object(H5T_NATIVE_LDOUBLE)) && 0 == H5T_cmp(type, tmp, FALSE)) HGOTO_DONE(H5T_NATIVE_LDOUBLE) #endif @@ -1258,7 +1258,7 @@ H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datva FUNC_ENTER_NOAPI(NULL) - assert(tree); + HDassert(tree); if(tree->type == H5Z_XFORM_INTEGER) { @@ -1335,7 +1335,7 @@ H5Z_op_is_numbs(H5Z_node* _tree) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(_tree); + HDassert(_tree); if(((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT)) && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) ret_value = TRUE; @@ -1364,7 +1364,7 @@ H5Z_op_is_numbs2(H5Z_node* _tree) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(_tree); + HDassert(_tree); if((!_tree->lchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) || ((_tree->lchild && ((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT))) && (_tree->rchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))))) @@ -1494,7 +1494,7 @@ H5Z_xform_create(const char *expr) FUNC_ENTER_NOAPI(NULL) - assert(expr); + HDassert(expr); /* Allocate space for the data transform information */ if(NULL == (data_xform_prop = (H5Z_data_xform_t *)H5MM_calloc(sizeof(H5Z_data_xform_t)))) @@ -1740,7 +1740,7 @@ H5Z_xform_extract_xform_str(const H5Z_data_xform_t *data_xform_prop) /* There should be no way that this can be NULL since the function * that calls this one checks to make sure it isn't before * pasing them */ - assert(data_xform_prop); + HDassert(data_xform_prop); FUNC_LEAVE_NOAPI(data_xform_prop->xform_exp) } /* H5Z_xform_extract_xform_str() */ diff --git a/src/H5detect.c b/src/H5detect.c index d6f6a3b..2bf0d2d 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -246,7 +246,7 @@ precision (detected_t *d) _v = (_v << 8) + _i; \ for(_i = 0, _x = (unsigned char *)&_v; _i < (signed)sizeof(TYPE); _i++) { \ _j = (*_x++) - 1; \ - assert(_j < (signed)sizeof(TYPE)); \ + HDassert(_j < (signed)sizeof(TYPE)); \ INFO.perm[_i] = _j; \ } /* end for */ \ } else { /*Not able to detect order if type size is 1 byte. Use native int \ @@ -255,7 +255,7 @@ precision (detected_t *d) _int_v = (_int_v << 8) + _i; \ for(_i = 0, _x = (unsigned char *)&_int_v; _i < (signed)sizeof(int); _i++) { \ _j = (*_x++)-1; \ - assert(_j < (signed)sizeof(int)); \ + HDassert(_j < (signed)sizeof(int)); \ INFO.perm[_i] = _j; \ } /* end for */ \ } /* end else */ \ @@ -296,23 +296,23 @@ precision (detected_t *d) int _i, _j, _last = (-1); \ char *_mesg; \ \ - memset(&INFO, 0, sizeof(INFO)); \ + HDmemset(&INFO, 0, sizeof(INFO)); \ INFO.varname = #VAR; \ INFO.size = sizeof(TYPE); \ \ /* Completely initialize temporary variables, in case the bits used in */ \ /* the type take less space than the number of bits used to store the type */ \ - memset(&_v3, 0, sizeof(TYPE)); \ - memset(&_v2, 0, sizeof(TYPE)); \ - memset(&_v1, 0, sizeof(TYPE)); \ + HDmemset(&_v3, 0, sizeof(TYPE)); \ + HDmemset(&_v2, 0, sizeof(TYPE)); \ + HDmemset(&_v1, 0, sizeof(TYPE)); \ \ /* Byte Order */ \ for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \ _v3 = _v1; \ _v1 += _v2; \ _v2 /= 256.0; \ - memcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \ - memcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \ + HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \ + HDmemcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \ _j = byte_cmp(sizeof(TYPE), &_buf3, &_buf1); \ if(_j >= 0) { \ INFO.perm[_i] = _j; \ @@ -321,7 +321,7 @@ precision (detected_t *d) } \ fix_order(sizeof(TYPE), _last, INFO.perm, (const char**)&_mesg); \ \ - if(!strcmp(_mesg, "VAX")) \ + if(!HDstrcmp(_mesg, "VAX")) \ INFO.is_vax = TRUE; \ \ /* Implicit mantissa bit */ \ @@ -351,8 +351,8 @@ precision (detected_t *d) INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \ precision (&(INFO)); \ ALIGNMENT(TYPE, INFO); \ - if(!strcmp(INFO.varname, "FLOAT") || !strcmp(INFO.varname, "DOUBLE") || \ - !strcmp(INFO.varname, "LDOUBLE")) { \ + if(!HDstrcmp(INFO.varname, "FLOAT") || !HDstrcmp(INFO.varname, "DOUBLE") || \ + !HDstrcmp(INFO.varname, "LDOUBLE")) { \ COMP_ALIGNMENT(TYPE,INFO.comp_align); \ } \ } @@ -399,7 +399,7 @@ precision (detected_t *d) void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \ void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\ \ - _buf = (char*)malloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ + _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ if(H5SETJMP(jbuf_g)) _ano++; \ if(_ano < NELMTS(align_g)) { \ *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \ @@ -409,12 +409,12 @@ precision (detected_t *d) /* pointer values when pointing to non-word aligned */ \ /* locations with pointers that are supposed to be */ \ /* word aligned. -QAK */ \ - memset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ + HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ /*How to handle VAX types?*/ \ if(INFO.perm[0]) /* Big-Endian */ \ - memcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ + HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ else /* Little-Endian */ \ - memcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ + HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ _val2 = *((TYPE*)(_buf+align_g[_ano])); \ if(_val!=_val2) \ H5LONGJMP(jbuf_g, 1); \ @@ -424,7 +424,7 @@ precision (detected_t *d) (INFO.align)=0; \ fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \ } \ - free(_buf); \ + HDfree(_buf); \ HDsignal(SIGBUS, _handler); /*restore original handler*/ \ HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \ } @@ -669,7 +669,7 @@ H5TN_init_interface(void)\n\ dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;\n", d[i].offset, /*offset */ d[i].precision); /*precision */ - /*assert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */ + /*HDassert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */ if (0 == d[i].msize) { /* The part unique to fixed point types */ @@ -705,10 +705,10 @@ H5TN_init_interface(void)\n\ d[i].varname, (unsigned long)(d[i].align)); /* Variables for alignment of compound datatype */ - if(!strcmp(d[i].varname, "SCHAR") || !strcmp(d[i].varname, "SHORT") || - !strcmp(d[i].varname, "INT") || !strcmp(d[i].varname, "LONG") || - !strcmp(d[i].varname, "LLONG") || !strcmp(d[i].varname, "FLOAT") || - !strcmp(d[i].varname, "DOUBLE") || !strcmp(d[i].varname, "LDOUBLE")) { + if(!HDstrcmp(d[i].varname, "SCHAR") || !HDstrcmp(d[i].varname, "SHORT") || + !HDstrcmp(d[i].varname, "INT") || !HDstrcmp(d[i].varname, "LONG") || + !HDstrcmp(d[i].varname, "LLONG") || !HDstrcmp(d[i].varname, "FLOAT") || + !HDstrcmp(d[i].varname, "DOUBLE") || !HDstrcmp(d[i].varname, "LDOUBLE")) { printf(" H5T_NATIVE_%s_COMP_ALIGN_g = %lu;\n", d[i].varname, (unsigned long)(d[i].comp_align)); } @@ -823,7 +823,7 @@ iprint(detected_t *d) printf(" * "); for (i=MIN(pass*4+3,d->size-1); i>=pass*4; --i) { printf ("%4d", d->perm[i]); - if (i>pass*4) fputs (" ", stdout); + if (i>pass*4) HDfputs (" ", stdout); } /* @@ -835,23 +835,23 @@ iprint(detected_t *d) i>=pass*4; --i) { for (j=7; j>=0; --j) { if (k==d->sign && d->msize) { - putchar('S'); + HDputchar('S'); } else if (k>=d->epos && kepos+d->esize) { - putchar('E'); + HDputchar('E'); } else if (k>=d->mpos && kmpos+d->msize) { - putchar('M'); + HDputchar('M'); } else if (d->msize) { - putchar('?'); /*unknown floating point bit */ + HDputchar('?'); /*unknown floating point bit */ } else if (d->sign) { - putchar('I'); + HDputchar('I'); } else { - putchar('U'); + HDputchar('U'); } --k; } - if (i>pass*4) putchar(' '); + if (i>pass*4) HDputchar(' '); } - putchar('\n'); + HDputchar('\n'); } /* @@ -934,13 +934,13 @@ bit_cmp(int nbytes, int *perm, volatile void *_a, volatile void *_b) unsigned char aa, bb; for (i = 0; i < nbytes; i++) { - assert(perm[i] < nbytes); + HDassert(perm[i] < nbytes); if ((aa = a[perm[i]]) != (bb = b[perm[i]])) { for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) { if ((aa & 1) != (bb & 1)) return i * 8 + j; } - assert("INTERNAL ERROR" && 0); - abort(); + HDassert("INTERNAL ERROR" && 0); + HDabort(); } } return -1; @@ -998,7 +998,7 @@ fix_order(int n, int last, int *perm, const char **mesg) * It could have some other endianess and fall into this * case - JKM & QAK) */ - assert(0 == n % 2); + HDassert(0 == n % 2); if (mesg) *mesg = "VAX"; for (i = 0; i < n; i += 2) { perm[i] = (n - 2) - i; @@ -1008,7 +1008,7 @@ fix_order(int n, int last, int *perm, const char **mesg) } else { fprintf(stderr, "Failed to detect byte order of %d-byte floating point.\n", n); - exit(1); + HDexit(1); } } @@ -1062,7 +1062,7 @@ imp_bit(int n, int *perm, volatile void *_a, volatile void *_b) * A and B. This is the least significant bit of the exponent. */ changed = bit_cmp(n, perm, a, b); - assert(changed >= 0); + HDassert(changed >= 0); /* * The bit to the right (less significant) of the changed bit should @@ -1139,8 +1139,8 @@ static void print_header(void) { - time_t now = time(NULL); - struct tm *tm = localtime(&now); + time_t now = HDtime(NULL); + struct tm *tm = HDlocaltime(&now); char real_name[30]; char host_name[256]; int i; @@ -1199,13 +1199,13 @@ bit.\n"; { size_t n; char *comma; - if ((pwd = getpwuid(getuid()))) { - if ((comma = strchr(pwd->pw_gecos, ','))) { + if ((pwd = HDgetpwuid(HDgetuid()))) { + if ((comma = HDstrchr(pwd->pw_gecos, ','))) { n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); - strncpy(real_name, pwd->pw_gecos, n); + HDstrncpy(real_name, pwd->pw_gecos, n); real_name[n] = '\0'; } else { - strncpy(real_name, pwd->pw_gecos, sizeof(real_name)); + HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name)); real_name[sizeof(real_name) - 1] = '\0'; } } else { @@ -1220,7 +1220,7 @@ bit.\n"; * The FQDM of this host or the empty string. */ #ifdef H5_HAVE_GETHOSTNAME - if (gethostname(host_name, sizeof(host_name)) < 0) { + if (HDgethostname(host_name, sizeof(host_name)) < 0) { host_name[0] = '\0'; } #else @@ -1231,7 +1231,7 @@ bit.\n"; * The file header: warning, copyright notice, build information. */ printf("/* Generated automatically by H5detect -- do not edit */\n\n\n"); - puts(FileHeader); /*the copyright notice--see top of this file */ + HDputs(FileHeader); /*the copyright notice--see top of this file */ printf(" *\n * Created:\t\t%s %2d, %4d\n", month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); @@ -1239,15 +1239,15 @@ bit.\n"; printf(" *\t\t\t"); if (real_name[0]) printf("%s <", real_name); #ifdef H5_HAVE_GETPWUID - if (pwd) fputs(pwd->pw_name, stdout); + if (pwd) HDfputs(pwd->pw_name, stdout); #endif if (host_name[0]) printf("@%s", host_name); if (real_name[0]) printf(">"); - putchar('\n'); + HDputchar('\n'); } printf(" *\n * Purpose:\t\t"); for (s = purpose; *s; s++) { - putchar(*s); + HDputchar(*s); if ('\n' == *s && s[1]) printf(" *\t\t\t"); } @@ -1256,7 +1256,7 @@ bit.\n"; printf(" *\tIt was generated by code in `H5detect.c'.\n"); printf(" *\n *"); - for (i = 0; i < 73; i++) putchar('-'); + for (i = 0; i < 73; i++) HDputchar('-'); printf("\n */\n\n"); } @@ -1645,7 +1645,7 @@ main(void) nvpairs[1] = UAC_NOPRINT | UAC_SIGBUS; if (setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0)<0) { fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", - strerror(errno)); + HDstrerror(errno)); } #endif #endif diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c index d903592..fa00c64 100644 --- a/src/H5make_libsettings.c +++ b/src/H5make_libsettings.c @@ -94,7 +94,7 @@ insert_libhdf5_settings(FILE *flibinfo) else HDputc(inchar, flibinfo); } /* end while */ - if(feof(fsettings)) { + if(HDfeof(fsettings)) { /* wrap up */ if(!bol) /* EOF found without a new line */ @@ -182,7 +182,7 @@ information about the library build configuration\n"; size_t n; char *comma; - if((pwd = HDgetpwuid(getuid()))) { + if((pwd = HDgetpwuid(HDgetuid()))) { if((comma = HDstrchr(pwd->pw_gecos, ','))) { n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos)); HDstrncpy(real_name, pwd->pw_gecos, n); @@ -204,7 +204,7 @@ information about the library build configuration\n"; * The FQDM of this host or the empty string. */ #ifdef H5_HAVE_GETHOSTNAME - if(gethostname(host_name, sizeof(host_name)) < 0) + if(HDgethostname(host_name, sizeof(host_name)) < 0) host_name[0] = '\0'; #else host_name[0] = '\0'; diff --git a/src/H5private.h b/src/H5private.h index 731a7f6..2701c63 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -844,6 +844,9 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #ifndef HDgetgroups #define HDgetgroups(Z,G) getgroups(Z,G) #endif /* HDgetgroups */ +#ifndef HDgethostname + #define HDgethostname(N,L) gethostname(N,L) +#endif /* HDgetlogin */ #ifndef HDgetlogin #define HDgetlogin() getlogin() #endif /* HDgetlogin */ diff --git a/src/H5system.c b/src/H5system.c index 3ffe411..a93a128 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -117,8 +117,8 @@ HDfprintf(FILE *stream, const char *fmt, ...) const char *s; va_list ap; - assert (stream); - assert (fmt); + HDassert(stream); + HDassert(fmt); va_start (ap, fmt); while (*fmt) { diff --git a/src/H5timer.c b/src/H5timer.c index 7bdee8a..301d98b 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -97,8 +97,8 @@ void H5_timer_reset (H5_timer_t *timer) { - assert (timer); - HDmemset (timer, 0, sizeof *timer); + HDassert(timer); + HDmemset(timer, 0, sizeof *timer); } /* end H5_timer_reset() */ @@ -126,7 +126,7 @@ H5_timer_begin (H5_timer_t *timer) struct timeval etime; #endif - assert (timer); + HDassert(timer); #ifdef H5_HAVE_GETRUSAGE HDgetrusage (RUSAGE_SELF, &rusage); @@ -169,7 +169,7 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) { H5_timer_t now; - assert (timer); + HDassert(timer); H5_timer_begin (&now); timer->utime = MAX(0.0, now.utime - timer->utime); @@ -220,7 +220,7 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds) HDstrcpy(buf, " NaN"); else { bw = nbytes/nseconds; - if(fabs(bw) < 0.0000000001) + if(HDfabs(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) diff --git a/src/H5trace.c b/src/H5trace.c index 92736d4..2babcd4 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -156,7 +156,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) } /* end if */ /* Get tim for event */ - if(fabs(first_time.etime) < 0.0000000001) + if(HDfabs(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) @@ -179,10 +179,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) char tmp[128]; sprintf(tmp, "%.6f", event_time.etime-first_time.etime); - fprintf(out, " %*s ", (int)strlen(tmp), ""); + fprintf(out, " %*s ", (int)HDstrlen(tmp), ""); } /* end if */ for(i = 0; i < current_depth; i++) - fputc('+', out); + HDfputc('+', out); fprintf(out, "%*s%s = ", 2*current_depth, "", func); } /* end if */ else { @@ -192,11 +192,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) } /* end if */ else { if(current_depth>last_call_depth) - fputs(" = \n", out); + HDfputs(" = \n", out); if(H5_debug_g.ttimes) fprintf(out, "@%.6f ", event_time.etime - first_time.etime); for(i = 0; i < current_depth; i++) - fputc('+', out); + HDfputc('+', out); fprintf(out, "%*s%s(", 2*current_depth, "", func); } /* end else */ diff --git a/test/links_env.c b/test/links_env.c index 2da5e64..308d562 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -21,7 +21,6 @@ #define H5G_TESTING #include "h5test.h" -#include "H5srcdir.h" #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ -- cgit v0.12 From 8cc6ceb4e32d51f9c296038fec589c2a4fb7eaaf Mon Sep 17 00:00:00 2001 From: Joel Plutchak Date: Wed, 22 May 2013 15:52:34 -0500 Subject: [svn-r23715] Bug Fix: HDFFV-8247 Description: Failure to write fill values to the user's buffer when reading unallocated chunks from datasets that have a fill value set to H5D_FILL_VALUE_DEFAULT. A consequence of this was the reporting of spurious data values in h5dump and h5diff output. Solution: Added check for fill value of H5D_FILL_VALUE_DEFAULT whenever fill value setting was checked to decide whether or not to fill. This effectively treats H5D_FILL_VALUE_DEFAULT the same as H5D_FILL_VALUE_USER rather than H5D_FILL_VALUE_UNDEFINED. Tested: h5committest (platypus, ostrich, jam-pp, koala) ran successfully (fillval test was modified to reveal and check for this error) Note: RELEASE.txt was previously changed to reflect this fix. This checkin was of a cleaner version of the code, but mostly to get this full log message entered. -This line, and those below, will be ignored-- M H5Dchunk.c --- src/H5Dchunk.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 2838a39..dd1860f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -1797,8 +1797,9 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, * but they aren't set, set the flag to skip missing chunks. */ if(fill->fill_time == H5D_FILL_TIME_NEVER || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status != H5D_FILL_VALUE_USER_DEFINED && - fill_status != H5D_FILL_VALUE_DEFAULT)) + (fill->fill_time == H5D_FILL_TIME_IFSET && + fill_status != H5D_FILL_VALUE_USER_DEFINED && + fill_status != H5D_FILL_VALUE_DEFAULT)) skip_missing_chunks = TRUE; } @@ -2889,7 +2890,9 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't tell if fill value defined") if(fill->fill_time == H5D_FILL_TIME_ALLOC || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED)) { + (fill->fill_time == H5D_FILL_TIME_IFSET && + (fill_status == H5D_FILL_VALUE_USER_DEFINED || + fill_status == H5D_FILL_VALUE_DEFAULT))) { /* * The chunk doesn't exist in the file. Replicate the fill * value throughout the chunk, if the fill value is defined. @@ -3314,7 +3317,9 @@ H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, * set the "should fill" flag */ if((!full_overwrite && (fill->fill_time == H5D_FILL_TIME_ALLOC || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED))) + (fill->fill_time == H5D_FILL_TIME_IFSET && + (fill_status == H5D_FILL_VALUE_USER_DEFINED || + fill_status == H5D_FILL_VALUE_DEFAULT)))) || pline->nused > 0) should_fill = TRUE; -- cgit v0.12 From 33bd53a7ebe9f0982b1a9b2141407519fcd607d9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 23 May 2013 13:24:57 -0500 Subject: [svn-r23717] Description: Fix return value from FAIL to NULL, to match the routines type. Tested on: Mac OSX/64 10.8.3 (amazon) --- src/H5Tnative.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Tnative.c b/src/H5Tnative.c index e7d1351..1a97f39 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -383,7 +383,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Find the conversion function */ if(NULL == (tpath = H5T_path_find(super_type, nat_super_type, NULL, NULL, H5P_DEFAULT, FALSE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to convert between src and dst data types") /* Retrieve member info and insert members into new enum type */ if((snmemb = H5T_get_nmembers(dtype)) <= 0) -- cgit v0.12 From 177a90f97ab9d315d832be74a48b49953e8db955 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 26 May 2013 03:56:00 -0500 Subject: [svn-r23718] Snapshot version 1.9 release 152 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index f328ecb..34d64ab 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.152 currently under development +HDF5 version 1.9.153 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index d86c4b7..ae83708 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 142 +LT_VERS_REVISION = 143 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index b6533b3..2e082be 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 142 +LT_VERS_REVISION = 143 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 3e15760..abbe63b 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.152. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.153. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.152' -PACKAGE_STRING='HDF5 1.9.152' +PACKAGE_VERSION='1.9.153' +PACKAGE_STRING='HDF5 1.9.153' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1486,7 +1486,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.152 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.153 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1556,7 +1556,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.152:";; + short | recursive ) echo "Configuration of HDF5 1.9.153:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.152 +HDF5 configure 1.9.153 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.152, which was +It was created by HDF5 $as_me 1.9.153, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3678,7 +3678,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.152' + VERSION='1.9.153' cat >>confdefs.h <<_ACEOF @@ -31632,7 +31632,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.152 +HDF5 config.lt 1.9.153 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33762,7 +33762,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.152, which was +This file was extended by HDF5 $as_me 1.9.153, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33828,7 +33828,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.152 +HDF5 config.status 1.9.153 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 30aeb09..8e37769 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.152], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.153], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index f47a11e..e359788 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 142 +LT_VERS_REVISION = 143 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 2abf918..03d851c 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 142 +LT_VERS_REVISION = 143 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 4e00046..a45a88b 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 142 +LT_VERS_REVISION = 143 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index c2bd053..5d86828 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 142 +LT_VERS_REVISION = 143 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index ac36a02..976baea 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.152 currently under development +HDF5 version 1.9.153 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index c30e156..7e8362b 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 152 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 153 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.152" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.153" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 54ddca3..3b28f6b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 142 +LT_VERS_REVISION = 143 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 33d52da..bd97307 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -511,7 +511,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.152" +#define H5_PACKAGE_STRING "HDF5 1.9.153" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -520,7 +520,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.152" +#define H5_PACKAGE_VERSION "1.9.153" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -683,7 +683,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.152" +#define H5_VERSION "1.9.153" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From fab67b684ee108a3e913828e2d236d59a9a8e487 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 5 Jun 2013 08:36:45 -0500 Subject: [svn-r23733] HDFFV-8366: Patches tested by Larry using h5committest, it creates the intermediate testfiles folder first. --- tools/h5dump/testh5dump.sh.in | 2 ++ tools/h5dump/testh5dumppbits.sh.in | 2 ++ tools/h5dump/testh5dumpxml.sh.in | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index ceefc08..6d45b4c 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -59,7 +59,9 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" +TEST_P_DIR=./testfiles TESTDIR=./testfiles/std +test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR test -d $TESTDIR || mkdir -p $TESTDIR ###################################################################### diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in index 8e8e0c0..def687b 100644 --- a/tools/h5dump/testh5dumppbits.sh.in +++ b/tools/h5dump/testh5dumppbits.sh.in @@ -64,7 +64,9 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" +TEST_P_DIR=./testfiles TESTDIR=./testfiles/pbits +test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR test -d $TESTDIR || mkdir -p $TESTDIR ###################################################################### diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in index a70d31c..6e4efd1 100644 --- a/tools/h5dump/testh5dumpxml.sh.in +++ b/tools/h5dump/testh5dumpxml.sh.in @@ -50,7 +50,9 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" +TEST_P_DIR=./testfiles TESTDIR=./testfiles/xml +test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR test -d $TESTDIR || mkdir -p $TESTDIR ###################################################################### -- cgit v0.12 From 10108d7e304531493c1e6158b50ac6d839fdf562 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 5 Jun 2013 12:55:09 -0500 Subject: [svn-r23735] HDFFV-8445: unregonized character warning solved by changing '\/' to '\\'. Tested: Windows --- src/H5PL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PL.c b/src/H5PL.c index 7a8a296..def41d1 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -456,7 +456,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) FUNC_ENTER_STATIC /* Specify a file mask. *.* = We want everything! */ - sprintf(service, "%s\/*.dll", dir); + sprintf(service, "%s\\*.dll", dir); if((hFind = FindFirstFile(service, &fdFile)) == INVALID_HANDLE_VALUE) HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") -- cgit v0.12 From 06d9eb3c6388aa193cb7cd89d8ec724d046d8b27 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 5 Jun 2013 13:14:45 -0500 Subject: [svn-r23736] HDFFV-8437: CMake so version numbering - changed order of values to match libtool values. Tested: local linux --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f7a2fe..66c3555 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,7 +190,7 @@ STRING (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) STRING (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) -MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}") +MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") #----------------------------------------------------------------------------- # Basic HDF5 stuff here @@ -205,7 +205,7 @@ IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") -SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}") +SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") SET (HDF5_PACKAGE_URL "http://www.hdfgroup.org") -- cgit v0.12 From a6d8395557a27d2dd3dd3929712c78b6e4e8ed2d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 5 Jun 2013 13:26:35 -0500 Subject: [svn-r23737] HDFFV-8434: Use lowecase for whether in confiure.ac Trival change --- configure | 8 ++++---- configure.ac | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure b/configure index abbe63b..f6c2cb6 100755 --- a/configure +++ b/configure @@ -30992,8 +30992,8 @@ fi ## Enable strict file format checks ## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Whether to perform strict file format checks" >&5 -$as_echo_n "checking Whether to perform strict file format checks... " >&6; }; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to perform strict file format checks" >&5 +$as_echo_n "checking whether to perform strict file format checks... " >&6; }; # Check whether --enable-strict-format-checks was given. if test "${enable_strict_format_checks+set}" = set; then : enableval=$enable_strict_format_checks; STRICT_CHECKS=$enableval @@ -31029,8 +31029,8 @@ esac ## ---------------------------------------------------------------------- ## Enable embedded library information ## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Whether to have library information embedded in the executables" >&5 -$as_echo_n "checking Whether to have library information embedded in the executables... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to have library information embedded in the executables" >&5 +$as_echo_n "checking whether to have library information embedded in the executables... " >&6; } # Check whether --enable-embedded-libinfo was given. if test "${enable_embedded_libinfo+set}" = set; then : enableval=$enable_embedded_libinfo; enable_embedded_libinfo=$enableval diff --git a/configure.ac b/configure.ac index 8e37769..3373119 100644 --- a/configure.ac +++ b/configure.ac @@ -4276,7 +4276,7 @@ fi ## Enable strict file format checks ## AC_SUBST([STRICT_FORMAT_CHECKS]) -AC_MSG_CHECKING([Whether to perform strict file format checks]); +AC_MSG_CHECKING([whether to perform strict file format checks]); AC_ARG_ENABLE([strict-format-checks], [AS_HELP_STRING([--enable-strict-format-checks], [Enable strict file format checks, default=yes if @@ -4309,7 +4309,7 @@ esac ## ---------------------------------------------------------------------- ## Enable embedded library information ## -AC_MSG_CHECKING([Whether to have library information embedded in the executables]) +AC_MSG_CHECKING([whether to have library information embedded in the executables]) AC_ARG_ENABLE([embedded-libinfo], [AS_HELP_STRING([--enable-embedded-libinfo], [Enable embedded library information [default=yes]])], -- cgit v0.12 From f0a9b781f3e751f18e074f0aa3d9d63f8fd83357 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 7 Jun 2013 13:39:54 -0500 Subject: [svn-r23740] HDFFV-8447: subsetting broke data output file option. Reviewed in H5T-59, tested local linux --- MANIFEST | 2 ++ tools/h5dump/CMakeLists.txt | 8 +++++++- tools/h5dump/testh5dump.sh.in | 3 +++ tools/lib/h5tools_dump.c | 14 +++++++------- tools/testfiles/trawssetfile.ddl | 14 ++++++++++++++ tools/testfiles/trawssetfile.exp | 2 ++ 6 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 tools/testfiles/trawssetfile.ddl create mode 100644 tools/testfiles/trawssetfile.exp diff --git a/MANIFEST b/MANIFEST index d9ff5db..fc36d36 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1511,6 +1511,8 @@ ./tools/testfiles/topaque.h5 ./tools/testfiles/trawdatafile.ddl ./tools/testfiles/trawdatafile.exp +./tools/testfiles/trawssetfile.ddl +./tools/testfiles/trawssetfile.exp ./tools/testfiles/tsaf.ddl ./tools/testfiles/tsaf.h5 ./tools/testfiles/tscalarattrintsize.ddl diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index c7ebe63..3adea56 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -148,6 +148,7 @@ IF (BUILD_TESTING) ${HDF5_TOOLS_SRC_DIR}/testfiles/tno-subset.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/trawdatafile.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/trawssetfile.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr2.ddl @@ -199,6 +200,7 @@ IF (BUILD_TESTING) tall-6.exp tnoddlfile.exp trawdatafile.exp + trawssetfile.exp tstr2bin2.exp tstr2bin6.exp twithddl.exp @@ -1254,6 +1256,9 @@ IF (BUILD_TESTING) trawdatafile.out trawdatafile.out.err trawdatafile.txt + trawssetfile.out + trawssetfile.out.err + trawssetfile.txt tno-subset.out tno-subset.out.err tnullspace.out @@ -1369,7 +1374,8 @@ IF (BUILD_TESTING) ADD_H5_TEST (tnoattrdata 0 --enable-error-stack -A -o tattr.h5) ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o) ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o) - + ADD_H5_TEST_EXPORT (trawssetfile tdset.h5 0 --enable-error-stack -d "/dset1[1,1;;;]" -y -o) + ADD_H5_TEST_EXPORT_DDL (twithddlfile packedbits.h5 0 twithddl --enable-error-stack --ddl=twithddl.txt -y -o) # test for maximum display datasets diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 6d45b4c..f55ecf8 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -276,6 +276,8 @@ $SRC_H5DUMP_TESTFILES/tno-subset.ddl $SRC_H5DUMP_TESTFILES/tnullspace.ddl $SRC_H5DUMP_TESTFILES/trawdatafile.ddl $SRC_H5DUMP_TESTFILES/trawdatafile.exp +$SRC_H5DUMP_TESTFILES/trawssetfile.ddl +$SRC_H5DUMP_TESTFILES/trawssetfile.exp $SRC_H5DUMP_TESTFILES/zerodim.ddl $SRC_H5DUMP_TESTFILES/tordergr1.ddl $SRC_H5DUMP_TESTFILES/tordergr2.ddl @@ -875,6 +877,7 @@ TOOLTEST tnoattrdata.ddl --enable-error-stack -A -o tattr.h5 TOOLTEST2 trawdatafile.exp --enable-error-stack -y -o trawdatafile.txt packedbits.h5 TOOLTEST2 tnoddlfile.exp --enable-error-stack -O -y -o tnoddlfile.txt packedbits.h5 TOOLTEST2A twithddlfile.exp twithddl.exp --enable-error-stack --ddl=twithddl.txt -y -o twithddlfile.txt packedbits.h5 +TOOLTEST2 trawssetfile.exp --enable-error-stack -d "/dset1[1,1;;;]" -y -o trawssetfile.txt tdset.h5 # test for maximum display datasets TOOLTEST twidedisplay.ddl --enable-error-stack -w0 packedbits.h5 diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index b3c8f5e..e4fe3a4 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -314,13 +314,13 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai if (region_space >= 0) { if (h5tools_is_zero(memref, H5Tget_size(type))) { ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + h5tools_simple_prefix(rawoutstream, info, ctx, curr_pos, 0); /* Render the region element begin */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NULL"); - dimension_break = h5tools_render_element(stream, info, + dimension_break = h5tools_render_element(rawoutstream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); } else { @@ -328,25 +328,25 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_name failed"); ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos+i, 0); + h5tools_simple_prefix(rawoutstream, info, ctx, curr_pos+i, 0); /* Render the region element begin */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, info->dset_format, ref_name); - dimension_break = h5tools_render_element(stream, info, + dimension_break = h5tools_render_element(rawoutstream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); region_type = H5Sget_select_type(region_space); if(region_type == H5S_SEL_POINTS) /* Print point information */ dimension_break = h5tools_dump_region_data_points( - region_space, region_id, stream, info, ctx, + region_space, region_id, rawoutstream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); else if(region_type == H5S_SEL_HYPERSLABS) /* Print block information */ dimension_break = h5tools_dump_region_data_blocks( - region_space, region_id, stream, info, ctx, + region_space, region_id, rawoutstream, info, ctx, &buffer, &curr_pos, ncols, i, elmt_counter); else HERROR(H5E_tools_g, H5E_tools_min_id_g, "invalid region type"); @@ -1790,7 +1790,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * if(!sset) status = h5tools_dump_simple_dset(rawdatastream, info, ctx, dset, p_type); else - status = h5tools_dump_simple_subset(stream, info, ctx, dset, p_type, sset); + status = h5tools_dump_simple_subset(rawdatastream, info, ctx, dset, p_type, sset); } else /* space is H5S_NULL */ diff --git a/tools/testfiles/trawssetfile.ddl b/tools/testfiles/trawssetfile.ddl new file mode 100644 index 0000000..e8f07f8 --- /dev/null +++ b/tools/testfiles/trawssetfile.ddl @@ -0,0 +1,14 @@ +HDF5 "tdset.h5" { +DATASET "/dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 10, 20 ) / ( 10, 20 ) } + SUBSET { + START ( 1, 1 ); + STRIDE ( 1, 1 ); + COUNT ( 1, 1 ); + BLOCK ( 1, 1 ); + DATA { + } + } +} +} diff --git a/tools/testfiles/trawssetfile.exp b/tools/testfiles/trawssetfile.exp new file mode 100644 index 0000000..2de8392 --- /dev/null +++ b/tools/testfiles/trawssetfile.exp @@ -0,0 +1,2 @@ + + 2 \ No newline at end of file -- cgit v0.12 From 70d440330db5b4e3cf6c791e0cc5b264b4807fee Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 9 Jun 2013 03:39:22 -0500 Subject: [svn-r23741] Snapshot version 1.9 release 153 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index 34d64ab..adef39f 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.153 currently under development +HDF5 version 1.9.154 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index ae83708..1c2d2de 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 143 +LT_VERS_REVISION = 144 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 2e082be..30d66a4 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 143 +LT_VERS_REVISION = 144 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index f6c2cb6..2b2aa7c 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.153. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.154. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.153' -PACKAGE_STRING='HDF5 1.9.153' +PACKAGE_VERSION='1.9.154' +PACKAGE_STRING='HDF5 1.9.154' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1486,7 +1486,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.153 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.154 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1556,7 +1556,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.153:";; + short | recursive ) echo "Configuration of HDF5 1.9.154:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.153 +HDF5 configure 1.9.154 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.153, which was +It was created by HDF5 $as_me 1.9.154, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3678,7 +3678,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.153' + VERSION='1.9.154' cat >>confdefs.h <<_ACEOF @@ -31632,7 +31632,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.153 +HDF5 config.lt 1.9.154 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33762,7 +33762,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.153, which was +This file was extended by HDF5 $as_me 1.9.154, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33828,7 +33828,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.153 +HDF5 config.status 1.9.154 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 3373119..1756d12 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.153], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.154], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index e359788..706317c 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 143 +LT_VERS_REVISION = 144 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 03d851c..752ea31 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 143 +LT_VERS_REVISION = 144 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index a45a88b..9f16c3c 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 143 +LT_VERS_REVISION = 144 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 5d86828..0b06294 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 143 +LT_VERS_REVISION = 144 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 976baea..4764cd6 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.153 currently under development +HDF5 version 1.9.154 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 7e8362b..fc96ea7 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 153 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 154 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.153" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.154" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 3b28f6b..2de0dbf 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 143 +LT_VERS_REVISION = 144 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index bd97307..b6662d1 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -511,7 +511,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.153" +#define H5_PACKAGE_STRING "HDF5 1.9.154" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -520,7 +520,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.153" +#define H5_PACKAGE_VERSION "1.9.154" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -683,7 +683,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.153" +#define H5_VERSION "1.9.154" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 001f6a53bff1ff0a074e52a31ee9ce3e61a0e7ce Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 10 Jun 2013 12:41:33 -0500 Subject: [svn-r23744] HDFFV-8468: Remove conversion tests which generate access violations on Windows 8 64 --- config/cmake/ConfigureChecks.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index b2078e2..0a4d190 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -190,7 +190,7 @@ ENDIF (WINDOWS) # something not quite correct with the actual test implementation. This affects # the 'dt_arith' test and most likely lots of other code # ---------------------------------------------------------------------------- -SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +#SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values @@ -1029,7 +1029,9 @@ H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "chec # integers except 'unsigned long long'. Other HP-UX systems are unknown # yet. (1/8/05 - SLU) # +IF (NOT MSVC) H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") +ENDIF (NOT MSVC) # ----------------------------------------------------------------------- # Set flag to indicate that the machine can handle conversion from # integers to long double. (This flag should be set "yes" for all @@ -1103,7 +1105,9 @@ ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) # where the last 2 bytes of mantissa are lost when compiler tries to do # the conversion, and Cygwin where compiler doesn't do rounding correctly.) # +IF (NOT MSVC) H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") +ENDIF (NOT MSVC) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle overflow converting # all floating-point to all integer types. -- cgit v0.12 From feb14ea872ed5889de014e35c421b37501fbe38a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 10 Jun 2013 12:46:48 -0500 Subject: [svn-r23745] HDFFV-8461: Add Windows /MT support This adds the UserMacros.cmake support needed. --- CMakeLists.txt | 7 +++++ MANIFEST | 1 + UserMacros.cmake | 17 ++++++++++++ c++/examples/CMakeLists.txt | 1 + c++/src/CMakeLists.txt | 1 + c++/test/CMakeLists.txt | 1 + config/cmake/HDFMacros.cmake | 57 ++++++++++++++++++++++++++++++++++---- examples/CMakeLists.txt | 2 ++ fortran/examples/CMakeLists.txt | 6 ++-- fortran/src/CMakeLists.txt | 3 +- fortran/test/CMakeLists.txt | 13 +++++---- fortran/testpar/CMakeLists.txt | 2 +- hl/c++/examples/CMakeLists.txt | 1 + hl/c++/src/CMakeLists.txt | 3 +- hl/c++/test/CMakeLists.txt | 1 + hl/examples/CMakeLists.txt | 1 + hl/fortran/examples/CMakeLists.txt | 2 +- hl/fortran/src/CMakeLists.txt | 3 +- hl/fortran/test/CMakeLists.txt | 8 +++--- hl/src/CMakeLists.txt | 1 + hl/test/CMakeLists.txt | 2 ++ hl/tools/CMakeLists.txt | 3 ++ perform/CMakeLists.txt | 10 +++++++ release_docs/USING_HDF5_CMake.txt | 1 + src/CMakeLists.txt | 3 ++ test/CMakeLists.txt | 14 ++++++++++ testpar/CMakeLists.txt | 2 ++ tools/h5copy/CMakeLists.txt | 2 ++ tools/h5diff/CMakeLists.txt | 3 ++ tools/h5dump/CMakeLists.txt | 2 ++ tools/h5import/CMakeLists.txt | 2 ++ tools/h5jam/CMakeLists.txt | 5 ++++ tools/h5ls/CMakeLists.txt | 1 + tools/h5repack/CMakeLists.txt | 3 ++ tools/h5stat/CMakeLists.txt | 2 ++ tools/lib/CMakeLists.txt | 3 +- tools/misc/CMakeLists.txt | 5 ++++ 37 files changed, 170 insertions(+), 24 deletions(-) create mode 100644 UserMacros.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 66c3555..e14fc21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,6 +351,8 @@ ENDIF (WIN32) IF (MSVC) SET (CMAKE_MFC_FLAG 0) + SET (WIN_COMPILE_FLAGS "/MD") + SET (WIN_LINK_FLAGS "") ENDIF (MSVC) SET (MAKE_SYSTEM) @@ -522,6 +524,11 @@ IF (HDF5_USE_18_API_DEFAULT) ENDIF (HDF5_USE_18_API_DEFAULT) #----------------------------------------------------------------------------- +# Include user macros +#----------------------------------------------------------------------------- +INCLUDE (UserMacros.cmake) + +#----------------------------------------------------------------------------- # Options for HDF5 Filters #----------------------------------------------------------------------------- MACRO (HDF5_SETUP_FILTERS FILTER) diff --git a/MANIFEST b/MANIFEST index fc36d36..0f368e7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2398,6 +2398,7 @@ ./CMakeLists.txt ./CTestConfig.cmake +./UserMacros.cmake ./c++/CMakeLists.txt ./c++/examples/CMakeLists.txt ./c++/src/CMakeLists.txt diff --git a/UserMacros.cmake b/UserMacros.cmake new file mode 100644 index 0000000..d7d3ef9 --- /dev/null +++ b/UserMacros.cmake @@ -0,0 +1,17 @@ +######################################################## +# Include file for user options +######################################################## + +#----------------------------------------------------------------------------- +# Option to Build with User Defined Values +#----------------------------------------------------------------------------- +MACRO (MACRO_USER_DEFINED_LIBS) + SET (USER_DEFINED_VALUE "FALSE") +ENDMACRO (MACRO_USER_DEFINED_LIBS) + +#------------------------------------------------------------------------------- +OPTION (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) +IF (BUILD_USER_DEFINED_LIBS) + MACRO_USER_DEFINED_LIBS () +ENDIF (BUILD_USER_DEFINED_LIBS) + \ No newline at end of file diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index f45251b..dd8e45d 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -23,6 +23,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) + TARGET_C_PROPERTIES (cpp_ex_${example} " " " ") TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) ENDFOREACH (example ${examples}) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index cf5bd07..e7ae371 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -84,6 +84,7 @@ SET (CPP_HDRS ) ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) +TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE}) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 124edb9..b31185e 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -37,6 +37,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} ) ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} ) TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE}) +TARGET_C_PROPERTIES (cpp_testhdf5 " " " ") TARGET_LINK_LIBRARIES (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index 099b97f..e9e9665 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -121,20 +121,67 @@ MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) ENDMACRO (HDF_SET_LIB_OPTIONS) #------------------------------------------------------------------------------- -MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addlinkflags) - IF (WIN32 AND MSVC) +MACRO (TARGET_C_PROPERTIES wintarget addcompileflags addlinkflags) + IF (MSVC) + TARGET_MSVC_PROPERTIES (${wintarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") + ELSE (MSVC) IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${wintarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + ELSE (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (${forttarget} PROPERTIES - COMPILE_FLAGS "/dll" + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDMACRO (TARGET_C_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (TARGET_MSVC_PROPERTIES wintarget addcompileflags addlinkflags) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${wintarget} + PROPERTIES + COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) ELSE (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (${forttarget} PROPERTIES - COMPILE_FLAGS "/MD" + COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) ENDIF (BUILD_SHARED_LIBS) - ENDIF (WIN32 AND MSVC) + ENDIF (MSVC) +ENDMACRO (TARGET_MSVC_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (TARGET_FORTRAN_PROPERTIES forttarget addcompileflags addlinkflags) + IF (WIN32) + TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") + ENDIF (WIN32) +ENDMACRO (TARGET_FORTRAN_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addcompileflags addlinkflags) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${forttarget} + PROPERTIES + COMPILE_FLAGS "/dll ${addcompileflags}" + LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + ) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${forttarget} + PROPERTIES + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3abf97a..01daf69 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -39,6 +39,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (${example} ${LIB_TYPE}) + TARGET_C_PROPERTIES (${example} " " " ") TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (${example} PROPERTIES FOLDER examples) ENDFOREACH (example ${examples}) @@ -46,6 +47,7 @@ ENDFOREACH (example ${examples}) IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example ${LIB_TYPE}) + TARGET_C_PROPERTIES (ph5example " " " ") TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (ph5example PROPERTIES FOLDER examples) ENDIF (H5_HAVE_PARALLEL) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 0536183..e514a6e 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -41,7 +41,7 @@ SET (F2003_examples FOREACH (example ${examples}) ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_${example} "") + TARGET_FORTRAN_PROPERTIES (f90_ex_${example} " " " ") IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS @@ -69,7 +69,7 @@ IF (HDF5_ENABLE_F2003) FOREACH (example ${F2003_examples}) ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (f03_ex_${example} "") + TARGET_FORTRAN_PROPERTIES (f03_ex_${example} " " " ") IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f03_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS @@ -95,7 +95,7 @@ ENDIF (HDF5_ENABLE_F2003) IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_ph5example "") + TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example " " " ") IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_ph5example APPEND PROPERTY COMPILE_DEFINITIONS diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 1bddc56..5d8c2d5 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -133,6 +133,7 @@ SET (f90CStub_C_HDRS ) ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) +TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE}) @@ -233,7 +234,7 @@ IF (WIN32 AND NOT CYGWIN) HDF5F90_WINDOWS ) ENDIF (WIN32 AND NOT CYGWIN) -TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${SHARED_LINK_FLAGS}) +TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 5b9ca11..72f239e 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -10,6 +10,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ # Add Test Lib #----------------------------------------------------------------------------- ADD_LIBRARY (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) +TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} @@ -28,7 +29,7 @@ IF (WIN32 AND NOT CYGWIN) ENDIF (BUILD_SHARED_LIBS) SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) ENDIF (WIN32 AND NOT CYGWIN) -TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} ${SHARED_LINK_FLAGS}) +TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_TARGET} @@ -60,7 +61,7 @@ ADD_EXECUTABLE (testhdf5_fortran tH5Z.f90 ) TARGET_NAMING (testhdf5_fortran ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran "") +TARGET_FORTRAN_PROPERTIES (testhdf5_fortran " " " ") TARGET_LINK_LIBRARIES (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -84,7 +85,7 @@ ADD_EXECUTABLE (testhdf5_fortran_1_8 tH5G_1_8.f90 ) TARGET_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran_1_8 "") +TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 " " " ") TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -112,7 +113,7 @@ IF (HDF5_ENABLE_F2003) tH5T_F03.f90 ) TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (fortranlib_test_F03 "") + TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 " " " ") TARGET_LINK_LIBRARIES (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -131,7 +132,7 @@ ENDIF (HDF5_ENABLE_F2003) #-- Adding test for fflush1 ADD_EXECUTABLE (fflush1 fflush1.f90) TARGET_NAMING (fflush1 ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (fflush1 "") +TARGET_FORTRAN_PROPERTIES (fflush1 " " " ") TARGET_LINK_LIBRARIES (fflush1 ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} @@ -148,7 +149,7 @@ ADD_TEST (NAME fflush1 COMMAND $) #-- Adding test for fflush2 ADD_EXECUTABLE (fflush2 fflush2.f90) TARGET_NAMING (fflush2 ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (fflush2 "") +TARGET_FORTRAN_PROPERTIES (fflush2 " " " ") TARGET_LINK_LIBRARIES (fflush2 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 1c7248c..76b6023 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -17,7 +17,7 @@ ADD_EXECUTABLE (parallel_test mdset.f90 ) TARGET_NAMING (parallel_test ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (parallel_test "") +TARGET_FORTRAN_PROPERTIES (parallel_test " " " ") TARGET_LINK_LIBRARIES (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 4c60165..aa4221f 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -12,6 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) # -------------------------------------------------------------------- ADD_EXECUTABLE (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) TARGET_NAMING (ptExampleFL ${LIB_TYPE}) +TARGET_C_PROPERTIES (ptExampleFL " " " ") TARGET_LINK_LIBRARIES ( ptExampleFL ${HDF5_HL_CPP_LIB_TARGET} diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 89de4ca..aa54889 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -10,7 +10,8 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) SET (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) SET (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) -ADD_LIBRARY ( ${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) +ADD_LIBRARY (${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) +TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES ( ${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_LIB_TARGET} diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 0f82748..6633426 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -17,6 +17,7 @@ IF (BUILD_TESTING) INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) ADD_EXECUTABLE (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) + TARGET_C_PROPERTIES (hl_ptableTest " " " ") TARGET_NAMING (hl_ptableTest ${LIB_TYPE}) TARGET_LINK_LIBRARIES ( hl_ptableTest diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 1f4807a..b702754 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -43,6 +43,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (hl_ex_${example} ${LIB_TYPE}) + TARGET_C_PROPERTIES (hl_ex_${example} " " " ") TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_ex_${example} PROPERTIES FOLDER examples/hl) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 03b9e9b..df7fd24 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -18,7 +18,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (hl_f90_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_ex_${example} "") + TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} " " " ") TARGET_LINK_LIBRARIES (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 9ab0fb2..22353f8 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -26,6 +26,7 @@ SET_SOURCE_FILES_PROPERTIES (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C) SET (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) +TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE}) @@ -61,7 +62,7 @@ IF (WIN32 AND NOT CYGWIN) HDF5F90_WINDOWS ) ENDIF (WIN32 AND NOT CYGWIN) -TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} ${SHARED_LINK_FLAGS}) +TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index d76e7f2..7e7aa1d 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -23,7 +23,7 @@ ADD_TEST ( #-- Adding test for hl_f90_tstds ADD_EXECUTABLE (hl_f90_tstds tstds.f90) TARGET_NAMING (hl_f90_tstds ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstds "") +TARGET_FORTRAN_PROPERTIES (hl_f90_tstds " " " ") TARGET_LINK_LIBRARIES (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) @@ -33,7 +33,7 @@ ADD_TEST (NAME hl_f90_tstds COMMAND $) #-- Adding test for hl_f90_tstlite ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstlite "") +TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite " " " ") TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) @@ -43,7 +43,7 @@ ADD_TEST (NAME hl_f90_tstlite COMMAND $) #-- Adding test for hl_f90_tstimage ADD_EXECUTABLE (hl_f90_tstimage tstimage.f90) TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstimage "") +TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage " " " ") TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) @@ -53,7 +53,7 @@ ADD_TEST (NAME hl_f90_tstimage COMMAND $) #-- Adding test for hl_f90_tsttable ADD_EXECUTABLE (hl_f90_tsttable tsttable.f90) TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE}) -TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tsttable "") +TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable " " " ") TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index edba042..5904d05 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -36,6 +36,7 @@ SET (HL_HEADERS ) ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) +TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index c5b6f6e..9cb61e0 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -23,6 +23,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) MACRO (HL_ADD_TEST hl_name files) ADD_EXECUTABLE (hl_${hl_name} ${hl_name}.c) TARGET_NAMING (hl_${hl_name} ${LIB_TYPE}) + TARGET_C_PROPERTIES (hl_${hl_name} " " " ") TARGET_LINK_LIBRARIES (hl_${hl_name} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -97,6 +98,7 @@ HL_ADD_TEST (test_table "test_table_be.h5;test_table_cray.h5;test_table_le.h5") IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (hl_gen_test_ds gen_test_ds.c) TARGET_NAMING (hl_gen_test_ds ${LIB_TYPE}) + TARGET_C_PROPERTIES (hl_gen_test_ds " " " ") TARGET_LINK_LIBRARIES (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 4887b6c..1deff23 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5) ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS}) TARGET_NAMING (gif2h5 ${LIB_TYPE}) +TARGET_C_PROPERTIES (gif2h5 " " " ") TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (gif2h5 PROPERTIES FOLDER tools/hl) @@ -29,6 +30,7 @@ SET (hdf2gif_SRCS ) ADD_EXECUTABLE (h52gif ${hdf2gif_SRCS}) TARGET_NAMING (h52gif ${LIB_TYPE}) +TARGET_C_PROPERTIES (h52gif " " " ") TARGET_LINK_LIBRARIES (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl) @@ -40,6 +42,7 @@ SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) TARGET_NAMING (hl_h52gifgentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (hl_h52gifgentest " " " ") TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 3f8b9b7..f3aed76 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -23,6 +23,7 @@ SET (h5perf_serial_SRCS ) ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS}) TARGET_NAMING (h5perf_serial ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5perf_serial " " " ") TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5perf_serial PROPERTIES FOLDER perform) @@ -38,6 +39,7 @@ IF (HDF5_BUILD_PERFORM_STANDALONE) APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5perf_serial_alone " " " ") TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5perf_serial_alone PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) @@ -48,6 +50,7 @@ SET (chunk_SRCS ) ADD_EXECUTABLE(chunk ${chunk_SRCS}) TARGET_NAMING (chunk ${LIB_TYPE}) +TARGET_C_PROPERTIES (chunk " " " ") TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (chunk PROPERTIES FOLDER perform) @@ -57,6 +60,7 @@ SET (iopipe_SRCS ) ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) TARGET_NAMING (iopipe ${LIB_TYPE}) +TARGET_C_PROPERTIES (iopipe " " " ") TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (iopipe PROPERTIES FOLDER perform) @@ -66,6 +70,7 @@ SET (overhead_SRCS ) ADD_EXECUTABLE (overhead ${overhead_SRCS}) TARGET_NAMING (overhead ${LIB_TYPE}) +TARGET_C_PROPERTIES (overhead " " " ") TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (overhead PROPERTIES FOLDER perform) @@ -75,6 +80,7 @@ SET (perf_meta_SRCS ) ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) TARGET_NAMING (perf_meta ${LIB_TYPE}) +TARGET_C_PROPERTIES (perf_meta " " " ") TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (perf_meta PROPERTIES FOLDER perform) @@ -84,6 +90,7 @@ SET (zip_perf_SRCS ) ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) TARGET_NAMING (zip_perf ${LIB_TYPE}) +TARGET_C_PROPERTIES (zip_perf " " " ") TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (zip_perf PROPERTIES FOLDER perform) @@ -96,6 +103,7 @@ IF (H5_HAVE_PARALLEL) ) ADD_EXECUTABLE (h5perf ${h5perf_SRCS}) TARGET_NAMING (h5perf ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5perf " " " ") TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (h5perf PROPERTIES FOLDER perform) @@ -111,6 +119,7 @@ IF (H5_HAVE_PARALLEL) APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_alone ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5perf_alone " " " ") TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) @@ -122,6 +131,7 @@ IF (H5_HAVE_PARALLEL) ) ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) TARGET_NAMING (benchpar ${LIB_TYPE}) + TARGET_C_PROPERTIES (benchpar " " " ") TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PARALLEL_ALL) diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 2b3c02b..3c04f36 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -197,6 +197,7 @@ SET (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) SET (example hdf_example) ADD_EXECUTABLE (${example} ${PROJECT_SOURCE_DIR}/${example}.c) +TARGET_C_PROPERTIES (${example} " " " ") TARGET_LINK_LIBRARIES (${example} ${LINK_LIBS}) ENABLE_TESTING () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7132d80..74283fe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -774,6 +774,7 @@ INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}) # specific type checks inside #----------------------------------------------------------------------------- ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) +TARGET_C_PROPERTIES (H5detect " " " ") IF (MSVC) TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib") ENDIF (MSVC) @@ -787,6 +788,7 @@ ADD_CUSTOM_COMMAND ( ) ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +TARGET_C_PROPERTIES (H5make_libsettings " " " ") IF (MSVC) TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib") ENDIF (MSVC) @@ -836,6 +838,7 @@ SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) +TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS}) IF (NOT WIN32) TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} dl) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 766ed7b..741976b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,6 +27,7 @@ SET (TEST_LIB_HEADERS ) ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) +TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} " " " ") IF (MSVC) TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") ENDIF (MSVC) @@ -64,6 +65,7 @@ IF (BUILD_SHARED_LIBS) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} @@ -94,6 +96,7 @@ IF (BUILD_SHARED_LIBS) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} @@ -279,6 +282,7 @@ SET (testhdf5_SRCS #-- Adding test for testhdf5 ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS}) TARGET_NAMING (testhdf5 ${LIB_TYPE}) +TARGET_C_PROPERTIES (testhdf5 " " " ") TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (testhdf5 PROPERTIES FOLDER test) @@ -331,6 +335,7 @@ ENDIF (HDF5_ENABLE_USING_MEMCHECKER) MACRO (ADD_H5_TEST file) ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) + TARGET_C_PROPERTIES (${file} " " " ") TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test) @@ -474,6 +479,7 @@ SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) #-- Adding test for cache ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache ${LIB_TYPE}) +TARGET_C_PROPERTIES (cache " " " ") TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (cache PROPERTIES FOLDER test) ADD_TEST ( @@ -488,6 +494,7 @@ SET_TESTS_PROPERTIES(cache PROPERTIES DEPENDS h5test-clear-cache-objects) #-- Adding test for cache_api ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_api ${LIB_TYPE}) +TARGET_C_PROPERTIES (cache_api " " " ") TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (cache_api PROPERTIES FOLDER test) @@ -503,6 +510,7 @@ SET_TESTS_PROPERTIES(cache_api PROPERTIES DEPENDS h5test-clear-cache_api-objects #-- Adding test for cache_tagging ADD_EXECUTABLE (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_tagging ${LIB_TYPE}) +TARGET_C_PROPERTIES (cache_tagging " " " ") TARGET_LINK_LIBRARIES (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (cache_tagging PROPERTIES FOLDER test) @@ -525,6 +533,7 @@ ADD_EXECUTABLE (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c ) TARGET_NAMING (ttsafe ${LIB_TYPE}) +TARGET_C_PROPERTIES (ttsafe " " " ") TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (ttsafe PROPERTIES FOLDER test) @@ -544,6 +553,7 @@ SET_TESTS_PROPERTIES(ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) TARGET_NAMING (err_compat ${LIB_TYPE}) + TARGET_C_PROPERTIES (err_compat " " " ") TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (err_compat PROPERTIES FOLDER test) @@ -570,6 +580,7 @@ ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) TARGET_NAMING (error_test ${LIB_TYPE}) +TARGET_C_PROPERTIES (error_test " " " ") TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (error_test PROPERTIES FOLDER test) @@ -596,6 +607,7 @@ SET_TESTS_PROPERTIES (error_test PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::" #-- Adding test for links_env ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) TARGET_NAMING (links_env ${LIB_TYPE}) +TARGET_C_PROPERTIES (links_env " " " ") TARGET_LINK_LIBRARIES (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (links_env PROPERTIES FOLDER test) @@ -649,6 +661,7 @@ IF (BUILD_SHARED_LIBS) ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) TARGET_NAMING (plugin ${LIB_TYPE}) + TARGET_C_PROPERTIES (plugin " " " ") TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) @@ -784,6 +797,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) MACRO (ADD_H5_GENERATOR genfile) ADD_EXECUTABLE (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} ${LIB_TYPE}) + TARGET_C_PROPERTIES (${genfile} " " " ") TARGET_LINK_LIBRARIES (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (${genfile} PROPERTIES FOLDER generator/test) ENDMACRO (ADD_H5_GENERATOR genfile) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index cccb148..04aa383 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -29,6 +29,7 @@ SET (testphdf5_SRCS #-- Adding test for testhdf5 ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) TARGET_NAMING (testphdf5 ${LIB_TYPE}) +TARGET_C_PROPERTIES (testphdf5 " " " ") TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) SET_TARGET_PROPERTIES (testphdf5 PROPERTIES FOLDER test/par) @@ -37,6 +38,7 @@ ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEX MACRO (ADD_H5P_TEST file) ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) + TARGET_C_PROPERTIES (${file} " " " ") TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/par) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 7f68e76..137edb0 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) TARGET_NAMING (h5copy ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5copy " " " ") TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) @@ -26,6 +27,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5copygentest " " " ") TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 8eb5ad1..e4e722a 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -14,6 +14,7 @@ ADD_EXECUTABLE (h5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) TARGET_NAMING (h5diff ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5diff " " " ") TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5diff PROPERTIES FOLDER tools) @@ -25,6 +26,7 @@ IF (H5_HAVE_PARALLEL) ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) TARGET_NAMING (ph5diff ${LIB_TYPE}) + TARGET_C_PROPERTIES (ph5diff " " " ") TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools) ENDIF (H5_HAVE_PARALLEL) @@ -42,6 +44,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) TARGET_NAMING (h5diffgentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5diffgentest " " " ") TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 3adea56..f881ec0 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -15,6 +15,7 @@ ADD_EXECUTABLE (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) TARGET_NAMING (h5dump ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5dump " " " ") TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools) @@ -33,6 +34,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) TARGET_NAMING (h5dumpgentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5dumpgentest " " " ") TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5dumpgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 97f7be9..94dd69c 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5import " " " ") TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) #SET_TARGET_PROPERTIES (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools) @@ -29,6 +30,7 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) TARGET_NAMING (h5importtest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5importtest " " " ") TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 95777b3..af9639d 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -11,21 +11,25 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) TARGET_NAMING (h5jam ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5jam " " " ") TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5jam PROPERTIES FOLDER tools) ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) TARGET_NAMING (getub ${LIB_TYPE}) +TARGET_C_PROPERTIES (getub " " " ") TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (getub PROPERTIES FOLDER tools) ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) TARGET_NAMING (tellub ${LIB_TYPE}) +TARGET_C_PROPERTIES (tellub " " " ") TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (tellub PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) TARGET_NAMING (h5unjam ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5unjam " " " ") TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5unjam PROPERTIES FOLDER tools) @@ -49,6 +53,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) TARGET_NAMING (h5jamgentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (testhdf5 " " " ") TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 70943b5..2d7bd97 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) #----------------------------------------------------------------------------- ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) TARGET_NAMING (h5ls ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5ls " " " ") TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5ls PROPERTIES FOLDER tools) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 06c6b71..7d251ac 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -22,6 +22,7 @@ SET (REPACK_COMMON_SRCS ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) TARGET_NAMING (h5repack ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5repack " " " ") TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools) @@ -39,11 +40,13 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE}) + TARGET_C_PROPERTIES (testh5repack_detect_szip " " " ") TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (testh5repack_detect_szip PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) TARGET_NAMING (h5repacktest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5repacktest " " " ") TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 447df70..78f39dd 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -11,6 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) TARGET_NAMING (h5stat ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5stat " " " ") TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools) @@ -29,6 +30,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) TARGET_NAMING (h5stat_gentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5stat_gentest " " " ") TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index ac86e8a..6649e48 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -37,8 +37,9 @@ SET (H5_TOOLS_LIB_HDRS ) ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) +TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} " " " ") TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE(HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} ${LIB_TYPE} diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index e778d2f..dc98967 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -12,16 +12,19 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) #-- Misc Executables ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) TARGET_NAMING (h5debug ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5debug " " " ") TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) TARGET_NAMING (h5repart ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5repart " " " ") TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) TARGET_NAMING (h5mkgrp ${LIB_TYPE}) +TARGET_C_PROPERTIES (h5mkgrp " " " ") TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools) @@ -51,6 +54,7 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) TARGET_NAMING (h5repart_gentest ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5repart_gentest " " " ") TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5repart_gentest COMMAND $) @@ -58,6 +62,7 @@ IF (BUILD_TESTING) ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test ${LIB_TYPE}) + TARGET_C_PROPERTIES (h5repart_test " " " ") TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) -- cgit v0.12 From 7e2733da8cd2502d224a3dc6975f3dec12548838 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 10 Jun 2013 14:23:27 -0500 Subject: [svn-r23746] Correct Windows setting after tests on windows --- config/cmake/ConfigureChecks.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 0a4d190..a2e0a03 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -190,7 +190,7 @@ ENDIF (WINDOWS) # something not quite correct with the actual test implementation. This affects # the 'dt_arith' test and most likely lots of other code # ---------------------------------------------------------------------------- -#SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values -- cgit v0.12 From 8f0c245f727ad226cef00afc73fc25f7ef59f1f3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 10 Jun 2013 15:39:00 -0500 Subject: [svn-r23748] HDFFV-8461: Add Windows /MT support This adds the UserMacros.cmake support needed. Correct Properties tag name --- UserMacros.cmake | 39 +++++++++++++++++++++++++++++---------- config/cmake/HDFMacros.cmake | 4 ++-- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/UserMacros.cmake b/UserMacros.cmake index d7d3ef9..bf609e5 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -3,15 +3,34 @@ ######################################################## #----------------------------------------------------------------------------- -# Option to Build with User Defined Values -#----------------------------------------------------------------------------- -MACRO (MACRO_USER_DEFINED_LIBS) - SET (USER_DEFINED_VALUE "FALSE") -ENDMACRO (MACRO_USER_DEFINED_LIBS) - +# Option to Build with Static CRT libraries on Windows #------------------------------------------------------------------------------- -OPTION (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) -IF (BUILD_USER_DEFINED_LIBS) - MACRO_USER_DEFINED_LIBS () -ENDIF (BUILD_USER_DEFINED_LIBS) +MACRO (TARGET_STATIC_CRT_FLAGS) + IF (MSVC AND NOT BUILD_SHARED_LIBS) + FOREACH (flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/MD") + STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/MD") + ENDFOREACH (flag_var) + FOREACH (flag_var + CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE + CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/libs:dll") + STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/libs:dll") + ENDFOREACH (flag_var) + SET (WIN_COMPILE_FLAGS "/MT") + SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + ENDIF (MSVC AND NOT BUILD_SHARED_LIBS) +ENDMACRO (TARGET_STATIC_CRT_FLAGS) + +#----------------------------------------------------------------------------- +OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) +IF (BUILD_STATIC_CRT_LIBS) + TARGET_STATIC_CRT_FLAGS () +ENDIF (BUILD_STATIC_CRT_LIBS) \ No newline at end of file diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index e9e9665..1a2d11b 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -132,7 +132,7 @@ MACRO (TARGET_C_PROPERTIES wintarget addcompileflags addlinkflags) LINK_FLAGS "${addlinkflags}" ) ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + SET_TARGET_PROPERTIES (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" @@ -151,7 +151,7 @@ MACRO (TARGET_MSVC_PROPERTIES wintarget addcompileflags addlinkflags) LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + SET_TARGET_PROPERTIES (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" -- cgit v0.12 From f4a3f6412bb4e739e2a5bcfe2a404191407ae3f6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 11 Jun 2013 10:10:18 -0500 Subject: [svn-r23751] Enable all warnings (do not filter warnings) --- config/cmake/CTestCustom.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index ec7b10e..d59fc3a 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -2,18 +2,18 @@ SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1500) SET (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} - "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" - "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" - "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument" - "note.*expected.*void.*but argument is of type.*volatile" - "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" - "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" - "SZIP.src.*:[ \t]*warning" - "POSIX name for this item is deprecated" +# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" +# "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" +# "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument" +# "note.*expected.*void.*but argument is of type.*volatile" +# "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" +# "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" +# "SZIP.src.*:[ \t]*warning" +# "POSIX name for this item is deprecated" "disabling jobserver mode" "config.cmake.xlatefile.c" - "warning.*implicit declaration of function" - "note: expanded from macro" +# "warning.*implicit declaration of function" +# "note: expanded from macro" # "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" ) -- cgit v0.12 From 6ca79dd149087b27d2b91e38942e5b5f706ae1a3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 11 Jun 2013 14:03:34 -0500 Subject: [svn-r23753] HDFFV-8461: Add Windows /MT support This adds the UserMacros.cmake Windows /MT support file. Tested: local linux --- MANIFEST | 3 +++ config/cmake/UserMacros/Windows_MT.cmake | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 config/cmake/UserMacros/Windows_MT.cmake diff --git a/MANIFEST b/MANIFEST index 0f368e7..c4a2ac7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2396,6 +2396,9 @@ ./config/cmake/NSIS.template.in ./config/cmake/NSIS.InstallOptions.ini.in +# CMake-specific User Files +./config/cmake/UserMacros/Windows_MT.cmake + ./CMakeLists.txt ./CTestConfig.cmake ./UserMacros.cmake diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake new file mode 100644 index 0000000..3bd1607 --- /dev/null +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -0,0 +1,39 @@ +######################################################## +# Include file for user options +######################################################## + +# To use this option, copy both the macro and option code +# into the root UserMacros.cmake file. + +#----------------------------------------------------------------------------- +# Option to Build with Static CRT libraries on Windows +#------------------------------------------------------------------------------- +MACRO (TARGET_STATIC_CRT_FLAGS) + IF (MSVC AND NOT BUILD_SHARED_LIBS) + FOREACH (flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/MD") + STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/MD") + ENDFOREACH (flag_var) + FOREACH (flag_var + CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE + CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/libs:dll") + STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/libs:dll") + ENDFOREACH (flag_var) + SET (WIN_COMPILE_FLAGS "/MT") + SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + ENDIF (MSVC AND NOT BUILD_SHARED_LIBS) +ENDMACRO (TARGET_STATIC_CRT_FLAGS) + +#----------------------------------------------------------------------------- +OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) +IF (BUILD_STATIC_CRT_LIBS) + TARGET_STATIC_CRT_FLAGS () +ENDIF (BUILD_STATIC_CRT_LIBS) + \ No newline at end of file -- cgit v0.12 From 26ef64312a5239e27918206f6f26da3b4a6125cd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 11 Jun 2013 14:05:36 -0500 Subject: [svn-r23754] HDFFV-8451/8453: add options to enable more warning messages. Tested: local linux --- CMakeLists.txt | 56 ++++++++++++++++++++++++++++++++++++++ config/cmake/CTestCustom.cmake | 2 +- config/cmake/ConfigureChecks.cmake | 18 ++++++------ 3 files changed, 66 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e14fc21..f0b8019 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -456,6 +456,62 @@ IF (HDF5_DISABLE_COMPILER_WARNINGS) ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- +# Option to allow the user to enable all warnings +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) +IF (HDF5_ENABLE_ALL_WARNINGS) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2 -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") +ENDIF (HDF5_ENABLE_ALL_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group one warnings" OFF) +IF (HDF5_ENABLE_GROUPZERO_WARNINGS) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef") +ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) +IF (HDF5_ENABLE_GROUPONE_WARNINGS) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return") +ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) +IF (HDF5_ENABLE_GROUPTWO_WARNINGS) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2") +ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) +IF (HDF5_ENABLE_GROUPTHREE_WARNINGS) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") +ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) +IF (HDF5_ENABLE_GROUPFOUR_WARNINGS) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5") +ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) + +#----------------------------------------------------------------------------- +# Option to allow the user to enable warnings by groups +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) +IF (HDF5_ENABLE_GROUPFIVE_WARNINGS) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") +ENDIF (HDF5_ENABLE_GROUPFIVE_WARNINGS) + +#----------------------------------------------------------------------------- # This is in here to help some of the GCC based IDES like Eclipse # and code blocks parse the compiler errors and warnings better. #----------------------------------------------------------------------------- diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index d59fc3a..c16f9a6 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -1,4 +1,4 @@ -SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1500) +SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) SET (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index a2e0a03..cce71c7 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -183,14 +183,14 @@ IF (WINDOWS) ENDIF (MINGW) SET (H5_HAVE_LIBWS2_32 1) SET (H5_HAVE_LIBWSOCK32 1) -ENDIF (WINDOWS) -#----------------------------------------------------------------------------- -# These tests need to be manually SET for windows since there is currently -# something not quite correct with the actual test implementation. This affects -# the 'dt_arith' test and most likely lots of other code -# ---------------------------------------------------------------------------- -SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") + #----------------------------------------------------------------------------- + # These tests need to be manually SET for windows since there is currently + # something not quite correct with the actual test implementation. This affects + # the 'dt_arith' test and most likely lots of other code + # ---------------------------------------------------------------------------- + SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +ENDIF (WINDOWS) # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values @@ -1030,7 +1030,7 @@ H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "chec # yet. (1/8/05 - SLU) # IF (NOT MSVC) -H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") + H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") ENDIF (NOT MSVC) # ----------------------------------------------------------------------- # Set flag to indicate that the machine can handle conversion from @@ -1106,7 +1106,7 @@ ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) # the conversion, and Cygwin where compiler doesn't do rounding correctly.) # IF (NOT MSVC) -H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") + H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") ENDIF (NOT MSVC) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle overflow converting -- cgit v0.12 From c7e81f4894a9751c99ffdcfd7f093918ddfb1c44 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 12 Jun 2013 10:28:26 -0500 Subject: [svn-r23759] HDFFV-8451/8453: add options to enable more warning messages. MS VS compiler levels added to warning options. --- CMakeLists.txt | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0b8019..6ce8d01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -460,7 +460,14 @@ ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) IF (HDF5_ENABLE_ALL_WARNINGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2 -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2 -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + ENDIF (MSVC) ENDIF (HDF5_ENABLE_ALL_WARNINGS) #----------------------------------------------------------------------------- @@ -468,7 +475,14 @@ ENDIF (HDF5_ENABLE_ALL_WARNINGS) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group one warnings" OFF) IF (HDF5_ENABLE_GROUPZERO_WARNINGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef") + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef") + ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS) #----------------------------------------------------------------------------- @@ -476,7 +490,14 @@ ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) IF (HDF5_ENABLE_GROUPONE_WARNINGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return") + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return") + ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS) #----------------------------------------------------------------------------- @@ -484,7 +505,14 @@ ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) IF (HDF5_ENABLE_GROUPTWO_WARNINGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2") + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2") + ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS) #----------------------------------------------------------------------------- @@ -492,7 +520,14 @@ ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) IF (HDF5_ENABLE_GROUPTHREE_WARNINGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") + ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS) #----------------------------------------------------------------------------- @@ -500,7 +535,14 @@ ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) IF (HDF5_ENABLE_GROUPFOUR_WARNINGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5") + IF (MSVC) + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + ELSE (MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5") + ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) #----------------------------------------------------------------------------- @@ -508,7 +550,9 @@ ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) IF (HDF5_ENABLE_GROUPFIVE_WARNINGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + IF (NOT MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + ENDIF (NOT MSVC) ENDIF (HDF5_ENABLE_GROUPFIVE_WARNINGS) #----------------------------------------------------------------------------- -- cgit v0.12 From 93ec8e08211a31693b96616b996c55d59ce7e5c2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 12 Jun 2013 15:55:38 -0500 Subject: [svn-r23762] Change warning flag groups to match list of gcc 4.7 from the config/gnu-flags file. --- CMakeLists.txt | 106 ++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 83 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ce8d01..b342ea5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -456,6 +456,70 @@ IF (HDF5_DISABLE_COMPILER_WARNINGS) ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- +# CDash is configured to only allow 3000 warnings, so +# break into groups +#----------------------------------------------------------------------------- +IF (NOT MSVC) + # Append warning flags + # Don't use the '-Wtraditional' flag, we're way past having K&R C code + # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") + # Don't use the '-Wtraditional-conversion' flag, there's too many warnings + # from GCC's assert macro + # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion") + + # Append warning flags from gcc-3* case + # (don't use -Wpadded flag for normal builds, many of the warnings its + # issuing can't be fixed and they are making it hard to detect other, + # more important warnings) + #SET (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") + SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") + + # Append warning flags from gcc-3.2* case + SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") + + # Enable more format checking flags, beyond the basic -Wformat included + # in -Wall + SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") + + # The "unreachable code" warning appears to be reliable now... + # (this warning was removed in gcc 4.5+) + #SET (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code") + + # Append warning flags from gcc-3.3* case + SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") + + # Append warning flags from gcc-3.4* case + SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") + + # Append more extra warning flags that only gcc4.0+ know about + SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") + + # Append more extra warning flags that only gcc 4.1+ know about + SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") + + # Append more extra warning flags that only gcc 4.2+ know about + SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") + + # Append more extra warning flags that only gcc 4.3+ know about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") + + # Append more extra warning flags that only gcc 4.4+ know about + SET (H5_CFLAGS3 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + + # Append more extra warning flags that only gcc 4.5+ know about + H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + + # Append more extra warning flags that only gcc 4.6+ know about + SET (H5_CFLAGS4 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") + + # Append more extra warning flags that only gcc 4.7+ know about + SET (H5_CFLAGS4 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") +ENDIF (NOT MSVC) + +#----------------------------------------------------------------------------- # Option to allow the user to enable all warnings #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) @@ -466,22 +530,22 @@ IF (HDF5_ENABLE_ALL_WARNINGS) STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2 -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") ENDIF (MSVC) ENDIF (HDF5_ENABLE_ALL_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group one warnings" OFF) +OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) IF (HDF5_ENABLE_GROUPZERO_WARNINGS) IF (MSVC) STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS) @@ -492,11 +556,12 @@ OPTION (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) IF (HDF5_ENABLE_GROUPONE_WARNINGS) IF (MSVC) STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return") + #config/gnu-flags General setting + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS) @@ -507,11 +572,11 @@ OPTION (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) IF (HDF5_ENABLE_GROUPTWO_WARNINGS) IF (MSVC) STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS) @@ -522,11 +587,11 @@ OPTION (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) IF (HDF5_ENABLE_GROUPTHREE_WARNINGS) IF (MSVC) STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS) @@ -535,14 +600,9 @@ ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) IF (HDF5_ENABLE_GROUPFOUR_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5") - ENDIF (MSVC) + IF (NOT MSVC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") + ENDIF (NOT MSVC) ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) #----------------------------------------------------------------------------- @@ -551,7 +611,7 @@ ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) OPTION (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) IF (HDF5_ENABLE_GROUPFIVE_WARNINGS) IF (NOT MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") ENDIF (NOT MSVC) ENDIF (HDF5_ENABLE_GROUPFIVE_WARNINGS) -- cgit v0.12 From e35d1e08f310b82889f4db81de88d5553daff2c5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 13 Jun 2013 08:22:43 -0500 Subject: [svn-r23763] Fix missing command Tested: local linux --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b342ea5..31269fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -510,7 +510,7 @@ IF (NOT MSVC) SET (H5_CFLAGS3 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") # Append more extra warning flags that only gcc 4.6+ know about SET (H5_CFLAGS4 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") @@ -560,7 +560,6 @@ IF (HDF5_ENABLE_GROUPONE_WARNINGS) STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") ELSE (MSVC) - #config/gnu-flags General setting SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") ENDIF (MSVC) ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS) -- cgit v0.12 From bdbd06d85d6f1ea3b088ac3f180c23e1389aefaa Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 16 Jun 2013 03:34:51 -0500 Subject: [svn-r23778] Snapshot version 1.9 release 154 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index adef39f..f1b5b68 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.154 currently under development +HDF5 version 1.9.155 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 1c2d2de..b8fe11f 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 144 +LT_VERS_REVISION = 145 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 30d66a4..d995248 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 144 +LT_VERS_REVISION = 145 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 2b2aa7c..53525e1 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.154. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.155. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.154' -PACKAGE_STRING='HDF5 1.9.154' +PACKAGE_VERSION='1.9.155' +PACKAGE_STRING='HDF5 1.9.155' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1486,7 +1486,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.154 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.155 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1556,7 +1556,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.154:";; + short | recursive ) echo "Configuration of HDF5 1.9.155:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.154 +HDF5 configure 1.9.155 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.154, which was +It was created by HDF5 $as_me 1.9.155, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3678,7 +3678,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.154' + VERSION='1.9.155' cat >>confdefs.h <<_ACEOF @@ -31632,7 +31632,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.154 +HDF5 config.lt 1.9.155 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33762,7 +33762,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.154, which was +This file was extended by HDF5 $as_me 1.9.155, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33828,7 +33828,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.154 +HDF5 config.status 1.9.155 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 1756d12..4684e4f 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.154], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.155], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 706317c..2b371c3 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 144 +LT_VERS_REVISION = 145 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 752ea31..a14e20a 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 144 +LT_VERS_REVISION = 145 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 9f16c3c..950dec2 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 144 +LT_VERS_REVISION = 145 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 0b06294..fa39ea3 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 144 +LT_VERS_REVISION = 145 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4764cd6..32b45e0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.154 currently under development +HDF5 version 1.9.155 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index fc96ea7..a88a1ee 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 154 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 155 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.154" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.155" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 2de0dbf..3520248 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 144 +LT_VERS_REVISION = 145 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index b6662d1..426f3a0 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -511,7 +511,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.154" +#define H5_PACKAGE_STRING "HDF5 1.9.155" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -520,7 +520,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.154" +#define H5_PACKAGE_VERSION "1.9.155" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -683,7 +683,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.154" +#define H5_VERSION "1.9.155" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 6c3284f8b3db5a49eb19d52c957467dae202a144 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Jun 2013 09:13:30 -0500 Subject: [svn-r23784] Remove ignored FLAGS from MSVC variant of C compile/link. Incorrect copy from Fortran macro --- config/cmake/HDFMacros.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index 1a2d11b..b0788f2 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -147,14 +147,14 @@ MACRO (TARGET_MSVC_PROPERTIES wintarget addcompileflags addlinkflags) IF (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (${wintarget} PROPERTIES - COMPILE_FLAGS "/dll ${addcompileflags}" - LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + COMPILE_FLAGS "${addcompileflags}" + LINK_FLAGS "${addlinkflags}" ) ELSE (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" - LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + LINK_FLAGS "${addlinkflags}" ) ENDIF (BUILD_SHARED_LIBS) ENDIF (MSVC) -- cgit v0.12 From 47190b32e52e4c20f9243d0872f75e702f2479f4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Jun 2013 11:28:47 -0500 Subject: [svn-r23786] Remove COMPILE_FLAGS value - already set in X_FLAGS Tested: windows --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31269fc..687bcef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,7 +351,7 @@ ENDIF (WIN32) IF (MSVC) SET (CMAKE_MFC_FLAG 0) - SET (WIN_COMPILE_FLAGS "/MD") + SET (WIN_COMPILE_FLAGS "") SET (WIN_LINK_FLAGS "") ENDIF (MSVC) -- cgit v0.12 From 8f9fb4a106f383fa8e6b7fef40fbfae39592ebed Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Jun 2013 11:43:33 -0500 Subject: [svn-r23789] Remove COMPILE_FLAGS value - already set in X_FLAGS --- UserMacros.cmake | 39 ++++++++------------------------ config/cmake/UserMacros/Windows_MT.cmake | 2 +- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/UserMacros.cmake b/UserMacros.cmake index bf609e5..d7d3ef9 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -3,34 +3,15 @@ ######################################################## #----------------------------------------------------------------------------- -# Option to Build with Static CRT libraries on Windows -#------------------------------------------------------------------------------- -MACRO (TARGET_STATIC_CRT_FLAGS) - IF (MSVC AND NOT BUILD_SHARED_LIBS) - FOREACH (flag_var - CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - IF (${flag_var} MATCHES "/MD") - STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - ENDIF (${flag_var} MATCHES "/MD") - ENDFOREACH (flag_var) - FOREACH (flag_var - CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE - CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) - IF (${flag_var} MATCHES "/libs:dll") - STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") - ENDIF (${flag_var} MATCHES "/libs:dll") - ENDFOREACH (flag_var) - SET (WIN_COMPILE_FLAGS "/MT") - SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF (MSVC AND NOT BUILD_SHARED_LIBS) -ENDMACRO (TARGET_STATIC_CRT_FLAGS) - +# Option to Build with User Defined Values #----------------------------------------------------------------------------- -OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) -IF (BUILD_STATIC_CRT_LIBS) - TARGET_STATIC_CRT_FLAGS () -ENDIF (BUILD_STATIC_CRT_LIBS) +MACRO (MACRO_USER_DEFINED_LIBS) + SET (USER_DEFINED_VALUE "FALSE") +ENDMACRO (MACRO_USER_DEFINED_LIBS) + +#------------------------------------------------------------------------------- +OPTION (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) +IF (BUILD_USER_DEFINED_LIBS) + MACRO_USER_DEFINED_LIBS () +ENDIF (BUILD_USER_DEFINED_LIBS) \ No newline at end of file diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 3bd1607..9be5404 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -26,7 +26,7 @@ MACRO (TARGET_STATIC_CRT_FLAGS) STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") ENDIF (${flag_var} MATCHES "/libs:dll") ENDFOREACH (flag_var) - SET (WIN_COMPILE_FLAGS "/MT") + SET (WIN_COMPILE_FLAGS "") SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") ENDIF (MSVC AND NOT BUILD_SHARED_LIBS) ENDMACRO (TARGET_STATIC_CRT_FLAGS) -- cgit v0.12 From 8ae76fa4b829cb534f0db56fa6b285092b4f9c04 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 19 Jun 2013 12:48:44 -0500 Subject: [svn-r23793] Correct logic for packaging cygwin release docs --- CMakeLists.txt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 687bcef..cb57320 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1147,17 +1147,19 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt ${HDF5_SOURCE_DIR}/release_docs/INSTALL ) - IF (WIN32 AND NOT CYGWIN) - SET (release_files - ${release_files} - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt - ) - ELSE (WIN32 AND NOT CYGWIN) - SET (release_files - ${release_files} - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt - ) - ENDIF (WIN32 AND NOT CYGWIN) + IF (WIN32) + IF (NOT CYGWIN) + SET (release_files + ${release_files} + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt + ) + ELSE (NOT CYGWIN) + SET (release_files + ${release_files} + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt + ) + ENDIF (NOT CYGWIN) + ENDIF (WIN32) IF (HDF5_ENABLE_PARALLEL) SET (release_files ${release_files} -- cgit v0.12 From 60cce86d0ed1b75bed5fb601573ecdb6c45081a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Jun 2013 10:06:14 -0500 Subject: [svn-r23796] remove commented line with c++ style --- tools/lib/h5tools_str.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index e17ae89..5820b28 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -631,8 +631,6 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, for (i = 0; i < indentlevel; i++) { h5tools_str_append(str, "%s", OPT(info->line_indent, "")); } - -// ctx->need_prefix = 0; } /*------------------------------------------------------------------------- -- cgit v0.12 From 74384b3c19425ef74d100e9be0b1d737be4aa56b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Jun 2013 12:39:49 -0500 Subject: [svn-r23798] HDFFV-8465: dtd reference incorrect. Fixed loading of xml files with respect to XSD file. Tested: local linux --- tools/h5dump/h5dump.c | 4 ++-- tools/testfiles/tall-2A.h5.xml | 2 +- tools/testfiles/tall.h5.xml | 2 +- tools/testfiles/tarray1.h5.xml | 2 +- tools/testfiles/tarray2.h5.xml | 2 +- tools/testfiles/tarray3.h5.xml | 2 +- tools/testfiles/tarray6.h5.xml | 2 +- tools/testfiles/tarray7.h5.xml | 2 +- tools/testfiles/tattr.h5.xml | 2 +- tools/testfiles/tbitfields.h5.xml | 2 +- tools/testfiles/tcompound.h5.xml | 2 +- tools/testfiles/tcompound2.h5.xml | 2 +- tools/testfiles/tcompound_complex.h5.xml | 2 +- tools/testfiles/tdatareg.h5.xml | 2 +- tools/testfiles/tdset.h5.xml | 2 +- tools/testfiles/tdset2.h5.xml | 2 +- tools/testfiles/tempty-dtd-2.h5.xml | 2 +- tools/testfiles/tempty-dtd.h5.xml | 2 +- tools/testfiles/tempty-ns-2.h5.xml | 2 +- tools/testfiles/tempty-ns.h5.xml | 2 +- tools/testfiles/tempty.h5.xml | 2 +- tools/testfiles/tenum.h5.xml | 2 +- tools/testfiles/textlink.h5.xml | 2 +- tools/testfiles/tfpformat.h5.xml | 2 +- tools/testfiles/tgroup.h5.xml | 2 +- tools/testfiles/thlink.h5.xml | 2 +- tools/testfiles/tloop.h5.xml | 2 +- tools/testfiles/tloop2.h5.xml | 2 +- tools/testfiles/tmany.h5.xml | 2 +- tools/testfiles/tname-amp.h5.xml | 2 +- tools/testfiles/tname-apos.h5.xml | 2 +- tools/testfiles/tname-gt.h5.xml | 2 +- tools/testfiles/tname-lt.h5.xml | 2 +- tools/testfiles/tname-quot.h5.xml | 2 +- tools/testfiles/tname-sp.h5.xml | 2 +- tools/testfiles/tnamed_dtype_attr.h5.xml | 2 +- tools/testfiles/tnestedcomp.h5.xml | 2 +- tools/testfiles/tnodata.h5.xml | 2 +- tools/testfiles/tobjref.h5.xml | 2 +- tools/testfiles/topaque.h5.xml | 2 +- tools/testfiles/torderattr1.h5.xml | 2 +- tools/testfiles/torderattr2.h5.xml | 2 +- tools/testfiles/torderattr3.h5.xml | 2 +- tools/testfiles/torderattr4.h5.xml | 2 +- tools/testfiles/tref-escapes-at.h5.xml | 2 +- tools/testfiles/tref-escapes.h5.xml | 2 +- tools/testfiles/tref.h5.xml | 2 +- tools/testfiles/tsaf.h5.xml | 2 +- tools/testfiles/tslink.h5.xml | 2 +- tools/testfiles/tstr.h5.xml | 2 +- tools/testfiles/tstr2.h5.xml | 2 +- tools/testfiles/tstring-at.h5.xml | 2 +- tools/testfiles/tstring.h5.xml | 2 +- tools/testfiles/tudlink.h5.xml | 2 +- tools/testfiles/tvldtypes1.h5.xml | 2 +- tools/testfiles/tvldtypes2.h5.xml | 2 +- tools/testfiles/tvldtypes3.h5.xml | 2 +- tools/testfiles/tvldtypes4.h5.xml | 2 +- tools/testfiles/tvldtypes5.h5.xml | 2 +- tools/testfiles/tvlstr.h5.xml | 2 +- 60 files changed, 61 insertions(+), 61 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index d89202c..ef979b2 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -30,7 +30,7 @@ static const char *xml_dtd_uri = NULL; /* module-scoped variables for XML option */ #define DEFAULT_XSD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" -#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd" +#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd" /* Standard DDL output */ static const dump_functions ddl_function_table = { @@ -1649,7 +1649,7 @@ main(int argc, const char *argv[]) indx = HDstrrchr(ns,(int)':'); if (indx) *indx = '\0'; - PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" " + PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\" " "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File " "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns); diff --git a/tools/testfiles/tall-2A.h5.xml b/tools/testfiles/tall-2A.h5.xml index d118a69..c7d2fcf 100644 --- a/tools/testfiles/tall-2A.h5.xml +++ b/tools/testfiles/tall-2A.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tall.h5.xml b/tools/testfiles/tall.h5.xml index a74ccbe..ba130f1 100644 --- a/tools/testfiles/tall.h5.xml +++ b/tools/testfiles/tall.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tarray1.h5.xml b/tools/testfiles/tarray1.h5.xml index 86db36f..26d2d9b 100644 --- a/tools/testfiles/tarray1.h5.xml +++ b/tools/testfiles/tarray1.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tarray2.h5.xml b/tools/testfiles/tarray2.h5.xml index 7f89b9b..8f4f312 100644 --- a/tools/testfiles/tarray2.h5.xml +++ b/tools/testfiles/tarray2.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tarray3.h5.xml b/tools/testfiles/tarray3.h5.xml index 0b74db8..3879994 100644 --- a/tools/testfiles/tarray3.h5.xml +++ b/tools/testfiles/tarray3.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tarray6.h5.xml b/tools/testfiles/tarray6.h5.xml index 628a342..0fb50ed 100644 --- a/tools/testfiles/tarray6.h5.xml +++ b/tools/testfiles/tarray6.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tarray7.h5.xml b/tools/testfiles/tarray7.h5.xml index dbf5ec5..e6a5bca 100644 --- a/tools/testfiles/tarray7.h5.xml +++ b/tools/testfiles/tarray7.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tattr.h5.xml b/tools/testfiles/tattr.h5.xml index fceea99..ce54360 100644 --- a/tools/testfiles/tattr.h5.xml +++ b/tools/testfiles/tattr.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tbitfields.h5.xml b/tools/testfiles/tbitfields.h5.xml index 73365f0..c8ba026 100644 --- a/tools/testfiles/tbitfields.h5.xml +++ b/tools/testfiles/tbitfields.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tcompound.h5.xml b/tools/testfiles/tcompound.h5.xml index 10ef36e..5c74493 100644 --- a/tools/testfiles/tcompound.h5.xml +++ b/tools/testfiles/tcompound.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tcompound2.h5.xml b/tools/testfiles/tcompound2.h5.xml index ac139d9..5c69cef 100644 --- a/tools/testfiles/tcompound2.h5.xml +++ b/tools/testfiles/tcompound2.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tcompound_complex.h5.xml b/tools/testfiles/tcompound_complex.h5.xml index b35193a..92bd64d 100644 --- a/tools/testfiles/tcompound_complex.h5.xml +++ b/tools/testfiles/tcompound_complex.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tdatareg.h5.xml b/tools/testfiles/tdatareg.h5.xml index 327e213..ea65384 100644 --- a/tools/testfiles/tdatareg.h5.xml +++ b/tools/testfiles/tdatareg.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tdset.h5.xml b/tools/testfiles/tdset.h5.xml index e914bf6..80dcf6f 100644 --- a/tools/testfiles/tdset.h5.xml +++ b/tools/testfiles/tdset.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tdset2.h5.xml b/tools/testfiles/tdset2.h5.xml index 34f43e1..7f78685 100644 --- a/tools/testfiles/tdset2.h5.xml +++ b/tools/testfiles/tdset2.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tempty-dtd-2.h5.xml b/tools/testfiles/tempty-dtd-2.h5.xml index a9b1d4f..213d582 100644 --- a/tools/testfiles/tempty-dtd-2.h5.xml +++ b/tools/testfiles/tempty-dtd-2.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tempty-dtd.h5.xml b/tools/testfiles/tempty-dtd.h5.xml index a9b1d4f..213d582 100644 --- a/tools/testfiles/tempty-dtd.h5.xml +++ b/tools/testfiles/tempty-dtd.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tempty-ns-2.h5.xml b/tools/testfiles/tempty-ns-2.h5.xml index 3476b60..00040d2 100644 --- a/tools/testfiles/tempty-ns-2.h5.xml +++ b/tools/testfiles/tempty-ns-2.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tempty-ns.h5.xml b/tools/testfiles/tempty-ns.h5.xml index 3476b60..00040d2 100644 --- a/tools/testfiles/tempty-ns.h5.xml +++ b/tools/testfiles/tempty-ns.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tempty.h5.xml b/tools/testfiles/tempty.h5.xml index d75bc70..41eef37 100644 --- a/tools/testfiles/tempty.h5.xml +++ b/tools/testfiles/tempty.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tenum.h5.xml b/tools/testfiles/tenum.h5.xml index ecc7804..33a6e62 100644 --- a/tools/testfiles/tenum.h5.xml +++ b/tools/testfiles/tenum.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/textlink.h5.xml b/tools/testfiles/textlink.h5.xml index f6c7ff6..9097f79 100644 --- a/tools/testfiles/textlink.h5.xml +++ b/tools/testfiles/textlink.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tfpformat.h5.xml b/tools/testfiles/tfpformat.h5.xml index c2bd96f..6445979 100644 --- a/tools/testfiles/tfpformat.h5.xml +++ b/tools/testfiles/tfpformat.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tgroup.h5.xml b/tools/testfiles/tgroup.h5.xml index 8065165..1eaf662 100644 --- a/tools/testfiles/tgroup.h5.xml +++ b/tools/testfiles/tgroup.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/thlink.h5.xml b/tools/testfiles/thlink.h5.xml index 65d7f8a..d0fa36e 100644 --- a/tools/testfiles/thlink.h5.xml +++ b/tools/testfiles/thlink.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tloop.h5.xml b/tools/testfiles/tloop.h5.xml index 36e8f1b..8cc6880 100644 --- a/tools/testfiles/tloop.h5.xml +++ b/tools/testfiles/tloop.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tloop2.h5.xml b/tools/testfiles/tloop2.h5.xml index 185e08b..e2df102 100644 --- a/tools/testfiles/tloop2.h5.xml +++ b/tools/testfiles/tloop2.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tmany.h5.xml b/tools/testfiles/tmany.h5.xml index 8056783..842f1f5 100644 --- a/tools/testfiles/tmany.h5.xml +++ b/tools/testfiles/tmany.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tname-amp.h5.xml b/tools/testfiles/tname-amp.h5.xml index f28cdc5..e40c38b 100644 --- a/tools/testfiles/tname-amp.h5.xml +++ b/tools/testfiles/tname-amp.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tname-apos.h5.xml b/tools/testfiles/tname-apos.h5.xml index 2194971..2acd0bf 100644 --- a/tools/testfiles/tname-apos.h5.xml +++ b/tools/testfiles/tname-apos.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tname-gt.h5.xml b/tools/testfiles/tname-gt.h5.xml index 6a56587..b44949e 100644 --- a/tools/testfiles/tname-gt.h5.xml +++ b/tools/testfiles/tname-gt.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tname-lt.h5.xml b/tools/testfiles/tname-lt.h5.xml index a6d2480..b148275 100644 --- a/tools/testfiles/tname-lt.h5.xml +++ b/tools/testfiles/tname-lt.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tname-quot.h5.xml b/tools/testfiles/tname-quot.h5.xml index 96ad068..83fd347 100644 --- a/tools/testfiles/tname-quot.h5.xml +++ b/tools/testfiles/tname-quot.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tname-sp.h5.xml b/tools/testfiles/tname-sp.h5.xml index d6f8278..07b80e4 100644 --- a/tools/testfiles/tname-sp.h5.xml +++ b/tools/testfiles/tname-sp.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tnamed_dtype_attr.h5.xml b/tools/testfiles/tnamed_dtype_attr.h5.xml index 199211c..c0e30b4 100644 --- a/tools/testfiles/tnamed_dtype_attr.h5.xml +++ b/tools/testfiles/tnamed_dtype_attr.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tnestedcomp.h5.xml b/tools/testfiles/tnestedcomp.h5.xml index 2cae353..a5ca214 100644 --- a/tools/testfiles/tnestedcomp.h5.xml +++ b/tools/testfiles/tnestedcomp.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tnodata.h5.xml b/tools/testfiles/tnodata.h5.xml index 17b4ac9..b60c4dc 100644 --- a/tools/testfiles/tnodata.h5.xml +++ b/tools/testfiles/tnodata.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tobjref.h5.xml b/tools/testfiles/tobjref.h5.xml index 016b298..71eb6ed 100644 --- a/tools/testfiles/tobjref.h5.xml +++ b/tools/testfiles/tobjref.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/topaque.h5.xml b/tools/testfiles/topaque.h5.xml index 314fd23..25dbcdb 100644 --- a/tools/testfiles/topaque.h5.xml +++ b/tools/testfiles/topaque.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/torderattr1.h5.xml b/tools/testfiles/torderattr1.h5.xml index 027cd64..e3e56eb 100644 --- a/tools/testfiles/torderattr1.h5.xml +++ b/tools/testfiles/torderattr1.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/torderattr2.h5.xml b/tools/testfiles/torderattr2.h5.xml index fe441da..1163afb 100644 --- a/tools/testfiles/torderattr2.h5.xml +++ b/tools/testfiles/torderattr2.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/torderattr3.h5.xml b/tools/testfiles/torderattr3.h5.xml index 38bbef7..73ef223 100644 --- a/tools/testfiles/torderattr3.h5.xml +++ b/tools/testfiles/torderattr3.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/torderattr4.h5.xml b/tools/testfiles/torderattr4.h5.xml index 0f90b22..1cc78fd 100644 --- a/tools/testfiles/torderattr4.h5.xml +++ b/tools/testfiles/torderattr4.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tref-escapes-at.h5.xml b/tools/testfiles/tref-escapes-at.h5.xml index 8126484..40c6b89 100644 --- a/tools/testfiles/tref-escapes-at.h5.xml +++ b/tools/testfiles/tref-escapes-at.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tref-escapes.h5.xml b/tools/testfiles/tref-escapes.h5.xml index 6c6455b..4ebac85 100644 --- a/tools/testfiles/tref-escapes.h5.xml +++ b/tools/testfiles/tref-escapes.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tref.h5.xml b/tools/testfiles/tref.h5.xml index 7ff360e..4c3fb8f 100644 --- a/tools/testfiles/tref.h5.xml +++ b/tools/testfiles/tref.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tsaf.h5.xml b/tools/testfiles/tsaf.h5.xml index 8da41b9..d646791 100644 --- a/tools/testfiles/tsaf.h5.xml +++ b/tools/testfiles/tsaf.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tslink.h5.xml b/tools/testfiles/tslink.h5.xml index 9d8040e..493decd 100644 --- a/tools/testfiles/tslink.h5.xml +++ b/tools/testfiles/tslink.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tstr.h5.xml b/tools/testfiles/tstr.h5.xml index d7214fd..32d63af 100644 --- a/tools/testfiles/tstr.h5.xml +++ b/tools/testfiles/tstr.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tstr2.h5.xml b/tools/testfiles/tstr2.h5.xml index 26758b3..1203417 100644 --- a/tools/testfiles/tstr2.h5.xml +++ b/tools/testfiles/tstr2.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tstring-at.h5.xml b/tools/testfiles/tstring-at.h5.xml index 1962610..a8281f4 100644 --- a/tools/testfiles/tstring-at.h5.xml +++ b/tools/testfiles/tstring-at.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tstring.h5.xml b/tools/testfiles/tstring.h5.xml index ebd0a3c..d68db77 100644 --- a/tools/testfiles/tstring.h5.xml +++ b/tools/testfiles/tstring.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tudlink.h5.xml b/tools/testfiles/tudlink.h5.xml index 7e57dd8..137c47b 100644 --- a/tools/testfiles/tudlink.h5.xml +++ b/tools/testfiles/tudlink.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tvldtypes1.h5.xml b/tools/testfiles/tvldtypes1.h5.xml index 9c519f0..b1aa5a6 100644 --- a/tools/testfiles/tvldtypes1.h5.xml +++ b/tools/testfiles/tvldtypes1.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tvldtypes2.h5.xml b/tools/testfiles/tvldtypes2.h5.xml index 9cabfdf..662ad3a 100644 --- a/tools/testfiles/tvldtypes2.h5.xml +++ b/tools/testfiles/tvldtypes2.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tvldtypes3.h5.xml b/tools/testfiles/tvldtypes3.h5.xml index 811d536..56d81a1 100644 --- a/tools/testfiles/tvldtypes3.h5.xml +++ b/tools/testfiles/tvldtypes3.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tvldtypes4.h5.xml b/tools/testfiles/tvldtypes4.h5.xml index 1d368ce..8e31bd9 100644 --- a/tools/testfiles/tvldtypes4.h5.xml +++ b/tools/testfiles/tvldtypes4.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tvldtypes5.h5.xml b/tools/testfiles/tvldtypes5.h5.xml index d6ed774..be68e09 100644 --- a/tools/testfiles/tvldtypes5.h5.xml +++ b/tools/testfiles/tvldtypes5.h5.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/testfiles/tvlstr.h5.xml b/tools/testfiles/tvlstr.h5.xml index e5ec1f3..d945964 100644 --- a/tools/testfiles/tvlstr.h5.xml +++ b/tools/testfiles/tvlstr.h5.xml @@ -1,5 +1,5 @@ - + -- cgit v0.12 From e71411f9cf484800ce95847687229f2f280877b9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Jun 2013 13:10:07 -0500 Subject: [svn-r23799] HDFFV-8455: moved h5dump in order of subdirs under tools to in front of h5import. Tested local linux: h5dump executed before h5import --- tools/Makefile.am | 2 +- tools/Makefile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 4479c20..76b32d2 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -24,6 +24,6 @@ include $(top_srcdir)/config/commence.am CONFIG=ordered # All subdirectories -SUBDIRS=lib h5diff h5ls misc h5import h5repack h5jam h5copy h5stat h5dump +SUBDIRS=lib h5diff h5ls h5dump misc h5import h5repack h5jam h5copy h5stat include $(top_srcdir)/config/conclude.am diff --git a/tools/Makefile.in b/tools/Makefile.in index 46c7d53..4af6d74 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -425,7 +425,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog CONFIG = ordered # All subdirectories -SUBDIRS = lib h5diff h5ls misc h5import h5repack h5jam h5copy h5stat h5dump +SUBDIRS = lib h5diff h5ls h5dump misc h5import h5repack h5jam h5copy h5stat # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., -- cgit v0.12 From 125e2a0a9d8beb22ab06e3300624df24a1192214 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Jun 2013 17:02:17 -0500 Subject: [svn-r23800] Added the HD prefix to the system functions used in the h5tools_str_replace function. --- tools/lib/h5tools_str.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 5820b28..9bacd19 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1395,24 +1395,24 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac char *head = NULL; if ( substr == NULL || replacement == NULL ) - return strdup (string); + return HDstrdup (string); - newstr = strdup (string); + newstr = HDstrdup (string); head = newstr; - while ( (tok = strstr ( head, substr ))){ + while ( (tok = HDstrstr ( head, substr ))){ oldstr = newstr; - newstr = HDmalloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 ); + newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); if ( newstr == NULL ){ HDfree (oldstr); return NULL; } - memcpy ( newstr, oldstr, tok - oldstr ); - memcpy ( newstr + (tok - oldstr), replacement, strlen ( replacement ) ); - memcpy ( newstr + (tok - oldstr) + strlen( replacement ), tok + strlen ( substr ), strlen ( oldstr ) - strlen ( substr ) - ( tok - oldstr ) ); - memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 ); + HDmemcpy ( newstr, oldstr, tok - oldstr ); + HDmemcpy ( newstr + (tok - oldstr), replacement, HDstrlen ( replacement ) ); + HDmemcpy ( newstr + (tok - oldstr) + HDstrlen( replacement ), tok + HDstrlen ( substr ), HDstrlen ( oldstr ) - HDstrlen ( substr ) - ( tok - oldstr ) ); + HDmemset ( newstr + HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) , 0, 1 ); /* move back head right after the last replacement */ - head = newstr + (tok - oldstr) + strlen( replacement ); + head = newstr + (tok - oldstr) + HDstrlen( replacement ); HDfree (oldstr); } -- cgit v0.12 From 148fc618725c5b3e2749506490dae3ebeb7b4384 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 20 Jun 2013 17:21:42 -0500 Subject: [svn-r23801] Change printfs in perform output for long long to use %lld instead of %Hd. The later is for shorts. This fixes: https://jira.hdfgroup.uiuc.edu/browse/HDFFV-8450 Tested on Jam. --- perform/pio_engine.c | 32 ++++++++++++++++---------------- perform/pio_perf.c | 14 +++++++------- perform/sio_engine.c | 8 ++++---- perform/sio_perf.c | 10 +++++----- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/perform/pio_engine.c b/perform/pio_engine.c index 0e3190c..b64be52 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -245,24 +245,24 @@ do_pio(parameters param) /* Validate transfer buffer size & block size*/ if(blk_size<=0) { HDfprintf(stderr, - "Transfer block size (%Hd) must be > 0\n", (long long)blk_size); + "Transfer block size (%lld) must be > 0\n", (long long)blk_size); GOTOERROR(FAIL); } if(buf_size<=0) { HDfprintf(stderr, - "Transfer buffer size (%Hd) must be > 0\n", (long long)buf_size); + "Transfer buffer size (%lld) must be > 0\n", (long long)buf_size); GOTOERROR(FAIL); } if ((buf_size % blk_size) != 0){ HDfprintf(stderr, - "Transfer buffer size (%Hd) must be a multiple of the " - "interleaved I/O block size (%Hd)\n", + "Transfer buffer size (%lld) must be a multiple of the " + "interleaved I/O block size (%lld)\n", (long long)buf_size, (long long)blk_size); GOTOERROR(FAIL); } if((snbytes%pio_mpi_nprocs_g)!=0) { HDfprintf(stderr, - "Dataset size (%Hd) must be a multiple of the " + "Dataset size (%lld) must be a multiple of the " "number of processes (%d)\n", (long long)snbytes, pio_mpi_nprocs_g); GOTOERROR(FAIL); @@ -271,8 +271,8 @@ do_pio(parameters param) if (!param.dim2d){ if(((snbytes/pio_mpi_nprocs_g)%buf_size)!=0) { HDfprintf(stderr, - "Dataset size/process (%Hd) must be a multiple of the " - "trasfer buffer size (%Hd)\n", + "Dataset size/process (%lld) must be a multiple of the " + "trasfer buffer size (%lld)\n", (long long)(snbytes/pio_mpi_nprocs_g), (long long)buf_size); GOTOERROR(FAIL); } @@ -280,8 +280,8 @@ do_pio(parameters param) else { if((snbytes%buf_size)!=0) { HDfprintf(stderr, - "Dataset side size (%Hd) must be a multiple of the " - "trasfer buffer size (%Hd)\n", + "Dataset side size (%lld) must be a multiple of the " + "trasfer buffer size (%lld)\n", (long long)snbytes, (long long)buf_size); GOTOERROR(FAIL); } @@ -289,7 +289,7 @@ do_pio(parameters param) /* Allocate transfer buffer */ if ((buffer = malloc(bsize)) == NULL){ - HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", + HDfprintf(stderr, "malloc for transfer buffer size (%lld) failed\n", (long long)(bsize)); GOTOERROR(FAIL); } @@ -651,12 +651,12 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, HDprint_rank(output); if (!parms->dim2d) { HDfprintf(output, "Debug(do_write): " - "buf_size=%Hd, bytes_begin=%Hd, bytes_count=%Hd\n", + "buf_size=%lld, bytes_begin=%lld, bytes_count=%lld\n", (long long)buf_size, (long long)bytes_begin[0], (long long)bytes_count); } else { HDfprintf(output, "Debug(do_write): " - "linear buf_size=%Hd, bytes_begin=(%Hd,%Hd), bytes_count=%Hd\n", + "linear buf_size=%lld, bytes_begin=(%lld,%lld), bytes_count=%lld\n", (long long)buf_size*blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], (long long)bytes_count); } @@ -1625,12 +1625,12 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, HDprint_rank(output); if (!parms->dim2d) { HDfprintf(output, "Debug(do_write): " - "buf_size=%Hd, bytes_begin=%Hd, bytes_count=%Hd\n", + "buf_size=%lld, bytes_begin=%lld, bytes_count=%lld\n", (long long)buf_size, (long long)bytes_begin[0], (long long)bytes_count); } else { HDfprintf(output, "Debug(do_write): " - "linear buf_size=%Hd, bytes_begin=(%Hd,%Hd), bytes_count=%Hd\n", + "linear buf_size=%lld, bytes_begin=(%lld,%lld), bytes_count=%lld\n", (long long)buf_size*blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], (long long)bytes_count); } @@ -2336,8 +2336,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, if (++nerror < 20){ /* report at most 20 errors */ HDprint_rank(output); - HDfprintf(output, "read data error, expected (%Hd), " - "got (%Hd)\n", + HDfprintf(output, "read data error, expected (%lld), " + "got (%lld)\n", (long long)pio_mpi_rank_g+1, (long long)*(ucharptr-1)); } /* end if */ diff --git a/perform/pio_perf.c b/perform/pio_perf.c index 337e982..5168bdd 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -1116,14 +1116,14 @@ recover_size_and_print(long long val, const char *end) if (val >= ONE_KB && (val % ONE_KB) == 0) { if (val >= ONE_MB && (val % ONE_MB) == 0) { if (val >= ONE_GB && (val % ONE_GB) == 0) - HDfprintf(output, "%HdGB%s", val / ONE_GB, end); + HDfprintf(output, "%lldGB%s", val / ONE_GB, end); else - HDfprintf(output, "%HdMB%s", val / ONE_MB, end); + HDfprintf(output, "%lldMB%s", val / ONE_MB, end); } else { - HDfprintf(output, "%HdKB%s", val / ONE_KB, end); + HDfprintf(output, "%lldKB%s", val / ONE_KB, end); } } else { - HDfprintf(output, "%Hd%s", val, end); + HDfprintf(output, "%lld%s", val, end); } } @@ -1150,11 +1150,11 @@ report_parameters(struct options *opts) HDfprintf(output, "rank %d: IO API=", rank); print_io_api(opts->io_types); - HDfprintf(output, "rank %d: Number of files=%Hd\n", rank, + HDfprintf(output, "rank %d: Number of files=%lld\n", rank, (long long)opts->num_files); - HDfprintf(output, "rank %d: Number of datasets=%Hd\n", rank, + HDfprintf(output, "rank %d: Number of datasets=%lld\n", rank, (long long)opts->num_dsets); - HDfprintf(output, "rank %d: Number of iterations=%Hd\n", rank, + HDfprintf(output, "rank %d: Number of iterations=%lld\n", rank, (long long)opts->num_iters); HDfprintf(output, "rank %d: Number of processes=%d:%d\n", rank, opts->min_num_procs, opts->max_num_procs); diff --git a/perform/sio_engine.c b/perform/sio_engine.c index df2e21e..5919c87 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -196,14 +196,14 @@ do_sio(parameters param) /* Validate transfer buffer size */ if (param.buf_size[i]<=0) { HDfprintf(stderr, - "Transfer buffer size[%d] (%Hd) must be > 0\n", i,(long long)buf_size[i]); + "Transfer buffer size[%d] (%lld) must be > 0\n", i,(long long)buf_size[i]); GOTOERROR(FAIL); } if ((param.dset_size[i]%param.buf_size[i])!=0) { HDfprintf(stderr, - "Dataset size[%d] (%Hd) must be a multiple of the " - "trasfer buffer size[%d] (%Hd)\n",param.rank, + "Dataset size[%d] (%lld) must be a multiple of the " + "trasfer buffer size[%d] (%lld)\n",param.rank, (long long)param.dset_size[i], param.rank, (long long)param.buf_size[i]); GOTOERROR(FAIL); } @@ -212,7 +212,7 @@ do_sio(parameters param) /* Allocate transfer buffer */ if ((buffer = malloc(linear_buf_size)) == NULL){ - HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", (long long)(linear_buf_size)); + HDfprintf(stderr, "malloc for transfer buffer size (%lld) failed\n", (long long)(linear_buf_size)); GOTOERROR(FAIL); } diff --git a/perform/sio_perf.c b/perform/sio_perf.c index 16e1750..a7de8eb 100644 --- a/perform/sio_perf.c +++ b/perform/sio_perf.c @@ -827,14 +827,14 @@ recover_size_and_print(long long val, const char *end) if (val >= ONE_KB && (val % ONE_KB) == 0) { if (val >= ONE_MB && (val % ONE_MB) == 0) { if (val >= ONE_GB && (val % ONE_GB) == 0) - HDfprintf(output, "%HdGB%s", val / ONE_GB, end); + HDfprintf(output, "%lldGB%s", val / ONE_GB, end); else - HDfprintf(output, "%HdMB%s", val / ONE_MB, end); + HDfprintf(output, "%lldMB%s", val / ONE_MB, end); } else { - HDfprintf(output, "%HdKB%s", val / ONE_KB, end); + HDfprintf(output, "%lldKB%s", val / ONE_KB, end); } } else { - HDfprintf(output, "%Hd%s", val, end); + HDfprintf(output, "%lld%s", val, end); } } @@ -860,7 +860,7 @@ report_parameters(struct options *opts) HDfprintf(output, "IO API="); print_io_api(opts->io_types); - HDfprintf(output, "Number of iterations=%Hd\n", + HDfprintf(output, "Number of iterations=%lld\n", (long long)opts->num_iters); HDfprintf(output, "Dataset size="); -- cgit v0.12 From 6fedfb6124e2c2ec3c93b3738dd1080c180f015e Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 23 Jun 2013 03:36:24 -0500 Subject: [svn-r23806] Snapshot version 1.9 release 155 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index f1b5b68..c417d3b 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.155 currently under development +HDF5 version 1.9.156 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index b8fe11f..cb01519 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 145 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index d995248..c3ec683 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 145 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 53525e1..0eda393 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.155. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.156. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.155' -PACKAGE_STRING='HDF5 1.9.155' +PACKAGE_VERSION='1.9.156' +PACKAGE_STRING='HDF5 1.9.156' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1486,7 +1486,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.155 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.156 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1556,7 +1556,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.155:";; + short | recursive ) echo "Configuration of HDF5 1.9.156:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.155 +HDF5 configure 1.9.156 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.155, which was +It was created by HDF5 $as_me 1.9.156, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3678,7 +3678,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.155' + VERSION='1.9.156' cat >>confdefs.h <<_ACEOF @@ -31632,7 +31632,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.155 +HDF5 config.lt 1.9.156 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33762,7 +33762,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.155, which was +This file was extended by HDF5 $as_me 1.9.156, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33828,7 +33828,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.155 +HDF5 config.status 1.9.156 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 4684e4f..0a4d854 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.155], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.156], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 2b371c3..8b6036b 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 145 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index a14e20a..6639a92 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 145 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 950dec2..caed99d 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 145 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index fa39ea3..3f82131 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 145 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 32b45e0..ed3ec6b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.155 currently under development +HDF5 version 1.9.156 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index a88a1ee..ad13851 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 155 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 156 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.155" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.156" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 3520248..ae0d0ff 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 145 +LT_VERS_REVISION = 146 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 426f3a0..7085a06 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -511,7 +511,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.155" +#define H5_PACKAGE_STRING "HDF5 1.9.156" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -520,7 +520,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.155" +#define H5_PACKAGE_VERSION "1.9.156" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -683,7 +683,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.155" +#define H5_VERSION "1.9.156" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 1e38ef67189e27d308b11e3fa35a73f8fdfaf043 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 24 Jun 2013 13:16:58 -0500 Subject: [svn-r23810] revert printf format changes to do a better solution. --- perform/pio_engine.c | 32 ++++++++++++++++---------------- perform/pio_perf.c | 14 +++++++------- perform/sio_engine.c | 8 ++++---- perform/sio_perf.c | 10 +++++----- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/perform/pio_engine.c b/perform/pio_engine.c index b64be52..0e3190c 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -245,24 +245,24 @@ do_pio(parameters param) /* Validate transfer buffer size & block size*/ if(blk_size<=0) { HDfprintf(stderr, - "Transfer block size (%lld) must be > 0\n", (long long)blk_size); + "Transfer block size (%Hd) must be > 0\n", (long long)blk_size); GOTOERROR(FAIL); } if(buf_size<=0) { HDfprintf(stderr, - "Transfer buffer size (%lld) must be > 0\n", (long long)buf_size); + "Transfer buffer size (%Hd) must be > 0\n", (long long)buf_size); GOTOERROR(FAIL); } if ((buf_size % blk_size) != 0){ HDfprintf(stderr, - "Transfer buffer size (%lld) must be a multiple of the " - "interleaved I/O block size (%lld)\n", + "Transfer buffer size (%Hd) must be a multiple of the " + "interleaved I/O block size (%Hd)\n", (long long)buf_size, (long long)blk_size); GOTOERROR(FAIL); } if((snbytes%pio_mpi_nprocs_g)!=0) { HDfprintf(stderr, - "Dataset size (%lld) must be a multiple of the " + "Dataset size (%Hd) must be a multiple of the " "number of processes (%d)\n", (long long)snbytes, pio_mpi_nprocs_g); GOTOERROR(FAIL); @@ -271,8 +271,8 @@ do_pio(parameters param) if (!param.dim2d){ if(((snbytes/pio_mpi_nprocs_g)%buf_size)!=0) { HDfprintf(stderr, - "Dataset size/process (%lld) must be a multiple of the " - "trasfer buffer size (%lld)\n", + "Dataset size/process (%Hd) must be a multiple of the " + "trasfer buffer size (%Hd)\n", (long long)(snbytes/pio_mpi_nprocs_g), (long long)buf_size); GOTOERROR(FAIL); } @@ -280,8 +280,8 @@ do_pio(parameters param) else { if((snbytes%buf_size)!=0) { HDfprintf(stderr, - "Dataset side size (%lld) must be a multiple of the " - "trasfer buffer size (%lld)\n", + "Dataset side size (%Hd) must be a multiple of the " + "trasfer buffer size (%Hd)\n", (long long)snbytes, (long long)buf_size); GOTOERROR(FAIL); } @@ -289,7 +289,7 @@ do_pio(parameters param) /* Allocate transfer buffer */ if ((buffer = malloc(bsize)) == NULL){ - HDfprintf(stderr, "malloc for transfer buffer size (%lld) failed\n", + HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", (long long)(bsize)); GOTOERROR(FAIL); } @@ -651,12 +651,12 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, HDprint_rank(output); if (!parms->dim2d) { HDfprintf(output, "Debug(do_write): " - "buf_size=%lld, bytes_begin=%lld, bytes_count=%lld\n", + "buf_size=%Hd, bytes_begin=%Hd, bytes_count=%Hd\n", (long long)buf_size, (long long)bytes_begin[0], (long long)bytes_count); } else { HDfprintf(output, "Debug(do_write): " - "linear buf_size=%lld, bytes_begin=(%lld,%lld), bytes_count=%lld\n", + "linear buf_size=%Hd, bytes_begin=(%Hd,%Hd), bytes_count=%Hd\n", (long long)buf_size*blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], (long long)bytes_count); } @@ -1625,12 +1625,12 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, HDprint_rank(output); if (!parms->dim2d) { HDfprintf(output, "Debug(do_write): " - "buf_size=%lld, bytes_begin=%lld, bytes_count=%lld\n", + "buf_size=%Hd, bytes_begin=%Hd, bytes_count=%Hd\n", (long long)buf_size, (long long)bytes_begin[0], (long long)bytes_count); } else { HDfprintf(output, "Debug(do_write): " - "linear buf_size=%lld, bytes_begin=(%lld,%lld), bytes_count=%lld\n", + "linear buf_size=%Hd, bytes_begin=(%Hd,%Hd), bytes_count=%Hd\n", (long long)buf_size*blk_size, (long long)bytes_begin[0], (long long)bytes_begin[1], (long long)bytes_count); } @@ -2336,8 +2336,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, if (++nerror < 20){ /* report at most 20 errors */ HDprint_rank(output); - HDfprintf(output, "read data error, expected (%lld), " - "got (%lld)\n", + HDfprintf(output, "read data error, expected (%Hd), " + "got (%Hd)\n", (long long)pio_mpi_rank_g+1, (long long)*(ucharptr-1)); } /* end if */ diff --git a/perform/pio_perf.c b/perform/pio_perf.c index 5168bdd..337e982 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -1116,14 +1116,14 @@ recover_size_and_print(long long val, const char *end) if (val >= ONE_KB && (val % ONE_KB) == 0) { if (val >= ONE_MB && (val % ONE_MB) == 0) { if (val >= ONE_GB && (val % ONE_GB) == 0) - HDfprintf(output, "%lldGB%s", val / ONE_GB, end); + HDfprintf(output, "%HdGB%s", val / ONE_GB, end); else - HDfprintf(output, "%lldMB%s", val / ONE_MB, end); + HDfprintf(output, "%HdMB%s", val / ONE_MB, end); } else { - HDfprintf(output, "%lldKB%s", val / ONE_KB, end); + HDfprintf(output, "%HdKB%s", val / ONE_KB, end); } } else { - HDfprintf(output, "%lld%s", val, end); + HDfprintf(output, "%Hd%s", val, end); } } @@ -1150,11 +1150,11 @@ report_parameters(struct options *opts) HDfprintf(output, "rank %d: IO API=", rank); print_io_api(opts->io_types); - HDfprintf(output, "rank %d: Number of files=%lld\n", rank, + HDfprintf(output, "rank %d: Number of files=%Hd\n", rank, (long long)opts->num_files); - HDfprintf(output, "rank %d: Number of datasets=%lld\n", rank, + HDfprintf(output, "rank %d: Number of datasets=%Hd\n", rank, (long long)opts->num_dsets); - HDfprintf(output, "rank %d: Number of iterations=%lld\n", rank, + HDfprintf(output, "rank %d: Number of iterations=%Hd\n", rank, (long long)opts->num_iters); HDfprintf(output, "rank %d: Number of processes=%d:%d\n", rank, opts->min_num_procs, opts->max_num_procs); diff --git a/perform/sio_engine.c b/perform/sio_engine.c index 5919c87..df2e21e 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -196,14 +196,14 @@ do_sio(parameters param) /* Validate transfer buffer size */ if (param.buf_size[i]<=0) { HDfprintf(stderr, - "Transfer buffer size[%d] (%lld) must be > 0\n", i,(long long)buf_size[i]); + "Transfer buffer size[%d] (%Hd) must be > 0\n", i,(long long)buf_size[i]); GOTOERROR(FAIL); } if ((param.dset_size[i]%param.buf_size[i])!=0) { HDfprintf(stderr, - "Dataset size[%d] (%lld) must be a multiple of the " - "trasfer buffer size[%d] (%lld)\n",param.rank, + "Dataset size[%d] (%Hd) must be a multiple of the " + "trasfer buffer size[%d] (%Hd)\n",param.rank, (long long)param.dset_size[i], param.rank, (long long)param.buf_size[i]); GOTOERROR(FAIL); } @@ -212,7 +212,7 @@ do_sio(parameters param) /* Allocate transfer buffer */ if ((buffer = malloc(linear_buf_size)) == NULL){ - HDfprintf(stderr, "malloc for transfer buffer size (%lld) failed\n", (long long)(linear_buf_size)); + HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", (long long)(linear_buf_size)); GOTOERROR(FAIL); } diff --git a/perform/sio_perf.c b/perform/sio_perf.c index a7de8eb..16e1750 100644 --- a/perform/sio_perf.c +++ b/perform/sio_perf.c @@ -827,14 +827,14 @@ recover_size_and_print(long long val, const char *end) if (val >= ONE_KB && (val % ONE_KB) == 0) { if (val >= ONE_MB && (val % ONE_MB) == 0) { if (val >= ONE_GB && (val % ONE_GB) == 0) - HDfprintf(output, "%lldGB%s", val / ONE_GB, end); + HDfprintf(output, "%HdGB%s", val / ONE_GB, end); else - HDfprintf(output, "%lldMB%s", val / ONE_MB, end); + HDfprintf(output, "%HdMB%s", val / ONE_MB, end); } else { - HDfprintf(output, "%lldKB%s", val / ONE_KB, end); + HDfprintf(output, "%HdKB%s", val / ONE_KB, end); } } else { - HDfprintf(output, "%lld%s", val, end); + HDfprintf(output, "%Hd%s", val, end); } } @@ -860,7 +860,7 @@ report_parameters(struct options *opts) HDfprintf(output, "IO API="); print_io_api(opts->io_types); - HDfprintf(output, "Number of iterations=%lld\n", + HDfprintf(output, "Number of iterations=%Hd\n", (long long)opts->num_iters); HDfprintf(output, "Dataset size="); -- cgit v0.12 From 66490d45e162ca2994d3d69d0140b6552e8b934a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Jun 2013 15:01:24 -0500 Subject: [svn-r23811] Remove unused label --- tools/h5diff/h5diff_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 607d58e..a916ec5 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -101,7 +101,6 @@ int main(int argc, const char *argv[]) print_info(&options); -out: /*------------------------------------------------------------------------- * exit code * 1 if differences, 0 if no differences, 2 if error -- cgit v0.12 From a8c227e175f362c0dfeed6a7c648a6635afab964 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Jun 2013 15:02:42 -0500 Subject: [svn-r23812] Added the HD prefix to the system functions used in the links.c file. Tested: local linux --- test/links.c | 116 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/test/links.c b/test/links.c index d77b371..bcffb3e 100644 --- a/test/links.c +++ b/test/links.c @@ -558,8 +558,8 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ if(H5Lexists(file, "d1", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -574,14 +574,14 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { H5_FAILED(); - puts(" Soft link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Soft link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ if(H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(HDstrcmp(linkval, "/d1")) { H5_FAILED(); - puts(" Soft link test failed. Wrong link value"); + HDputs(" Soft link test failed. Wrong link value"); TEST_ERROR } /* end if */ if(H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -592,7 +592,7 @@ cklinks(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(status >= 0) { H5_FAILED(); - puts(" H5Oget_info_by_name() should have failed for a dangling link."); + HDputs(" H5Oget_info_by_name() should have failed for a dangling link."); TEST_ERROR } /* end if */ if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -608,7 +608,7 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(HDstrcmp(linkval, "foobar")) { H5_FAILED(); - puts(" Dangling link test failed. Wrong link value"); + HDputs(" Dangling link test failed. Wrong link value"); TEST_ERROR } /* end if */ if(H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR @@ -619,7 +619,7 @@ cklinks(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(status >= 0) { H5_FAILED(); - puts(" H5Oget_info_by_name() should have failed for a recursive link."); + HDputs(" H5Oget_info_by_name() should have failed for a recursive link."); TEST_ERROR } /* end if */ if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -635,7 +635,7 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if(HDstrcmp(linkval, "/grp1/recursive")) { H5_FAILED(); - puts(" Recursive link test failed. Wrong link value"); + HDputs(" Recursive link test failed. Wrong link value"); TEST_ERROR } /* end if */ @@ -700,8 +700,8 @@ ck_new_links(hid_t fapl, hbool_t new_format) } if(H5F_addr_ne(oi_dset.addr, oi_hard1.addr) || H5F_addr_ne(oi_dset.addr, oi_hard2.addr)) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } @@ -905,7 +905,7 @@ toomany(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); TEST_ERROR } /* end if */ @@ -1189,7 +1189,7 @@ test_move(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(moved_grp >= 0) { H5_FAILED(); - puts(" Group still in original location?"); + HDputs(" Group still in original location?"); TEST_ERROR } /* end if */ @@ -1684,8 +1684,8 @@ test_deprec(hid_t fapl, hbool_t new_format) if(HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ @@ -1695,8 +1695,8 @@ test_deprec(hid_t fapl, hbool_t new_format) if(HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { H5_FAILED(); - puts(" Hard link test failed. Link seems not to point to the "); - puts(" expected file location."); + HDputs(" Hard link test failed. Link seems not to point to the "); + HDputs(" expected file location."); TEST_ERROR } /* end if */ @@ -1812,19 +1812,19 @@ external_link_root(hid_t fapl, hbool_t new_format) if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error; if(H5L_TYPE_EXTERNAL != linfo.type) { H5_FAILED(); - puts(" Unexpected object type - should have been an external link"); + HDputs(" Unexpected object type - should have been an external link"); goto error; } if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR if(HDstrcmp(file, filename1)) { H5_FAILED(); - puts(" External link file name incorrect"); + HDputs(" External link file name incorrect"); goto error; } if(HDstrcmp(path, "/")) { H5_FAILED(); - puts(" External link path incorrect"); + HDputs(" External link path incorrect"); goto error; } @@ -1836,19 +1836,19 @@ external_link_root(hid_t fapl, hbool_t new_format) if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error; if(H5L_TYPE_EXTERNAL != linfo.type) { H5_FAILED(); - puts(" Unexpected object type - should have been an external link"); + HDputs(" Unexpected object type - should have been an external link"); goto error; } if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR if(HDstrcmp(file, filename1)) { H5_FAILED(); - puts(" External link file name incorrect"); + HDputs(" External link file name incorrect"); goto error; } if(HDstrcmp(path, "/")) { H5_FAILED(); - puts(" External link path incorrect"); + HDputs(" External link path incorrect"); goto error; } @@ -2693,7 +2693,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); goto error; } @@ -2703,7 +2703,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); goto error; } @@ -2713,7 +2713,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (status >= 0) { H5_FAILED(); - puts(" Retreiving name of object by index through dangling file external link should have failed."); + HDputs(" Retreiving name of object by index through dangling file external link should have failed."); } /* end if */ /* Close root group */ @@ -2810,7 +2810,7 @@ external_link_prefix(hid_t fapl, hbool_t new_format) /* should be able to find the target file from pathnames set via H5Pset_elink_prefix() */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -2905,7 +2905,7 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) /* should be able to find the target file from absolute path set for main file */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -2991,7 +2991,7 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format) /* should be able to find the target file from the main file's relative pathname */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in current working directory"); + HDputs(" Should have found the file in current working directory"); goto error; } @@ -3083,7 +3083,7 @@ external_link_cwd(hid_t fapl, hbool_t new_format) /* should be able to find the target file from the current working directory */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in current working directory"); + HDputs(" Should have found the file in current working directory"); goto error; } @@ -3179,7 +3179,7 @@ external_link_abstar(hid_t fapl, hbool_t new_format) /* should be able to find the target file with abolute path */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -3273,7 +3273,7 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format) /* should be able to find the target file from main file's current working directory */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in current working directory."); + HDputs(" Should have found the file in current working directory."); goto error; } @@ -3353,7 +3353,7 @@ external_link_reltar(hid_t fapl, hbool_t new_format) /* Open object through external link */ if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } /* end if */ @@ -3450,7 +3450,7 @@ external_link_chdir(hid_t fapl, hbool_t new_format) */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp directory."); + HDputs(" Should have found the file in tmp directory."); goto error; } @@ -3625,7 +3625,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) /* should succeed in opening the target object A in the current working directory */ if (oidA < 0) { H5_FAILED(); - puts(" Should succeed in opening family target file A in current working directory"); + HDputs(" Should succeed in opening family target file A in current working directory"); goto error; } @@ -3639,7 +3639,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) /* should succeed in opening the target object B in the current working directory */ if (oidB < 0) { H5_FAILED(); - puts(" Should succeed in opening multi target file B in current working directory"); + HDputs(" Should succeed in opening multi target file B in current working directory"); goto error; } @@ -3785,7 +3785,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) did = H5Dopen2(fid, "ext_link", dapl_id); if(did < 0) { H5_FAILED(); - puts(" Should succeed in opening the target dataset"); + HDputs(" Should succeed in opening the target dataset"); goto error; } @@ -4371,7 +4371,7 @@ external_link_win1(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's CWD*/ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in CWD."); + HDputs(" Should have found the file in CWD."); goto error; } @@ -4465,7 +4465,7 @@ external_link_win2(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -4558,7 +4558,7 @@ external_link_win3(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -4647,7 +4647,7 @@ external_link_win4(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's absolute drive/relative path */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in CWD."); + HDputs(" Should have found the file in CWD."); goto error; } @@ -4743,7 +4743,7 @@ external_link_win5(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's rel drive/abs path */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in CWD."); + HDputs(" Should have found the file in CWD."); goto error; } @@ -4836,7 +4836,7 @@ external_link_win6(hid_t fapl, hbool_t new_format) /* should be able to find the target file via target file's rel path in current drive */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -4923,7 +4923,7 @@ external_link_win7(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's local host/main drive*/ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in local host/main drive."); + HDputs(" Should have found the file in local host/main drive."); goto error; } @@ -5015,7 +5015,7 @@ external_link_win8(hid_t fapl, hbool_t new_format) /* should be able to find the target file directly */ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp."); + HDputs(" Should have found the file in tmp."); goto error; } @@ -5102,7 +5102,7 @@ external_link_win9(hid_t fapl, hbool_t new_format) /* should be able to find the target file via main file's local host/main drive*/ if(gid < 0) { H5_FAILED(); - puts(" Should have found the file in local host/main drive."); + HDputs(" Should have found the file in local host/main drive."); goto error; } @@ -5173,7 +5173,7 @@ external_link_recursive(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for recursive external links."); + HDputs(" Should have failed for recursive external links."); goto error; } @@ -5243,7 +5243,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR if (H5L_TYPE_EXTERNAL != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been an external link"); + HDputs(" Unexpected link class - should have been an external link"); goto error; } @@ -5269,7 +5269,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR if(H5L_TYPE_EXTERNAL != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been an external link"); + HDputs(" Unexpected link class - should have been an external link"); goto error; } @@ -5287,7 +5287,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(H5Oget_info_by_name(fid, "src", &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5O_TYPE_GROUP != oi.type) { H5_FAILED(); - puts(" Unexpected object type - should have been a group"); + HDputs(" Unexpected object type - should have been a group"); goto error; } @@ -6511,7 +6511,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) } /* end if */ else { SKIPPED(); - puts(" Current VFD doesn't support POSIX I/O calls"); + HDputs(" Current VFD doesn't support POSIX I/O calls"); } /* end else */ return 0; @@ -6531,7 +6531,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) return -1; #else /* H5_HAVE_SYMLINK */ SKIPPED(); - puts(" Current file system or operating system doesn't support symbolic links"); + HDputs(" Current file system or operating system doesn't support symbolic links"); return 0; #endif /* H5_HAVE_SYMLINK */ @@ -7570,7 +7570,7 @@ ud_hard_links(hid_t fapl) if(li.u.val_size != 0) TEST_ERROR if(UD_HARD_TYPE != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been a UD hard link"); + HDputs(" Unexpected link class - should have been a UD hard link"); goto error; } /* end if */ @@ -7984,7 +7984,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) if(li.u.val_size != 16) TEST_ERROR if (UD_CB_TYPE != li.type) { H5_FAILED(); - puts(" Unexpected link class - should have been a UD hard link"); + HDputs(" Unexpected link class - should have been a UD hard link"); goto error; } @@ -8632,7 +8632,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if (gid >= 0) { H5_FAILED(); - puts(" Should have failed for sequence of too many nested links."); + HDputs(" Should have failed for sequence of too many nested links."); goto error; } @@ -10147,7 +10147,7 @@ corder_create_empty(hid_t fapl) } H5E_END_TRY; if(ret > 0) { H5_FAILED(); - puts(" H5Pset_link_create_order() should have failed for a creation order index with no tracking."); + HDputs(" H5Pset_link_create_order() should have failed for a creation order index with no tracking."); TEST_ERROR } /* end if */ @@ -14703,7 +14703,7 @@ main(void) if(nerrors) { printf("***** %d LINK TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - exit(1); + HDexit(1); } printf("All link tests passed.\n"); @@ -14718,7 +14718,7 @@ main(void) return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); return 1; } -- cgit v0.12 From e3a1fa7e57891979723021128108288c89012cd1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Jun 2013 15:03:54 -0500 Subject: [svn-r23813] Added the HD prefix to the system functions used in the file. Tested: local linux --- hl/src/H5LT.c | 74 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index eed2721..88f8de4 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -803,7 +803,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, if((tid = H5Tcopy(H5T_C_S1)) < 0 ) goto out; - size = strlen(buf) + 1; /* extra null term */ + size = HDstrlen(buf) + 1; /* extra null term */ if(H5Tset_size(tid, size) < 0) goto out; @@ -1354,7 +1354,7 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d * cause the iterator to immediately return that positive value, * indicating short-circuit success */ - if(strcmp(name, (char *)op_data) == 0) + if(HDstrcmp(name, (char *)op_data) == 0) ret = 1; return ret; @@ -1437,7 +1437,7 @@ herr_t H5LTset_attribute_string( hid_t loc_id, if ( (attr_type = H5Tcopy( H5T_C_S1 )) < 0 ) goto out; - attr_size = strlen( attr_data ) + 1; /* extra null term */ + attr_size = HDstrlen( attr_data ) + 1; /* extra null term */ if ( H5Tset_size( attr_type, (size_t)attr_size) < 0 ) goto out; @@ -1936,7 +1936,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, * cause the iterator to immediately return that positive value, * indicating short-circuit success */ - if(strcmp(name, (char *)op_data) == 0) + if(HDstrcmp(name, (char *)op_data) == 0) ret = H5_ITER_STOP; return ret; @@ -2168,17 +2168,17 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) goto out; if(lang_type != H5LT_DDL) { - fprintf(stderr, "only DDL is supported for now.\n"); + HDfprintf(stderr, "only DDL is supported for now.\n"); goto out; } - input_len = strlen(text); - myinput = strdup(text); + input_len = HDstrlen(text); + myinput = HDstrdup(text); if((type_id = H5LTyyparse()) < 0) goto out; - free(myinput); + HDfree(myinput); input_len = 0; return type_id; @@ -2207,12 +2207,12 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_ad { if(_no_user_buf) { /* If the buffer isn't big enough, reallocate it. Otherwise, go to do strcat. */ - if(str_to_add && ((ssize_t)(*len - (strlen(buf) + strlen(str_to_add) + 1)) < LIMIT)) { - *len += ((strlen(buf) + strlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT; - buf = (char*)realloc(buf, *len); - } else if(!str_to_add && ((ssize_t)(*len - strlen(buf) - 1) < LIMIT)) { + if(str_to_add && ((ssize_t)(*len - (HDstrlen(buf) + HDstrlen(str_to_add) + 1)) < LIMIT)) { + *len += ((HDstrlen(buf) + HDstrlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT; + buf = (char*)HDrealloc(buf, *len); + } else if(!str_to_add && ((ssize_t)(*len - HDstrlen(buf) - 1) < LIMIT)) { *len += INCREMENT; - buf = (char*)realloc(buf, *len); + buf = (char*)HDrealloc(buf, *len); } } @@ -2220,7 +2220,7 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_ad goto out; if(str_to_add) - strcat(buf, str_to_add); + HDstrcat(buf, str_to_add); return buf; @@ -2249,7 +2249,7 @@ indentation(size_t x, char* str, hbool_t no_u_buf, size_t *s_len) char tmp_str[TMP_LEN]; if (x < 80) { - memset(tmp_str, ' ', x); + HDmemset(tmp_str, ' ', x); tmp_str[x]='\0'; } else HDsnprintf(tmp_str, TMP_LEN, "error: the indentation exceeds the number of cols."); @@ -2310,8 +2310,8 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) dst_size = H5Tget_size(native); /* Get the names and raw values of all members */ - name = (char**)calloc((size_t)nmembs, sizeof(char *)); - value = (unsigned char*)calloc((size_t)nmembs, MAX(dst_size, super_size)); + name = (char**)HDcalloc((size_t)nmembs, sizeof(char *)); + value = (unsigned char*)HDcalloc((size_t)nmembs, MAX(dst_size, super_size)); for (i = 0; i < nmembs; i++) { if((name[i] = H5Tget_member_name(type, (unsigned)i))==NULL) @@ -2359,10 +2359,10 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) /* Release resources */ for(i = 0; i < nmembs; i++) - free(name[i]); + HDfree(name[i]); - free(name); - free(value); + HDfree(name); + HDfree(value); H5Tclose(super); return str; @@ -2378,12 +2378,12 @@ out: if(name) { for(i = 0; i < nmembs; i++) if(name[i]) - free(name[i]); - free(name); + HDfree(name[i]); + HDfree(name); } /* end if */ if(value) - free(value); + HDfree(value); if(super >= 0) H5Tclose(super); @@ -2418,13 +2418,13 @@ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t * goto out; if(len && !str) { - text_str = (char*)calloc(str_len, sizeof(char)); + text_str = (char*)HDcalloc(str_len, sizeof(char)); text_str[0]='\0'; if(!(text_str = H5LT_dtype_to_text(dtype, text_str, lang_type, &str_len, 1))) goto out; - *len = strlen(text_str) + 1; + *len = HDstrlen(text_str) + 1; if(text_str) - free(text_str); + HDfree(text_str); text_str = NULL; } else if(len && str) { if(!(H5LT_dtype_to_text(dtype, str, lang_type, len, 0))) @@ -2744,7 +2744,7 @@ next: if(tag) { HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag); if(tag) - free(tag); + HDfree(tag); tag = NULL; } else HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n"); @@ -2777,14 +2777,14 @@ next: goto out; if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char*)calloc(super_len, sizeof(char)); + stmp = (char*)HDcalloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) goto out; if(stmp) - free(stmp); + HDfree(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, ";\n"); @@ -2821,14 +2821,14 @@ next: goto out; if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char*)calloc(super_len, sizeof(char)); + stmp = (char*)HDcalloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) goto out; if(stmp) - free(stmp); + HDfree(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, "\n"); if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) @@ -2879,13 +2879,13 @@ next: goto out; if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char*)calloc(super_len, sizeof(char)); + stmp = (char*)HDcalloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) goto out; if(stmp) - free(stmp); + HDfree(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, "\n"); if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) @@ -2934,13 +2934,13 @@ next: if(H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0) goto out; - mtmp = (char*)calloc(mlen, sizeof(char)); + mtmp = (char*)HDcalloc(mlen, sizeof(char)); if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, mtmp))) goto out; if(mtmp) - free(mtmp); + HDfree(mtmp); mtmp = NULL; if (H5T_COMPOUND == mclass) @@ -2950,7 +2950,7 @@ next: if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; if(mname) - free(mname); + HDfree(mname); mname = NULL; HDsnprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset); @@ -3560,7 +3560,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, if((tid = H5Tcopy(H5T_C_S1)) < 0) return FAIL; - size = strlen(buf) + 1; /* extra null term */ + size = HDstrlen(buf) + 1; /* extra null term */ if(H5Tset_size(tid,(size_t)size) < 0) goto out; -- cgit v0.12 From dd89c8e90f20c91cd0e937656c7cc9d82a88ff59 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Jun 2013 09:06:28 -0500 Subject: [svn-r23819] Change name of generated file in test to use the macro based removal line. Tested: local linux --- tools/h5dump/CMakeLists.txt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index f881ec0..6c7756e 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1639,20 +1639,14 @@ IF (BUILD_TESTING) ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-tbin2-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out2.bin) - SET_TESTS_PROPERTIES (H5DUMP-tbin2-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) - SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-tbin2-bin-clear-objects) + ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-tbin4-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out4.bin) - SET_TESTS_PROPERTIES (H5DUMP-tbin4-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) - SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-tbin4-bin-clear-objects) + ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for dataset region references -- cgit v0.12 From a8b44cd899576a93104aedcf52b520c2f4d64e73 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Jun 2013 11:10:56 -0500 Subject: [svn-r23821] HDFFV-8428: Corrected FAQ reference --- release_docs/USING_HDF5_VS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/USING_HDF5_VS.txt b/release_docs/USING_HDF5_VS.txt index bd928bc..bbfc501 100644 --- a/release_docs/USING_HDF5_VS.txt +++ b/release_docs/USING_HDF5_VS.txt @@ -78,7 +78,7 @@ Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008 Many other common questions and hints are located online and being updated in the HDF5 FAQ. For Windows-specific questions, please see: - http://www.hdfgroup.org/windows/faq.html + http://www.hdfgroup.org/HDF5/faq/windows.html For all other general questions, you can look in the general FAQ: -- cgit v0.12 From dc2de300b4d5a8a36dad86ca086040c0da4c6051 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Jun 2013 12:44:09 -0500 Subject: [svn-r23823] HDFFV-8428: Correct docs install list HDFFV-8427: Add options to the help text of ALLOW_EXTERNAL_LIBS option. --- CMakeLists.txt | 22 +++++++++++----------- config/cmake/cacheinit.cmake | 3 ++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb57320..bb2c7c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -705,12 +705,10 @@ HDF5_SETUP_FILTERS (NBIT) HDF5_SETUP_FILTERS (SCALEOFFSET) INCLUDE (ExternalProject) -OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO") -OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0) -OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0) +OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO") IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - SET (ZLIB_USE_EXTERNAL 1) - SET (SZIP_USE_EXTERNAL 1) + OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) + OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") SET (ZLIB_URL ${ZLIB_SVN_URL}) SET (SZIP_URL ${SZIP_SVN_URL}) @@ -720,6 +718,9 @@ IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT ENDIF (NOT TGZ_PATH) SET (ZLIB_URL ${TGZ_PATH}/${ZLIB_TGZ_NAME}) SET (SZIP_URL ${TGZ_PATH}/${SZIP_TGZ_NAME}) + ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + SET (ZLIB_USE_EXTERNAL 0) + SET (SZIP_USE_EXTERNAL 0) ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") @@ -1124,7 +1125,6 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) FILES ${HDF5_SOURCE_DIR}/ACKNOWLEDGMENTS ${HDF5_SOURCE_DIR}/COPYING - ${HDF5_SOURCE_DIR}/README.txt DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) @@ -1166,12 +1166,12 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel ) ENDIF (HDF5_ENABLE_PARALLEL) - INSTALL ( - FILES ${release_files} - DESTINATION ${HDF5_INSTALL_DATA_DIR}/release_docs - COMPONENT hdfdocuments - ) ENDIF (HDF5_PACK_INSTALL_DOCS) + INSTALL ( + FILES ${release_files} + DESTINATION ${HDF5_INSTALL_DATA_DIR} + COMPONENT hdfdocuments + ) ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index d45ef9e..43ba754 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -62,7 +62,8 @@ SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libr SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) -SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) +SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE) +SET_PROPERTY(CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ) SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) -- cgit v0.12 From cf5071ad059c3a443b23f7ea157cc2fc74fd6e43 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Jun 2013 13:48:49 -0500 Subject: [svn-r23824] Remove unused warnings option --- CMakeLists.txt | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb2c7c8..eddb4e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -457,7 +457,7 @@ ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so -# break into groups +# break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- IF (NOT MSVC) # Append warning flags @@ -605,16 +605,6 @@ IF (HDF5_ENABLE_GROUPFOUR_WARNINGS) ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) #----------------------------------------------------------------------------- -# Option to allow the user to enable warnings by groups -#----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) -IF (HDF5_ENABLE_GROUPFIVE_WARNINGS) - IF (NOT MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") - ENDIF (NOT MSVC) -ENDIF (HDF5_ENABLE_GROUPFIVE_WARNINGS) - -#----------------------------------------------------------------------------- # This is in here to help some of the GCC based IDES like Eclipse # and code blocks parse the compiler errors and warnings better. #----------------------------------------------------------------------------- -- cgit v0.12 From c2750822ffd92d78e9c442e8ab046ac2dbf47d8e Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 26 Jun 2013 01:25:44 -0500 Subject: [svn-r23825] Bug HDFFV-8469: C++ comments in C code. Found and removed two more "//" comments. Tested: in Koala by $ env CFLAGS="-ansi" ../hdf5/bin/buildhdf5 -fortran -cxx -config # enable fortran and cxx, configure only $ make AM_CFLAGS=-ansi # compile all source file by setting HDF5 build CFLAGS as "-ansi" only --- tools/h5dump/h5dump_ddl.c | 2 -- tools/lib/h5tools_dump.c | 1 - 2 files changed, 3 deletions(-) diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index c4a9ecb..10d4d32 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -1360,8 +1360,6 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe string_dataformat.do_escape = display_escape; outputformat = &string_dataformat; - //attr_name = attr + j + 1; - // need to replace escape characters attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/"); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index e4fe3a4..cde249c 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -637,7 +637,6 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, { HERROR(H5E_tools_g, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); HGOTO_DONE(dimension_break); - //HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); } if(H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0) -- cgit v0.12 From 308106c0e96f3d991d804194a83c231f0a98ba2a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jun 2013 16:04:20 -0500 Subject: [svn-r23829] HDFFV-8134: allow exclusion of attributes. This implements the technique and creates a test. Help changes will be added after trunk tests pass the test cycle. Tested: local linux --- MANIFEST | 2 ++ tools/h5dump/CMakeLists.txt | 7 +++++ tools/h5dump/errfiles/tall-2A0.err | 25 +++++++++++++++ tools/h5dump/h5dump.c | 15 ++++++--- tools/h5dump/h5dump.h | 1 + tools/h5dump/h5dump_ddl.c | 25 ++++++++------- tools/h5dump/h5dump_extern.h | 1 + tools/h5dump/testh5dump.sh.in | 5 +++ tools/testfiles/tall-2A0.ddl | 64 ++++++++++++++++++++++++++++++++++++++ 9 files changed, 128 insertions(+), 17 deletions(-) create mode 100644 tools/h5dump/errfiles/tall-2A0.err create mode 100644 tools/testfiles/tall-2A0.ddl diff --git a/MANIFEST b/MANIFEST index c4a2ac7..f4fbe34 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1553,6 +1553,7 @@ ./tools/testfiles/tudlink-2.ddl ./tools/testfiles/tattr2.h5 ./tools/testfiles/tall-2A.ddl +./tools/testfiles/tall-2A0.ddl ./tools/testfiles/tall-2B.ddl ./tools/testfiles/tattrcontents1.ddl ./tools/testfiles/tattrcontents2.ddl @@ -1612,6 +1613,7 @@ ./tools/h5dump/errfiles/filter_fail.err ./tools/h5dump/errfiles/tall-1.err ./tools/h5dump/errfiles/tall-2A.err +./tools/h5dump/errfiles/tall-2A0.err ./tools/h5dump/errfiles/tall-2B.err ./tools/h5dump/errfiles/tarray1_big.err ./tools/h5dump/errfiles/tattr-3.err diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 6c7756e..8d15e2b 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -52,6 +52,7 @@ IF (BUILD_TESTING) ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A0.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2B.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-3.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-4s.ddl @@ -305,6 +306,7 @@ IF (BUILD_TESTING) ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-2A0.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2B.err ${PROJECT_SOURCE_DIR}/errfiles/tarray1_big.err ${PROJECT_SOURCE_DIR}/errfiles/tattrregR.err @@ -1072,6 +1074,8 @@ IF (BUILD_TESTING) tall-2.out.err tall-2A.out tall-2A.out.err + tall-2A0.out + tall-2A0.out.err tall-2B.out tall-2B.out.err tall-3.out @@ -1506,6 +1510,9 @@ IF (BUILD_TESTING) # test '-A' to suppress data but print attr's ADD_H5ERR_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5) + # test '-A' to suppress attr's but print data + ADD_H5ERR_MASK_TEST (tall-2A0 0 --enable-error-stack -A 0 tall.h5) + # test '-r' to print attributes in ASCII instead of decimal ADD_H5ERR_MASK_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5) diff --git a/tools/h5dump/errfiles/tall-2A0.err b/tools/h5dump/errfiles/tall-2A0.err new file mode 100644 index 0000000..ba691d0 --- /dev/null +++ b/tools/h5dump/errfiles/tall-2A0.err @@ -0,0 +1,25 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + major: Links + minor: Unable to open file diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index ef979b2..225bc9a 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -71,7 +71,7 @@ struct handler_t { */ /* The following initialization makes use of C language cancatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:Aq:z:m:RECM:O*"; +static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, @@ -175,7 +175,7 @@ static struct long_options l_opts[] = { { "xml-n", require_arg, 'X' }, { "xml", no_arg, 'x' }, { "xm", no_arg, 'x' }, - { "onlyattr", no_arg, 'A' }, + { "onlyattr", optional_arg, 'A' }, { "escape", no_arg, 'e' }, { "noindex", no_arg, 'y' }, { "binary", optional_arg, 'b' }, @@ -1093,9 +1093,14 @@ parse_start: last_was_dset = FALSE; break; case 'A': - display_data = FALSE; - display_attr_data = TRUE; - last_was_dset = FALSE; + if ( opt_arg != NULL) { + if(0 == HDatoi(opt_arg)) include_attrs = FALSE; + } + else { + display_data = FALSE; + display_attr_data = TRUE; + last_was_dset = FALSE; + } break; case 'i': display_oid = TRUE; diff --git a/tools/h5dump/h5dump.h b/tools/h5dump/h5dump.h index 7d4f460..7bfead7 100644 --- a/tools/h5dump/h5dump.h +++ b/tools/h5dump/h5dump.h @@ -76,6 +76,7 @@ int display_region = FALSE; /*print region reference data */ int enable_error_stack= FALSE; /* re-enable error stack */ int disable_compact_subset= FALSE; /* disable compact form of subset notation */ int display_packed_bits = FALSE; /*print 1-8 byte numbers as packed bits*/ +int include_attrs = TRUE; /* Display attributes */ /* sort parameters */ H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index 10d4d32..a9a23a5 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -556,19 +556,20 @@ attr_iteration(hid_t gid, unsigned attr_crt_order_flags) { /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group for attributes, then, sort by creation order, otherwise by name */ - - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); + if(include_attrs) { + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ } /* end if */ - } /* end else */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ + } } /*------------------------------------------------------------------------- diff --git a/tools/h5dump/h5dump_extern.h b/tools/h5dump/h5dump_extern.h index 5a0f2bd..08f9e36 100644 --- a/tools/h5dump/h5dump_extern.h +++ b/tools/h5dump/h5dump_extern.h @@ -76,6 +76,7 @@ extern int display_region; /*print region reference data */ extern int enable_error_stack; /* re-enable error stack */ extern int disable_compact_subset; /* disable compact form of subset notation */ extern int display_packed_bits; /*print 1-8 byte numbers as packed bits*/ +extern int include_attrs; /* Display attributes */ /* sort parameters */ extern H5_index_t sort_by; /*sort_by [creation_order | name] */ diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index f55ecf8..0e3cfda 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -175,6 +175,7 @@ $SRC_H5DUMP_TESTFILES/packedbits.ddl $SRC_H5DUMP_TESTFILES/tall-1.ddl $SRC_H5DUMP_TESTFILES/tall-2.ddl $SRC_H5DUMP_TESTFILES/tall-2A.ddl +$SRC_H5DUMP_TESTFILES/tall-2A0.ddl $SRC_H5DUMP_TESTFILES/tall-2B.ddl $SRC_H5DUMP_TESTFILES/tall-3.ddl $SRC_H5DUMP_TESTFILES/tall-4s.ddl @@ -335,6 +336,7 @@ LIST_ERROR_TEST_FILES=" ${SRC_H5DUMP_ERRORFILES}/filter_fail.err ${SRC_H5DUMP_ERRORFILES}/tall-1.err ${SRC_H5DUMP_ERRORFILES}/tall-2A.err +${SRC_H5DUMP_ERRORFILES}/tall-2A0.err ${SRC_H5DUMP_ERRORFILES}/tall-2B.err ${SRC_H5DUMP_ERRORFILES}/tarray1_big.err ${SRC_H5DUMP_ERRORFILES}/tattr-3.err @@ -1005,6 +1007,9 @@ TOOLTEST tlarge_objname.ddl --enable-error-stack -w157 tlarge_objname.h5 # test '-A' to suppress data but print attr's TOOLTEST4 tall-2A.ddl --enable-error-stack -A tall.h5 +# test '-A' to suppress attr's but print data +TOOLTEST4 tall-2A0.ddl --enable-error-stack -A 0 tall.h5 + # test '-r' to print attributes in ASCII instead of decimal TOOLTEST4 tall-2B.ddl --enable-error-stack -A -r tall.h5 diff --git a/tools/testfiles/tall-2A0.ddl b/tools/testfiles/tall-2A0.ddl new file mode 100644 index 0000000..e0955f3 --- /dev/null +++ b/tools/testfiles/tall-2A0.ddl @@ -0,0 +1,64 @@ +HDF5 "tall.h5" { +GROUP "/" { + GROUP "g1" { + GROUP "g1.1" { + DATASET "dset1.1.1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 10, 10 ) / ( 10, 10 ) } + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + (2,0): 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + (3,0): 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, + (4,0): 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, + (5,0): 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, + (6,0): 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, + (7,0): 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, + (8,0): 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, + (9,0): 0, 9, 18, 27, 36, 45, 54, 63, 72, 81 + } + } + DATASET "dset1.1.2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 20 ) / ( 20 ) } + DATA { + (0): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + (17): 17, 18, 19 + } + } + } + GROUP "g1.2" { + EXTERNAL_LINK "extlink" { + TARGETFILE "somefile" + TARGETPATH "somepath" + } + GROUP "g1.2.1" { + SOFTLINK "slink" { + LINKTARGET "somevalue" + } + } + } + } + GROUP "g2" { + DATASET "dset2.1" { + DATATYPE H5T_IEEE_F32BE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + DATA { + (0): 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9 + } + } + DATASET "dset2.2" { + DATATYPE H5T_IEEE_F32BE + DATASPACE SIMPLE { ( 3, 5 ) / ( 3, 5 ) } + DATA { + (0,0): 0, 0.1, 0.2, 0.3, 0.4, + (1,0): 0, 0.2, 0.4, 0.6, 0.8, + (2,0): 0, 0.3, 0.6, 0.9, 1.2 + } + } + USERDEFINED_LINK "udlink" { + LINKCLASS 187 + } + } +} +} -- cgit v0.12 From a4dc3ff34d2dec4db339851df381b67970853f2a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jun 2013 16:28:13 -0500 Subject: [svn-r23830] HDFFV-8476: Add the optional arg to the help usage text. Tested: local linux --- tools/h5dump/h5dump.c | 6 +----- tools/testfiles/h5dump-help.txt | 1 + tools/testfiles/tnofilename-with-packed-bits.ddl | 1 + tools/testfiles/tpbitsIncomplete.ddl | 1 + tools/testfiles/tpbitsLengthExceeded.ddl | 1 + tools/testfiles/tpbitsLengthPositive.ddl | 1 + tools/testfiles/tpbitsMaxExceeded.ddl | 1 + tools/testfiles/tpbitsOffsetExceeded.ddl | 1 + tools/testfiles/tpbitsOffsetNegative.ddl | 1 + 9 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 225bc9a..9b304bd 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -221,11 +221,6 @@ leave(int ret) * Purpose: Print the usage message about dumper * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * Pedro Vicente, October 5, 2007. Add -q and -z flags *------------------------------------------------------------------------- */ static void @@ -240,6 +235,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " -B, --superblock Print the content of the super block\n"); PRINTVALSTREAM(rawoutstream, " -H, --header Print the header only; no data is displayed\n"); PRINTVALSTREAM(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n"); + PRINTVALSTREAM(rawoutstream, " Optional value 0 suppresses printing attributes.\n"); PRINTVALSTREAM(rawoutstream, " -i, --object-ids Print the object ids\n"); PRINTVALSTREAM(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n"); PRINTVALSTREAM(rawoutstream, " -e, --escape Escape non printing characters\n"); diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index 40510a4..b735b18 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl index 440e3d9..e8d6d84 100644 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl index 758b6b4..06c5613 100644 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ b/tools/testfiles/tpbitsIncomplete.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl index a85ba49..ffd9910 100644 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/tpbitsLengthExceeded.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl index d5a1c88..a54812b 100644 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ b/tools/testfiles/tpbitsLengthPositive.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl index e24245c..1a8dd11 100644 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/tpbitsMaxExceeded.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl index 8f58c47..7527131 100644 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/tpbitsOffsetExceeded.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl index 6df8cce..21b573d 100644 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/tpbitsOffsetNegative.ddl @@ -6,6 +6,7 @@ usage: h5dump [OPTIONS] files -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. -i, --object-ids Print the object ids -r, --string Print 1-byte integer datasets as ASCII -e, --escape Escape non printing characters -- cgit v0.12