From cb0c04e1d4d3a5be3b3b07bb81ab647a3adccd43 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 29 Apr 2009 06:39:38 -0500 Subject: [svn-r16888] Description: Bring r16821:16875 back from trunk to 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 debug 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 --- COPYING | 18 +- bin/make_overflow | 219 ++++++ c++/examples/testh5c++.sh.in | 4 +- config/gnu-flags | 61 +- examples/h5_shared_mesg.c | 4 +- examples/testh5cc.sh.in | 4 +- fortran/examples/testh5fc.sh.in | 4 +- hl/src/H5LT.c | 12 +- hl/test/test_lite.c | 19 +- src/H5Apkg.h | 16 +- src/H5Aprivate.h | 1 - src/H5Dchunk.c | 14 +- src/H5Dcompact.c | 12 +- src/H5Dcontig.c | 12 +- src/H5Defl.c | 12 +- src/H5Dint.c | 2 +- src/H5Dpkg.h | 16 +- src/H5EAdbg.c | 2 +- src/H5EApkg.h | 23 +- src/H5Eint.c | 5 +- src/H5Eprivate.h | 2 +- src/H5FScache.c | 2 +- src/H5FSsection.c | 20 +- src/H5Gpkg.h | 12 +- src/H5Oprivate.h | 10 +- src/H5detect.c | 2 +- src/H5overflow.h | 1381 +++++++++++++++++++++++++++++++++ src/H5overflow.txt | 43 + src/H5private.h | 7 +- src/H5win32defs.h | 1 + test/cache.c | 201 +++++ test/cache_common.c | 131 +++- test/cache_common.h | 25 +- test/error_test.c | 31 +- test/testfiles/error_test_1 | 13 +- tools/h5repack/Makefile.am | 3 + tools/h5repack/Makefile.in | 3 + vms/tools/h5repack/check_h5repack.com | 3 + 38 files changed, 2227 insertions(+), 123 deletions(-) create mode 100755 bin/make_overflow create mode 100644 src/H5overflow.h create mode 100644 src/H5overflow.txt diff --git a/COPYING b/COPYING index 43c4534..5ba610b 100644 --- a/COPYING +++ b/COPYING @@ -11,11 +11,6 @@ Copyright 1998-2006 by the Board of Trustees of the University of Illinois. All rights reserved. -Contributors: National Center for Supercomputing Applications (NCSA) at -the University of Illinois, Fortner Software, Unidata Program Center (netCDF), -The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler (gzip), -and Digital Equipment Corporation (DEC). - Redistribution and use in source and binary forms, with or without modification, are permitted for any purpose (including commercial purposes) provided that the following conditions are met: @@ -39,8 +34,8 @@ provided that the following conditions are met: 5. Neither the name of The HDF Group, the name of the University, nor the name of any Contributor may be used to endorse or promote products derived - from this software without specific prior written permission from the - University, The HDF Group, or the Contributor, respectively. + from this software without specific prior written permission from + The HDF Group, the University, or the Contributor, respectively. DISCLAIMER: THIS SOFTWARE IS PROVIDED BY THE HDF GROUP AND THE CONTRIBUTORS @@ -50,6 +45,15 @@ suffered by the users arising out of the use of this software, even if advised of the possibility of such damage. ----------------------------------------------------------------------------- +----------------------------------------------------------------------------- + +Contributors: National Center for Supercomputing Applications (NCSA) at +the University of Illinois, Fortner Software, Unidata Program Center (netCDF), +The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler (gzip), +and Digital Equipment Corporation (DEC). + +----------------------------------------------------------------------------- + Portions of HDF5 were developed with support from the University of California, Lawrence Livermore National Laboratory (UC LLNL). The following statement applies to those portions of the product and must diff --git a/bin/make_overflow b/bin/make_overflow new file mode 100755 index 0000000..ced486a --- /dev/null +++ b/bin/make_overflow @@ -0,0 +1,219 @@ +#!/usr/bin/perl -w +require 5.003; +use strict; + +# Global settings + +# List of supported C types to generate overflow assignment code for +my @ctypes = ( () ); + +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic HDF5 document set and +# is linked from the top-level documents page. It can also be found at +# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have +# access to either file, you may request a copy from help@hdfgroup.org. +# + +# Create assignment overflow #ifdefs +# +# Programmer: Quincey Koziol +# Creation Date: 2009/04/09 + +############################################################################## +# Parse a meaningful line (not a comment or blank line) into the appropriate +# data structure +# +sub parse_line ($) { + my $line = shift; # Get the line to parse + + # Parse get the type name and whether it's signed or unsigned +#print "line=$line\n"; + if($line =~ /.*SIGNED\s*;\s*$/ || $line =~ /.*UNSIGNED\s*;\s*$/) { + my $name; # The name of the type + my $signed; # Whether the type is signed or not + + # Get the type's name & signed status + ($name, $signed) = ($line =~ /^\s*(\w*)\s*,\s*(\w*)\s*;\s*$/); +#print "name = '$name', signed = '$signed'\n"; + + # Append the type to the list of C types already parsed + push @ctypes, [$name, $signed]; + + } + # Unknown keyword + else { + die "unknown keyword: $line"; + } +} + +############################################################################## +# Print the copyright into an open file +# +sub print_copyright ($) { + my $fh = shift; + + print $fh "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n"; + print $fh " * Copyright by The HDF Group. *\n"; + print $fh " * Copyright by the Board of Trustees of the University of Illinois. *\n"; + print $fh " * All rights reserved. *\n"; + print $fh " * *\n"; + print $fh " * This file is part of HDF5. The full HDF5 copyright notice, including *\n"; + print $fh " * terms governing use, modification, and redistribution, is contained in *\n"; + print $fh " * the files COPYING and Copyright.html. COPYING can be found at the root *\n"; + print $fh " * of the source code distribution tree; Copyright.html can be found at the *\n"; + print $fh " * root level of an installed copy of the electronic HDF5 document set and *\n"; + print $fh " * is linked from the top-level documents page. It can also be found at *\n"; + print $fh " * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n"; + print $fh " * access to either file, you may request a copy from help\@hdfgroup.org. *\n"; + print $fh " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n"; +} + +############################################################################## +# Print the "do not change this file" warning +# +sub print_warning ($) { + my $fh = shift; + + print $fh "\n/* Generated automatically by bin/make_overflow -- do not edit */\n"; + print $fh "/* Add new types to H5overflow.txt file */\n\n"; +} + +############################################################################## +# Print start of ifdef's to prevent a file from being re-included +# +sub print_startprotect ($$) { + my ($fh, $file) = @_; + + # Clip off the ".h" part of the name + $file =~ s/(\w*)\.h/$1/; + + # Print the ifdef info + print $fh "\n#ifndef _${file}_H\n"; + print $fh "#define _${file}_H\n"; +} + +############################################################################## +# Print assignment overflow macros for each type +# +sub print_typemacros ($) { + my $fh = shift; # File handle for output file + my ($src_aref, $dst_aref); # References for each type's information + + # Print the descriptive comment + print $fh "\n\n/* Each type in this file is tested for assignment to the other types,\n"; + print $fh " * and range checks are defined for bad assignments at run-time.\n"; + print $fh " */\n"; + + for $src_aref (@ctypes) { + # Print a descriptive comment + print $fh "\n/* Assignment checks for @$src_aref[0] */\n\n"; + + for $dst_aref (@ctypes) { + if (@$src_aref[0] ne @$dst_aref[0]) { + # Print a descriptive comment + print $fh "/* src: @$src_aref[0], dst: @$dst_aref[0] */\n"; + + # Print actual type size checks & macro definitions + print $fh "#if H5_SIZEOF_", uc @$src_aref[0], " < H5_SIZEOF_", uc @$dst_aref[0], "\n"; + print $fh " #define ASSIGN_", @$src_aref[0], "_TO_", @$dst_aref[0], "(dst, dsttype, src, srctype) \\\n"; + if ( @$src_aref[1] eq @$dst_aref[1]) { + print $fh " ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype)\n"; + } elsif ( @$src_aref[1] eq "SIGNED") { + print $fh " ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype)\n"; + } else { + print $fh " ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype)\n"; + } + print $fh "#elif H5_SIZEOF_", uc @$src_aref[0], " > H5_SIZEOF_", uc @$dst_aref[0], "\n"; + print $fh " #define ASSIGN_", @$src_aref[0], "_TO_", @$dst_aref[0], "(dst, dsttype, src, srctype) \\\n"; + print $fh " ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype)\n"; + print $fh "#else /* H5_SIZEOF_", uc @$src_aref[0], " == H5_SIZEOF_", uc @$dst_aref[0], " */\n"; + print $fh " #define ASSIGN_", @$src_aref[0], "_TO_", @$dst_aref[0], "(dst, dsttype, src, srctype) \\\n"; + if ( @$src_aref[1] eq @$dst_aref[1]) { + print $fh " ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype)\n"; + } elsif ( @$src_aref[1] eq "SIGNED") { + print $fh " ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype)\n"; + } else { + print $fh " ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype)\n"; + } + print $fh "#endif /* src: @$src_aref[0] dst: @$dst_aref[0] */\n\n"; + } + } + } + +} + +############################################################################## +# Print end of ifdef's to prevent a file from being re-included +# +sub print_endprotect ($$) { + my ($fh, $file) = @_; + + # Clip off the ".h" part of the name + $file =~ s/(\w*)\.h/$1/; + + # Print the endif info + print $fh "#endif /* ${file}_H */\n\n"; +} + +############################################################################## +# Create the generated portion of the public header file +# +sub create_public ($) { + my $prefix = shift; # Get the prefix for the generated file + my $file = "H5overflow.h"; # Name of file to generate + my $name; # Name of function + + # Rename previous file +# rename "${prefix}${file}", "${prefix}${file}~" or die "unable to make backup"; + + # Open new header file + open HEADER, ">${prefix}${file}" or die "unable to modify source"; + + # Create file contents + print_copyright(*HEADER); + print_warning(*HEADER); + print_startprotect(*HEADER, $file); + print_typemacros(*HEADER); + print_endprotect(*HEADER, $file); + + # Close header file + close HEADER; +} + +############################################################################## +# Read symbol version file (given as command-line argument) in and process it +# into internal data structures, then create header files. +# +my $file; # Filename of input file + +for $file (@ARGV) { + my $prefix; # Local prefix for generated files + my $line; # Line from input file + +#print "file = '$file'\n"; + ($prefix) = ($file =~ /(^.*\/)/); +#print "prefix = '$prefix'\n"; + # Read in the entire file + open SOURCE, $file or die "$file: $!\n"; + while ( defined ($line=) ) { + # Skip blank lines and those lines whose first character is a '#' + if(!($line =~ /(^\s*#.*$)|(^\s*$)/)) { + # Construct data structures for later printing + parse_line($line); + } + } + close SOURCE; + + # Create header files + print "Generating 'H5overflow.h'\n"; + create_public($prefix); +} + diff --git a/c++/examples/testh5c++.sh.in b/c++/examples/testh5c++.sh.in index c9474bf..2b7bbfe 100755 --- a/c++/examples/testh5c++.sh.in +++ b/c++/examples/testh5c++.sh.in @@ -22,8 +22,8 @@ # Initializations # Where the tool is installed. prefix="${prefix:-@prefix@}" -AR=@AR@ -RANLIB=@RANLIB@ +AR="@AR@" +RANLIB="@RANLIB@" H5TOOL="h5c++" # The tool name H5TOOL_BIN="${prefix}/bin/${H5TOOL}" # The path of the tool binary diff --git a/config/gnu-flags b/config/gnu-flags index c99a664..fe3eba3 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -190,10 +190,67 @@ esac # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in -# Closer to the gcc 4.4 release, we should check for additional flags to +# Closer to the gcc 4.5 release, we should check for additional flags to # include and break it out into it's own section, like the other versions # below. -QAK - gcc-4.[34]*) + gcc-4.[45]*) + # Replace -ansi flag with -std=c99 flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Disable warnings about using 'long long' type + H5_CFLAGS="$H5_CFLAGS -Wno-long-long" + + # Append warning flags from gcc-3* case + # (don't use -Wpadded flag for normal builds, many of the warnings its + # issuing can't be fixed and they are making it hard to detect other, + # more important warnings) + #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" + + # Append warning flags from gcc-3.2* case + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" + + # Enable more format checking flags, beyond the basic -Wformat included + # in -Wall + H5_CFLAGS="$H5_CFLAGS -Wformat=2" + + # The "unreachable code" warning appears to be reliable now... + H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" + + # Append warning flags from gcc-3.3* case + H5_CFLAGS="$H5_CFLAGS -Wendif-labels" + + # Append warning flags from gcc-3.4* case + H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + + # Replace old -W flag with new -Wextra flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + + # Append more extra warning flags that only gcc4.0+ know about + H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" + + # Append more extra warning flags that only gcc 4.1+ know about + H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" + + # Append more extra warning flags that only gcc 4.2+ know about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" + + # Append more extra warning flags that only gcc 4.3+ know about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" + + # Append more extra warning flags that only gcc 4.4+ know about + H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" + + # Try out the new "stack protector" feature in gcc 4.1 + # (Strictly speaking this isn't really a "warning" flag, so it's added to + # the debugging flags) + #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" + ;; + + gcc-4.3*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" diff --git a/examples/h5_shared_mesg.c b/examples/h5_shared_mesg.c index a2edb38..0c7f2f0 100644 --- a/examples/h5_shared_mesg.c +++ b/examples/h5_shared_mesg.c @@ -261,9 +261,9 @@ create_standard_file(const char *filename, hid_t fcpl_id) * disk, so this type will be an array type rather than an atomic type. * However, any type can be shared. */ - temp_type_id = H5Tarray_create2(H5T_NATIVE_INT, 10, dims); + temp_type_id = H5Tarray_create2(H5T_NATIVE_INT, 2, dims); if(temp_type_id < 0) goto error; - type_id = H5Tarray_create2(temp_type_id, 10, dims); + type_id = H5Tarray_create2(temp_type_id, 2, dims); if(type_id < 0) goto error; ret = H5Tclose(temp_type_id); if(ret < 0) goto error; diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in index cf70c18..07c84ef 100755 --- a/examples/testh5cc.sh.in +++ b/examples/testh5cc.sh.in @@ -25,8 +25,8 @@ # Where the tool is installed. prefix="${prefix:-@prefix@}" PARALLEL=@PARALLEL@ # Am I in parallel mode? -AR=@AR@ -RANLIB=@RANLIB@ +AR="@AR@" +RANLIB="@RANLIB@" if [ "$PARALLEL" = no ]; then H5TOOL="h5cc" # The tool name else diff --git a/fortran/examples/testh5fc.sh.in b/fortran/examples/testh5fc.sh.in index 9f2d9bf..a25abbe 100755 --- a/fortran/examples/testh5fc.sh.in +++ b/fortran/examples/testh5fc.sh.in @@ -23,8 +23,8 @@ # Where the tool is installed. prefix="${prefix:-@prefix@}" PARALLEL=@PARALLEL@ # Am I in parallel mode? -AR=@AR@ -RANLIB=@RANLIB@ +AR="@AR@" +RANLIB="@RANLIB@" if [ "$PARALLEL" = no ]; then H5TOOL="h5fc" # The tool name else diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 7c073d6..e797d14 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -1792,6 +1792,7 @@ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t * if((ret = H5LT_dtype_to_text(dtype, &text_str, lang_type, &str_len, 1)) < 0) goto out; *len = strlen(text_str) + 1; + free(text_str); } else if(len && str) { if((ret = H5LT_dtype_to_text(dtype, &str, lang_type, len, 0)) < 0) goto out; @@ -2076,6 +2077,9 @@ next: break; } case H5T_OPAQUE: + { + char *tag; + /* Print lead-in */ sprintf(*dt_str, "H5T_OPAQUE {\n"); indent += COL; @@ -2085,7 +2089,12 @@ next: strcat(*dt_str, tmp_str); indentation(indent + COL, *dt_str); - sprintf(tmp_str, "OPQ_TAG \"%s\";\n", H5Tget_tag(dtype)); + tag = H5Tget_tag(dtype); + if(tag) { + sprintf(tmp_str, "OPQ_TAG \"%s\";\n", tag); + free(tag); + } else + sprintf(tmp_str, "OPQ_TAG \"\";\n"); strcat(*dt_str, tmp_str); /* Print closing */ @@ -2094,6 +2103,7 @@ next: strcat(*dt_str, "}"); break; + } case H5T_ENUM: { hid_t super; diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 6de2e31..8c9fb30 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1317,10 +1317,12 @@ static int test_enums(void) dt_str = (char*)calloc(str_len, sizeof(char)); if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) goto out; - /*if(strcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { - printf("dt=\n%s\n", dt_str); - goto out; - }*/ + if(strcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { + + printf("dt=\n%s\n", dt_str); + goto out; + } + free(dt_str); if(H5Tclose(dtype)<0) @@ -1427,10 +1429,11 @@ static int test_arrays(void) dt_str = (char*)calloc(str_len, sizeof(char)); if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) goto out; - /*if(strcmp(dt_str, "H5T_ARRAY { [5][7][13] H5T_ARRAY { [17][19] H5T_COMPOUND { H5T_STD_I8BE \"arr_compound_1\"; H5T_STD_I32BE \"arr_compound_2\"; } } }")) { - printf("dt=\n%s\n", dt_str); - goto out; - }*/ + if(strcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) { + printf("dt=\n%s\n", dt_str); + goto out; + } + free(dt_str); if(H5Tclose(dtype)<0) diff --git a/src/H5Apkg.h b/src/H5Apkg.h index b166b06..3c62635 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -163,14 +163,16 @@ typedef struct { typedef herr_t (*H5A_lib_iterate_t)(const H5A_t *attr, void *op_data); /* Describe kind of callback to make for each attribute */ -struct H5A_attr_iter_op_t { - enum { +typedef enum H5A_attr_iter_op_type_t { #ifndef H5_NO_DEPRECATED_SYMBOLS - H5A_ATTR_OP_APP, /* Application callback */ + H5A_ATTR_OP_APP, /* Application callback */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - H5A_ATTR_OP_APP2, /* Revised application callback */ - H5A_ATTR_OP_LIB /* Library internal callback */ - } op_type; + H5A_ATTR_OP_APP2, /* Revised application callback */ + H5A_ATTR_OP_LIB /* Library internal callback */ +} H5A_attr_iter_op_type_t; + +typedef struct H5A_attr_iter_op_t { + H5A_attr_iter_op_type_t op_type; union { #ifndef H5_NO_DEPRECATED_SYMBOLS H5A_operator1_t app_op; /* Application callback for each attribute */ @@ -178,7 +180,7 @@ struct H5A_attr_iter_op_t { H5A_operator2_t app_op2; /* Revised application callback for each attribute */ H5A_lib_iterate_t lib_op; /* Library internal callback for each attribute */ } u; -}; +} H5A_attr_iter_op_t; /*****************************/ diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index d46e46b..0c0e519 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -37,7 +37,6 @@ /* Forward references of package typedefs */ typedef struct H5A_t H5A_t; -typedef struct H5A_attr_iter_op_t H5A_attr_iter_op_t; /*****************************/ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 3662b3c..047db92 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -173,7 +173,7 @@ typedef struct H5D_chunk_it_ud4_t { /********************/ /* Chunked layout operation callbacks */ -static herr_t H5D_chunk_new(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, +static herr_t H5D_chunk_construct(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, const H5P_genplist_t *dc_plist); static herr_t H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, @@ -216,7 +216,7 @@ static herr_t H5D_chunk_mem_cb(void *elem, hid_t type_id, unsigned ndims, /* Chunked storage layout I/O ops */ const H5D_layout_ops_t H5D_LOPS_CHUNK[1] = {{ - H5D_chunk_new, + H5D_chunk_construct, H5D_chunk_is_space_alloc, H5D_chunk_io_init, H5D_chunk_read, @@ -269,7 +269,7 @@ H5FL_DEFINE_STATIC(H5D_chunk_prune_stack_t); /*------------------------------------------------------------------------- - * Function: H5D_chunk_new + * Function: H5D_chunk_construct * * Purpose: Constructs new chunked layout information for dataset * @@ -285,7 +285,7 @@ H5FL_DEFINE_STATIC(H5D_chunk_prune_stack_t); *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_new(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, +H5D_chunk_construct(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, const H5P_genplist_t *dc_plist) { const H5T_t *type = dset->shared->type; /* Convenience pointer to dataset's datatype */ @@ -295,7 +295,7 @@ H5D_chunk_new(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_new) + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_construct) /* Sanity checks */ HDassert(f); @@ -355,7 +355,7 @@ H5D_chunk_new(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_new() */ +} /* end H5D_chunk_construct() */ /*------------------------------------------------------------------------- @@ -3954,7 +3954,7 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_layout_t *layout) idx_info.layout = layout; /* Delete the chunked storage information in the file */ - if((layout->u.chunk.ops->delete)(&idx_info) < 0) + if((layout->u.chunk.ops->idx_delete)(&idx_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk index") done: diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index ad95e18..f773f5f 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -57,7 +57,7 @@ /********************/ /* Layout operation callbacks */ -static herr_t H5D_compact_new(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, +static herr_t H5D_compact_construct(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, const H5P_genplist_t *dc_plist); static hbool_t H5D_compact_is_space_alloc(const H5O_layout_t *layout); static herr_t H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, @@ -77,7 +77,7 @@ static ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info, /* Compact storage layout I/O ops */ const H5D_layout_ops_t H5D_LOPS_COMPACT[1] = {{ - H5D_compact_new, + H5D_compact_construct, H5D_compact_is_space_alloc, H5D_compact_io_init, H5D_contig_read, @@ -154,7 +154,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_compact_new + * Function: H5D_compact_construct * * Purpose: Constructs new compact layout information for dataset * @@ -167,14 +167,14 @@ done: */ /* ARGSUSED */ static herr_t -H5D_compact_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset, +H5D_compact_construct(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset, const H5P_genplist_t UNUSED *dc_plist) { hssize_t tmp_size; /* Temporary holder for raw data size */ hsize_t comp_data_size; /* Size of compact data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_compact_new) + FUNC_ENTER_NOAPI_NOINIT(H5D_compact_construct) /* Sanity checks */ HDassert(f); @@ -197,7 +197,7 @@ H5D_compact_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dse done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_compact_new() */ +} /* end H5D_compact_construct() */ /*------------------------------------------------------------------------- diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 6ba6cbb..1275ee1 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -61,7 +61,7 @@ /********************/ /* Layout operation callbacks */ -static herr_t H5D_contig_new(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, +static herr_t H5D_contig_construct(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, const H5P_genplist_t *dc_plist); static hbool_t H5D_contig_is_space_alloc(const H5O_layout_t *layout); static herr_t H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, @@ -79,7 +79,7 @@ static herr_t H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset, /* Contiguous storage layout I/O ops */ const H5D_layout_ops_t H5D_LOPS_CONTIG[1] = {{ - H5D_contig_new, + H5D_contig_construct, H5D_contig_is_space_alloc, H5D_contig_io_init, H5D_contig_read, @@ -360,7 +360,7 @@ H5D_contig_get_addr(const H5D_t *dset) /*------------------------------------------------------------------------- - * Function: H5D_contig_new + * Function: H5D_contig_construct * * Purpose: Constructs new contiguous layout information for dataset * @@ -373,7 +373,7 @@ H5D_contig_get_addr(const H5D_t *dset) */ /* ARGSUSED */ static herr_t -H5D_contig_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset, +H5D_contig_construct(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset, const H5P_genplist_t UNUSED *dc_plist) { hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ @@ -386,7 +386,7 @@ H5D_contig_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_new) + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_construct) /* Sanity checks */ HDassert(f); @@ -429,7 +429,7 @@ H5D_contig_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_new() */ +} /* end H5D_contig_construct() */ /*------------------------------------------------------------------------- diff --git a/src/H5Defl.c b/src/H5Defl.c index f3b346e..a22ca2d 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -49,7 +49,7 @@ /********************/ /* Layout operation callbacks */ -static herr_t H5D_efl_new(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, +static herr_t H5D_efl_construct(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, const H5P_genplist_t *dc_plist); static hbool_t H5D_efl_is_space_alloc(const H5O_layout_t *layout); static herr_t H5D_efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, @@ -75,7 +75,7 @@ static herr_t H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, /* External File List (EFL) storage layout I/O ops */ const H5D_layout_ops_t H5D_LOPS_EFL[1] = {{ - H5D_efl_new, + H5D_efl_construct, H5D_efl_is_space_alloc, H5D_efl_io_init, H5D_contig_read, @@ -97,7 +97,7 @@ const H5D_layout_ops_t H5D_LOPS_EFL[1] = {{ /*------------------------------------------------------------------------- - * Function: H5D_efl_new + * Function: H5D_efl_construct * * Purpose: Constructs new EFL layout information for dataset * @@ -109,7 +109,7 @@ const H5D_layout_ops_t H5D_LOPS_EFL[1] = {{ *------------------------------------------------------------------------- */ static herr_t -H5D_efl_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset, +H5D_efl_construct(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset, const H5P_genplist_t *dc_plist) { size_t dt_size; /* Size of datatype */ @@ -122,7 +122,7 @@ H5D_efl_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset, int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_efl_new) + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_construct) /* Sanity checks */ HDassert(f); @@ -167,7 +167,7 @@ H5D_efl_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_efl_new() */ +} /* end H5D_efl_construct() */ /*------------------------------------------------------------------------- diff --git a/src/H5Dint.c b/src/H5Dint.c index 6990ba2..1ab6dce 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1152,7 +1152,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize I/O operations") /* Create the layout information for the new dataset */ - if((new_dset->shared->layout.ops->new)(file, dapl_id, dxpl_id, new_dset, dc_plist) < 0) + if((new_dset->shared->layout.ops->construct)(file, dapl_id, dxpl_id, new_dset, dc_plist) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize layout information") /* Indicate that the layout information was initialized */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index b936dba..c3a4d2e 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -100,7 +100,7 @@ struct H5D_io_info_t; struct H5D_chunk_map_t; /* Function pointers for I/O on particular types of dataset layouts */ -typedef herr_t (*H5D_layout_new_func_t)(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, +typedef herr_t (*H5D_layout_construct_func_t)(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset, const H5P_genplist_t *dc_plist); typedef hbool_t (*H5D_layout_is_space_alloc_func_t)(const H5O_layout_t *layout); typedef herr_t (*H5D_layout_io_init_func_t)(const struct H5D_io_info_t *io_info, @@ -123,7 +123,7 @@ typedef herr_t (*H5D_layout_io_term_func_t)(const struct H5D_chunk_map_t *cm); /* Typedef for grouping layout I/O routines */ typedef struct H5D_layout_ops_t { - H5D_layout_new_func_t new; /* Layout constructor for new datasets */ + H5D_layout_construct_func_t construct; /* Layout constructor for new datasets */ H5D_layout_is_space_alloc_func_t is_space_alloc; /* Query routine to determine if storage is allocated */ H5D_layout_io_init_func_t io_init; /* I/O initialization routine */ H5D_layout_read_func_t ser_read; /* High-level I/O routine for reading data in serial */ @@ -177,6 +177,11 @@ typedef union H5D_storage_t { } H5D_storage_t; /* Typedef for raw data I/O operation info */ +typedef enum H5D_io_op_type_t { + H5D_IO_OP_READ, /* Read operation */ + H5D_IO_OP_WRITE /* Write operation */ +} H5D_io_op_type_t; + typedef struct H5D_io_info_t { H5D_t *dset; /* Pointer to dataset being operated on */ #ifndef H5_HAVE_PARALLEL @@ -196,10 +201,7 @@ typedef struct H5D_io_info_t { H5D_storage_t *store; /* Dataset storage info */ H5D_layout_ops_t layout_ops; /* Dataset layout I/O operation function pointers */ H5D_io_ops_t io_ops; /* I/O operation function pointers */ - enum { - H5D_IO_OP_READ, /* Read operation */ - H5D_IO_OP_WRITE /* Write operation */ - } op_type; + H5D_io_op_type_t op_type; union { void *rbuf; /* Pointer to buffer for read */ const void *wbuf; /* Pointer to buffer to write */ @@ -295,7 +297,7 @@ typedef struct H5D_chunk_ops_t { H5D_chunk_get_addr_func_t get_addr; /* Routine to retrieve address of chunk in file */ H5D_chunk_iterate_func_t iterate; /* Routine to iterate over chunks */ H5D_chunk_remove_func_t remove; /* Routine to remove a chunk from an index */ - H5D_chunk_delete_func_t delete; /* Routine to delete index & all chunks from file*/ + H5D_chunk_delete_func_t idx_delete; /* Routine to delete index & all chunks from file*/ H5D_chunk_copy_setup_func_t copy_setup; /* Routine to perform any necessary setup for copying chunks */ H5D_chunk_copy_shutdown_func_t copy_shutdown; /* Routine to perform any necessary shutdown for copying chunks */ H5D_chunk_size_func_t size; /* Routine to get size of indexing information */ diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index 8e4c634..d9d0a4c 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -321,7 +321,7 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde /* Protect super block */ /* (Note: setting parent of super block to 'hdr' for this operation should be OK -QAK) */ - if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, hdr, addr, sblk_idx, H5AC_READ))) + if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, (H5EA_iblock_t *)hdr, addr, sblk_idx, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)addr) /* Print opening message */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index b2f837a..f64f520 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -39,7 +39,6 @@ /* Revisions to FUNC_ENTER/LEAVE & Error Macros */ /************************************************/ -#ifndef NDEBUG /* `S' is the name of a function which is being tested to check if it's */ /* a public API function */ #define H5_IS_PUB(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && HDislower(S[2])) || \ @@ -58,6 +57,7 @@ ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && '_' == S[4] && HDislower(S[5])) || \ ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && '_' == S[5] && HDislower(S[6]))) +#ifndef NDEBUG #define FUNC_ENTER_NAME_CHECK(asrt) \ { \ static hbool_t func_check = FALSE; \ @@ -72,13 +72,11 @@ } /* end scope */ #else /* NDEBUG */ #define FUNC_ENTER_NAME_CHECK(asrt) -#define H5_IS_PUB(S) -#define H5_IS_PRIV(S) -#define H5_IS_PKG(S) #endif /* NDEBUG */ -/* Macro for referencing package initialization variables */ +/* Macros for referencing package initialization symbols */ #define H5_PACKAGE_INIT_VAR(x) H5_GLUE3(H5_, x, _init_g) +#define H5_PACKAGE_INIT_FUNC(x) H5_GLUE(x, __pkg_init) /* Macros to check if a package is initialized */ #define H5_CHECK_PACKAGE_INIT_REG_YES(asrt) HDassert(H5_PACKAGE_INIT_VAR(pkg)); @@ -98,14 +96,18 @@ } /* end if */ #define H5_PKG_NO_INIT(pkg) -/* Macros to declare package initialization variable, if a package initialization routine is defined */ +/* Macros to declare package initialization symbols, if a package initialization routine is defined */ #define H5_PKG_YES_INIT_VAR(pkg) extern hbool_t H5_PACKAGE_INIT_VAR(H5_MY_PKG); #define H5_PKG_NO_INIT_VAR(pkg) +#define H5_PKG_YES_INIT_FUNC(pkg) extern herr_t H5_PACKAGE_INIT_FUNC(pkg)(void); +#define H5_PKG_NO_INIT_FUNC(pkg) -/* Declare package initialization variable (if in a package) */ +/* Declare package initialization symbols (if in a package) */ #define H5_DECLARE_PKG_VAR(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT_VAR)(pkg) +#define H5_DECLARE_PKG_FUNC(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT_FUNC)(pkg) #ifdef H5_MY_PKG H5_DECLARE_PKG_VAR(H5_MY_PKG_INIT, H5_MY_PKG) +H5_DECLARE_PKG_FUNC(H5_MY_PKG_INIT, H5_MY_PKG) #endif /* H5_MY_PKG */ /* API re-entrance variable */ @@ -226,6 +228,13 @@ func \ #define H5_PRIV_FUNC_INIT_FAILED(pkg_init) H5_GLUE3(H5_PRIV_, pkg_init, _FUNC_INIT_FAILED) /* Macros for leaving different scopes of routines */ +#define FUNC_LEAVE_PKGINIT \ + /* Leave scope for this type of function */ \ + } \ + \ + /* Pop the name of this function off the function stack */ \ + H5_POP_FUNC + #define FUNC_LEAVE_STATIC \ /* Leave scope for this type of function */ \ } \ diff --git a/src/H5Eint.c b/src/H5Eint.c index ba1b1e0..52f8aac 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -362,8 +362,9 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data) if(min_ptr->msg) min_str = min_ptr->msg; - /* Get error class info */ - cls_ptr = maj_ptr->cls; + /* Get error class info. Don't use the class of the major or minor error because + * they might be different. */ + cls_ptr = (H5E_cls_t *)H5I_object_verify(err_desc->cls_id, H5I_ERROR_CLASS); /* Print error class header if new class */ if(eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) { diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 7b1d7ef..c6adb67 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -40,7 +40,7 @@ typedef struct H5E_t H5E_t; */ #define HCOMMON_ERROR(maj, min, str) \ HERROR(maj, min, str); \ - (void)H5E_dump_api_stack((hbool_t)H5_IS_API(FUNC)); + err_occurred = TRUE; /* * HDONE_ERROR macro, used to facilitate error reporting between a diff --git a/src/H5FScache.c b/src/H5FScache.c index b896197..5d901e9 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -203,7 +203,7 @@ HDfprintf(stderr, "%s: Load free space header, addr = %a\n", FUNC, addr); HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space header version") /* Client ID */ - fspace->client = *p++; + fspace->client = (H5FS_client_t)*p++; if(fspace->client >= H5FS_NUM_CLIENT_ID) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "unknown client ID in free space header") diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 77e6d1a..9ad6c70 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -232,7 +232,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") /* Re-protect the section info with read-write access */ - if(NULL == (fspace->sinfo = H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, NULL, fspace, H5AC_WRITE))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, NULL, fspace, H5AC_WRITE))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to load free space sections") /* Switch the access mode we have */ @@ -251,7 +251,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %a\n", FUNC, fspace->sect_addr); #endif /* H5FS_SINFO_DEBUG */ /* Protect the free space sections */ - if(NULL == (fspace->sinfo = H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, NULL, fspace, accmode))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, NULL, fspace, accmode))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to load free space sections") /* Remember that we protected the section info & the access mode */ @@ -1186,7 +1186,7 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) greater_sect_node_valid = TRUE; /* Get section for 'less than' skip list node */ - tmp_sect = H5SL_item(less_sect_node); + tmp_sect = (H5FS_section_info_t *)H5SL_item(less_sect_node); /* Get classes for right & left sections */ tmp_sect_cls = &fspace->sect_cls[tmp_sect->type]; @@ -1229,7 +1229,7 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) /* Check for node after new node able to merge with new node */ if(greater_sect_node) { /* Get section for 'greater than' skip list node */ - tmp_sect = H5SL_item(greater_sect_node); + tmp_sect = (H5FS_section_info_t *)H5SL_item(greater_sect_node); /* Get classes for right & left sections */ sect_cls = &fspace->sect_cls[(*sect)->type]; @@ -1307,7 +1307,7 @@ HDfprintf(stderr, "%s: Can shrink!\n", FUNC); /* Check for last node in the merge list */ if(NULL != (last_node = H5SL_last(fspace->sinfo->merge_list))) { /* Get the pointer to the last section, from the last node */ - *sect = H5SL_item(last_node); + *sect = (H5FS_section_info_t *)H5SL_item(last_node); HDassert(*sect); /* Indicate that this section needs to be removed if it causes a shrink */ @@ -1500,7 +1500,7 @@ if(_section_) */ /* Look for a section after block to extend */ - if((sect = H5SL_greater(fspace->sinfo->merge_list, &addr))) { + if((sect = (H5FS_section_info_t *)H5SL_greater(fspace->sinfo->merge_list, &addr))) { /* Check if this section adjoins the block and is large enough to * fulfill extension request. * @@ -1640,10 +1640,10 @@ HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); H5SL_node_t *curr_sect_node=NULL; /* Get the free space node for free space sections of the same size */ - curr_fspace_node = H5SL_item(curr_size_node); + curr_fspace_node = (H5FS_node_t *)H5SL_item(curr_size_node); /* Get the Skip list which holds pointers to actual free list sections */ - curr_sect_node = H5SL_first(curr_fspace_node->sect_list); + curr_sect_node = (H5SL_node_t *)H5SL_first(curr_fspace_node->sect_list); while(curr_sect_node != NULL) { H5FS_section_info_t *curr_sect=NULL; @@ -1651,7 +1651,7 @@ HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); H5FS_section_info_t *split_sect=NULL; /* Get section node */ - curr_sect = H5SL_item(curr_sect_node); + curr_sect = (H5FS_section_info_t *)H5SL_item(curr_sect_node); HDassert(H5F_addr_defined(curr_sect->addr)); HDassert(curr_fspace_node->sect_size == curr_sect->size); @@ -1666,7 +1666,7 @@ HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); if ((curr_sect->size >= (request + frag_size)) && (cls->split)) { /* remove the section with aligned address */ - if(NULL == (*node = H5SL_remove(curr_fspace_node->sect_list, &curr_sect->addr))) + if(NULL == (*node = (H5FS_section_info_t *)H5SL_remove(curr_fspace_node->sect_list, &curr_sect->addr))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTREMOVE, FAIL, "can't remove free space node from skip list") /* Decrement # of sections in section size node */ if(H5FS_size_node_decr(fspace->sinfo, bin, curr_fspace_node, cls) < 0) diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 0840ee7..3d25109 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -144,13 +144,15 @@ struct H5G_t { typedef herr_t (*H5G_lib_iterate_t)(const H5O_link_t *lnk, void *op_data); /* Describe kind of callback to make for each link */ -typedef struct { - enum { +typedef enum H5G_link_iterate_op_type_t { #ifndef H5_NO_DEPRECATED_SYMBOLS - H5G_LINK_OP_OLD, /* "Old" application callback */ + H5G_LINK_OP_OLD, /* "Old" application callback */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - H5G_LINK_OP_NEW /* "New" application callback */ - } op_type; + H5G_LINK_OP_NEW /* "New" application callback */ +} H5G_link_iterate_op_type_t; + +typedef struct { + H5G_link_iterate_op_type_t op_type; union { #ifndef H5_NO_DEPRECATED_SYMBOLS H5G_iterate_t op_old; /* "Old" application callback for each link */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index cb6db7b..4e4844e 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -556,11 +556,13 @@ typedef herr_t (*H5O_lib_operator_t)(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, hbool_t *oh_modified/*out*/, void *operator_data/*in,out*/); /* Some syntactic sugar to make the compiler happy with two different kinds of iterator callbacks */ +typedef enum H5O_mesg_operator_type_t { + H5O_MESG_OP_APP, /* Application callback */ + H5O_MESG_OP_LIB /* Library internal callback */ +} H5O_mesg_operator_type_t; + typedef struct { - enum { - H5O_MESG_OP_APP, /* Application callback */ - H5O_MESG_OP_LIB /* Library internal callback */ - } op_type; + H5O_mesg_operator_type_t op_type; union { H5O_operator_t app_op; /* Application callback for each message */ H5O_lib_operator_t lib_op; /* Library internal callback for each message */ diff --git a/src/H5detect.c b/src/H5detect.c index 146750c..8d7b93b 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -522,7 +522,7 @@ static void insert_libhdf5_settings(void) { FILE *fsettings; - char inchar; + int inchar; int bol=0; /* indicates the beginning of a new line */ if (NULL==(fsettings=HDfopen(LIBSETTINGSFNAME, "r"))){ diff --git a/src/H5overflow.h b/src/H5overflow.h new file mode 100644 index 0000000..1c00acf --- /dev/null +++ b/src/H5overflow.h @@ -0,0 +1,1381 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Generated automatically by bin/make_overflow -- do not edit */ +/* Add new types to H5overflow.txt file */ + + +#ifndef _H5overflow_H +#define _H5overflow_H + + +/* Each type in this file is tested for assignment to the other types, + * and range checks are defined for bad assignments at run-time. + */ + +/* Assignment checks for unsigned */ + +/* src: unsigned, dst: int */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_INT + #define ASSIGN_unsigned_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_INT + #define ASSIGN_unsigned_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_INT */ + #define ASSIGN_unsigned_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: int */ + +/* src: unsigned, dst: uint8_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_UINT8_T + #define ASSIGN_unsigned_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_UINT8_T + #define ASSIGN_unsigned_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_UINT8_T */ + #define ASSIGN_unsigned_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: uint8_t */ + +/* src: unsigned, dst: uint32_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_UINT32_T + #define ASSIGN_unsigned_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_UINT32_T + #define ASSIGN_unsigned_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_UINT32_T */ + #define ASSIGN_unsigned_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: uint32_t */ + +/* src: unsigned, dst: uint64_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_UINT64_T + #define ASSIGN_unsigned_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_UINT64_T + #define ASSIGN_unsigned_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_UINT64_T */ + #define ASSIGN_unsigned_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: uint64_t */ + +/* src: unsigned, dst: size_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_SIZE_T + #define ASSIGN_unsigned_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_SIZE_T + #define ASSIGN_unsigned_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_SIZE_T */ + #define ASSIGN_unsigned_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: size_t */ + +/* src: unsigned, dst: ssize_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_SSIZE_T + #define ASSIGN_unsigned_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_SSIZE_T + #define ASSIGN_unsigned_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_unsigned_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: ssize_t */ + +/* src: unsigned, dst: haddr_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_HADDR_T + #define ASSIGN_unsigned_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_HADDR_T + #define ASSIGN_unsigned_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_HADDR_T */ + #define ASSIGN_unsigned_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: haddr_t */ + +/* src: unsigned, dst: hsize_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_HSIZE_T + #define ASSIGN_unsigned_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_HSIZE_T + #define ASSIGN_unsigned_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_unsigned_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: hsize_t */ + +/* src: unsigned, dst: hssize_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_HSSIZE_T + #define ASSIGN_unsigned_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_HSSIZE_T + #define ASSIGN_unsigned_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_unsigned_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: hssize_t */ + +/* src: unsigned, dst: h5_stat_size_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_unsigned_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_unsigned_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_unsigned_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: h5_stat_size_t */ + + +/* Assignment checks for int */ + +/* src: int, dst: unsigned */ +#if H5_SIZEOF_INT < H5_SIZEOF_UNSIGNED + #define ASSIGN_int_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_UNSIGNED + #define ASSIGN_int_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_int_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: unsigned */ + +/* src: int, dst: uint8_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_UINT8_T + #define ASSIGN_int_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_UINT8_T + #define ASSIGN_int_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_UINT8_T */ + #define ASSIGN_int_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: uint8_t */ + +/* src: int, dst: uint32_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_UINT32_T + #define ASSIGN_int_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_UINT32_T + #define ASSIGN_int_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_UINT32_T */ + #define ASSIGN_int_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: uint32_t */ + +/* src: int, dst: uint64_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_UINT64_T + #define ASSIGN_int_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_UINT64_T + #define ASSIGN_int_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_UINT64_T */ + #define ASSIGN_int_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: uint64_t */ + +/* src: int, dst: size_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_SIZE_T + #define ASSIGN_int_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_SIZE_T + #define ASSIGN_int_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_SIZE_T */ + #define ASSIGN_int_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: size_t */ + +/* src: int, dst: ssize_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_SSIZE_T + #define ASSIGN_int_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_SSIZE_T + #define ASSIGN_int_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_int_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: ssize_t */ + +/* src: int, dst: haddr_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_HADDR_T + #define ASSIGN_int_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_HADDR_T + #define ASSIGN_int_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_HADDR_T */ + #define ASSIGN_int_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: haddr_t */ + +/* src: int, dst: hsize_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_HSIZE_T + #define ASSIGN_int_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_HSIZE_T + #define ASSIGN_int_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_int_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: hsize_t */ + +/* src: int, dst: hssize_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_HSSIZE_T + #define ASSIGN_int_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_HSSIZE_T + #define ASSIGN_int_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_int_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: hssize_t */ + +/* src: int, dst: h5_stat_size_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_int_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_int_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_int_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: h5_stat_size_t */ + + +/* Assignment checks for uint8_t */ + +/* src: uint8_t, dst: unsigned */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_uint8_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_uint8_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_uint8_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: unsigned */ + +/* src: uint8_t, dst: int */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_INT + #define ASSIGN_uint8_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_INT + #define ASSIGN_uint8_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_INT */ + #define ASSIGN_uint8_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: int */ + +/* src: uint8_t, dst: uint32_t */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_UINT32_T + #define ASSIGN_uint8_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_UINT32_T + #define ASSIGN_uint8_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_UINT32_T */ + #define ASSIGN_uint8_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: uint32_t */ + +/* src: uint8_t, dst: uint64_t */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_UINT64_T + #define ASSIGN_uint8_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_UINT64_T + #define ASSIGN_uint8_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_UINT64_T */ + #define ASSIGN_uint8_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: uint64_t */ + +/* src: uint8_t, dst: size_t */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_SIZE_T + #define ASSIGN_uint8_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_SIZE_T + #define ASSIGN_uint8_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_SIZE_T */ + #define ASSIGN_uint8_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: size_t */ + +/* src: uint8_t, dst: ssize_t */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_SSIZE_T + #define ASSIGN_uint8_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_SSIZE_T + #define ASSIGN_uint8_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_uint8_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: ssize_t */ + +/* src: uint8_t, dst: haddr_t */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_HADDR_T + #define ASSIGN_uint8_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_HADDR_T + #define ASSIGN_uint8_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_HADDR_T */ + #define ASSIGN_uint8_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: haddr_t */ + +/* src: uint8_t, dst: hsize_t */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_HSIZE_T + #define ASSIGN_uint8_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_HSIZE_T + #define ASSIGN_uint8_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_uint8_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: hsize_t */ + +/* src: uint8_t, dst: hssize_t */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_HSSIZE_T + #define ASSIGN_uint8_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_HSSIZE_T + #define ASSIGN_uint8_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_uint8_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: hssize_t */ + +/* src: uint8_t, dst: h5_stat_size_t */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_uint8_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_uint8_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_uint8_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: h5_stat_size_t */ + + +/* Assignment checks for uint32_t */ + +/* src: uint32_t, dst: unsigned */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_uint32_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_uint32_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_uint32_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: unsigned */ + +/* src: uint32_t, dst: int */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_INT + #define ASSIGN_uint32_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_INT + #define ASSIGN_uint32_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_INT */ + #define ASSIGN_uint32_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: int */ + +/* src: uint32_t, dst: uint8_t */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_UINT8_T + #define ASSIGN_uint32_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_UINT8_T + #define ASSIGN_uint32_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_UINT8_T */ + #define ASSIGN_uint32_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: uint8_t */ + +/* src: uint32_t, dst: uint64_t */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_UINT64_T + #define ASSIGN_uint32_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_UINT64_T + #define ASSIGN_uint32_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_UINT64_T */ + #define ASSIGN_uint32_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: uint64_t */ + +/* src: uint32_t, dst: size_t */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_SIZE_T + #define ASSIGN_uint32_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_SIZE_T + #define ASSIGN_uint32_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_SIZE_T */ + #define ASSIGN_uint32_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: size_t */ + +/* src: uint32_t, dst: ssize_t */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_SSIZE_T + #define ASSIGN_uint32_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_SSIZE_T + #define ASSIGN_uint32_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_uint32_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: ssize_t */ + +/* src: uint32_t, dst: haddr_t */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_HADDR_T + #define ASSIGN_uint32_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_HADDR_T + #define ASSIGN_uint32_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_HADDR_T */ + #define ASSIGN_uint32_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: haddr_t */ + +/* src: uint32_t, dst: hsize_t */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_HSIZE_T + #define ASSIGN_uint32_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_HSIZE_T + #define ASSIGN_uint32_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_uint32_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: hsize_t */ + +/* src: uint32_t, dst: hssize_t */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_HSSIZE_T + #define ASSIGN_uint32_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_HSSIZE_T + #define ASSIGN_uint32_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_uint32_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: hssize_t */ + +/* src: uint32_t, dst: h5_stat_size_t */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_uint32_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_uint32_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_uint32_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: h5_stat_size_t */ + + +/* Assignment checks for uint64_t */ + +/* src: uint64_t, dst: unsigned */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_uint64_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_uint64_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_uint64_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: unsigned */ + +/* src: uint64_t, dst: int */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_INT + #define ASSIGN_uint64_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_INT + #define ASSIGN_uint64_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_INT */ + #define ASSIGN_uint64_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: int */ + +/* src: uint64_t, dst: uint8_t */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_UINT8_T + #define ASSIGN_uint64_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_UINT8_T + #define ASSIGN_uint64_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_UINT8_T */ + #define ASSIGN_uint64_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: uint8_t */ + +/* src: uint64_t, dst: uint32_t */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_UINT32_T + #define ASSIGN_uint64_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_UINT32_T + #define ASSIGN_uint64_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_UINT32_T */ + #define ASSIGN_uint64_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: uint32_t */ + +/* src: uint64_t, dst: size_t */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_SIZE_T + #define ASSIGN_uint64_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_SIZE_T + #define ASSIGN_uint64_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_SIZE_T */ + #define ASSIGN_uint64_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: size_t */ + +/* src: uint64_t, dst: ssize_t */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_SSIZE_T + #define ASSIGN_uint64_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_SSIZE_T + #define ASSIGN_uint64_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_uint64_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: ssize_t */ + +/* src: uint64_t, dst: haddr_t */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_HADDR_T + #define ASSIGN_uint64_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_HADDR_T + #define ASSIGN_uint64_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_HADDR_T */ + #define ASSIGN_uint64_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: haddr_t */ + +/* src: uint64_t, dst: hsize_t */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_HSIZE_T + #define ASSIGN_uint64_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_HSIZE_T + #define ASSIGN_uint64_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_uint64_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: hsize_t */ + +/* src: uint64_t, dst: hssize_t */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_HSSIZE_T + #define ASSIGN_uint64_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_HSSIZE_T + #define ASSIGN_uint64_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_uint64_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: hssize_t */ + +/* src: uint64_t, dst: h5_stat_size_t */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_uint64_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_uint64_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_uint64_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: h5_stat_size_t */ + + +/* Assignment checks for size_t */ + +/* src: size_t, dst: unsigned */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_size_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_size_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_size_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: unsigned */ + +/* src: size_t, dst: int */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_INT + #define ASSIGN_size_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_INT + #define ASSIGN_size_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_INT */ + #define ASSIGN_size_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: int */ + +/* src: size_t, dst: uint8_t */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_UINT8_T + #define ASSIGN_size_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_UINT8_T + #define ASSIGN_size_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_UINT8_T */ + #define ASSIGN_size_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: uint8_t */ + +/* src: size_t, dst: uint32_t */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_UINT32_T + #define ASSIGN_size_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_UINT32_T + #define ASSIGN_size_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_UINT32_T */ + #define ASSIGN_size_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: uint32_t */ + +/* src: size_t, dst: uint64_t */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_UINT64_T + #define ASSIGN_size_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_UINT64_T + #define ASSIGN_size_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_UINT64_T */ + #define ASSIGN_size_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: uint64_t */ + +/* src: size_t, dst: ssize_t */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_SSIZE_T + #define ASSIGN_size_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_SSIZE_T + #define ASSIGN_size_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_size_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: ssize_t */ + +/* src: size_t, dst: haddr_t */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_HADDR_T + #define ASSIGN_size_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_HADDR_T + #define ASSIGN_size_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_HADDR_T */ + #define ASSIGN_size_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: haddr_t */ + +/* src: size_t, dst: hsize_t */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_HSIZE_T + #define ASSIGN_size_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_HSIZE_T + #define ASSIGN_size_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_size_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: hsize_t */ + +/* src: size_t, dst: hssize_t */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_HSSIZE_T + #define ASSIGN_size_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_HSSIZE_T + #define ASSIGN_size_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_size_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: hssize_t */ + +/* src: size_t, dst: h5_stat_size_t */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_size_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_size_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_size_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: h5_stat_size_t */ + + +/* Assignment checks for ssize_t */ + +/* src: ssize_t, dst: unsigned */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_ssize_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_ssize_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_ssize_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: unsigned */ + +/* src: ssize_t, dst: int */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_INT + #define ASSIGN_ssize_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_INT + #define ASSIGN_ssize_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_INT */ + #define ASSIGN_ssize_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: int */ + +/* src: ssize_t, dst: uint8_t */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_UINT8_T + #define ASSIGN_ssize_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_UINT8_T + #define ASSIGN_ssize_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_UINT8_T */ + #define ASSIGN_ssize_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: uint8_t */ + +/* src: ssize_t, dst: uint32_t */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_UINT32_T + #define ASSIGN_ssize_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_UINT32_T + #define ASSIGN_ssize_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_UINT32_T */ + #define ASSIGN_ssize_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: uint32_t */ + +/* src: ssize_t, dst: uint64_t */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_UINT64_T + #define ASSIGN_ssize_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_UINT64_T + #define ASSIGN_ssize_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_UINT64_T */ + #define ASSIGN_ssize_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: uint64_t */ + +/* src: ssize_t, dst: size_t */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_SIZE_T + #define ASSIGN_ssize_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_SIZE_T + #define ASSIGN_ssize_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_SIZE_T */ + #define ASSIGN_ssize_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: size_t */ + +/* src: ssize_t, dst: haddr_t */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_HADDR_T + #define ASSIGN_ssize_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_HADDR_T + #define ASSIGN_ssize_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_HADDR_T */ + #define ASSIGN_ssize_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: haddr_t */ + +/* src: ssize_t, dst: hsize_t */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_HSIZE_T + #define ASSIGN_ssize_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_HSIZE_T + #define ASSIGN_ssize_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_ssize_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: hsize_t */ + +/* src: ssize_t, dst: hssize_t */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_HSSIZE_T + #define ASSIGN_ssize_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_HSSIZE_T + #define ASSIGN_ssize_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_ssize_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: hssize_t */ + +/* src: ssize_t, dst: h5_stat_size_t */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_ssize_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_ssize_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_ssize_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: h5_stat_size_t */ + + +/* Assignment checks for haddr_t */ + +/* src: haddr_t, dst: unsigned */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_haddr_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_haddr_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_haddr_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: unsigned */ + +/* src: haddr_t, dst: int */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_INT + #define ASSIGN_haddr_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_INT + #define ASSIGN_haddr_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_INT */ + #define ASSIGN_haddr_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: int */ + +/* src: haddr_t, dst: uint8_t */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_UINT8_T + #define ASSIGN_haddr_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_UINT8_T + #define ASSIGN_haddr_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_UINT8_T */ + #define ASSIGN_haddr_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: uint8_t */ + +/* src: haddr_t, dst: uint32_t */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_UINT32_T + #define ASSIGN_haddr_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_UINT32_T + #define ASSIGN_haddr_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_UINT32_T */ + #define ASSIGN_haddr_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: uint32_t */ + +/* src: haddr_t, dst: uint64_t */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_UINT64_T + #define ASSIGN_haddr_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_UINT64_T + #define ASSIGN_haddr_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_UINT64_T */ + #define ASSIGN_haddr_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: uint64_t */ + +/* src: haddr_t, dst: size_t */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_SIZE_T + #define ASSIGN_haddr_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_SIZE_T + #define ASSIGN_haddr_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_SIZE_T */ + #define ASSIGN_haddr_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: size_t */ + +/* src: haddr_t, dst: ssize_t */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_SSIZE_T + #define ASSIGN_haddr_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_SSIZE_T + #define ASSIGN_haddr_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_haddr_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: ssize_t */ + +/* src: haddr_t, dst: hsize_t */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_HSIZE_T + #define ASSIGN_haddr_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_HSIZE_T + #define ASSIGN_haddr_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_haddr_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: hsize_t */ + +/* src: haddr_t, dst: hssize_t */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_HSSIZE_T + #define ASSIGN_haddr_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_HSSIZE_T + #define ASSIGN_haddr_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_haddr_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: hssize_t */ + +/* src: haddr_t, dst: h5_stat_size_t */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_haddr_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_haddr_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_haddr_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: h5_stat_size_t */ + + +/* Assignment checks for hsize_t */ + +/* src: hsize_t, dst: unsigned */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_hsize_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_hsize_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_hsize_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: unsigned */ + +/* src: hsize_t, dst: int */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_INT + #define ASSIGN_hsize_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_INT + #define ASSIGN_hsize_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_INT */ + #define ASSIGN_hsize_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: int */ + +/* src: hsize_t, dst: uint8_t */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_UINT8_T + #define ASSIGN_hsize_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_UINT8_T + #define ASSIGN_hsize_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_UINT8_T */ + #define ASSIGN_hsize_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: uint8_t */ + +/* src: hsize_t, dst: uint32_t */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_UINT32_T + #define ASSIGN_hsize_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_UINT32_T + #define ASSIGN_hsize_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_UINT32_T */ + #define ASSIGN_hsize_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: uint32_t */ + +/* src: hsize_t, dst: uint64_t */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_UINT64_T + #define ASSIGN_hsize_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_UINT64_T + #define ASSIGN_hsize_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_UINT64_T */ + #define ASSIGN_hsize_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: uint64_t */ + +/* src: hsize_t, dst: size_t */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_SIZE_T + #define ASSIGN_hsize_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_SIZE_T + #define ASSIGN_hsize_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_SIZE_T */ + #define ASSIGN_hsize_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: size_t */ + +/* src: hsize_t, dst: ssize_t */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_SSIZE_T + #define ASSIGN_hsize_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_SSIZE_T + #define ASSIGN_hsize_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_hsize_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: ssize_t */ + +/* src: hsize_t, dst: haddr_t */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_HADDR_T + #define ASSIGN_hsize_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_HADDR_T + #define ASSIGN_hsize_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_HADDR_T */ + #define ASSIGN_hsize_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: haddr_t */ + +/* src: hsize_t, dst: hssize_t */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_HSSIZE_T + #define ASSIGN_hsize_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_HSSIZE_T + #define ASSIGN_hsize_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_hsize_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: hssize_t */ + +/* src: hsize_t, dst: h5_stat_size_t */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_hsize_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_hsize_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_hsize_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: h5_stat_size_t */ + + +/* Assignment checks for hssize_t */ + +/* src: hssize_t, dst: unsigned */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_hssize_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_hssize_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_hssize_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: unsigned */ + +/* src: hssize_t, dst: int */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_INT + #define ASSIGN_hssize_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_INT + #define ASSIGN_hssize_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_INT */ + #define ASSIGN_hssize_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: int */ + +/* src: hssize_t, dst: uint8_t */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_UINT8_T + #define ASSIGN_hssize_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_UINT8_T + #define ASSIGN_hssize_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_UINT8_T */ + #define ASSIGN_hssize_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: uint8_t */ + +/* src: hssize_t, dst: uint32_t */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_UINT32_T + #define ASSIGN_hssize_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_UINT32_T + #define ASSIGN_hssize_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_UINT32_T */ + #define ASSIGN_hssize_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: uint32_t */ + +/* src: hssize_t, dst: uint64_t */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_UINT64_T + #define ASSIGN_hssize_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_UINT64_T + #define ASSIGN_hssize_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_UINT64_T */ + #define ASSIGN_hssize_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: uint64_t */ + +/* src: hssize_t, dst: size_t */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_SIZE_T + #define ASSIGN_hssize_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_SIZE_T + #define ASSIGN_hssize_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_SIZE_T */ + #define ASSIGN_hssize_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: size_t */ + +/* src: hssize_t, dst: ssize_t */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_SSIZE_T + #define ASSIGN_hssize_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_SSIZE_T + #define ASSIGN_hssize_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_hssize_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: ssize_t */ + +/* src: hssize_t, dst: haddr_t */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_HADDR_T + #define ASSIGN_hssize_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_HADDR_T + #define ASSIGN_hssize_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_HADDR_T */ + #define ASSIGN_hssize_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: haddr_t */ + +/* src: hssize_t, dst: hsize_t */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_HSIZE_T + #define ASSIGN_hssize_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_HSIZE_T + #define ASSIGN_hssize_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_hssize_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: hsize_t */ + +/* src: hssize_t, dst: h5_stat_size_t */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_hssize_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_hssize_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_hssize_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: h5_stat_size_t */ + + +/* Assignment checks for h5_stat_size_t */ + +/* src: h5_stat_size_t, dst: unsigned */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_h5_stat_size_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_h5_stat_size_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_h5_stat_size_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: unsigned */ + +/* src: h5_stat_size_t, dst: int */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_INT + #define ASSIGN_h5_stat_size_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_INT + #define ASSIGN_h5_stat_size_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_INT */ + #define ASSIGN_h5_stat_size_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: int */ + +/* src: h5_stat_size_t, dst: uint8_t */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_UINT8_T + #define ASSIGN_h5_stat_size_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_UINT8_T + #define ASSIGN_h5_stat_size_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_UINT8_T */ + #define ASSIGN_h5_stat_size_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: uint8_t */ + +/* src: h5_stat_size_t, dst: uint32_t */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_UINT32_T + #define ASSIGN_h5_stat_size_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_UINT32_T + #define ASSIGN_h5_stat_size_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_UINT32_T */ + #define ASSIGN_h5_stat_size_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: uint32_t */ + +/* src: h5_stat_size_t, dst: uint64_t */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_UINT64_T + #define ASSIGN_h5_stat_size_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_UINT64_T + #define ASSIGN_h5_stat_size_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_UINT64_T */ + #define ASSIGN_h5_stat_size_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: uint64_t */ + +/* src: h5_stat_size_t, dst: size_t */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_SIZE_T + #define ASSIGN_h5_stat_size_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_SIZE_T + #define ASSIGN_h5_stat_size_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_SIZE_T */ + #define ASSIGN_h5_stat_size_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: size_t */ + +/* src: h5_stat_size_t, dst: ssize_t */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_SSIZE_T + #define ASSIGN_h5_stat_size_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_SSIZE_T + #define ASSIGN_h5_stat_size_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_h5_stat_size_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: ssize_t */ + +/* src: h5_stat_size_t, dst: haddr_t */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_HADDR_T + #define ASSIGN_h5_stat_size_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_HADDR_T + #define ASSIGN_h5_stat_size_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_HADDR_T */ + #define ASSIGN_h5_stat_size_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: haddr_t */ + +/* src: h5_stat_size_t, dst: hsize_t */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_HSIZE_T + #define ASSIGN_h5_stat_size_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_HSIZE_T + #define ASSIGN_h5_stat_size_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_h5_stat_size_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: hsize_t */ + +/* src: h5_stat_size_t, dst: hssize_t */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_HSSIZE_T + #define ASSIGN_h5_stat_size_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_HSSIZE_T + #define ASSIGN_h5_stat_size_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_h5_stat_size_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: hssize_t */ + +#endif /* H5overflow_H */ + diff --git a/src/H5overflow.txt b/src/H5overflow.txt new file mode 100644 index 0000000..ea62fa0 --- /dev/null +++ b/src/H5overflow.txt @@ -0,0 +1,43 @@ +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic HDF5 document set and +# is linked from the top-level documents page. It can also be found at +# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have +# access to either file, you may request a copy from help@hdfgroup.org. +# + +# This file is used to generate the headers that is needed for detecting +# overflows between types at run-time +# +# The bin/make_overflow script reads in this file and creates the appropriate +# file in the src/ directory when the generated header is out of date with +# respect to this file. +# +# Blank lines and lines beginning with '#' are ignored +# +# The format of this file is as follows: +# , ; +# +# Where is a valid C type (like 'int8_t', 'hssize_t', etc. and whether +# the type is signed or unsigned follows. +# +# Programmer: Quincey Koziol +# Creation Date: 2009/04/09 + +unsigned, UNSIGNED; +int, SIGNED; +uint8_t, UNSIGNED; +uint32_t, UNSIGNED; +uint64_t, UNSIGNED; +size_t, UNSIGNED; +ssize_t, SIGNED; +haddr_t, UNSIGNED; +hsize_t, UNSIGNED; +hssize_t, SIGNED; +h5_stat_size_t, UNSIGNED; diff --git a/src/H5private.h b/src/H5private.h index 7a7ec53..43b8a95 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1741,6 +1741,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); #define FUNC_ENTER_COMMON(func_name,asrt) \ static const char FUNC[]=#func_name; \ + hbool_t err_occurred = FALSE; \ FUNC_ENTER_COMMON_NOFUNC(func_name,asrt); /* Threadsafety initialization code for API routines */ @@ -1910,7 +1911,9 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); #define FUNC_LEAVE_API(ret_value) \ FINISH_MPE_LOG; \ H5TRACE_RETURN(ret_value); \ - H5_POP_FUNC \ + H5_POP_FUNC \ + if(err_occurred) \ + (void)H5E_dump_api_stack(TRUE); \ FUNC_LEAVE_API_THREADSAFE \ return (ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ @@ -1919,6 +1922,8 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); #define FUNC_LEAVE_API_NOFS(ret_value) \ FINISH_MPE_LOG; \ H5TRACE_RETURN(ret_value); \ + if(err_occurred) \ + (void)H5E_dump_api_stack(TRUE); \ FUNC_LEAVE_API_THREADSAFE \ return (ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 41e2edd..0cf7172 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -58,6 +58,7 @@ typedef __int64 h5_stat_size_t; #define HDunlink(S) _unlink(S) #define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A) #define HDwrite(F,M,Z) _write(F,M,Z) +#define HDstrtoull(S,R,N) _strtoui64(S,R,N) /* Non-POSIX functions */ diff --git a/test/cache.c b/test/cache.c index bacd559..a5b5f3a 100644 --- a/test/cache.c +++ b/test/cache.c @@ -126,6 +126,7 @@ static unsigned check_metadata_blizzard_absence(hbool_t fill_via_insertion); static unsigned check_flush_deps(void); static unsigned check_flush_deps_err(void); static unsigned check_flush_deps_order(void); +static unsigned check_notify_cb(void); /**************************************************************************/ @@ -33789,6 +33790,205 @@ done: /*------------------------------------------------------------------------- + * Function: check_notify_cb() + * + * Purpose: Exercise the client 'notify' callback. + * + * Return: 0 on success, non-zero on failure + * + * Programmer: Quincey Koziol + * 4/28/09 + * + *------------------------------------------------------------------------- + */ + +static unsigned +check_notify_cb(void) +{ + H5C_t * cache_ptr = NULL; /* Metadata cache for this test */ + test_entry_t *base_addr; /* Base address of entries for test */ + test_entry_t * entry_ptr; /* Cache entry to examine/manipulate */ + int entry_type = NOTIFY_ENTRY_TYPE; /* Use entry w/notify callback (size of entries doesn't matter) */ + size_t entry_size = NOTIFY_ENTRY_SIZE; /* 1 byte */ + unsigned u; /* Local index variable */ + struct expected_entry_status expected[5] = + { + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */ + { entry_type, 0, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 }, + { entry_type, 1, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 }, + { entry_type, 2, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 }, + { entry_type, 3, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 }, + { entry_type, 4, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 } + }; + + TESTING("'notify' callback"); + + pass = TRUE; + + /* Allocate a cache, insert & remove entries, triggering 'notify' callback. + * Verify that all performs as expected. + */ + + reset_entries(); + cache_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); + base_addr = entries[entry_type]; + + if ( !pass ) CACHE_ERROR("setup_cache failed") + + /* Insert entries to work with into the cache */ + for(u = 0; u < 5; u++) { + insert_entry(cache_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET); + if ( !pass ) CACHE_ERROR("insert_entry failed") + + /* Change expected values, and verify the status of the entries + * after each insertion + */ + expected[u].in_cache = TRUE; + expected[u].is_dirty = TRUE; + + /* Verify the status */ + verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ + (int)u, /* int tag */ + (int)5, /* int num_entries */ + expected); /* struct expected_entry_staus[] */ + if ( !pass ) CACHE_ERROR("verify_entry_status failed") + + /* Check the entry's 'after insert' count */ + entry_ptr = &(base_addr[u]); + if(1 != entry_ptr->notify_after_insert_count) + CACHE_ERROR("invalid notify after insert count") + if(0 != entry_ptr->notify_before_evict_count) + CACHE_ERROR("invalid notify before evict count") + } /* end for */ + + /* Remove entries from the cache */ + for(u = 0; u < 5; u++) { + expunge_entry(cache_ptr, entry_type, (int32_t)u); + if ( !pass ) CACHE_ERROR("expunge_entry failed") + + /* Change expected values, and verify the status of the entries + * after each insertion + */ + expected[u].in_cache = FALSE; + expected[u].is_dirty = FALSE; + expected[u].cleared = TRUE; + expected[u].destroyed = TRUE; + + /* Verify the status */ + verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ + (int)u, /* int tag */ + (int)5, /* int num_entries */ + expected); /* struct expected_entry_staus[] */ + if ( !pass ) CACHE_ERROR("verify_entry_status failed") + + /* Check the entry's 'before evict' count */ + entry_ptr = &(base_addr[u]); + if(1 != entry_ptr->notify_after_insert_count) + CACHE_ERROR("invalid notify after insert count") + if(1 != entry_ptr->notify_before_evict_count) + CACHE_ERROR("invalid notify before evict count") + } /* end for */ + + /* Protect entries to bring them into the cache */ + for(u = 0; u < 5; u++) { + protect_entry(cache_ptr, entry_type, (int32_t)u); + if ( !pass ) CACHE_ERROR("protect_entry failed") + + /* Change expected values, and verify the status of the entries + * after each insertion + */ + expected[u].in_cache = TRUE; + expected[u].is_dirty = FALSE; + expected[u].is_protected = TRUE; + expected[u].loaded = TRUE; + + /* Verify the status */ + verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ + (int)u, /* int tag */ + (int)5, /* int num_entries */ + expected); /* struct expected_entry_staus[] */ + if ( !pass ) CACHE_ERROR("verify_entry_status failed") + + /* Check the entry's 'after insert' count */ + entry_ptr = &(base_addr[u]); + if(2 != entry_ptr->notify_after_insert_count) + CACHE_ERROR("invalid notify after insert count") + if(1 != entry_ptr->notify_before_evict_count) + CACHE_ERROR("invalid notify before evict count") + } /* end for */ + + /* Unprotect entries, evicting them from the cache */ + for(u = 0; u < 5; u++) { + unprotect_entry(cache_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET); + if ( !pass ) CACHE_ERROR("unprotect_entry failed") + + /* Change expected values, and verify the status of the entries + * after each insertion + */ + expected[u].in_cache = TRUE; + expected[u].is_dirty = TRUE; + expected[u].is_protected = FALSE; + + /* Verify the status */ + verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ + (int)u, /* int tag */ + (int)5, /* int num_entries */ + expected); /* struct expected_entry_staus[] */ + if ( !pass ) CACHE_ERROR("verify_entry_status failed") + + /* Check the entry's 'after insert' count */ + entry_ptr = &(base_addr[u]); + if(2 != entry_ptr->notify_after_insert_count) + CACHE_ERROR("invalid notify after insert count") + if(1 != entry_ptr->notify_before_evict_count) + CACHE_ERROR("invalid notify before evict count") + } /* end for */ + + /* Remove entries from the cache */ + for(u = 0; u < 5; u++) { + expunge_entry(cache_ptr, entry_type, (int32_t)u); + if ( !pass ) CACHE_ERROR("expunge_entry failed") + + /* Change expected values, and verify the status of the entries + * after each insertion + */ + expected[u].in_cache = FALSE; + expected[u].is_dirty = FALSE; + expected[u].cleared = TRUE; + expected[u].destroyed = TRUE; + + /* Verify the status */ + verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ + (int)u, /* int tag */ + (int)5, /* int num_entries */ + expected); /* struct expected_entry_staus[] */ + if ( !pass ) CACHE_ERROR("verify_entry_status failed") + + /* Check the entry's 'before evict' count */ + entry_ptr = &(base_addr[u]); + if(2 != entry_ptr->notify_after_insert_count) + CACHE_ERROR("invalid notify after insert count") + if(2 != entry_ptr->notify_before_evict_count) + CACHE_ERROR("invalid notify before evict count") + } /* end for */ + +done: + if(cache_ptr) + takedown_cache(cache_ptr, FALSE, FALSE); + + if ( pass ) + PASSED() + else { + H5_FAILED(); + HDfprintf(stdout, "%s.\n", failure_mssg); + } /* end else */ + + return (unsigned)!pass; +} /* check_notify_cb() */ + + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Run tests on the cache code contained in H5C.c @@ -33867,6 +34067,7 @@ main(void) nerrs += check_flush_deps(); nerrs += check_flush_deps_err(); nerrs += check_flush_deps_order(); + nerrs += check_notify_cb(); return(nerrs > 0); } diff --git a/test/cache_common.c b/test/cache_common.c index 6a9c7e5..4768f53 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -43,6 +43,7 @@ test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTR test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES]; test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES]; test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES]; +test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_NOTIFY_ENTRIES]; hbool_t orig_entry_arrays_init = FALSE; @@ -57,7 +58,8 @@ test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] = large_entries, huge_entries, monster_entries, - variable_entries + variable_entries, + notify_entries }; test_entry_t * orig_entries[NUMBER_OF_ENTRY_TYPES] = @@ -71,7 +73,8 @@ test_entry_t * orig_entries[NUMBER_OF_ENTRY_TYPES] = orig_large_entries, orig_huge_entries, orig_monster_entries, - orig_variable_entries + orig_variable_entries, + orig_notify_entries }; const int32_t max_indices[NUMBER_OF_ENTRY_TYPES] = @@ -85,7 +88,8 @@ const int32_t max_indices[NUMBER_OF_ENTRY_TYPES] = NUM_LARGE_ENTRIES - 1, NUM_HUGE_ENTRIES - 1, NUM_MONSTER_ENTRIES - 1, - NUM_VARIABLE_ENTRIES - 1 + NUM_VARIABLE_ENTRIES - 1, + NUM_NOTIFY_ENTRIES - 1 }; const size_t entry_sizes[NUMBER_OF_ENTRY_TYPES] = @@ -99,7 +103,8 @@ const size_t entry_sizes[NUMBER_OF_ENTRY_TYPES] = LARGE_ENTRY_SIZE, HUGE_ENTRY_SIZE, MONSTER_ENTRY_SIZE, - VARIABLE_ENTRY_SIZE + VARIABLE_ENTRY_SIZE, + NOTIFY_ENTRY_SIZE }; const haddr_t base_addrs[NUMBER_OF_ENTRY_TYPES] = @@ -113,7 +118,8 @@ const haddr_t base_addrs[NUMBER_OF_ENTRY_TYPES] = LARGE_BASE_ADDR, HUGE_BASE_ADDR, MONSTER_BASE_ADDR, - VARIABLE_BASE_ADDR + VARIABLE_BASE_ADDR, + NOTIFY_BASE_ADDR }; const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES] = @@ -127,7 +133,8 @@ const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES] = LARGE_ALT_BASE_ADDR, HUGE_ALT_BASE_ADDR, MONSTER_ALT_BASE_ADDR, - VARIABLE_ALT_BASE_ADDR + VARIABLE_ALT_BASE_ADDR, + NOTIFY_ALT_BASE_ADDR }; const char * entry_type_names[NUMBER_OF_ENTRY_TYPES] = @@ -141,7 +148,8 @@ const char * entry_type_names[NUMBER_OF_ENTRY_TYPES] = "large entries -- 4 KB", "huge entries -- 16 KB", "monster entries -- 64 KB", - "variable entries -- 1B - 10KB" + "variable entries -- 1B - 10KB", + "notify entries -- 1B" }; @@ -238,6 +246,15 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = (H5C_clear_func_t)variable_clear, (H5C_notify_func_t)NULL, (H5C_size_func_t)variable_size + }, + { + NOTIFY_ENTRY_TYPE, + (H5C_load_func_t)notify_load, + (H5C_flush_func_t)notify_flush, + (H5C_dest_func_t)notify_dest, + (H5C_clear_func_t)notify_clear, + (H5C_notify_func_t)notify_notify, + (H5C_size_func_t)notify_size } }; @@ -248,6 +265,7 @@ static herr_t flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, static void * load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); static herr_t size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t notify(H5C_notify_action_t action, void *thing); @@ -542,6 +560,13 @@ variable_clear(H5F_t * f, void * thing, hbool_t dest) return(clear(f, thing, dest)); } +herr_t +notify_clear(H5F_t * f, void * thing, hbool_t dest) +{ + HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); + return(clear(f, thing, dest)); +} + /*------------------------------------------------------------------------- @@ -710,6 +735,13 @@ variable_dest(H5F_t * f, void * thing) return(destroy(f, thing)); } +herr_t +notify_dest(H5F_t * f, void * thing) +{ + HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); + return(destroy(f, thing)); +} + /*------------------------------------------------------------------------- * Function: flush & friends @@ -888,6 +920,14 @@ variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); } +herr_t +notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, + void *thing, unsigned * flags_ptr) +{ + HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); + return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); +} + /*------------------------------------------------------------------------- @@ -1029,6 +1069,13 @@ variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, return(load(f, dxpl_id, addr, udata1, udata2)); } +void * +notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, + const void *udata1, void *udata2) +{ + return(load(f, dxpl_id, addr, udata1, udata2)); +} + /*------------------------------------------------------------------------- * Function: size & friends @@ -1148,6 +1195,73 @@ variable_size(H5F_t * f, void * thing, size_t * size_ptr) return(size(f, thing, size_ptr)); } +herr_t +notify_size(H5F_t * f, void * thing, size_t * size_ptr) +{ + HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); + return(size(f, thing, size_ptr)); +} + + +/*------------------------------------------------------------------------- + * Function: notify & friends + * + * Purpose: Record notifications of cache events for the entry. + * The helper functions verify that the correct version of notify + * is being called, and then call notify proper. + * + * Return: SUCCEED + * + * Programmer: Quincey Koziol + * 4/28/09 + * + *------------------------------------------------------------------------- + */ + +static herr_t +notify(H5C_notify_action_t action, void *thing) +{ + test_entry_t * entry_ptr; + test_entry_t * base_addr; + + HDassert( thing ); + + entry_ptr = (test_entry_t *)thing; + base_addr = entries[entry_ptr->type]; + + HDassert( entry_ptr->index >= 0 ); + HDassert( entry_ptr->index <= max_indices[entry_ptr->type] ); + HDassert( entry_ptr == &(base_addr[entry_ptr->index]) ); + HDassert( entry_ptr == entry_ptr->self ); + HDassert( entry_ptr->header.addr == entry_ptr->addr ); + HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || \ + ( entry_ptr->size == entry_sizes[entry_ptr->type] ) ); + + /* Increment count for appropriate action */ + switch(action) { + case H5C_NOTIFY_ACTION_AFTER_INSERT: /* Entry has been added to the cache */ + entry_ptr->notify_after_insert_count++; + break; + + case H5C_NOTIFY_ACTION_BEFORE_EVICT: /* Entry is about to be evicted from cache */ + entry_ptr->notify_before_evict_count++; + break; + + default: + HDassert(0 && "Unknown notify action!?!"); + } /* end switch */ + + return(SUCCEED); +} /* notify() */ + +herr_t +notify_notify(H5C_notify_action_t action, void *thing) +{ + HDassert ( ((test_entry_t *)thing)->type == NOTIFY_ENTRY_TYPE ); + return(notify(action, thing)); +} + + /**************************************************************************/ @@ -1678,6 +1792,9 @@ reset_entries(void) base_addr[j].flush_order = 0; + base_addr[j].notify_after_insert_count = 0; + base_addr[j].notify_before_evict_count = 0; + addr += (haddr_t)entry_size; alt_addr += (haddr_t)entry_size; } /* end for */ diff --git a/test/cache_common.h b/test/cache_common.h index 37e9e0c..d150f2a 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -51,8 +51,9 @@ #define HUGE_ENTRY_TYPE 7 #define MONSTER_ENTRY_TYPE 8 #define VARIABLE_ENTRY_TYPE 9 +#define NOTIFY_ENTRY_TYPE 10 -#define NUMBER_OF_ENTRY_TYPES 10 +#define NUMBER_OF_ENTRY_TYPES 11 #define PICO_ENTRY_SIZE (size_t)1 #define NANO_ENTRY_SIZE (size_t)4 @@ -64,6 +65,7 @@ #define HUGE_ENTRY_SIZE (size_t)(16 * 1024) #define MONSTER_ENTRY_SIZE (size_t)(64 * 1024) #define VARIABLE_ENTRY_SIZE (size_t)(10 * 1024) +#define NOTIFY_ENTRY_SIZE (size_t)1 #define NUM_PICO_ENTRIES (10 * 1024) #define NUM_NANO_ENTRIES (10 * 1024) @@ -75,6 +77,7 @@ #define NUM_HUGE_ENTRIES (10 * 1024) #define NUM_MONSTER_ENTRIES (10 * 1024) #define NUM_VARIABLE_ENTRIES (10 * 1024) +#define NUM_NOTIFY_ENTRIES (10 * 1024) #define MAX_ENTRIES (10 * 1024) @@ -97,9 +100,11 @@ (HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES)) #define VARIABLE_BASE_ADDR (haddr_t)(MONSTER_BASE_ADDR + \ (MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES)) +#define NOTIFY_BASE_ADDR (haddr_t)(VARIABLE_BASE_ADDR + \ + (VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES)) -#define PICO_ALT_BASE_ADDR (haddr_t)(VARIABLE_BASE_ADDR + \ - (VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES)) +#define PICO_ALT_BASE_ADDR (haddr_t)(NOTIFY_BASE_ADDR + \ + (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES)) #define NANO_ALT_BASE_ADDR (haddr_t)(PICO_ALT_BASE_ADDR + \ (PICO_ENTRY_SIZE * NUM_PICO_ENTRIES)) #define MICRO_ALT_BASE_ADDR (haddr_t)(NANO_ALT_BASE_ADDR + \ @@ -118,6 +123,8 @@ (HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES)) #define VARIABLE_ALT_BASE_ADDR (haddr_t)(MONSTER_ALT_BASE_ADDR + \ (MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES)) +#define NOTIFY_ALT_BASE_ADDR (haddr_t)(VARIABLE_ALT_BASE_ADDR + \ + (VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES)) #define MAX_PINS 8 /* Maximum number of entries that can be * directly pinned by a single entry. @@ -309,6 +316,9 @@ typedef struct test_entry_t hbool_t pinned_from_client; /* entry was pinned by client call */ hbool_t pinned_from_cache; /* entry was pinned by cache internally */ unsigned flush_order; /* Order that entry was flushed in */ + + unsigned notify_after_insert_count; /* Count of times that entry was inserted in cache */ + unsigned notify_before_evict_count; /* Count of times that entry was removed in cache */ } test_entry_t; /* The following is a cut down copy of the hash table manipulation @@ -530,6 +540,7 @@ herr_t large_clear(H5F_t * f, void * thing, hbool_t dest); herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest); herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest); herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest); +herr_t notify_clear(H5F_t * f, void * thing, hbool_t dest); herr_t pico_dest(H5F_t * f, void * thing); @@ -542,6 +553,7 @@ herr_t large_dest(H5F_t * f, void * thing); herr_t huge_dest(H5F_t * f, void * thing); herr_t monster_dest(H5F_t * f, void * thing); herr_t variable_dest(H5F_t * f, void * thing); +herr_t notify_dest(H5F_t * f, void * thing); herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, @@ -564,6 +576,8 @@ herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing, unsigned * flags_ptr); herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing, unsigned * flags_ptr); +herr_t notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, @@ -586,6 +600,8 @@ void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); +void * notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, + const void *udata1, void *udata2); herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr); @@ -598,6 +614,9 @@ herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr); herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr); herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr); herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr); +herr_t notify_size(H5F_t * f, void * thing, size_t * size_ptr); + +herr_t notify_notify(H5C_notify_action_t action, void *thing); /* callback table extern */ diff --git a/test/error_test.c b/test/error_test.c index a5afcfc..89a81a3 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -40,6 +40,7 @@ const char *FILENAME[] = { int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1]; hid_t ERR_CLS; +hid_t ERR_CLS2; hid_t ERR_STACK; hid_t ERR_MAJ_TEST; @@ -56,7 +57,9 @@ hid_t ERR_MIN_GETNUM; #define FAKE_ID 0 #define ERR_CLS_NAME "Error Test" +#define ERR_CLS2_NAME "Second Test" #define PROG_NAME "Error Program" +#define PROG2_NAME "Second Program" #define PROG_VERS "1.0" #define ERR_MAJ_TEST_MSG "Error in test" @@ -69,12 +72,6 @@ hid_t ERR_MIN_GETNUM; #define ERR_MIN_GETNUM_MSG "Error in H5Eget_num" #define MSG_SIZE 64 -#define SPACE1_DIM1 4 -#define SPACE1_RANK 1 -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 - #define LONG_DESC_SIZE 8192 static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, @@ -106,6 +103,7 @@ test_error(hid_t file) void *old_data; TESTING("error API based on data I/O"); + printf("\n"); /* Create the data space */ dims[0] = DIM0; @@ -189,10 +187,10 @@ static herr_t init_error(void) { ssize_t cls_size = (ssize_t)HDstrlen(ERR_CLS_NAME)+1; - char *cls_name = HDmalloc(HDstrlen(ERR_CLS_NAME)+1); + char *cls_name = (char*)HDmalloc(HDstrlen(ERR_CLS_NAME)+1); ssize_t msg_size = (ssize_t)HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1; - char *msg = HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG)+1); - H5E_type_t *msg_type= HDmalloc(sizeof(H5E_type_t)); + char *msg = (char*)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG)+1); + H5E_type_t *msg_type= (H5E_type_t *)HDmalloc(sizeof(H5E_type_t)); if((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) TEST_ERROR; @@ -231,6 +229,10 @@ init_error(void) HDfree(msg); HDfree(msg_type); + /* Register another class for later testing. */ + if((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) + TEST_ERROR; + return 0; error: @@ -334,8 +336,8 @@ test_long_desc(void) const char *test_FUNC = "test_long_desc"; /* Allocate space for the error description info */ - if(NULL == (long_desc = HDmalloc(LONG_DESC_SIZE))) TEST_ERROR; - if(NULL == (full_desc = HDmalloc(LONG_DESC_SIZE + 128))) TEST_ERROR; + if(NULL == (long_desc = (char*)HDmalloc(LONG_DESC_SIZE))) TEST_ERROR; + if(NULL == (full_desc = (char*)HDmalloc(LONG_DESC_SIZE + 128))) TEST_ERROR; /* Create the long part of the error description */ for(u = 0; u < LONG_DESC_SIZE; u++) @@ -535,6 +537,9 @@ close_error(void) if(H5Eunregister_class(ERR_CLS) < 0) TEST_ERROR; + if(H5Eunregister_class(ERR_CLS2) < 0) + TEST_ERROR; + return 0; error: @@ -581,6 +586,10 @@ main(void) /* Delete an error from the top of error stack */ H5Epop(ERR_STACK, 1); + /* Make sure we can use other class's major or minor errors. */ + H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS2, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, + "Error stack test failed"); + /* Print out the errors on stack */ dump_error(ERR_STACK); diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 20f669d..308ca07 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -1,11 +1,16 @@ ############################# Expected output for error_test ############################# -Testing error API based on data I/O All error API tests passed. +Testing error API based on data I/O +All error API tests passed. This program tests the Error API. There're supposed to be some error messages ********* Print error stack in HDF5 default way ********* +Second Test-DIAG: Error detected in Second Program (1.0) thread (IDs): + #000: (file name) line (number) in main(): Error stack test failed + major: Error in test + minor: Error in error stack Error Test-DIAG: Error detected in Error Program (1.0) thread (IDs): - #000: (file name) line (number) in error_stack(): Get number test failed, returned 0 + #001: (file name) line (number) in error_stack(): Get number test failed, returned 0 major: Error in API minor: Error in H5Eget_num @@ -14,6 +19,10 @@ Error Test-DIAG: Error detected in Error Program (1.0) thread (IDs): class: Error Test major: Error in API minor: Error in H5Eget_num + error #001: (file name) in main(): line (number) + class: Second Test + major: Error in test + minor: Error in error stack HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Dwrite(): not a dataset major: Invalid arguments to routine diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am index f677de0..2c0c0c2 100644 --- a/tools/h5repack/Makefile.am +++ b/tools/h5repack/Makefile.am @@ -50,6 +50,9 @@ h5repacktst_SOURCES=$(COMMON_SOURCES) h5repacktst.c testh5repack_detect_szip_SOURCES=testh5repack_detect_szip.c +# The h5repack.sh script needs h5repacktst to run first. +h5repack.sh.chkexe_: h5repacktst.chkexe_ + # Temporary files. *.h5 are generated by h5repack. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES+=*.h5 *.bin diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 7320ce0..9b559ad 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -722,6 +722,9 @@ uninstall-am: uninstall-binPROGRAMS help: @$(top_srcdir)/bin/makehelp +# The h5repack.sh script needs h5repacktst to run first. +h5repack.sh.chkexe_: h5repacktst.chkexe_ + # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. build-lib: $(LIB) diff --git a/vms/tools/h5repack/check_h5repack.com b/vms/tools/h5repack/check_h5repack.com index 207951e..34c122c 100644 --- a/vms/tools/h5repack/check_h5repack.com +++ b/vms/tools/h5repack/check_h5repack.com @@ -48,6 +48,9 @@ $ CALL TOOLTEST "" h5repack_attr.h5 $ CALL TOOLTEST "" h5repack_hlink.h5 $ CALL TOOLTEST "" h5repack_layout.h5 $ CALL TOOLTEST "" h5repack_early.h5 + +$! Check repacking file with committed datatypes in odd configurations +$ CALL TOOLTEST "" h5repack_named_dtypes.h5 $ $! # use h5repack_layout.h5 to write some filters (this file has no filters) $ -- cgit v0.12