diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-06-18 21:03:30 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-06-18 21:03:30 (GMT) |
commit | 23465486edeb6e9d76ae795d523bedbf4e665d64 (patch) | |
tree | 3831eaca941ba6521cd31463bfdcb8739805bb3a | |
parent | d6f7fda058353212449fce012787d0d46d866f2f (diff) | |
download | hdf5-23465486edeb6e9d76ae795d523bedbf4e665d64.zip hdf5-23465486edeb6e9d76ae795d523bedbf4e665d64.tar.gz hdf5-23465486edeb6e9d76ae795d523bedbf4e665d64.tar.bz2 |
[svn-r432] Changes since 19980617
----------------------
./html/Datatypes.html
./src/H5T.c
./src/H5Tconv.c
./src/H5Tpkg.h
./src/H5Tpublic.h
./src/H5detect.c
./test/cmpd_dset.c
./test/dsets.c
./test/dtypes.c
./test/external.c
./test/tattr.c
./test/th5s.c
Organized the predefined data types.
./html/H5.intro.html
NO MODIFICATIONS! This file is a mess (obviously generated
from something else) so I skipped updating it!
./src/h5ls.c
./test/dsets.c
./test/tattr.c
./test/th5s.c
Added extra argument to H5Sget_dims() calls per Albert's last
update.
-rw-r--r-- | src/H5S.c | 2 | ||||
-rw-r--r-- | src/H5T.c | 421 | ||||
-rw-r--r-- | src/H5Tconv.c | 11 | ||||
-rw-r--r-- | src/H5Tpkg.h | 2 | ||||
-rw-r--r-- | src/H5Tpublic.h | 241 | ||||
-rw-r--r-- | src/H5detect.c | 432 | ||||
-rw-r--r-- | src/h5ls.c | 4 | ||||
-rw-r--r-- | test/.distdep | 232 | ||||
-rw-r--r-- | test/cmpd_dset.c | 44 | ||||
-rw-r--r-- | test/dsets.c | 26 | ||||
-rw-r--r-- | test/dtypes.c | 16 | ||||
-rw-r--r-- | test/external.c | 12 | ||||
-rw-r--r-- | test/tattr.c | 78 | ||||
-rw-r--r-- | test/th5s.c | 67 |
14 files changed, 870 insertions, 718 deletions
@@ -677,7 +677,7 @@ H5S_get_ndims(const H5S_t *ds) *------------------------------------------------------------------------- */ int -H5Sget_dims(hid_t space_id, hsize_t dims[]/*out*/, hsize_t maxdims[]/*out*/) +H5Sget_dims (hid_t space_id, hsize_t dims[]/*out*/, hsize_t maxdims[]/*out*/) { H5S_t *ds = NULL; intn ret_value = 0; @@ -30,7 +30,45 @@ static intn interface_initialize_g = FALSE; #define INTERFACE_INIT H5T_init_interface static void H5T_term_interface(void); -/* Predefined native types */ +hid_t H5T_IEEE_F32BE_g = FAIL; +hid_t H5T_IEEE_F32LE_g = FAIL; +hid_t H5T_IEEE_F64BE_g = FAIL; +hid_t H5T_IEEE_F64LE_g = FAIL; + +hid_t H5T_STD_I8BE_g = FAIL; +hid_t H5T_STD_I8LE_g = FAIL; +hid_t H5T_STD_I16BE_g = FAIL; +hid_t H5T_STD_I16LE_g = FAIL; +hid_t H5T_STD_I32BE_g = FAIL; +hid_t H5T_STD_I32LE_g = FAIL; +hid_t H5T_STD_I64BE_g = FAIL; +hid_t H5T_STD_I64LE_g = FAIL; +hid_t H5T_STD_U8BE_g = FAIL; +hid_t H5T_STD_U8LE_g = FAIL; +hid_t H5T_STD_U16BE_g = FAIL; +hid_t H5T_STD_U16LE_g = FAIL; +hid_t H5T_STD_U32BE_g = FAIL; +hid_t H5T_STD_U32LE_g = FAIL; +hid_t H5T_STD_U64BE_g = FAIL; +hid_t H5T_STD_U64LE_g = FAIL; +hid_t H5T_STD_B8BE_g = FAIL; +hid_t H5T_STD_B8LE_g = FAIL; +hid_t H5T_STD_B16BE_g = FAIL; +hid_t H5T_STD_B16LE_g = FAIL; +hid_t H5T_STD_B32BE_g = FAIL; +hid_t H5T_STD_B32LE_g = FAIL; +hid_t H5T_STD_B64BE_g = FAIL; +hid_t H5T_STD_B64LE_g = FAIL; + +hid_t H5T_UNIX_D32BE_g = FAIL; +hid_t H5T_UNIX_D32LE_g = FAIL; +hid_t H5T_UNIX_D64BE_g = FAIL; +hid_t H5T_UNIX_D64LE_g = FAIL; + +hid_t H5T_C_S1_g = FAIL; + +hid_t H5T_FORTRAN_S1_g = FAIL; + hid_t H5T_NATIVE_CHAR_g = FAIL; hid_t H5T_NATIVE_UCHAR_g = FAIL; hid_t H5T_NATIVE_SHORT_g = FAIL; @@ -38,44 +76,18 @@ hid_t H5T_NATIVE_USHORT_g = FAIL; hid_t H5T_NATIVE_INT_g = FAIL; hid_t H5T_NATIVE_UINT_g = FAIL; hid_t H5T_NATIVE_LONG_g = FAIL; +hid_t H5T_NATIVE_ULONG_g = FAIL; hid_t H5T_NATIVE_LLONG_g = FAIL; hid_t H5T_NATIVE_ULLONG_g = FAIL; -hid_t H5T_NATIVE_HYPER_g = FAIL; -hid_t H5T_NATIVE_UHYPER_g = FAIL; -hid_t H5T_NATIVE_INT8_g = FAIL; -hid_t H5T_NATIVE_UINT8_g = FAIL; -hid_t H5T_NATIVE_INT16_g = FAIL; -hid_t H5T_NATIVE_UINT16_g = FAIL; -hid_t H5T_NATIVE_INT32_g = FAIL; -hid_t H5T_NATIVE_UINT32_g = FAIL; -hid_t H5T_NATIVE_INT64_g = FAIL; -hid_t H5T_NATIVE_UINT64_g = FAIL; -hid_t H5T_NATIVE_ULONG_g = FAIL; hid_t H5T_NATIVE_FLOAT_g = FAIL; hid_t H5T_NATIVE_DOUBLE_g = FAIL; -hid_t H5T_NATIVE_TIME_g = FAIL; -hid_t H5T_NATIVE_STRING_g = FAIL; -hid_t H5T_NATIVE_BITFIELD_g = FAIL; +hid_t H5T_NATIVE_LDOUBLE_g = FAIL; +hid_t H5T_NATIVE_B8_g = FAIL; +hid_t H5T_NATIVE_B16_g = FAIL; +hid_t H5T_NATIVE_B32_g = FAIL; +hid_t H5T_NATIVE_B64_g = FAIL; hid_t H5T_NATIVE_OPAQUE_g = FAIL; -/* Predefined standard types */ -hid_t H5T_IEEE_R32LE_g = FAIL; -hid_t H5T_IEEE_R32BE_g = FAIL; -hid_t H5T_IEEE_R64LE_g = FAIL; -hid_t H5T_IEEE_R64BE_g = FAIL; -hid_t H5T_IEEE_U16LE_g = FAIL; -hid_t H5T_IEEE_U16BE_g = FAIL; -hid_t H5T_IEEE_U32LE_g = FAIL; -hid_t H5T_IEEE_U32BE_g = FAIL; -hid_t H5T_IEEE_U64LE_g = FAIL; -hid_t H5T_IEEE_U64BE_g = FAIL; -hid_t H5T_IEEE_S16LE_g = FAIL; -hid_t H5T_IEEE_S16BE_g = FAIL; -hid_t H5T_IEEE_S32LE_g = FAIL; -hid_t H5T_IEEE_S32BE_g = FAIL; -hid_t H5T_IEEE_S64LE_g = FAIL; -hid_t H5T_IEEE_S64BE_g = FAIL; - /* The path database */ static intn H5T_npath_g = 0; /*num paths defined */ @@ -116,69 +128,67 @@ H5T_init_interface(void) } /* - * Initialize pre-defined data types that depend on the architecture. + * Initialize pre-defined native data types from code generated during + * the library configuration by H5detect. */ ret_value = H5T_init(); - /* - * Initialize pre-define data types that can be derived from - * architecture-dependent types. + /*------------------------------------------------------------ + * Native types + *------------------------------------------------------------ */ - /* INT8 */ - H5T_NATIVE_INT8_g = H5Tcopy(H5T_NATIVE_INT_g); - H5Tset_size(H5T_NATIVE_INT8_g, 1); - H5Tset_precision(H5T_NATIVE_INT8_g, 8); - H5Tlock(H5T_NATIVE_INT8_g); - - /* UINT8 */ - H5T_NATIVE_UINT8_g = H5Tcopy(H5T_NATIVE_UINT_g); - H5Tset_size(H5T_NATIVE_UINT8_g, 1); - H5Tset_precision(H5T_NATIVE_UINT8_g, 8); - H5Tlock(H5T_NATIVE_UINT8_g); - - /* INT16 */ - H5T_NATIVE_INT16_g = H5Tcopy(H5T_NATIVE_INT_g); - H5Tset_size(H5T_NATIVE_INT16_g, 2); - H5Tset_precision(H5T_NATIVE_INT16_g, 16); - H5Tlock(H5T_NATIVE_INT16_g); - - /* UINT16 */ - H5T_NATIVE_UINT16_g = H5Tcopy(H5T_NATIVE_UINT_g); - H5Tset_size(H5T_NATIVE_UINT16_g, 2); - H5Tset_precision(H5T_NATIVE_UINT16_g, 16); - H5Tlock(H5T_NATIVE_UINT16_g); - - /* INT32 */ - H5T_NATIVE_INT32_g = H5Tcopy(H5T_NATIVE_INT_g); - H5Tset_size(H5T_NATIVE_INT32_g, 4); - H5Tset_precision(H5T_NATIVE_INT32_g, 32); - H5Tlock(H5T_NATIVE_INT32_g); - - /* UINT32 */ - H5T_NATIVE_UINT32_g = H5Tcopy(H5T_NATIVE_UINT_g); - H5Tset_size(H5T_NATIVE_UINT32_g, 4); - H5Tset_precision(H5T_NATIVE_UINT32_g, 32); - H5Tlock(H5T_NATIVE_UINT32_g); - - /* INT64 */ - H5T_NATIVE_INT64_g = H5Tcopy(H5T_NATIVE_INT_g); - H5Tset_size(H5T_NATIVE_INT64_g, 8); - H5Tset_precision(H5T_NATIVE_INT64_g, 64); - H5Tlock(H5T_NATIVE_INT64_g); - - /* UINT64 */ - H5T_NATIVE_UINT64_g = H5Tcopy(H5T_NATIVE_UINT_g); - H5Tset_size(H5T_NATIVE_UINT64_g, 8); - H5Tset_precision(H5T_NATIVE_UINT64_g, 64); - H5Tlock(H5T_NATIVE_UINT64_g); - - /* - * Standard data types in big and little endian flavors. + /* 1-byte bit field */ + dt = H5I_object (H5T_NATIVE_B8_g = H5Tcopy (H5T_NATIVE_UINT_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + dt->size = 1; + dt->u.atomic.prec = 8; + + /* 2-byte bit field */ + dt = H5I_object (H5T_NATIVE_B16_g = H5Tcopy (H5T_NATIVE_UINT_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + dt->size = 2; + dt->u.atomic.prec = 16; + + /* 4-byte bit field */ + dt = H5I_object (H5T_NATIVE_B32_g = H5Tcopy (H5T_NATIVE_UINT_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + dt->size = 4; + dt->u.atomic.prec = 32; + + /* 8-byte bit field */ + dt = H5I_object (H5T_NATIVE_B64_g = H5Tcopy (H5T_NATIVE_UINT_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + dt->size = 8; + dt->u.atomic.prec = 64; + + /* Opaque data */ + dt = H5MM_xcalloc(1, sizeof(H5T_t)); + dt->state = H5T_STATE_IMMUTABLE; + H5F_addr_undef (&(dt->ent.header)); + dt->type = H5T_OPAQUE; + dt->size = 1; + dt->u.atomic.order = H5T_ORDER_NONE; + dt->u.atomic.offset = 0; + dt->u.atomic.prec = 8 * dt->size; + dt->u.atomic.lsb_pad = H5T_PAD_ZERO; + dt->u.atomic.msb_pad = H5T_PAD_ZERO; + if ((H5T_NATIVE_OPAQUE_g = H5I_register(H5_DATATYPE, dt)) < 0) { + HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, + "unable to initialize H5T layer"); + } + + /*------------------------------------------------------------ + * IEEE Types + *------------------------------------------------------------ */ /* IEEE 4-byte little-endian float */ - dt = H5I_object (H5T_IEEE_R32LE_g = H5Tcopy (H5T_NATIVE_DOUBLE)); + dt = H5I_object (H5T_IEEE_F32LE_g = H5Tcopy (H5T_NATIVE_DOUBLE_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 4; dt->u.atomic.offset = 0; @@ -196,7 +206,7 @@ H5T_init_interface(void) dt->u.atomic.u.f.pad = H5T_PAD_ZERO; /* IEEE 4-byte big-endian float */ - dt = H5I_object (H5T_IEEE_R32BE_g = H5Tcopy (H5T_NATIVE_DOUBLE)); + dt = H5I_object (H5T_IEEE_F32BE_g = H5Tcopy (H5T_NATIVE_DOUBLE_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 4; dt->u.atomic.offset = 0; @@ -214,7 +224,7 @@ H5T_init_interface(void) dt->u.atomic.u.f.pad = H5T_PAD_ZERO; /* IEEE 8-byte little-endian float */ - dt = H5I_object (H5T_IEEE_R64LE_g = H5Tcopy (H5T_NATIVE_DOUBLE)); + dt = H5I_object (H5T_IEEE_F64LE_g = H5Tcopy (H5T_NATIVE_DOUBLE_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 8; dt->u.atomic.offset = 0; @@ -232,7 +242,7 @@ H5T_init_interface(void) dt->u.atomic.u.f.pad = H5T_PAD_ZERO; /* IEEE 8-byte big-endian float */ - dt = H5I_object (H5T_IEEE_R64BE_g = H5Tcopy (H5T_NATIVE_DOUBLE)); + dt = H5I_object (H5T_IEEE_F64BE_g = H5Tcopy (H5T_NATIVE_DOUBLE_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 8; dt->u.atomic.offset = 0; @@ -249,8 +259,36 @@ H5T_init_interface(void) dt->u.atomic.u.f.norm = H5T_NORM_IMPLIED; dt->u.atomic.u.f.pad = H5T_PAD_ZERO; - /* IEEE 2-byte little-endian signed integer */ - dt = H5I_object (H5T_IEEE_S16LE_g = H5Tcopy (H5T_NATIVE_INT)); + /*------------------------------------------------------------ + * Other "standard" types + *------------------------------------------------------------ + */ + + + /* 1-byte little-endian (endianness is irrelevant) signed integer */ + dt = H5I_object (H5T_STD_I8LE_g = H5Tcopy (H5T_NATIVE_INT_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->size = 1; + dt->u.atomic.offset = 0; + dt->u.atomic.prec = 8; + dt->u.atomic.order = H5T_ORDER_LE; + dt->u.atomic.lsb_pad = H5T_PAD_ZERO; + dt->u.atomic.msb_pad = H5T_PAD_ZERO; + dt->u.atomic.u.i.sign = H5T_SGN_2; + + /* 1-byte big-endian (endianness is irrelevant) signed integer */ + dt = H5I_object (H5T_STD_I8BE_g = H5Tcopy (H5T_NATIVE_INT_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->size = 1; + dt->u.atomic.offset = 0; + dt->u.atomic.prec = 8; + dt->u.atomic.order = H5T_ORDER_BE; + dt->u.atomic.lsb_pad = H5T_PAD_ZERO; + dt->u.atomic.msb_pad = H5T_PAD_ZERO; + dt->u.atomic.u.i.sign = H5T_SGN_2; + + /* 2-byte little-endian signed integer */ + dt = H5I_object (H5T_STD_I16LE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 2; dt->u.atomic.offset = 0; @@ -260,8 +298,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_2; - /* IEEE 2-byte big-endian signed integer */ - dt = H5I_object (H5T_IEEE_S16BE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 2-byte big-endian signed integer */ + dt = H5I_object (H5T_STD_I16BE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 2; dt->u.atomic.offset = 0; @@ -271,8 +309,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_2; - /* IEEE 4-byte little-endian signed integer */ - dt = H5I_object (H5T_IEEE_S32LE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 4-byte little-endian signed integer */ + dt = H5I_object (H5T_STD_I32LE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 4; dt->u.atomic.offset = 0; @@ -282,8 +320,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_2; - /* IEEE 4-byte big-endian signed integer */ - dt = H5I_object (H5T_IEEE_S32BE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 4-byte big-endian signed integer */ + dt = H5I_object (H5T_STD_I32BE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 4; dt->u.atomic.offset = 0; @@ -293,8 +331,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_2; - /* IEEE 8-byte little-endian signed integer */ - dt = H5I_object (H5T_IEEE_S64LE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 8-byte little-endian signed integer */ + dt = H5I_object (H5T_STD_I64LE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 8; dt->u.atomic.offset = 0; @@ -304,8 +342,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_2; - /* IEEE 8-byte big-endian signed integer */ - dt = H5I_object (H5T_IEEE_S64BE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 8-byte big-endian signed integer */ + dt = H5I_object (H5T_STD_I64BE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 8; dt->u.atomic.offset = 0; @@ -315,8 +353,30 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_2; - /* IEEE 2-byte little-endian unsigned integer */ - dt = H5I_object (H5T_IEEE_U16LE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 1-byte little-endian (endianness is irrelevant) unsigned integer */ + dt = H5I_object (H5T_STD_U8LE_g = H5Tcopy (H5T_NATIVE_INT_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->size = 1; + dt->u.atomic.offset = 0; + dt->u.atomic.prec = 8; + dt->u.atomic.order = H5T_ORDER_LE; + dt->u.atomic.lsb_pad = H5T_PAD_ZERO; + dt->u.atomic.msb_pad = H5T_PAD_ZERO; + dt->u.atomic.u.i.sign = H5T_SGN_NONE; + + /* 1-byte big-endian (endianness is irrelevant) unsigned integer */ + dt = H5I_object (H5T_STD_U8BE_g = H5Tcopy (H5T_NATIVE_INT_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->size = 1; + dt->u.atomic.offset = 0; + dt->u.atomic.prec = 8; + dt->u.atomic.order = H5T_ORDER_BE; + dt->u.atomic.lsb_pad = H5T_PAD_ZERO; + dt->u.atomic.msb_pad = H5T_PAD_ZERO; + dt->u.atomic.u.i.sign = H5T_SGN_NONE; + + /* 2-byte little-endian unsigned integer */ + dt = H5I_object (H5T_STD_U16LE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 2; dt->u.atomic.offset = 0; @@ -326,8 +386,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_NONE; - /* IEEE 2-byte big-endian unsigned integer */ - dt = H5I_object (H5T_IEEE_U16BE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 2-byte big-endian unsigned integer */ + dt = H5I_object (H5T_STD_U16BE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 2; dt->u.atomic.offset = 0; @@ -337,8 +397,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_NONE; - /* IEEE 4-byte little-endian unsigned integer */ - dt = H5I_object (H5T_IEEE_U32LE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 4-byte little-endian unsigned integer */ + dt = H5I_object (H5T_STD_U32LE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 4; dt->u.atomic.offset = 0; @@ -348,8 +408,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_NONE; - /* IEEE 4-byte big-endian unsigned integer */ - dt = H5I_object (H5T_IEEE_U32BE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 4-byte big-endian unsigned integer */ + dt = H5I_object (H5T_STD_U32BE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 4; dt->u.atomic.offset = 0; @@ -359,8 +419,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_NONE; - /* IEEE 8-byte little-endian unsigned integer */ - dt = H5I_object (H5T_IEEE_U64LE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 8-byte little-endian unsigned integer */ + dt = H5I_object (H5T_STD_U64LE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 8; dt->u.atomic.offset = 0; @@ -370,8 +430,8 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_NONE; - /* IEEE 8-byte big-endian unsigned integer */ - dt = H5I_object (H5T_IEEE_U64BE_g = H5Tcopy (H5T_NATIVE_INT)); + /* 8-byte big-endian unsigned integer */ + dt = H5I_object (H5T_STD_U64BE_g = H5Tcopy (H5T_NATIVE_INT_g)); dt->state = H5T_STATE_IMMUTABLE; dt->size = 8; dt->u.atomic.offset = 0; @@ -381,28 +441,79 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.i.sign = H5T_SGN_NONE; + /* 1-byte big endian bit field (order is irrelevant) */ + dt = H5I_object (H5T_STD_B8BE_g = H5Tcopy (H5T_STD_U8BE_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; - /* - * Initialize pre-defined data types that don't depend on architecture. + /* 1-byte little-endian bit field (order is irrelevant) */ + dt = H5I_object (H5T_STD_B8LE_g = H5Tcopy (H5T_STD_U8LE_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + + /* 2-byte big endian bit field */ + dt = H5I_object (H5T_STD_B16BE_g = H5Tcopy (H5T_STD_U16BE_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + + /* 2-byte little-endian bit field */ + dt = H5I_object (H5T_STD_B16LE_g = H5Tcopy (H5T_STD_U16LE_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + + /* 4-byte big endian bit field */ + dt = H5I_object (H5T_STD_B32BE_g = H5Tcopy (H5T_STD_U32BE_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + + /* 4-byte little-endian bit field */ + dt = H5I_object (H5T_STD_B32LE_g = H5Tcopy (H5T_STD_U32LE_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + + /* 8-byte big endian bit field */ + dt = H5I_object (H5T_STD_B64BE_g = H5Tcopy (H5T_STD_U64BE_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + + /* 8-byte little-endian bit field */ + dt = H5I_object (H5T_STD_B64LE_g = H5Tcopy (H5T_STD_U64LE_g)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_BITFIELD; + + + + /*------------------------------------------------------------ + * The Unix architecture for dates and times. + *------------------------------------------------------------ */ - /* TIME */ - dt = H5MM_xcalloc(1, sizeof(H5T_t)); + /* 4-byte time_t, big-endian */ + dt = H5I_object (H5T_UNIX_D32BE_g = H5Tcopy (H5T_STD_U32BE)); dt->state = H5T_STATE_IMMUTABLE; - H5F_addr_undef (&(dt->ent.header)); dt->type = H5T_TIME; - dt->size = 1; - dt->u.atomic.order = H5Tget_order(H5T_NATIVE_INT_g); - dt->u.atomic.offset = 0; - dt->u.atomic.prec = 8 * dt->size; - dt->u.atomic.lsb_pad = H5T_PAD_ZERO; - dt->u.atomic.msb_pad = H5T_PAD_ZERO; - if ((H5T_NATIVE_TIME_g = H5I_register(H5_DATATYPE, dt)) < 0) { - HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, - "can't initialize H5T layer"); - } + + /* 4-byte time_t, little-endian */ + dt = H5I_object (H5T_UNIX_D32LE_g = H5Tcopy (H5T_STD_U32LE)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_TIME; + + /* 8-byte time_t, big-endian */ + dt = H5I_object (H5T_UNIX_D64BE_g = H5Tcopy (H5T_STD_U64BE)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_TIME; + + /* 8-byte time_t, little-endian */ + dt = H5I_object (H5T_UNIX_D64LE_g = H5Tcopy (H5T_STD_U64LE)); + dt->state = H5T_STATE_IMMUTABLE; + dt->type = H5T_TIME; + + /*------------------------------------------------------------ + * The `C' architecture + *------------------------------------------------------------ + */ - /* STRING */ + /* One-byte character string */ dt = H5MM_xcalloc(1, sizeof(H5T_t)); dt->state = H5T_STATE_IMMUTABLE; H5F_addr_undef (&(dt->ent.header)); @@ -415,53 +526,35 @@ H5T_init_interface(void) dt->u.atomic.msb_pad = H5T_PAD_ZERO; dt->u.atomic.u.s.cset = H5T_CSET_ASCII; dt->u.atomic.u.s.pad = H5T_STR_NULL; - if ((H5T_NATIVE_STRING_g = H5I_register(H5_DATATYPE, dt)) < 0) { + if ((H5T_C_S1_g = H5I_register(H5_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't initialize H5T layer"); } - /* BITFIELD */ - dt = H5MM_xcalloc(1, sizeof(H5T_t)); - dt->state = H5T_STATE_IMMUTABLE; - H5F_addr_undef (&(dt->ent.header)); - dt->type = H5T_BITFIELD; - dt->size = 1; - dt->u.atomic.order = H5Tget_order(H5T_NATIVE_INT_g); - dt->u.atomic.offset = 0; - dt->u.atomic.prec = 8 * dt->size; - dt->u.atomic.lsb_pad = H5T_PAD_ZERO; - dt->u.atomic.msb_pad = H5T_PAD_ZERO; - if ((H5T_NATIVE_BITFIELD_g = H5I_register(H5_DATATYPE, dt)) < 0) { - HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, - "unable to initialize H5T layer"); - } + /*------------------------------------------------------------ + * The `Fortran' architecture + *------------------------------------------------------------ + */ - /* OPAQUE */ + /* One-byte character string */ dt = H5MM_xcalloc(1, sizeof(H5T_t)); dt->state = H5T_STATE_IMMUTABLE; H5F_addr_undef (&(dt->ent.header)); - dt->type = H5T_OPAQUE; + dt->type = H5T_STRING; dt->size = 1; dt->u.atomic.order = H5T_ORDER_NONE; dt->u.atomic.offset = 0; dt->u.atomic.prec = 8 * dt->size; dt->u.atomic.lsb_pad = H5T_PAD_ZERO; dt->u.atomic.msb_pad = H5T_PAD_ZERO; - if ((H5T_NATIVE_OPAQUE_g = H5I_register(H5_DATATYPE, dt)) < 0) { + dt->u.atomic.u.s.cset = H5T_CSET_ASCII; + dt->u.atomic.u.s.pad = H5T_STR_SPACE; + if ((H5T_FORTRAN_S1_g = H5I_register(H5_DATATYPE, dt)) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, - "unable to initialize H5T layer"); + "can't initialize H5T layer"); } /* - * Define aliases. - */ - H5T_NATIVE_HYPER_g = H5Tcopy(H5T_NATIVE_LLONG_g); - H5Tlock(H5T_NATIVE_HYPER_g); - - H5T_NATIVE_UHYPER_g = H5Tcopy(H5T_NATIVE_ULLONG_g); - H5Tlock(H5T_NATIVE_UHYPER_g); - - /* * Register conversion functions beginning with the most general and * ending with the most specific. */ @@ -485,13 +578,13 @@ H5T_init_interface(void) "unable to register conversion function"); } - if (H5Tregister_hard ("i32le_r64le", H5T_IEEE_U32LE_g, H5T_IEEE_R64LE_g, - H5T_conv_i32le_r64le)<0) { + if (H5Tregister_hard ("u32le_f64le", H5T_STD_U32LE_g, H5T_IEEE_F64LE_g, + H5T_conv_i32le_f64le)<0) { HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function"); } - if (H5Tregister_hard ("i32le_r64le", H5T_IEEE_S32LE_g, H5T_IEEE_R64LE_g, - H5T_conv_i32le_r64le)<0) { + if (H5Tregister_hard ("i32le_f64le", H5T_STD_I32LE_g, H5T_IEEE_F64LE_g, + H5T_conv_i32le_f64le)<0) { HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function"); } diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 3f393d2..2d69dc1 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -54,7 +54,7 @@ H5T_conv_noop(hid_t __unused__ src_id, hid_t __unused__ dst_id, switch (cdata->command) { case H5T_CONV_INIT: - /* Nothing to initialize */ + cdata->need_bkg = H5T_BKG_NO; break; case H5T_CONV_CONV: @@ -147,6 +147,7 @@ H5T_conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HRETURN_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion not supported"); } + cdata->need_bkg = H5T_BKG_NO; break; case H5T_CONV_CONV: @@ -578,6 +579,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HRETURN_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "destination size is too large"); } + cdata->need_bkg = H5T_BKG_NO; break; case H5T_CONV_FREE: @@ -855,7 +857,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_i32le_r64le + * Function: H5T_conv_i32le_f64le * * Purpose: Converts 4-byte little-endian integers (signed or unsigned) * to 8-byte litte-endian IEEE floating point. @@ -872,7 +874,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_i32le_r64le (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T_conv_i32le_f64le (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, void *buf, void __unused__ *bkg) { uint8 *s=NULL, *d=NULL; /*src and dst buf pointers */ @@ -886,11 +888,12 @@ H5T_conv_i32le_r64le (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, uintn exponent; /*exponent */ intn i; /*counter */ - FUNC_ENTER (H5T_conv_i32le_r64le, FAIL); + FUNC_ENTER (H5T_conv_i32le_f64le, FAIL); switch (cdata->command) { case H5T_CONV_INIT: assert (sizeof(intn)>=4); + cdata->need_bkg = H5T_BKG_NO; break; case H5T_CONV_FREE: diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index fc67908..4257d52 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -127,7 +127,7 @@ herr_t H5T_conv_struct (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, void *_buf, void *bkg); herr_t H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, void *_buf, void __unused__ *bkg); -herr_t H5T_conv_i32le_r64le (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +herr_t H5T_conv_i32le_f64le (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, void *_buf, void __unused__ *bkg); /* Bit twiddling functions */ diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index bc1d9bd..56ad7c3 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -21,7 +21,6 @@ #include <H5Ipublic.h> #define HOFFSET(S,M) (offsetof(S,M)) -#define HPOFFSET(P,M) ((size_t)((const char*)&(P->M)-(const char*)P)) /* These are the various classes of data types */ typedef enum H5T_class_t { @@ -119,7 +118,166 @@ typedef struct H5T_cdata_t { typedef herr_t (*H5T_conv_t) (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, void *buf, void *bkg); -/* The predefined native types */ +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The IEEE floating point types in various byte orders. + */ +#define H5T_IEEE_F32BE (H5open(), H5T_IEEE_F32BE_g) +#define H5T_IEEE_F32LE (H5open(), H5T_IEEE_F32LE_g) +#define H5T_IEEE_F64BE (H5open(), H5T_IEEE_F64BE_g) +#define H5T_IEEE_F64LE (H5open(), H5T_IEEE_F64LE_g) +extern hid_t H5T_IEEE_F32BE_g; +extern hid_t H5T_IEEE_F32LE_g; +extern hid_t H5T_IEEE_F64BE_g; +extern hid_t H5T_IEEE_F64LE_g; + +/* + * These are "standard" types. For instance, signed (2's complement) and + * unsigned integers of various sizes and byte orders. + */ +#define H5T_STD_I8BE (H5open(), H5T_STD_I8BE_g) +#define H5T_STD_I8LE (H5open(), H5T_STD_I8LE_g) +#define H5T_STD_I16BE (H5open(), H5T_STD_I16BE_g) +#define H5T_STD_I16LE (H5open(), H5T_STD_I16LE_g) +#define H5T_STD_I32BE (H5open(), H5T_STD_I32BE_g) +#define H5T_STD_I32LE (H5open(), H5T_STD_I32LE_g) +#define H5T_STD_I64BE (H5open(), H5T_STD_I64BE_g) +#define H5T_STD_I64LE (H5open(), H5T_STD_I64LE_g) +#define H5T_STD_U8BE (H5open(), H5T_STD_U8BE_g) +#define H5T_STD_U8LE (H5open(), H5T_STD_U8LE_g) +#define H5T_STD_U16BE (H5open(), H5T_STD_U16BE_g) +#define H5T_STD_U16LE (H5open(), H5T_STD_U16LE_g) +#define H5T_STD_U32BE (H5open(), H5T_STD_U32BE_g) +#define H5T_STD_U32LE (H5open(), H5T_STD_U32LE_g) +#define H5T_STD_U64BE (H5open(), H5T_STD_U64BE_g) +#define H5T_STD_U64LE (H5open(), H5T_STD_U64LE_g) +#define H5T_STD_B8BE (H5open(), H5T_STD_B8BE_g) +#define H5T_STD_B8LE (H5open(), H5T_STD_B8LE_g) +#define H5T_STD_B16BE (H5open(), H5T_STD_B16BE_g) +#define H5T_STD_B16LE (H5open(), H5T_STD_B16LE_g) +#define H5T_STD_B32BE (H5open(), H5T_STD_B32BE_g) +#define H5T_STD_B32LE (H5open(), H5T_STD_B32LE_g) +#define H5T_STD_B64BE (H5open(), H5T_STD_B64BE_g) +#define H5T_STD_B64LE (H5open(), H5T_STD_B64LE_g) +extern hid_t H5T_STD_I8BE_g; +extern hid_t H5T_STD_I8LE_g; +extern hid_t H5T_STD_I16BE_g; +extern hid_t H5T_STD_I16LE_g; +extern hid_t H5T_STD_I32BE_g; +extern hid_t H5T_STD_I32LE_g; +extern hid_t H5T_STD_I64BE_g; +extern hid_t H5T_STD_I64LE_g; +extern hid_t H5T_STD_U8BE_g; +extern hid_t H5T_STD_U8LE_g; +extern hid_t H5T_STD_U16BE_g; +extern hid_t H5T_STD_U16LE_g; +extern hid_t H5T_STD_U32BE_g; +extern hid_t H5T_STD_U32LE_g; +extern hid_t H5T_STD_U64BE_g; +extern hid_t H5T_STD_U64LE_g; +extern hid_t H5T_STD_B8BE_g; +extern hid_t H5T_STD_B8LE_g; +extern hid_t H5T_STD_B16BE_g; +extern hid_t H5T_STD_B16LE_g; +extern hid_t H5T_STD_B32BE_g; +extern hid_t H5T_STD_B32LE_g; +extern hid_t H5T_STD_B64BE_g; +extern hid_t H5T_STD_B64LE_g; + +/* + * Types which are particular to Unix. + */ +#define H5T_UNIX_D32BE (H5open(), H5T_UNIX_D32BE_g) +#define H5T_UNIX_D32LE (H5open(), H5T_UNIX_D32LE_g) +#define H5T_UNIX_D64BE (H5open(), H5T_UNIX_D64BE_g) +#define H5T_UNIX_D64LE (H5open(), H5T_UNIX_D64LE_g) +extern hid_t H5T_UNIX_D32BE_g; +extern hid_t H5T_UNIX_D32LE_g; +extern hid_t H5T_UNIX_D64BE_g; +extern hid_t H5T_UNIX_D64LE_g; + +/* + * Types particular to the C language. String types use `bytes' instead + * of `bits' as their size. + */ +#define H5T_C_S1 (H5open(), H5T_C_S1_g) +extern hid_t H5T_C_S1_g; + +/* + * Types particular to Fortran. + */ +#define H5T_FORTRAN_S1 (H5open(), H5T_FORTRAN_S1_g) +extern hid_t H5T_FORTRAN_S1_g; + +/* + * These types are for Intel CPU's. They are little endian with IEEE + * floating point. + */ +#define H5T_INTEL_I8 H5T_STD_I8LE +#define H5T_INTEL_I16 H5T_STD_I16LE +#define H5T_INTEL_I32 H5T_STD_I32LE +#define H5T_INTEL_I64 H5T_STD_I64LE +#define H5T_INTEL_U8 H5T_STD_U8LE +#define H5T_INTEL_U16 H5T_STD_U16LE +#define H5T_INTEL_U32 H5T_STD_U32LE +#define H5T_INTEL_U64 H5T_STD_U64LE +#define H5T_INTEL_B8 H5T_STD_B8LE +#define H5T_INTEL_B16 H5T_STD_B16LE +#define H5T_INTEL_B32 H5T_STD_B32LE +#define H5T_INTEL_B64 H5T_STD_B64LE +#define H5T_INTEL_F32 H5T_IEEE_F32LE +#define H5T_INTEL_F64 H5T_IEEE_F64LE + +/* + * These types are for DEC Alpha CPU's. They are little endian with IEEE + * floating point. + */ +#define H5T_ALPHA_I8 H5T_STD_I8LE +#define H5T_ALPHA_I16 H5T_STD_I16LE +#define H5T_ALPHA_I32 H5T_STD_I32LE +#define H5T_ALPHA_I64 H5T_STD_I64LE +#define H5T_ALPHA_U8 H5T_STD_U8LE +#define H5T_ALPHA_U16 H5T_STD_U16LE +#define H5T_ALPHA_U32 H5T_STD_U32LE +#define H5T_ALPHA_U64 H5T_STD_U64LE +#define H5T_ALPHA_B8 H5T_STD_B8LE +#define H5T_ALPHA_B16 H5T_STD_B16LE +#define H5T_ALPHA_B32 H5T_STD_B32LE +#define H5T_ALPHA_B64 H5T_STD_B64LE +#define H5T_ALPHA_F32 H5T_IEEE_F32LE +#define H5T_ALPHA_F64 H5T_IEEE_F64LE + +/* + * These types are for MIPS cpu's commonly used in SGI systems. They are big + * endian with IEEE floating point. + */ +#define H5T_MIPS_I8 H5T_STD_I8BE +#define H5T_MIPS_I16 H5T_STD_I16BE +#define H5T_MIPS_I32 H5T_STD_I32BE +#define H5T_MIPS_I64 H5T_STD_I64BE +#define H5T_MIPS_U8 H5T_STD_U8BE +#define H5T_MIPS_U16 H5T_STD_U16BE +#define H5T_MIPS_U32 H5T_STD_U32BE +#define H5T_MIPS_U64 H5T_STD_U64BE +#define H5T_MIPS_B8 H5T_STD_B8BE +#define H5T_MIPS_B16 H5T_STD_B16BE +#define H5T_MIPS_B32 H5T_STD_B32BE +#define H5T_MIPS_B64 H5T_STD_B64BE +#define H5T_MIPS_F32 H5T_IEEE_F32BE +#define H5T_MIPS_F64 H5T_IEEE_F64BE + +/* + * The predefined native types. These are the types detected by H5detect and + * they violate the naming scheme a little. Instead of a class name, + * precision and byte order as the last component, they have a C-like type + * name. If the type begins with `U' then it is the unsigned version of the + * integer type; other integer types are signed. The type LLONG corresponds + * to C's `long long' and LDOUBLE is `long double' (these types might be the + * same as `LONG' and `DOUBLE' respectively. + */ #define H5T_NATIVE_CHAR (H5open(), H5T_NATIVE_CHAR_g) #define H5T_NATIVE_UCHAR (H5open(), H5T_NATIVE_UCHAR_g) #define H5T_NATIVE_SHORT (H5open(), H5T_NATIVE_SHORT_g) @@ -130,46 +288,14 @@ typedef herr_t (*H5T_conv_t) (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, #define H5T_NATIVE_ULONG (H5open(), H5T_NATIVE_ULONG_g) #define H5T_NATIVE_LLONG (H5open(), H5T_NATIVE_LLONG_g) #define H5T_NATIVE_ULLONG (H5open(), H5T_NATIVE_ULLONG_g) -#define H5T_NATIVE_HYPER (H5open(), H5T_NATIVE_HYPER_g) -#define H5T_NATIVE_UHYPER (H5open(), H5T_NATIVE_UHYPER_g) -#define H5T_NATIVE_INT8 (H5open(), H5T_NATIVE_INT8_g) -#define H5T_NATIVE_UINT8 (H5open(), H5T_NATIVE_UINT8_g) -#define H5T_NATIVE_INT16 (H5open(), H5T_NATIVE_INT16_g) -#define H5T_NATIVE_UINT16 (H5open(), H5T_NATIVE_UINT16_g) -#define H5T_NATIVE_INT32 (H5open(), H5T_NATIVE_INT32_g) -#define H5T_NATIVE_UINT32 (H5open(), H5T_NATIVE_UINT32_g) -#define H5T_NATIVE_INT64 (H5open(), H5T_NATIVE_INT64_g) -#define H5T_NATIVE_UINT64 (H5open(), H5T_NATIVE_UINT64_g) #define H5T_NATIVE_FLOAT (H5open(), H5T_NATIVE_FLOAT_g) #define H5T_NATIVE_DOUBLE (H5open(), H5T_NATIVE_DOUBLE_g) -#define H5T_NATIVE_TIME (H5open(), H5T_NATIVE_TIME_g) -#define H5T_NATIVE_STRING (H5open(), H5T_NATIVE_STRING_g) -#define H5T_NATIVE_BITFIELD (H5open(), H5T_NATIVE_BITFIELD_g) +#define H5T_NATIVE_LDOUBLE (H5open(), H5T_NATIVE_LDOUBLE_g) +#define H5T_NATIVE_B8 (H5open(), H5T_NATIVE_B8_g) +#define H5T_NATIVE_B16 (H5open(), H5T_NATIVE_B16_g) +#define H5T_NATIVE_B32 (H5open(), H5T_NATIVE_B32_g) +#define H5T_NATIVE_B64 (H5open(), H5T_NATIVE_B64_g) #define H5T_NATIVE_OPAQUE (H5open(), H5T_NATIVE_OPAQUE_g) - -/* The predefined standard types */ -#define H5T_IEEE_R32LE (H5open(), H5T_IEEE_R32LE_g) -#define H5T_IEEE_R32BE (H5open(), H5T_IEEE_R32BE_g) -#define H5T_IEEE_R64LE (H5open(), H5T_IEEE_R64LE_g) -#define H5T_IEEE_R64BE (H5open(), H5T_IEEE_R64BE_g) -#define H5T_IEEE_U16LE (H5open(), H5T_IEEE_U16LE_g) -#define H5T_IEEE_U16BE (H5open(), H5T_IEEE_U16BE_g) -#define H5T_IEEE_U32LE (H5open(), H5T_IEEE_U32LE_g) -#define H5T_IEEE_U32BE (H5open(), H5T_IEEE_U32BE_g) -#define H5T_IEEE_U64LE (H5open(), H5T_IEEE_U64LE_g) -#define H5T_IEEE_U64BE (H5open(), H5T_IEEE_U64BE_g) -#define H5T_IEEE_S16LE (H5open(), H5T_IEEE_S16LE_g) -#define H5T_IEEE_S16BE (H5open(), H5T_IEEE_S16BE_g) -#define H5T_IEEE_S32LE (H5open(), H5T_IEEE_S32LE_g) -#define H5T_IEEE_S32BE (H5open(), H5T_IEEE_S32BE_g) -#define H5T_IEEE_S64LE (H5open(), H5T_IEEE_S64LE_g) -#define H5T_IEEE_S64BE (H5open(), H5T_IEEE_S64BE_g) - -#ifdef __cplusplus -extern "C" { -#endif - -/* Native types */ extern hid_t H5T_NATIVE_CHAR_g; extern hid_t H5T_NATIVE_UCHAR_g; extern hid_t H5T_NATIVE_SHORT_g; @@ -177,45 +303,18 @@ extern hid_t H5T_NATIVE_USHORT_g; extern hid_t H5T_NATIVE_INT_g; extern hid_t H5T_NATIVE_UINT_g; extern hid_t H5T_NATIVE_LONG_g; -extern hid_t H5T_NATIVE_INT8_g; -extern hid_t H5T_NATIVE_UINT8_g; -extern hid_t H5T_NATIVE_INT16_g; -extern hid_t H5T_NATIVE_UINT16_g; -extern hid_t H5T_NATIVE_INT32_g; -extern hid_t H5T_NATIVE_UINT32_g; -extern hid_t H5T_NATIVE_INT64_g; -extern hid_t H5T_NATIVE_UINT64_g; extern hid_t H5T_NATIVE_ULONG_g; extern hid_t H5T_NATIVE_LLONG_g; extern hid_t H5T_NATIVE_ULLONG_g; -extern hid_t H5T_NATIVE_HYPER_g; -extern hid_t H5T_NATIVE_UHYPER_g; extern hid_t H5T_NATIVE_FLOAT_g; extern hid_t H5T_NATIVE_DOUBLE_g; -extern hid_t H5T_NATIVE_TIME_g; -extern hid_t H5T_NATIVE_STRING_g; -extern hid_t H5T_NATIVE_BITFIELD_g; +extern hid_t H5T_NATIVE_LDOUBLE_g; +extern hid_t H5T_NATIVE_B8_g; +extern hid_t H5T_NATIVE_B16_g; +extern hid_t H5T_NATIVE_B32_g; +extern hid_t H5T_NATIVE_B64_g; extern hid_t H5T_NATIVE_OPAQUE_g; -/* Standard types */ -extern hid_t H5T_IEEE_R32LE_g; /*IEEE 4-byte little-endian float */ -extern hid_t H5T_IEEE_R32BE_g; /*IEEE 4-byte big-endian float */ -extern hid_t H5T_IEEE_R64LE_g; /*IEEE 8-byte little-endian float */ -extern hid_t H5T_IEEE_R64BE_g; /*IEEE 8-byte big endian float */ -extern hid_t H5T_IEEE_U16LE_g; /*IEEE 2-byte little-endian unsigned int */ -extern hid_t H5T_IEEE_U16BE_g; /*IEEE 2-byte big-endian unsigned int */ -extern hid_t H5T_IEEE_U32LE_g; /*IEEE 4-byte little-endian unsigned int */ -extern hid_t H5T_IEEE_U32BE_g; /*IEEE 4-byte big-endian unsigned int */ -extern hid_t H5T_IEEE_U64LE_g; /*IEEE 8-byte little-endian unsigned int */ -extern hid_t H5T_IEEE_U64BE_g; /*IEEE 8-byte big-endian unsigned int */ -extern hid_t H5T_IEEE_S16LE_g; /*IEEE 2-byte little-endian signed int */ -extern hid_t H5T_IEEE_S16BE_g; /*IEEE 2-byte big-endian signed int */ -extern hid_t H5T_IEEE_S32LE_g; /*IEEE 4-byte little-endian signed int */ -extern hid_t H5T_IEEE_S32BE_g; /*IEEE 4-byte big-endian signed int */ -extern hid_t H5T_IEEE_S64LE_g; /*IEEE 8-byte little-endian signed int */ -extern hid_t H5T_IEEE_S64BE_g; /*IEEE 8-byte big-endian signed int */ - - /* Operations defined on all data types */ hid_t H5Topen (hid_t loc_id, const char *name); diff --git a/src/H5detect.c b/src/H5detect.c index 6b47a85..119822c 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -45,6 +45,7 @@ static const char *FileHeader = "\n\ #ifndef MIN # define MIN(X,Y) ((X)<(Y)?(X):(Y)) +# define MIN3(X,Y,Z) MIN(X,MIN(Y,Z)) #endif /* @@ -53,13 +54,14 @@ static const char *FileHeader = "\n\ */ typedef struct detected_t { const char *varname; - int size; - int padding; + int size; /*total byte size*/ + int precision; /*meaningful bits*/ + int offset; /*bit offset to meaningful bits*/ int perm[32]; int sign; int mpos, msize, imp; int epos, esize; - unsigned long bias; + unsigned long bias; } detected_t; static void print_results(int nd, detected_t *d); @@ -68,10 +70,65 @@ static void print_known_formats(detected_t *); static int byte_cmp(int, void *, void *); static int bit_cmp(int, int *, void *, void *); static void fix_order(int, int, int, int *, const char **); -static void fix_padding(detected_t *); static int imp_bit(int, int *, void *, void *); static unsigned long find_bias(int, int, int, int *, void *); +static void precision (detected_t*); static void print_header(void); + + +/*------------------------------------------------------------------------- + * Function: precision + * + * Purpose: Determine the precision and offset. + * + * Return: void + * + * Programmer: Robb Matzke + * Thursday, June 18, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void +precision (detected_t *d) +{ + int n; + + if (0==d->msize) { + /* + * An integer. The permutation can have negative values at the + * beginning or end which represent padding of bytes. We must adjust + * the precision and offset accordingly. + */ + if (d->perm[0] < 0) { + /* + * Lower addresses are padded. + */ + for (n=0; n<d->size && d->perm[n]<0; n++) /*void*/; + d->precision = 8*(d->size-n); + d->offset = 0; + } else if (d->perm[d->size - 1] < 0) { + /* + * Higher addresses are padded. + */ + for (n=0; n<d->size && d->perm[d->size-(n+1)]; n++) /*void*/; + d->precision = 8*(d->size-n); + d->offset = 8*n; + } else { + /* + * No padding. + */ + d->precision = 8*d->size; + d->offset = 0; + } + } else { + /* A floating point */ + d->offset = MIN3 (d->mpos, d->epos, d->sign); + d->precision = d->msize + d->esize + 1; + } +} + /*------------------------------------------------------------------------- * For convenience, we place here in a table descriptions of all @@ -98,31 +155,31 @@ static detected_t Known[] = { /* Single-byte quantities */ {"Byte addressable", - 1, 0, LE_1, INTEGER}, + 1, 8, 0, LE_1, INTEGER}, /* Little-endian integer */ {"Little-endian", - 2, 0, LE_2, INTEGER}, + 2, 16, 0, LE_2, INTEGER}, {"Little-endian", - 4, 0, LE_4, INTEGER}, + 4, 32, 0, LE_4, INTEGER}, /* Big-endian integer */ {"Big-endian", - 2, 0, BE_2, INTEGER}, + 2, 16, 0, BE_2, INTEGER}, {"Big-endian", - 4, 0, BE_4, INTEGER}, + 4, 32, 0, BE_4, INTEGER}, /* Little-endian IEEE floating-point */ {"Little-endian IEEE", - 4, 0, LE_4, 31, 0, 23, 1, 23, 8, 127}, + 4, 32, 0, LE_4, 31, 0, 23, 1, 23, 8, 127}, {"Little-endian IEEE", - 8, 0, LE_8, 63, 0, 52, 1, 52, 11, 1023}, + 8, 64, 0, LE_8, 63, 0, 52, 1, 52, 11, 1023}, /* Big-endian IEEE floating-point */ {"Big-endian IEEE", - 4, 0, BE_4, 31, 0, 23, 1, 23, 8, 127}, + 4, 32, 0, BE_4, 31, 0, 23, 1, 23, 8, 127}, {"Big-endian IEEE", - 8, 0, BE_8, 63, 0, 52, 1, 52, 11, 1023}, + 8, 64, 0, BE_8, 63, 0, 52, 1, 52, 11, 1023}, }; /*------------------------------------------------------------------------- @@ -167,8 +224,8 @@ static detected_t Known[] = assert (_j<(signed)sizeof(TYPE)); \ INFO.perm[_i] = _j; \ } \ - fix_padding (&(INFO)); \ INFO.sign = ('U'!=*(#VAR)); \ + precision (&(INFO)); \ } /*------------------------------------------------------------------------- @@ -205,7 +262,6 @@ static detected_t Known[] = memset (&INFO, 0, sizeof(INFO)); \ INFO.varname = #VAR; \ INFO.size = sizeof(TYPE); \ - INFO.padding = 0; \ \ /* Byte Order */ \ for (_i=0,_v1=0.0,_v2=1.0; _i<(signed)sizeof(TYPE); _i++) { \ @@ -245,6 +301,7 @@ static detected_t Known[] = \ _v1 = 1.0; \ INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.imp, INFO.perm, &_v1); \ + precision (&(INFO)); \ } /*------------------------------------------------------------------------- @@ -266,7 +323,7 @@ static void print_results(int nd, detected_t *d) { - int i; + int i; /* Include files */ printf("\ @@ -311,13 +368,15 @@ H5T_init (void)\n\ dt->type = H5T_%s;\n\ dt->size = %d;\n\ dt->u.atomic.order = H5T_ORDER_%s;\n\ + dt->u.atomic.offset = %d;\n\ dt->u.atomic.prec = %d;\n\ dt->u.atomic.lsb_pad = H5T_PAD_ZERO;\n\ dt->u.atomic.msb_pad = H5T_PAD_ZERO;\n", - d[i].msize ? "FLOAT" : "INTEGER", /*class */ - d[i].size + abs(d[i].padding), /*size */ - d[i].perm[0] ? "BE" : "LE", /*byte order */ - 8 * d[i].size); /*precision */ + d[i].msize ? "FLOAT" : "INTEGER",/*class */ + d[i].size, /*size */ + d[i].perm[0] ? "BE" : "LE", /*byte order */ + d[i].offset, /*offset */ + d[i].precision); /*precision */ if (0 == d[i].msize) { /* The part unique to fixed point types */ @@ -352,11 +411,11 @@ H5T_init (void)\n\ \"failure\");\n\ }\n", d[i].varname); - } printf(" FUNC_LEAVE (SUCCEED);\n}\n"); } + /*------------------------------------------------------------------------- * Function: iprint @@ -377,50 +436,45 @@ H5T_init (void)\n\ static void iprint(detected_t *d) { - - int i, j, k; - - /* - * Print the byte ordering above the bit fields. - */ - printf(" * "); - for (i = d->size - 1; i >= 0; --i) { - printf("%4d", d->perm[i]); - if (i > 0) - fputs(" ", stdout); - if (0 == i % 4) - putchar(' '); - } - putchar('\n'); - - /* - * Print the bit fields - */ - printf(" * "); - for (i = d->size - 1, k = d->size * 8 - 1; i >= 0; --i) { - for (j = 7; j >= 0; --j) { - if (k == d->sign && d->msize) { - putchar('S'); - } else if (k >= d->epos && k < d->epos + d->esize) { - putchar('E'); - } else if (k >= d->mpos && k < d->mpos + d->msize) { - putchar('M'); - } else if (d->msize) { - putchar('?'); /*unknown floating point bit */ - } else if (d->sign) { - putchar('I'); - } else { - putchar('U'); - } - --k; - } - if (i > 0) { - putchar(' '); - if (0 == i % 4) - putchar(' '); + int i, j, k, pass; + + for (pass=(d->size-1)/4; pass>=0; --pass) { + /* + * Print the byte ordering above the bit fields. + */ + printf(" * "); + for (i=MIN(pass*4+3,d->size-1); i>=pass*4; --i) { + printf ("%4d", d->perm[i]); + if (i>pass*4) fputs (" ", stdout); } + + /* + * Print the bit fields + */ + printf("\n * "); + for (i=MIN(pass*4+3,d->size-1), + k=MIN(pass*32+31,8*d->size-1); + i>=pass*4; --i) { + for (j=7; j>=0; --j) { + if (k==d->sign && d->msize) { + putchar('S'); + } else if (k>=d->epos && k<d->epos+d->esize) { + putchar('E'); + } else if (k>=d->mpos && k<d->mpos+d->msize) { + putchar('M'); + } else if (d->msize) { + putchar('?'); /*unknown floating point bit */ + } else if (d->sign) { + putchar('I'); + } else { + putchar('U'); + } + --k; + } + if (i>pass*4) putchar(' '); + } + putchar('\n'); } - putchar('\n'); /* * Is there an implicit bit in the mantissa. @@ -429,6 +483,7 @@ iprint(detected_t *d) printf(" * Implicit bit? %s\n", d->imp ? "yes" : "no"); } } + /*------------------------------------------------------------------------- * Function: print_known_formats @@ -450,36 +505,30 @@ static void print_known_formats(detected_t *d) { - int i, j, diff; - int n = sizeof(Known) / sizeof(Known[0]); + int i, j, diff; + int n = sizeof(Known) / sizeof(Known[0]); - for (i = 0; i < n; i++) { - if (d->size != Known[i].size) - continue; + for (i=0; i<n; i++) { + if (d->size != Known[i].size) continue; + if (d->precision != Known[i].precision) continue; + if (d->offset != Known[i].offset) continue; for (j = diff = 0; !diff && j < d->size; j++) { - if (d->perm[j] != Known[i].perm[j]) - diff = 1; + if (d->perm[j] != Known[i].perm[j]) diff = 1; } - if (diff) - continue; + if (diff) continue; /* if (d->sign != Known[i].sign) continue; */ - if (d->mpos != Known[i].mpos) - continue; - if (d->msize != Known[i].msize) - continue; - if (d->imp != Known[i].imp) - continue; - if (d->epos != Known[i].epos) - continue; - if (d->esize != Known[i].esize) - continue; - if (d->bias != Known[i].bias) - continue; + if (d->mpos != Known[i].mpos) continue; + if (d->msize != Known[i].msize) continue; + if (d->imp != Known[i].imp) continue; + if (d->epos != Known[i].epos) continue; + if (d->esize != Known[i].esize) continue; + if (d->bias != Known[i].bias) continue; printf(" * %s\n", Known[i].varname); } } + /*------------------------------------------------------------------------- * Function: byte_cmp @@ -503,16 +552,14 @@ print_known_formats(detected_t *d) static int byte_cmp(int n, void *_a, void *_b) { + register int i; + unsigned char *a = (unsigned char *) _a; + unsigned char *b = (unsigned char *) _b; - register int i; - unsigned char *a = (unsigned char *) _a; - unsigned char *b = (unsigned char *) _b; - - for (i = 0; i < n; i++) - if (a[i] != b[i]) - return i; + for (i = 0; i < n; i++) if (a[i] != b[i]) return i; return -1; } + /*------------------------------------------------------------------------- * Function: bit_cmp @@ -537,24 +584,23 @@ byte_cmp(int n, void *_a, void *_b) static int bit_cmp(int nbytes, int *perm, void *_a, void *_b) { - - int i, j; - unsigned char *a = (unsigned char *) _a; - unsigned char *b = (unsigned char *) _b; - unsigned char aa, bb; + int i, j; + unsigned char *a = (unsigned char *) _a; + unsigned char *b = (unsigned char *) _b; + unsigned char aa, bb; for (i = 0; i < nbytes; i++) { assert(perm[i] < nbytes); if ((aa = a[perm[i]]) != (bb = b[perm[i]])) { for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) { - if ((aa & 1) != (bb & 1)) - return i * 8 + j; + if ((aa & 1) != (bb & 1)) return i * 8 + j; } assert("INTERNAL ERROR" && 0); } } return -1; } + /*------------------------------------------------------------------------- * Function: fix_order @@ -580,8 +626,7 @@ bit_cmp(int nbytes, int *perm, void *_a, void *_b) static void fix_order(int n, int first, int last, int *perm, const char **mesg) { - - int i; + int i; if (first + 1 < last) { /* @@ -591,27 +636,22 @@ fix_order(int n, int first, int last, int *perm, const char **mesg) /* * Little endian. */ - if (mesg) - *mesg = "Little-endian"; - for (i = 0; i < n; i++) - perm[i] = i; + if (mesg) *mesg = "Little-endian"; + for (i = 0; i < n; i++) perm[i] = i; - } else if (perm[last] > perm[last - 1] && perm[last - 1] > perm[last - 2]) { + } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) { /* * Big endian. */ - if (mesg) - *mesg = "Big-endian"; - for (i = 0; i < n; i++) - perm[i] = (n - 1) - i; + if (mesg) *mesg = "Big-endian"; + for (i = 0; i < n; i++) perm[i] = (n - 1) - i; } else { /* * Bi-endian machines like VAX. */ assert(0 == n / 2); - if (mesg) - *mesg = "VAX"; + if (mesg) *mesg = "VAX"; for (i = 0; i < n; i += 2) { perm[i] = (n - 2) - i; perm[i + 1] = (n - 1) - i; @@ -623,67 +663,7 @@ fix_order(int n, int first, int last, int *perm, const char **mesg) exit(1); } } - -/*------------------------------------------------------------------------- - * Function: fix_padding - * - * Purpose: The permutation can have negative values at the beginning - * or end which represent zero padding. The amount of padding - * is subtracted from the size, the negative values are removed - * from the permutation, and the `padding' field is set to an - * appropriate value. - * - * If N bytes of padding appear to the left (lower address) of - * the value, then `padding=N'. If N bytes of padding appear - * to the right of the value then `padding=(-N)'. - * - * Return: void - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Nov 4 1996 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -fix_padding(detected_t *d) -{ - - int i, n; - if (d->perm[0] < 0) { - /* - * Left padding. - */ - for (n = 0; n < d->size && d->perm[n] < 0; n++) /*void */ - ; - for (i = n; i < d->size; i++) - d->perm[i - n] = d->perm[i]; - for (i = d->size - n; i < d->size; i++) - d->perm[i] = 0; - d->padding = n; - d->size -= n; - - } else if (d->perm[d->size - 1] < 0) { - /* - * Right padding. - */ - for (n = 0; n < d->size && d->perm[d->size - (n + 1)]; n++) /*void */ - ; - for (i = d->size - n; i < d->size; i++) - d->perm[i] = 0; - d->padding = -n; - d->size -= n; - - } else { - /* - * No padding. - */ - d->padding = 0; - } -} /*------------------------------------------------------------------------- * Function: imp_bit @@ -724,11 +704,10 @@ fix_padding(detected_t *d) static int imp_bit(int n, int *perm, void *_a, void *_b) { - - unsigned char *a = (unsigned char *) _a; - unsigned char *b = (unsigned char *) _b; - int changed, major, minor; - int msmb; /*most significant mantissa bit */ + unsigned char *a = (unsigned char *) _a; + unsigned char *b = (unsigned char *) _b; + int changed, major, minor; + int msmb; /*most significant mantissa bit */ /* * Look for the least significant bit that has changed between @@ -748,6 +727,7 @@ imp_bit(int n, int *perm, void *_a, void *_b) return (a[perm[major]] >> minor) & 0x01 ? 0 : 1; } + /*------------------------------------------------------------------------- * Function: find_bias @@ -774,10 +754,9 @@ imp_bit(int n, int *perm, void *_a, void *_b) static unsigned long find_bias(int epos, int esize, int imp, int *perm, void *_a) { - - unsigned char *a = (unsigned char *) _a; - unsigned char mask; - unsigned long b, shift = 0, nbits, bias = 0; + unsigned char *a = (unsigned char *) _a; + unsigned char mask; + unsigned long b, shift = 0, nbits, bias = 0; while (esize > 0) { nbits = MIN(esize, (8 - epos % 8)); @@ -792,6 +771,7 @@ find_bias(int epos, int esize, int imp, int *perm, void *_a) return bias - (imp ? 0 : 1); } + /*------------------------------------------------------------------------- * Function: print_header @@ -866,20 +846,20 @@ bit.\n"; */ #ifdef HAVE_GETPWUID { - size_t n; - char *comma; - if ((pwd = getpwuid(getuid()))) { - if ((comma = strchr(pwd->pw_gecos, ','))) { - n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); - strncpy(real_name, pwd->pw_gecos, n); - real_name[n] = '\0'; - } else { - strncpy(real_name, pwd->pw_gecos, sizeof(real_name)); - real_name[sizeof(real_name) - 1] = '\0'; - } - } else { - real_name[0] = '\0'; - } + size_t n; + char *comma; + if ((pwd = getpwuid(getuid()))) { + if ((comma = strchr(pwd->pw_gecos, ','))) { + n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); + strncpy(real_name, pwd->pw_gecos, n); + real_name[n] = '\0'; + } else { + strncpy(real_name, pwd->pw_gecos, sizeof(real_name)); + real_name[sizeof(real_name) - 1] = '\0'; + } + } else { + real_name[0] = '\0'; + } } #else real_name[0] = '\0'; @@ -907,21 +887,16 @@ bit.\n"; month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); if (pwd || real_name[0] || host_name[0]) { printf(" *\t\t\t"); - if (real_name[0]) - printf("%s <", real_name); - if (pwd) - fputs(pwd->pw_name, stdout); - if (host_name[0]) - printf("@%s", host_name); - if (real_name[0]) - printf(">"); + if (real_name[0]) printf("%s <", real_name); + if (pwd) fputs(pwd->pw_name, stdout); + if (host_name[0]) printf("@%s", host_name); + if (real_name[0]) printf(">"); putchar('\n'); } printf(" *\n * Purpose:\t\t"); for (s = purpose; *s; s++) { putchar(*s); - if ('\n' == *s && s[1]) - printf(" *\t\t\t"); + if ('\n' == *s && s[1]) printf(" *\t\t\t"); } printf(" *\n * Modifications:\n *\n"); @@ -929,11 +904,11 @@ bit.\n"; printf(" *\tIt was generated by code in `H5detect.c'.\n"); printf(" *\n *"); - for (i = 0; i < 73; i++) - putchar('-'); + for (i = 0; i < 73; i++) putchar('-'); printf("\n */\n\n"); } + /*------------------------------------------------------------------------- * Function: main @@ -955,36 +930,25 @@ bit.\n"; int main(void) { - detected_t d[MAXDETECT]; - int nd = 0; + detected_t d[MAXDETECT]; + int nd = 0; print_header(); - DETECT_I(signed char, CHAR, d[nd]); - nd++; - DETECT_I(unsigned char, UCHAR, d[nd]); - nd++; - DETECT_I(short, SHORT, d[nd]); - nd++; - DETECT_I(unsigned short, USHORT, d[nd]); - nd++; - DETECT_I(int, INT, d[nd]); - nd++; - DETECT_I(unsigned int, UINT, d[nd]); - nd++; - DETECT_I(long, LONG, d[nd]); - nd++; - DETECT_I(unsigned long, ULONG, d[nd]); - nd++; - DETECT_I(long long, LLONG, d[nd]); - nd++; - DETECT_I(unsigned long long, ULLONG, d[nd]); - nd++; - DETECT_F(float, FLOAT, d[nd]); - nd++; - DETECT_F(double, DOUBLE, d[nd]); - nd++; - - print_results(nd, d); + DETECT_I (signed char, CHAR, d[nd]); nd++; + DETECT_I (unsigned char, UCHAR, d[nd]); nd++; + DETECT_I (short, SHORT, d[nd]); nd++; + DETECT_I (unsigned short, USHORT, d[nd]); nd++; + DETECT_I (int, INT, d[nd]); nd++; + DETECT_I (unsigned int, UINT, d[nd]); nd++; + DETECT_I (long, LONG, d[nd]); nd++; + DETECT_I (unsigned long, ULONG, d[nd]); nd++; + DETECT_I (long long, LLONG, d[nd]); nd++; + DETECT_I (unsigned long long, ULLONG, d[nd]); nd++; + DETECT_F (float, FLOAT, d[nd]); nd++; + DETECT_F (double, DOUBLE, d[nd]); nd++; + DETECT_F (long double, LDOUBLE, d[nd]); nd++; + + print_results (nd, d); return 0; } @@ -55,7 +55,7 @@ list_attr (hid_t obj, const char *attr_name, void __unused__ *op_data) if ((attr = H5Aopen_name (obj, attr_name))) { hid_t space = H5Aget_space (attr); hsize_t size[64]; - int ndims = H5Sget_dims (space, size); + int ndims = H5Sget_dims (space, size, NULL); H5Sclose (space); printf (" {"); for (i=0; i<ndims; i++) { @@ -113,7 +113,7 @@ list (hid_t group, const char *name, void __unused__ *op_data) if ((obj=H5Dopen (group, name))>=0) { hsize_t size[64]; hid_t space = H5Dget_space (obj); - int ndims = H5Sget_dims (space, size); + int ndims = H5Sget_dims (space, size, NULL); printf ("Dataset {"); for (i=0; i<ndims; i++) { HDfprintf (stdout, "%s%Hu", i?", ":"", size[i]); diff --git a/test/.distdep b/test/.distdep index b2dc049..17b11f1 100644 --- a/test/.distdep +++ b/test/.distdep @@ -4,30 +4,6 @@ testhdf5.o: \ ../src/H5private.h \ ../src/H5public.h \ ../src/H5config.h -tattr.o: \ - tattr.c \ - testhdf5.h \ - ../src/H5private.h \ - ../src/H5public.h \ - ../src/H5config.h \ - ../src/H5Eprivate.h \ - ../src/H5Epublic.h \ - ../src/H5Ipublic.h \ - ../src/hdf5.h \ - ../src/H5Apublic.h \ - ../src/H5ACpublic.h \ - ../src/H5Bpublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Fpublic.h \ - ../src/H5Gpublic.h \ - ../src/H5HGpublic.h \ - ../src/H5HLpublic.h \ - ../src/H5MFpublic.h \ - ../src/H5MMpublic.h \ - ../src/H5Opublic.h \ - ../src/H5Ppublic.h \ - ../src/H5Zpublic.h \ - ../src/H5Spublic.h tfile.o: \ tfile.c \ testhdf5.h \ @@ -130,55 +106,6 @@ tstab.o: \ ../src/H5Tpublic.h \ ../src/H5Sprivate.h \ ../src/H5Spublic.h -th5s.o: \ - th5s.c \ - testhdf5.h \ - ../src/H5private.h \ - ../src/H5public.h \ - ../src/H5config.h \ - ../src/H5Eprivate.h \ - ../src/H5Epublic.h \ - ../src/H5Ipublic.h \ - ../src/H5Bprivate.h \ - ../src/H5Bpublic.h \ - ../src/H5Fprivate.h \ - ../src/H5Fpublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Sprivate.h \ - ../src/H5Spublic.h \ - ../src/H5Gprivate.h \ - ../src/H5Gpublic.h \ - ../src/H5Oprivate.h \ - ../src/H5Opublic.h \ - ../src/H5HGprivate.h \ - ../src/H5HGpublic.h \ - ../src/H5Tprivate.h \ - ../src/H5Tpublic.h \ - ../src/H5Zprivate.h \ - ../src/H5Zpublic.h \ - ../src/H5Pprivate.h -dtypes.o: \ - dtypes.c \ - ../src/hdf5.h \ - ../src/H5public.h \ - ../src/H5config.h \ - ../src/H5Ipublic.h \ - ../src/H5Apublic.h \ - ../src/H5ACpublic.h \ - ../src/H5Bpublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Epublic.h \ - ../src/H5Fpublic.h \ - ../src/H5Gpublic.h \ - ../src/H5HGpublic.h \ - ../src/H5HLpublic.h \ - ../src/H5MFpublic.h \ - ../src/H5MMpublic.h \ - ../src/H5Opublic.h \ - ../src/H5Ppublic.h \ - ../src/H5Zpublic.h \ - ../src/H5Spublic.h \ - ../src/H5Tpublic.h hyperslab.o: \ hyperslab.c \ ../src/H5private.h \ @@ -210,8 +137,29 @@ istore.o: \ ../src/H5Tprivate.h \ ../src/H5Tpublic.h \ ../src/H5Sprivate.h -dsets.o: \ - dsets.c \ +extend.o: \ + extend.c \ + ../src/hdf5.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Ipublic.h \ + ../src/H5Apublic.h \ + ../src/H5ACpublic.h \ + ../src/H5Bpublic.h \ + ../src/H5Dpublic.h \ + ../src/H5Epublic.h \ + ../src/H5Fpublic.h \ + ../src/H5Gpublic.h \ + ../src/H5HGpublic.h \ + ../src/H5HLpublic.h \ + ../src/H5MFpublic.h \ + ../src/H5MMpublic.h \ + ../src/H5Opublic.h \ + ../src/H5Ppublic.h \ + ../src/H5Zpublic.h \ + ../src/H5Spublic.h +iopipe.o: \ + iopipe.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -232,8 +180,25 @@ dsets.o: \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ ../src/H5Tpublic.h -cmpd_dset.o: \ - cmpd_dset.c \ +gheap.o: \ + gheap.c \ + ../src/H5private.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Eprivate.h \ + ../src/H5Epublic.h \ + ../src/H5Ipublic.h \ + ../src/H5Fprivate.h \ + ../src/H5Fpublic.h \ + ../src/H5Dpublic.h \ + ../src/H5Gprivate.h \ + ../src/H5Gpublic.h \ + ../src/H5Bprivate.h \ + ../src/H5Bpublic.h \ + ../src/H5HGprivate.h \ + ../src/H5HGpublic.h +shtype.o: \ + shtype.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -253,8 +218,8 @@ cmpd_dset.o: \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ ../src/H5Spublic.h -extend.o: \ - extend.c \ +big.o: \ + big.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -273,9 +238,11 @@ extend.o: \ ../src/H5Opublic.h \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ - ../src/H5Spublic.h -external.o: \ - external.c \ + ../src/H5Spublic.h \ + ../src/H5Tpublic.h \ + ../src/H5private.h +links.o: \ + links.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -296,8 +263,8 @@ external.o: \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ ../src/H5Tpublic.h -iopipe.o: \ - iopipe.c \ +chunk.o: \ + chunk.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -318,34 +285,37 @@ iopipe.o: \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ ../src/H5Tpublic.h -gheap.o: \ - gheap.c \ - ../src/H5private.h \ +bittests.o: \ + bittests.c \ + ../src/H5Tpkg.h \ + ../src/H5HGprivate.h \ + ../src/H5HGpublic.h \ ../src/H5public.h \ ../src/H5config.h \ - ../src/H5Eprivate.h \ - ../src/H5Epublic.h \ - ../src/H5Ipublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ + ../src/H5Ipublic.h \ + ../src/H5private.h \ ../src/H5Dpublic.h \ + ../src/H5Tprivate.h \ + ../src/H5Tpublic.h \ ../src/H5Gprivate.h \ ../src/H5Gpublic.h \ - ../src/H5Bprivate.h \ - ../src/H5Bpublic.h \ - ../src/H5HGprivate.h \ - ../src/H5HGpublic.h -shtype.o: \ - shtype.c \ - ../src/hdf5.h \ + ../src/H5Bprivate.h +tattr.o: \ + tattr.c \ + testhdf5.h \ + ../src/H5private.h \ ../src/H5public.h \ ../src/H5config.h \ + ../src/H5Eprivate.h \ + ../src/H5Epublic.h \ ../src/H5Ipublic.h \ + ../src/hdf5.h \ ../src/H5Apublic.h \ ../src/H5ACpublic.h \ ../src/H5Bpublic.h \ ../src/H5Dpublic.h \ - ../src/H5Epublic.h \ ../src/H5Fpublic.h \ ../src/H5Gpublic.h \ ../src/H5HGpublic.h \ @@ -356,8 +326,8 @@ shtype.o: \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ ../src/H5Spublic.h -big.o: \ - big.c \ +dtypes.o: \ + dtypes.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -377,10 +347,9 @@ big.o: \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ - ../src/H5Tpublic.h \ - ../src/H5private.h -links.o: \ - links.c \ + ../src/H5Tpublic.h +dsets.o: \ + dsets.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -401,8 +370,29 @@ links.o: \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ ../src/H5Tpublic.h -chunk.o: \ - chunk.c \ +cmpd_dset.o: \ + cmpd_dset.c \ + ../src/hdf5.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Ipublic.h \ + ../src/H5Apublic.h \ + ../src/H5ACpublic.h \ + ../src/H5Bpublic.h \ + ../src/H5Dpublic.h \ + ../src/H5Epublic.h \ + ../src/H5Fpublic.h \ + ../src/H5Gpublic.h \ + ../src/H5HGpublic.h \ + ../src/H5HLpublic.h \ + ../src/H5MFpublic.h \ + ../src/H5MMpublic.h \ + ../src/H5Opublic.h \ + ../src/H5Ppublic.h \ + ../src/H5Zpublic.h \ + ../src/H5Spublic.h +external.o: \ + external.c \ ../src/hdf5.h \ ../src/H5public.h \ ../src/H5config.h \ @@ -423,20 +413,30 @@ chunk.o: \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ ../src/H5Tpublic.h -bittests.o: \ - bittests.c \ - ../src/H5Tpkg.h \ - ../src/H5HGprivate.h \ - ../src/H5HGpublic.h \ +th5s.o: \ + th5s.c \ + testhdf5.h \ + ../src/H5private.h \ ../src/H5public.h \ ../src/H5config.h \ + ../src/H5Eprivate.h \ + ../src/H5Epublic.h \ + ../src/H5Ipublic.h \ + ../src/H5Bprivate.h \ + ../src/H5Bpublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ - ../src/H5Ipublic.h \ - ../src/H5private.h \ ../src/H5Dpublic.h \ - ../src/H5Tprivate.h \ - ../src/H5Tpublic.h \ + ../src/H5Sprivate.h \ + ../src/H5Spublic.h \ ../src/H5Gprivate.h \ ../src/H5Gpublic.h \ - ../src/H5Bprivate.h + ../src/H5Oprivate.h \ + ../src/H5Opublic.h \ + ../src/H5HGprivate.h \ + ../src/H5HGpublic.h \ + ../src/H5Tprivate.h \ + ../src/H5Tpublic.h \ + ../src/H5Zprivate.h \ + ../src/H5Zpublic.h \ + ../src/H5Pprivate.h diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 1ccbe85..694ce3d 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -189,11 +189,11 @@ STEP 1: Initialize dataset `s1' and store it on disk in native order.\n"); /* Create the memory data type */ s1_tid = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)); - H5Tinsert (s1_tid, "a", HPOFFSET(s1,a), H5T_NATIVE_INT); - H5Tinsert (s1_tid, "b", HPOFFSET(s1,b), H5T_NATIVE_INT); - H5Tinsert (s1_tid, "c", HPOFFSET(s1,c), H5T_NATIVE_INT); - H5Tinsert (s1_tid, "d", HPOFFSET(s1,d), H5T_NATIVE_INT); - H5Tinsert (s1_tid, "e", HPOFFSET(s1,e), H5T_NATIVE_INT); + H5Tinsert (s1_tid, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT); + H5Tinsert (s1_tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT); + H5Tinsert (s1_tid, "c", HOFFSET(s1_t,c), H5T_NATIVE_INT); + H5Tinsert (s1_tid, "d", HOFFSET(s1_t,d), H5T_NATIVE_INT); + H5Tinsert (s1_tid, "e", HOFFSET(s1_t,e), H5T_NATIVE_INT); assert (s1_tid>=0); /* Create the dataset */ @@ -218,11 +218,11 @@ STEP 2: Read the dataset from disk into a new memory buffer which has the\n\ /* Create a data type for s2 */ s2_tid = H5Tcreate (H5T_COMPOUND, sizeof(s2_t)); - H5Tinsert (s2_tid, "a", HPOFFSET(s2,a), H5T_NATIVE_INT); - H5Tinsert (s2_tid, "b", HPOFFSET(s2,b), H5T_NATIVE_INT); - H5Tinsert (s2_tid, "c", HPOFFSET(s2,c), H5T_NATIVE_INT); - H5Tinsert (s2_tid, "d", HPOFFSET(s2,d), H5T_NATIVE_INT); - H5Tinsert (s2_tid, "e", HPOFFSET(s2,e), H5T_NATIVE_INT); + H5Tinsert (s2_tid, "a", HOFFSET(s2_t,a), H5T_NATIVE_INT); + H5Tinsert (s2_tid, "b", HOFFSET(s2_t,b), H5T_NATIVE_INT); + H5Tinsert (s2_tid, "c", HOFFSET(s2_t,c), H5T_NATIVE_INT); + H5Tinsert (s2_tid, "d", HOFFSET(s2_t,d), H5T_NATIVE_INT); + H5Tinsert (s2_tid, "e", HOFFSET(s2_t,e), H5T_NATIVE_INT); assert (s2_tid>=0); /* Read the data */ @@ -250,11 +250,11 @@ STEP 3: Read the dataset again with members in a different order.\n"); /* Create a data type for s3 */ s3_tid = H5Tcreate (H5T_COMPOUND, sizeof(s3_t)); - H5Tinsert (s3_tid, "a", HPOFFSET(s3,a), H5T_NATIVE_INT); - H5Tinsert (s3_tid, "b", HPOFFSET(s3,b), H5T_NATIVE_INT); - H5Tinsert (s3_tid, "c", HPOFFSET(s3,c), H5T_NATIVE_INT); - H5Tinsert (s3_tid, "d", HPOFFSET(s3,d), H5T_NATIVE_INT); - H5Tinsert (s3_tid, "e", HPOFFSET(s3,e), H5T_NATIVE_INT); + H5Tinsert (s3_tid, "a", HOFFSET(s3_t,a), H5T_NATIVE_INT); + H5Tinsert (s3_tid, "b", HOFFSET(s3_t,b), H5T_NATIVE_INT); + H5Tinsert (s3_tid, "c", HOFFSET(s3_t,c), H5T_NATIVE_INT); + H5Tinsert (s3_tid, "d", HOFFSET(s3_t,d), H5T_NATIVE_INT); + H5Tinsert (s3_tid, "e", HOFFSET(s3_t,e), H5T_NATIVE_INT); assert (s3_tid>=0); /* Read the data */ @@ -281,8 +281,8 @@ STEP 4: Read a subset of the members.\n"); /* Create a datatype for s4 */ s4_tid = H5Tcreate (H5T_COMPOUND, sizeof(s4_t)); - H5Tinsert (s4_tid, "b", HPOFFSET(s4,b), H5T_NATIVE_INT); - H5Tinsert (s4_tid, "d", HPOFFSET(s4,d), H5T_NATIVE_INT); + H5Tinsert (s4_tid, "b", HOFFSET(s4_t,b), H5T_NATIVE_INT); + H5Tinsert (s4_tid, "d", HOFFSET(s4_t,d), H5T_NATIVE_INT); assert (s4_tid>=0); /* Read the data */ @@ -314,11 +314,11 @@ STEP 5: Read members into a superset which is partially initialized.\n"); /* Create a data type for s5 */ s5_tid = H5Tcreate (H5T_COMPOUND, sizeof(s5_t)); - H5Tinsert (s5_tid, "a", HPOFFSET(s5,a), H5T_NATIVE_INT); - H5Tinsert (s5_tid, "b", HPOFFSET(s5,b), H5T_NATIVE_INT); - H5Tinsert (s5_tid, "c", HPOFFSET(s5,c), H5T_NATIVE_INT); - H5Tinsert (s5_tid, "d", HPOFFSET(s5,d), H5T_NATIVE_INT); - H5Tinsert (s5_tid, "e", HPOFFSET(s5,e), H5T_NATIVE_INT); + H5Tinsert (s5_tid, "a", HOFFSET(s5_t,a), H5T_NATIVE_INT); + H5Tinsert (s5_tid, "b", HOFFSET(s5_t,b), H5T_NATIVE_INT); + H5Tinsert (s5_tid, "c", HOFFSET(s5_t,c), H5T_NATIVE_INT); + H5Tinsert (s5_tid, "d", HOFFSET(s5_t,d), H5T_NATIVE_INT); + H5Tinsert (s5_tid, "e", HOFFSET(s5_t,e), H5T_NATIVE_INT); assert (s5_tid>=0); /* Read the data */ diff --git a/test/dsets.c b/test/dsets.c index cc81319..a3c15df 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -291,7 +291,7 @@ test_tconv(hid_t file) char *out=NULL, *in=NULL; int i; hsize_t dims[1]; - hid_t space, dataset, type; + hid_t space, dataset; herr_t status; out = malloc (4*1000000); @@ -316,31 +316,18 @@ test_tconv(hid_t file) assert(space >= 0); /* Create the data set */ - dataset = H5Dcreate(file, DSET_TCONV_NAME, H5T_NATIVE_INT32, space, + dataset = H5Dcreate(file, DSET_TCONV_NAME, H5T_STD_I32LE, space, H5P_DEFAULT); assert(dataset >= 0); /* Write the data to the dataset */ - status = H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, + status = H5Dwrite(dataset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, out); assert(status >= 0); - /* Create a new type with the opposite byte order */ - type = H5Tcopy(H5T_NATIVE_INT32); - switch (H5Tget_order(type)) { - case H5T_ORDER_BE: - H5Tset_order(type, H5T_ORDER_LE); - break; - case H5T_ORDER_LE: - H5Tset_order(type, H5T_ORDER_BE); - break; - default: - assert("funny byte order" && 0); - break; - } - /* Read data with byte order conversion */ - status = H5Dread(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, in); + status = H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, + H5P_DEFAULT, in); assert(status >= 0); /* Check */ @@ -352,7 +339,6 @@ test_tconv(hid_t file) } H5Dclose(dataset); - H5Tclose(type); free (out); free (in); @@ -716,7 +702,7 @@ test_multiopen (hid_t file) /* Get the size from the second handle */ if ((space = H5Dget_space (dset2))<0) goto error; - if (H5Sget_dims (space, tmp_size)<0) goto error; + if (H5Sget_dims (space, tmp_size, NULL)<0) goto error; if (cur_size[0]!=tmp_size[0]) { puts ("*FAILED*"); printf (" Got %d instead of %d!\n", diff --git a/test/dtypes.c b/test/dtypes.c index f60efd7..1bc58f5 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -534,7 +534,7 @@ test_conv_num (void) /* (unsigned)0x80000000 -> (unsigned)0xffff */ byte[0] = byte[1] = byte[2] = 0; byte[3] = 0x80; - if (H5Tconvert (H5T_NATIVE_UINT32, H5T_NATIVE_UINT16, 1, byte, NULL)<0) { + if (H5Tconvert (H5T_STD_U32LE, H5T_STD_U16LE, 1, byte, NULL)<0) { goto error; } if (byte[0]!=0xff || byte[1]!=0xff) { @@ -545,7 +545,7 @@ test_conv_num (void) /* (unsigned)0xffffffff -> (signed)0x7fff */ byte[0] = byte[1] = byte[2] = byte[3] = 0xff; - if (H5Tconvert (H5T_NATIVE_UINT32, H5T_NATIVE_INT16, 1, byte, NULL)<0) { + if (H5Tconvert (H5T_STD_U32LE, H5T_STD_I16LE, 1, byte, NULL)<0) { goto error; } if (byte[0]!=0xff || byte[1]!=0x7f) { @@ -556,7 +556,7 @@ test_conv_num (void) /* (signed)0xffffffff -> (unsigned)0x0000 */ byte[0] = byte[1] = byte[2] = byte[3] = 0xff; - if (H5Tconvert (H5T_NATIVE_INT32, H5T_NATIVE_UINT16, 1, byte, NULL)<0) { + if (H5Tconvert (H5T_STD_I32LE, H5T_STD_U16LE, 1, byte, NULL)<0) { goto error; } if (byte[0]!=0x00 || byte[1]!=0x00) { @@ -568,7 +568,7 @@ test_conv_num (void) /* (signed)0x7fffffff -> (unsigned)0xffff */ byte[0] = byte[1] = byte[2] = 0xff; byte[3] = 0x7f; - if (H5Tconvert (H5T_NATIVE_INT32, H5T_NATIVE_UINT16, 1, byte, NULL)<0) { + if (H5Tconvert (H5T_STD_I32LE, H5T_STD_U16LE, 1, byte, NULL)<0) { goto error; } if (byte[0]!=0xff || byte[1]!=0xff) { @@ -580,7 +580,7 @@ test_conv_num (void) /* (signed)0x7fffffff -> (signed)0x7fff */ byte[0] = byte[1] = byte[2] = 0xff; byte[3] = 0x7f; - if (H5Tconvert (H5T_NATIVE_INT32, H5T_NATIVE_INT16, 1, byte, NULL)<0) { + if (H5Tconvert (H5T_STD_I32LE, H5T_STD_I16LE, 1, byte, NULL)<0) { goto error; } if (byte[0]!=0xff || byte[1]!=0x7f) { @@ -592,7 +592,7 @@ test_conv_num (void) /* (signed)0xbfffffff -> (signed)0x8000 */ byte[0] = byte[1] = byte[2] = 0xff; byte[3] = 0xbf; - if (H5Tconvert (H5T_NATIVE_INT32, H5T_NATIVE_INT16, 1, byte, NULL)<0) { + if (H5Tconvert (H5T_STD_I32LE, H5T_STD_I16LE, 1, byte, NULL)<0) { goto error; } if (byte[0]!=0x00 || byte[1]!=0x80) { @@ -622,9 +622,9 @@ test_conv_num (void) memcpy (saved, buf, nelmts*sizeof(int)); /* Convert there and back */ - if (H5Tconvert (H5T_NATIVE_INT, H5T_IEEE_S64LE, nelmts, buf, + if (H5Tconvert (H5T_NATIVE_INT, H5T_STD_I64LE, nelmts, buf, NULL)<0) goto error; - if (H5Tconvert (H5T_IEEE_S64LE, H5T_NATIVE_INT, nelmts, buf, + if (H5Tconvert (H5T_STD_I64LE, H5T_NATIVE_INT, nelmts, buf, NULL)<0) goto error; /* Check results */ diff --git a/test/external.c b/test/external.c index 2c8e8a7..d552ac0 100644 --- a/test/external.c +++ b/test/external.c @@ -157,7 +157,7 @@ test_1 (void) assert (space>=0); /* Create the dataset, the `dset1' name is used later too */ - dset = H5Dcreate (file, "dset1", H5T_NATIVE_INT32, space, plist); + dset = H5Dcreate (file, "dset1", H5T_NATIVE_INT, space, plist); if (dset<0) break; H5Dclose (dset); puts (" PASSED"); @@ -182,7 +182,7 @@ test_1 (void) H5Eget_auto (&func, &client_data); H5Eset_auto (NULL, NULL); - dset = H5Dcreate (file, "dset2", H5T_NATIVE_INT32, space, plist); + dset = H5Dcreate (file, "dset2", H5T_NATIVE_INT, space, plist); H5Eset_auto (func, client_data); if (dset>=0) { @@ -214,7 +214,7 @@ test_1 (void) space = H5Screate_simple (1, size, max_size); assert (space>=0); - dset = H5Dcreate (file, "dset3", H5T_NATIVE_INT32, space, plist); + dset = H5Dcreate (file, "dset3", H5T_NATIVE_INT, space, plist); if (dset<0) break; H5Dclose (dset); puts (" PASSED"); @@ -243,7 +243,7 @@ test_1 (void) H5Eget_auto (&func, &client_data); H5Eset_auto (NULL, NULL); - dset = H5Dcreate (file, "dset4", H5T_NATIVE_INT32, space, plist); + dset = H5Dcreate (file, "dset4", H5T_NATIVE_INT, space, plist); H5Eset_auto (func, client_data); if (dset>=0) { @@ -275,7 +275,7 @@ test_1 (void) assert (space>=0); /* Create the dataset, the `dset5' name is used later too */ - dset = H5Dcreate (file, "dset5", H5T_NATIVE_INT32, space, plist); + dset = H5Dcreate (file, "dset5", H5T_NATIVE_INT, space, plist); if (dset<0) break; H5Dclose (dset); puts (" PASSED"); @@ -399,7 +399,7 @@ test_1 (void) space = H5Screate_simple (1, size, max_size); assert (space>=0); - dset = H5Dcreate (file, "dset6", H5T_NATIVE_INT32, space, plist); + dset = H5Dcreate (file, "dset6", H5T_NATIVE_INT, space, plist); if (dset<0) break; H5Dclose (dset); puts (" PASSED"); diff --git a/test/tattr.c b/test/tattr.c index 1eae9b5..36dbdcf 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -46,13 +46,13 @@ static char RcsId[] = "$Revision$"; #define ATTR1_NAME "Attr1" #define ATTR1_RANK 1 #define ATTR1_DIM1 3 -int32 attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */ +int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */ #define ATTR2_NAME "Attr2" #define ATTR2_RANK 2 #define ATTR2_DIM1 2 #define ATTR2_DIM2 2 -int32 attr_data2[ATTR2_DIM1][ATTR2_DIM2]={{7614,-416},{197814,-3}}; /* Test data for 2nd attribute */ +int attr_data2[ATTR2_DIM1][ATTR2_DIM2]={{7614,-416},{197814,-3}}; /* Test data for 2nd attribute */ #define ATTR3_NAME "Attr3" #define ATTR3_RANK 3 @@ -72,7 +72,7 @@ size_t attr4_field1_off=0; size_t attr4_field2_off=0; size_t attr4_field3_off=0; struct attr4_struct { - int32 i; + int i; double d; char c; } attr_data4[ATTR4_DIM1][ATTR4_DIM2]={{{3,-26.1,'d'},{-100000, 0.123,'3'}}, @@ -115,26 +115,26 @@ test_attr_basic_write(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UINT8,sid1,H5P_DEFAULT); + dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); /* Create dataspace for attribute */ sid2 = H5Screate_simple(ATTR1_RANK, dims2, NULL); CHECK(sid2, FAIL, "H5Screate_simple"); /* Try to create an attribute on the file (should fail) */ - ret=H5Acreate(fid1,ATTR1_NAME,H5T_NATIVE_INT32,sid2,H5P_DEFAULT); + ret=H5Acreate(fid1,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate"); /* Create an attribute for the dataset */ - attr=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT32,sid2,H5P_DEFAULT); + attr=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate"); /* Try to create the same attribute again (should fail) */ - ret=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT32,sid2,H5P_DEFAULT); + ret=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate"); /* Write attribute information */ - ret=H5Awrite(attr,H5T_NATIVE_INT32,attr_data1); + ret=H5Awrite(attr,H5T_NATIVE_INT,attr_data1); CHECK(ret, FAIL, "H5Awrite"); /* Close attribute */ @@ -159,15 +159,15 @@ test_attr_basic_write(void) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create an attribute for the group */ - attr=H5Acreate(group,ATTR2_NAME,H5T_NATIVE_INT32,sid2,H5P_DEFAULT); + attr=H5Acreate(group,ATTR2_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate"); /* Try to create the same attribute again (should fail) */ - ret=H5Acreate(group,ATTR2_NAME,H5T_NATIVE_INT32,sid2,H5P_DEFAULT); + ret=H5Acreate(group,ATTR2_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate"); /* Write attribute information */ - ret=H5Awrite(attr,H5T_NATIVE_INT32,attr_data2); + ret=H5Awrite(attr,H5T_NATIVE_INT,attr_data2); CHECK(ret, FAIL, "H5Awrite"); /* Close attribute */ @@ -199,8 +199,8 @@ test_attr_basic_read(void) hid_t dataset; /* Dataset ID */ hid_t group; /* Group ID */ hid_t attr; /* Attribute ID */ - int32 read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int32 read_data2[ATTR2_DIM1][ATTR2_DIM2]={{0}}; /* Buffer for reading 2nd attribute */ + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int read_data2[ATTR2_DIM1][ATTR2_DIM2]={{0}}; /* Buffer for reading 2nd attribute */ int i,j; herr_t ret; /* Generic return value */ @@ -224,7 +224,7 @@ test_attr_basic_read(void) CHECK(attr, FAIL, "H5Aopen_name"); /* Read attribute information */ - ret=H5Aread(attr,H5T_NATIVE_INT32,read_data1); + ret=H5Aread(attr,H5T_NATIVE_INT,read_data1); CHECK(ret, FAIL, "H5Aread"); /* Verify values read in */ @@ -253,7 +253,7 @@ test_attr_basic_read(void) CHECK(attr, FAIL, "H5Aopen_name"); /* Read attribute information */ - ret=H5Aread(attr,H5T_NATIVE_INT32,read_data2); + ret=H5Aread(attr,H5T_NATIVE_INT,read_data2); CHECK(ret, FAIL, "H5Aread"); /* Verify values read in */ @@ -307,7 +307,7 @@ test_attr_compound_write(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UINT8,sid1,H5P_DEFAULT); + dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); /* Close dataset's dataspace */ ret = H5Sclose(sid1); @@ -317,7 +317,7 @@ test_attr_compound_write(void) tid1 = H5Tcreate (H5T_COMPOUND, sizeof(struct attr4_struct)); CHECK(tid1, FAIL, "H5Tcreate"); attr4_field1_off=HOFFSET(struct attr4_struct, i); - ret = H5Tinsert(tid1, ATTR4_FIELDNAME1, attr4_field1_off, H5T_NATIVE_INT32); + ret = H5Tinsert(tid1, ATTR4_FIELDNAME1, attr4_field1_off, H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); attr4_field2_off=HOFFSET(struct attr4_struct, d); ret = H5Tinsert(tid1, ATTR4_FIELDNAME2, attr4_field2_off, H5T_NATIVE_DOUBLE); @@ -414,7 +414,7 @@ test_attr_compound_read(void) CHECK(space, FAIL, "H5Aget_space"); rank=H5Sget_ndims(space); VERIFY(rank, ATTR4_RANK, "H5Sget_ndims"); - ret=H5Sget_dims(space,dims); + ret=H5Sget_dims(space,dims, NULL); CHECK(ret, FAIL, "H5Sget_dims"); if(dims[0]!=ATTR4_DIM1) { printf("attribute dimensions different: dims[0]=%d, should be %d\n",(int)dims[0],ATTR4_DIM1); @@ -456,9 +456,9 @@ test_attr_compound_read(void) class=H5Tget_class(field); VERIFY(class, H5T_INTEGER, "H5Tget_class"); order=H5Tget_order(field); - VERIFY(order, H5Tget_order(H5T_NATIVE_INT32), "H5Tget_order"); + VERIFY(order, H5Tget_order(H5T_NATIVE_INT), "H5Tget_order"); size=H5Tget_size(field); - VERIFY(size, H5Tget_size(H5T_NATIVE_INT32), "H5Tget_size"); + VERIFY(size, H5Tget_size(H5T_NATIVE_INT), "H5Tget_size"); H5Tclose(field); field=H5Tget_member_type(type,1); CHECK(field, FAIL, "H5Tget_member_type"); @@ -545,7 +545,7 @@ test_attr_scalar_write(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UINT8,sid1,H5P_DEFAULT); + dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); /* Create dataspace for attribute */ sid2 = H5Screate_simple(ATTR5_RANK, NULL, NULL); @@ -662,7 +662,7 @@ test_attr_mult_write(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UINT8,sid1,H5P_DEFAULT); + dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT); /* Close dataset's dataspace */ ret = H5Sclose(sid1); @@ -673,15 +673,15 @@ test_attr_mult_write(void) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create 1st attribute for the dataset */ - attr=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT32,sid2,H5P_DEFAULT); + attr=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate"); /* Try to create the same attribute again (should fail) */ - ret=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT32,sid2,H5P_DEFAULT); + ret=H5Acreate(dataset,ATTR1_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate"); /* Write 1st attribute data */ - ret=H5Awrite(attr,H5T_NATIVE_INT32,attr_data1); + ret=H5Awrite(attr,H5T_NATIVE_INT,attr_data1); CHECK(ret, FAIL, "H5Awrite"); /* Close 1st attribute */ @@ -697,15 +697,15 @@ test_attr_mult_write(void) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create 2nd attribute for the dataset */ - attr=H5Acreate(dataset,ATTR2_NAME,H5T_NATIVE_INT32,sid2,H5P_DEFAULT); + attr=H5Acreate(dataset,ATTR2_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate"); /* Try to create the same attribute again (should fail) */ - ret=H5Acreate(dataset,ATTR2_NAME,H5T_NATIVE_INT32,sid2,H5P_DEFAULT); + ret=H5Acreate(dataset,ATTR2_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate"); /* Write 2nd attribute information */ - ret=H5Awrite(attr,H5T_NATIVE_INT32,attr_data2); + ret=H5Awrite(attr,H5T_NATIVE_INT,attr_data2); CHECK(ret, FAIL, "H5Awrite"); /* Close 2nd attribute */ @@ -769,8 +769,8 @@ test_attr_mult_read(void) H5T_class_t class; /* Attribute datatype class */ H5T_order_t order; /* Attribute datatype order */ size_t size; /* Attribute datatype size as stored in file */ - int32 read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int32 read_data2[ATTR2_DIM1][ATTR2_DIM2]={{0}}; /* Buffer for reading 2nd attribute */ + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int read_data2[ATTR2_DIM1][ATTR2_DIM2]={{0}}; /* Buffer for reading 2nd attribute */ double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{0}}}; /* Buffer for reading 3rd attribute */ int i,j,k; size_t name_len; /* Length of attribute name */ @@ -799,7 +799,7 @@ test_attr_mult_read(void) CHECK(space, FAIL, "H5Aget_space"); rank=H5Sget_ndims(space); VERIFY(rank, ATTR1_RANK, "H5Sget_ndims"); - ret=H5Sget_dims(space,dims); + ret=H5Sget_dims(space,dims, NULL); CHECK(ret, FAIL, "H5Sget_dims"); if(dims[0]!=ATTR1_DIM1) { printf("attribute dimensions different: dims[0]=%d, should be %d\n",(int)dims[0],ATTR1_DIM1); @@ -813,13 +813,13 @@ test_attr_mult_read(void) class=H5Tget_class(type); VERIFY(class, H5T_INTEGER, "H5Tget_class"); order=H5Tget_order(type); - VERIFY(order, H5Tget_order(H5T_NATIVE_INT32), "H5Tget_order"); + VERIFY(order, H5Tget_order(H5T_NATIVE_INT), "H5Tget_order"); size=H5Tget_size(type); - VERIFY(size, H5Tget_size(H5T_NATIVE_INT32), "H5Tget_size"); + VERIFY(size, H5Tget_size(H5T_NATIVE_INT), "H5Tget_size"); H5Tclose(type); /* Read attribute information */ - ret=H5Aread(attr,H5T_NATIVE_INT32,read_data1); + ret=H5Aread(attr,H5T_NATIVE_INT,read_data1); CHECK(ret, FAIL, "H5Aread"); /* Verify values read in */ @@ -860,7 +860,7 @@ test_attr_mult_read(void) CHECK(space, FAIL, "H5Aget_space"); rank=H5Sget_ndims(space); VERIFY(rank, ATTR2_RANK, "H5Sget_ndims"); - ret=H5Sget_dims(space,dims); + ret=H5Sget_dims(space,dims, NULL); CHECK(ret, FAIL, "H5Sget_dims"); if(dims[0]!=ATTR2_DIM1) { printf("attribute dimensions different: dims[0]=%d, should be %d\n",(int)dims[0],ATTR2_DIM1); @@ -878,13 +878,13 @@ test_attr_mult_read(void) class=H5Tget_class(type); VERIFY(class, H5T_INTEGER, "H5Tget_class"); order=H5Tget_order(type); - VERIFY(order, H5Tget_order(H5T_NATIVE_INT32), "H5Tget_order"); + VERIFY(order, H5Tget_order(H5T_NATIVE_INT), "H5Tget_order"); size=H5Tget_size(type); - VERIFY(size, H5Tget_size(H5T_NATIVE_INT32), "H5Tget_size"); + VERIFY(size, H5Tget_size(H5T_NATIVE_INT), "H5Tget_size"); H5Tclose(type); /* Read attribute information */ - ret=H5Aread(attr,H5T_NATIVE_INT32,read_data2); + ret=H5Aread(attr,H5T_NATIVE_INT,read_data2); CHECK(ret, FAIL, "H5Aread"); /* Verify values read in */ @@ -926,7 +926,7 @@ test_attr_mult_read(void) CHECK(space, FAIL, "H5Aget_space"); rank=H5Sget_ndims(space); VERIFY(rank, ATTR3_RANK, "H5Sget_ndims"); - ret=H5Sget_dims(space,dims); + ret=H5Sget_dims(space,dims, NULL); CHECK(ret, FAIL, "H5Sget_dims"); if(dims[0]!=ATTR3_DIM1) { printf("attribute dimensions different: dims[0]=%d, should be %d\n",(int)dims[0],ATTR3_DIM1); diff --git a/test/th5s.c b/test/th5s.c index 8527652..3ac55db 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -51,7 +51,7 @@ static char RcsId[] = "$Revision$"; /* Scalar dataset with simple datatype */ #define SPACE3_NAME "Scalar1" #define SPACE3_RANK 0 -uint32 space3_data=65; +unsigned space3_data=65; /* Scalar dataset with compound datatype */ #define SPACE4_NAME "Scalar2" @@ -66,7 +66,7 @@ size_t space4_field3_off=0; size_t space4_field4_off=0; struct space4_struct { char c1; - uint32 u; + unsigned u; float f; char c2; } space4_data={'v',987123,-3.14,'g'}; /* Test data for 4th dataspace */ @@ -81,7 +81,7 @@ test_h5s_basic(void) { hid_t fid1; /* HDF5 File IDs */ hid_t sid1, sid2; /* Dataspace ID */ - uint32 rank; /* Logical rank of dataspace */ + unsigned rank; /* Logical rank of dataspace */ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, SPACE2_DIM4}; @@ -107,24 +107,27 @@ test_h5s_basic(void) CHECK(rank, UFAIL, "H5Sget_lrank"); VERIFY(rank, SPACE1_RANK, "H5Sget_lrank"); - ret = H5Sget_dims(sid1, tdims); + ret = H5Sget_dims(sid1, tdims, NULL); CHECK(ret, FAIL, "H5Sget_ldims"); - VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(uint32)), 0, "H5Sget_ldims"); + VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0, + "H5Sget_ldims"); sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL); CHECK(sid2, FAIL, "H5Screate_simple"); n = H5Sget_npoints(sid2); CHECK(n, UFAIL, "H5Snelem"); - VERIFY(n, SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4, "H5Snelem"); + VERIFY(n, SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4, + "H5Snelem"); rank = H5Sget_ndims(sid2); CHECK(rank, UFAIL, "H5Sget_lrank"); VERIFY(rank, SPACE2_RANK, "H5Sget_lrank"); - ret = H5Sget_dims(sid2, tdims); + ret = H5Sget_dims(sid2, tdims, NULL); CHECK(ret, FAIL, "H5Sget_ldims"); - VERIFY(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(uint32)), 0, "H5Sget_ldims"); + VERIFY(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0, + "H5Sget_ldims"); ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); @@ -148,7 +151,7 @@ test_h5s_scalar_write(void) hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1; /* Dataspace ID */ - uint32 rank; /* Logical rank of dataspace */ + unsigned rank; /* Logical rank of dataspace */ hsize_t tdims[4]; /* Dimension array to test with */ size_t n; /* Number of dataspace elements */ herr_t ret; /* Generic return value */ @@ -172,14 +175,14 @@ test_h5s_scalar_write(void) CHECK(rank, UFAIL, "H5Sget_lrank"); VERIFY(rank, SPACE3_RANK, "H5Sget_lrank"); - ret = H5Sget_dims(sid1, tdims); + ret = H5Sget_dims(sid1, tdims, NULL); VERIFY(ret, 0, "H5Sget_dims"); /* Create a dataset */ - dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UINT32,sid1,H5P_DEFAULT); + dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UINT,sid1,H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate"); - ret = H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, &space3_data); + ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &space3_data); CHECK(ret, FAIL, "H5Dwrite"); /* Close Dataset */ @@ -205,11 +208,11 @@ test_h5s_scalar_read(void) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - uint32 rank; /* Logical rank of dataspace */ + hid_t sid1; /* Dataspace ID */ + unsigned rank; /* Logical rank of dataspace */ hsize_t tdims[4]; /* Dimension array to test with */ size_t n; /* Number of dataspace elements */ - uint32 rdata; /* Scalar data read in */ + unsigned rdata; /* Scalar data read in */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -234,10 +237,10 @@ test_h5s_scalar_read(void) CHECK(rank, UFAIL, "H5Sget_lrank"); VERIFY(rank, SPACE3_RANK, "H5Sget_lrank"); - ret = H5Sget_dims(sid1, tdims); + ret = H5Sget_dims(sid1, tdims, NULL); VERIFY(ret, 0, "H5Sget_dims"); - ret = H5Dread(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata); + ret = H5Dread(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata); CHECK(ret, FAIL, "H5Dread"); VERIFY(rdata, space3_data, "H5Dread"); @@ -265,9 +268,9 @@ test_h5s_compound_scalar_write(void) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ - hid_t tid1; /* Attribute datatype ID */ - hid_t sid1; /* Dataspace ID */ - uint32 rank; /* Logical rank of dataspace */ + hid_t tid1; /* Attribute datatype ID */ + hid_t sid1; /* Dataspace ID */ + unsigned rank; /* Logical rank of dataspace */ hsize_t tdims[4]; /* Dimension array to test with */ size_t n; /* Number of dataspace elements */ herr_t ret; /* Generic return value */ @@ -283,16 +286,20 @@ test_h5s_compound_scalar_write(void) tid1 = H5Tcreate (H5T_COMPOUND, sizeof(struct space4_struct)); CHECK(tid1, FAIL, "H5Tcreate"); space4_field1_off=HOFFSET(struct space4_struct, c1); - ret = H5Tinsert(tid1, SPACE4_FIELDNAME1, space4_field1_off, H5T_NATIVE_CHAR); + ret = H5Tinsert(tid1, SPACE4_FIELDNAME1, space4_field1_off, + H5T_NATIVE_CHAR); CHECK(ret, FAIL, "H5Tinsert"); space4_field2_off=HOFFSET(struct space4_struct, u); - ret = H5Tinsert(tid1, SPACE4_FIELDNAME2, space4_field2_off, H5T_NATIVE_UINT32); + ret = H5Tinsert(tid1, SPACE4_FIELDNAME2, space4_field2_off, + H5T_NATIVE_UINT); CHECK(ret, FAIL, "H5Tinsert"); space4_field3_off=HOFFSET(struct space4_struct, f); - ret = H5Tinsert(tid1, SPACE4_FIELDNAME3, space4_field3_off, H5T_NATIVE_FLOAT); + ret = H5Tinsert(tid1, SPACE4_FIELDNAME3, space4_field3_off, + H5T_NATIVE_FLOAT); CHECK(ret, FAIL, "H5Tinsert"); space4_field4_off=HOFFSET(struct space4_struct, c2); - ret = H5Tinsert(tid1, SPACE4_FIELDNAME4, space4_field4_off, H5T_NATIVE_CHAR); + ret = H5Tinsert(tid1, SPACE4_FIELDNAME4, space4_field4_off, + H5T_NATIVE_CHAR); CHECK(ret, FAIL, "H5Tinsert"); /* Create scalar dataspace */ @@ -307,7 +314,7 @@ test_h5s_compound_scalar_write(void) CHECK(rank, UFAIL, "H5Sget_lrank"); VERIFY(rank, SPACE3_RANK, "H5Sget_lrank"); - ret = H5Sget_dims(sid1, tdims); + ret = H5Sget_dims(sid1, tdims, NULL); VERIFY(ret, 0, "H5Sget_dims"); /* Create a dataset */ @@ -341,12 +348,12 @@ test_h5s_compound_scalar_read(void) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t type; /* Datatype */ - uint32 rank; /* Logical rank of dataspace */ + hid_t sid1; /* Dataspace ID */ + hid_t type; /* Datatype */ + unsigned rank; /* Logical rank of dataspace */ hsize_t tdims[4]; /* Dimension array to test with */ size_t n; /* Number of dataspace elements */ - struct space4_struct rdata; /* Scalar data read in */ + struct space4_struct rdata; /* Scalar data read in */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -371,7 +378,7 @@ test_h5s_compound_scalar_read(void) CHECK(rank, UFAIL, "H5Sget_lrank"); VERIFY(rank, SPACE3_RANK, "H5Sget_lrank"); - ret = H5Sget_dims(sid1, tdims); + ret = H5Sget_dims(sid1, tdims, NULL); VERIFY(ret, 0, "H5Sget_dims"); type=H5Dget_type(dataset); |