From 33a65add7db18a4efd2b34ac8261c2065820ebf9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 24 Feb 2009 12:59:14 -0500 Subject: [svn-r16514] Description: Merge r16440:16500 from trunk into revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.6 (amazon) in debug mode Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode --- MANIFEST | 2 + README.txt | 2 +- config/lt_vers.am | 2 +- configure | 22 +- configure.in | 2 +- fortran/src/H5_f.c | 10 +- fortran/src/H5match_types.c | 16 +- hl/fortran/src/H5IMcc.c | 10 +- hl/fortran/src/H5LTfc.c | 4 +- hl/src/H5LT.c | 4 +- hl/src/H5LTparse.c | 2 +- hl/src/H5LTpublic.h | 4 +- perform/pio_engine.c | 34 +-- perform/pio_perf.c | 60 ++--- perform/pio_standalone.h | 19 -- perform/sio_engine.c | 6 +- perform/sio_perf.c | 12 +- perform/sio_standalone.h | 18 -- release_docs/INSTALL_Windows.txt | 2 +- release_docs/RELEASE.txt | 15 +- src/H5A.c | 28 +-- src/H5Abtree2.c | 2 +- src/H5Adense.c | 2 +- src/H5Aint.c | 33 +-- src/H5Apkg.h | 5 +- src/H5Atest.c | 2 +- src/H5D.c | 2 +- src/H5Dchunk.c | 192 ++++++++++------ src/H5Dearray.c | 4 +- src/H5Dmpio.c | 4 +- src/H5Dpkg.h | 6 +- src/H5Dtest.c | 46 ++++ src/H5EA.c | 24 +- src/H5EAdbg.c | 6 +- src/H5EAdblkpage.c | 4 +- src/H5EAdblock.c | 6 +- src/H5EAiblock.c | 6 +- src/H5EAsblock.c | 6 +- src/H5EAtest.c | 4 +- src/H5F.c | 6 +- src/H5FDmulti.c | 6 +- src/H5Gbtree2.c | 2 +- src/H5Gdense.c | 10 +- src/H5Gobj.c | 4 +- src/H5HFcache.c | 2 +- src/H5O.c | 92 +++++--- src/H5Oainfo.c | 8 +- src/H5Oalloc.c | 183 ++++++++++----- src/H5Oattr.c | 14 +- src/H5Oattribute.c | 240 +++++++++++--------- src/H5Obogus.c | 8 +- src/H5Obtreek.c | 8 +- src/H5Ocache.c | 4 +- src/H5Ocont.c | 8 +- src/H5Ocopy.c | 2 +- src/H5Odrvinfo.c | 8 +- src/H5Odtype.c | 6 +- src/H5Oefl.c | 8 +- src/H5Ofill.c | 16 +- src/H5Oginfo.c | 8 +- src/H5Olayout.c | 8 +- src/H5Olinfo.c | 8 +- src/H5Olink.c | 8 +- src/H5Omessage.c | 10 +- src/H5Omtime.c | 16 +- src/H5Oname.c | 8 +- src/H5Opkg.h | 11 +- src/H5Opline.c | 8 +- src/H5Oprivate.h | 8 +- src/H5Orefcount.c | 8 +- src/H5Osdspace.c | 8 +- src/H5Oshared.c | 47 +++- src/H5Oshared.h | 6 +- src/H5Oshmesg.c | 8 +- src/H5Ostab.c | 8 +- src/H5Otest.c | 37 ++-- src/H5S.c | 2 +- src/H5SM.c | 2 +- src/H5T.c | 6 +- src/H5Tconv.c | 180 +++++++-------- src/H5Tnative.c | 8 +- src/H5Tpublic.h | 2 +- src/H5Zscaleoffset.c | 126 +++++------ src/H5Ztrans.c | 12 +- src/H5detect.c | 4 +- src/H5private.h | 8 +- src/H5public.h | 36 +-- src/Makefile.in | 2 +- test/Makefile.am | 4 +- test/big.c | 8 +- test/cmpd_dset.c | 2 +- test/dsets.c | 203 ++++++++++++++--- test/dt_arith.c | 222 +++++++++---------- test/dtransform.c | 8 +- test/earray.c | 4 +- test/ntypes.c | 12 +- test/tattr.c | 380 +++++++++++++++++++++++++++++++- test/tconfig.c | 2 +- test/tmisc.c | 184 ++++++++++++++++ testpar/t_cache.c | 154 ++++++++++++- tools/h5diff/h5diffgentest.c | 68 +++++- tools/h5diff/testfiles/h5diff_17.txt | 3 + tools/h5diff/testfiles/h5diff_206.txt | 1 + tools/h5diff/testfiles/h5diff_207.txt | 2 + tools/h5diff/testfiles/h5diff_90.txt | 10 + tools/h5diff/testfiles/h5diff_basic2.h5 | Bin 7688 -> 9008 bytes tools/h5diff/testh5diff.sh | 10 + tools/h5dump/h5dump.c | 28 +-- tools/h5dump/h5dumpgentest.c | 2 +- tools/h5import/h5import.h | 2 +- tools/h5import/h5importtest.c | 8 +- tools/h5ls/h5ls.c | 16 +- tools/h5repack/h5repacktst.c | 2 +- tools/lib/h5diff.h | 3 +- tools/lib/h5diff_array.c | 114 +++++----- tools/lib/h5diff_attr.c | 3 +- tools/lib/h5diff_dset.c | 100 ++++++++- tools/lib/h5diff_util.c | 2 +- tools/lib/h5tools.c | 12 +- tools/lib/h5tools_str.c | 12 +- vms/build.com | 10 +- vms/c++/examples/make.com | 42 ++-- vms/c++/src/make.com | 81 +++---- vms/c++/test/make.com | 18 +- vms/fortran/examples/make.com | 2 +- vms/fortran/src/make.com | 17 +- vms/fortran/test/make.com | 7 +- vms/install.com | 9 + vms/make.com | 28 ++- vms/src/h5pubconf.h | 6 +- vms/test/check.com | 5 - vms/tools/h5copy/make.com | 6 +- vms/tools/h5diff/check_h5diff.com | 15 +- vms/tools/h5diff/make.com | 7 +- vms/tools/h5dump/make.com | 12 +- vms/tools/h5import/make.com | 8 +- vms/tools/h5jam/make.com | 8 +- vms/tools/h5ls/make.com | 8 +- vms/tools/h5repack/check_h5repack.com | 9 +- vms/tools/h5repack/make.com | 9 +- windows/src/H5pubconf.h | 6 +- windows/tools/h5diff/testh5diff.bat | 38 ++++ 142 files changed, 2562 insertions(+), 1236 deletions(-) create mode 100644 tools/h5diff/testfiles/h5diff_206.txt create mode 100644 tools/h5diff/testfiles/h5diff_207.txt diff --git a/MANIFEST b/MANIFEST index 1d4c795..a0307d4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1479,6 +1479,8 @@ ./tools/h5diff/testfiles/h5diff_203.txt ./tools/h5diff/testfiles/h5diff_204.txt ./tools/h5diff/testfiles/h5diff_205.txt +./tools/h5diff/testfiles/h5diff_206.txt +./tools/h5diff/testfiles/h5diff_207.txt ./tools/h5diff/testfiles/h5diff_basic1.h5 diff --git a/README.txt b/README.txt index fe64891..9acec5d 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.30 currently under development +HDF5 version 1.9.32 currently under development ==> README.txt <== Messages to be sent to the list should be sent to "@hdfgroup.org". diff --git a/config/lt_vers.am b/config/lt_vers.am index 2821e1f..f18b5c7 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 = 20 +LT_VERS_REVISION = 22 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 3407690..2e3e34e 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 16344 2009-01-25 12:22:44Z hdftest . +# From configure.in Id: configure.in 16453 2009-02-08 11:15:02Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for HDF5 1.9.30. +# Generated by GNU Autoconf 2.61 for HDF5 1.9.32. # # Report bugs to . # @@ -724,8 +724,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.30' -PACKAGE_STRING='HDF5 1.9.30' +PACKAGE_VERSION='1.9.32' +PACKAGE_STRING='HDF5 1.9.32' PACKAGE_BUGREPORT='help@hdfgroup.org' ac_unique_file="src/H5.c" @@ -1501,7 +1501,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.30 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.32 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1571,7 +1571,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.30:";; + short | recursive ) echo "Configuration of HDF5 1.9.32:";; esac cat <<\_ACEOF @@ -1753,7 +1753,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.30 +HDF5 configure 1.9.32 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1767,7 +1767,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.30, which was +It was created by HDF5 $as_me 1.9.32, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2462,7 +2462,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.30' + VERSION='1.9.32' cat >>confdefs.h <<_ACEOF @@ -51948,7 +51948,7 @@ exec 6>&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.30, which was +This file was extended by HDF5 $as_me 1.9.32, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -52001,7 +52001,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -HDF5 config.status 1.9.30 +HDF5 config.status 1.9.32 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.in b/configure.in index 4fc9bd0..abe2b3f 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.30], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.32], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 915f8cb..d7bb3d8 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -56,7 +56,7 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_LONG)) < 0) return ret_value; } /*end if */ else - if (sizeof(int_f) == sizeof(long_long)) { + if (sizeof(int_f) == sizeof(long long)) { if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ @@ -115,7 +115,7 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_1_f) == sizeof(int)) { if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value; } /*end if */ - else if (sizeof(int_1_f) == sizeof(long_long)) { + else if (sizeof(int_1_f) == sizeof(long long)) { if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ @@ -128,7 +128,7 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_2_f) == sizeof(int)) { if ((types[7] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value; } /*end if */ - else if (sizeof(int_2_f) == sizeof(long_long)) { + else if (sizeof(int_2_f) == sizeof(long long)) { if ((types[7] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ @@ -141,7 +141,7 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_4_f) == sizeof(int)) { if ((types[8] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value; } /*end if */ - else if (sizeof(int_4_f) == sizeof(long_long)) { + else if (sizeof(int_4_f) == sizeof(long long)) { if ((types[8] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ @@ -154,7 +154,7 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_8_f) == sizeof(int)) { if ((types[9] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value; } /*end if */ - else if (sizeof(int_8_f) == sizeof(long_long)) { + else if (sizeof(int_8_f) == sizeof(long long)) { if ((types[9] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index 034ff72..091d0c8 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -160,8 +160,8 @@ int main() /* First, define c_int_x */ #if defined H5_FORTRAN_HAS_INTEGER_1 - if(sizeof(long_long) == 1) - writeTypedef("long_long", 1); + if(sizeof(long long) == 1) + writeTypedef("long long", 1); else if(sizeof(long) == 1) writeTypedef("long", 1); else if(sizeof(int) == 1) @@ -176,8 +176,8 @@ int main() #endif /*H5_FORTRAN_HAS_INTEGER_1 */ #if defined H5_FORTRAN_HAS_INTEGER_2 - if(sizeof(long_long) == 2) - writeTypedef("long_long", 2); + if(sizeof(long long) == 2) + writeTypedef("long long", 2); else if(sizeof(long) == 2) writeTypedef("long", 2); else if(sizeof(int) == 2) @@ -189,8 +189,8 @@ int main() #endif /*H5_FORTRAN_HAS_INTEGER_2 */ #if defined H5_FORTRAN_HAS_INTEGER_4 - if(sizeof(long_long) == 4) - writeTypedef("long_long", 4); + if(sizeof(long long) == 4) + writeTypedef("long long", 4); else if(sizeof(long) == 4) writeTypedef("long", 4); else if(sizeof(int) == 4) @@ -202,8 +202,8 @@ int main() #endif /*H5_FORTRAN_HAS_INTEGER_4 */ #if defined H5_FORTRAN_HAS_INTEGER_8 - if(sizeof(long_long) == 8) - writeTypedef("long_long", 8); + if(sizeof(long long) == 8) + writeTypedef("long long", 8); else if(sizeof(long) == 8) writeTypedef("long", 8); else if(sizeof(int) == 8) diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index 492e8b8..8f0e29e 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -87,7 +87,7 @@ herr_t H5IMmake_image_8bitf(hid_t loc_id, } else if(sizeof(int_f) == sizeof(long)) { if(H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) return -1; - } else if(sizeof(int_f) == sizeof(long_long)) { + } else if(sizeof(int_f) == sizeof(long long)) { if(H5Dwrite(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) return -1; } else @@ -200,7 +200,7 @@ herr_t H5IMmake_image_24bitf(hid_t loc_id, } else if(sizeof(int_f) == sizeof(long)) { if(H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) return -1; - } else if(sizeof(int_f) == sizeof(long_long)) { + } else if(sizeof(int_f) == sizeof(long long)) { if(H5Dwrite(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) return -1; } else @@ -276,7 +276,7 @@ herr_t H5IMread_imagef(hid_t loc_id, tid = H5T_NATIVE_INT; else if(sizeof(int_f) == sizeof(long)) tid = H5T_NATIVE_LONG; - else if(sizeof(int_f) == sizeof(long_long)) + else if(sizeof(int_f) == sizeof(long long)) tid = H5T_NATIVE_LLONG; else goto out; @@ -360,7 +360,7 @@ herr_t H5IMmake_palettef(hid_t loc_id, } else if(sizeof(int_f) == sizeof(long)) { if(H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0) return -1; - } else if(sizeof(int_f) == sizeof(long_long)) { + } else if(sizeof(int_f) == sizeof(long long)) { if(H5Dwrite(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0) return -1; } else @@ -424,7 +424,7 @@ herr_t H5IMget_palettef(hid_t loc_id, return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_INT,pal_data); else if(sizeof(int_f) == sizeof(long)) return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LONG,pal_data); - else if(sizeof(int_f) == sizeof(long_long)) + else if(sizeof(int_f) == sizeof(long long)) return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LLONG,pal_data); else return -1; diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 6aa3354..93d65ef 100755 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -682,7 +682,7 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, ret = H5LTset_attribute_int(c_loc_id,c_name,c_attrname,buf,c_size); else if (sizeof(int_f) == sizeof(long)) ret = H5LTset_attribute_long(c_loc_id,c_name,c_attrname,buf,c_size); - else if (sizeof(int_f) == sizeof(long_long)) + else if (sizeof(int_f) == sizeof(long long)) ret = H5LTset_attribute_long_long(c_loc_id,c_name,c_attrname,buf,c_size); else return ret_value; @@ -928,7 +928,7 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id, ret = H5LTget_attribute_int(c_loc_id,c_name,c_attrname,buf); else if (sizeof(int_f) == sizeof(long)) ret = H5LTget_attribute_long(c_loc_id,c_name,c_attrname,buf); - else if (sizeof(int_f) == sizeof(long_long)) + else if (sizeof(int_f) == sizeof(long long)) ret = H5LTget_attribute_long_long(c_loc_id,c_name,c_attrname,buf); else return ret_value; diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 78df61a..92965fd 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -1227,7 +1227,7 @@ herr_t H5LTset_attribute_long( hid_t loc_id, herr_t H5LTset_attribute_long_long( hid_t loc_id, const char *obj_name, const char *attr_name, - const long_long *data, + const long long *data, size_t size ) { @@ -2557,7 +2557,7 @@ herr_t H5LTget_attribute_long( hid_t loc_id, herr_t H5LTget_attribute_long_long( hid_t loc_id, const char *obj_name, const char *attr_name, - long_long *data ) + long long *data ) { /* Get the attribute */ if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_LLONG, data) < 0) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 9f67175..6e5e08b 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1053,7 +1053,7 @@ case 92: short short_val=(short)yylval.ival; int int_val=(int)yylval.ival; long long_val=(long)yylval.ival; - long_long llong_val=(long_long)yylval.ival; + long long llong_val=(long long)yylval.ival; hid_t super = H5Tget_super(enum_id); hid_t native = H5Tget_native_type(super, H5T_DIR_ASCEND); diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h index 05670d2..7fb873a 100644 --- a/hl/src/H5LTpublic.h +++ b/hl/src/H5LTpublic.h @@ -203,7 +203,7 @@ H5_HLDLL herr_t H5LTset_attribute_long( hid_t loc_id, H5_HLDLL herr_t H5LTset_attribute_long_long( hid_t loc_id, const char *obj_name, const char *attr_name, - const long_long *buffer, + const long long *buffer, size_t size ); H5_HLDLL herr_t H5LTset_attribute_ulong( hid_t loc_id, @@ -280,7 +280,7 @@ H5_HLDLL herr_t H5LTget_attribute_long( hid_t loc_id, H5_HLDLL herr_t H5LTget_attribute_long_long( hid_t loc_id, const char *obj_name, const char *attr_name, - long_long *data ); + long long *data ); H5_HLDLL herr_t H5LTget_attribute_ulong( hid_t loc_id, const char *obj_name, diff --git a/perform/pio_engine.c b/perform/pio_engine.c index 6124bce..c5214d3 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -248,26 +248,26 @@ 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 (%Hd) 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 (%Hd) 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", - (long_long)buf_size, (long_long)blk_size); + (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 " "number of processes (%d)\n", - (long_long)snbytes, pio_mpi_nprocs_g); + (long long)snbytes, pio_mpi_nprocs_g); GOTOERROR(FAIL); } @@ -276,7 +276,7 @@ do_pio(parameters param) HDfprintf(stderr, "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); + (long long)(snbytes/pio_mpi_nprocs_g), (long long)buf_size); GOTOERROR(FAIL); } } @@ -285,7 +285,7 @@ do_pio(parameters param) HDfprintf(stderr, "Dataset side size (%Hd) must be a multiple of the " "trasfer buffer size (%Hd)\n", - (long_long)snbytes, (long_long)buf_size); + (long long)snbytes, (long long)buf_size); GOTOERROR(FAIL); } } @@ -293,7 +293,7 @@ do_pio(parameters param) /* Allocate transfer buffer */ if ((buffer = malloc(bsize)) == NULL){ HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", - (long_long)(bsize)); + (long long)(bsize)); GOTOERROR(FAIL); } @@ -651,13 +651,13 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, if (!parms->dim2d) { HDfprintf(output, "Debug(do_write): " "buf_size=%Hd, bytes_begin=%Hd, bytes_count=%Hd\n", - (long_long)buf_size, (long_long)bytes_begin[0], - (long_long)bytes_count); + (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", - (long_long)buf_size*blk_size, (long_long)bytes_begin[0], - (long_long)bytes_begin[1], (long_long)bytes_count); + (long long)buf_size*blk_size, (long long)bytes_begin[0], + (long long)bytes_begin[1], (long long)bytes_count); } } @@ -1625,13 +1625,13 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, if (!parms->dim2d) { HDfprintf(output, "Debug(do_write): " "buf_size=%Hd, bytes_begin=%Hd, bytes_count=%Hd\n", - (long_long)buf_size, (long_long)bytes_begin[0], - (long_long)bytes_count); + (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", - (long_long)buf_size*blk_size, (long_long)bytes_begin[0], - (long_long)bytes_begin[1], (long_long)bytes_count); + (long long)buf_size*blk_size, (long long)bytes_begin[0], + (long long)bytes_begin[1], (long long)bytes_count); } } @@ -2337,8 +2337,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, HDprint_rank(output); HDfprintf(output, "read data error, expected (%Hd), " "got (%Hd)\n", - (long_long)pio_mpi_rank_g+1, - (long_long)*(ucharptr-1)); + (long long)pio_mpi_rank_g+1, + (long long)*(ucharptr-1)); } /* end if */ } /* end if */ } /* end for */ diff --git a/perform/pio_perf.c b/perform/pio_perf.c index b19c7fb..a6057b3 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -1107,7 +1107,7 @@ print_indent(register int indent) } static void -recover_size_and_print(long_long val, const char *end) +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) { @@ -1147,67 +1147,67 @@ report_parameters(struct options *opts) print_io_api(opts->io_types); HDfprintf(output, "rank %d: Number of files=%Hd\n", rank, - (long_long)opts->num_files); + (long long)opts->num_files); HDfprintf(output, "rank %d: Number of datasets=%Hd\n", rank, - (long_long)opts->num_dsets); + (long long)opts->num_dsets); HDfprintf(output, "rank %d: Number of iterations=%Hd\n", rank, - (long_long)opts->num_iters); + (long long)opts->num_iters); HDfprintf(output, "rank %d: Number of processes=%d:%d\n", rank, opts->min_num_procs, opts->max_num_procs); if (opts->dim2d){ HDfprintf(output, "rank %d: Number of bytes per process per dataset=", rank); - recover_size_and_print((long_long)(opts->num_bpp * opts->num_bpp * opts->min_num_procs), ":"); - recover_size_and_print((long_long)(opts->num_bpp * opts->num_bpp * opts->max_num_procs), "\n"); + recover_size_and_print((long long)(opts->num_bpp * opts->num_bpp * opts->min_num_procs), ":"); + recover_size_and_print((long long)(opts->num_bpp * opts->num_bpp * opts->max_num_procs), "\n"); HDfprintf(output, "rank %d: Size of dataset(s)=", rank); - recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs), "x"); - recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs), ":"); - recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs), "x"); - recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs), "\n"); + recover_size_and_print((long long)(opts->num_bpp * opts->min_num_procs), "x"); + recover_size_and_print((long long)(opts->num_bpp * opts->min_num_procs), ":"); + recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "x"); + recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "\n"); HDfprintf(output, "rank %d: File size=", rank); - recover_size_and_print((long_long)(pow(opts->num_bpp * opts->min_num_procs,2) + recover_size_and_print((long long)(pow(opts->num_bpp * opts->min_num_procs,2) * opts->num_dsets), ":"); - recover_size_and_print((long_long)(pow(opts->num_bpp * opts->max_num_procs,2) + recover_size_and_print((long long)(pow(opts->num_bpp * opts->max_num_procs,2) * opts->num_dsets), "\n"); HDfprintf(output, "rank %d: Transfer buffer size=", rank); if(opts->interleaved){ - recover_size_and_print((long_long)opts->min_xfer_size, "x"); - recover_size_and_print((long_long)opts->blk_size, ":"); - recover_size_and_print((long_long)opts->max_xfer_size, "x"); - recover_size_and_print((long_long)opts->blk_size, "\n"); + recover_size_and_print((long long)opts->min_xfer_size, "x"); + recover_size_and_print((long long)opts->blk_size, ":"); + recover_size_and_print((long long)opts->max_xfer_size, "x"); + recover_size_and_print((long long)opts->blk_size, "\n"); } else{ - recover_size_and_print((long_long)opts->blk_size, "x"); - recover_size_and_print((long_long)opts->min_xfer_size, ":"); - recover_size_and_print((long_long)opts->blk_size, "x"); - recover_size_and_print((long_long)opts->max_xfer_size, "\n"); + recover_size_and_print((long long)opts->blk_size, "x"); + recover_size_and_print((long long)opts->min_xfer_size, ":"); + recover_size_and_print((long long)opts->blk_size, "x"); + recover_size_and_print((long long)opts->max_xfer_size, "\n"); } HDfprintf(output, "rank %d: Block size=", rank); - recover_size_and_print((long_long)opts->blk_size, "x"); - recover_size_and_print((long_long)opts->blk_size, "\n"); + recover_size_and_print((long long)opts->blk_size, "x"); + recover_size_and_print((long long)opts->blk_size, "\n"); } else{ HDfprintf(output, "rank %d: Number of bytes per process per dataset=", rank); - recover_size_and_print((long_long)opts->num_bpp, "\n"); + recover_size_and_print((long long)opts->num_bpp, "\n"); HDfprintf(output, "rank %d: Size of dataset(s)=", rank); - recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs), ":"); - recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs), "\n"); + recover_size_and_print((long long)(opts->num_bpp * opts->min_num_procs), ":"); + recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "\n"); HDfprintf(output, "rank %d: File size=", rank); - recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs + recover_size_and_print((long long)(opts->num_bpp * opts->min_num_procs * opts->num_dsets), ":"); - recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs + recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs * opts->num_dsets), "\n"); HDfprintf(output, "rank %d: Transfer buffer size=", rank); - recover_size_and_print((long_long)opts->min_xfer_size, ":"); - recover_size_and_print((long_long)opts->max_xfer_size, "\n"); + recover_size_and_print((long long)opts->min_xfer_size, ":"); + recover_size_and_print((long long)opts->max_xfer_size, "\n"); HDfprintf(output, "rank %d: Block size=", rank); - recover_size_and_print((long_long)opts->blk_size, "\n"); + recover_size_and_print((long long)opts->blk_size, "\n"); } HDfprintf(output, "rank %d: Block Pattern in Dataset=", rank); diff --git a/perform/pio_standalone.h b/perform/pio_standalone.h index af67a35..ab4ee94 100644 --- a/perform/pio_standalone.h +++ b/perform/pio_standalone.h @@ -132,25 +132,6 @@ typedef off_t h5_stat_size_t; # define TRUE 1 #endif -/* - * Although `long long' is part of the revised ANSI-C some compilers don't - * support it yet. We define `long_long' as the longest integral integer type - * supported by the compiler, usually 64 bits. It must be legal to qualify - * `long_long' with `unsigned'. - */ -#if H5_SIZEOF_LONG_LONG>0 -# define long_long long long -#elif H5_SIZEOF___INT64>0 -# define long_long __int64 /*Win32*/ -# undef H5_SIZEOF_LONG_LONG -# define H5_SIZEOF_LONG_LONG H5_SIZEOF___INT64 -#else -# define long_long long int -# undef H5_SIZEOF_LONG_LONG -# define H5_SIZEOF_LONG_LONG H5_SIZEOF_LONG -#endif - - /** From h5test.h **/ diff --git a/perform/sio_engine.c b/perform/sio_engine.c index a6a7fa1..0fdfac5 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -202,7 +202,7 @@ 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] (%Hd) must be > 0\n", i,(long long)buf_size[i]); GOTOERROR(FAIL); } @@ -210,7 +210,7 @@ do_sio(parameters param) HDfprintf(stderr, "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]); + (long long)param.dset_size[i], param.rank, (long long)param.buf_size[i]); GOTOERROR(FAIL); } @@ -220,7 +220,7 @@ do_sio(parameters param) buffer2 = malloc(linear_buf_size); if ((buffer = malloc(linear_buf_size)) == NULL){ HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", - (long_long)(linear_buf_size)); + (long long)(linear_buf_size)); GOTOERROR(FAIL); } diff --git a/perform/sio_perf.c b/perform/sio_perf.c index b0f81f4..271bf20 100644 --- a/perform/sio_perf.c +++ b/perform/sio_perf.c @@ -820,7 +820,7 @@ print_indent(register int indent) } static void -recover_size_and_print(long_long val, const char *end) +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) { @@ -859,23 +859,23 @@ report_parameters(struct options *opts) print_io_api(opts->io_types); HDfprintf(output, "Number of iterations=%Hd\n", - (long_long)opts->num_iters); + (long long)opts->num_iters); HDfprintf(output, "Dataset size="); for (i=0; idset_size[i], " "); + recover_size_and_print((long long)opts->dset_size[i], " "); HDfprintf(output, "\n"); HDfprintf(output, "Transfer buffer size="); for (i=0; ibuf_size[i], " "); + recover_size_and_print((long long)opts->buf_size[i], " "); HDfprintf(output, "\n"); HDfprintf(output, "Dimension access order="); for (i=0; iorder[i], " "); + recover_size_and_print((long long)opts->order[i], " "); HDfprintf(output, "\n"); if (opts->io_types & SIO_HDF5) { @@ -887,7 +887,7 @@ report_parameters(struct options *opts) HDfprintf(output, "Chunked\n"); HDfprintf(output, "HDF5 chunk size="); for (i=0; ichk_size[i], " "); + recover_size_and_print((long long)opts->chk_size[i], " "); HDfprintf(output, "\n"); HDfprintf(output, "HDF5 dataset dimensions="); diff --git a/perform/sio_standalone.h b/perform/sio_standalone.h index 7b32c66..9faaac1 100644 --- a/perform/sio_standalone.h +++ b/perform/sio_standalone.h @@ -486,24 +486,6 @@ extern char *strdup(const char *s); # define TRUE 1 #endif -/* - * Although `long long' is part of the revised ANSI-C some compilers don't - * support it yet. We define `long_long' as the longest integral integer type - * supported by the compiler, usually 64 bits. It must be legal to qualify - * `long_long' with `unsigned'. - */ -#if H5_SIZEOF_LONG_LONG>0 -# define long_long long long -#elif H5_SIZEOF___INT64>0 -# define long_long __int64 /*Win32*/ -# undef H5_SIZEOF_LONG_LONG -# define H5_SIZEOF_LONG_LONG H5_SIZEOF___INT64 -#else -# define long_long long int -# undef H5_SIZEOF_LONG_LONG -# define H5_SIZEOF_LONG_LONG H5_SIZEOF_LONG -#endif - /** From h5test.h **/ #ifdef H5_HAVE_PARALLEL diff --git a/release_docs/INSTALL_Windows.txt b/release_docs/INSTALL_Windows.txt index 6c4a71f..61a81a9 100644 --- a/release_docs/INSTALL_Windows.txt +++ b/release_docs/INSTALL_Windows.txt @@ -893,7 +893,7 @@ project, you may choose one of the following two methods. 3. Choose the build configuration you would like to modify in the drop down menu labeled "Configuration:" - 4. Choose the "C/C++" tab, anc select "General". + 4. Choose the "C/C++" tab, and select "General". 5. In a text-area labeled with "Additional Include Directories:", add HDF5, Zlib, and Szip header files directories. For example: diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d544e87..84bdaf3 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.30 currently under development +HDF5 version 1.9.32 currently under development ================================================================================ @@ -142,8 +142,17 @@ Bug Fixes since HDF5-1.8.0 release Library ------- - - Fixed a bug that could cause problems when copying an object with a shared - message in its own object header. (NAF - 2009/01/29) + - Fixed a bug that prevented more than one dataset chunk from being cached + at a time. (NAF - 2009/02/12) + - Fixed an assertion failure caused by opening an attribute multiple times + through multiple file handles. (NAF - 2009/02/12) + - Fixed a problem that could prevent the user from adding attributes (or + any object header message) in some circumstances. (NAF - 2009/02/12) + - Fixed a bug that could cause problems when an attribute was added to a + committed datatype using the committed datatype's datatype. + (NAF - 2009/02/12) + - Fixed a bug that could cause problems when copying an object with a + shared message in its own object header. (NAF - 2009/01/29) - Changed H5Tset_order to properly reject H5T_ORDER_NONE for most datatypes. (NAF - 2009/01/27) - Fixed a bug where H5Tpack wouldn't remove trailing space from an diff --git a/src/H5A.c b/src/H5A.c index 0af4aaf..325f7be 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -440,7 +440,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, attr->shared->initialized = TRUE; /*for now, set to false later*/ /* Copy the object header information */ - if(H5O_loc_copy(&(attr->shared->oloc), loc->oloc, H5_COPY_DEEP) < 0) + if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5_COPY_DEEP) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry") /* Deep copy of the group hierarchy path */ @@ -450,9 +450,9 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, /* Check if any of the pieces should be (or are already) shared in the * SOHM table */ - if(H5SM_try_share(attr->shared->oloc.file, dxpl_id, NULL, H5O_DTYPE_ID, attr->shared->dt, NULL) < 0) + if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, H5O_DTYPE_ID, attr->shared->dt, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share datatype failed") - if(H5SM_try_share(attr->shared->oloc.file, dxpl_id, NULL, H5O_SDSPACE_ID, attr->shared->ds, NULL) < 0) + if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, H5O_SDSPACE_ID, attr->shared->ds, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share dataspace failed") /* Check whether datatype is committed & increment ref count @@ -469,8 +469,8 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, * datatype and dataspace messages themselves, or the size of the "shared" * messages if either or both of them are shared. */ - attr->shared->dt_size = H5O_msg_raw_size(attr->shared->oloc.file, H5O_DTYPE_ID, FALSE, attr->shared->dt); - attr->shared->ds_size = H5O_msg_raw_size(attr->shared->oloc.file, H5O_SDSPACE_ID, FALSE, attr->shared->ds); + attr->shared->dt_size = H5O_msg_raw_size(attr->oloc.file, H5O_DTYPE_ID, FALSE, attr->shared->dt); + attr->shared->ds_size = H5O_msg_raw_size(attr->oloc.file, H5O_SDSPACE_ID, FALSE, attr->shared->ds); /* Get # of elements for attribute's dataspace */ if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0) @@ -482,16 +482,16 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, attr->shared->data_size = nelmts * H5T_GET_SIZE(attr->shared->dt); /* Hold the symbol table entry (and file) open */ - if(H5O_open(&(attr->shared->oloc)) < 0) + if(H5O_open(&(attr->oloc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open") attr->obj_opened = TRUE; /* Set the version to encode the attribute with */ - if(H5A_set_version(attr->shared->oloc.file, attr) < 0) + if(H5A_set_version(attr->oloc.file, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "unable to update attribute version") /* Insert the attribute into the object header */ - if(H5O_attr_create(&(attr->shared->oloc), dxpl_id, attr) < 0) + if(H5O_attr_create(&(attr->oloc), dxpl_id, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create attribute in object header") /* Register the new attribute and get an ID for it */ @@ -737,7 +737,7 @@ H5A_open_common(const H5G_loc_t *loc, H5A_t *attr) #if defined(H5_USING_MEMCHECKER) || !defined(NDEBUG) /* Clear object location */ - if(H5O_loc_reset(&(attr->shared->oloc)) < 0) + if(H5O_loc_reset(&(attr->oloc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to reset location") #endif /* H5_USING_MEMCHECKER */ @@ -746,7 +746,7 @@ H5A_open_common(const H5G_loc_t *loc, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release group hier. path") /* Deep copy of the symbol table entry */ - if(H5O_loc_copy(&(attr->shared->oloc), loc->oloc, H5_COPY_DEEP) < 0) + if(H5O_loc_copy(&(attr->oloc), loc->oloc, H5_COPY_DEEP) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry") /* Deep copy of the group hier. path */ @@ -754,7 +754,7 @@ H5A_open_common(const H5G_loc_t *loc, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "unable to copy entry") /* Hold the symbol table entry (and file) open */ - if(H5O_open(&(attr->shared->oloc)) < 0) + if(H5O_open(&(attr->oloc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open") attr->obj_opened = TRUE; @@ -1032,7 +1032,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) } /* end else */ /* Modify the attribute in the object header */ - if(H5O_attr_write(&(attr->shared->oloc), dxpl_id, attr) < 0) + if(H5O_attr_write(&(attr->oloc), dxpl_id, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to modify attribute") } /* end if */ @@ -2432,7 +2432,7 @@ H5A_close(H5A_t *attr) HDassert(attr->shared); /* Close the object's symbol-table entry */ - if(attr->obj_opened && (H5O_close(&(attr->shared->oloc)) < 0)) + if(attr->obj_opened && (H5O_close(&(attr->oloc)) < 0)) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release object header info") /* Reference count can be 0. It only happens when H5A_create fails. */ @@ -2486,7 +2486,7 @@ H5A_oloc(H5A_t *attr) HDassert(attr); /* Set return value */ - ret_value = &(attr->shared->oloc); + ret_value = &(attr->oloc); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 07550da..da4ad86 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -168,7 +168,7 @@ H5A_dense_fh_name_cmp(const void *obj, size_t UNUSED obj_len, void *_udata) FUNC_ENTER_NOAPI_NOINIT(H5A_dense_fh_name_cmp) /* Decode attribute information */ - if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Compare the string values */ diff --git a/src/H5Adense.c b/src/H5Adense.c index 76ab95d..bc5ddfb 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -806,7 +806,7 @@ H5A_dense_copy_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail) */ - if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Set the creation order index for the attribute */ diff --git a/src/H5Aint.c b/src/H5Aint.c index a2cc6ec..c7013a2 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -680,8 +680,8 @@ done: * Purpose: Retrieves the "attribute info" message for an object. Also * sets the number of attributes correctly, if it isn't set up yet. * - * Return: Success: Ptr to message in native format. - * Failure: NULL + * Return: Success: TRUE/FALSE whether message was found & retrieved + * Failure: FAIL if error occurred * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -689,35 +689,40 @@ done: * *------------------------------------------------------------------------- */ -H5O_ainfo_t * +htri_t H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) { - H5O_ainfo_t *ret_value; /* Return value */ + htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5A_get_ainfo, NULL) + FUNC_ENTER_NOAPI(H5A_get_ainfo, FAIL) /* check arguments */ HDassert(f); HDassert(oh); + HDassert(ainfo); + + /* Check if the "attribute info" message exists */ + if((ret_value = H5O_msg_exists_oh(oh, H5O_AINFO_ID)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "unable to check object header") + if(ret_value > 0) { + /* Retrieve the "attribute info" structure */ + if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_AINFO_ID, ainfo)) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't read AINFO message") - /* Retrieve the "attribute info" structure */ - if((ret_value = (H5O_ainfo_t *)H5O_msg_read_oh(f, dxpl_id, oh, H5O_AINFO_ID, ainfo))) { /* Check if we don't know how many attributes there are */ - if(ret_value->nattrs == HSIZET_MAX) { + if(ainfo->nattrs == HSIZET_MAX) { /* Check if we are using "dense" attribute storage */ - if(H5F_addr_defined(ret_value->fheap_addr)) { + if(H5F_addr_defined(ainfo->fheap_addr)) { /* Retrieve # of records in "name" B-tree */ /* (should be same # of records in all indices) */ - if(H5B2_get_nrec(f, dxpl_id, H5A_BT2_NAME, ret_value->name_bt2_addr, &ret_value->nattrs) < 0) + if(H5B2_get_nrec(f, dxpl_id, H5A_BT2_NAME, ainfo->name_bt2_addr, &ainfo->nattrs) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't retrieve # of records in index") } /* end if */ else /* Retrieve # of attributes from object header */ - ret_value->nattrs = oh->attr_msgs_seen; + ainfo->nattrs = oh->attr_msgs_seen; } /* end if */ } /* end if */ - else - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "attribute info message not present") done: FUNC_LEAVE_NOAPI(ret_value) @@ -829,7 +834,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate shared attr structure") /* Don't have an opened group location for copy */ - H5O_loc_reset(&(attr_dst->shared->oloc)); + H5O_loc_reset(&(attr_dst->oloc)); H5G_name_reset(&(attr_dst->path)); attr_dst->obj_opened = FALSE; diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 9027864..b166b06 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -76,7 +76,6 @@ typedef struct H5A_shared_t { unsigned version; /* Version to encode attribute with */ hbool_t initialized;/* Indicate whether the attribute has been modified */ - H5O_loc_t oloc; /* Object location for object attribute is on */ char *name; /* Attribute's name */ H5T_cset_t encoding; /* Character encoding of attribute name */ @@ -96,6 +95,7 @@ typedef struct H5A_shared_t { /* Define the main attribute structure */ struct H5A_t { H5O_shared_t sh_loc; /* Shared message info (must be first) */ + H5O_loc_t oloc; /* Object location for object attribute is on */ hbool_t obj_opened; /* Object header entry opened? */ H5G_name_t path; /* Group hierarchy path */ H5A_shared_t *shared; /* Shared attribute information */ @@ -218,8 +218,7 @@ H5_DLL H5A_t *H5A_copy(H5A_t *new_attr, const H5A_t *old_attr); H5_DLL herr_t H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo); H5_DLL herr_t H5A_free(H5A_t *attr); H5_DLL herr_t H5A_close(H5A_t *attr); -H5_DLL H5O_ainfo_t *H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5O_ainfo_t *ainfo); +H5_DLL htri_t H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo); H5_DLL herr_t H5A_set_version(const H5F_t *f, H5A_t *attr); /* Attribute "dense" storage routines */ diff --git a/src/H5Atest.c b/src/H5Atest.c index de03a25..df88472 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -139,7 +139,7 @@ H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); /* Retrieve ref count for shared or shareable attribute */ - if(H5SM_get_refcount(attr->shared->oloc.file, H5AC_ind_dxpl_id, H5O_ATTR_ID, + if(H5SM_get_refcount(attr->oloc.file, H5AC_ind_dxpl_id, H5O_ATTR_ID, &attr->sh_loc, ref_count) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") diff --git a/src/H5D.c b/src/H5D.c index 9c552c2..4dad2aa 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -712,7 +712,7 @@ H5Dget_access_plist(hid_t dset_id) if (dset->shared->layout.type == H5D_CHUNKED) { if (H5P_set(new_plist, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, &(dset->shared->cache.chunk.nslots)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data cache number of slots") - if (H5P_set(new_plist, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, &(dset->shared->cache.chunk.nbytes)) < 0) + if (H5P_set(new_plist, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, &(dset->shared->cache.chunk.nbytes_max)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data cache byte size") if (H5P_set(new_plist, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, &(dset->shared->cache.chunk.w0)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set preempt read chunks") diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 8318af1..a99998f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -194,14 +194,17 @@ static herr_t H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *typ H5D_chunk_map_t *fm); static herr_t H5D_chunk_io_term(const H5D_chunk_map_t *fm); -/* "Null" layout operation callbacks */ -static ssize_t H5D_null_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], +/* "Nonexistent" layout operation callback */ +static ssize_t +H5D_nonexistent_readvv(const H5D_io_info_t *io_info, + size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); /* Helper routines */ static void *H5D_chunk_alloc(size_t size, const H5O_pline_t *pline); static void *H5D_chunk_xfree(void *chk, const H5O_pline_t *pline); +static herr_t H5D_chunk_cinfo_cache_update(H5D_chunk_cached_t *last, + const H5D_chunk_ud_t *udata); static herr_t H5D_free_chunk_info(void *item, void *key, void *opdata); static herr_t H5D_create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info); @@ -240,8 +243,8 @@ const H5D_layout_ops_t H5D_LOPS_CHUNK[1] = {{ /* Local Variables */ /*******************/ -/* "null" storage layout I/O ops */ -const H5D_layout_ops_t H5D_LOPS_NULL[1] = {{ +/* "nonexistent" storage layout I/O ops */ +const H5D_layout_ops_t H5D_LOPS_NONEXISTENT[1] = {{ NULL, NULL, NULL, @@ -251,7 +254,7 @@ const H5D_layout_ops_t H5D_LOPS_NULL[1] = {{ NULL, NULL, #endif /* H5_HAVE_PARALLEL */ - H5D_null_readvv, + H5D_nonexistent_readvv, NULL, NULL }}; @@ -1373,7 +1376,7 @@ done: *------------------------------------------------------------------------- */ hbool_t -H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr) +H5D_chunk_cacheable(const H5D_io_info_t *io_info) { const H5D_t *dataset = io_info->dset; hbool_t ret_value; @@ -1402,8 +1405,7 @@ H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr) * cache, just write the data to it directly. */ H5_CHECK_OVERFLOW(dataset->shared->layout.u.chunk.size, uint32_t, size_t); - if((size_t)dataset->shared->layout.u.chunk.size > dataset->shared->cache.chunk.nbytes - && H5F_addr_defined(caddr)) + if((size_t)dataset->shared->layout.u.chunk.size > dataset->shared->cache.chunk.nbytes_max) ret_value = FALSE; else ret_value = TRUE; @@ -1481,7 +1483,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm) { H5SL_node_t *chunk_node; /* Current node in chunk skip list */ - H5D_io_info_t nul_io_info; /* "null" I/O info object */ + H5D_io_info_t nonexistent_io_info; /* "nonexistent" I/O info object */ H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ H5D_io_info_t cpt_io_info; /* Compact I/O info object */ @@ -1500,9 +1502,9 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HDassert(type_info); HDassert(fm); - /* Set up "null" I/O info object */ - HDmemcpy(&nul_io_info, io_info, sizeof(nul_io_info)); - nul_io_info.layout_ops = *H5D_LOPS_NULL; + /* Set up "nonexistent" I/O info object */ + HDmemcpy(&nonexistent_io_info, io_info, sizeof(nonexistent_io_info)); + nonexistent_io_info.layout_ops = *H5D_LOPS_NONEXISTENT; /* Set up contiguous I/O info object */ HDmemcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); @@ -1552,17 +1554,10 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Check for non-existant chunk & skip it if appropriate */ - if(!H5F_addr_defined(udata.addr) && !H5D_chunk_in_cache(io_info->dset, chunk_info->coords, chunk_info->index) - && skip_missing_chunks) { - /* No chunk cached */ - chunk = NULL; - - /* Point I/O info at "null" I/O info for this chunk */ - chk_io_info = &nul_io_info; - } /* end if */ - else { + if(H5F_addr_defined(udata.addr) || H5D_chunk_in_cache(io_info->dset, chunk_info->coords, chunk_info->index) + || !skip_missing_chunks) { /* Load the chunk into cache and lock it. */ - if(H5D_chunk_cacheable(io_info, udata.addr)) { + if(H5D_chunk_cacheable(io_info)) { /* Pass in chunk's coordinates in a union. */ io_info->store->chunk.offset = chunk_info->coords; io_info->store->chunk.index = chunk_info->index; @@ -1580,10 +1575,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Point I/O info at contiguous I/O info for this chunk */ chk_io_info = &cpt_io_info; } /* end if */ - else { - /* Sanity check */ - HDassert(H5F_addr_defined(udata.addr)); - + else if(H5F_addr_defined(udata.addr)) { /* Set up the storage address information for this chunk */ ctg_store.contig.dset_addr = udata.addr; @@ -1592,17 +1584,24 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Point I/O info at temporary I/O info for this chunk */ chk_io_info = &ctg_io_info; + } /* end else if */ + else { + /* No chunk cached */ + chunk = NULL; + + /* Point I/O info at "nonexistent" I/O info for this chunk */ + chk_io_info = &nonexistent_io_info; } /* end else */ - } /* end else */ - /* Perform the actual read operation */ - if((io_info->io_ops.single_read)(chk_io_info, type_info, - (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed") + /* Perform the actual read operation */ + if((io_info->io_ops.single_read)(chk_io_info, type_info, + (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed") - /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, FALSE, idx_hint, chunk, src_accessed_bytes) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") + /* Release the cache lock on the chunk. */ + if(chunk && H5D_chunk_unlock(io_info, FALSE, idx_hint, chunk, src_accessed_bytes) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") + } /* end if */ /* Advance to next chunk in list */ chunk_node = H5D_CHUNK_GET_NEXT_NODE(fm, chunk_node); @@ -1623,6 +1622,12 @@ done: * Programmer: Raymond Lu * Thursday, April 10, 2003 * + * Modification:Raymond Lu + * 4 Feb 2009 + * One case that was considered cacheable was when the chunk + * was bigger than the cache size but not allocated on disk. + * I moved it to uncacheable branch to bypass the cache to + * improve performance. *------------------------------------------------------------------------- */ static herr_t @@ -1679,7 +1684,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, * simply allocate space instead of load the chunk. */ if(H5D_chunk_get_info(io_info->dset, io_info->dxpl_id, chunk_info->coords, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - if(H5D_chunk_cacheable(io_info, udata.addr)) { + if(H5D_chunk_cacheable(io_info)) { hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ /* Pass in chunk's coordinates in a union. */ @@ -1705,8 +1710,30 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chk_io_info = &cpt_io_info; } /* end if */ else { - /* Sanity check */ - HDassert(H5F_addr_defined(udata.addr)); + /* If the chunk hasn't been allocated on disk, do so now. */ + if(!H5F_addr_defined(udata.addr)) { + H5D_chk_idx_info_t idx_info; /* Chunked index info */ + + /* Compose chunked index info struct */ + idx_info.f = io_info->dset->oloc.file; + idx_info.dxpl_id = io_info->dxpl_id; + idx_info.pline = &(io_info->dset->shared->dcpl_cache.pline); + idx_info.layout = &(io_info->dset->shared->layout); + + /* Set up the size of chunk for user data */ + udata.nbytes = io_info->dset->shared->layout.u.chunk.size; + + /* Create the chunk */ + if((io_info->dset->shared->layout.u.chunk.ops->insert)(&idx_info, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk") + + /* Make sure the address of the chunk is returned. */ + if(!H5F_addr_defined(udata.addr)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined") + + /* Cache the new chunk information */ + H5D_chunk_cinfo_cache_update(&io_info->dset->shared->cache.chunk.last, &udata); + } /* end if */ /* Set up the storage address information for this chunk */ ctg_store.contig.dset_addr = udata.addr; @@ -1827,19 +1854,19 @@ H5D_chunk_init(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, const H5D_t *dset) if(rdcc->nslots == H5D_CHUNK_CACHE_NSLOTS_DEFAULT) rdcc->nslots = H5F_RDCC_NSLOTS(f); - if(H5P_get(dapl, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, &rdcc->nbytes) < 0) + if(H5P_get(dapl, H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME, &rdcc->nbytes_max) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get data cache byte size"); - if(rdcc->nbytes == H5D_CHUNK_CACHE_NBYTES_DEFAULT) - rdcc->nbytes = H5F_RDCC_NBYTES(f); + if(rdcc->nbytes_max == H5D_CHUNK_CACHE_NBYTES_DEFAULT) + rdcc->nbytes_max = H5F_RDCC_NBYTES(f); if(H5P_get(dapl, H5D_ACS_PREEMPT_READ_CHUNKS_NAME, &rdcc->w0) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get preempt read chunks"); if(rdcc->w0 < 0) rdcc->w0 = H5F_RDCC_W0(f); - /* If nbytes or nslots is 0, set them both to 0 and avoid allocating space */ - if(!rdcc->nbytes || !rdcc->nslots) - rdcc->nbytes = rdcc->nslots = 0; + /* If nbytes_max or nslots is 0, set them both to 0 and avoid allocating space */ + if(!rdcc->nbytes_max || !rdcc->nslots) + rdcc->nbytes_max = rdcc->nslots = 0; else { rdcc->slot = H5FL_SEQ_CALLOC(H5D_rdcc_ent_ptr_t, rdcc->nslots); if(NULL == rdcc->slot) @@ -2338,7 +2365,7 @@ H5D_chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * /* Remove from cache */ rdcc->slot[ent->idx] = NULL; ent->idx = UINT_MAX; - rdcc->nbytes -= ent->chunk_size; + rdcc->nbytes_used -= ent->chunk_size; --rdcc->nused; /* Free */ @@ -2368,7 +2395,7 @@ H5D_chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, size_t size) { const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - size_t total = rdcc->nbytes; + size_t total = rdcc->nbytes_max; const int nmeth = 2; /*number of methods */ int w[1]; /*weighting as an interval */ H5D_rdcc_ent_t *p[2], *cur; /*list pointers */ @@ -2392,7 +2419,7 @@ H5D_chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, p[0] = rdcc->head; p[1] = NULL; - while((p[0] || p[1]) && (rdcc->nbytes + size) > total) { + while((p[0] || p[1]) && (rdcc->nbytes_used + size) > total) { int i; /* Local index variable */ /* Introduce new pointers */ @@ -2405,7 +2432,7 @@ H5D_chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, n[i] = p[i] ? p[i]->next : NULL; /* Give each method a chance */ - for(i = 0; i < nmeth && (rdcc->nbytes + size) > total; i++) { + for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) { if(0 == i && p[0] && !p[0]->locked && ((0 == p[0]->rd_count && 0 == p[0]->wr_count) || (0 == p[0]->rd_count && p[0]->chunk_size == p[0]->wr_count) || @@ -2625,7 +2652,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, } /* end else */ HDassert(found || chunk_size > 0); - if(!found && rdcc->nslots > 0 && chunk_size <= rdcc->nbytes && + if(!found && rdcc->nslots > 0 && chunk_size <= rdcc->nbytes_max && (!ent || !ent->locked)) { /* * Add the chunk to the cache only if the slot is not already locked. @@ -2655,7 +2682,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, HDassert(NULL == rdcc->slot[idx]); rdcc->slot[idx] = ent; ent->idx = idx; - rdcc->nbytes += chunk_size; + rdcc->nbytes_used += chunk_size; rdcc->nused++; /* Add it to the linked list */ @@ -4625,28 +4652,38 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_null_readvv + * Function: H5D_nonexistent_readvv + * + * Purpose: When the chunk doesn't exist on disk and the chunk is bigger + * than the cache size, performs fill value I/O operation on + * memory buffer, advancing through two I/O vectors, until one + * runs out. * - * Purpose: Performs "no-op" I/O operation, advancing through two I/O - * vectors, until one runs out. + * Note: This algorithm is pretty inefficient about initializing and + * terminating the fill buffer info structure and it would be + * faster to refactor this into a "real" initialization routine, + * and a "vectorized fill" routine. -QAK * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Tuesday, April 1, 2008 + * Programmer: Raymond Lu + * 6 Feb 2009 * *------------------------------------------------------------------------- */ static ssize_t -H5D_null_readvv(const H5D_io_info_t UNUSED *io_info, +H5D_nonexistent_readvv(const H5D_io_info_t *io_info, size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) { - size_t u, v; /* Local index variables */ - size_t size; /* Size of sequence in bytes */ - ssize_t bytes_processed = 0; /* Eventual return value */ + H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ + H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ + hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ + ssize_t bytes_processed = 0; /* Eventual return value */ + size_t u, v; /* Local index variables */ + ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_null_readvv) + FUNC_ENTER_NOAPI_NOINIT(H5D_nonexistent_readvv) /* Check args */ HDassert(chunk_len_arr); @@ -4656,12 +4693,35 @@ H5D_null_readvv(const H5D_io_info_t UNUSED *io_info, /* Work through all the sequences */ for(u = *mem_curr_seq, v = *chunk_curr_seq; u < mem_max_nseq && v < chunk_max_nseq; ) { + unsigned char *buf; /* Temporary pointer into read buffer */ + size_t size; /* Size of sequence in bytes */ + /* Choose smallest buffer to write */ if(chunk_len_arr[v] < mem_len_arr[u]) size = chunk_len_arr[v]; else size = mem_len_arr[u]; + /* Compute offset in memory */ + buf = (unsigned char *)io_info->u.rbuf + mem_offset_arr[v]; + + /* Initialize the fill value buffer */ + if(H5D_fill_init(&fb_info, buf, FALSE, + NULL, NULL, NULL, NULL, + &dset->shared->dcpl_cache.fill, dset->shared->type, + dset->shared->type_id, (size_t)0, size, io_info->dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") + fb_info_init = TRUE; + + /* Check for VL datatype & fill the buffer with VL datatype fill values */ + if(fb_info.has_vlen_fill_type && H5D_fill_refill_vl(&fb_info, fb_info.elmts_per_buf, io_info->dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") + + /* Release the fill buffer info */ + if(H5D_fill_term(&fb_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") + fb_info_init = FALSE; + /* Update source information */ chunk_len_arr[v] -= size; chunk_offset_arr[v] += size; @@ -4682,6 +4742,14 @@ H5D_null_readvv(const H5D_io_info_t UNUSED *io_info, *mem_curr_seq = u; *chunk_curr_seq = v; - FUNC_LEAVE_NOAPI(bytes_processed) -} /* H5D_null_readvv() */ + /* Set return value */ + ret_value = bytes_processed; + +done: + /* Release the fill buffer info, if it's been initialized */ + if(fb_info_init && H5D_fill_term(&fb_info) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_nonexistent_readvv() */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 03e3434..5ba1c5f 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -404,7 +404,7 @@ H5D_earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, HDassert(elmt); /* Print element */ - sprintf(temp_str, "Element #%llu:", (unsigned long_long)idx); + sprintf(temp_str, "Element #%llu:", (unsigned long long)idx); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, temp_str, *(const haddr_t *)elmt); @@ -563,7 +563,7 @@ H5D_earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, HDassert(elmt); /* Print element */ - sprintf(temp_str, "Element #%llu:", (unsigned long_long)idx); + sprintf(temp_str, "Element #%llu:", (unsigned long long)idx); HDfprintf(stream, "%*s%-*s {%a, %u, %0x}\n", indent, "", fwidth, temp_str, elmt->addr, elmt->nbytes, elmt->filter_mask); diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 99ad001..19be413 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1224,7 +1224,7 @@ if(H5DEBUG(D)) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") /* Load the chunk into cache and lock it. */ - if(H5D_chunk_cacheable(io_info, udata.addr)) { + if(H5D_chunk_cacheable(io_info)) { hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ /* Compute # of bytes accessed in chunk */ @@ -1449,7 +1449,7 @@ if(H5DEBUG(D)) { HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") /* Load the chunk into cache and lock it. */ - if(H5D_chunk_cacheable(io_info, udata.addr)) { + if(H5D_chunk_cacheable(io_info)) { hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ /* Compute # of bytes accessed in chunk */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 5cef2fe..4d5bd45 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -366,11 +366,12 @@ typedef struct H5D_rdcc_t { unsigned nmisses;/* Number of cache misses */ unsigned nflushes;/* Number of cache flushes */ } stats; - size_t nbytes; /* Current cached raw data in bytes */ + size_t nbytes_max; /* Maximum cached raw data in bytes */ size_t nslots; /* Number of chunk slots allocated */ double w0; /* Chunk preemption policy */ struct H5D_rdcc_ent_t *head; /* Head of doubly linked list */ struct H5D_rdcc_ent_t *tail; /* Tail of doubly linked list */ + size_t nbytes_used; /* Current cached raw data in bytes */ int nused; /* Number of chunk slots in use */ H5D_chunk_cached_t last; /* Cached copy of last chunk information */ struct H5D_rdcc_ent_t **slot; /* Chunk slots, each points to a chunk*/ @@ -573,7 +574,7 @@ H5_DLL herr_t H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_ H5O_layout_t *layout_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); /* Functions that operate on chunked dataset storage */ -H5_DLL hbool_t H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr); +H5_DLL hbool_t H5D_chunk_cacheable(const H5D_io_info_t *io_info); H5_DLL herr_t H5D_chunk_cinfo_cache_reset(H5D_chunk_cached_t *last); H5_DLL herr_t H5D_chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id); H5_DLL herr_t H5D_chunk_init(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, const H5D_t *dset); @@ -670,6 +671,7 @@ H5_DLL htri_t H5D_mpio_opt_possible(const H5D_io_info_t *io_info, H5_DLL herr_t H5D_layout_version_test(hid_t did, unsigned *version); H5_DLL herr_t H5D_layout_contig_size_test(hid_t did, hsize_t *size); H5_DLL herr_t H5D_layout_idx_type_test(hid_t did, H5D_chunk_index_t *idx_type); +H5_DLL herr_t H5D_current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused); #endif /* H5D_TESTING */ #endif /*_H5Dpkg_H*/ diff --git a/src/H5Dtest.c b/src/H5Dtest.c index b71ba30..34ea99f 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -176,3 +176,49 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_layout_idx_type_test() */ + +/*-------------------------------------------------------------------------- + NAME + H5D_current_cache_size_test + PURPOSE + Determine current the size of the dataset's chunk cache + USAGE + herr_t H5D_layout_contig_size_test(did, size) + hid_t did; IN: Dataset to query + hsize_t *size; OUT: Pointer to location to place size info + RETURNS + Non-negative on success, negative on failure + DESCRIPTION + Checks the size of a contiguous dataset's storage. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5D_current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused) +{ + H5D_t *dset; /* Pointer to dataset to query */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_NOAPI(H5D_current_cache_size_test, FAIL) + + /* Check args */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + + if(nbytes_used) { + HDassert(dset->shared->layout.type == H5D_CHUNKED); + *nbytes_used = dset->shared->cache.chunk.nbytes_used; + } /* end if */ + + if(nused) { + HDassert(dset->shared->layout.type == H5D_CHUNKED); + *nused = dset->shared->cache.chunk.nused; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_current_cache_size_test() */ + diff --git a/src/H5EA.c b/src/H5EA.c index 86c54fd..f1ed71b 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -199,7 +199,7 @@ H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, const H5EA_class_t *cls)) HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr); #endif /* QAK */ if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, cls, NULL, H5AC_READ))) - H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header, address = %llu", (unsigned long_long)ea_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header, address = %llu", (unsigned long long)ea_addr) /* Check for pending array deletion */ if(hdr->pending_delete) @@ -365,7 +365,7 @@ HDfprintf(stderr, "%s: Index block address is: %a\n", FUNC, hdr->idx_blk_addr); /* Protect index block */ if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC_WRITE))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long_long)hdr->idx_blk_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Check if element is in index block */ if(idx < hdr->cparam.idx_blk_elmts) { @@ -420,7 +420,7 @@ HDfprintf(stderr, "%s: dblk_idx = %u, iblock->ndblk_addrs = %Zu\n", FUNC, dblk_i /* Protect data block */ if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, iblock->dblk_addrs[dblk_idx], hdr->sblk_info[sblk_idx].dblk_nelmts, H5AC_WRITE))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long_long)iblock->dblk_addrs[dblk_idx]) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)iblock->dblk_addrs[dblk_idx]) /* Adjust index to offset in data block */ elmt_idx %= hdr->sblk_info[sblk_idx].dblk_nelmts; @@ -455,7 +455,7 @@ HDfprintf(stderr, "%s: New super block address is: %a\n", FUNC, sblk_addr); /* Protect super block */ if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, iblock->sblk_addrs[sblk_off], sblk_idx, H5AC_WRITE))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long_long)iblock->sblk_addrs[sblk_off]) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)iblock->sblk_addrs[sblk_off]) /* Compute the data block index in super block */ dblk_idx = (size_t)(elmt_idx / sblock->dblk_nelmts); @@ -532,7 +532,7 @@ HDfprintf(stderr, "%s: sblock->dblk_page_size = %Zu\n", FUNC, sblock->dblk_page_ /* Protect data block page */ if(NULL == (dblk_page = H5EA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, H5AC_WRITE))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long_long)dblk_page_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Set pointer to elements */ elmts = dblk_page->elmts; @@ -540,7 +540,7 @@ HDfprintf(stderr, "%s: sblock->dblk_page_size = %Zu\n", FUNC, sblock->dblk_page_ else { /* Protect data block */ if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, sblock->dblk_addrs[dblk_idx], sblock->dblk_nelmts, H5AC_WRITE))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long_long)sblock->dblk_addrs[dblk_idx]) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)sblock->dblk_addrs[dblk_idx]) /* Set pointer to elements */ elmts = dblock->elmts; @@ -639,7 +639,7 @@ HDfprintf(stderr, "%s: Index block address is: %a\n", FUNC, hdr->idx_blk_addr); /* Protect index block */ if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC_READ))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long_long)hdr->idx_blk_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Check if element is in index block */ if(idx < hdr->cparam.idx_blk_elmts) { @@ -681,7 +681,7 @@ HDfprintf(stderr, "%s: dblk_idx = %u\n", FUNC, dblk_idx); else { /* Protect data block */ if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, iblock->dblk_addrs[dblk_idx], hdr->sblk_info[sblk_idx].dblk_nelmts, H5AC_READ))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long_long)iblock->dblk_addrs[dblk_idx]) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)iblock->dblk_addrs[dblk_idx]) /* Adjust index to offset in data block */ elmt_idx %= hdr->sblk_info[sblk_idx].dblk_nelmts; @@ -705,7 +705,7 @@ HDfprintf(stderr, "%s: dblk_idx = %u\n", FUNC, dblk_idx); else { /* Protect super block */ if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, iblock->sblk_addrs[sblk_off], sblk_idx, H5AC_READ))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long_long)iblock->sblk_addrs[sblk_off]) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)iblock->sblk_addrs[sblk_off]) /* Compute the data block index in super block */ dblk_idx = (size_t)(elmt_idx / sblock->dblk_nelmts); @@ -779,7 +779,7 @@ HDfprintf(stderr, "%s: elmt_idx = %Hu, dblk_page_addr = %a\n", FUNC, elmt_idx, d /* Protect data block page */ if(NULL == (dblk_page = H5EA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, H5AC_READ))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long_long)dblk_page_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Set pointer to elements */ elmts = dblk_page->elmts; @@ -788,7 +788,7 @@ HDfprintf(stderr, "%s: elmt_idx = %Hu, dblk_page_addr = %a\n", FUNC, elmt_idx, d else { /* Protect data block */ if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, sblock->dblk_addrs[dblk_idx], sblock->dblk_nelmts, H5AC_READ))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long_long)sblock->dblk_addrs[dblk_idx]) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)sblock->dblk_addrs[dblk_idx]) /* Set pointer to elements */ elmts = dblock->elmts; @@ -924,7 +924,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr)) HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr); #endif /* QAK */ if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, NULL, NULL, H5AC_WRITE))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long_long)ea_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr) /* Check for files using shared array header */ if(hdr->file_rc) diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index 0cafe3d..2c903b2 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -208,7 +208,7 @@ H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde /* Protect index block */ if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC_READ))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long_long)hdr->idx_blk_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Print opening message */ HDfprintf(stream, "%*sExtensible Array Index Block...\n", indent, ""); @@ -321,7 +321,7 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde /* Protect super block */ if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, addr, sblk_idx, H5AC_READ))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long_long)addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)addr) /* Print opening message */ HDfprintf(stream, "%*sExtensible Array Super Block...\n", indent, ""); @@ -405,7 +405,7 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde /* Protect data block */ if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, addr, dblk_nelmts, H5AC_READ))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long_long)addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)addr) /* Print opening message */ HDfprintf(stream, "%*sExtensible Array data Block...\n", indent, ""); diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 4b9cc9d..a8edae1 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -223,7 +223,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Protect the data block page */ if(NULL == (ret_value = (H5EA_dblk_page_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, NULL, hdr, rw))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long_long)dblk_page_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long long)dblk_page_addr) CATCH @@ -260,7 +260,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Unprotect the data block page */ if(H5AC_unprotect(dblk_page->hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block page, address = %llu", (unsigned long_long)dblk_page->addr) + H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block page, address = %llu", (unsigned long long)dblk_page->addr) CATCH diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index aec5af2..af2828a 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -317,7 +317,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Protect the data block */ if(NULL == (ret_value = (H5EA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblk_addr, &dblk_nelmts, hdr, rw))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long_long)dblk_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)dblk_addr) CATCH @@ -352,7 +352,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Unprotect the data block */ if(H5AC_unprotect(dblock->hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block, address = %llu", (unsigned long_long)dblock->addr) + H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block, address = %llu", (unsigned long long)dblock->addr) CATCH @@ -391,7 +391,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Protect data block */ if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, dblk_addr, dblk_nelmts, H5AC_WRITE))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long_long)dblk_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)dblk_addr) /* Check if this is a paged data block */ if(dblk_nelmts > hdr->dblk_page_nelmts) { diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index 6fd6f2a..2d93015 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -292,7 +292,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Protect the index block */ if(NULL == (ret_value = (H5EA_iblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, hdr->idx_blk_addr, NULL, hdr, rw))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long_long)hdr->idx_blk_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) CATCH @@ -327,7 +327,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Unprotect the index block */ if(H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, cache_flags) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array index block, address = %llu", (unsigned long_long)iblock->addr) + H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array index block, address = %llu", (unsigned long long)iblock->addr) CATCH @@ -364,7 +364,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Protect index block */ if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC_WRITE))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long_long)hdr->idx_blk_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Check for index block having data block pointers */ if(iblock->ndblk_addrs > 0) { diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index 4ad83b0..3cb97a9 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -289,7 +289,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Protect the super block */ if(NULL == (ret_value = (H5EA_sblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblk_addr, &sblk_idx, hdr, rw))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long_long)sblk_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)sblk_addr) CATCH @@ -324,7 +324,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Unprotect the super block */ if(H5AC_unprotect(sblock->hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, cache_flags) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array super block, address = %llu", (unsigned long_long)sblock->addr) + H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array super block, address = %llu", (unsigned long long)sblock->addr) CATCH @@ -363,7 +363,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Protect super block */ if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, sblk_addr, sblk_idx, H5AC_WRITE))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long_long)sblk_addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)sblk_addr) /* Iterate over data blocks */ for(u = 0; u < sblock->ndblks; u++) { diff --git a/src/H5EAtest.c b/src/H5EAtest.c index de63d11..5337aea 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -322,9 +322,9 @@ H5EA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, HDassert(elmt); /* Print element */ - sprintf(temp_str, "Element #%llu:", (unsigned long_long)idx); + sprintf(temp_str, "Element #%llu:", (unsigned long long)idx); HDfprintf(stream, "%*s%-*s %llu\n", indent, "", fwidth, temp_str, - (unsigned long_long)*(const uint64_t *)elmt); + (unsigned long long)*(const uint64_t *)elmt); END_FUNC(STATIC) /* end H5EA__test_debug() */ diff --git a/src/H5F.c b/src/H5F.c index 14efa63..7b9ce79 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -428,7 +428,7 @@ H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_obj_count) /* H5F_get_objects doesn't fail */ - ret_value=H5F_get_objects(f, types, 0, NULL, app_ref); + ret_value = H5F_get_objects(f, types, 0, NULL, app_ref); FUNC_LEAVE_NOAPI(ret_value) } @@ -518,8 +518,6 @@ H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 * - * Modification: - * *--------------------------------------------------------------------------- */ static size_t @@ -587,7 +585,7 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_ ret_value = obj_id_count; FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5F_get_objects() */ /*------------------------------------------------------------------------- diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 2be54f8..e0421a7 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -1945,9 +1945,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) if (HADDR_UNDEF!=file->memb_addr[mt]) { haddr_t eoa = H5FDget_eoa(file->memb[mt], mt); fprintf(stderr, " %6d %20llu %20llu %20llu %s\n", - (int)mt, (unsigned long_long)(file->memb_addr[mt]), - (unsigned long_long)eoa, - (unsigned long_long)(file->memb_next[mt]), + (int)mt, (unsigned long long)(file->memb_addr[mt]), + (unsigned long long)eoa, + (unsigned long long)(file->memb_next[mt]), file->memb_name[mt]); } } diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index d060a11..c16fc16 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -164,7 +164,7 @@ H5G_dense_fh_name_cmp(const void *obj, size_t UNUSED obj_len, void *_udata) FUNC_ENTER_NOAPI_NOINIT(H5G_dense_fh_name_cmp) /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Compare the string values */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 6c3a171..2bca4fa 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -566,7 +566,7 @@ H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t UNUSED obj_len, void *_uda FUNC_ENTER_NOAPI_NOINIT(H5G_dense_lookup_by_idx_fh_cb) /* Decode link information & keep a copy */ - if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Copy link information */ @@ -852,7 +852,7 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail - QAK) */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") done: @@ -1047,7 +1047,7 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t UNUSED obj_len, void *_u FUNC_ENTER_NOAPI_NOINIT(H5G_dense_get_name_by_idx_fh_cb) /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Get the length of the name */ @@ -1245,7 +1245,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) FUNC_ENTER_NOAPI_NOINIT(H5G_dense_remove_fh_cb) /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Check for removing the link from the creation order index */ @@ -1408,7 +1408,7 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t UNUSED obj_len, void *_uda FUNC_ENTER_NOAPI_NOINIT(H5G_dense_remove_by_idx_fh_cb) /* Decode link information */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, H5_ITER_ERROR, "can't decode link") /* Can't operate on link here because the fractal heap block is locked */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index a6b2d7f..3220b67 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -317,8 +317,8 @@ H5G_obj_ent_encode(const H5F_t *f, uint8_t **pp, const H5O_loc_t *oloc) * Purpose: Retrieves the "link info" message for an object. Also * sets the number of links correctly, if it isn't set up yet. * - * Return: Success: Ptr to message in native format. - * Failure: NULL + * Return: Success: TRUE/FALSE whether message was found & retrieved + * Failure: FAIL if error occurred * * Programmer: Quincey Koziol * koziol@hdfgroup.org diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 847c54e..8ab35cb 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -387,7 +387,7 @@ HDfprintf(stderr, "%s: Load heap header, addr = %a\n", FUNC, addr); UINT32DECODE(p, hdr->pline_root_direct_filter_mask); /* Decode I/O filter information */ - if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, dxpl_id, H5O_PLINE_ID, p))) + if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, dxpl_id, NULL, H5O_PLINE_ID, p))) HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, NULL, "can't decode I/O pipeline filters") p += hdr->filter_len; diff --git a/src/H5O.c b/src/H5O.c index 73c8e73..9b9d0ef 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -1393,9 +1393,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_link + * Function: H5O_link_oh * - * Purpose: Adjust the link count for an object header by adding + * Purpose: Adjust the link count for an open object header by adding * ADJUST to the link count. * * Return: Success: New link count @@ -1409,24 +1409,12 @@ done: *------------------------------------------------------------------------- */ int -H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) +H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags) { - H5O_t *oh = NULL; - H5AC_protect_t oh_acc; /* Access mode for protecting object header */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Whether the object was deleted */ + haddr_t addr = H5O_OH_GET_ADDR(oh); /* Object header address */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_link, FAIL) - - /* check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5F_addr_defined(loc->addr)); - - /* get header */ - oh_acc = adjust ? H5AC_WRITE : H5AC_READ; - if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, NULL, NULL, oh_acc))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") + FUNC_ENTER_NOAPI(H5O_link_oh, FAIL) /* Check for adjusting link count */ if(adjust) { @@ -1435,38 +1423,38 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) if((unsigned)(-adjust) > oh->nlink) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "link count would be negative") oh->nlink += adjust; - oh_flags |= H5AC__DIRTIED_FLAG; + *oh_flags |= H5AC__DIRTIED_FLAG; /* Check if the object should be deleted */ if(oh->nlink == 0) { /* Check if the object is still open by the user */ - if(H5FO_opened(loc->file, loc->addr) != NULL) { + if(H5FO_opened(f, addr) != NULL) { /* Flag the object to be deleted when it's closed */ - if(H5FO_mark(loc->file, loc->addr, TRUE) < 0) + if(H5FO_mark(f, addr, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't mark object for deletion") } /* end if */ else { /* Delete object right now */ - if(H5O_delete_oh(loc->file, dxpl_id, oh) < 0) + if(H5O_delete_oh(f, dxpl_id, oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") /* Mark the object header as deleted */ - oh_flags = H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; + *oh_flags = H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; } /* end else */ } /* end if */ } else { /* A new object, or one that will be deleted */ if(oh->nlink == 0) { /* Check if the object is current open, but marked for deletion */ - if(H5FO_marked(loc->file, loc->addr) > 0) { + if(H5FO_marked(f, addr) > 0) { /* Remove "delete me" flag on the object */ - if(H5FO_mark(loc->file, loc->addr, FALSE) < 0) + if(H5FO_mark(f, addr, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't mark object for deletion") } /* end if */ } /* end if */ oh->nlink += adjust; - oh_flags |= H5AC__DIRTIED_FLAG; + *oh_flags |= H5AC__DIRTIED_FLAG; } /* end if */ /* Check for operations on refcount message */ @@ -1475,7 +1463,7 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) if(oh->has_refcount_msg) { /* Check for removing refcount message */ if(oh->nlink <= 1) { - if(H5O_msg_remove_real(loc->file, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, TRUE, dxpl_id) < 0) + if(H5O_msg_remove_real(f, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, TRUE, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete refcount message") oh->has_refcount_msg = FALSE; } /* end if */ @@ -1483,7 +1471,7 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) else { H5O_refcount_t refcount = oh->nlink; - if(H5O_msg_write_real(loc->file, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) + if(H5O_msg_write_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update refcount message") } /* end else */ } /* end if */ @@ -1492,7 +1480,7 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) if(oh->nlink > 1) { H5O_refcount_t refcount = oh->nlink; - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) + if(H5O_msg_append_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new refcount message") oh->has_refcount_msg = TRUE; } /* end if */ @@ -1504,6 +1492,51 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) ret_value = oh->nlink; done: + FUNC_LEAVE_NOAPI(ret_value); +} /* end H5O_link_oh() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_link + * + * Purpose: Adjust the link count for an object header by adding + * ADJUST to the link count. + * + * Return: Success: New link count + * + * Failure: Negative + * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Aug 5 1997 + * + *------------------------------------------------------------------------- + */ +int +H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) +{ + H5O_t *oh = NULL; + H5AC_protect_t oh_acc; /* Access mode for protecting object header */ + unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Whether the object was deleted */ + int ret_value; /* Return value */ + + FUNC_ENTER_NOAPI(H5O_link, FAIL) + + /* check args */ + HDassert(loc); + HDassert(loc->file); + HDassert(H5F_addr_defined(loc->addr)); + + /* get header */ + oh_acc = adjust ? H5AC_WRITE : H5AC_READ; + if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, NULL, NULL, oh_acc))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") + + /* Call the "real" link routine */ + if((ret_value = H5O_link_oh(loc->file, adjust, dxpl_id, oh, &oh_flags)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust object link count") + +done: if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") @@ -2383,7 +2416,8 @@ H5O_get_info(H5O_loc_t *oloc, hid_t dxpl_id, hbool_t want_ih_info, H5O_info_t *o } /* end for */ /* Retrieve # of attributes */ - oinfo->num_attrs = H5O_attr_count_real(oloc->file, dxpl_id, oh); + if(H5O_attr_count_real(oloc->file, dxpl_id, oh, &oinfo->num_attrs) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve attribute count") /* Get B-tree & heap metadata storage size, if requested */ if(want_ih_info) { diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 7f6a55d..667f28c 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -35,8 +35,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_ainfo_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_ainfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ainfo_copy(const void *_mesg, void *_dest); static size_t H5O_ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -105,8 +105,8 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); *------------------------------------------------------------------------- */ static void * -H5O_ainfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_ainfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_ainfo_t *ainfo = NULL; /* Attribute info */ unsigned char flags; /* Flags for encoding attribute info */ diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 6d5d736..b2d38da 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -674,6 +674,7 @@ H5O_alloc_new_chunk(H5F_t *f, H5O_mesg_t *curr_msg; /* Pointer to current message to operate on */ size_t cont_size; /*continuation message size */ + size_t multi_size = 0; /* Size of all the messages in the last chunk */ int found_null = (-1); /* Best fit null message */ alloc_info found_attr = {-1, 0, 0, 0, 0}; /* Best fit attribute message */ alloc_info found_other = {-1, 0, 0, 0, 0}; /* Best fit other message */ @@ -769,11 +770,15 @@ H5O_alloc_new_chunk(H5F_t *f, found_other.null_msgno = null_msgno; } /* end if */ } /* end else */ - } /* end if */ + } else if(found_null < 0 && found_attr.msgno < 0 && found_other.msgno < 0 && msg_chunkno == oh->nchunks - 1) + /* Keep track of the total size of smaller messages in the last + * chunk, in case we need to move more than 1 message. + */ + multi_size += curr_msg->raw_size + H5O_SIZEOF_MSGHDR_OH(oh); } /* end else */ } /* end for */ - if(found_null < 0 && found_attr.msgno < 0 && found_other.msgno < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, UFAIL, "unable to locate message to move") + if(found_null >= 0 || found_attr.msgno >= 0 || found_other.msgno >= 0) + multi_size = 0; /* * If we must move some other message to make room for the null @@ -782,14 +787,20 @@ H5O_alloc_new_chunk(H5F_t *f, * * Move other messages first, and attributes only as a last resort. * + * If all else fails, move every message in the last chunk. + * */ - if(found_null < 0) { - if(found_other.msgno < 0) - found_other = found_attr; + if(multi_size == 0) { + if(found_null < 0) { + if(found_other.msgno < 0) + found_other = found_attr; - HDassert(found_other.msgno >= 0); - size += H5O_SIZEOF_MSGHDR_OH(oh) + oh->mesg[found_other.msgno].raw_size; + HDassert(found_other.msgno >= 0); + size += H5O_SIZEOF_MSGHDR_OH(oh) + oh->mesg[found_other.msgno].raw_size; + } /* end if */ } /* end if */ + else + size += multi_size; /* * The total chunk size must include the requested space plus enough @@ -848,10 +859,58 @@ H5O_alloc_new_chunk(H5F_t *f, if(H5O_alloc_msgs(oh, (size_t)3) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, UFAIL, "can't allocate more space for messages") - /* Move message (that will be replaced with continuation message) - * to new chunk, if necessary. - */ - if(found_null < 0) { + if(multi_size > 0) { + /* Move all non-null messages in the last chunk to the new chunk. This + * should be extremely rare so we don't care too much about minimizing + * the space used */ + H5O_mesg_t *null_msg; /* Pointer to new null message */ + + /* Copy each message to the new location */ + for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) + if(curr_msg->chunkno == chunkno - 1) { + if(curr_msg->type->id == H5O_NULL_ID) { + /* Delete the null message */ + if(u < oh->nmesgs - 1) + HDmemmove(curr_msg, curr_msg + 1, ((oh->nmesgs - 1) - u) * sizeof(H5O_mesg_t)); + oh->nmesgs--; + } else { + /* Copy the raw data */ + HDmemcpy(p, curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh), + curr_msg->raw_size + H5O_SIZEOF_MSGHDR_OH(oh)); + + /* Update the message info */ + curr_msg->chunkno = chunkno; + curr_msg->raw = p + H5O_SIZEOF_MSGHDR_OH(oh); + + /* Account for copied message in new chunk */ + p += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; + size -= H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; + } /* end else */ + } /* end if */ + + /* Create a null message spanning the entire last chunk */ + found_null = oh->nmesgs++; + null_msg = &(oh->mesg[found_null]); + null_msg->type = H5O_MSG_NULL; + null_msg->dirty = TRUE; + null_msg->native = NULL; + null_msg->raw = oh->chunk[chunkno-1].image + + ((chunkno == 1) ? H5O_SIZEOF_HDR(oh) : H5O_SIZEOF_CHKHDR_OH(oh)) + - H5O_SIZEOF_CHKSUM_OH(oh) + H5O_SIZEOF_MSGHDR_OH(oh); + null_msg->raw_size = oh->chunk[chunkno-1].size + - ((chunkno == 1) ? H5O_SIZEOF_HDR(oh) : H5O_SIZEOF_CHKHDR_OH(oh)) + - H5O_SIZEOF_MSGHDR_OH(oh); + null_msg->chunkno = chunkno - 1; + + HDassert(null_msg->raw_size >= cont_size); + + /* Remove any gap in the chunk */ + oh->chunk[chunkno-1].gap = 0; + + } else if(found_null < 0) { + /* Move message (that will be replaced with continuation message) + * to new chunk, if necessary. + */ H5O_mesg_t *null_msg; /* Pointer to new null message */ /* Create null message for space that message to copy currently occupies */ @@ -1788,9 +1847,10 @@ H5O_alloc_shrink_chunk(H5F_t *f, uint8_t *old_image = chunk->image; /* Old address of chunk's image in memory */ size_t old_size = chunk->size; /* Old size of chunk */ size_t new_size = chunk->size - chunk->gap; /* Size of shrunk chunk */ + size_t total_msg_size; /* Size of the messages in this chunk */ + size_t min_chunk_size = H5O_ALIGN_OH(oh, H5O_MIN_SIZE); /* Minimum chunk size */ size_t sizeof_chksum = H5O_SIZEOF_CHKSUM_OH(oh); /* Size of chunk checksum */ size_t sizeof_msghdr = H5O_SIZEOF_MSGHDR_OH(oh); /* Size of message header */ - size_t sizeof_chkhdr = H5O_SIZEOF_CHKHDR_OH(oh); /* Size of chunk header */ uint8_t new_size_flags = 0; /* New chunk #0 size flags */ hbool_t adjust_size_flags = FALSE; /* Whether to adjust the chunk #0 size flags */ size_t less_prfx_size = 0; /* Bytes removed from object header prefix */ @@ -1808,61 +1868,67 @@ H5O_alloc_shrink_chunk(H5F_t *f, */ for (u = oh->nmesgs - 1, curr_msg = &oh->mesg[u]; u < oh->nmesgs; u--, curr_msg--) { if ((H5O_NULL_ID == curr_msg->type->id) && (chunkno == curr_msg->chunkno)) { - /* Check if the message is the only one in the chunk */ - if (chunkno > 0 && (sizeof_msghdr + curr_msg->raw_size) == (new_size - sizeof_chkhdr)) { - /* Shrink the message to the minimum size */ - new_size -= curr_msg->raw_size; - curr_msg->raw_size = 0; - curr_msg->dirty = TRUE; - HDassert(new_size == sizeof_msghdr + sizeof_chkhdr); - - /* There are no more messages in this chunk, so we can exit the loop */ - break; - } /* end if */ - else { - /* Remove the message entirely */ - size_t shrink_size = curr_msg->raw_size + sizeof_msghdr; /* Amount to shrink the chunk by */ - /* If the current message is not at the end of the chunk, copy the - * data after it (except the checksum). - */ - if (curr_msg->raw + curr_msg->raw_size - < old_image + new_size - sizeof_chksum) { - unsigned v; /* Index */ - H5O_mesg_t *curr_msg2; - uint8_t *src = curr_msg->raw + curr_msg->raw_size; /* Source location */ - - /* Slide down the raw data */ - HDmemmove(curr_msg->raw - sizeof_msghdr, src, - (size_t)(old_image + new_size - sizeof_chksum - src)); - - /* Update the raw data pointers for messages after this one */ - for (v = 0, curr_msg2 = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg2++) - if ((chunkno == curr_msg2->chunkno) && (curr_msg2->raw > curr_msg->raw)) - curr_msg2->raw -= shrink_size; - } /* end if */ + size_t shrink_size = curr_msg->raw_size + sizeof_msghdr; /* Amount to shrink the chunk by */ + + /* If the current message is not at the end of the chunk, copy the + * data after it (except the checksum). + */ + if (curr_msg->raw + curr_msg->raw_size + < old_image + new_size - sizeof_chksum) { + unsigned v; /* Index */ + H5O_mesg_t *curr_msg2; + uint8_t *src = curr_msg->raw + curr_msg->raw_size; /* Source location */ + + /* Slide down the raw data */ + HDmemmove(curr_msg->raw - sizeof_msghdr, src, + (size_t)(old_image + new_size - sizeof_chksum - src)); + + /* Update the raw data pointers for messages after this one */ + for (v = 0, curr_msg2 = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg2++) + if ((chunkno == curr_msg2->chunkno) && (curr_msg2->raw > curr_msg->raw)) + curr_msg2->raw -= shrink_size; + } /* end if */ - /* Adjust the new chunk size */ - new_size -= shrink_size; + /* Adjust the new chunk size */ + new_size -= shrink_size; - /* Release any information/memory for the message */ - H5O_msg_free_mesg(curr_msg); + /* Release any information/memory for the message */ + H5O_msg_free_mesg(curr_msg); - /* Remove the deleted null message from list of messages */ - if (u < (oh->nmesgs - 1)) - HDmemmove(&oh->mesg[u], &oh->mesg[u+1], ((oh->nmesgs - 1) - u) * sizeof(H5O_mesg_t)); + /* Remove the deleted null message from list of messages */ + if (u < (oh->nmesgs - 1)) + HDmemmove(&oh->mesg[u], &oh->mesg[u+1], ((oh->nmesgs - 1) - u) * sizeof(H5O_mesg_t)); - /* Decrement # of messages */ - /* (Don't bother reducing size of message array for now) */ - oh->nmesgs--; - } /* end else */ + /* Decrement # of messages */ + /* (Don't bother reducing size of message array for now) */ + oh->nmesgs--; } /* end if */ } /* end for */ + /* Check if the chunk is too small, extend if necessary */ + total_msg_size = new_size - (chunkno == 0 ? H5O_SIZEOF_HDR(oh) : H5O_SIZEOF_CHKHDR_OH(oh)); + if(total_msg_size < min_chunk_size) { + HDassert(oh->alloc_nmesgs > oh->nmesgs); + oh->nmesgs++; + + /* Initialize new null message to make the chunk large enough */ + oh->mesg[oh->nmesgs].type = H5O_MSG_NULL; + oh->mesg[oh->nmesgs].dirty = TRUE; + oh->mesg[oh->nmesgs].native = NULL; + oh->mesg[oh->nmesgs].raw = old_image + new_size + sizeof_msghdr - sizeof_chksum; + oh->mesg[oh->nmesgs].raw_size = MAX(H5O_ALIGN_OH(oh, min_chunk_size - total_msg_size), + sizeof_msghdr) - sizeof_msghdr; + oh->mesg[oh->nmesgs].chunkno = chunkno; + + /* update the new chunk size */ + new_size += oh->mesg[oh->nmesgs].raw_size + sizeof_msghdr; + } + /* Check for changing the chunk #0 data size enough to need adjusting the flags */ if(oh->version > H5O_VERSION_1 && chunkno == 0) { uint64_t chunk0_newsize = new_size - H5O_SIZEOF_HDR(oh); /* New size of chunk 0's data */ size_t orig_prfx_size = 1 << (oh->flags & H5O_HDR_CHUNK0_SIZE); /* Original prefix size */ - + /* Check for moving to a 1-byte size encoding */ if (orig_prfx_size > 1 && chunk0_newsize <= 255) { less_prfx_size = orig_prfx_size - 1; @@ -1926,6 +1992,8 @@ H5O_alloc_shrink_chunk(H5F_t *f, } /* end if */ } /* end for */ + HDassert(new_size <= old_size); + /* Free the unused space in the file */ if (H5MF_xfree(f, H5FD_MEM_OHDR, dxpl_id, chunk->addr + new_size, (hsize_t)(old_size - new_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to shrink object header chunk") @@ -1933,3 +2001,4 @@ H5O_alloc_shrink_chunk(H5F_t *f, done: FUNC_LEAVE_NOAPI(ret_value) } /* H5O_alloc_shrink_chunk() */ + diff --git a/src/H5Oattr.c b/src/H5Oattr.c index b875d02..27b9d5e 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -27,8 +27,8 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_attr_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static void *H5O_attr_copy(const void *_mesg, void *_dest); static size_t H5O_attr_size(const H5F_t *f, const void *_mesg); static herr_t H5O_attr_free(void *mesg); @@ -121,7 +121,7 @@ H5FL_EXTERN(H5S_extent_t); function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_attr_decode(H5F_t *f, hid_t dxpl_id, unsigned UNUSED mesg_flags, +H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned UNUSED mesg_flags, unsigned *ioflags, const uint8_t *p) { H5A_t *attr = NULL; @@ -182,7 +182,8 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, unsigned UNUSED mesg_flags, p += name_len; /* advance the memory pointer */ /* Decode the attribute's datatype */ - if(NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, dxpl_id, ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p))) + if(NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, dxpl_id, open_oh, + ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype") if(attr->shared->version < H5O_ATTR_VERSION_2) p += H5O_ALIGN_OLD(attr->shared->dt_size); @@ -196,7 +197,8 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, unsigned UNUSED mesg_flags, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Decode attribute's dataspace extent */ - if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)) == NULL) + if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, open_oh, + ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)) == NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace") /* Copy the extent information to the dataspace */ @@ -810,7 +812,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in mesg->obj_opened); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Object:", - mesg->shared->oloc.addr); + mesg->oloc.addr); /* Check for attribute creation order index on the attribute */ if(mesg->shared->crt_idx != H5O_MAX_CRT_ORDER_IDX) diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index ea9a7f5..81c2d3b 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -239,15 +239,16 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) /* Check if this object already has attribute information */ if(oh->version > H5O_VERSION_1) { - hbool_t new_ainfo = FALSE; /* Flag to indicate that the attribute information is new */ - - if(NULL == H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) { - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + hbool_t new_ainfo = FALSE; /* Flag to indicate that the attribute information is new */ + htri_t ainfo_exists; /* Whether the attribute info was retrieved */ + /* Check for (& retrieve if available) attribute info */ + if((ainfo_exists = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + if(!ainfo_exists) { /* Initialize attribute information */ - ainfo.track_corder = (oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) ? TRUE : FALSE; - ainfo.index_corder = (oh->flags & H5O_HDR_ATTR_CRT_ORDER_INDEXED) ? TRUE : FALSE; + ainfo.track_corder = (hbool_t)((oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) ? TRUE : FALSE); + ainfo.index_corder = (hbool_t)((oh->flags & H5O_HDR_ATTR_CRT_ORDER_INDEXED) ? TRUE : FALSE); ainfo.max_crt_idx = 0; ainfo.corder_bt2_addr = HADDR_UNDEF; ainfo.nattrs = 0; @@ -491,22 +492,29 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't check for attribute info message") + } /* end if */ /* If found the attribute is already opened, make a copy of it to share the - object information. If not, open attribute as a new object */ + * object information. If not, open attribute as a new object + */ if((found_open_attr = H5O_attr_find_opened_attr(loc, &exist_attr, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute") else if(found_open_attr == TRUE) { if(NULL == (ret_value = H5A_copy(NULL, exist_attr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute") - } else { - if(H5F_addr_defined(ainfo.fheap_addr)) { /* open attribute with dense storage */ + } /* end else if */ + else { + /* Check for attributes in dense storage */ + if(H5F_addr_defined(ainfo.fheap_addr)) { + /* Open attribute with dense storage */ if(NULL == (ret_value = H5A_dense_open(loc->file, dxpl_id, &ainfo, name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "can't open attribute") - } else { + } /* end if */ + else { H5O_iter_opn_t udata; /* User data for callback */ H5O_mesg_operator_t op; /* Wrapper for operator */ @@ -528,7 +536,7 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) HDassert(udata.attr); ret_value = udata.attr; } /* end else */ - } + } /* end else */ done: if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) @@ -595,12 +603,11 @@ H5A_t * H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id) { + H5O_t *oh = NULL; /* Object header */ H5A_attr_iter_op_t attr_op; /* Attribute operator */ H5A_t *exist_attr = NULL; /* Opened attribute object */ htri_t found_open_attr = FALSE; /* Whether opened object is found */ H5A_t *ret_value = NULL; /* Return value */ - H5O_t *oh = NULL; /* Object header */ - H5O_ainfo_t ainfo; /* Attribute information for object */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_open_by_idx) @@ -615,38 +622,30 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, if(H5O_attr_iterate_real((hid_t)-1, loc, dxpl_id, idx_type, order, n, NULL, &attr_op, &ret_value) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, NULL, "can't locate attribute") - /* Protect the object header to iterate over */ if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, NULL, NULL, H5AC_READ))) HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, NULL, "unable to load object header") - /* Check for attribute info stored */ - ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); - /* Find out whether it has already been opened. If it has, close the object - * and make a copy of the already opened object to share the object info. */ + * and make a copy of the already opened object to share the object info. + */ if(ret_value) { - if((found_open_attr = H5O_attr_find_opened_attr(loc, &exist_attr, - ret_value->shared->name)) < 0) + if((found_open_attr = H5O_attr_find_opened_attr(loc, &exist_attr, ret_value->shared->name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute") /* If found that the attribute is already opened, make a copy of it - and close the object just opened. */ + * and close the object just opened. + */ if(found_open_attr && exist_attr) { if(H5A_close(ret_value) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close attribute") - if(NULL == (ret_value = H5A_copy(NULL, exist_attr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute") - } - } + } /* end if */ + } /* end if */ done: - if(oh && H5AC_unprotect(loc->file, H5AC_ind_dxpl_id, H5AC_OHDR, loc->addr, oh, - H5AC__NO_FLAGS_SET) < 0) + if(oh && H5AC_unprotect(loc->file, H5AC_ind_dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_PROTECT, NULL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -668,14 +667,13 @@ done: * *------------------------------------------------------------------------- */ -static -htri_t H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_to_open) +static htri_t +H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_to_open) { - htri_t ret_value = FALSE; - int num_open_attr = 0; - hid_t *attr_id_list = NULL; - unsigned long loc_fnum, attr_fnum; - int i; + hid_t *attr_id_list = NULL; /* List of IDs for opened attributes */ + unsigned long loc_fnum; /* File serial # for object */ + size_t num_open_attr; /* Number of opened attributes */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_find_opened_attr) @@ -684,39 +682,48 @@ htri_t H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "can't get file serial number") /* Count all opened attributes */ - if((num_open_attr = H5F_get_obj_count(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, FALSE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "can't get number of opened attributes") + num_open_attr = H5F_get_obj_count(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, FALSE); /* Find out whether the attribute has been opened */ if(num_open_attr) { - attr_id_list = (hid_t*)H5MM_malloc(num_open_attr*sizeof(hid_t)); + size_t u; /* Local index variable */ + + /* Allocate space for the attribute ID list */ + if(NULL == (attr_id_list = (hid_t *)H5MM_malloc(num_open_attr * sizeof(hid_t)))) + HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "unable to allocate memory for attribute ID list") /* Retrieve the IDs of all opened attributes */ - if(H5F_get_obj_ids(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, num_open_attr, attr_id_list, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't IDs of opened attributes") + H5F_get_obj_ids(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, num_open_attr, attr_id_list, FALSE); + + /* Iterate over the attributes */ + for(u = 0; u < num_open_attr; u++) { + unsigned long attr_fnum; /* Attributes file serial number */ - for(i=0; ishared->oloc.file, &attr_fnum) < 0) + if(H5F_get_fileno((*attr)->oloc.file, &attr_fnum) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "can't get file serial number") - /* Verify whether it's the right object. The attribute name, object address - * to which the attribute is attached, and file serial number should all - * match. */ - if(!strcmp(name_to_open, (*attr)->shared->name) && - loc->addr == (*attr)->shared->oloc.addr && - loc_fnum == attr_fnum) { + /* Verify whether it's the right object. The attribute name, object + * address to which the attribute is attached, and file serial + * number should all match. + */ + if(!HDstrcmp(name_to_open, (*attr)->shared->name) && + loc->addr == (*attr)->oloc.addr && + loc_fnum == attr_fnum) { ret_value = TRUE; break; - } - } - H5MM_free(attr_id_list); - } + } /* end if */ + } /* end for */ + } /* end if */ done: + if(attr_id_list) + H5MM_free(attr_id_list); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_attr_find_opened_attr */ @@ -886,9 +893,11 @@ H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { @@ -1118,9 +1127,11 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { @@ -1206,15 +1217,16 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, HDassert(attr_op); /* Protect the object header to iterate over */ - if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, - NULL, NULL, H5AC_READ))) + if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, NULL, NULL, H5AC_READ))) HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { @@ -1228,8 +1240,7 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, oh = NULL; /* Iterate over attributes in dense storage */ - if((ret_value = H5A_dense_iterate(loc->file, dxpl_id, loc_id, &ainfo, - idx_type, order, skip, last_attr, attr_op, op_data)) < 0) + if((ret_value = H5A_dense_iterate(loc->file, dxpl_id, loc_id, &ainfo, idx_type, order, skip, last_attr, attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); } /* end if */ else { @@ -1491,7 +1502,7 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ - H5O_ainfo_t *ainfo_ptr = NULL; /* Pointer to attribute information for object */ + htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Metadata cache flags for object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1507,9 +1518,11 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == (ainfo_ptr = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo))) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if((ainfo_exists = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { @@ -1539,7 +1552,7 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) } /* end else */ /* Update the attribute information after removing an attribute */ - if(ainfo_ptr) + if(ainfo_exists) if(H5O_attr_remove_update(loc, oh, &ainfo, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") @@ -1577,7 +1590,7 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ - H5O_ainfo_t *ainfo_ptr = NULL; /* Pointer to attribute information for object */ + htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Metadata cache flags for object header */ H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1593,9 +1606,11 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == (ainfo_ptr = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo))) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if((ainfo_exists = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { @@ -1633,7 +1648,7 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, } /* end else */ /* Update the attribute information after removing an attribute */ - if(ainfo_ptr) + if(ainfo_exists) if(H5O_attr_remove_update(loc, oh, &ainfo, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") @@ -1666,40 +1681,44 @@ done: * *------------------------------------------------------------------------- */ -hsize_t -H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +herr_t +H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs) { - hsize_t ret_value; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_attr_count_real) + FUNC_ENTER_NOAPI_NOINIT(H5O_attr_count_real) /* Check arguments */ HDassert(f); HDassert(oh); + HDassert(nattrs); /* Check for attributes stored densely */ if(oh->version > H5O_VERSION_1) { + htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ H5O_ainfo_t ainfo; /* Attribute information for object */ /* Attempt to get the attribute information from the object header */ - if(H5A_get_ainfo(f, dxpl_id, oh, &ainfo)) - ret_value = ainfo.nattrs; - else { - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); - - ret_value = 0; - } /* end else */ + if((ainfo_exists = H5A_get_ainfo(f, dxpl_id, oh, &ainfo)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + else if(ainfo_exists > 0) + *nattrs = ainfo.nattrs; + else + *nattrs = 0; } /* end if */ else { + hsize_t attr_count; /* Number of attributes found */ unsigned u; /* Local index variable */ /* Loop over all messages, counting the attributes */ - for(u = ret_value = 0; u < oh->nmesgs; u++) + attr_count = 0; + for(u = 0; u < oh->nmesgs; u++) if(oh->mesg[u].type == H5O_MSG_ATTR) - ret_value++; + attr_count++; + *nattrs = attr_count; } /* end else */ +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_attr_count_real */ @@ -1775,9 +1794,11 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { @@ -1802,7 +1823,7 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute") /* Check that we found the attribute */ - ret_value = udata.found; + ret_value = (htri_t)udata.found; } /* end else */ done: @@ -1840,12 +1861,12 @@ H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) /* Attributes are only stored in fractal heap & indexed w/v2 B-tree in later versions */ if(oh->version > H5O_VERSION_1) { H5O_ainfo_t ainfo; /* Attribute information for object */ + htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ - /* Check for attribute info stored */ - if(NULL == H5A_get_ainfo(f, dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); - else { + /* Check for (& retrieve if available) attribute info */ + if((ainfo_exists = H5A_get_ainfo(f, dxpl_id, oh, &ainfo)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + else if(ainfo_exists > 0) { /* Get storage size of creation order index, if it's used */ if(H5F_addr_defined(ainfo.corder_bt2_addr)) if(H5B2_iterate_size(f, dxpl_id, H5A_BT2_CORDER, ainfo.corder_bt2_addr, &(bh_info->index_size)) < 0) @@ -1899,8 +1920,9 @@ done: int H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id) { - H5O_t *oh = NULL; /* Pointer to actual object header */ - int ret_value; /* Return value */ + H5O_t *oh = NULL; /* Pointer to actual object header */ + hsize_t nattrs; /* Number of attributes */ + int ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_count) @@ -1912,7 +1934,11 @@ H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id) HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Retrieve # of attributes on object */ - ret_value = (int)H5O_attr_count_real(loc->file, dxpl_id, oh); + if(H5O_attr_count_real(loc->file, dxpl_id, oh, &nattrs) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve attribute count") + + /* Set return value */ + ret_value = (int)nattrs; done: if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) diff --git a/src/H5Obogus.c b/src/H5Obogus.c index c257ca4..cee3199 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -38,8 +38,8 @@ #ifdef H5O_ENABLE_BOGUS /* PRIVATE PROTOTYPES */ -static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O_bogus_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, @@ -87,8 +87,8 @@ const H5O_msg_class_t H5O_MSG_BOGUS[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_bogus_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_bogus_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_bogus_t *mesg = NULL; void *ret_value; /* Return value */ diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 36e4c1a..99e6bdd 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -28,8 +28,8 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_btreek_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_btreek_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_btreek_copy(const void *_mesg, void *_dest); static size_t H5O_btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -79,8 +79,8 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_btreek_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_btreek_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_btreek_t *mesg; /* Native message */ void *ret_value; /* Return value */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index db093a4..551eca8 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -536,7 +536,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, unsigned ioflags = 0; /* Flags for decode routine */ /* Decode continuation message */ - cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(f, dxpl_id, 0, &ioflags, oh->mesg[curmesg].raw); + cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(f, dxpl_id, NULL, 0, &ioflags, oh->mesg[curmesg].raw); cont->chunkno = oh->nchunks; /*the next chunk to allocate */ /* Save 'native' form of continuation message */ @@ -559,7 +559,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, /* Decode ref. count message */ HDassert(oh->version > H5O_VERSION_1); - refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(f, dxpl_id, 0, &ioflags, oh->mesg[curmesg].raw); + refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(f, dxpl_id, NULL, 0, &ioflags, oh->mesg[curmesg].raw); /* Save 'native' form of ref. count message */ oh->mesg[curmesg].native = refcount; diff --git a/src/H5Ocont.c b/src/H5Ocont.c index b3f178d..df336dd 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -37,8 +37,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_cont_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_cont_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O_cont_free(void *mesg); @@ -90,8 +90,8 @@ H5FL_DEFINE(H5O_cont_t); *------------------------------------------------------------------------- */ static void * -H5O_cont_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_cont_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_cont_t *cont = NULL; void *ret_value; diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 5334539..7b76f3d 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -1035,7 +1035,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, new_oloc.addr = dst_oloc->addr; /* Pick a default name for the new object */ - sprintf(tmp_obj_name, "~obj_pointed_by_%llu", (unsigned long_long)dst_oloc->addr); + sprintf(tmp_obj_name, "~obj_pointed_by_%llu", (unsigned long long)dst_oloc->addr); /* Create a link to the newly copied object */ if(H5L_link(dst_root_loc, tmp_obj_name, &new_loc, H5P_DEFAULT, H5P_DEFAULT, dxpl_id) < 0) diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index 9aafe41..864fe9e 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -28,8 +28,8 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_drvinfo_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_drvinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_drvinfo_copy(const void *_mesg, void *_dest); static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -80,8 +80,8 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_drvinfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_drvinfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_drvinfo_t *mesg; /* Native message */ void *ret_value; /* Return value */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 71692c1..24e443c 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -29,8 +29,8 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static void *H5O_dtype_copy(const void *_mesg, void *_dest); static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg); static herr_t H5O_dtype_reset(void *_mesg); @@ -990,7 +990,7 @@ done: function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_dtype_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, +H5O_dtype_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned UNUSED mesg_flags, unsigned *ioflags/*in,out*/, const uint8_t *p) { H5T_t *dt = NULL; diff --git a/src/H5Oefl.c b/src/H5Oefl.c index ee51e1c..5702b34 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -29,8 +29,8 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_efl_copy(const void *_mesg, void *_dest); static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -84,8 +84,8 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_efl_decode(H5F_t *f, hid_t dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_efl_t *mesg = NULL; int version; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 02706ec..d5345aa 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -33,12 +33,12 @@ #include "H5Sprivate.h" /* Dataspaces */ -static void *H5O_fill_old_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_fill_old_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_old_size(const H5F_t *f, const void *_mesg); -static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg); static void *H5O_fill_copy(const void *_mesg, void *_dest); @@ -182,8 +182,8 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ static void * -H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_fill_t *fill = NULL; void *ret_value; @@ -296,8 +296,8 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_fill_old_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_fill_old_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_fill_t *fill = NULL; /* Decoded fill value message */ void *ret_value; /* Return value */ diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 2323fff..83a6085 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -33,8 +33,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_ginfo_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_ginfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ginfo_copy(const void *_mesg, void *_dest); static size_t H5O_ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -95,8 +95,8 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); *------------------------------------------------------------------------- */ static void * -H5O_ginfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_ginfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ unsigned char flags; /* Flags for encoding group info */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 1975173..50a6094 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -34,8 +34,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_layout_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_layout_copy(const void *_mesg, void *_dest); static size_t H5O_layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -94,8 +94,8 @@ H5FL_DEFINE(H5O_layout_t); *------------------------------------------------------------------------- */ static void * -H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_layout_t *mesg = NULL; unsigned u; diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index d1eb2c0..5ba237a 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -35,8 +35,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_linfo_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_linfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_linfo_copy(const void *_mesg, void *_dest); static size_t H5O_linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -111,8 +111,8 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); *------------------------------------------------------------------------- */ static void * -H5O_linfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_linfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_linfo_t *linfo = NULL; /* Link info */ unsigned char index_flags; /* Flags for encoding link index info */ diff --git a/src/H5Olink.c b/src/H5Olink.c index a4449f0..96d4747 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -38,8 +38,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_link_copy(const void *_mesg, void *_dest); static size_t H5O_link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -116,8 +116,8 @@ H5FL_DEFINE_STATIC(H5O_link_t); *------------------------------------------------------------------------- */ static void * -H5O_link_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_link_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_link_t *lnk = NULL; /* Pointer to link message */ size_t len = 0; /* Length of a string in the message */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index a63299a..286240c 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1804,10 +1804,16 @@ done: * slu@ncsa.uiuc.edu * July 14, 2004 * + * Modifications: Neil Fortner + * Feb 4 2009 + * Added open_oh parameter. This parameter is optional and + * contains this message's protected object header + * *------------------------------------------------------------------------- */ void * -H5O_msg_decode(H5F_t *f, hid_t dxpl_id, unsigned type_id, const unsigned char *buf) +H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, + const unsigned char *buf) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ void *ret_value; /* Return value */ @@ -1822,7 +1828,7 @@ H5O_msg_decode(H5F_t *f, hid_t dxpl_id, unsigned type_id, const unsigned char *b HDassert(type); /* decode */ - if((ret_value = (type->decode)(f, dxpl_id, 0, &ioflags, buf)) == NULL) + if((ret_value = (type->decode)(f, dxpl_id, open_oh, 0, &ioflags, buf)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode message") done: diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 46272a0..1bbcfe3 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -28,13 +28,13 @@ #include "H5Opkg.h" /* Object headers */ -static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_mtime_copy(const void *_mesg, void *_dest); static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -119,8 +119,8 @@ H5FL_DEFINE(time_t); *------------------------------------------------------------------------- */ static void * -H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { time_t *mesg; uint32_t tmp_time; /* Temporary copy of the time */ @@ -172,8 +172,8 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { time_t *mesg, the_time; int i; diff --git a/src/H5Oname.c b/src/H5Oname.c index 915546b..5ffa870 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -33,8 +33,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_name_copy(const void *_mesg, void *_dest); static size_t H5O_name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -84,8 +84,8 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_name_t *mesg; void *ret_value; /* Return value */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index fa69b93..9981461 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -187,7 +187,7 @@ \ /* Decode the message */ \ HDassert(msg_type->decode); \ - if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (MSG)->flags, &ioflags, (MSG)->raw))) \ + if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \ HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \ \ /* Mark the message dirty if it was changed by decoding */ \ @@ -222,7 +222,7 @@ struct H5O_msg_class_t { const char *name; /*for debugging */ size_t native_size; /*size of native message */ unsigned share_flags; /* Message sharing settings */ - void *(*decode)(H5F_t*, hid_t, unsigned, unsigned *, const uint8_t *); + void *(*decode)(H5F_t*, hid_t, H5O_t *, unsigned, unsigned *, const uint8_t *); herr_t (*encode)(H5F_t*, hbool_t, uint8_t*, const void *); void *(*copy)(const void *, void *); /*copy native value */ size_t (*raw_size)(const H5F_t *, hbool_t, const void *);/*sizeof encoded message */ @@ -515,8 +515,8 @@ H5_DLL herr_t H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link); /* Shared object operators */ -H5_DLL void * H5O_shared_decode(H5F_t *f, hid_t dxpl_id, unsigned *ioflags, - const uint8_t *buf, const H5O_msg_class_t *type); +H5_DLL void * H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned *ioflags, const uint8_t *buf, const H5O_msg_class_t *type); H5_DLL herr_t H5O_shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_mesg); H5_DLL size_t H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg); H5_DLL herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, @@ -534,6 +534,9 @@ H5_DLL herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, H5_DLL herr_t H5O_attr_reset(void *_mesg); H5_DLL herr_t H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); +H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, + hsize_t *nattrs); + /* These functions operate on object locations */ H5_DLL H5O_loc_t *H5O_get_loc(hid_t id); diff --git a/src/H5Opline.c b/src/H5Opline.c index fed2861..20a9d26 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -33,8 +33,8 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_pline_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_pline_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static void *H5O_pline_copy(const void *_mesg, void *_dest); static size_t H5O_pline_size(const H5F_t *f, const void *_mesg); static herr_t H5O_pline_reset(void *_mesg); @@ -107,8 +107,8 @@ H5FL_DEFINE(H5O_pline_t); *------------------------------------------------------------------------- */ static void * -H5O_pline_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_pline_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_pline_t *pline = NULL; /* Pipeline message */ H5Z_filter_info_t *filter; /* Filter to decode */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 80a924f..c623b73 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -584,6 +584,7 @@ H5_DLL herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, H5_DLL herr_t H5O_open(H5O_loc_t *loc); H5_DLL herr_t H5O_close(H5O_loc_t *loc); H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id); +H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags); H5_DLL H5O_t *H5O_protect(H5O_loc_t *loc, hid_t dxpl_id); H5_DLL herr_t H5O_unprotect(H5O_loc_t *loc, H5O_t *oh); H5_DLL herr_t H5O_touch(H5O_loc_t *loc, hbool_t force, hid_t dxpl_id); @@ -644,8 +645,8 @@ H5_DLL herr_t H5O_msg_get_crt_index(unsigned type_id, const void *mesg, H5O_msg_crt_idx_t *crt_idx); H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared, unsigned char *buf, const void *obj); -H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, unsigned type_id, - const unsigned char *buf); +H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned type_id, const unsigned char *buf); H5_DLL herr_t H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, void *mesg); @@ -687,8 +688,5 @@ H5_DLL herr_t H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Shared message operators */ H5_DLL herr_t H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src); -/* Attribute operators */ -H5_DLL hsize_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh); - #endif /* _H5Oprivate_H */ diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index b2f02b2..2f00e86 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -33,8 +33,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_refcount_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_refcount_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_refcount_copy(const void *_mesg, void *_dest); static size_t H5O_refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -90,8 +90,8 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); *------------------------------------------------------------------------- */ static void * -H5O_refcount_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_refcount_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_refcount_t *refcount = NULL; /* Reference count */ void *ret_value; /* Return value */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index fe7bf02..23af101 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -26,8 +26,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_sdspace_copy(const void *_mesg, void *_dest); static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg); @@ -109,8 +109,8 @@ H5FL_ARR_EXTERN(hsize_t); within this function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */ void *ret_value; diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 062443a..fd7cc8b 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -107,7 +107,7 @@ *------------------------------------------------------------------------- */ static void * -H5O_shared_read(H5F_t *f, hid_t dxpl_id, unsigned *ioflags, +H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, const H5O_shared_t *shared, const H5O_msg_class_t *type) { H5HF_t *fheap = NULL; @@ -159,7 +159,7 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, unsigned *ioflags, HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "can't read message from fractal heap.") /* Decode the message */ - if(NULL == (ret_value = (type->decode)(f, dxpl_id, 0, ioflags, mesg_ptr))) + if(NULL == (ret_value = (type->decode)(f, dxpl_id, open_oh, 0, ioflags, mesg_ptr))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "can't decode shared message.") } /* end if */ else { @@ -167,12 +167,22 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, unsigned *ioflags, HDassert(shared->type == H5O_SHARE_TYPE_COMMITTED); - /* Get the shared message from an object header */ + /* Build the object location for the shared message's object header */ oloc.file = f; oloc.addr = shared->u.loc.oh_addr; oloc.holding_file = FALSE; - if(NULL == (ret_value = H5O_msg_read(&oloc, type->id, NULL, dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read message") + + if(open_oh && oloc.addr == H5O_OH_GET_ADDR(open_oh)) { + /* The shared message is in the already opened object header. This + * is possible, for example, if an attribute's datatype is shared in + * the same object header the attribute is in. Read the message + * directly. */ + if(NULL == (ret_value = H5O_msg_read_oh(f, dxpl_id, open_oh, type->id, NULL))) + HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read message") + } else + /* The shared message is in another object header */ + if(NULL == (ret_value = H5O_msg_read(&oloc, type->id, NULL, dxpl_id))) + HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read message") } /* end else */ /* Mark the message as shared */ @@ -228,7 +238,7 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_loc_t oloc; /* Location for object header where message is stored */ /* - * The shared message is stored in some other object header. + * The shared message is stored in some object header. * The other object header must be in the same file as the * new object header. Adjust the reference count on that * object header. @@ -236,13 +246,26 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, if(shared->file->shared != f->shared) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "interfile hard links are not allowed") - /* Get the shared message from an object header */ + /* Build the object location for the shared message's object header */ oloc.file = f; oloc.addr = shared->u.loc.oh_addr; oloc.holding_file = FALSE; - if(H5O_link(&oloc, adjust, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") + if(open_oh && oloc.addr == H5O_OH_GET_ADDR(open_oh)) { + /* The shared message is in the already opened object header. This + * is possible, for example, if an attribute's datatype is shared in + * the same object header the attribute is in. Adjust the link + * count directly. */ + unsigned oh_flags = H5AC__NO_FLAGS_SET; /* This is used only to satisfy H5O_link_oh */ + + if(H5O_link_oh(f, adjust, dxpl_id, open_oh, &oh_flags) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") + + HDassert(!(oh_flags & H5AC__DELETED_FLAG)); + } else + /* The shared message is in another object header */ + if(H5O_link(&oloc, adjust, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") } /* end if */ else { HDassert(shared->type == H5O_SHARE_TYPE_SOHM || shared->type == H5O_SHARE_TYPE_HERE); @@ -277,7 +300,7 @@ done: *------------------------------------------------------------------------- */ void * -H5O_shared_decode(H5F_t *f, hid_t dxpl_id, unsigned *ioflags, +H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, const uint8_t *buf, const H5O_msg_class_t *type) { H5O_shared_t sh_mesg; /* Shared message info */ @@ -344,7 +367,7 @@ H5O_shared_decode(H5F_t *f, hid_t dxpl_id, unsigned *ioflags, sh_mesg.msg_type_id = type->id; /* Retrieve actual message, through decoded shared message info */ - if(NULL == (ret_value = H5O_shared_read(f, dxpl_id, ioflags, &sh_mesg, type))) + if(NULL == (ret_value = H5O_shared_read(f, dxpl_id, open_oh, ioflags, &sh_mesg, type))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to retrieve native message") done: @@ -708,7 +731,7 @@ H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth) "SOHM"); HDfprintf(stream, "%*s%-*s %016llx\n", indent, "", fwidth, "Heap ID:", - (unsigned long_long)mesg->u.heap_id); + (unsigned long long)mesg->u.heap_id); break; case H5O_SHARE_TYPE_HERE: diff --git a/src/H5Oshared.h b/src/H5Oshared.h index d52cd8f..c0f5cd6 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -48,7 +48,7 @@ *------------------------------------------------------------------------- */ static H5_inline void * -H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, +H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p) { void *ret_value; /* Return value */ @@ -68,7 +68,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, /* Check for shared message */ if(mesg_flags & H5O_MSG_FLAG_SHARED) { /* Retrieve native message info indirectly through shared message */ - if(NULL == (ret_value = H5O_shared_decode(f, dxpl_id, ioflags, p, H5O_SHARED_TYPE))) + if(NULL == (ret_value = H5O_shared_decode(f, dxpl_id, open_oh, ioflags, p, H5O_SHARED_TYPE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message") /* We currently do not support automatically fixing shared messages */ @@ -81,7 +81,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, } /* end if */ else { /* Decode native message directly */ - if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, mesg_flags, ioflags, p))) + if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, open_oh, mesg_flags, ioflags, p))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message") } /* end else */ diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 74fe739..51c1c55 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -28,8 +28,8 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_shmesg_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_shmesg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_shmesg_copy(const void *_mesg, void *_dest); static size_t H5O_shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -76,8 +76,8 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_shmesg_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_shmesg_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_shmesg_table_t *mesg; /* Native message */ void *ret_value; /* Return value */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 9524f43..a93a46d 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -36,8 +36,8 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, unsigned mesg_flags, - unsigned *ioflags, const uint8_t *p); +static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, + unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_stab_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_stab_copy(const void *_mesg, void *_dest); static size_t H5O_stab_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); @@ -96,8 +96,8 @@ H5FL_DEFINE_STATIC(H5O_stab_t); *------------------------------------------------------------------------- */ static void * -H5O_stab_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags, - unsigned UNUSED *ioflags, const uint8_t *p) +H5O_stab_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, + unsigned UNUSED mesg_flags, unsigned UNUSED *ioflags, const uint8_t *p) { H5O_stab_t *stab = NULL; void *ret_value; /* Return value */ diff --git a/src/H5Otest.c b/src/H5Otest.c index 8116ffa..c2b30fa 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -112,9 +112,11 @@ H5O_is_attr_dense_test(hid_t oid) /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if(H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Check if dense storage is being used */ if(H5F_addr_defined(ainfo.fheap_addr)) { @@ -157,7 +159,7 @@ H5O_is_attr_empty_test(hid_t oid) { H5O_t *oh = NULL; /* Object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ - H5O_ainfo_t *ainfo_ptr = NULL; /* Pointer to attribute information for object */ + htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ H5O_loc_t *oloc; /* Pointer to object's location */ hsize_t nattrs; /* Number of attributes */ htri_t ret_value; /* Return value */ @@ -173,17 +175,18 @@ H5O_is_attr_empty_test(hid_t oid) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Check for attribute info stored */ - ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == (ainfo_ptr = H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo))) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if((ainfo_exists = H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Retrieve the number of attribute messages in header */ nattrs = H5O_msg_count_real(oh, H5O_MSG_ATTR); /* Check for later version of object header format & attribute info available */ if(oh->version > H5O_VERSION_1) { - if(ainfo_ptr) { + if(ainfo_exists) { /* Check for using dense storage */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Check for any messages in object header */ @@ -252,9 +255,11 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if(H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Retrieve the number of attribute messages in header */ obj_nattrs = H5O_msg_count_real(oh, H5O_MSG_ATTR); @@ -327,9 +332,11 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; - if(oh->version > H5O_VERSION_1 && NULL == H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo)) - /* Clear error stack from not finding attribute info */ - H5E_clear_stack(NULL); + if(oh->version > H5O_VERSION_1) { + /* Check for (& retrieve if available) attribute info */ + if(H5A_get_ainfo(oloc->file, H5AC_ind_dxpl_id, oh, &ainfo) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") + } /* end if */ /* Check for 'dense' attribute storage file addresses being defined */ if(!H5F_addr_defined(ainfo.fheap_addr)) diff --git a/src/H5S.c b/src/H5S.c index b7982f0..40134a6 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1565,7 +1565,7 @@ H5S_decode(const unsigned char *buf) /* Decode the extent part of dataspace */ /* (pass mostly bogus file pointer and bogus DXPL) */ - if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, H5O_SDSPACE_ID, buf))==NULL) + if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, buf))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object") buf += extent_size; diff --git a/src/H5SM.c b/src/H5SM.c index d942399..c383877 100755 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -1402,7 +1402,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) * master table needs to be unprotected when we do this. */ if(mesg_buf) { - if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, type_id, (const unsigned char *)mesg_buf))) + if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, open_oh, type_id, (const unsigned char *)mesg_buf))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "can't decode shared message.") if(H5O_msg_delete(f, dxpl_id, open_oh, type_id, native_mesg) < 0) diff --git a/src/H5T.c b/src/H5T.c index d6bc1ed..0345e5f 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1052,7 +1052,7 @@ H5T_init_interface(void) status |= H5T_register(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T_conv_ldouble_double, H5AC_dxpl_id, FALSE); #endif /*H5T_CONV_INTERNAL_FP_LDOUBLE*/ - /* from long_long */ + /* from long long */ status |= H5T_register(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T_conv_llong_ullong, H5AC_dxpl_id, FALSE); status |= H5T_register(H5T_PERS_HARD, "ullong_llong", native_ullong, native_llong, H5T_conv_ullong_llong, H5AC_dxpl_id, FALSE); status |= H5T_register(H5T_PERS_HARD, "llong_long", native_llong, native_long, H5T_conv_llong_long, H5AC_dxpl_id, FALSE); @@ -2920,7 +2920,7 @@ H5T_decode(const unsigned char *buf) HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype") /* Decode the serialized datatype message */ - if((ret_value = H5O_msg_decode(f, H5AC_dxpl_id, H5O_DTYPE_ID, buf)) == NULL) + if((ret_value = H5O_msg_decode(f, H5AC_dxpl_id, NULL, H5O_DTYPE_ID, buf)) == NULL) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") done: @@ -2992,7 +2992,7 @@ H5T_create(H5T_class_t type, size_t size) subtype = H5T_NATIVE_INT_g; } else if (sizeof(long)==size) { subtype = H5T_NATIVE_LONG_g; - } else if (sizeof(long_long)==size) { + } else if (sizeof(long long)==size) { subtype = H5T_NATIVE_LLONG_g; } else { HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "no applicable native integer type"); diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 05277a8..90b7a21 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -241,7 +241,7 @@ #define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, long long, 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) { \ assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_sU, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_sU, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_uS_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -291,17 +291,17 @@ #define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_uS, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_uS, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_uU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ assert(sizeof(ST)<=sizeof(DT)); \ - H5T_CONV(H5T_CONV_xX, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_xX, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Ss(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Xx, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Xx, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -337,17 +337,17 @@ #define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Su, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Su, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_Uu(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ assert(sizeof(ST)>=sizeof(DT)); \ - H5T_CONV(H5T_CONV_Ux, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_Ux, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_su_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -374,7 +374,7 @@ #define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_su, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_su, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_us_CORE(S,D,ST,DT,D_MIN,D_MAX) { \ @@ -401,7 +401,7 @@ #define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ assert(sizeof(ST)==sizeof(DT)); \ - H5T_CONV(H5T_CONV_us, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + H5T_CONV(H5T_CONV_us, long long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ } #define H5T_CONV_fF(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ @@ -5019,7 +5019,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_schar_llong * - * Purpose: Converts `signed char' to `long_long' + * Purpose: Converts `signed char' to `long long' * * Return: Success: Non-negative * @@ -5042,7 +5042,7 @@ H5T_conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_schar_llong, FAIL) - H5T_CONV_sS(SCHAR, LLONG, signed char, long_long, -, -); + H5T_CONV_sS(SCHAR, LLONG, signed char, long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -5052,7 +5052,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_schar_ullong * - * Purpose: Converts `signed char' to `unsigned long_long' + * Purpose: Converts `signed char' to `unsigned long long' * * Return: Success: Non-negative * @@ -5075,7 +5075,7 @@ H5T_conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_schar_ullong, FAIL) - H5T_CONV_sU(SCHAR, ULLONG, signed char, unsigned long_long, -, -); + H5T_CONV_sU(SCHAR, ULLONG, signed char, unsigned long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -5085,7 +5085,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uchar_llong * - * Purpose: Converts `unsigned char' to `long_long' + * Purpose: Converts `unsigned char' to `long long' * * Return: Success: Non-negative * @@ -5108,7 +5108,7 @@ H5T_conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_uchar_llong, FAIL) - H5T_CONV_uS(UCHAR, LLONG, unsigned char, long_long, -, LLONG_MAX); + H5T_CONV_uS(UCHAR, LLONG, unsigned char, long long, -, LLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -5118,7 +5118,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uchar_ullong * - * Purpose: Converts `unsigned char' to `unsigned long_long' + * Purpose: Converts `unsigned char' to `unsigned long long' * * Return: Success: Non-negative * @@ -5141,7 +5141,7 @@ H5T_conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_uchar_ullong, FAIL) - H5T_CONV_uU(UCHAR, ULLONG, unsigned char, unsigned long_long, -, -); + H5T_CONV_uU(UCHAR, ULLONG, unsigned char, unsigned long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -5613,7 +5613,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_short_llong * - * Purpose: Converts `short' to `long_long' + * Purpose: Converts `short' to `long long' * * Return: Success: Non-negative * @@ -5636,7 +5636,7 @@ H5T_conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_short_llong, FAIL) - H5T_CONV_sS(SHORT, LLONG, short, long_long, -, -); + H5T_CONV_sS(SHORT, LLONG, short, long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -5646,7 +5646,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_short_ullong * - * Purpose: Converts `short' to `unsigned long_long' + * Purpose: Converts `short' to `unsigned long long' * * Return: Success: Non-negative * @@ -5669,7 +5669,7 @@ H5T_conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_short_ullong, FAIL) - H5T_CONV_sU(SHORT, ULLONG, short, unsigned long_long, -, -); + H5T_CONV_sU(SHORT, ULLONG, short, unsigned long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -5679,7 +5679,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ushort_llong * - * Purpose: Converts `unsigned short' to `long_long' + * Purpose: Converts `unsigned short' to `long long' * * Return: Success: Non-negative * @@ -5702,7 +5702,7 @@ H5T_conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ushort_llong, FAIL) - H5T_CONV_uS(USHORT, LLONG, unsigned short, long_long, -, LLONG_MAX); + H5T_CONV_uS(USHORT, LLONG, unsigned short, long long, -, LLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -5712,7 +5712,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ushort_ullong * - * Purpose: Converts `unsigned short' to `unsigned long_long' + * Purpose: Converts `unsigned short' to `unsigned long long' * * Return: Success: Non-negative * @@ -5735,7 +5735,7 @@ H5T_conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ushort_ullong, FAIL) - H5T_CONV_uU(USHORT, ULLONG, unsigned short, unsigned long_long, -, -); + H5T_CONV_uU(USHORT, ULLONG, unsigned short, unsigned long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6201,7 +6201,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_int_llong * - * Purpose: Converts `int' to `long_long' + * Purpose: Converts `int' to `long long' * * Return: Success: Non-negative * @@ -6223,7 +6223,7 @@ H5T_conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_int_llong, FAIL) - H5T_CONV_sS(INT, LLONG, int, long_long, -, -); + H5T_CONV_sS(INT, LLONG, int, long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6233,7 +6233,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_int_ullong * - * Purpose: Converts `int' to `unsigned long_long' + * Purpose: Converts `int' to `unsigned long long' * * Return: Success: Non-negative * @@ -6255,7 +6255,7 @@ H5T_conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_int_ullong, FAIL) - H5T_CONV_sU(INT, ULLONG, int, unsigned long_long, -, -); + H5T_CONV_sU(INT, ULLONG, int, unsigned long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6265,7 +6265,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uint_llong * - * Purpose: Converts `unsigned int' to `long_long' + * Purpose: Converts `unsigned int' to `long long' * * Return: Success: Non-negative * @@ -6287,7 +6287,7 @@ H5T_conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_uint_llong, FAIL) - H5T_CONV_uS(UINT, LLONG, unsigned, long_long, -, LLONG_MAX); + H5T_CONV_uS(UINT, LLONG, unsigned, long long, -, LLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6297,7 +6297,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uint_ullong * - * Purpose: Converts `unsigned int' to `unsigned long_long' + * Purpose: Converts `unsigned int' to `unsigned long long' * * Return: Success: Non-negative * @@ -6320,7 +6320,7 @@ H5T_conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_uint_ullong, FAIL) - H5T_CONV_uU(UINT, ULLONG, unsigned, unsigned long_long, -, -); + H5T_CONV_uU(UINT, ULLONG, unsigned, unsigned long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6782,7 +6782,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_long_llong * - * Purpose: Converts `long' to `long_long' + * Purpose: Converts `long' to `long long' * * Return: Success: Non-negative * @@ -6804,7 +6804,7 @@ H5T_conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_long_llong, FAIL) - H5T_CONV_sS(LONG, LLONG, long, long_long, -, -); + H5T_CONV_sS(LONG, LLONG, long, long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6814,7 +6814,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_long_ullong * - * Purpose: Converts `long' to `unsigned long_long' + * Purpose: Converts `long' to `unsigned long long' * * Return: Success: Non-negative * @@ -6837,7 +6837,7 @@ H5T_conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_long_ullong, FAIL) - H5T_CONV_sU(LONG, ULLONG, long, unsigned long_long, -, -); + H5T_CONV_sU(LONG, ULLONG, long, unsigned long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6847,7 +6847,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ulong_llong * - * Purpose: Converts `unsigned long' to `long_long' + * Purpose: Converts `unsigned long' to `long long' * * Return: Success: Non-negative * @@ -6870,7 +6870,7 @@ H5T_conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ulong_llong, FAIL) - H5T_CONV_uS(ULONG, LLONG, unsigned long, long_long, -, LLONG_MAX); + H5T_CONV_uS(ULONG, LLONG, unsigned long, long long, -, LLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6880,7 +6880,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ulong_ullong * - * Purpose: Converts `unsigned long' to `unsigned long_long' + * Purpose: Converts `unsigned long' to `unsigned long long' * * Return: Success: Non-negative * @@ -6903,7 +6903,7 @@ H5T_conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ulong_ullong, FAIL) - H5T_CONV_uU(ULONG, ULLONG, unsigned long, unsigned long_long, -, -); + H5T_CONV_uU(ULONG, ULLONG, unsigned long, unsigned long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6913,7 +6913,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_schar * - * Purpose: Converts `long_long' to `signed char' + * Purpose: Converts `long long' to `signed char' * * Return: Success: Non-negative * @@ -6936,7 +6936,7 @@ H5T_conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_schar, FAIL) - H5T_CONV_Ss(LLONG, SCHAR, long_long, signed char, SCHAR_MIN, SCHAR_MAX); + H5T_CONV_Ss(LLONG, SCHAR, long long, signed char, SCHAR_MIN, SCHAR_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6946,7 +6946,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_uchar * - * Purpose: Converts `long_long' to `unsigned char' + * Purpose: Converts `long long' to `unsigned char' * * Return: Success: Non-negative * @@ -6969,7 +6969,7 @@ H5T_conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_uchar, FAIL) - H5T_CONV_Su(LLONG, UCHAR, long_long, unsigned char, -, UCHAR_MAX); + H5T_CONV_Su(LLONG, UCHAR, long long, unsigned char, -, UCHAR_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -6979,7 +6979,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_schar * - * Purpose: Converts `unsigned long_long' to `signed char' + * Purpose: Converts `unsigned long long' to `signed char' * * Return: Success: Non-negative * @@ -7002,7 +7002,7 @@ H5T_conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_schar, FAIL) - H5T_CONV_Us(ULLONG, SCHAR, unsigned long_long, signed char, -, SCHAR_MAX); + H5T_CONV_Us(ULLONG, SCHAR, unsigned long long, signed char, -, SCHAR_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7012,7 +7012,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_uchar * - * Purpose: Converts `unsigned long_long' to `unsigned char' + * Purpose: Converts `unsigned long long' to `unsigned char' * * Return: Success: Non-negative * @@ -7035,7 +7035,7 @@ H5T_conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_uchar, FAIL) - H5T_CONV_Uu(ULLONG, UCHAR, unsigned long_long, unsigned char, -, UCHAR_MAX); + H5T_CONV_Uu(ULLONG, UCHAR, unsigned long long, unsigned char, -, UCHAR_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7045,7 +7045,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_short * - * Purpose: Converts `long_long' to `short' + * Purpose: Converts `long long' to `short' * * Return: Success: Non-negative * @@ -7068,7 +7068,7 @@ H5T_conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_short, FAIL) - H5T_CONV_Ss(LLONG, SHORT, long_long, short, SHRT_MIN, SHRT_MAX); + H5T_CONV_Ss(LLONG, SHORT, long long, short, SHRT_MIN, SHRT_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7078,7 +7078,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_ushort * - * Purpose: Converts `long_long' to `unsigned short' + * Purpose: Converts `long long' to `unsigned short' * * Return: Success: Non-negative * @@ -7101,7 +7101,7 @@ H5T_conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_ushort, FAIL) - H5T_CONV_Su(LLONG, USHORT, long_long, unsigned short, -, USHRT_MAX); + H5T_CONV_Su(LLONG, USHORT, long long, unsigned short, -, USHRT_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7111,7 +7111,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_short * - * Purpose: Converts `unsigned long_long' to `short' + * Purpose: Converts `unsigned long long' to `short' * * Return: Success: Non-negative * @@ -7134,7 +7134,7 @@ H5T_conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_short, FAIL) - H5T_CONV_Us(ULLONG, SHORT, unsigned long_long, short, -, SHRT_MAX); + H5T_CONV_Us(ULLONG, SHORT, unsigned long long, short, -, SHRT_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7144,7 +7144,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_ushort * - * Purpose: Converts `unsigned long_long' to `unsigned short' + * Purpose: Converts `unsigned long long' to `unsigned short' * * Return: Success: Non-negative * @@ -7167,7 +7167,7 @@ H5T_conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_ushort, FAIL) - H5T_CONV_Uu(ULLONG, USHORT, unsigned long_long, unsigned short, -, USHRT_MAX); + H5T_CONV_Uu(ULLONG, USHORT, unsigned long long, unsigned short, -, USHRT_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7177,7 +7177,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_int * - * Purpose: Converts `long_long' to `int' + * Purpose: Converts `long long' to `int' * * Return: Success: Non-negative * @@ -7199,7 +7199,7 @@ H5T_conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_int, FAIL) - H5T_CONV_Ss(LLONG, INT, long_long, int, INT_MIN, INT_MAX); + H5T_CONV_Ss(LLONG, INT, long long, int, INT_MIN, INT_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7209,7 +7209,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_uint * - * Purpose: Converts `long_long' to `unsigned int' + * Purpose: Converts `long long' to `unsigned int' * * Return: Success: Non-negative * @@ -7231,7 +7231,7 @@ H5T_conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_uint, FAIL) - H5T_CONV_Su(LLONG, UINT, long_long, unsigned, -, UINT_MAX); + H5T_CONV_Su(LLONG, UINT, long long, unsigned, -, UINT_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7241,7 +7241,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_int * - * Purpose: Converts `unsigned long_long' to `int' + * Purpose: Converts `unsigned long long' to `int' * * Return: Success: Non-negative * @@ -7263,7 +7263,7 @@ H5T_conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_int, FAIL) - H5T_CONV_Us(ULLONG, INT, unsigned long_long, int, -, INT_MAX); + H5T_CONV_Us(ULLONG, INT, unsigned long long, int, -, INT_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7273,7 +7273,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_uint * - * Purpose: Converts `unsigned long_long' to `unsigned int' + * Purpose: Converts `unsigned long long' to `unsigned int' * * Return: Success: Non-negative * @@ -7296,7 +7296,7 @@ H5T_conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_uint, FAIL) - H5T_CONV_Uu(ULLONG, UINT, unsigned long_long, unsigned, -, UINT_MAX); + H5T_CONV_Uu(ULLONG, UINT, unsigned long long, unsigned, -, UINT_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7306,7 +7306,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_long * - * Purpose: Converts `long_long' to `long' + * Purpose: Converts `long long' to `long' * * Return: Success: Non-negative * @@ -7328,7 +7328,7 @@ H5T_conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_long, FAIL) - H5T_CONV_Ss(LLONG, LONG, long_long, long, LONG_MIN, LONG_MAX); + H5T_CONV_Ss(LLONG, LONG, long long, long, LONG_MIN, LONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7338,7 +7338,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_ulong * - * Purpose: Converts `long_long' to `unsigned long' + * Purpose: Converts `long long' to `unsigned long' * * Return: Success: Non-negative * @@ -7361,7 +7361,7 @@ H5T_conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_ulong, FAIL) - H5T_CONV_Su(LLONG, ULONG, long_long, unsigned long, -, ULONG_MAX); + H5T_CONV_Su(LLONG, ULONG, long long, unsigned long, -, ULONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7371,7 +7371,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_long * - * Purpose: Converts `unsigned long_long' to `long' + * Purpose: Converts `unsigned long long' to `long' * * Return: Success: Non-negative * @@ -7394,7 +7394,7 @@ H5T_conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_long, FAIL) - H5T_CONV_Us(ULLONG, LONG, unsigned long_long, long, -, LONG_MAX); + H5T_CONV_Us(ULLONG, LONG, unsigned long long, long, -, LONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7404,7 +7404,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_ulong * - * Purpose: Converts `unsigned long_long' to `unsigned long' + * Purpose: Converts `unsigned long long' to `unsigned long' * * Return: Success: Non-negative * @@ -7427,7 +7427,7 @@ H5T_conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_ulong, FAIL) - H5T_CONV_Uu(ULLONG, ULONG, unsigned long_long, unsigned long, -, ULONG_MAX); + H5T_CONV_Uu(ULLONG, ULONG, unsigned long long, unsigned long, -, ULONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7437,7 +7437,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_ullong * - * Purpose: Converts `long_long' to `unsigned long_long' + * Purpose: Converts `long long' to `unsigned long long' * * Return: Success: non-negative * @@ -7460,7 +7460,7 @@ H5T_conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_ullong, FAIL) - H5T_CONV_su(LLONG, ULLONG, long_long, unsigned long_long, -, -); + H5T_CONV_su(LLONG, ULLONG, long long, unsigned long long, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7470,7 +7470,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_llong * - * Purpose: Converts `unsigned long_long' to `long_long' + * Purpose: Converts `unsigned long long' to `long long' * * Return: Success: non-negative * @@ -7493,7 +7493,7 @@ H5T_conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_llong, FAIL) - H5T_CONV_us(ULLONG, LLONG, unsigned long_long, long_long, -, LLONG_MAX); + H5T_CONV_us(ULLONG, LLONG, unsigned long long, long long, -, LLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -8529,7 +8529,7 @@ H5T_conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_float, FAIL) - H5T_CONV_xF(LLONG, FLOAT, long_long, float, -, -); + H5T_CONV_xF(LLONG, FLOAT, long long, float, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -8561,7 +8561,7 @@ H5T_conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_double, FAIL) - H5T_CONV_xF(LLONG, DOUBLE, long_long, double, -, -); + H5T_CONV_xF(LLONG, DOUBLE, long long, double, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -8594,7 +8594,7 @@ H5T_conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_llong_ldouble, FAIL) - H5T_CONV_xF(LLONG, LDOUBLE, long_long, long double, -, -); + H5T_CONV_xF(LLONG, LDOUBLE, long long, long double, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -8628,7 +8628,7 @@ H5T_conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_float, FAIL) - H5T_CONV_xF(ULLONG, FLOAT, unsigned long_long, float, -, -); + H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -8662,7 +8662,7 @@ H5T_conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_double, FAIL) - H5T_CONV_xF(ULLONG, DOUBLE, unsigned long_long, double, -, -); + H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -8696,7 +8696,7 @@ H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ullong_ldouble, FAIL) - H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long_long, long double, -, -); + H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long long, long double, -, -); done: FUNC_LEAVE_NOAPI(ret_value) @@ -9514,7 +9514,7 @@ H5T_conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_float_llong, FAIL) - H5T_CONV_Fx(FLOAT, LLONG, float, long_long, LLONG_MIN, LLONG_MAX); + H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -9548,7 +9548,7 @@ H5T_conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_float_ullong, FAIL) - H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long_long, 0, ULLONG_MAX); + H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -9582,7 +9582,7 @@ H5T_conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_double_llong, FAIL) - H5T_CONV_Fx(DOUBLE, LLONG, double, long_long, LLONG_MIN, LLONG_MAX); + H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -9616,7 +9616,7 @@ H5T_conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_double_ullong, FAIL) - H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long_long, 0, ULLONG_MAX); + H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long long, 0, ULLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -9650,7 +9650,7 @@ H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ldouble_llong, FAIL) - H5T_CONV_Fx(LDOUBLE, LLONG, long double, long_long, LLONG_MIN, LLONG_MAX); + H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) @@ -9684,7 +9684,7 @@ H5T_conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, FUNC_ENTER_NOAPI(H5T_conv_ldouble_ullong, FAIL) - H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long_long, 0, ULLONG_MAX); + H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long long, 0, ULLONG_MAX); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Tnative.c b/src/H5Tnative.c index f347d93..75b5d03 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -550,22 +550,22 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, native_size = sizeof(long); } else if(prec<=H5Tget_precision(H5T_NATIVE_LLONG)) { match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long long); } else { /* If no native type matches the querried datatype, simply choose the type of biggest size. */ match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long long); } } else if(direction == H5T_DIR_DESCEND) { if(prec>=H5Tget_precision(H5T_NATIVE_LLONG)) { match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long long); } else if(prec>=H5Tget_precision(H5T_NATIVE_LONG)) { if(prec==H5Tget_precision(H5T_NATIVE_LONG)) { match=H5T_NATIVE_INT_MATCH_LONG; native_size = sizeof(long); } else { match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long long); } } else if(prec>=H5Tget_precision(H5T_NATIVE_INT)) { diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 95539ab..330a731 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -388,7 +388,7 @@ H5_DLLVAR hid_t H5T_VAX_F64_g; * precision and byte order as the last component, they have a C-like type * name. If the type begins with `U' then it is the unsigned version of the * integer type; other integer types are signed. The type LLONG corresponds - * to C's `long_long' and LDOUBLE is `long double' (these types might be the + * to C's `long long' and LDOUBLE is `long double' (these types might be the * same as `LONG' and `DOUBLE' respectively). */ #define H5T_NATIVE_CHAR (CHAR_MIN?H5T_NATIVE_SCHAR:H5T_NATIVE_UCHAR) diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 28d8f93..10618c3 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -50,19 +50,19 @@ static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t spac static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, size_t dtype_size); -static unsigned H5Z_scaleoffset_log2(unsigned long_long num); +static unsigned H5Z_scaleoffset_log2(unsigned long long num); static void H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, - uint32_t *minbits, unsigned long_long *minval); + uint32_t *minbits, unsigned long long *minval); static void H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, - uint32_t minbits, unsigned long_long minval); + uint32_t minbits, unsigned long long minval); static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, - uint32_t *minbits, unsigned long_long *minval, double D_val); + uint32_t *minbits, unsigned long long *minval, double D_val); static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, - uint32_t minbits, unsigned long_long minval, double D_val); + uint32_t minbits, unsigned long long minval, double D_val); static void H5Z_scaleoffset_next_byte(size_t *j, int *buf_len); static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, unsigned char *buffer, size_t *j, int *buf_len, @@ -188,8 +188,8 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_save_filval(unsigned int, cd_values, *(int *)&fill_val) \ else if(sizeof(type) == sizeof(long)) \ H5Z_scaleoffset_save_filval(unsigned long, cd_values, *(long *)&fill_val) \ - else if(sizeof(type) == sizeof(long_long)) \ - H5Z_scaleoffset_save_filval(unsigned long_long, cd_values, *(long_long *)&fill_val)\ + else if(sizeof(type) == sizeof(long long)) \ + H5Z_scaleoffset_save_filval(unsigned long long, cd_values, *(long long *)&fill_val)\ else \ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype")\ } @@ -216,8 +216,8 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_get_filval_1(i, int, filval_buf, *(int *)&filval) \ else if(sizeof(type)==sizeof(long)) \ H5Z_scaleoffset_get_filval_1(i, long, filval_buf, *(long *)&filval) \ - else if(sizeof(type)==sizeof(long_long)) \ - H5Z_scaleoffset_get_filval_1(i, long_long, filval_buf, *(long_long *)&filval) \ + else if(sizeof(type)==sizeof(long long)) \ + H5Z_scaleoffset_get_filval_1(i, long long, filval_buf, *(long long *)&filval) \ else \ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype")\ } @@ -303,10 +303,10 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ > HDpow(2.0, (double)(sizeof(long)*8 - 1))) { \ *minbits = sizeof(long)*8; goto done; \ } \ - } else if(sizeof(type)==sizeof(long_long)) { \ + } else if(sizeof(type)==sizeof(long long)) { \ if(H5Z_scaleoffset_rnd(max*HDpow(10.0, D_val) - min*HDpow(10.0, D_val)) \ - > HDpow(2.0, (double)(sizeof(long_long)*8 - 1))) { \ - *minbits = sizeof(long_long)*8; goto done; \ + > HDpow(2.0, (double)(sizeof(long long)*8 - 1))) { \ + *minbits = sizeof(long long)*8; goto done; \ } \ } else \ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype")\ @@ -323,7 +323,7 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \ H5Z_scaleoffset_check_1(type, max, min, minbits) \ span = max - min + 1; \ - *minbits = H5Z_scaleoffset_log2((unsigned long_long)(span+1)); \ + *minbits = H5Z_scaleoffset_log2((unsigned long long)(span+1)); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ @@ -334,7 +334,7 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \ H5Z_scaleoffset_check_1(type, max, min, minbits) \ span = max - min + 1; \ - *minbits = H5Z_scaleoffset_log2((unsigned long_long)span); \ + *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ @@ -355,7 +355,7 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \ H5Z_scaleoffset_check_2(type, max, min, minbits) \ span = max - min + 1; \ - *minbits = H5Z_scaleoffset_log2((unsigned long_long)(span+1)); \ + *minbits = H5Z_scaleoffset_log2((unsigned long long)(span+1)); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ @@ -366,7 +366,7 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \ H5Z_scaleoffset_check_2(type, max, min, minbits) \ span = max - min + 1; \ - *minbits = H5Z_scaleoffset_log2((unsigned long_long)span); \ + *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ @@ -394,12 +394,12 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ *(long *)&buf[i] = H5Z_scaleoffset_rnd( \ buf[i]*HDpow(10.0, D_val) - min*HDpow(10.0, D_val)); \ } \ - else if(sizeof(type)==sizeof(long_long)) \ + else if(sizeof(type)==sizeof(long long)) \ for(i = 0; i < d_nelmts; i++) { \ if(HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \ - *(long_long *)&buf[i] = ((unsigned long_long)1 << *minbits) - 1; \ + *(long long *)&buf[i] = ((unsigned long long)1 << *minbits) - 1; \ else \ - *(long_long *)&buf[i] = H5Z_scaleoffset_rnd( \ + *(long long *)&buf[i] = H5Z_scaleoffset_rnd( \ buf[i]*HDpow(10.0, D_val) - min*HDpow(10.0, D_val)); \ } \ else \ @@ -417,9 +417,9 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ for(i = 0; i < d_nelmts; i++) \ *(long *)&buf[i] = H5Z_scaleoffset_rnd( \ buf[i]*HDpow(10.0, D_val) - min*HDpow(10.0, D_val)); \ - else if(sizeof(type)==sizeof(long_long)) \ + else if(sizeof(type)==sizeof(long long)) \ for(i = 0; i < d_nelmts; i++) \ - *(long_long *)&buf[i] = H5Z_scaleoffset_rnd( \ + *(long long *)&buf[i] = H5Z_scaleoffset_rnd( \ buf[i]*HDpow(10.0, D_val) - min*HDpow(10.0, D_val)); \ else \ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype")\ @@ -434,9 +434,9 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ else if(sizeof(type)==sizeof(long)) \ for(i = 0; i < sizeof(long); i++) \ ((unsigned char *)minval)[i] = (unsigned char)((*(long *)&min & ((long)0xff << i*8)) >> i*8); \ - else if(sizeof(type)==sizeof(long_long)) \ - for(i = 0; i < sizeof(long_long); i++) \ - ((unsigned char *)minval)[i] = (unsigned char)((*(long_long *)&min & ((long_long)0xff << i*8)) >> i*8);\ + else if(sizeof(type)==sizeof(long long)) \ + for(i = 0; i < sizeof(long long); i++) \ + ((unsigned char *)minval)[i] = (unsigned char)((*(long long *)&min & ((long long)0xff << i*8)) >> i*8);\ else \ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype")\ } @@ -446,21 +446,21 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ minbits, minval, D_val) \ { \ type *buf = data, min = 0, max = 0, filval = 0; \ - unsigned long_long span; unsigned i; *minval = 0; \ + unsigned long long span; unsigned i; *minval = 0; \ \ if(filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ \ H5Z_scaleoffset_get_filval_2(i, type, filval_buf, filval) \ H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \ H5Z_scaleoffset_check_3(i, type, max, min, minbits, D_val) \ span = H5Z_scaleoffset_rnd(max*HDpow(10.0,D_val) - min*HDpow(10.0,D_val)) + 1; \ - *minbits = H5Z_scaleoffset_log2((unsigned long_long)(span+1)); \ + *minbits = H5Z_scaleoffset_log2((unsigned long long)(span+1)); \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ H5Z_scaleoffset_modify_1(i, type, buf, d_nelmts, filval, minbits, min, D_val) \ } else { /* fill value undefined */ \ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \ H5Z_scaleoffset_check_3(i, type, max, min, minbits, D_val) \ span = H5Z_scaleoffset_rnd(max*HDpow(10.0,D_val) - min*HDpow(10.0,D_val)) + 1; \ - *minbits = H5Z_scaleoffset_log2((unsigned long_long)span); \ + *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ H5Z_scaleoffset_modify_2(i, type, buf, d_nelmts, min, D_val) \ } \ @@ -506,10 +506,10 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ for(i = 0; i < sizeof(long); i++) { \ mask = ((unsigned char *)&minval)[i]; mask <<= i*8; *(long *)&min |= mask; \ } \ - } else if(sizeof(type)==sizeof(long_long)) { \ - long_long mask; \ - for(i = 0; i < sizeof(long_long); i++) { \ - mask = ((unsigned char *)&minval)[i]; mask <<= i*8; *(long_long *)&min |= mask;\ + } else if(sizeof(type)==sizeof(long long)) { \ + long long mask; \ + for(i = 0; i < sizeof(long long); i++) { \ + mask = ((unsigned char *)&minval)[i]; mask <<= i*8; *(long long *)&min |= mask;\ } \ } else \ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype")\ @@ -526,10 +526,10 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ for(i = 0; i < d_nelmts; i++) \ buf[i] = (*(long *)&buf[i]==(((unsigned long)1 << minbits) - 1))? \ filval:(*(long *)&buf[i])/HDpow(10.0, D_val) + min; \ - else if(sizeof(type)==sizeof(long_long)) \ + else if(sizeof(type)==sizeof(long long)) \ for(i = 0; i < d_nelmts; i++) \ - buf[i] = (*(long_long *)&buf[i]==(((unsigned long_long)1 << minbits) - 1))? \ - filval:(*(long_long *)&buf[i])/HDpow(10.0, D_val) + min; \ + buf[i] = (*(long long *)&buf[i]==(((unsigned long long)1 << minbits) - 1))? \ + filval:(*(long long *)&buf[i])/HDpow(10.0, D_val) + min; \ else \ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \ } @@ -543,9 +543,9 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ else if(sizeof(type)==sizeof(long)) \ for(i = 0; i < d_nelmts; i++) \ buf[i] = (*(long *)&buf[i])/HDpow(10.0, D_val) + min; \ - else if(sizeof(type)==sizeof(long_long)) \ + else if(sizeof(type)==sizeof(long long)) \ for(i = 0; i < d_nelmts; i++) \ - buf[i] = (*(long_long *)&buf[i])/HDpow(10.0, D_val) + min; \ + buf[i] = (*(long long *)&buf[i])/HDpow(10.0, D_val) + min; \ else \ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \ } @@ -651,7 +651,7 @@ H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dty else if(dtype_size == sizeof(unsigned short)) type = t_ushort; else if(dtype_size == sizeof(unsigned int)) type = t_uint; else if(dtype_size == sizeof(unsigned long)) type = t_ulong; - else if(dtype_size == sizeof(unsigned long_long)) type = t_ulong_long; + else if(dtype_size == sizeof(unsigned long long)) type = t_ulong_long; else HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype") } @@ -661,7 +661,7 @@ H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dty else if(dtype_size == sizeof(short)) type = t_short; else if(dtype_size == sizeof(int)) type = t_int; else if(dtype_size == sizeof(long)) type = t_long; - else if(dtype_size == sizeof(long_long)) type = t_long_long; + else if(dtype_size == sizeof(long long)) type = t_long_long; else HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype") } @@ -713,7 +713,7 @@ H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, else if(scale_type == t_ulong) H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values, need_convert, dxpl_id) else if(scale_type == t_ulong_long) - H5Z_scaleoffset_set_filval_1(unsigned long_long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values, need_convert, dxpl_id) else if(scale_type == t_schar) H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values, need_convert, dxpl_id) else if(scale_type == t_short) @@ -723,7 +723,7 @@ H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, else if(scale_type == t_long) H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values, need_convert, dxpl_id) else if(scale_type == t_long_long) - H5Z_scaleoffset_set_filval_2(long_long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_2(long long, dcpl_plist, type, cd_values, need_convert, dxpl_id) else if(scale_type == t_float) H5Z_scaleoffset_set_filval_4(float, dcpl_plist, type, cd_values, need_convert, dxpl_id) else if(scale_type == t_double) @@ -920,7 +920,7 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu int scale_factor = 0; /* scale factor */ double D_val = 0.0; /* decimal scale factor */ uint32_t minbits = 0; /* minimum number of bits to store values */ - unsigned long_long minval= 0; /* minimum value of input buffer */ + unsigned long long minval= 0; /* minimum value of input buffer */ enum H5Z_scaleoffset_type type; /* memory type corresponding to dataset datatype */ int need_convert = FALSE; /* flag indicating convertion of byte order */ unsigned char *outbuf = NULL; /* pointer to new output buffer */ @@ -1009,7 +1009,7 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu * retrieve them corresponding to how they are stored during compression */ uint32_t minbits_mask = 0; - unsigned long_long minval_mask = 0; + unsigned long long minval_mask = 0; unsigned minval_size = 0; minbits = 0; @@ -1020,11 +1020,11 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu } /* retrieval of minval takes into consideration situation where sizeof - * unsigned long_long (datatype of minval) may change from compression + * unsigned long long (datatype of minval) may change from compression * to decompression, only smaller size is used */ - minval_size = sizeof(unsigned long_long) <= ((unsigned char *)*buf)[4] ? - sizeof(unsigned long_long) : ((unsigned char *)*buf)[4]; + minval_size = sizeof(unsigned long long) <= ((unsigned char *)*buf)[4] ? + sizeof(unsigned long long) : ((unsigned char *)*buf)[4]; minval = 0; for(i = 0; i < minval_size; i++) { minval_mask = ((unsigned char *)*buf)[5+i]; @@ -1129,10 +1129,10 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu for(i = 0; i < 4; i++) ((unsigned char *)outbuf)[i] = (minbits & ((uint32_t)0xff << i*8)) >> i*8; - ((unsigned char *)outbuf)[4] = sizeof(unsigned long_long); + ((unsigned char *)outbuf)[4] = sizeof(unsigned long long); - for(i = 0; i < sizeof(unsigned long_long); i++) - ((unsigned char *)outbuf)[5+i] = (unsigned char)((minval & ((unsigned long_long)0xff << i*8)) >> i*8); + for(i = 0; i < sizeof(unsigned long long); i++) + ((unsigned char *)outbuf)[5+i] = (unsigned char)((minval & ((unsigned long long)0xff << i*8)) >> i*8); /* special case: minbits equal to full precision */ if(minbits == p.size * 8) { @@ -1221,11 +1221,11 @@ static double H5Z_scaleoffset_rnd(double val) /* return ceiling of floating-point log2 function * receive unsigned integer as argument 3/10/2005 */ -static unsigned H5Z_scaleoffset_log2(unsigned long_long num) +static unsigned H5Z_scaleoffset_log2(unsigned long long num) { unsigned v = 0; - unsigned long_long lower_bound = 1; /* is power of 2, largest value <= num */ - unsigned long_long val = num; + unsigned long long lower_bound = 1; /* is power of 2, largest value <= num */ + unsigned long long val = num; while(val >>= 1) { v++; lower_bound <<= 1; } @@ -1236,7 +1236,7 @@ static unsigned H5Z_scaleoffset_log2(unsigned long_long num) /* precompress for integer type */ static void H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, - unsigned filavail, const void *filval_buf, uint32_t *minbits, unsigned long_long *minval) + unsigned filavail, const void *filval_buf, uint32_t *minbits, unsigned long long *minval) { if(type == t_uchar) H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, @@ -1251,7 +1251,7 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_ulong_long) - H5Z_scaleoffset_precompress_1(unsigned long_long, data, d_nelmts, + H5Z_scaleoffset_precompress_1(unsigned long long, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_schar) { signed char *buf = data, min = 0, max = 0, filval = 0; @@ -1264,7 +1264,7 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse if((unsigned char)(max - min) > (unsigned char)(~(unsigned char)0 - 2)) { *minbits = sizeof(signed char)*8; return; } span = max - min + 1; - *minbits = H5Z_scaleoffset_log2((unsigned long_long)(span+1)); + *minbits = H5Z_scaleoffset_log2((unsigned long long)(span+1)); } else /* minbits already set, only calculate min */ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ @@ -1278,7 +1278,7 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse *minval = min; return; } span = max - min + 1; - *minbits = H5Z_scaleoffset_log2((unsigned long_long)span); + *minbits = H5Z_scaleoffset_log2((unsigned long long)span); } else /* minbits already set, only calculate min */ H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ @@ -1296,16 +1296,16 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse H5Z_scaleoffset_precompress_2(long, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_long_long) - H5Z_scaleoffset_precompress_2(long_long, data, d_nelmts, + H5Z_scaleoffset_precompress_2(long long, data, d_nelmts, filavail, filval_buf, minbits, minval) } /* postdecompress for integer type */ static void H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, - unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long_long minval) + unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long long minval) { - long_long sminval = *(long_long*)&minval; /* for signed integer types */ + long long sminval = *(long long*)&minval; /* for signed integer types */ if(type == t_uchar) H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, @@ -1320,7 +1320,7 @@ H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleof H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_ulong_long) - H5Z_scaleoffset_postdecompress_1(unsigned long_long, data, d_nelmts, filavail, + H5Z_scaleoffset_postdecompress_1(unsigned long long, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_schar) { signed char *buf = data, filval = 0; unsigned i; @@ -1342,7 +1342,7 @@ H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleof H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, filval_buf, minbits, sminval) else if(type == t_long_long) - H5Z_scaleoffset_postdecompress_2(long_long, data, d_nelmts, filavail, + H5Z_scaleoffset_postdecompress_2(long long, data, d_nelmts, filavail, filval_buf, minbits, sminval) } @@ -1350,7 +1350,7 @@ H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleof success: non-negative, failure: negative 4/15/05 */ static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, -unsigned filavail, const void *filval_buf, uint32_t *minbits, unsigned long_long *minval, double D_val) +unsigned filavail, const void *filval_buf, uint32_t *minbits, unsigned long long *minval, double D_val) { herr_t ret_value=SUCCEED; /* Return value */ @@ -1371,9 +1371,9 @@ done: success: non-negative, failure: negative 4/15/05 */ static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, -unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long_long minval, double D_val) +unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long long minval, double D_val) { - long_long sminval = *(long_long*)&minval; /* for signed integer types */ + long long sminval = *(long long*)&minval; /* for signed integer types */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5Z_scaleoffset_postdecompress_fd, FAIL) diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index b26a4b3..2b35786 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -193,9 +193,9 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); else if((TYPE) == H5T_NATIVE_ULONG) \ H5Z_XFORM_DO_OP1((RESL), (RESR), unsigned long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_LLONG) \ - H5Z_XFORM_LL_DO_OP1((RESL), (RESR), long_long, OP, (SIZE)) \ + H5Z_XFORM_LL_DO_OP1((RESL), (RESR), long long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_ULLONG) \ - H5Z_XFORM_ULL_DO_OP1((RESL), (RESR), unsigned long_long, OP, (SIZE)) \ + H5Z_XFORM_ULL_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_FLOAT) \ H5Z_XFORM_DO_OP1((RESL), (RESR), float, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_DOUBLE) \ @@ -225,9 +225,9 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); else if((TYPE) == H5T_NATIVE_ULONG) \ H5Z_XFORM_DO_OP1((RESL), (RESR), unsigned long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_LLONG) \ - H5Z_XFORM_LL_DO_OP1((RESL), (RESR), long_long, OP, (SIZE)) \ + H5Z_XFORM_LL_DO_OP1((RESL), (RESR), long long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_ULLONG) \ - H5Z_XFORM_ULL_DO_OP1((RESL), (RESR), unsigned long_long, OP, (SIZE)) \ + H5Z_XFORM_ULL_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_FLOAT) \ H5Z_XFORM_DO_OP1((RESL), (RESR), float, OP, (SIZE)) \ else if((TYPE) == H5T_NATIVE_DOUBLE) \ @@ -942,9 +942,9 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size else if(array_type == H5T_NATIVE_ULONG) H5Z_XFORM_DO_OP5(unsigned long, array_size) else if(array_type == H5T_NATIVE_LLONG) - H5Z_XFORM_DO_OP5(long_long, array_size) + H5Z_XFORM_DO_OP5(long long, array_size) else if(array_type == H5T_NATIVE_ULLONG) - H5Z_XFORM_DO_OP5(unsigned long_long, array_size) + H5Z_XFORM_DO_OP5(unsigned long long, array_size) else if(array_type == H5T_NATIVE_FLOAT) H5Z_XFORM_DO_OP5(float, array_size) else if(array_type == H5T_NATIVE_DOUBLE) diff --git a/src/H5detect.c b/src/H5detect.c index e29157d..b67c2b0 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -1396,8 +1396,8 @@ detect_C99_integers64(void) #endif #if H5_SIZEOF_LONG_LONG>0 - DETECT_I(long_long, LLONG, d_g[nd_g]); nd_g++; - DETECT_I(unsigned long_long, ULLONG, d_g[nd_g]); nd_g++; + DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++; + DETECT_I(unsigned long long, ULLONG, d_g[nd_g]); nd_g++; #else /* * This architecture doesn't support an integer type larger than `long' diff --git a/src/H5private.h b/src/H5private.h index 2f75f86..ea55a61 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -404,12 +404,12 @@ * most part. */ #ifndef LLONG_MAX -# define LLONG_MAX ((long_long)(((unsigned long_long)1 \ - <<(8*sizeof(long_long)-1))-1)) -# define LLONG_MIN ((long_long)(-LLONG_MAX)-1) +# define LLONG_MAX ((long long)(((unsigned long long)1 \ + <<(8*sizeof(long long)-1))-1)) +# define LLONG_MIN ((long long)(-LLONG_MAX)-1) #endif #ifndef ULLONG_MAX -# define ULLONG_MAX ((unsigned long_long)((long_long)(-1))) +# define ULLONG_MAX ((unsigned long long)((long long)(-1))) #endif #ifndef SIZET_MAX # define SIZET_MAX ((size_t)(ssize_t)(-1)) diff --git a/src/H5public.h b/src/H5public.h index db2d407..e13091b 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -71,10 +71,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 30 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 32 /* 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.30" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.32" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) @@ -110,24 +110,6 @@ typedef int herr_t; typedef unsigned int hbool_t; typedef int htri_t; -/* - * Although `long long' is part of the revised ANSI-C some compilers don't - * support it yet. We define `long_long' as the longest integral integer type - * supported by the compiler, usually 64 bits. It must be legal to qualify - * `long_long' with `unsigned'. - */ -#if H5_SIZEOF_LONG_LONG>0 -# define long_long long long -#elif H5_SIZEOF___INT64>0 -# define long_long __int64 /*Win32*/ -# undef H5_SIZEOF_LONG_LONG -# define H5_SIZEOF_LONG_LONG H5_SIZEOF___INT64 -#else -# define long_long long int -# undef H5_SIZEOF_LONG_LONG -# define H5_SIZEOF_LONG_LONG H5_SIZEOF_LONG -#endif - /* Define the ssize_t type if it not is defined */ #if H5_SIZEOF_SSIZE_T==0 /* Undefine this size, we will re-define it in one of the sections below */ @@ -139,7 +121,7 @@ typedef int ssize_t; typedef long ssize_t; # define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG #elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG_LONG -typedef long_long ssize_t; +typedef long long ssize_t; # define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG_LONG #else /* Can't find matching type for ssize_t */ # error "nothing appropriate for ssize_t" @@ -151,8 +133,8 @@ typedef long_long ssize_t; * type. */ #if H5_SIZEOF_LONG_LONG >= 8 -typedef unsigned long_long hsize_t; -typedef signed long_long hssize_t; +typedef unsigned long long hsize_t; +typedef signed long long hssize_t; # define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG # define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG #else @@ -184,8 +166,8 @@ typedef signed long_long hssize_t; # define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG # endif /* H5_HAVE_PARALLEL */ #elif H5_SIZEOF_LONG_LONG>=8 - typedef unsigned long_long haddr_t; -# define HADDR_UNDEF ((haddr_t)(long_long)(-1)) + typedef unsigned long long haddr_t; +# define HADDR_UNDEF ((haddr_t)(long long)(-1)) # define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG # ifdef H5_HAVE_PARALLEL # define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT @@ -237,7 +219,7 @@ typedef signed long_long hssize_t; # undef H5_SIZEOF_INT64_T # define H5_SIZEOF_INT64_T H5_SIZEOF_LONG #elif H5_SIZEOF_LONG_LONG>=8 - typedef long_long int64_t; + typedef long long int64_t; # undef H5_SIZEOF_INT64_T # define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG #else @@ -257,7 +239,7 @@ typedef signed long_long hssize_t; # undef H5_SIZEOF_UINT64_T # define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG #elif H5_SIZEOF_LONG_LONG>=8 - typedef unsigned long_long uint64_t; + typedef unsigned long long uint64_t; # undef H5_SIZEOF_UINT64_T # define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG #else diff --git a/src/Makefile.in b/src/Makefile.in index 96b1f3a..dc6e787 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -408,7 +408,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 = 20 +LT_VERS_REVISION = 22 LT_VERS_AGE = 0 H5detect_CFLAGS = -g diff --git a/test/Makefile.am b/test/Makefile.am index 3a729fd..ae54149 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -104,8 +104,8 @@ flush2.chkexe_: flush1.chkexe_ # the temporary file name in ways that the makefile is not aware of. CHECK_CLEANFILES+=cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offset.h5 \ max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ - huge_chunks.h5 chunk_cache.h5 chunk_fast.h5 extend.h5 istore.h5 \ - extlinks*.h5 frspace.h5 links*.h5 \ + huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_fast.h5 \ + extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \ tfile[1-4].h5 th5s[1-3].h5 lheap.h5 fheap.h5 ohdr.h5 stab.h5 \ extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 dt_arith[1-2] \ links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \ diff --git a/test/big.c b/test/big.c index 3cef154..8176929 100644 --- a/test/big.c +++ b/test/big.c @@ -38,7 +38,7 @@ const char *FILENAME[] = { #define MAX_TRIES 100 #if H5_SIZEOF_LONG_LONG >= 8 -# define GB8LL ((unsigned long_long)8*1024*1024*1024) +# define GB8LL ((unsigned long long)8*1024*1024*1024) #else # define GB8LL 0 /*cannot do the test*/ #endif @@ -53,7 +53,7 @@ static hsize_t values_used[WRT_N]; /*------------------------------------------------------------------------- * Function: randll * - * Purpose: Create a random long_long value. + * Purpose: Create a random long long value. * Ensures that a write at this value doesn't overlap any * previous write. * @@ -577,8 +577,8 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); * because we would generate multi-gigabyte files. */ puts("Checking if file system is adequate for this test..."); - if (sizeof(long_long)<8 || 0==GB8LL) { - puts("Test skipped because sizeof(long_long) is too small. This"); + if (sizeof(long long)<8 || 0==GB8LL) { + puts("Test skipped because sizeof(long long) is too small. This"); puts("hardware apparently doesn't support 64-bit integer types."); usage(); goto quit; diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index d1f317f..53c63d7 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -116,7 +116,7 @@ typedef struct { float f, g, h[16], i, j; double k, l, m, n; long o, p, q; - long_long r, s, t; + long long r, s, t; } stype4; #define NX 100u diff --git a/test/dsets.c b/test/dsets.c index 5ea5774..2df76cd 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -51,6 +51,7 @@ const char *FILENAME[] = { "random_chunks", "huge_chunks", "chunk_cache", + "big_chunk", "chunk_fast", NULL }; @@ -173,6 +174,12 @@ const char *FILENAME[] = { #define TOO_HUGE_CHUNK_DIM2_1 ((hsize_t)1024) #define TOO_HUGE_CHUNK_DIM2_2 ((hsize_t)1024) +/* Parameters for testing bypassing chunk cache */ +#define BYPASS_DATASET "Dset" +#define BYPASS_DIM 1000 +#define BYPASS_CHUNK_DIM 500 +#define BYPASS_FILL_VALUE 7 + /* Shared global arrays */ #define DSET_DIM1 100 #define DSET_DIM2 200 @@ -2607,11 +2614,11 @@ test_nbit_int(hid_t file) if((dataset = H5Dcreate2(file, DSET_NBIT_INT_NAME, datatype, space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; - /* Initialize data, assuming size of long_long >= size of int */ + /* Initialize data, assuming size of long long >= size of int */ for(i= 0;i< (size_t)size[0]; i++) for(j = 0; j < (size_t)size[1]; j++) { - orig_data[i][j] = (int)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision - 1))) << offset); + orig_data[i][j] = (int)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision - 1))) << offset); /* even-numbered values are negtive */ if((i*size[1]+j+1)%2 == 0) @@ -2917,7 +2924,7 @@ test_nbit_double(hid_t file) goto error; /* Check that the values read are the same as the values written - * Assume size of long_long = size of double + * Assume size of long long = size of double */ for(i=0; i<(size_t)size[0]; i++) { for(j=0; j<(size_t)size[1]; j++) { @@ -3019,13 +3026,13 @@ test_nbit_array(hid_t file) if((dataset = H5Dcreate2(file, DSET_NBIT_ARRAY_NAME, array_datatype, space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; - /* Initialize data, assuming size of long_long >= size of unsigned int */ + /* Initialize data, assuming size of long long >= size of unsigned int */ for(i= 0;i< (size_t)size[0]; i++) for(j = 0; j < (size_t)size[1]; j++) for(m = 0; m < (size_t)adims[0]; m++) for(n = 0; n < (size_t)adims[1]; n++) - orig_data[i][j][m][n] = (unsigned int)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)precision)) << offset); + orig_data[i][j][m][n] = (unsigned int)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)precision)) << offset); PASSED(); #else SKIPPED(); @@ -3201,15 +3208,15 @@ test_nbit_compound(hid_t file) if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME, cmpd_tid, space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; - /* Initialize data, assuming size of long_long >= size of member datatypes */ + /* Initialize data, assuming size of long long >= size of member datatypes */ for(i= 0;i< (size_t)size[0]; i++) for(j = 0; j < (size_t)size[1]; j++) { - orig_data[i][j].i = (int)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); - orig_data[i][j].c = (char)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[1]-1))) << offset[1]); - orig_data[i][j].s = (short)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[2]-1))) << offset[2]); + orig_data[i][j].i = (int)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); + orig_data[i][j].c = (char)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[1]-1))) << offset[1]); + orig_data[i][j].s = (short)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[2]-1))) << offset[2]); orig_data[i][j].f = float_val[i][j]; /* some even-numbered integer values are negtive */ @@ -3448,33 +3455,33 @@ test_nbit_compound_2(hid_t file) if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME_2, cmpd_tid2, space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; - /* Initialize data, assuming size of long_long >= size of member datatypes */ + /* Initialize data, assuming size of long long >= size of member datatypes */ for(i= 0;i< (size_t)size[0]; i++) for(j = 0; j < (size_t)size[1]; j++) { - orig_data[i][j].a.i = (int)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); - orig_data[i][j].a.c = (char)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[1]-1))) << offset[1]); - orig_data[i][j].a.s = (short)(-((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[2]-1))) << offset[2]); + orig_data[i][j].a.i = (int)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); + orig_data[i][j].a.c = (char)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[1]-1))) << offset[1]); + orig_data[i][j].a.s = (short)(-((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[2]-1))) << offset[2]); orig_data[i][j].a.f = float_val[i][j]; - orig_data[i][j].v = (unsigned int)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)precision[3])) << offset[3]); + orig_data[i][j].v = (unsigned int)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)precision[3])) << offset[3]); for(m = 0; m < (size_t)array_dims[0]; m++) for(n = 0; n < (size_t)array_dims[1]; n++) - orig_data[i][j].b[m][n] = (char)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[4]-1))) << offset[4]); + orig_data[i][j].b[m][n] = (char)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[4]-1))) << offset[4]); for(m = 0; m < (size_t)array_dims[0]; m++) for(n = 0; n < (size_t)array_dims[1]; n++) { - orig_data[i][j].d[m][n].i = (int)(-((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); - orig_data[i][j].d[m][n].c = (char)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[1]-1))) << offset[1]); - orig_data[i][j].d[m][n].s = (short)(((long_long)HDrandom() % - (long_long)HDpow(2.0, (double)(precision[2]-1))) << offset[2]); + orig_data[i][j].d[m][n].i = (int)(-((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); + orig_data[i][j].d[m][n].c = (char)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[1]-1))) << offset[1]); + orig_data[i][j].d[m][n].s = (short)(((long long)HDrandom() % + (long long)HDpow(2.0, (double)(precision[2]-1))) << offset[2]); orig_data[i][j].d[m][n].f = float_val[i][j]; } } @@ -6690,6 +6697,139 @@ error: /*------------------------------------------------------------------------- + * Function: test_big_chunks_bypass_cache + * + * Purpose: When the chunk size is bigger than the cache size and the + * chunk isn't on disk, this test verifies that the library + * bypasses the cache. + * + * Note: This test is not very conclusive - it doesn't actually check + * is the chunks bypass the cache... :-( -QAK + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 11 Feb 2009 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_big_chunks_bypass_cache(hid_t fapl) +{ + char filename[FILENAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t fapl_local = -1; /* File access property list ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t dsid = -1; /* Dataset ID */ + hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */ + size_t rdcc_nelmts, rdcc_nbytes; + int fvalue = BYPASS_FILL_VALUE; + hsize_t count, stride, offset, block; + static int wdata[BYPASS_CHUNK_DIM], rdata[BYPASS_DIM]; + int i, j; + herr_t ret; /* Generic return value */ + + TESTING("big chunks bypassing the cache"); + + h5_fixname(FILENAME[9], fapl, filename, sizeof filename); + + /* Copy fapl passed to this function (as we will be modifying it) */ + if((fapl_local = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR + + /* Define cache size to be smaller than chunk size */ + rdcc_nelmts = BYPASS_CHUNK_DIM/5; + rdcc_nbytes = sizeof(int)*BYPASS_CHUNK_DIM/5; + if(H5Pset_cache(fapl_local, 0, rdcc_nelmts, rdcc_nbytes, 0) < 0) FAIL_STACK_ERROR + + /* Create file */ + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_local)) < 0) FAIL_STACK_ERROR + + /* Create 1-D dataspace */ + dim = BYPASS_DIM; + if((sid = H5Screate_simple(1, &dim, NULL)) < 0) FAIL_STACK_ERROR + + /* Create dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR + + /* Define chunk size. There will be only 2 chunks in the dataset. */ + chunk_dim = BYPASS_CHUNK_DIM; + if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR + + /* Define fill value, fill time, and chunk allocation time */ + if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fvalue) < 0) FAIL_STACK_ERROR + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) FAIL_STACK_ERROR + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR) < 0) FAIL_STACK_ERROR + + /* Try to create dataset */ + if((dsid = H5Dcreate2(fid, BYPASS_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Select first chunk to write the data */ + offset = 0; + count = 1; + stride = 1; + block = BYPASS_CHUNK_DIM; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &offset, &stride, &count, &block) < 0) + FAIL_STACK_ERROR + + /* Initialize data to write */ + for(i = 0; i < BYPASS_CHUNK_DIM; i++) + wdata[i] = i; + + /* This write should bypass the cache because the chunk is bigger than the cache size + * and it's not allocated on disk. */ + if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, wdata) < 0) + FAIL_STACK_ERROR + + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + + /* Reopen the dataset */ + if((dsid = H5Dopen2(fid, BYPASS_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Reads both 2 chunks. Reading the second chunk should bypass the cache because the + * chunk is bigger than the cache size and it isn't allocated on disk. */ + if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0) + FAIL_STACK_ERROR + + for(i = 0; i < BYPASS_CHUNK_DIM; i++) + if(rdata[i] != i) { + printf(" Read different values than written in the 1st chunk.\n"); + printf(" At line %d and index %d, rdata = %d. It should be %d.\n", __LINE__, i, rdata[i], i); + TEST_ERROR + } /* end if */ + + for(j = BYPASS_CHUNK_DIM; j < BYPASS_DIM; j++) + if(rdata[j] != fvalue) { + printf(" Read different values than written in the 2nd chunk.\n"); + printf(" At line %d and index %d, rdata = %d. It should be %d.\n", __LINE__, i, rdata[i], fvalue); + TEST_ERROR + } /* end if */ + + /* Close IDs */ + if(H5Sclose(sid) < 0) FAIL_STACK_ERROR + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR + if(H5Pclose(fapl_local) < 0) FAIL_STACK_ERROR + if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Pclose(fapl_local); + H5Dclose(dsid); + H5Sclose(sid); + H5Fclose(fid); + } H5E_END_TRY; + return -1; +} /* end test_big_chunks_bypass_cache() */ + + +/*------------------------------------------------------------------------- * Function: test_chunk_fast * * Purpose: Tests support for extensible arrays as chunk index. @@ -7050,6 +7190,7 @@ main(void) #endif /* H5_NO_DEPRECATED_SYMBOLS */ nerrors += (test_huge_chunks(my_fapl) < 0 ? 1 : 0); nerrors += (test_chunk_cache(my_fapl) < 0 ? 1 : 0); + nerrors += (test_big_chunks_bypass_cache(my_fapl) < 0 ? 1 : 0); nerrors += (test_chunk_fast(my_fapl) < 0 ? 1 : 0); if(H5Fclose(file) < 0) diff --git a/test/dt_arith.c b/test/dt_arith.c index 67885a3..e507fd0 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -1668,8 +1668,8 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) unsigned hw_uint; long hw_long; unsigned long hw_ulong; - long_long hw_llong; - unsigned long_long hw_ullong; + long long hw_llong; + unsigned long long hw_ullong; /* What are the names of the source and destination types */ if (H5Tequal(src, H5T_NATIVE_SCHAR)) { @@ -1766,7 +1766,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) dst_nbits = H5Tget_precision(dst); /* not 8*dst_size, esp on J90 - QAK */ src_sign = H5Tget_sign(src); dst_sign = H5Tget_sign(dst); - aligned = HDcalloc(1, sizeof(long_long)); + aligned = HDcalloc(1, sizeof(long long)); /* Allocate and initialize the source buffer through macro INIT_INTEGER. The BUF * will be used for the conversion while the SAVED buffer will be @@ -1789,9 +1789,9 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) } else if(src_type == INT_ULONG) { INIT_INTEGER(unsigned long, ULONG_MAX, 0, src_size, dst_size, src_nbits, buf, saved, nelmts); } else if(src_type == INT_LLONG) { - INIT_INTEGER(long_long, LLONG_MAX, LLONG_MIN, src_size, dst_size, src_nbits, buf, saved, nelmts); + INIT_INTEGER(long long, LLONG_MAX, LLONG_MIN, src_size, dst_size, src_nbits, buf, saved, nelmts); } else if(src_type == INT_ULLONG) { - INIT_INTEGER(unsigned long_long, ULLONG_MAX, 0, src_size, dst_size, src_nbits, buf, saved, nelmts); + INIT_INTEGER(unsigned long long, ULLONG_MAX, 0, src_size, dst_size, src_nbits, buf, saved, nelmts); } else goto error; @@ -1837,12 +1837,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw_char = (signed char)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_char = (signed char)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_char = (signed char)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_char = (signed char)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_char = (signed char)(*((unsigned long long*)aligned)); break; default: break; @@ -1883,12 +1883,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw_uchar = (unsigned char)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_uchar = (unsigned char)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_uchar = (unsigned char)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_uchar = (unsigned char)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_uchar = (unsigned char)(*((unsigned long long*)aligned)); break; default: break; @@ -1929,12 +1929,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw_short = (short)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_short = (short)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_short = (short)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_short = (short)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_short = (short)(*((unsigned long long*)aligned)); break; default: @@ -1976,12 +1976,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw_ushort = (unsigned short)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_ushort = (unsigned short)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_ushort = (unsigned short)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_ushort = (unsigned short)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_ushort = (unsigned short)(*((unsigned long long*)aligned)); break; default: break; @@ -2022,12 +2022,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw_int = (int)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_int = (int)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_int = (int)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_int = (int)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_int = (int)(*((unsigned long long*)aligned)); break; default: break; @@ -2068,12 +2068,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw_uint = (unsigned int)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_uint = (unsigned int)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_uint = (unsigned int)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_uint = (unsigned int)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_uint = (unsigned int)(*((unsigned long long*)aligned)); break; default: break; @@ -2114,12 +2114,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw_long = (long int)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_long = (long int)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_long = (long int)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_long = (long int)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_long = (long int)(*((unsigned long long*)aligned)); break; default: break; @@ -2160,12 +2160,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw_ulong = (unsigned long)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_ulong = (unsigned long)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_ulong = (unsigned long)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_ulong = (unsigned long)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_ulong = (unsigned long)(*((unsigned long long*)aligned)); break; default: break; @@ -2175,43 +2175,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) switch (src_type) { case INT_SCHAR: HDmemcpy(aligned, saved+j*sizeof(char), sizeof(char)); - hw_llong = (long_long)(*((char*)aligned)); + hw_llong = (long long)(*((char*)aligned)); break; case INT_UCHAR: HDmemcpy(aligned, saved+j*sizeof(unsigned char), sizeof(unsigned char)); - hw_llong = (long_long)(*((unsigned char*)aligned)); + hw_llong = (long long)(*((unsigned char*)aligned)); break; case INT_SHORT: HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); - hw_llong = (long_long)(*((short*)aligned)); + hw_llong = (long long)(*((short*)aligned)); break; case INT_USHORT: HDmemcpy(aligned, saved+j*sizeof(unsigned short), sizeof(unsigned short)); - hw_llong = (long_long)(*((unsigned short*)aligned)); + hw_llong = (long long)(*((unsigned short*)aligned)); break; case INT_INT: HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); - hw_llong = (long_long)(*((int*)aligned)); + hw_llong = (long long)(*((int*)aligned)); break; case INT_UINT: HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); - hw_llong = (long_long)(*((unsigned*)aligned)); + hw_llong = (long long)(*((unsigned*)aligned)); break; case INT_LONG: HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); - hw_llong = (long_long)(*((long*)aligned)); + hw_llong = (long long)(*((long*)aligned)); break; case INT_ULONG: HDmemcpy(aligned, saved+j*sizeof(unsigned long), sizeof(unsigned long)); - hw_llong = (long_long)(*((unsigned long*)aligned)); + hw_llong = (long long)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_llong = (long_long)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_llong = (long long)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_llong = (long_long)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_llong = (long long)(*((unsigned long long*)aligned)); break; default: break; @@ -2221,43 +2221,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) switch (src_type) { case INT_SCHAR: HDmemcpy(aligned, saved+j*sizeof(signed char), sizeof(signed char)); - hw_ullong = (unsigned long_long)(*((signed char*)aligned)); + hw_ullong = (unsigned long long)(*((signed char*)aligned)); break; case INT_UCHAR: HDmemcpy(aligned, saved+j*sizeof(unsigned char), sizeof(unsigned char)); - hw_ullong = (unsigned long_long)(*((unsigned char*)aligned)); + hw_ullong = (unsigned long long)(*((unsigned char*)aligned)); break; case INT_SHORT: HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); - hw_ullong = (unsigned long_long)(*((short*)aligned)); + hw_ullong = (unsigned long long)(*((short*)aligned)); break; case INT_USHORT: HDmemcpy(aligned, saved+j*sizeof(unsigned short), sizeof(unsigned short)); - hw_ullong = (unsigned long_long)(*((unsigned short*)aligned)); + hw_ullong = (unsigned long long)(*((unsigned short*)aligned)); break; case INT_INT: HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); - hw_ullong = (unsigned long_long)(*((int*)aligned)); + hw_ullong = (unsigned long long)(*((int*)aligned)); break; case INT_UINT: HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); - hw_ullong = (unsigned long_long)(*((unsigned*)aligned)); + hw_ullong = (unsigned long long)(*((unsigned*)aligned)); break; case INT_LONG: HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); - hw_ullong = (unsigned long_long)(*((long*)aligned)); + hw_ullong = (unsigned long long)(*((long*)aligned)); break; case INT_ULONG: HDmemcpy(aligned, saved+j*sizeof(unsigned long), sizeof(unsigned long)); - hw_ullong = (unsigned long_long)(*((unsigned long*)aligned)); + hw_ullong = (unsigned long long)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_ullong = (unsigned long_long)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_ullong = (unsigned long long)(*((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_ullong = (unsigned long_long)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_ullong = (unsigned long long)(*((unsigned long long*)aligned)); break; default: break; @@ -2426,12 +2426,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) printf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)aligned)); break; default: break; @@ -2475,12 +2475,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) printf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, buf+j*sizeof(long_long), sizeof(long_long)); - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); + HDmemcpy(aligned, buf+j*sizeof(long long), sizeof(long long)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, buf+j*sizeof(long_long), sizeof(unsigned long_long)); - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)aligned)); + HDmemcpy(aligned, buf+j*sizeof(long long), sizeof(unsigned long long)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)aligned)); break; default: break; @@ -2516,10 +2516,10 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) printf(" %29lu\n", *((unsigned long*)hw)); break; case INT_LLONG: - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)hw)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)hw)); break; case INT_ULLONG: - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)hw)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)hw)); break; default: break; @@ -3478,8 +3478,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) unsigned hw_uint=0; long hw_long=0; unsigned long hw_ulong=0; - long_long hw_llong=0; - unsigned long_long hw_ullong=0; + long long hw_llong=0; + unsigned long long hw_ullong=0; /* What is the name of the source type */ if (H5Tequal(src, H5T_NATIVE_SCHAR)) { @@ -3650,7 +3650,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) dst_size = H5Tget_size(dst); src_nbits = H5Tget_precision(src); /* not 8*src_size, esp on J90 - QAK */ dst_nbits = H5Tget_precision(dst); /* not 8*dst_size, esp on J90 - QAK */ - aligned = HDcalloc(1, MAX(sizeof(long double), sizeof(long_long))); + aligned = HDcalloc(1, MAX(sizeof(long double), sizeof(long long))); #ifdef SHOW_OVERFLOWS noverflows_g = 0; #endif @@ -3707,9 +3707,9 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) } else if(src_type == INT_ULONG) { INIT_INTEGER(unsigned long, ULONG_MAX, 0, src_size, dst_size, src_nbits, buf, saved, nelmts); } else if(src_type == INT_LLONG) { - INIT_INTEGER(long_long, LLONG_MAX, LLONG_MIN, src_size, dst_size, src_nbits, buf, saved, nelmts); + INIT_INTEGER(long long, LLONG_MAX, LLONG_MIN, src_size, dst_size, src_nbits, buf, saved, nelmts); } else if(src_type == INT_ULLONG) { - INIT_INTEGER(unsigned long_long, ULLONG_MAX, 0, src_size, dst_size, src_nbits, buf, saved, nelmts); + INIT_INTEGER(unsigned long long, ULLONG_MAX, 0, src_size, dst_size, src_nbits, buf, saved, nelmts); } else if(src_type == FLT_FLOAT) { if(run_test==TEST_NORMAL) { INIT_FP_NORM(float, FLT_MAX, FLT_MIN, FLT_MAX_10_EXP, FLT_MIN_10_EXP, @@ -3795,13 +3795,13 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw_float = (float)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_float = (float)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_float = (float)(*((long long*)aligned)); break; #ifdef H5_ULLONG_TO_FP_CAST_WORKS case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_float = (float)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_float = (float)(*((unsigned long long*)aligned)); break; #endif /* H5_ULLONG_TO_FP_CAST_WORKS */ default: @@ -3843,13 +3843,13 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw_double = (double)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_double = (double)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_double = (double)(*((long long*)aligned)); break; #ifdef H5_ULLONG_TO_FP_CAST_WORKS case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_double = (double)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_double = (double)(*((unsigned long long*)aligned)); break; #endif /* H5_ULLONG_TO_FP_CAST_WORKS */ default: @@ -3892,13 +3892,13 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) hw_ldouble = (long double)(*((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - hw_ldouble = (long double)(*((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + hw_ldouble = (long double)(*((long long*)aligned)); break; #ifdef H5_ULLONG_TO_FP_CAST_WORKS case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - hw_ldouble = (long double)(*((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + hw_ldouble = (long double)(*((unsigned long long*)aligned)); break; #endif /* H5_ULLONG_TO_FP_CAST_WORKS */ default: @@ -4070,16 +4070,16 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) switch (src_type) { case FLT_FLOAT: HDmemcpy(aligned, saved+j*sizeof(float), sizeof(float)); - hw_llong = (long_long)(*((float*)aligned)); + hw_llong = (long long)(*((float*)aligned)); break; case FLT_DOUBLE: HDmemcpy(aligned, saved+j*sizeof(double), sizeof(double)); - hw_llong = (long_long)(*((double*)aligned)); + hw_llong = (long long)(*((double*)aligned)); break; #if H5_SIZEOF_LONG_DOUBLE !=0 case FLT_LDOUBLE: HDmemcpy(aligned, saved+j*sizeof(long double), sizeof(long double)); - hw_llong = (long_long)(*((long double*)aligned)); + hw_llong = (long long)(*((long double*)aligned)); break; #endif default: @@ -4090,16 +4090,16 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) switch (src_type) { case FLT_FLOAT: HDmemcpy(aligned, saved+j*sizeof(float), sizeof(float)); - hw_ullong = (unsigned long_long)(*((float*)aligned)); + hw_ullong = (unsigned long long)(*((float*)aligned)); break; case FLT_DOUBLE: HDmemcpy(aligned, saved+j*sizeof(double), sizeof(double)); - hw_ullong = (unsigned long_long)(*((double*)aligned)); + hw_ullong = (unsigned long long)(*((double*)aligned)); break; #if H5_SIZEOF_LONG_DOUBLE !=0 case FLT_LDOUBLE: HDmemcpy(aligned, saved+j*sizeof(long double), sizeof(long double)); - hw_ullong = (unsigned long_long)(*((long double*)aligned)); + hw_ullong = (unsigned long long)(*((long double*)aligned)); break; #endif default: @@ -4258,10 +4258,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if((tmp_s+1)==tmp_h || (tmp_s-1)==tmp_h) continue; /*no error*/ } /* end if */ - else if (dst_size==sizeof(unsigned long_long)) { - unsigned long_long tmp_s, tmp_h; - HDmemcpy(&tmp_s,&buf[j*dst_size],sizeof(unsigned long_long)); - HDmemcpy(&tmp_h,&hw[0],sizeof(unsigned long_long)); + else if (dst_size==sizeof(unsigned long long)) { + unsigned long long tmp_s, tmp_h; + HDmemcpy(&tmp_s,&buf[j*dst_size],sizeof(unsigned long long)); + HDmemcpy(&tmp_h,&hw[0],sizeof(unsigned long long)); if((tmp_s+1)==tmp_h || (tmp_s-1)==tmp_h) continue; /*no error*/ } /* end if */ @@ -4273,9 +4273,9 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) */ #ifndef H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS if((src_type==FLT_FLOAT || src_type==FLT_DOUBLE) && dst_type==INT_ULLONG) { - unsigned long_long tmp_s, tmp_h; - HDmemcpy(&tmp_s,&buf[j*dst_size],sizeof(unsigned long_long)); - HDmemcpy(&tmp_h,&hw[0],sizeof(unsigned long_long)); + unsigned long long tmp_s, tmp_h; + HDmemcpy(&tmp_s,&buf[j*dst_size],sizeof(unsigned long long)); + HDmemcpy(&tmp_h,&hw[0],sizeof(unsigned long long)); if((tmp_s+1)==tmp_h) continue; /*no error*/ } @@ -4347,12 +4347,12 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) printf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, saved+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)aligned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)aligned)); break; case FLT_FLOAT: HDmemcpy(aligned, saved+j*sizeof(float), sizeof(float)); @@ -4410,12 +4410,12 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) printf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: - HDmemcpy(aligned, buf+j*sizeof(long_long), sizeof(long_long)); - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); + HDmemcpy(aligned, buf+j*sizeof(long long), sizeof(long long)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)aligned)); break; case INT_ULLONG: - HDmemcpy(aligned, buf+j*sizeof(unsigned long_long), sizeof(unsigned long_long)); - HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)aligned)); + HDmemcpy(aligned, buf+j*sizeof(unsigned long long), sizeof(unsigned long long)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)aligned)); break; case FLT_FLOAT: HDmemcpy(aligned, buf+j*sizeof(float), sizeof(float)); @@ -4465,10 +4465,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) printf(" %29lu\n", *((unsigned long*)hw)); break; case INT_LLONG: - printf(" %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)hw)); + printf(" %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)hw)); break; case INT_ULLONG: - printf(" %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)hw)); + printf(" %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)hw)); break; case FLT_FLOAT: printf(" %29f\n", *((float*)hw)); diff --git a/test/dtransform.c b/test/dtransform.c index c5a4fa8..3297fe6 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -265,14 +265,14 @@ int main(void) TEST_TYPE_CONTIG(dxpl_id_utrans_inv, unsigned long, H5T_NATIVE_ULONG, "ulong", transformData, 0); #ifdef H5_LLONG_TO_FP_CAST_WORKS - TEST_TYPE_CONTIG(dxpl_id_c_to_f, long_long, H5T_NATIVE_LLONG, "llong", windchillFfloat, 1); + TEST_TYPE_CONTIG(dxpl_id_c_to_f, long long, H5T_NATIVE_LLONG, "llong", windchillFfloat, 1); #else TESTING("contiguous, with type conversion (float->llong)") SKIPPED() #endif #ifdef H5_ULLONG_TO_FP_CAST_WORKS - TEST_TYPE_CONTIG(dxpl_id_utrans_inv, unsigned long_long, H5T_NATIVE_ULLONG, "ullong", transformData, 0); + TEST_TYPE_CONTIG(dxpl_id_utrans_inv, unsigned long long, H5T_NATIVE_ULLONG, "ullong", transformData, 0); #else TESTING("contiguous, with type conversion (float->ullong)") SKIPPED() @@ -293,14 +293,14 @@ int main(void) TEST_TYPE_CHUNK(dxpl_id_c_to_f, long, H5T_NATIVE_LONG, "long", windchillFfloat, 1); TEST_TYPE_CHUNK(dxpl_id_utrans_inv, unsigned long, H5T_NATIVE_ULONG, "ulong", transformData, 0); #ifdef H5_LLONG_TO_FP_CAST_WORKS - TEST_TYPE_CHUNK(dxpl_id_c_to_f, long_long, H5T_NATIVE_LLONG, "llong", windchillFfloat, 1); + TEST_TYPE_CHUNK(dxpl_id_c_to_f, long long, H5T_NATIVE_LLONG, "llong", windchillFfloat, 1); #else TESTING("chunked, with type conversion (float->llong)") SKIPPED() #endif #ifdef H5_ULLONG_TO_FP_CAST_WORKS - TEST_TYPE_CHUNK(dxpl_id_utrans_inv, unsigned long_long, H5T_NATIVE_ULLONG, "ullong", transformData, 0); + TEST_TYPE_CHUNK(dxpl_id_utrans_inv, unsigned long long, H5T_NATIVE_ULLONG, "ullong", transformData, 0); #else TESTING("chunked, with type conversion (float->ullong)") SKIPPED() diff --git a/test/earray.c b/test/earray.c index 6935a15..7b68e95 100644 --- a/test/earray.c +++ b/test/earray.c @@ -2381,14 +2381,14 @@ main(void) nelmts = (hsize_t)(1 + cparam.idx_blk_elmts + tparam.sblk_info[sblk].start_idx + (tparam.sblk_info[sblk].dblk_nelmts * dblk)); - sprintf(test_str, "setting first element of array's data block #%llu", (unsigned long_long)ndblks); + sprintf(test_str, "setting first element of array's data block #%llu", (unsigned long long)ndblks); nerrors += test_set_elmts(fapl, &cparam, &tparam, nelmts, test_str); /* Test all elements in data block */ nelmts = (hsize_t)(cparam.idx_blk_elmts + tparam.sblk_info[sblk].start_idx + (tparam.sblk_info[sblk].dblk_nelmts * (dblk + 1))); - sprintf(test_str, "setting all elements of array's data block #%llu", (unsigned long_long)ndblks); + sprintf(test_str, "setting all elements of array's data block #%llu", (unsigned long long)ndblks); nerrors += test_set_elmts(fapl, &cparam, &tparam, nelmts, test_str); /* Increment data block being tested */ diff --git a/test/ntypes.c b/test/ntypes.c index c8e7ccd..a82f051 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -284,7 +284,7 @@ test_compound_dtype2(hid_t file) char c; int i; s2 st; - unsigned long_long l; + unsigned long long l; } s1; hid_t dataset, space; hid_t dtype, native_type, tid, tid2, tid_m, tid_m2, @@ -310,7 +310,7 @@ test_compound_dtype2(hid_t file) temp_point->i = n++; temp_point->st.c2 = (short)(i + j); temp_point->st.l2 = (i * 5 + j * 50) * n; - temp_point->l = (unsigned long_long)((i * 10 + j * 100) * n); + temp_point->l = (unsigned long long)((i * 10 + j * 100) * n); } } @@ -531,7 +531,7 @@ test_compound_dtype(hid_t file) typedef struct { char c; unsigned int i; - long_long l; + long long l; } s1; hid_t dataset, space; hid_t dtype, native_type, tid, tid2, mem_id; @@ -703,7 +703,7 @@ test_compound_dtype3(hid_t file) typedef struct { char c; int a[5]; - long_long l; + long long l; } s1; hid_t dataset, space; hid_t dtype, native_type, tid, tid2, tid_m, tid_m2, @@ -902,7 +902,7 @@ test_compound_opaque(hid_t file) typedef struct { char c; unsigned char o[5]; - long_long l; + long long l; } s1; hid_t dataset, space; hid_t dtype, native_type, tid, tid2, tid_m, @@ -1218,7 +1218,7 @@ test_array_dtype(hid_t file) typedef struct { char c; int i; - long_long l; + long long l; } s1; hid_t dataset, space; hid_t dtype, native_type, tid, tid2, tid3, tid_m; diff --git a/test/tattr.c b/test/tattr.c index fe092e6..4b130e6 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -135,6 +135,10 @@ float attr_data5=(float)-5.123; /* Test data for 5th attribute */ #define BUG2_NATTR 100 #define BUG2_NATTR2 16 +#define BUG3_DSET_NAME "dset" +#define BUG3_DT_NAME "dt" +#define BUG3_ATTR_NAME "attr" + /* Attribute iteration struct */ typedef struct { H5_iter_order_t order; /* Direction of iteration */ @@ -9288,7 +9292,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) attr = H5Acreate2(dataset, attrname, attr_tid, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); - /* Check that attribute is shared */ + /* ChecFk that attribute is shared */ is_shared = H5A_is_shared_test(attr); VERIFY(is_shared, TRUE, "H5A_is_shared_test"); @@ -9773,6 +9777,374 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /**************************************************************** ** +** test_attr_bug3(): Test basic H5A (attribute) code. +** Tests creating and deleting attributes which use a +** datatype and/or dataspace stored in the same object +** header. +** +****************************************************************/ +static void +test_attr_bug3(hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t aid1, aid2; /* Attribute IDs */ + hid_t sid1, sid2; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ + hid_t did; /* Dataset ID */ + hsize_t dims1[2] = {2, 2}, + dims2[2] = {3, 3}; /* Dimensions */ + int wdata1[2][2]; + unsigned wdata2[3][3]; /* Write buffers */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Attributes in the Same Header as their Datatypes\n")); + + /* Create dataspaces */ + sid1 = H5Screate_simple(2, dims1, NULL); + CHECK(sid1, FAIL, "H5Screate_simple"); + sid2 = H5Screate_simple(2, dims2, NULL); + CHECK(sid2, FAIL, "H5Screate_simple"); + + /* Create file to operate on */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create datatypes and commit tid1 */ + tid1 = H5Tcopy(H5T_STD_I16BE); + CHECK(tid1, FAIL, "H5Tcopy"); + tid2 = H5Tcopy(H5T_STD_U64LE); + CHECK(tid1, FAIL, "H5Tcopy"); + ret = H5Tcommit2(fid, "dtype", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* Create dataset */ + did = H5Dcreate2(fid, "dset", tid2, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Create attribute on datatype, using that datatype as its datatype */ + aid1 = H5Acreate2(tid1, "attr", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid1, FAIL, "H5Acreate2"); + + /* Create attribute on dataset, using its datatype and dataspace */ + aid2 = H5Acreate2(did, "attr", tid2, sid2, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid2, FAIL, "H5Acreate2"); + + /* Close attributes */ + ret = H5Aclose(aid1); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aid2); + CHECK(ret, FAIL, "H5Aclose"); + + /* Reopen attributes */ + aid1 = H5Aopen(tid1, "attr", H5P_DEFAULT); + CHECK(aid1, FAIL, "H5Aopen"); + aid2 = H5Aopen(did, "attr", H5P_DEFAULT); + CHECK(aid2, FAIL, "H5Aopen"); + + /* Write data to the attributes (the data is uninitialized, we only care + * that H5Awrite succeeds for now) */ + ret = H5Awrite(aid1, H5T_NATIVE_INT, wdata1[0]); + CHECK(ret, FAIL, "H5Awrite"); + ret = H5Awrite(aid2, H5T_NATIVE_UINT, wdata2[0]); + CHECK(ret, FAIL, "H5Awrite"); + + /* Close attributes */ + ret = H5Aclose(aid1); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aid2); + CHECK(ret, FAIL, "H5Aclose"); + + /* Delete attributes */ + ret = H5Adelete(tid1, "attr"); + CHECK(ret, FAIL, "H5Adelete"); + ret = H5Adelete(did, "attr"); + CHECK(ret, FAIL, "H5Adelete"); + + /* Recreate attributes */ + aid1 = H5Acreate2(tid1, "attr", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid1, FAIL, "H5Acreate2"); + aid2 = H5Acreate2(did, "attr", tid2, sid2, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid2, FAIL, "H5Acreate2"); + + /* Delete attributes (note they are still open) */ + ret = H5Adelete(tid1, "attr"); + CHECK(ret, FAIL, "H5Adelete"); + ret = H5Adelete(did, "attr"); + CHECK(ret, FAIL, "H5Adelete"); + + /* Close dataspaces and transient datatype */ + ret = H5Sclose(sid1); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(sid2); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Tclose(tid2); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close dataset and committed datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + /* Delete dataset and committed datatype */ + ret = H5Ldelete(fid, "dtype", H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tclose"); + ret = H5Ldelete(fid, "dset", H5P_DEFAULT); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close attributes */ + ret = H5Aclose(aid1); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aid2); + CHECK(ret, FAIL, "H5Aclose"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} /* test_attr_bug3() */ + +/**************************************************************** +** +** test_attr_bug4(): Test basic H5A (attribute) code. +** Attempts to trigger a bug which would result in being +** unable to add an attribute to a named datatype. This +** happened when an object header chunk was too small to +** hold a continuation message and could not be extended. +** +****************************************************************/ +static void +test_attr_bug4(hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t gid; /* Group ID */ + hid_t aid1, aid2, aid3; /* Attribute IDs */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hid_t did; /* Dataset ID */ + hsize_t dims[1] = {5}; /* Attribute dimensions */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing that attributes can always be added to named datatypes\n")); + + /* Create dataspace */ + sid = H5Screate_simple(1, dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + /* Create file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Open root group */ + gid = H5Gopen2(fid, "/", H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Create committed datatype */ + tid = H5Tcopy(H5T_STD_I32LE); + CHECK(tid, FAIL, "H5Tcopy"); + ret = H5Tcommit2(fid, "dtype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* Create dataset */ + did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Create attributes on group and dataset */ + aid1 = H5Acreate2(gid, "attr", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid1, FAIL, "H5Acreate2"); + aid2 = H5Acreate2(did, "attr", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid2, FAIL, "H5Acreate2"); + + /* Create attribute on datatype (this is the main test) */ + aid3 = H5Acreate2(tid, "attr", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid3, FAIL, "H5Acreate2"); + + /* Close IDs */ + ret = H5Aclose(aid3); + CHECK(ret, FAIL, "H5Aclose"); + + ret = H5Aclose(aid2); + CHECK(ret, FAIL, "H5Aclose"); + + ret = H5Aclose(aid1); + CHECK(ret, FAIL, "H5Aclose"); + + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_attr_bug4() */ + +/**************************************************************** +** +** test_attr_bug5(): Test basic H5A (attribute) code. +** Tests opening an attribute multiple times through +** objects opened through different file handles. +** +****************************************************************/ +static void +test_attr_bug5(hid_t fcpl, hid_t fapl) +{ + hid_t fid1, fid2; /* File IDs */ + hid_t gid1, gid2; /* Group IDs */ + hid_t did1, did2; /* Dataset IDs */ + hid_t tid1, tid2; /* Datatype IDs */ + hid_t aidg1, aidg2, + aidd1, aidd2, + aidt1, aidt2; /* Attribute IDs */ + hid_t sid; /* Dataspace ID */ + hsize_t dims[1] = {5}; /* Attribute dimensions */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Opening an Attribute Through Multiple Files Concurrently\n")); + + /* Create dataspace ID for attributes and datasets */ + sid = H5Screate_simple(1, dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + /* Create file */ + fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid1, FAIL, "H5Fcreate"); + + /* Open root group */ + gid1 = H5Gopen2(fid1, "/", H5P_DEFAULT); + CHECK(gid1, FAIL, "H5Gopen2"); + + /* Create and commit datatype */ + tid1 = H5Tcopy(H5T_STD_I32LE); + CHECK(tid1, FAIL, "H5Tcopy"); + ret = H5Tcommit2(fid1, BUG3_DT_NAME, tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* Create dataset */ + did1 = H5Dcreate2(fid1, BUG3_DSET_NAME, tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(did1, FAIL, "H5Dcreate2"); + + /* Create attribute on root group */ + aidg1 = H5Acreate2(gid1, BUG3_ATTR_NAME, tid1, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aidg1, FAIL, "H5Acreate2"); + + /* Create attribute on dataset */ + aidd1 = H5Acreate2(did1, BUG3_ATTR_NAME, tid1, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aidd1, FAIL, "H5Acreate2"); + + /* Create attribute on datatype */ + aidt1 = H5Acreate2(tid1, BUG3_ATTR_NAME, tid1, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aidt1, FAIL, "H5Acreate2"); + + /* Close all IDs */ + ret = H5Aclose(aidt1); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aidd1); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aidg1); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Dclose(did1); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + ret = H5Gclose(gid1); + CHECK(ret, FAIL, "H5Gclose"); + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Open file twice */ + fid1 = H5Fopen(FILENAME, H5F_ACC_RDONLY, fapl); + CHECK(fid1, FAIL, "H5Fopen"); + fid2 = H5Fopen(FILENAME, H5F_ACC_RDONLY, fapl); + CHECK(fid2, FAIL, "H5Fopen"); + + /* Open the root group twice */ + gid1 = H5Gopen2(fid1, "/", H5P_DEFAULT); + CHECK(gid1, FAIL, "H5Gopen2"); + gid2 = H5Gopen2(fid2, "/", H5P_DEFAULT); + CHECK(gid2, FAIL, "H5Gopen2"); + + /* Open the root group attribute twice */ + aidg1 = H5Aopen(gid1, BUG3_ATTR_NAME, H5P_DEFAULT); + CHECK(aidg1, FAIL, "H5Aopen"); + aidg2 = H5Aopen(gid2, BUG3_ATTR_NAME, H5P_DEFAULT); + CHECK(aidg1, FAIL, "H5Aopen"); + + /* Open the dataset twice */ + did1 = H5Dopen2(fid1, BUG3_DSET_NAME, H5P_DEFAULT); + CHECK(did1, FAIL, "H5Dopen2"); + did2 = H5Dopen2(fid2, BUG3_DSET_NAME, H5P_DEFAULT); + CHECK(did2, FAIL, "H5Dopen2"); + + /* Open the dataset attribute twice */ + aidd1 = H5Aopen(did1, BUG3_ATTR_NAME, H5P_DEFAULT); + CHECK(aidd1, FAIL, "H5Aopen"); + aidd2 = H5Aopen(did2, BUG3_ATTR_NAME, H5P_DEFAULT); + CHECK(aidd1, FAIL, "H5Aopen"); + + /* Open the datatype twice */ + tid1 = H5Topen2(fid1, BUG3_DT_NAME, H5P_DEFAULT); + CHECK(tid1, FAIL, "H5Topen2"); + tid2 = H5Topen2(fid2, BUG3_DT_NAME, H5P_DEFAULT); + CHECK(tid2, FAIL, "H5Topen2"); + + /* Open the datatype attribute twice */ + aidt1 = H5Aopen(tid1, BUG3_ATTR_NAME, H5P_DEFAULT); + CHECK(aidt1, FAIL, "H5Aopen"); + aidt2 = H5Aopen(tid2, BUG3_ATTR_NAME, H5P_DEFAULT); + CHECK(aidt2, FAIL, "H5Aopen"); + + /* Close all attributes */ + ret = H5Aclose(aidg1); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aidg2); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aidd1); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aidd2); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aidt1); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Aclose(aidt2); + CHECK(ret, FAIL, "H5Aclose"); + + /* Close root groups */ + ret = H5Gclose(gid1); + CHECK(ret, FAIL, "H5Gclose"); + ret = H5Gclose(gid2); + CHECK(ret, FAIL, "H5Gclose"); + + /* Close datasets */ + ret = H5Dclose(did1); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(did2); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close datatypes */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + ret = H5Tclose(tid2); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close files */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Fclose(fid2); + CHECK(ret, FAIL, "H5Fclose"); +} /* test_attr_bug5() */ + +/**************************************************************** +** ** test_attr(): Main H5A (attribute) testing routine. ** ****************************************************************/ @@ -9913,6 +10285,9 @@ test_attr(void) /* Tests that address specific bugs */ test_attr_bug1(my_fcpl, my_fapl); /* Test odd allocation operations */ test_attr_bug2(my_fcpl, my_fapl); /* Test many deleted attributes */ + test_attr_bug3(my_fcpl, my_fapl); /* Test "self referential" attributes */ + test_attr_bug4(my_fcpl, my_fapl); /* Test attributes on named datatypes */ + test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */ } /* end for */ } /* end if */ else { @@ -9933,6 +10308,9 @@ test_attr(void) /* Tests that address specific bugs */ test_attr_bug1(fcpl, my_fapl); /* Test odd allocation operations */ test_attr_bug2(fcpl, my_fapl); /* Test many deleted attributes */ + test_attr_bug3(fcpl, my_fapl); /* Test "self referential" attributes */ + test_attr_bug4(fcpl, my_fapl); /* Test attributes on named datatypes */ + test_attr_bug5(fcpl, my_fapl); /* Test opening/closing attributes through different file handles */ } /* end else */ } /* end for */ diff --git a/test/tconfig.c b/test/tconfig.c index d4d7d4b..355191d 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -127,7 +127,7 @@ test_config_ctypes(void) /* standard C99 basic types */ #if H5_SIZEOF_LONG_LONG > 0 - vrfy_cint_type(long_long, unsigned long_long, H5_SIZEOF_LONG_LONG); + vrfy_cint_type(long long, unsigned long long, H5_SIZEOF_LONG_LONG); #endif #if H5_SIZEOF_INT8_T > 0 diff --git a/test/tmisc.c b/test/tmisc.c index 746af5d..9ac2bc4 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -300,6 +300,11 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset #define MISC27_FILE "tbad_msg_count.h5" #define MISC27_GROUP "Group" +/* Definitions for misc. test #28 */ +#define MISC28_FILE "tmisc28.h5" +#define MISC28_SIZE 10 +#define MISC28_NSLOTS 10000 + /**************************************************************** ** ** test_misc1(): test unlinking a dataset from a group and immediately @@ -4854,6 +4859,183 @@ test_misc27(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc27() */ + +/**************************************************************** +** +** test_misc28(): Ensure that the dataset chunk cache will hold +** the correct number of chunks in cache without +** evicting them. +** +****************************************************************/ +static void +test_misc28(void) +{ + hid_t fid; /* File ID */ + hid_t sidf; /* File Dataspace ID */ + hid_t sidm; /* Memory Dataspace ID */ + hid_t did; /* Dataset ID */ + hid_t dcpl, fapl; /* Property List IDs */ + hsize_t dims[] = {MISC28_SIZE, MISC28_SIZE}; + hsize_t mdims[] = {MISC28_SIZE}; + hsize_t cdims[] = {1, 1}; + hsize_t start[] = {0,0}; + hsize_t count[] = {MISC28_SIZE, 1}; + size_t nbytes_used; + int nused; + char buf[MISC28_SIZE]; + int i; + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Dataset chunk cache\n")); + + /* Create the fapl and set the cache size. Set nelmts to larger than the + * file size so we can be guaranteed that no chunks will be evicted due to + * a hash collision. Set nbytes to fit exactly 1 column of chunks (10 + * bytes). */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + ret = H5Pset_cache(fapl, MISC28_NSLOTS, MISC28_NSLOTS, MISC28_SIZE, 0.75); + CHECK(ret, FAIL, "H5Pset_cache"); + + /* Create the dcpl and set the chunk size */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl, 2, cdims); + CHECK(ret, FAIL, "H5Pset_chunk"); + + + /* Create a new file and datasets within that file that use these + * property lists + */ + fid = H5Fcreate(MISC28_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + sidf = H5Screate_simple(2, dims, NULL); + CHECK(sidf, FAIL, "H5Screate_simple"); + + did = H5Dcreate2(fid, "dataset", H5T_NATIVE_CHAR, sidf, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Verify that the chunk cache is empty */ + ret = H5D_current_cache_size_test(did, &nbytes_used, &nused); + CHECK(ret, FAIL, "H5D_current_cache_size_test"); + VERIFY(nbytes_used, (size_t) 0, "H5D_current_cache_size_test"); + VERIFY(nused, 0, "H5D_current_cache_size_test"); + + /* Initialize write buffer */ + for(i=0; iheader.size == entry_ptr->len ) || ( entry_ptr->header.size == entry_ptr->local_len ) ); + HDassert( entry_ptr->header.is_dirty == entry_ptr->dirty ); + + if ( entry_ptr->header.is_dirty ) { + + entry_ptr->cleared = TRUE; + } + entry_ptr->header.is_dirty = FALSE; entry_ptr->dirty = FALSE; @@ -1791,6 +1815,10 @@ destroy_datum(H5F_t UNUSED * f, * length of the entry, while retaining the original * value for communications with the server. * + * JRM -- 2/4/09 + * Added code to set the flushed flag when a dirty entry + * is flushed. + * *------------------------------------------------------------------------- */ @@ -1859,6 +1887,7 @@ flush_datum(H5F_t *f, { entry_ptr->header.is_dirty = FALSE; entry_ptr->dirty = FALSE; + entry_ptr->flushed = TRUE; } } } @@ -2175,8 +2204,6 @@ expunge_entry(H5C_t * cache_ptr, HDassert( !(entry_ptr->global_pinned) ); HDassert( !(entry_ptr->local_pinned) ); - entry_ptr->dirty = TRUE; - if ( nerrors == 0 ) { result = H5AC_expunge_entry(file_ptr, -1, &(types[0]), @@ -3492,7 +3519,7 @@ setup_rand(void) const char * fcn_name = "setup_rand()"; hbool_t use_predefined_seeds = FALSE; int num_predefined_seeds = 3; - unsigned predefined_seeds[3] = {18669, 89925, 12577}; + unsigned predefined_seeds[3] = {33402, 33505, 33422}; unsigned seed; struct timeval tv; struct timezone tz; @@ -3663,9 +3690,14 @@ unlock_entry(H5C_t * cache_ptr, HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE ); - if ( ( flags & H5AC__DIRTIED_FLAG ) != 0 - && ( (flags & H5C__DELETED_FLAG) == 0 ) ) { - + if ( ( (flags & H5AC__DIRTIED_FLAG) != 0 ) && + ( (flags & H5C__DELETED_FLAG) == 0 ) && + ( ! ( ( ( world_mpi_rank == 0 ) && ( entry_ptr->flushed ) ) + || + ( ( world_mpi_rank != 0 ) && ( entry_ptr->cleared ) ) + ) + ) + ) { HDassert( entry_ptr->header.is_dirty ); HDassert( entry_ptr->dirty ); } @@ -4412,6 +4444,8 @@ smoke_check_3(void) { const char * fcn_name = "smoke_check_3()"; hbool_t success = TRUE; + hbool_t verbose = FALSE; + int cp = 0; int i; int max_nerrors; int min_count; @@ -4428,12 +4462,18 @@ smoke_check_3(void) TESTING("smoke check #3"); } + /* 0 */ + if ( verbose ) { HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); } + nerrors = 0; init_data(); reset_stats(); if ( world_mpi_rank == world_server_mpi_rank ) { + /* 1 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + if ( ! server_main() ) { /* some error occured in the server -- report failure */ @@ -4443,9 +4483,15 @@ smoke_check_3(void) world_mpi_rank, fcn_name); } } + + /* 2 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} } else /* run the clients */ { + /* 1 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + if ( ! setup_cache_for_test(&fid, &file_ptr, &cache_ptr) ) { nerrors++; @@ -4457,6 +4503,9 @@ smoke_check_3(void) } } + /* 2 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + min_count = 100 / ((file_mpi_rank + 1) * (file_mpi_rank + 1)); max_count = min_count + 50; @@ -4472,6 +4521,9 @@ smoke_check_3(void) } } + /* 3 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + min_count = 100 / ((file_mpi_rank + 2) * (file_mpi_rank + 2)); max_count = min_count + 50; @@ -4512,6 +4564,9 @@ smoke_check_3(void) } + /* 4 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + /* flush the file to be sure that we have no problems flushing * pinned entries @@ -4524,6 +4579,9 @@ smoke_check_3(void) } } + /* 5 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + min_idx = 0; max_idx = ((virt_num_data_entries / 10) / @@ -4558,6 +4616,9 @@ smoke_check_3(void) } } + /* 6 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + min_idx = 0; max_idx = ((virt_num_data_entries / 10) / ((file_mpi_rank + 3) * (file_mpi_rank + 3))) - 1; @@ -4574,6 +4635,9 @@ smoke_check_3(void) min_idx, max_idx, 0, 100); } + /* 7 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + /* we can't rename pinned entries, so release any local pins now. */ local_unpin_all_entries(cache_ptr, file_ptr, FALSE); @@ -4592,6 +4656,9 @@ smoke_check_3(void) min_count, max_count); } + /* 8 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + /* ...and then rename them back. */ for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- ) { @@ -4604,6 +4671,9 @@ smoke_check_3(void) min_count, max_count); } + /* 9 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + /* finally, do some dirty lock/unlocks while we give the cache * a chance t reduce its size. */ @@ -4627,6 +4697,9 @@ smoke_check_3(void) } } + /* 10 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + /* release any local pins before we take down the cache. */ local_unpin_all_entries(cache_ptr, file_ptr, FALSE); @@ -4642,6 +4715,9 @@ smoke_check_3(void) } } + /* 11 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} + /* verify that all instances of datum are back where the started * and are clean. */ @@ -4676,6 +4752,9 @@ smoke_check_3(void) } } } + + /* 12 */ + if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);} } max_nerrors = get_max_nerrors(); @@ -5043,6 +5122,8 @@ smoke_check_5(void) { const char * fcn_name = "smoke_check_5()"; hbool_t success = TRUE; + hbool_t verbose = FALSE; + int cp = 0; int i; int max_nerrors; hid_t fid = -1; @@ -5055,12 +5136,20 @@ smoke_check_5(void) TESTING("smoke check #5"); } + /* 0 */ + if ( verbose ) { HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); } + nerrors = 0; init_data(); reset_stats(); if ( world_mpi_rank == world_server_mpi_rank ) { + /* 1 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } + if ( ! server_main() ) { /* some error occured in the server -- report failure */ @@ -5070,9 +5159,20 @@ smoke_check_5(void) world_mpi_rank, fcn_name); } } + + /* 2 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } } else /* run the clients */ { + + /* 1 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } + if ( ! setup_cache_for_test(&fid, &file_ptr, &cache_ptr) ) { nerrors++; @@ -5084,11 +5184,21 @@ smoke_check_5(void) } } + /* 2 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } + for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET); } + /* 3 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } + /* flush the file so we can lock known clean entries. */ if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) { nerrors++; @@ -5098,6 +5208,11 @@ smoke_check_5(void) } } + /* 4 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } + for ( i = 0; i < (virt_num_data_entries / 4); i++ ) { lock_entry(cache_ptr, file_ptr, i); @@ -5121,6 +5236,11 @@ smoke_check_5(void) } } + /* 5 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } + for ( i = (virt_num_data_entries / 2) - 1; i >= (virt_num_data_entries / 4); i-- ) @@ -5154,6 +5274,11 @@ smoke_check_5(void) unpin_entry(cache_ptr, file_ptr, i, TRUE, FALSE, FALSE); } + /* 6 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } + if ( fid >= 0 ) { if ( ! take_down_cache(fid) ) { @@ -5166,6 +5291,11 @@ smoke_check_5(void) } } + /* 7 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } + /* verify that all instance of datum are back where the started * and are clean. */ @@ -5176,6 +5306,11 @@ smoke_check_5(void) HDassert( ! (data[i].dirty) ); } + /* 8 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } + /* compose the done message */ mssg.req = DONE_REQ_CODE; mssg.src = world_mpi_rank; @@ -5199,6 +5334,11 @@ smoke_check_5(void) } } } + + /* 9 */ + if ( verbose ) { + HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++); + } } max_nerrors = get_max_nerrors(); diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index ec379be..d9495e5 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -43,7 +43,7 @@ #define FILE11 "h5diff_empty.h5" #define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */ #define STR_SIZE 3 -#define GBLL ((unsigned long_long) 1024 * 1024 *1024 ) +#define GBLL ((unsigned long long) 1024 * 1024 *1024 ) #define MY_LINKCLASS 187 @@ -202,12 +202,12 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) /*------------------------------------------------------------------------- * relative error, compare divide by zero, both zero - * # 1.6.2 with -p (unsigned long_long) + * # 1.6.2 with -p (unsigned long long) *------------------------------------------------------------------------- */ { - unsigned long_long data7[3][2] = {{100,100},{100,0},{0,100}}; - unsigned long_long data8[3][2] = {{120,80}, {0,100},{0,50}}; + unsigned long long data7[3][2] = {{100,100},{100,0},{0,100}}; + unsigned long long data8[3][2] = {{120,80}, {0,100},{0,50}}; write_dset(gid1,2,dims2,"dset7",H5T_NATIVE_ULLONG,data7); write_dset(gid1,2,dims2,"dset8",H5T_NATIVE_ULLONG,data8); @@ -331,12 +331,37 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) /* not comparable objects */ { + + typedef struct cmp1_t + { + double d; + int i; + } cmp1_t; + + typedef struct cmp2_t + { + int i; + double d; + } cmp2_t; + + typedef struct cmp3_t + { + int i; + } cmp3_t; + double data2[6] = {0,0,0,0,0,0}; int data3[6] = {0,0,0,0,0,0}; int data4[3][2] = {{0,0},{0,0},{0,0}}; - hsize_t dims3[2] = { 2,2 }; int data5[2][2] = {{0,0},{0,0}}; unsigned int data6[3][2] = {{0,0},{0,0},{0,0}}; + cmp1_t data7[1] = {1,2}; + cmp2_t data8[1] = {1,2}; + hsize_t dims3[2] = { 2,2 }; + hsize_t dims4[1] = { 1 }; + size_t type_size; + hid_t tid; + + write_dset(gid3,1,dims1,"dset1",H5T_NATIVE_DOUBLE,NULL); write_dset(gid3,1,dims1,"dset2",H5T_NATIVE_DOUBLE,data2); @@ -344,7 +369,28 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) write_dset(gid3,2,dims2,"dset4",H5T_NATIVE_INT,data4); write_dset(gid3,2,dims3,"dset5",H5T_NATIVE_INT,data5); write_dset(gid3,2,dims2,"dset6",H5T_NATIVE_UINT,data6); - + + /* case of compound with different type members */ + type_size = sizeof( cmp1_t ); + tid = H5Tcreate (H5T_COMPOUND, type_size ); + H5Tinsert(tid, "d", HOFFSET( cmp1_t, d ), H5T_NATIVE_DOUBLE ); + H5Tinsert(tid, "i", HOFFSET( cmp1_t, i ), H5T_NATIVE_INT ); + write_dset(gid3,1,dims4,"dset7",tid,data7); + H5Tclose(tid); + + type_size = sizeof( cmp2_t ); + tid = H5Tcreate (H5T_COMPOUND, type_size ); + H5Tinsert(tid, "i", HOFFSET( cmp2_t, i ), H5T_NATIVE_INT ); + H5Tinsert(tid, "d", HOFFSET( cmp2_t, d ), H5T_NATIVE_DOUBLE ); + write_dset(gid3,1,dims4,"dset8",tid,data8); + H5Tclose(tid); + + /* case of compound with different number of members */ + type_size = sizeof( cmp3_t ); + tid = H5Tcreate (H5T_COMPOUND, type_size ); + H5Tinsert(tid, "i", HOFFSET( cmp2_t, i ), H5T_NATIVE_INT ); + write_dset(gid3,1,dims4,"dset9",tid,NULL); + H5Tclose(tid); } @@ -529,11 +575,11 @@ int test_datatypes(const char *fname) char buf7a[3][2] = {{-1,-128},{-1,-1},{-1,-1}}; unsigned char buf7b[3][2] = {{1,128},{1,1},{1,1}}; - /* long_long test */ - long_long buf8a[3][2] = {{1,1},{1,1},{1,1}}; - long_long buf8b[3][2] = {{1,1},{3,4},{5,6}}; - unsigned long_long buf9a[3][2] = {{1,1},{1,1},{1,1}}; - unsigned long_long buf9b[3][2] = {{1,1},{3,4},{5,6}}; + /* long long test */ + long long buf8a[3][2] = {{1,1},{1,1},{1,1}}; + long long buf8b[3][2] = {{1,1},{3,4},{5,6}}; + unsigned long long buf9a[3][2] = {{1,1},{1,1},{1,1}}; + unsigned long long buf9b[3][2] = {{1,1},{3,4},{5,6}}; unsigned int buf10a[3][2] = {{UIMAX,1},{1,1},{1,1}}; unsigned int buf10b[3][2] = {{UIMAX-1,1},{3,4},{5,6}}; diff --git a/tools/h5diff/testfiles/h5diff_17.txt b/tools/h5diff/testfiles/h5diff_17.txt index 2ffbda9..ac04bd4 100644 --- a/tools/h5diff/testfiles/h5diff_17.txt +++ b/tools/h5diff/testfiles/h5diff_17.txt @@ -29,6 +29,9 @@ file1 file2 x /g2/dset4 x /g2/dset5 x /g2/dset6 + x /g2/dset7 + x /g2/dset8 + x /g2/dset9 group : and 0 differences found diff --git a/tools/h5diff/testfiles/h5diff_206.txt b/tools/h5diff/testfiles/h5diff_206.txt new file mode 100644 index 0000000..8bbbb9a --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_206.txt @@ -0,0 +1 @@ + has a class H5T_FLOAT and has a class H5T_INTEGER diff --git a/tools/h5diff/testfiles/h5diff_207.txt b/tools/h5diff/testfiles/h5diff_207.txt new file mode 100644 index 0000000..833afe8 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_207.txt @@ -0,0 +1,2 @@ + or are empty datasets + has 2 members has 1 members diff --git a/tools/h5diff/testfiles/h5diff_90.txt b/tools/h5diff/testfiles/h5diff_90.txt index cfef527..71b960e 100644 --- a/tools/h5diff/testfiles/h5diff_90.txt +++ b/tools/h5diff/testfiles/h5diff_90.txt @@ -13,6 +13,9 @@ file1 file2 x x /g2/dset4 x x /g2/dset5 x x /g2/dset6 + x x /g2/dset7 + x x /g2/dset8 + x x /g2/dset9 group : and 0 differences found @@ -39,6 +42,13 @@ dataset: and 0 differences found dataset: and 0 differences found +dataset: and +0 differences found +dataset: and +0 differences found +dataset: and + or are empty datasets +0 differences found -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/h5diff/testfiles/h5diff_basic2.h5 b/tools/h5diff/testfiles/h5diff_basic2.h5 index edb0c65..c0795b6 100644 Binary files a/tools/h5diff/testfiles/h5diff_basic2.h5 and b/tools/h5diff/testfiles/h5diff_basic2.h5 differ diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index e37a047..4854e3e 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -598,6 +598,16 @@ TESTING $H5DIFF -c $SRCFILE2 $SRCFILE2 g2/dset5 g2/dset6 TOOLTEST h5diff_205.txt -c $FILE2 $FILE2 g2/dset5 g2/dset6 +# not comparable in compound +TESTING $H5DIFF -c $SRCFILE2 $SRCFILE2 g2/dset7 g2/dset8 +TOOLTEST h5diff_206.txt -c $FILE2 $FILE2 g2/dset7 g2/dset8 + +TESTING $H5DIFF -c $SRCFILE2 $SRCFILE2 g2/dset8 g2/dset9 +TOOLTEST h5diff_207.txt -c $FILE2 $FILE2 g2/dset8 g2/dset9 + + + + # ############################################################################## # # END # ############################################################################## diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 19a26b4..600de9b 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -3065,9 +3065,9 @@ dump_fcpl(hid_t fid) indentation(indent + COL); printf("%s %u\n","OBJECTHEADER_VERSION", shhdr); indentation(indent + COL); - HDfprintf(stdout,"%s %Hd\n","OFFSET_SIZE", (long_long)off_size); + HDfprintf(stdout,"%s %Hd\n","OFFSET_SIZE", (long long)off_size); indentation(indent + COL); - HDfprintf(stdout,"%s %Hd\n","LENGTH_SIZE", (long_long)len_size); + HDfprintf(stdout,"%s %Hd\n","LENGTH_SIZE", (long long)len_size); indentation(indent + COL); printf("%s %u\n","BTREE_RANK", sym_ik); indentation(indent + COL); @@ -4505,12 +4505,12 @@ print_enum(hid_t type) /* * Determine what datatype to use for the native values. To simplify * things we entertain three possibilities: - * 1. long_long -- the largest native signed integer - * 2. unsigned long_long -- the largest native unsigned integer + * 1. long long -- the largest native signed integer + * 2. unsigned long long -- the largest native unsigned integer * 3. raw format */ - if (H5Tget_size(type) <= sizeof(long_long)) { - dst_size = sizeof(long_long); + if (H5Tget_size(type) <= sizeof(long long)) { + dst_size = sizeof(long long); if (H5T_SGN_NONE == H5Tget_sign(type)) { native = H5T_NATIVE_ULLONG; @@ -4556,14 +4556,14 @@ print_enum(hid_t type) /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" *strangely, unless use another pointer "copy".*/ copy = value+i*dst_size; - HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long_long *) + HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) ((void *)copy))); } else { /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" *strangely, unless use another pointer "copy".*/ copy = value+i*dst_size; HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "d", - *((long_long *) ((void *)copy))); + *((long long *) ((void *)copy))); } printf(";\n"); @@ -6684,12 +6684,12 @@ xml_print_enum(hid_t type) /* * Determine what datatype to use for the native values. To simplify * things we entertain three possibilities: - * 1. long_long -- the largest native signed integer - * 2. unsigned long_long -- the largest native unsigned integer + * 1. long long -- the largest native signed integer + * 2. unsigned long long -- the largest native unsigned integer * 3. raw format */ - if (H5Tget_size(type) <= sizeof(long_long)) { - dst_size = sizeof(long_long); + if (H5Tget_size(type) <= sizeof(long long)) { + dst_size = sizeof(long long); if (H5T_SGN_NONE == H5Tget_sign(type)) { native = H5T_NATIVE_ULLONG; @@ -6737,11 +6737,11 @@ xml_print_enum(hid_t type) for (j = 0; j < dst_size; j++) printf("%02x", value[i * dst_size + j]); } else if (H5T_SGN_NONE == H5Tget_sign(native)) { - HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long_long *) + HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) ((void *) (value + i * dst_size)))); } else { HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "d", - *((long_long *) ((void *) (value + i * dst_size)))); + *((long long *) ((void *) (value + i * dst_size)))); } printf("\n"); indentation(indent); diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 05efda8..3b11eac 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -5608,7 +5608,7 @@ gent_binary(void) * *------------------------------------------------------------------------- */ -#define GB4LL ((unsigned long_long) 4*1024*1024*1024) +#define GB4LL ((unsigned long long) 4*1024*1024*1024) #define DIM_4GB (GB4LL + 10) static void diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h index 975ace0..c43b0cf 100755 --- a/tools/h5import/h5import.h +++ b/tools/h5import/h5import.h @@ -68,7 +68,7 @@ #define H5DT_UINT8 unsigned char #define H5DT_UINT16 unsigned short #define H5DT_UINT32 unsigned int -#define H5DT_INT64 long_long +#define H5DT_INT64 long long #define H5DT_UINT64 unsigned H5DT_INT64 struct path_info diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c index 0b0ba9c..718ec6b 100755 --- a/tools/h5import/h5importtest.c +++ b/tools/h5import/h5importtest.c @@ -44,10 +44,10 @@ main(void) int rowi4i = (int)1 , coli4i = (int)2 , plni4i = (int)5 ; #ifndef WIN32 - long_long b64i2[3][4], b64i3[5][3][4]; - long_long row4i64[3], col4i64[4], pln4i64[5]; - long_long rowo4i64 = (long_long)11 , colo4i64 = (long_long)21 , plno4i64 = (long_long)51 ; - long_long rowi4i64 = (long_long)1 , coli4i64 = (long_long)2 , plni4i64 = (long_long)5 ; + long long b64i2[3][4], b64i3[5][3][4]; + long long row4i64[3], col4i64[4], pln4i64[5]; + long long rowo4i64 = (long long)11 , colo4i64 = (long long)21 , plno4i64 = (long long)51 ; + long long rowi4i64 = (long long)1 , coli4i64 = (long long)2 , plni4i64 = (long long)5 ; #endif short b16i3[5][3][4]; diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index d0af4bb..ca0ddcb 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -770,11 +770,11 @@ display_enum_type(hid_t type, int ind) /* Determine what data type to use for the native values. To simplify * things we entertain three possibilities: - * 1. long_long -- the largest native signed integer - * 2. unsigned long_long -- the largest native unsigned integer + * 1. long long -- the largest native signed integer + * 2. unsigned long long -- the largest native unsigned integer * 3. raw format */ - if (H5Tget_size(type)<=sizeof(long_long)) { - dst_size = sizeof(long_long); + if (H5Tget_size(type)<=sizeof(long long)) { + dst_size = sizeof(long long); if (H5T_SGN_NONE==H5Tget_sign(type)) { native = H5T_NATIVE_ULLONG; } else { @@ -813,13 +813,13 @@ display_enum_type(hid_t type, int ind) *strangely, unless use another pointer "copy".*/ copy = value+i*dst_size; HDfprintf(stdout,"%"H5_PRINTF_LL_WIDTH"u", - *((unsigned long_long*)((void*)copy))); + *((unsigned long long*)((void*)copy))); } else { /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" *strangely, unless use another pointer "copy".*/ copy = value+i*dst_size; HDfprintf(stdout,"%"H5_PRINTF_LL_WIDTH"d", - *((long_long*)((void*)copy))); + *((long long*)((void*)copy))); } } @@ -952,9 +952,9 @@ display_reference_type(hid_t type, int UNUSED ind) { if (H5T_REFERENCE!=H5Tget_class(type)) return FALSE; - if (H5Tequal(type, H5T_STD_REF_OBJ)) { + if (H5Tequal(type, H5T_STD_REF_OBJ)==TRUE) { printf("object reference"); - } else if (H5Tequal(type, H5T_STD_REF_DSETREG)) { + } else if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) { printf("dataset region reference"); } else { printf("%lu-byte unknown reference", diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index d10bc25..c5f9d69 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -92,7 +92,7 @@ int d_status = EXIT_SUCCESS; #define CDIM1 DIM1/2 #define CDIM2 DIM2/2 #define RANK 2 -#define GBLL ((unsigned long_long) 1024*1024*1024) +#define GBLL ((unsigned long long) 1024*1024*1024) /* Size of userblock (for userblock test) */ #define USERBLOCK_SIZE 2048 diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 9028ce5..e0f2ad0 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -134,7 +134,8 @@ int diff_can_type( hid_t f_type1, /* file data type */ hsize_t *maxdim2, const char *obj1_name, const char *obj2_name, - diff_opt_t *options ); + diff_opt_t *options, + int is_compound); hsize_t diff_attr(hid_t loc1_id, diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index f9c6261..5d57a52 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -138,7 +138,7 @@ static int not_comparable; */ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id,hid_t region1_id, hid_t region2_id, diff_opt_t *options); static hbool_t all_zero(const void *_mem, size_t size); -static int ull2float(unsigned long_long ull_value, float *f_value); +static int ull2float(unsigned long long ull_value, float *f_value); static hsize_t character_compare(unsigned char *mem1,unsigned char *mem2,hsize_t i,unsigned u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); static hsize_t character_compare_opt(unsigned char *mem1,unsigned char *mem2,hsize_t i,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); static hbool_t equal_float(float value, float expected, diff_opt_t *options); @@ -356,9 +356,9 @@ hsize_t diff_array( void *_mem1, * H5T_COMPOUND * Recursively call this function for each member * H5T_ARRAY - * Recursively call this function for each element  + * Recursively call this function for each element� * H5T_VLEN - * Recursively call this function for each element  + * Recursively call this function for each element� * H5T_STRING * compare byte by byte in a cycle from 0 to type_size. this type_size is the * value obtained by the get_size function but it is the string lenght for @@ -1588,12 +1588,12 @@ hsize_t diff_datum(void *_mem1, else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) { - long_long temp1_llong; - long_long temp2_llong; - assert(type_size==sizeof(long_long)); + long long temp1_llong; + long long temp2_llong; + assert(type_size==sizeof(long long)); - memcpy(&temp1_llong, mem1, sizeof(long_long)); - memcpy(&temp2_llong, mem2, sizeof(long_long)); + memcpy(&temp1_llong, mem1, sizeof(long long)); + memcpy(&temp2_llong, mem2, sizeof(long long)); /* -d and !-p */ if (options->d && !options->p) { @@ -1686,16 +1686,16 @@ hsize_t diff_datum(void *_mem1, else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) { - unsigned long_long temp1_ullong; - unsigned long_long temp2_ullong; - assert(type_size==sizeof(unsigned long_long)); + unsigned long long temp1_ullong; + unsigned long long temp2_ullong; + assert(type_size==sizeof(unsigned long long)); - memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); + memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); /* -d and !-p */ if (options->d && !options->p) { - if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long)options->delta) + if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long)options->delta) { if ( print_data(options) ) { @@ -1758,7 +1758,7 @@ hsize_t diff_datum(void *_mem1, else - if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long)options->delta ) + if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long)options->delta ) { if ( print_data(options) ) @@ -4777,8 +4777,8 @@ hsize_t diff_llong(unsigned char *mem1, { hsize_t nfound=0; /* number of differences found */ - long_long temp1_llong; - long_long temp2_llong; + long long temp1_llong; + long long temp2_llong; hsize_t i; double per; int both_zero; @@ -4789,8 +4789,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long_long)); - memcpy(&temp2_llong, mem2, sizeof(long_long)); + memcpy(&temp1_llong, mem1, sizeof(long long)); + memcpy(&temp2_llong, mem2, sizeof(long long)); if (ABS( temp1_llong-temp2_llong) > options->delta) { @@ -4802,8 +4802,8 @@ hsize_t diff_llong(unsigned char *mem1, } nfound++; } - mem1+=sizeof(long_long); - mem2+=sizeof(long_long); + mem1+=sizeof(long long); + mem2+=sizeof(long long); if (options->n && nfound>=options->count) return nfound; } @@ -4816,8 +4816,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long_long)); - memcpy(&temp2_llong, mem2, sizeof(long_long)); + memcpy(&temp1_llong, mem1, sizeof(long long)); + memcpy(&temp2_llong, mem2, sizeof(long long)); PER(temp1_llong,temp2_llong); @@ -4844,8 +4844,8 @@ hsize_t diff_llong(unsigned char *mem1, } nfound++; } - mem1+=sizeof(long_long); - mem2+=sizeof(long_long); + mem1+=sizeof(long long); + mem2+=sizeof(long long); if (options->n && nfound>=options->count) return nfound; } @@ -4859,8 +4859,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long_long)); - memcpy(&temp2_llong, mem2, sizeof(long_long)); + memcpy(&temp1_llong, mem1, sizeof(long long)); + memcpy(&temp2_llong, mem2, sizeof(long long)); PER(temp1_llong,temp2_llong); @@ -4887,8 +4887,8 @@ hsize_t diff_llong(unsigned char *mem1, } nfound++; } - mem1+=sizeof(long_long); - mem2+=sizeof(long_long); + mem1+=sizeof(long long); + mem2+=sizeof(long long); if (options->n && nfound>=options->count) return nfound; } @@ -4899,8 +4899,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long_long)); - memcpy(&temp2_llong, mem2, sizeof(long_long)); + memcpy(&temp1_llong, mem1, sizeof(long long)); + memcpy(&temp2_llong, mem2, sizeof(long long)); if (temp1_llong != temp2_llong) { @@ -4913,8 +4913,8 @@ hsize_t diff_llong(unsigned char *mem1, nfound++; } - mem1+=sizeof(long_long); - mem2+=sizeof(long_long); + mem1+=sizeof(long long); + mem2+=sizeof(long long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ @@ -4950,8 +4950,8 @@ hsize_t diff_ullong(unsigned char *mem1, { hsize_t nfound=0; /* number of differences found */ - unsigned long_long temp1_ullong; - unsigned long_long temp2_ullong; + unsigned long long temp1_ullong; + unsigned long long temp2_ullong; hsize_t i; float f1, f2; double per; @@ -4963,10 +4963,10 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); + memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long) options->delta) + if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { if ( print_data(options) ) { @@ -4976,8 +4976,8 @@ hsize_t diff_ullong(unsigned char *mem1, } nfound++; } - mem1+=sizeof(unsigned long_long); - mem2+=sizeof(unsigned long_long); + mem1+=sizeof(unsigned long long); + mem2+=sizeof(unsigned long long); if (options->n && nfound>=options->count) return nfound; } @@ -4990,8 +4990,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); + memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); @@ -5020,8 +5020,8 @@ hsize_t diff_ullong(unsigned char *mem1, } nfound++; } - mem1+=sizeof(unsigned long_long); - mem2+=sizeof(unsigned long_long); + mem1+=sizeof(unsigned long long); + mem2+=sizeof(unsigned long long); if (options->n && nfound>=options->count) return nfound; } @@ -5035,8 +5035,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); + memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); @@ -5055,7 +5055,7 @@ hsize_t diff_ullong(unsigned char *mem1, else - if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long_long)options->delta ) + if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long)options->delta ) { if ( print_data(options) ) { @@ -5065,8 +5065,8 @@ hsize_t diff_ullong(unsigned char *mem1, } nfound++; } - mem1+=sizeof(unsigned long_long); - mem2+=sizeof(unsigned long_long); + mem1+=sizeof(unsigned long long); + mem2+=sizeof(unsigned long long); if (options->n && nfound>=options->count) return nfound; } @@ -5077,8 +5077,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); + memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); if (temp1_ullong != temp2_ullong) { @@ -5091,8 +5091,8 @@ hsize_t diff_ullong(unsigned char *mem1, nfound++; } - mem1+=sizeof(unsigned long_long); - mem2+=sizeof(unsigned long_long); + mem1+=sizeof(unsigned long long); + mem2+=sizeof(unsigned long long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ @@ -5107,7 +5107,7 @@ hsize_t diff_ullong(unsigned char *mem1, /*------------------------------------------------------------------------- * Function: ull2float * - * Purpose: convert unsigned long_long to float + * Purpose: convert unsigned long long to float * * Programmer: pvn * Mar 22, 2006 @@ -5117,7 +5117,7 @@ hsize_t diff_ullong(unsigned char *mem1, *------------------------------------------------------------------------- */ static -int ull2float(unsigned long_long ull_value, float *f_value) +int ull2float(unsigned long long ull_value, float *f_value) { hid_t dxpl_id; unsigned char *buf; @@ -5573,7 +5573,7 @@ void print_pos( int *ph, /* print header */ parallel_print("[ " ); for ( i = 0; i < rank; i++) { - parallel_print(HSIZE_T_FORMAT, (unsigned long_long)pos[i]); + parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); parallel_print(" "); } parallel_print("]" ); @@ -5651,7 +5651,7 @@ void print_char_pos( int *ph, /* print header */ for ( i = 0; i < rank; i++) { - parallel_print(HSIZE_T_FORMAT, (unsigned long_long)pos[i]); + parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); parallel_print(" "); } diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index c527310..69bd44c 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -147,7 +147,8 @@ hsize_t diff_attr(hid_t loc1_id, NULL, name1, name2, - options)!=1) + options, + 0)!=1) { diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 9710419..4826a7f 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -287,7 +287,8 @@ hsize_t diff_datasetid( hid_t did1, maxdim2, obj1_name, obj2_name, - options)!=1) + options, + 0)!=1) { can_compare=0; } @@ -661,7 +662,8 @@ int diff_can_type( hid_t f_tid1, /* file data type */ hsize_t *maxdim2, const char *obj1_name, const char *obj2_name, - diff_opt_t *options ) + diff_opt_t *options, + int is_compound) { @@ -685,12 +687,32 @@ int diff_can_type( hid_t f_tid1, /* file data type */ if ( tclass1 != tclass2 ) { + if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("<%s> is of class %s and <%s> is of class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2) ); + + if ( is_compound ) + { + + parallel_print("<%s> has a class %s and <%s> has a class %s\n", + obj1_name, get_class(tclass1), + obj2_name, get_class(tclass2) ); + + } + + else + + { + + parallel_print("<%s> is of class %s and <%s> is of class %s\n", + obj1_name, get_class(tclass1), + obj2_name, get_class(tclass2) ); + + } + } + + can_compare = 0; options->not_cmp = 1; return can_compare; @@ -850,6 +872,74 @@ int diff_can_type( hid_t f_tid1, /* file data type */ parallel_print("\n"); } } + + + if ( tclass1 == H5T_COMPOUND ) + { + + int nmembs1; + int nmembs2; + int j; + hid_t memb_type1; + hid_t memb_type2; + + nmembs1 = H5Tget_nmembers(f_tid1); + nmembs2 = H5Tget_nmembers(f_tid2); + + if ( nmembs1 != nmembs2 ) + { + + if ( (options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + { + parallel_print("<%s> has %d members ", obj1_name, nmembs1); + parallel_print("<%s> has %d members ", obj2_name, nmembs2); + parallel_print("\n"); + } + + can_compare = 0; + options->not_cmp = 1; + return can_compare; + } + + for (j = 0; j < nmembs1; j++) + { + memb_type1 = H5Tget_member_type(f_tid1, (unsigned)j); + memb_type2 = H5Tget_member_type(f_tid2, (unsigned)j); + + if (diff_can_type(memb_type1, + memb_type2, + rank1, + rank2, + dims1, + dims2, + maxdim1, + maxdim2, + obj1_name, + obj2_name, + options, + 1)!=1) + { + can_compare = 0; + options->not_cmp = 1; + H5Tclose(memb_type1); + H5Tclose(memb_type2); + return can_compare; + } + + H5Tclose(memb_type1); + H5Tclose(memb_type2); + + } + + + + + + } + + + + return can_compare; } diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 35f4dfb..1acc493 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -371,7 +371,7 @@ get_class(H5T_class_t tclass) void print_found(hsize_t nfound) { if(g_Parallel) - parallel_print("%"H5_PRINTF_LL_WIDTH"u differences found\n", (unsigned long_long)nfound); + parallel_print("%"H5_PRINTF_LL_WIDTH"u differences found\n", (unsigned long long)nfound); else HDfprintf(stdout,"%Hu differences found\n",nfound); } diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 52d65fe..6032c02 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1559,8 +1559,8 @@ int render_bin_output(FILE *stream, hid_t tid, void *_mem) size_t size; /* datum size */ float tempfloat; double tempdouble; - unsigned long_long tempullong; - long_long templlong; + unsigned long long tempullong; + long long templlong; unsigned long tempulong; long templong; unsigned int tempuint; @@ -1726,7 +1726,7 @@ int render_bin_output(FILE *stream, hid_t tid, void *_mem) } else if (H5Tequal(tid, H5T_NATIVE_LLONG)) { - memcpy(&templlong, mem, sizeof(long_long)); + memcpy(&templlong, mem, sizeof(long long)); #ifdef DEBUG_H5DUMP_BIN fprintf(stream, fmt_llong, templlong); #else @@ -1736,7 +1736,7 @@ int render_bin_output(FILE *stream, hid_t tid, void *_mem) } else if (H5Tequal(tid, H5T_NATIVE_ULLONG)) { - memcpy(&tempullong, mem, sizeof(unsigned long_long)); + memcpy(&tempullong, mem, sizeof(unsigned long long)); #ifdef DEBUG_H5DUMP_BIN fprintf(stream, fmt_ullong, tempullong); #else @@ -1768,7 +1768,7 @@ int render_bin_output(FILE *stream, hid_t tid, void *_mem) } else { - memcpy(&templlong, mem, sizeof(long_long)); + memcpy(&templlong, mem, sizeof(long long)); #ifdef DEBUG_H5DUMP_BIN fprintf(stream, fmt_llong, templlong); #else @@ -1801,7 +1801,7 @@ int render_bin_output(FILE *stream, hid_t tid, void *_mem) } else { - memcpy(&tempullong, mem, sizeof(unsigned long_long)); + memcpy(&tempullong, mem, sizeof(unsigned long long)); #ifdef DEBUG_H5DUMP_BIN fprintf(stream, fmt_ullong, tempullong); #else diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 5d42307..a339acf 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -586,8 +586,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai * some tempvars to store the value before we append it to the string to * get rid of the memory alignment problem */ - unsigned long_long tempullong; - long_long templlong; + unsigned long long tempullong; + long long templlong; unsigned long tempulong; long templong; unsigned int tempuint; @@ -737,10 +737,10 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai HDmemcpy(&tempulong, vp, sizeof(unsigned long)); h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); } else if (H5Tequal(type, H5T_NATIVE_LLONG)) { - HDmemcpy(&templlong, vp, sizeof(long_long)); + HDmemcpy(&templlong, vp, sizeof(long long)); h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); } else if (H5Tequal(type, H5T_NATIVE_ULLONG)) { - HDmemcpy(&tempullong, vp, sizeof(unsigned long_long)); + HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)) { if (sizeof(hssize_t) == sizeof(int)) { @@ -750,7 +750,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai memcpy(&templong, vp, sizeof(long)); h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong); } else { - memcpy(&templlong, vp, sizeof(long_long)); + memcpy(&templlong, vp, sizeof(long long)); h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); } } else if (H5Tequal(type, H5T_NATIVE_HSIZE)) { @@ -761,7 +761,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai memcpy(&tempulong, vp, sizeof(long)); h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); } else { - memcpy(&tempullong, vp, sizeof(unsigned long_long)); + memcpy(&tempullong, vp, sizeof(unsigned long long)); h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); } } else if (H5Tget_class(type) == H5T_COMPOUND) { diff --git a/vms/build.com b/vms/build.com index c1de293..ee13379 100644 --- a/vms/build.com +++ b/vms/build.com @@ -14,7 +14,7 @@ $!# access to either file, you may request a copy from help@hdfgroup.org. $!# $! $! -$! This file builds C, Frtran, C++ HDF5 librraies and runs the tests +$! This file builds C, Fortran, C++ HDF5 libraries and runs the tests $! Specify location of the top HDF5 source directory $ $ hdf5top == "sys$sysusers:[pourmal.hdf5]" @@ -25,6 +25,8 @@ $ hdf5ctest = tmp + ".TEST]" $ hdf5f90test = tmp + ".FORTRAN.TEST]" $ hdf5cxxtest = tmp + ".C__.TEST]" $ hdf5toolstest = tmp + ".TOOLS.TESTFILES]" +$ hdf5toolstest_h5diff = tmp + ".TOOLS.H5DIFF.TESTFILES]" +$ hdf5toolstest_h5repack = tmp + ".TOOLS.H5REPACK.TESTFILES]" $ h5importtest = tmp + ".TOOLS.H5IMPORT.TESTFILES]" $ set def 'hdf5vms' $@make @@ -37,11 +39,13 @@ $@check $ set def 'hdf5toolstest' $ copy [-.h5dump]check_h5dump.com check_h5dump.com $ copy [-.h5ls]check_h5ls.com check_h5ls.com -$ copy [-.h5diff]check_h5diff.com check_h5diff.com -$ copy [-.h5repack]check_h5repack.com check_h5repack.com $@check_h5dump.com $@check_h5ls.com +$ set def 'hdf5toolstest_h5diff' +$ copy [-]check_h5diff.com check_h5diff.com $@check_h5diff.com +$ set def 'hdf5toolstest_h5repack' +$ copy [-]check_h5repack.com check_h5repack.com $@check_h5repack.com $! $ set def 'h5importtest' diff --git a/vms/c++/examples/make.com b/vms/c++/examples/make.com index 37ee782..cde20e2 100644 --- a/vms/c++/examples/make.com +++ b/vms/c++/examples/make.com @@ -15,63 +15,65 @@ $!# $! $! Make HDF5 C++ examples $! -$ cxxopt = "/float=ieee_float/standard=strict_ansi/define=H5_VMS" -$ define zlib_dir sys$sysusers:[pourmale.zlib-1_2_3] -$ +$ define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$ cxxopt = "/float=ieee_float/standard=strict_ansi/define=H5_VMS/include=zlib_dir" $ ccc := cxx 'cxxopt /include=([-.-.include]) $! $! -$ cxxobj= "create.cxx, readdata.cxx, writedata.cxx, compound.cxx,"+- - "extend_ds.cxx, chunks.cxx, h5group.cxx" +$ cxxobj= "chunks.cxx, compound.cxx, create.cxx, extend_ds.cxx, h5group.cxx, "+- + "readdata.cxx, writedata.cxx" $! $! $ ccc 'cxxobj $ type sys$input - Creating create -$ cxxlink create, - + Creating chunks +$ cxxlink chunks, - [-.-.lib]hdf5_cplus.olb/lib, - [-.-.lib]hdf5.olb/lib,zlib_dir:libz.olb/lib +$! $ type sys$input - Creating readdata -$ cxxlink readdata, - + Creating compound +$ cxxlink compound, - [-.-.lib]hdf5_cplus.olb/lib, - [-.-.lib]hdf5.olb/lib,zlib_dir:libz.olb/lib $! $ type sys$input - Creating writedata -$ cxxlink writedata, - + Creating create +$ cxxlink create, - [-.-.lib]hdf5_cplus.olb/lib, - [-.-.lib]hdf5.olb/lib,zlib_dir:libz.olb/lib -$ ! +$! $ type sys$input - Creating compound -$ cxxlink compound, - + Creating extend_ds +$ cxxlink extend_ds, - [-.-.lib]hdf5_cplus.olb/lib, - [-.-.lib]hdf5.olb/lib,zlib_dir:libz.olb/lib $! $ type sys$input - Creating extend_ds -$ cxxlink extend_ds, - + Creating h5group +$ cxxlink h5group, - [-.-.lib]hdf5_cplus.olb/lib, - [-.-.lib]hdf5.olb/lib,zlib_dir:libz.olb/lib $! $ type sys$input - Creating chunks -$ cxxlink chunks, - + Creating readdata +$ cxxlink readdata, - [-.-.lib]hdf5_cplus.olb/lib, - [-.-.lib]hdf5.olb/lib,zlib_dir:libz.olb/lib $! $ type sys$input - Creating h5group -$ cxxlink h5group, - + Creating writedata +$ cxxlink writedata, - [-.-.lib]hdf5_cplus.olb/lib, - [-.-.lib]hdf5.olb/lib,zlib_dir:libz.olb/lib +$! +$ type sys$input $! $ exit diff --git a/vms/c++/src/make.com b/vms/c++/src/make.com index f407caf..37525bc 100644 --- a/vms/c++/src/make.com +++ b/vms/c++/src/make.com @@ -16,6 +16,10 @@ $! Makefile for VMS systems. $! $! Make HDF5 C++ library $! +$! The next two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] $! cxxopt = "/float=ieee_float/standard=strict_ansi/define=H5_VMS" $ ccc := cxx 'cxxopt /include=([-.-.src]) $! @@ -23,60 +27,59 @@ $! type sys$input $! Creating HDF5 C++ library $! $ lib/create/object hdf5_cplus.olb -$ ccc H5Exception.cxx -$ lib/insert/object hdf5_cplus H5Exception -$ ccc H5IdComponent.cxx -$ lib/insert/object hdf5_cplus H5IdComponent -$ ccc H5Library.cxx -$ lib/insert/object hdf5_cplus H5Library +$ ccc H5AbstractDs.cxx +$ lib/insert/object hdf5_cplus H5AbstractDs +$ ccc H5ArrayType.cxx +$ lib/insert/object hdf5_cplus H5ArrayType +$ ccc H5AtomType.cxx +$ lib/insert/object hdf5_cplus H5AtomType $ ccc H5Attribute.cxx $ lib/insert/object hdf5_cplus H5Attribute -$ ccc H5Object.cxx -$ lib/insert/object hdf5_cplus H5Object -$ ccc H5PropList.cxx -$ lib/insert/object hdf5_cplus H5PropList -$ ccc H5FaccProp.cxx -$ lib/insert/object hdf5_cplus H5FaccProp -$ ccc H5FcreatProp.cxx -$ lib/insert/object hdf5_cplus H5FcreatProp +$ ccc H5CommonFG.cxx +$ lib/insert/object hdf5_cplus H5CommonFG +$ ccc H5CompType.cxx +$ lib/insert/object hdf5_cplus H5CompType +$ ccc H5DataSet.cxx +$ lib/insert/object hdf5_cplus H5DataSet +$ ccc H5DataSpace.cxx +$ lib/insert/object hdf5_cplus H5DataSpace +$ ccc H5DataType.cxx +$ lib/insert/object hdf5_cplus H5DataType $ ccc H5DcreatProp.cxx $ lib/insert/object hdf5_cplus H5DcreatProp $ ccc H5DxferProp.cxx $ lib/insert/object hdf5_cplus H5DxferProp -$ ccc H5DataType.cxx -$ lib/insert/object hdf5_cplus H5DataType -$ ccc H5DataSpace.cxx -$ lib/insert/object hdf5_cplus H5DataSpace -$ ccc H5AbstractDs.cxx -$ lib/insert/object hdf5_cplus H5AbstractDs -$ ccc H5AtomType.cxx -$ lib/insert/object hdf5_cplus H5AtomType -$ ccc H5PredType.cxx -$ lib/insert/object hdf5_cplus H5PredType $ ccc H5EnumType.cxx $ lib/insert/object hdf5_cplus H5EnumType -$ ccc H5IntType.cxx -$ lib/insert/object hdf5_cplus H5IntType +$ ccc H5Exception.cxx +$ lib/insert/object hdf5_cplus H5Exception +$ ccc H5FaccProp.cxx +$ lib/insert/object hdf5_cplus H5FaccProp +$ ccc H5FcreatProp.cxx +$ lib/insert/object hdf5_cplus H5FcreatProp +$ ccc H5File.cxx +$ lib/insert/object hdf5_cplus H5File $ ccc H5FloatType.cxx $ lib/insert/object hdf5_cplus H5FloatType +$ ccc H5Group.cxx +$ lib/insert/object hdf5_cplus H5Group +$ ccc H5IdComponent.cxx +$ lib/insert/object hdf5_cplus H5IdComponent +$ ccc H5IntType.cxx +$ lib/insert/object hdf5_cplus H5IntType +$ ccc H5Library.cxx +$ lib/insert/object hdf5_cplus H5Library +$ ccc H5Object.cxx +$ lib/insert/object hdf5_cplus H5Object +$ ccc H5PredType.cxx +$ lib/insert/object hdf5_cplus H5PredType +$ ccc H5PropList.cxx +$ lib/insert/object hdf5_cplus H5PropList $ ccc H5StrType.cxx $ lib/insert/object hdf5_cplus H5StrType -$ ccc H5ArrayType.cxx -$ lib/insert/object hdf5_cplus H5ArrayType $ ccc H5VarLenType.cxx $ lib/insert/object hdf5_cplus H5VarLenType -$ ccc H5CompType.cxx -$ lib/insert/object hdf5_cplus H5CompType -$ ccc H5DataSet.cxx -$ lib/insert/object hdf5_cplus H5DataSet -$ ccc H5CommonFG.cxx -$ lib/insert/object hdf5_cplus H5CommonFG -$ ccc H5Group.cxx -$ lib/insert/object hdf5_cplus H5Group -$ ccc H5File.cxx -$ lib/insert/object hdf5_cplus H5File $! $ type sys$input Done $ exit - diff --git a/vms/c++/test/make.com b/vms/c++/test/make.com index bcf26ce..47d9370 100644 --- a/vms/c++/test/make.com +++ b/vms/c++/test/make.com @@ -16,30 +16,34 @@ $! Makefile for VMS systems. $! $! Make HDF5 C++ library tests $! +$! The next two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] $! cxxopt = "/float=ieee_float/standard=strict_ansi/define=H5_VMS" $ $ ccc := cxx 'cxxopt /include=([-.-.src], [-.-.test], [-.src]) $! $! $! +$ ccc h5cpputil $ ccc tattr -$ ccc tfile $ ccc tcompound +$ ccc testhdf5 +$ ccc tfile $ ccc tfilter +$ ccc th5s $ ccc trefer $ ccc ttypes $ ccc tvlstr -$ ccc th5s -$ ccc h5cpputil -$ ccc testhdf5 $ type sys$input Creating testhdf5 -$ cxxlink testhdf5,tattr,tfile, th5s, - - tcompound, tfilter, trefer, tvlstr, ttypes, h5cpputil, - +$ cxxlink testhdf5, h5cpputil, tattr, tcompound, tfile, tfilter, th5s, - + trefer, ttypes, tvlstr, - [-.src]hdf5_cplus.olb/lib, [-.-.test]libh5test.olb/lib, - [-.-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib $! -$ ! +$! $ ccc dsets $ type sys$input Creating dsets diff --git a/vms/fortran/examples/make.com b/vms/fortran/examples/make.com index 9f18198..591ba63 100644 --- a/vms/fortran/examples/make.com +++ b/vms/fortran/examples/make.com @@ -17,7 +17,7 @@ $! $! Make HDF5 Fortran examples $! $ fcopt = "/float=ieee_float/define=H5_VMS" -$ define zlib_dir sys$sysusers:[pourmale.zlib-1_2_3] +$ define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] $ fff := fortran 'fcopt /module=[-.-.include] $ $ type sys$input diff --git a/vms/fortran/src/make.com b/vms/fortran/src/make.com index 8c75d9a..5ad89ff 100644 --- a/vms/fortran/src/make.com +++ b/vms/fortran/src/make.com @@ -16,8 +16,13 @@ $! Makefile for VMS systems. $! $! Make HDF5 Fortran library $! -$ ccopt = "/float=ieee_float/define=H5_VMS" -$ fcopt = "/float=ieee_float/define=H5_VMS" +$! The thre two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$! ccopt = "/float=ieee_float/define=H5_VMS/debug/nooptimize/include=zlib_dir" +$! fcopt = "/float=ieee_float/define=H5_VMS/debug/nooptimize/include=zlib_dir" $ ccc := cc 'ccopt /include=[-.-.src] $ fff := fortran 'fcopt $ type sys$input @@ -48,17 +53,17 @@ $ type sys$input Creating HDF5 Fortran library $! $ cobj="H5f90kit, H5_f, H5Af, H5Df, H5Ef, H5Ff, H5Gf, "+- - "H5If, H5Pf, H5Rf, H5Sf, H5Tf, H5Zf" + "H5If, H5Lf, H5Of, H5Pf, H5Rf, H5Sf, H5Tf, H5Zf" $ ffiles= "H5_ff.f90, H5Aff.f90, H5Dff.f90, H5Eff.f90,"+- + "H5Lff.f90, H5Off.f90,"+- "H5Fff.f90, H5Gff.f90, H5Iff.f90, H5Pff.f90, H5Rff.f90, H5Sff.f90,"+- "H5Tff.f90, H5Zff.f90, H5_DBLE_InterfaceInclude.f90, HDF5.f90" -$ fobj="H5fortran_flags, H5f90global, "+- +$ fobj="H5f90global, "+- "H5fortran_types, H5_ff, H5Aff, H5Dff, H5Eff,"+- - "H5Fff, H5Gff, H5Iff, H5Pff, H5Rff, H5Sff,"+- + "H5Fff, H5Gff, H5Iff, H5Lff, H5Off, H5Pff, H5Rff, H5Sff,"+- "H5Tff, H5Zff, H5_DBLE_InterfaceInclude, HDF5" $! $ ccc 'cobj -$ fff H5fortran_flags.f90 $ fff H5fortran_types.f90 $ fff H5f90global.f90 $ diff --git a/vms/fortran/test/make.com b/vms/fortran/test/make.com index 120fa7b..478c64c 100644 --- a/vms/fortran/test/make.com +++ b/vms/fortran/test/make.com @@ -16,8 +16,9 @@ $! Makefile for VMS systems. $! $! Make HDF5 Fortran tests $! -$ ccopt = "/float=ieee_float/define=H5_VMS" -$ fcopt = "/float=ieee_float/define=H5_VMS" +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$! ccopt = "/float=ieee_float/define=H5_VMS/debug/nooptimize/include=zlib_dir" +$! fcopt = "/float=ieee_float/define=H5_VMS/debug/nooptimize/include=zlib_dir" $ ccc := cc 'ccopt /include=[-.-.src] $ fff := fortran 'fcopt /module=[-.src] $ @@ -58,7 +59,7 @@ $ link/exec=fortranlib_test.exe - [-.src]hdf5_fortran.olb/lib,- [-.-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib $ link/exec=fortranlib_test_1_8.exe - - fortranlib_test_1_8.obj, tH5F.obj, tH5A_1_8.obj, tH5G_1_8.obj,- + fortranlib_test_1_8.obj, tH5F.obj, tH5O.obj, tH5A_1_8.obj, tH5G_1_8.obj,- h5test_fortran.olb/lib,[-.-.test]libh5test.olb/lib, - [-.src]hdf5_fortran.olb/lib,- [-.-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib diff --git a/vms/install.com b/vms/install.com index 21ebbbd..f1f9304 100644 --- a/vms/install.com +++ b/vms/install.com @@ -33,6 +33,8 @@ $ hdf5tools_h5ls = hdf5top_dir + "TOOLS.H5LS]" $ hdf5tools_h5repack = hdf5top_dir + "TOOLS.H5REPACK]" $ hdf5tools_h5jam = hdf5top_dir + "TOOLS.H5JAM]" $ hdf5tools_h5import = hdf5top_dir + "TOOLS.H5IMPORT]" +$ hdf5tools_h5stat = hdf5top_dir + "TOOLS.H5STAT]" +$ hdf5tools_h5misc = hdf5top_dir + "TOOLS.H5MISC]" $ hdf5fortran_examples = hdf5top_dir + "FORTRAN.EXAMPLES]" $ hdf5fortran_src = hdf5top_dir + "FORTRAN.SRC]" $ hdf5cxx_src = hdf5top_dir + "C__.SRC]" @@ -137,6 +139,13 @@ $! $ set def 'hdf5tools_h5import' $ copy h5import.exe 'hdf5install_bin' $! +$ set def 'hdf5tools_h5stat' +$ copy h5stat.exe 'hdf5install_bin' +$! +$ set def 'hdf5tools_h5misc' +$ copy h5debug.exe 'hdf5install_bin' +$ copy h5mkgrp.exe 'hdf5install_bin' +$! $ write sys$output "Installing examples" $ set def 'hdf5examples' $ copy *.c 'hdf5install_examples_c' diff --git a/vms/make.com b/vms/make.com index a5d0f10..5af9469 100644 --- a/vms/make.com +++ b/vms/make.com @@ -31,8 +31,10 @@ $ copy [.tools.h5diff]*.com [-.tools.h5diff] $ copy [.tools.h5repack]*.com [-.tools.h5repack] $ copy [.tools.h5import]*.com [-.tools.h5import] $ copy [.tools.h5jam]*.com [-.tools.h5jam] +$ copy [.tools.h5stat]*.com [-.tools.h5stat] $ copy [.tools.lib]make.com [-.tools.lib] $ copy [.tools.testfiles]*.ddl [-.tools.testfiles] +$ copy [.tools.misc]make.com [-.tools.misc] $! $! Define location of ZLIB library. If you do not have it on your system, download $! source code from http://www.zlib.net/, build and install on your system @@ -59,10 +61,12 @@ $ hdf5tools_lib = hdf5top_dir + "TOOLS.LIB]" $ hdf5tools_h5copy = hdf5top_dir + "TOOLS.H5COPY]" $ hdf5tools_h5diff = hdf5top_dir + "TOOLS.H5DIFF]" $ hdf5tools_h5dump = hdf5top_dir + "TOOLS.H5DUMP]" +$ hdf5tools_h5import = hdf5top_dir + "TOOLS.H5IMPORT]" +$ hdf5tools_h5jam = hdf5top_dir + "TOOLS.H5JAM]" $ hdf5tools_h5ls = hdf5top_dir + "TOOLS.H5LS]" $ hdf5tools_h5repack = hdf5top_dir + "TOOLS.H5REPACK]" -$ hdf5tools_h5jam = hdf5top_dir + "TOOLS.H5JAM]" -$ hdf5tools_h5import = hdf5top_dir + "TOOLS.H5IMPORT]" +$ hdf5tools_h5stat = hdf5top_dir + "TOOLS.H5STAT]" +$ hdf5tools_misc = hdf5top_dir + "TOOLS.MISC]" $ hdf5fortran_examples = hdf5top_dir + "FORTRAN.EXAMPLES]" $ hdf5fortran_src = hdf5top_dir + "FORTRAN.SRC]" $ hdf5fortran_test = hdf5top_dir + "FORTRAN.TEST]" @@ -95,20 +99,28 @@ $ write sys$output "Building h5dump" $ set def 'hdf5tools_h5dump' $ @make.com $! -$ write sys$output "Building h5repack" -$ set def 'hdf5tools_h5repack' +$ write sys$output "Building h5import" +$ set def 'hdf5tools_h5import' +$ @make.com +$! +$ write sys$output "Building h5jam" +$ set def 'hdf5tools_h5jam' $ @make.com $! $ write sys$output "Building h5ls" $ set def 'hdf5tools_h5ls' $ @make.com $! -$ write sys$output "Building h5jam" -$ set def 'hdf5tools_h5jam' +$ write sys$output "Building h5repack" +$ set def 'hdf5tools_h5repack' $ @make.com $! -$ write sys$output "Building h5import" -$ set def 'hdf5tools_h5import' +$ write sys$output "Building h5stat" +$ set def 'hdf5tools_h5stat' +$ @make.com +$! +$ write sys$output "Building misc" +$ set def 'hdf5tools_misc' $ @make.com $! $ write sys$output "Building Fortran library" diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 4ab1766..dfaa7e6 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -480,13 +480,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.30" +#define H5_PACKAGE_STRING "HDF5 1.9.32" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.30" +#define H5_PACKAGE_VERSION "1.9.32" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -639,7 +639,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.30" +#define H5_VERSION "1.9.32" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/vms/test/check.com b/vms/test/check.com index de1ef3c..402f17a 100644 --- a/vms/test/check.com +++ b/vms/test/check.com @@ -56,11 +56,6 @@ $ run cache $ type sys$input $ type sys$input -------- Running cache_common ------- -$ run cache_common -$ type sys$input - -$ type sys$input ------- Running chunk_info ------- $ run chunk_info $ type sys$input diff --git a/vms/tools/h5copy/make.com b/vms/tools/h5copy/make.com index b262663..1a95f58 100644 --- a/vms/tools/h5copy/make.com +++ b/vms/tools/h5copy/make.com @@ -16,7 +16,11 @@ $! Makefile for VMS systems. $! $! Make h5copy tool $! -$! ccopt = "/float=ieee_float" +$! The next two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$! ccopt = "/float=ieee_float/define=H5_VMS/include=zlib_dir" $ $ ccc := cc 'ccopt /include=([-.-.src], [-.lib], [-.-.test]) $ type sys$input diff --git a/vms/tools/h5diff/check_h5diff.com b/vms/tools/h5diff/check_h5diff.com index 9d16b12..0773c16 100644 --- a/vms/tools/h5diff/check_h5diff.com +++ b/vms/tools/h5diff/check_h5diff.com @@ -15,7 +15,7 @@ $!# $! $ ! $ ! This command file tests h5diff utility. The command file has to -$ ! run in the [hdf5-top.tools.testfiles] directory. +$ ! run in the [hdf5-top.tools.h5diff.testfiles] directory. $ ! $ ! $ type sys$input @@ -29,8 +29,8 @@ $ ! $! set message/notext/nofacility/noidentification/noseverity $ current_dir = F$DIRECTRY() $ len = F$LENGTH(current_dir) -$ temp = F$EXTRACT(0, len-10, current_dir) -$ h5diff_dir = temp + "H5DIFF]" +$ temp = F$EXTRACT(0, len-11, current_dir) +$ h5diff_dir = temp + "]" $ h5diff :== $sys$disk:'h5diff_dir'h5diff.exe $ ! @@ -152,8 +152,6 @@ $!# ############################################################################ $!# # -d $!# ############################################################################## $! -$!# 6.2: no value -$ CALL TOOLTEST h5diff_602.txt "-d h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4" $! $!# 6.3: negative value $ CALL TOOLTEST h5diff_603.txt "-d -4 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4" @@ -185,8 +183,6 @@ $!# # -p $!# ############################################################################## $! $! -$!# 6.11: no value -$ CALL TOOLTEST h5diff_611.txt "-r -p h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4" $! $!# 6.12: negative value $ CALL TOOLTEST h5diff_612.txt "-p -4 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4" @@ -219,8 +215,6 @@ $!# # -n $!# ############################################################################## $! $! -$!# 6.20: no value -$ CALL TOOLTEST h5diff_620.txt "-n h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4" $! $!# 6.21: negative value $ CALL TOOLTEST h5diff_621.txt "-n -4 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4" @@ -290,9 +284,6 @@ $ ! Run the test and save output in the 'actual' file $ ! $ define/nolog sys$output 'actual' $ define/nolog sys$error 'actual_err' -$ write sys$output "#############################" -$ write sys$output "Expected output for 'h5diff ''P2''" -$ write sys$output "#############################" $ ON ERROR THEN CONTINUE $ h5diff 'P2 $ deassign sys$output diff --git a/vms/tools/h5diff/make.com b/vms/tools/h5diff/make.com index 9c69c85..c1e0078 100644 --- a/vms/tools/h5diff/make.com +++ b/vms/tools/h5diff/make.com @@ -16,8 +16,11 @@ $! Makefile for VAX/VMX systems. $! $! Make h5diff tool $! -$! ccopt = "/float=ieee_float" -$ +$! The next two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$! ccopt = "/float=ieee_float/define=H5_VMS/include=zlib_dir" $ ccc := cc 'ccopt /include=([-.-.src], [-.lib]) $! $ cobj= "h5diff_main, h5diff_common, h5diffgentest" diff --git a/vms/tools/h5dump/make.com b/vms/tools/h5dump/make.com index 96ab968..612b524 100644 --- a/vms/tools/h5dump/make.com +++ b/vms/tools/h5dump/make.com @@ -16,14 +16,14 @@ $! Makefile for VMS systems. $! $! Make h5dump tool $! -$! ccopt = "/float=ieee_float" +$! The next two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$! ccopt = "/float=ieee_float/define=H5_VMS/include=zlib_dir" $ $ ccc := cc 'ccopt /include=([-.-.src], [-.lib]) -$ -$ $ cobj= "h5dump.c, h5dumpgentest.c " - -$ $ ccc 'cobj $ type sys$input Creating h5dumpgentest ... @@ -31,8 +31,6 @@ $ link h5dumpgentest, - [-.lib]libh5tools.olb/lib,[-.-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib $ type sys$input Finished h5dumpgentest - -$ $ type sys$input Creating h5dump ... $ link h5dump, - diff --git a/vms/tools/h5import/make.com b/vms/tools/h5import/make.com index 347c87c..6afbd70 100644 --- a/vms/tools/h5import/make.com +++ b/vms/tools/h5import/make.com @@ -16,8 +16,11 @@ $! Makefile for VMS systems. $! $! Make h5import tool $! -$! ccopt = "/float=ieee_float" -$ +$! The next two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$! ccopt = "/float=ieee_float/define=H5_VMS/include=zlib_dir" $ ccc := cc 'ccopt /include=([-.-.src], [-.lib]) $ type sys$input Creating h5import ... @@ -26,7 +29,6 @@ $ cobj= "h5import, h5importtest " $! $ ccc 'cobj -$ $ link h5import,- [-.lib]libh5tools.olb/lib,[-.-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib $ type sys$input diff --git a/vms/tools/h5jam/make.com b/vms/tools/h5jam/make.com index 086143f..d57b5e9 100644 --- a/vms/tools/h5jam/make.com +++ b/vms/tools/h5jam/make.com @@ -16,8 +16,11 @@ $! Makefile for VMS systems. $! $! Make h5ls tool $! -$! ccopt = "/float=ieee_float" -$ +$! The next two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$! ccopt = "/float=ieee_float/define=H5_VMS/include=zlib_dir" $ ccc := cc 'ccopt /include=([-.-.src], [-.lib]) $ type sys$input Creating h5jam @@ -26,7 +29,6 @@ $ cobj= "h5jam, h5unjam, tellub, getub, h5jamgentest" $! $ ccc 'cobj -$ $ type sys$input Creating tellub $ link tellub - diff --git a/vms/tools/h5ls/make.com b/vms/tools/h5ls/make.com index 2ab721f..51d57c6 100644 --- a/vms/tools/h5ls/make.com +++ b/vms/tools/h5ls/make.com @@ -16,8 +16,11 @@ $! Makefile for VMS systems. $! $! Make h5ls tool $! -$! ccopt = "/float=ieee_float" -$ +$! The next two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$! ccopt = "/float=ieee_float/define=H5_VMS/include=zlib_dir" $ ccc := cc 'ccopt /include=([-.-.src], [-.lib]) $ type sys$input Creating h5ls @@ -26,7 +29,6 @@ $ cobj= "h5ls.c " $! $ ccc 'cobj -$ $ type sys$input Creating h5ls $ link h5ls, - diff --git a/vms/tools/h5repack/check_h5repack.com b/vms/tools/h5repack/check_h5repack.com index 1dcbc78..207951e 100644 --- a/vms/tools/h5repack/check_h5repack.com +++ b/vms/tools/h5repack/check_h5repack.com @@ -15,7 +15,7 @@ $!# $! $ ! $ ! This command file tests h5repack utility. The command file has to -$ ! run in the [hdf5-top.tools.testfiles] directory. +$ ! run in the [hdf5-top.tools.h5repack.testfiles] directory. $ ! $ ! $ type sys$input @@ -29,10 +29,11 @@ $ ! $! set message/notext/nofacility/noidentification/noseverity $ current_dir = F$DIRECTRY() $ len = F$LENGTH(current_dir) -$ temp = F$EXTRACT(0, len-10, current_dir) -$ h5diff_dir = temp + "H5DIFF]" +$ temp = F$EXTRACT(0, len-11, current_dir) +$ temp1 = F$EXTRACT(0, len-19, current_dir) +$ h5diff_dir = temp1 + "H5DIFF]" $ h5diff :== $sys$disk:'h5diff_dir'h5diff.exe -$ h5repack_dir = temp + "H5REPACK]" +$ h5repack_dir = temp + "]" $ h5repack :== $sys$disk:'h5repack_dir'h5repack.exe $ ! $ ! diff --git a/vms/tools/h5repack/make.com b/vms/tools/h5repack/make.com index f9a42c4..0de0e2b 100644 --- a/vms/tools/h5repack/make.com +++ b/vms/tools/h5repack/make.com @@ -16,8 +16,11 @@ $! Makefile for VMS systems. $! $! Make h5repack tool $! -$! ccopt = "/float=ieee_float" -$ +$! The next two lines should be uncommented only when building by hand in the +$! current directory. Use build.com in the vms directory to build +$! the distribution. Make sure that location of the zlib library is correct. +$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3] +$! ccopt = "/float=ieee_float/define=H5_VMS/include=zlib_dir" $ ccc := cc 'ccopt /include=([-.-.src], [-.lib], [-.-.test]) $ type sys$input Creating h5repack ... @@ -37,7 +40,6 @@ $ link/exe=h5repack.exe - $ type sys$input Finished h5repack -$ $ type sys$input Creating h5repacktst ... $ link/exe=h5repacktst.exe - @@ -47,7 +49,6 @@ $ link/exe=h5repacktst.exe - h5repack_verify, - [-.lib]libh5tools.olb/lib,[-.-.test]libh5test.olb/lib, - [-.-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib -$ $ type sys$input Finished h5repacktst $! diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 6639fb5..95b53d8 100755 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -479,13 +479,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.30" +#define H5_PACKAGE_STRING "HDF5 1.9.32" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.30" +#define H5_PACKAGE_VERSION "1.9.32" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -642,7 +642,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.30" +#define H5_VERSION "1.9.32" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/tools/h5diff/testh5diff.bat b/windows/tools/h5diff/testh5diff.bat index 350e7c2..007475a 100644 --- a/windows/tools/h5diff/testh5diff.bat +++ b/windows/tools/h5diff/testh5diff.bat @@ -62,6 +62,8 @@ set /a nerrors=0 set verbose=yes rem default to run h5diff tests set pmode= +rem following not needed for windows see #10 ADB 1/22/2009 +rem mydomainname=`domainname 2>/dev/null` if not exist .\testfiles mkdir .\testfiles @@ -482,8 +484,16 @@ rem ############################################################################ call :tooltest h5diff_90.txt -v %file2% %file2% rem 10. read by hyperslab, print indexes + rem ############################################################################## + rem Not tested on windows as this has not been a problem - ADB 1/22/2009 + rem if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then + rem # skip this test which sometimes hangs in some THG machines + rem SKIP -v $SRCFILE9 $SRCFILE10 + rem else + rem ############################################################################## call :testing %h5diff% -v %srcfile9% %srcfile10% call :tooltest h5diff_100.txt -v %file9% %file10% + rem fi rem 11. floating point comparison rem Not tested on Windows due to difference in formatting of scientific @@ -496,6 +506,34 @@ rem ############################################################################ rem call :tooltest h5diff_102.txt -v %file1% %file1% g1/fp1 g1/fp2 call :results -SKIP- + rem New option added #1368(E1) - ADB 2/5/2009 + rem not compable -c flag + call :testing %h5diff% %srcfile2% %srcfile2% g2/dset1 g2/dset2 + call :tooltest h5diff_200.txt %file2% %file2% g2/dset1 g2/dset2 + + call :testing %h5diff% -c %srcfile2% %srcfile2% g2/dset1 g2/dset2 + call :tooltest h5diff_201.txt -c %file2% %file2% g2/dset1 g2/dset2 + + call :testing %h5diff% -c %srcfile2% %srcfile2% g2/dset2 g2/dset3 + call :tooltest h5diff_202.txt -c %file2% %file2% g2/dset2 g2/dset3 + + call :testing %h5diff% -c %srcfile2% %srcfile2% g2/dset3 g2/dset4 + call :tooltest h5diff_203.txt -c %file2% %file2% g2/dset3 g2/dset4 + + call :testing %h5diff% -c %srcfile2% %srcfile2% g2/dset4 g2/dset5 + call :tooltest h5diff_204.txt -c %file2% %file2% g2/dset4 g2/dset5 + + call :testing %h5diff% -c %srcfile2% %srcfile2% g2/dset5 g2/dset6 + call :tooltest h5diff_205.txt -c %file2% %file2% g2/dset5 g2/dset6 + + rem New option added rev #16461 - ADB 2/11/2009 + rem # not comparable in compound + call :testing %h5diff% -c %srcfile2% %srcfile2% g2/dset7 g2/dset8 + call :tooltest h5diff_206.txt -c %file2% %file2% g2/dset7 g2/dset8 + + call :testing %h5diff% -c %srcfile2% %srcfile2% g2/dset8 g2/dset9 + call :tooltest h5diff_207.txt -c %file2% %file2% g2/dset8 g2/dset9 + rem ############################################################################## rem # END rem ############################################################################## -- cgit v0.12