From d3ee3988b68292524b3a893b9db55c074f4b9e87 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 8 Oct 2007 10:26:02 -0500 Subject: [svn-r14192] Description: Deprecate H5Dextend in favor of H5Dset_extent (without using API versioning, due to changed behavior) and switch internal usage to H5Dset_extent Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode --- c++/src/H5DataSet.cpp | 8 +- examples/h5_extend_write.c | 12 +- fortran/src/H5Df.c | 29 +- hl/src/H5TB.c | 16 +- src/H5D.c | 69 +-- src/H5Ddeprec.c | 6 + src/H5Dpublic.h | 16 + src/H5S.c | 130 ++--- src/H5Sprivate.h | 4 +- test/dsets.c | 1306 ++++++++++++++++++++++---------------------- test/extend.c | 236 +++++--- test/external.c | 207 +++---- test/fillval.c | 4 +- test/objcopy.c | 2 +- test/testmeta.c | 15 +- test/tmisc.c | 56 +- test/tselect.c | 52 +- test/tsohm.c | 24 +- test/tvltypes.c | 23 +- testpar/t_chunk_alloc.c | 2 +- testpar/t_dset.c | 34 +- 21 files changed, 1182 insertions(+), 1069 deletions(-) diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 4d3050c..9858e7d 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -405,11 +405,9 @@ int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& spa //-------------------------------------------------------------------------- void DataSet::extend( const hsize_t* size ) const { - herr_t ret_value = H5Dextend( id, size ); - if( ret_value < 0 ) // raise exception when H5Dextend returns a neg value - { - throw DataSetIException("DataSet::extend", "H5Dextend failed"); - } + herr_t ret_value = H5Dset_extent( id, size ); + if( ret_value < 0 ) // raise exception when H5Dset_extent returns a neg value + throw DataSetIException("DataSet::extend", "H5Dset_extent failed"); } //-------------------------------------------------------------------------- diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c index 4e605e0..b54cc66 100644 --- a/examples/h5_extend_write.c +++ b/examples/h5_extend_write.c @@ -89,12 +89,12 @@ main (void) */ size[0] = 3; size[1] = 3; - status = H5Dextend (dataset, size); + status = H5Dset_extent(dataset, size); /* * Select a hyperslab. */ - filespace = H5Dget_space (dataset); + filespace = H5Dget_space(dataset); offset[0] = 0; offset[1] = 0; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, @@ -112,12 +112,12 @@ main (void) dims[0] = dims1[0] + dims2[0]; size[0] = dims[0]; size[1] = dims[1]; - status = H5Dextend (dataset, size); + status = H5Dset_extent(dataset, size); /* * Select a hyperslab. */ - filespace = H5Dget_space (dataset); + filespace = H5Dget_space(dataset); offset[0] = 3; offset[1] = 0; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, @@ -140,12 +140,12 @@ main (void) dims[1] = dims1[1] + dims3[1]; size[0] = dims[0]; size[1] = dims[1]; - status = H5Dextend (dataset, size); + status = H5Dset_extent(dataset, size); /* * Select a hyperslab */ - filespace = H5Dget_space (dataset); + filespace = H5Dget_space(dataset); offset[0] = 0; offset[1] = 3; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index b2d9a61..082bed5 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -1273,7 +1273,7 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) /*---------------------------------------------------------------------------- * Name: h5dextend_c - * Purpose: Call H5Dextend to extend dataset with unlimited dimensions + * Purpose: Call H5Dset_extent to extend dataset with unlimited dimensions * Inputs: dset_id - identifier of the dataset * Outputs: dims - array with the dimension sizes * Returns: 0 on success, -1 on failure @@ -1285,34 +1285,27 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) int_f nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) { - int ret_value = -1; - hsize_t *c_dims; - int status; + hid_t c_space_id; + hsize_t c_dims[H5S_MAX_RANK]; int rank; int i; - hid_t c_dset_id; - hid_t c_space_id; - - c_dset_id = (hid_t)*dset_id; - c_space_id = H5Dget_space(c_dset_id); - if (c_space_id < 0) return ret_value; + int status; + int ret_value = -1; - rank = H5Sget_simple_extent_ndims(c_space_id); - if (rank < 0) return ret_value; + if((c_space_id = H5Dget_space((hid_t)*dset_id)) < 0) return ret_value; - c_dims = malloc(sizeof(hsize_t)*rank); - if (!c_dims) return ret_value; + if((rank = H5Sget_simple_extent_ndims(c_space_id)) < 0) return ret_value; /* * Reverse dimensions due to C-FORTRAN storage order. */ - for (i=0; i < rank; i++) + for(i = 0; i < rank; i++) c_dims[i] = dims[rank - i - 1]; - status = H5Dextend(c_dset_id, c_dims); + status = H5Dset_extent((hid_t)*dset_id, c_dims); - if ( status >= 0 ) ret_value = 0; - HDfree(c_dims); + if(status >= 0) + ret_value = 0; return ret_value; } diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 3221cb4..9193bbd 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -1550,7 +1550,7 @@ herr_t H5TBinsert_record( hid_t loc_id, goto out; read_nrecords = ntotal_records - start; - tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, type_size ); + tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, type_size); /* Read the records after the inserted one(s) */ if(H5TBread_records( loc_id, dset_name, start, read_nrecords, type_size, field_offset, @@ -1560,7 +1560,7 @@ herr_t H5TBinsert_record( hid_t loc_id, /* Extend the dataset */ dims[0] = ntotal_records + nrecords; - if(H5Dextend ( did, dims ) < 0) + if(H5Dset_extent(did, dims) < 0) goto out; /*------------------------------------------------------------------------- @@ -1569,8 +1569,8 @@ herr_t H5TBinsert_record( hid_t loc_id, */ /* Create a simple memory data space */ - mem_dims[0]=nrecords; - if((mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0) + mem_dims[0] = nrecords; + if((mem_space_id = H5Screate_simple(1, mem_dims, NULL)) < 0) return -1; /* Get the file data space */ @@ -3691,16 +3691,16 @@ herr_t H5TB_common_append_records( hid_t dataset_id, /* Extend the dataset */ dims[0] = nrecords + orig_table_size; - if(H5Dextend ( dataset_id, dims ) < 0) + if(H5Dset_extent(dataset_id, dims) < 0) goto out; /* Create a simple memory data space */ - mem_dims[0]=nrecords; - if((mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0) + mem_dims[0] = nrecords; + if((mem_space_id = H5Screate_simple(1, mem_dims, NULL)) < 0) goto out; /* Get a copy of the new file data space for writing */ - if((space_id = H5Dget_space( dataset_id )) < 0) + if((space_id = H5Dget_space(dataset_id)) < 0) goto out; /* Define a hyperslab in the dataset */ diff --git a/src/H5D.c b/src/H5D.c index a6b9a52..5133651 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -3077,8 +3077,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Dset_extent * - * Purpose: Modifies the dimensions of a dataset, based on H5Dextend. - * Can change to a lower dimension. + * Purpose: Modifies the dimensions of a dataset. + * Can change to a smaller dimension. * * Return: Non-negative on success, negative on failure * @@ -3130,10 +3130,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) H5S_t *space; /* Dataset's dataspace */ int rank; /* Dataspace # of dimensions */ hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Current dimension sizes */ - hbool_t shrink = FALSE; /* Flag to indicate a dimension has shrank */ - hbool_t expand = FALSE; /* Flag to indicate a dimension has grown */ htri_t changed; /* Whether the dataspace changed size */ - unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5D_set_extent, FAIL) @@ -3142,40 +3139,44 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) HDassert(dset); HDassert(size); - /*------------------------------------------------------------------------- - * Get the data space - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Get the data space + *------------------------------------------------------------------------- + */ space = dset->shared->space; - /*------------------------------------------------------------------------- - * Check if we are shrinking or expanding any of the dimensions - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Check if we are shrinking or expanding any of the dimensions + *------------------------------------------------------------------------- + */ if((rank = H5S_get_simple_extent_dims(space, curr_dims, NULL)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") - /* Determine if we are shrinking and/or expanding any dimensions */ - for(u = 0; u < (unsigned)rank; u++) { - if(size[u] < curr_dims[u]) - shrink = TRUE; - if(size[u] > curr_dims[u]) - expand = TRUE; - } /* end for */ - - /*------------------------------------------------------------------------- - * Modify the size of the data space - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Modify the size of the data space + *------------------------------------------------------------------------- + */ if((changed = H5S_set_extent(space, size)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space") /* Don't bother updating things, unless they've changed */ if(changed) { - /*------------------------------------------------------------------------- - * Modify the dataset storage - *------------------------------------------------------------------------- - */ + hbool_t shrink = FALSE; /* Flag to indicate a dimension has shrank */ + hbool_t expand = FALSE; /* Flag to indicate a dimension has grown */ + unsigned u; /* Local index variable */ + + /* Determine if we are shrinking and/or expanding any dimensions */ + for(u = 0; u < (unsigned)rank; u++) { + if(size[u] < curr_dims[u]) + shrink = TRUE; + if(size[u] > curr_dims[u]) + expand = TRUE; + } /* end for */ + + /*------------------------------------------------------------------------- + * Modify the dataset storage + *------------------------------------------------------------------------- + */ /* Save the new dataspace in the file if necessary */ if(H5S_write(&(dset->oloc), space, TRUE, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace") @@ -3191,11 +3192,11 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset storage") - /*------------------------------------------------------------------------- - * Remove chunk information in the case of chunked datasets - * This removal takes place only in case we are shrinking the dateset - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Remove chunk information in the case of chunked datasets + * This removal takes place only in case we are shrinking the dateset + *------------------------------------------------------------------------- + */ if(shrink && H5D_CHUNKED == dset->shared->layout.type) { H5D_io_info_t io_info; /* Dataset I/O info */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index fcb67e4..3d58557 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -65,7 +65,9 @@ /* Local Prototypes */ /********************/ +#ifndef H5_NO_DEPRECATED_SYMBOLS static herr_t H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /*********************/ @@ -256,6 +258,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Dopen() */ +#ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- * Function: H5Dextend @@ -264,6 +267,8 @@ done: * SIZE. The dimensionality of SIZE is the same as the data * space of the dataset being changed. * + * Note: Deprecated in favor of H5Dset_extent + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -377,4 +382,5 @@ H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_extend() */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 3ddba7c..bbd74a6 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -124,8 +124,24 @@ H5_DLL herr_t H5Ddebug(hid_t dset_id); H5_DLL hid_t H5Dcreate(hid_t file_id, const char *name, hid_t type_id, hid_t space_id, hid_t plist_id); H5_DLL hid_t H5Dopen(hid_t file_id, const char *name); + +/* Symbols defined for compatibility with previous versions of the HDF5 API. + * + * Use of these symbols is deprecated. + */ +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/* Macros */ + + +/* Typedefs */ + + +/* Function prototypes */ H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t *size); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + #ifdef __cplusplus } #endif diff --git a/src/H5S.c b/src/H5S.c index 45069c1..f990925 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1499,70 +1499,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5S_extend - * - * Purpose: Extend the dimensions of a data space. - * - * Return: Success: Number of dimensions whose size increased. - * - * Failure: Negative - * - * Programmer: Robb Matzke - * Friday, January 30, 1998 - * - *------------------------------------------------------------------------- - */ -int -H5S_extend(H5S_t *space, const hsize_t *size) -{ - unsigned u; - int ret_value = 0; - - FUNC_ENTER_NOAPI(H5S_extend, FAIL) - - /* Check args */ - HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); - HDassert(size); - - /* Check through all the dimensions to see if modifying the dataspace is allowed */ - for(u = 0; u < space->extent.rank; u++) { - if(space->extent.size[u]extent.max && H5S_UNLIMITED!=space->extent.max[u] && - space->extent.max[u]extent.rank; u++) { - if(space->extent.size[u] < size[u]) - space->extent.size[u] = size[u]; - - nelem *= space->extent.size[u]; - } /* end for */ - space->extent.nelem = nelem; - - /* If the selection is 'all', update the number of elements selected */ - if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL) - if(H5S_select_all(space, FALSE) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") - - /* Mark the dataspace as no longer shared if it was before */ - if(H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_extend() */ - - -/*------------------------------------------------------------------------- * Function: H5Screate_simple * * Purpose: Creates a new simple data space object and opens it for @@ -2355,3 +2291,69 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_set_latest_version() */ +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/*------------------------------------------------------------------------- + * Function: H5S_extend + * + * Purpose: Extend the dimensions of a data space. + * + * Return: Success: Number of dimensions whose size increased. + * + * Failure: Negative + * + * Programmer: Robb Matzke + * Friday, January 30, 1998 + * + *------------------------------------------------------------------------- + */ +int +H5S_extend(H5S_t *space, const hsize_t *size) +{ + unsigned u; + int ret_value = 0; + + FUNC_ENTER_NOAPI(H5S_extend, FAIL) + + /* Check args */ + HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); + HDassert(size); + + /* Check through all the dimensions to see if modifying the dataspace is allowed */ + for(u = 0; u < space->extent.rank; u++) { + if(space->extent.size[u]extent.max && H5S_UNLIMITED!=space->extent.max[u] && + space->extent.max[u]extent.rank; u++) { + if(space->extent.size[u] < size[u]) + space->extent.size[u] = size[u]; + + nelem *= space->extent.size[u]; + } /* end for */ + space->extent.nelem = nelem; + + /* If the selection is 'all', update the number of elements selected */ + if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL) + if(H5S_select_all(space, FALSE) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") + + /* Mark the dataspace as no longer shared if it was before */ + if(H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5S_extend() */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 69624c3..c6f2ce5 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -208,7 +208,6 @@ H5_DLL herr_t H5S_write(struct H5O_loc_t *loc, const H5S_t *space, H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds); H5_DLL H5S_t *H5S_read(const struct H5O_loc_t *loc, hid_t dxpl_id); -H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size); H5_DLL int H5S_set_extent(H5S_t *space, const hsize_t *size); H5_DLL herr_t H5S_set_extent_real(H5S_t *space, const hsize_t *size); H5_DLL H5S_t *H5S_create(H5S_class_t type); @@ -217,6 +216,9 @@ H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], H5_DLL herr_t H5S_set_latest_version(H5S_t *ds); H5_DLL herr_t H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, int fwidth); +#ifndef H5_NO_DEPRECATED_SYMBOLS +H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ H5_DLL hsize_t H5S_extent_nelem(const H5S_extent_t *ext); diff --git a/test/dsets.c b/test/dsets.c index 6469a5e..cf1f650 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -234,7 +234,7 @@ test_create(hid_t file) * existing datasets are accessed. */ if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) goto error; - if ((dataset = H5Dopen(file, DSET_DEFAULT_NAME))<0) goto error; + if ((dataset = H5Dopen(file, DSET_DEFAULT_NAME)) < 0) goto error; if (H5Dclose(dataset) < 0) goto error; /* @@ -354,29 +354,29 @@ test_simple_io(hid_t fapl) for (j = 0; j < DSET_DIM2; j++) points[i][j] = n++; - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; /* Create the data space */ dims[0] = DSET_DIM1; dims[1] = DSET_DIM2; - if ((space = H5Screate_simple(2, dims, NULL))<0) goto error; + if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error; /* Create a small conversion buffer to test strip mining */ tconv_buf = HDmalloc((size_t)1000); xfer = H5Pcreate (H5P_DATASET_XFER); assert (xfer>=0); - if (H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL)<0) goto error; + if (H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space, - H5P_DEFAULT))<0) goto error; + H5P_DEFAULT)) < 0) goto error; /* Test dataset address. Should be undefined. */ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error; /* Write the data to the dataset */ - if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points)<0) + if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points) < 0) goto error; /* Test dataset address in file. Open the same file as a C file, seek @@ -385,7 +385,7 @@ test_simple_io(hid_t fapl) if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error; /* Read the dataset back */ - if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check)<0) + if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check) < 0) goto error; /* Check that the values read are the same as the values written */ @@ -400,9 +400,9 @@ test_simple_io(hid_t fapl) } } - if(H5Pclose (xfer)<0) goto error; - if(H5Dclose(dataset)<0) goto error; - if(H5Fclose(file)<0) goto error; + if(H5Pclose (xfer) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; + if(H5Fclose(file) < 0) goto error; f = HDopen(filename, O_RDONLY, 0); HDlseek(f, (off_t)offset, SEEK_SET); @@ -462,23 +462,23 @@ test_userblock_offset(hid_t fapl) h5_fixname(FILENAME[2], fapl, filename, sizeof filename); - if((fcpl=H5Pcreate(H5P_FILE_CREATE))<0) goto error; - if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK)<0) goto error; + if((fcpl=H5Pcreate(H5P_FILE_CREATE)) < 0) goto error; + if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK) < 0) goto error; - if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl))<0) + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) goto error; /* Create the data space */ dims[0] = DSET_DIM1; dims[1] = DSET_DIM2; - if ((space = H5Screate_simple(2, dims, NULL))<0) goto error; + if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_USERBLOCK_IO_NAME, H5T_NATIVE_INT, space, - H5P_DEFAULT))<0) goto error; + H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ - if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0) + if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) goto error; /* Test dataset address in file. Open the same file as a C file, seek @@ -486,8 +486,8 @@ test_userblock_offset(hid_t fapl) * compare it with the data written in.*/ if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error; - if(H5Dclose(dataset)<0) goto error; - if(H5Fclose(file)<0) goto error; + if(H5Dclose(dataset) < 0) goto error; + if(H5Fclose(file) < 0) goto error; f = HDopen(filename, O_RDONLY, 0); HDlseek(f, (off_t)offset, SEEK_SET); @@ -558,7 +558,7 @@ test_compact_io(hid_t fapl) /* Create a file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create property list for compact dataset creation */ @@ -567,13 +567,13 @@ test_compact_io(hid_t fapl) if(H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR /* Create and write to a compact dataset */ - if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, plist))<0) + if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, plist)) < 0) TEST_ERROR /* Test dataset address. Should be undefined. */ if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR - if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf)<0) + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR /* Test dataset address. Should be undefined. */ @@ -588,11 +588,11 @@ test_compact_io(hid_t fapl) /* * Open the file and check data */ - if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) + if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR - if((dataset = H5Dopen(file, DSET_COMPACT_IO_NAME))<0) + if((dataset = H5Dopen(file, DSET_COMPACT_IO_NAME)) < 0) TEST_ERROR - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf)<0) + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) TEST_ERROR /* Check that the values read are the same as the values written */ @@ -668,7 +668,7 @@ test_max_compact(hid_t fapl) /* Create a file */ h5_fixname(FILENAME[3], fapl, filename, sizeof filename); - if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; /* Create property list for compact dataset creation */ @@ -679,10 +679,10 @@ test_max_compact(hid_t fapl) /* Create and write to a compact dataset */ if((dataset = H5Dcreate(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space, - plist))<0) + plist)) < 0) goto error; - if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf)<0) + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) goto error; /* Close file */ @@ -694,11 +694,11 @@ test_max_compact(hid_t fapl) /* * Open the file and check data */ - if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) + if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) goto error; - if((dataset = H5Dopen(file, DSET_COMPACT_MAX_NAME))<0) + if((dataset = H5Dopen(file, DSET_COMPACT_MAX_NAME)) < 0) goto error; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf)<0) + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) goto error; /* Check that the values read are the same as the values written */ @@ -726,7 +726,7 @@ test_max_compact(hid_t fapl) assert(space>=0); /* Open file */ - if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0) + if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) goto error; /* Create property list for compact dataset creation */ @@ -819,7 +819,7 @@ test_conv_buffer(hid_t fid) /* Create data space */ - if((space=H5Screate(H5S_SCALAR))<0) goto error; + if((space=H5Screate(H5S_SCALAR)) < 0) goto error; /* Add members to the compound data type */ dimsa[0] = DIM1; @@ -829,37 +829,37 @@ test_conv_buffer(hid_t fid) dimsc[0] = DIM3; /* Create the memory data type */ - if((ctype1 = H5Tcreate(H5T_COMPOUND, sizeof (CmpField)))<0) goto error; + if((ctype1 = H5Tcreate(H5T_COMPOUND, sizeof (CmpField))) < 0) goto error; if((arr_type1 = H5Tarray_create(H5T_NATIVE_INT, 3, dimsa, NULL)) < 0) goto error; if((arr_type2 = H5Tarray_create(H5T_NATIVE_FLOAT, 1, dimsb, NULL)) < 0) goto error; if((arr_type3 = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, dimsc, NULL)) < 0) goto error; - if(H5Tinsert(ctype1, "A", HOFFSET(CmpField, a), arr_type1)<0) goto error; - if(H5Tinsert (ctype1, "B", HOFFSET(CmpField, b), arr_type2)<0) goto error; - if(H5Tinsert (ctype1, "C", HOFFSET(CmpField, c), arr_type3)<0) goto error; + if(H5Tinsert(ctype1, "A", HOFFSET(CmpField, a), arr_type1) < 0) goto error; + if(H5Tinsert (ctype1, "B", HOFFSET(CmpField, b), arr_type2) < 0) goto error; + if(H5Tinsert (ctype1, "C", HOFFSET(CmpField, c), arr_type3) < 0) goto error; /* Create the dataset */ - if((dataset = H5Dcreate(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT))<0) goto error; - if(H5Dwrite(dataset, ctype1, H5S_ALL, H5S_ALL, H5P_DEFAULT, cf)<0) goto error; + if((dataset = H5Dcreate(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT)) < 0) goto error; + if(H5Dwrite(dataset, ctype1, H5S_ALL, H5S_ALL, H5P_DEFAULT, cf) < 0) goto error; - if((ctype2 = H5Tcreate(H5T_COMPOUND, sizeof (CmpFieldR)))<0) goto error; + if((ctype2 = H5Tcreate(H5T_COMPOUND, sizeof (CmpFieldR))) < 0) goto error; if((arr_type4 = H5Tarray_create(H5T_NATIVE_FLOAT, 1, dimsb, NULL)) < 0) goto error; if((arr_type5 = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, dimsc, NULL)) < 0) goto error; - if(H5Tinsert (ctype2, "B", HOFFSET(CmpFieldR, b), arr_type4)<0) goto error; - if(H5Tinsert (ctype2, "C", HOFFSET(CmpFieldR, c), arr_type5)<0) goto error; + if(H5Tinsert (ctype2, "B", HOFFSET(CmpFieldR, b), arr_type4) < 0) goto error; + if(H5Tinsert (ctype2, "C", HOFFSET(CmpFieldR, c), arr_type5) < 0) goto error; /* Read should succeed since library will set conversion buffer big enough */ cfrR = (CmpFieldR *)HDcalloc((size_t)1, sizeof(CmpFieldR)); - if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfrR)<0) goto error; + if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfrR) < 0) goto error; /* Read should fail since conversion buffer isn't big enough */ xfer_list = H5Pcreate (H5P_DATASET_XFER); size = (DIM2*DIM3*(sizeof(int))+ DIM2*(sizeof(float))+ DIM3*(sizeof(double))); - if(H5Pset_buffer (xfer_list, size, NULL, NULL)<0) goto error; + if(H5Pset_buffer (xfer_list, size, NULL, NULL) < 0) goto error; H5E_BEGIN_TRY { status = H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR); @@ -873,21 +873,21 @@ test_conv_buffer(hid_t fid) /* Read will succeed since conversion buffer is big enough */ size = (DIM1*DIM2*DIM3*(sizeof(int))+ DIM2*(sizeof(float))+ DIM3*(sizeof(double))); - if(H5Pset_buffer (xfer_list, size, NULL, NULL)<0) goto error; + if(H5Pset_buffer (xfer_list, size, NULL, NULL) < 0) goto error; - if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR)<0) goto error; + if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR) < 0) goto error; - if(H5Pclose(xfer_list)<0) goto error; - if(H5Sclose(space)<0) goto error; - if(H5Tclose(arr_type1)<0) goto error; - if(H5Tclose(arr_type2)<0) goto error; - if(H5Tclose(arr_type3)<0) goto error; - if(H5Tclose(ctype1)<0) goto error; - if(H5Tclose(ctype2)<0) goto error; - if(H5Tclose(arr_type4)<0) goto error; - if(H5Tclose(arr_type5)<0) goto error; - if(H5Dclose(dataset)<0) goto error; + if(H5Pclose(xfer_list) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Tclose(arr_type1) < 0) goto error; + if(H5Tclose(arr_type2) < 0) goto error; + if(H5Tclose(arr_type3) < 0) goto error; + if(H5Tclose(ctype1) < 0) goto error; + if(H5Tclose(ctype2) < 0) goto error; + if(H5Tclose(arr_type4) < 0) goto error; + if(H5Tclose(arr_type5) < 0) goto error; + if(H5Dclose(dataset) < 0) goto error; if(cf) HDfree(cf); @@ -942,18 +942,18 @@ test_tconv(hid_t file) /* Create the data space */ dims[0] = 1000000; - if ((space = H5Screate_simple (1, dims, NULL))<0) goto error; + if ((space = H5Screate_simple (1, dims, NULL)) < 0) goto error; /* Create the data set */ if ((dataset = H5Dcreate(file, DSET_TCONV_NAME, H5T_STD_I32LE, space, - H5P_DEFAULT))<0) goto error; + H5P_DEFAULT)) < 0) goto error; /* Write the data to the dataset */ if (H5Dwrite(dataset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, - out)<0) goto error; + out) < 0) goto error; /* Read data with byte order conversion */ - if (H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in)<0) + if (H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in) < 0) goto error; /* Check */ @@ -968,7 +968,7 @@ test_tconv(hid_t file) } } - if (H5Dclose(dataset)<0) goto error; + if (H5Dclose(dataset) < 0) goto error; free (out); free (in); puts(" PASSED"); @@ -1316,19 +1316,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, herr_t status; /* Error status */ /* Create the data space */ - if ((sid = H5Screate_simple(2, size, NULL))<0) goto error; + if ((sid = H5Screate_simple(2, size, NULL)) < 0) goto error; /* * Create a small conversion buffer to test strip mining. We * might as well test all we can! */ - if ((dxpl = H5Pcreate(H5P_DATASET_XFER))<0) goto error; + if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; tconv_buf = HDmalloc((size_t)1000); - if (H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL)<0) goto error; - if ((write_dxpl = H5Pcopy(dxpl))<0) TEST_ERROR; + if (H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error; + if ((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR; if (if_fletcher32==DISABLE_FLETCHER32) { - if(H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC)<0) + if(H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC) < 0) goto error; if(H5Z_DISABLE_EDC != H5Pget_edc_check(dxpl)) goto error; @@ -1345,7 +1345,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Create the dataset */ if ((dataset = H5Dcreate(fid, name, H5T_NATIVE_INT, sid, - dcpl))<0) goto error; + dcpl)) < 0) goto error; PASSED(); /*---------------------------------------------------------------------- @@ -1354,7 +1354,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, */ TESTING(" filters (uninitialized read)"); - if (H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) + if (H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) goto error; for (i=0; i<(size_t)size[0]; i++) { @@ -1383,7 +1383,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } } - if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points)<0) + if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) TEST_ERROR; if((*dset_size=H5Dget_storage_size(dataset))==0) TEST_ERROR; @@ -1406,19 +1406,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(status>=0) TEST_ERROR; /* Callback decides to continue inspite data is corrupted. */ - if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) + if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR; + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; /* Callback decides to fail when data is corrupted. */ - if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR; + if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check); } H5E_END_TRY; if(status>=0) TEST_ERROR; } else { - if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) + if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ @@ -1452,7 +1452,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, points[i][j] = (int)HDrandom (); } } - if (H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points)<0) + if (H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) TEST_ERROR; if(corrupted) { @@ -1464,12 +1464,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(status>=0) TEST_ERROR; /* Callback decides to continue inspite data is corrupted. */ - if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) + if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR; + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; /* Callback decides to fail when data is corrupted. */ - if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR; + if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check); @@ -1477,7 +1477,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(status>=0) TEST_ERROR; } else { /* Read the dataset back and check it */ - if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) + if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ @@ -1505,8 +1505,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, */ TESTING(" filters (re-open)"); - if (H5Dclose (dataset)<0) TEST_ERROR; - if ((dataset = H5Dopen (fid, name))<0) TEST_ERROR; + if (H5Dclose (dataset) < 0) TEST_ERROR; + if ((dataset = H5Dopen (fid, name)) < 0) TEST_ERROR; if(corrupted) { /* Default behavior is failure when data is corrupted. */ @@ -1517,19 +1517,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(status>=0) TEST_ERROR; /* Callback decides to continue inspite data is corrupted. */ - if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) + if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR; + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; /* Callback decides to fail when data is corrupted. */ - if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR; + if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check); } H5E_END_TRY; if(status>=0) TEST_ERROR; } else { - if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) + if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ @@ -1563,9 +1563,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } } if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size, - NULL)<0) TEST_ERROR; + NULL) < 0) TEST_ERROR; /* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */ - if (H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points)<0) + if (H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0) TEST_ERROR; if(corrupted) { @@ -1577,19 +1577,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(status>=0) TEST_ERROR; /* Callback decides to continue inspite data is corrupted. */ - if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) + if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR; + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; /* Callback decides to fail when data is corrupted. */ - if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR; + if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check); } H5E_END_TRY; if(status>=0) TEST_ERROR; } else { - if (H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check)<0) + if (H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ @@ -1617,9 +1617,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Get the storage size of the dataset */ if((*dset_size=H5Dget_storage_size(dataset))==0) goto error; /* Clean up objects used for this test */ - if (H5Dclose (dataset)<0) goto error; - if (H5Sclose (sid)<0) goto error; - if (H5Pclose (dxpl)<0) goto error; + if (H5Dclose (dataset) < 0) goto error; + if (H5Sclose (sid) < 0) goto error; + if (H5Pclose (dxpl) < 0) goto error; free (tconv_buf); return(0); @@ -1688,10 +1688,11 @@ test_filter_noencoder(const char *dset_name, hid_t fapl) /* Read the dataset and make sure the decoder is working correctly */ err = H5Dread(dset_id, H5T_NATIVE_INT, space_id, space_id, H5P_DEFAULT, read_buf); - if (err < 0) goto error; + if(err < 0) goto error; for(i = 0; i < 10; i++) - if ( read_buf[i] != i ) goto error; + if(read_buf[i] != i) + goto error; H5Sclose(space_id); @@ -1704,10 +1705,10 @@ test_filter_noencoder(const char *dset_name, hid_t fapl) TESTING(" trying to write without encoder"); dcpl_id = H5Dget_create_plist(dset_id); - if (dcpl_id < 0) goto error; + if(dcpl_id < 0) goto error; space_id = H5Screate_simple(1, &dims, NULL); - if (space_id < 0) goto error; + if(space_id < 0) goto error; H5E_BEGIN_TRY{ test_dset_id = H5Dcreate(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id , dcpl_id); @@ -1721,10 +1722,10 @@ test_filter_noencoder(const char *dset_name, hid_t fapl) */ dims = 20; /* Dataset is originally of size 10 */ H5E_BEGIN_TRY{ - err = H5Dextend(dset_id, &dims); + err = H5Dset_extent(dset_id, &dims); }H5E_END_TRY - if (err >= 0) goto error; + if(err >= 0) goto error; /* Attempt to write to the dataset. This should fail because * the filter does not have an encoder. @@ -1733,7 +1734,7 @@ test_filter_noencoder(const char *dset_name, hid_t fapl) err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints); }H5E_END_TRY - if (err >= 0) goto error; + if(err >= 0) goto error; H5Fclose(file_id); H5Dclose(dset_id); @@ -1907,15 +1908,15 @@ UNUSED *---------------------------------------------------------- */ puts("Testing 'null' filter"); - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; - if (H5Zregister (H5Z_BOGUS)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if (H5Zregister (H5Z_BOGUS) < 0) goto error; if(H5Pset_filter(dc, H5Z_FILTER_BOGUS, 0, (size_t)0, NULL) < 0) goto error; - if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size)<0) goto error; + if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc)<0) goto error; + if (H5Pclose (dc) < 0) goto error; /*---------------------------------------------------------- * STEP 1: Test Fletcher32 Checksum by itself. @@ -1923,12 +1924,12 @@ UNUSED */ #ifdef H5_HAVE_FILTER_FLETCHER32 puts("Testing Fletcher32 checksum(enabled for read)"); - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Pset_filter(dc, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL) < 0) goto error; /* Enable checksum during read */ - if(test_filter_internal(file,DSET_FLETCHER32_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size)<0) goto error; + if(test_filter_internal(file,DSET_FLETCHER32_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size) < 0) goto error; if(fletcher32_size<=null_size) { H5_FAILED(); puts(" Size after checksumming is incorrect."); @@ -1937,7 +1938,7 @@ UNUSED /* Disable checksum during read */ puts("Testing Fletcher32 checksum(disabled for read)"); - if(test_filter_internal(file,DSET_FLETCHER32_NAME_2,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size)<0) goto error; + if(test_filter_internal(file,DSET_FLETCHER32_NAME_2,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&fletcher32_size) < 0) goto error; if(fletcher32_size<=null_size) { H5_FAILED(); puts(" Size after checksumming is incorrect."); @@ -1952,9 +1953,9 @@ UNUSED /* Temporarily disable this test because the changes in chunk caching conflicts with * the way this test is conducted. -slu 2007/7/20 */ - if (H5Zregister (H5Z_CORRUPT)<0) goto error; + if (H5Zregister (H5Z_CORRUPT) < 0) goto error; if(H5Pset_filter(dc, H5Z_FILTER_CORRUPT, 0, (size_t)3, data_corrupt) < 0) goto error; - if(test_filter_internal(file,DSET_FLETCHER32_NAME_3,dc,DISABLE_FLETCHER32,DATA_CORRUPTED,&fletcher32_size)<0) goto error; + if(test_filter_internal(file,DSET_FLETCHER32_NAME_3,dc,DISABLE_FLETCHER32,DATA_CORRUPTED,&fletcher32_size) < 0) goto error; if(fletcher32_size<=null_size) { H5_FAILED(); puts(" Size after checksumming is incorrect."); @@ -1962,7 +1963,7 @@ UNUSED } /* end if */ /* Clean up objects used for this test */ - if (H5Pclose (dc)<0) goto error; + if (H5Pclose (dc) < 0) goto error; #else /* H5_HAVE_FILTER_FLETCHER32 */ TESTING("fletcher32 checksum"); @@ -1976,13 +1977,13 @@ UNUSED */ #ifdef H5_HAVE_FILTER_DEFLATE puts("Testing deflate filter"); - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; - if (H5Pset_deflate (dc, 6)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if (H5Pset_deflate (dc, 6) < 0) goto error; - if(test_filter_internal(file,DSET_DEFLATE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deflate_size)<0) goto error; + if(test_filter_internal(file,DSET_DEFLATE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deflate_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc)<0) goto error; + if (H5Pclose (dc) < 0) goto error; #else /* H5_HAVE_FILTER_DEFLATE */ TESTING("deflate filter"); SKIPPED(); @@ -1996,13 +1997,13 @@ UNUSED #ifdef H5_HAVE_FILTER_SZIP TESTING("szip filter (with encoder)"); if ( h5_szip_can_encode() == 1) { - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; puts(""); - if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error; - if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size)<0) goto error; - if (H5Pclose (dc)<0) goto error; + if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; + if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size) < 0) goto error; + if (H5Pclose (dc) < 0) goto error; } else { SKIPPED(); } @@ -2028,11 +2029,11 @@ UNUSED */ #ifdef H5_HAVE_FILTER_SHUFFLE puts("Testing shuffle filter"); - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; - if (H5Pset_shuffle (dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if (H5Pset_shuffle (dc) < 0) goto error; - if(test_filter_internal(file,DSET_SHUFFLE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&shuffle_size)<0) goto error; + if(test_filter_internal(file,DSET_SHUFFLE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&shuffle_size) < 0) goto error; if(shuffle_size!=null_size) { H5_FAILED(); puts(" Shuffled size not the same as uncompressed size."); @@ -2040,7 +2041,7 @@ UNUSED } /* end if */ /* Clean up objects used for this test */ - if (H5Pclose (dc)<0) goto error; + if (H5Pclose (dc) < 0) goto error; #else /* H5_HAVE_FILTER_SHUFFLE */ TESTING("shuffle filter"); SKIPPED(); @@ -2053,28 +2054,28 @@ UNUSED */ #if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 puts("Testing shuffle+deflate+checksum filters(checksum first)"); - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; - if (H5Pset_fletcher32 (dc)<0) goto error; - if (H5Pset_shuffle (dc)<0) goto error; - if (H5Pset_deflate (dc, 6)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if (H5Pset_fletcher32 (dc) < 0) goto error; + if (H5Pset_shuffle (dc) < 0) goto error; + if (H5Pset_deflate (dc, 6) < 0) goto error; - if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error; + if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc)<0) goto error; + if (H5Pclose (dc) < 0) goto error; puts("Testing shuffle+deflate+checksum filters(checksum last)"); - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; - if (H5Pset_shuffle (dc)<0) goto error; - if (H5Pset_deflate (dc, 6)<0) goto error; - if (H5Pset_fletcher32 (dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if (H5Pset_shuffle (dc) < 0) goto error; + if (H5Pset_deflate (dc, 6) < 0) goto error; + if (H5Pset_fletcher32 (dc) < 0) goto error; - if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error; + if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc)<0) goto error; + if (H5Pclose (dc) < 0) goto error; #else /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ TESTING("shuffle+deflate+fletcher32 filters"); SKIPPED(); @@ -2088,16 +2089,16 @@ UNUSED #if defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 TESTING("shuffle+szip+checksum filters(checksum first, with encoder)"); - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; - if (H5Pset_fletcher32 (dc)<0) goto error; - if (H5Pset_shuffle (dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if (H5Pset_fletcher32 (dc) < 0) goto error; + if (H5Pset_shuffle (dc) < 0) goto error; /* Make sure encoding is enabled */ if ( h5_szip_can_encode() == 1) { puts(""); - if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error; - if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error; + if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; + if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; } else { SKIPPED(); } @@ -2112,23 +2113,23 @@ UNUSED } /* Clean up objects used for this test */ - if (H5Pclose (dc)<0) goto error; + if (H5Pclose (dc) < 0) goto error; TESTING("shuffle+szip+checksum filters(checksum last, with encoder)"); /* Make sure encoding is enabled */ if ( h5_szip_can_encode() == 1) { puts(""); - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; - if (H5Pset_shuffle (dc)<0) goto error; - if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error; - if (H5Pset_fletcher32 (dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if (H5Pset_shuffle (dc) < 0) goto error; + if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error; + if (H5Pset_fletcher32 (dc) < 0) goto error; - if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error; + if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error; /* Clean up objects used for this test */ - if (H5Pclose (dc)<0) goto error; + if (H5Pclose (dc) < 0) goto error; } else { SKIPPED(); @@ -2186,7 +2187,7 @@ test_missing_filter(hid_t file) } /* end if */ /* Unregister deflate filter (use internal function) */ - if (H5Z_unregister(H5Z_FILTER_DEFLATE)<0) { + if (H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) { H5_FAILED(); printf(" Line %d: Can't unregister deflate filter\n",__LINE__); goto error; @@ -2200,17 +2201,17 @@ test_missing_filter(hid_t file) } /* end if */ /* Create dcpl with deflate filter */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) { + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { H5_FAILED(); printf(" Line %d: Can't create dcpl\n",__LINE__); goto error; } /* end if */ - if(H5Pset_chunk(dcpl, 2, chunk_dims)<0) { + if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) { H5_FAILED(); printf(" Line %d: Can't set chunk sizes\n",__LINE__); goto error; } /* end if */ - if(H5Pset_deflate(dcpl, 9)<0) { + if(H5Pset_deflate(dcpl, 9) < 0) { H5_FAILED(); printf(" Line %d: Can't set deflate filter\n",__LINE__); goto error; @@ -2230,28 +2231,28 @@ test_missing_filter(hid_t file) } /* end if */ /* Create the data space */ - if ((sid = H5Screate_simple(2, dims, NULL))<0) { + if ((sid = H5Screate_simple(2, dims, NULL)) < 0) { H5_FAILED(); printf(" Line %d: Can't open dataspace\n",__LINE__); goto error; } /* end if */ /* Create new dataset */ - if ((dsid = H5Dcreate(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, dcpl))<0) { + if ((dsid = H5Dcreate(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) { H5_FAILED(); printf(" Line %d: Can't create dataset\n",__LINE__); goto error; } /* end if */ /* Write data */ - if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0) { + if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) { H5_FAILED(); printf(" Line %d: Error writing dataset data\n",__LINE__); goto error; } /* end if */ /* Flush the file (to clear the cache) */ - if (H5Fflush(file, H5F_SCOPE_GLOBAL)<0) { + if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) { H5_FAILED(); printf(" Line %d: Error flushing file\n",__LINE__); goto error; @@ -2273,7 +2274,7 @@ test_missing_filter(hid_t file) } /* end if */ /* Read data */ - if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check)<0) { + if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) { H5_FAILED(); printf(" Line %d: Error reading dataset data\n",__LINE__); goto error; @@ -2295,21 +2296,21 @@ test_missing_filter(hid_t file) } /* end for */ /* Close dataset */ - if(H5Dclose(dsid)<0) { + if(H5Dclose(dsid) < 0) { H5_FAILED(); printf(" Line %d: Can't close dataset\n",__LINE__); goto error; } /* end if */ /* Close dataspace */ - if(H5Sclose(sid)<0) { + if(H5Sclose(sid) < 0) { H5_FAILED(); printf(" Line %d: Can't close dataspace\n",__LINE__); goto error; } /* end if */ /* Close dataset creation property list */ - if(H5Pclose(dcpl)<0) { + if(H5Pclose(dcpl) < 0) { H5_FAILED(); printf(" Line %d: Can't close dcpl\n",__LINE__); goto error; @@ -2326,14 +2327,14 @@ test_missing_filter(hid_t file) HDstrcat(testfile, FILE_DEFLATE_NAME); /* Open existing file */ - if((fid=H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT))<0) { + if((fid=H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) { H5_FAILED(); printf(" Line %d: Can't open existing deflated file\n",__LINE__); goto error; } /* end if */ /* Open dataset */ - if ((dsid = H5Dopen(fid, "Dataset1"))<0) { + if ((dsid = H5Dopen(fid, "Dataset1")) < 0) { H5_FAILED(); printf(" Line %d: Can't open dataset\n",__LINE__); goto error; @@ -2350,14 +2351,14 @@ test_missing_filter(hid_t file) } /* end if */ /* Close dataset */ - if(H5Dclose(dsid)<0) { + if(H5Dclose(dsid) < 0) { H5_FAILED(); printf(" Line %d: Can't close dataset\n",__LINE__); goto error; } /* end if */ /* Close existing file */ - if(H5Fclose(fid)<0) { + if(H5Fclose(fid) < 0) { H5_FAILED(); printf(" Line %d: Can't close file\n",__LINE__); goto error; @@ -2372,7 +2373,7 @@ test_missing_filter(hid_t file) } /* end if */ #ifdef H5_HAVE_FILTER_DEFLATE /* Register deflate filter (use internal function to avoid range checks) */ - if(H5Z_register(H5Z_DEFLATE)<0) { + if(H5Z_register(H5Z_DEFLATE) < 0) { H5_FAILED(); printf(" Line %d: Can't unregister deflate filter\n",__LINE__); goto error; @@ -2430,16 +2431,16 @@ test_onebyte_shuffle(hid_t file) #ifdef H5_HAVE_FILTER_SHUFFLE /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use shuffling algorithm with 8-bit */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error; - if (H5Pset_shuffle (dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + if (H5Pset_shuffle (dc) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR, - space,dc))<0) goto error; + space,dc)) < 0) goto error; for (i= 0;i< 10; i++) for (j = 0; j < 20; j++) @@ -2460,7 +2461,7 @@ test_onebyte_shuffle(hid_t file) #ifdef H5_HAVE_FILTER_SHUFFLE if (H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) + orig_data) < 0) goto error; PASSED(); @@ -2478,7 +2479,7 @@ test_onebyte_shuffle(hid_t file) #ifdef H5_HAVE_FILTER_SHUFFLE /* Read the dataset back */ if (H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) + new_data) < 0) goto error; /* Check that the values read are the same as the values written */ @@ -2498,8 +2499,8 @@ test_onebyte_shuffle(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Pclose (dc)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Pclose (dc) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -2552,27 +2553,27 @@ test_nbit_int(hid_t file) /* Define dataset datatype (integer), and set precision, offset */ datatype = H5Tcopy(H5T_NATIVE_INT); precision = 17; /* precision includes sign bit */ - if(H5Tset_precision(datatype,precision)<0) goto error; + if(H5Tset_precision(datatype,precision) < 0) goto error; offset = 4; - if(H5Tset_offset(datatype,offset)<0) goto error; + if(H5Tset_offset(datatype,offset) < 0) goto error; /* Copy to memory datatype before setting order */ mem_datatype = H5Tcopy(datatype); /* Set order of dataset datatype */ - if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_nbit(dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_NBIT_INT_NAME, datatype, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Initialize data, assuming size of long_long >= size of int */ for (i= 0;i< (size_t)size[0]; i++) @@ -2600,7 +2601,7 @@ test_nbit_int(hid_t file) #ifdef H5_HAVE_FILTER_NBIT if (H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) + orig_data) < 0) goto error; PASSED(); #else @@ -2617,7 +2618,7 @@ test_nbit_int(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if (H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) + new_data) < 0) goto error; /* Check that the values read are the same as the values written @@ -2639,11 +2640,11 @@ test_nbit_int(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype)<0) goto error; - if (H5Tclose(mem_datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(datatype) < 0) goto error; + if (H5Tclose(mem_datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -2697,23 +2698,23 @@ test_nbit_float(hid_t file) datatype = H5Tcopy(H5T_IEEE_F32BE); if(H5Tset_fields(datatype, (size_t)26, (size_t)20, (size_t)6, (size_t)7, (size_t)13) < 0) goto error; offset = 7; - if(H5Tset_offset(datatype,offset)<0) goto error; + if(H5Tset_offset(datatype,offset) < 0) goto error; precision = 20; - if(H5Tset_precision(datatype,precision)<0) goto error; + if(H5Tset_precision(datatype,precision) < 0) goto error; if(H5Tset_size(datatype, (size_t)4) < 0) goto error; if(H5Tset_ebias(datatype, (size_t)31) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_nbit(dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_NBIT_FLOAT_NAME, datatype, - space,dc))<0) goto error; + space,dc)) < 0) goto error; PASSED(); #else SKIPPED(); @@ -2729,7 +2730,7 @@ test_nbit_float(hid_t file) #ifdef H5_HAVE_FILTER_NBIT if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) + orig_data) < 0) goto error; PASSED(); @@ -2747,7 +2748,7 @@ test_nbit_float(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) + new_data) < 0) goto error; /* Check that the values read are the same as the values written @@ -2769,10 +2770,10 @@ test_nbit_float(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -2830,23 +2831,23 @@ test_nbit_double(hid_t file) datatype = H5Tcopy(H5T_IEEE_F64BE); if(H5Tset_fields(datatype, (size_t)55, (size_t)46, (size_t)9, (size_t)5, (size_t)41) < 0) goto error; offset = 5; - if(H5Tset_offset(datatype,offset)<0) goto error; + if(H5Tset_offset(datatype,offset) < 0) goto error; precision = 51; - if(H5Tset_precision(datatype,precision)<0) goto error; + if(H5Tset_precision(datatype,precision) < 0) goto error; if(H5Tset_size(datatype, (size_t)8) < 0) goto error; if(H5Tset_ebias(datatype, (size_t)255) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_nbit(dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_NBIT_DOUBLE_NAME, datatype, - space, dc))<0) goto error; + space, dc)) < 0) goto error; PASSED(); #else @@ -2863,7 +2864,7 @@ test_nbit_double(hid_t file) #ifdef H5_HAVE_FILTER_NBIT if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) + orig_data) < 0) goto error; PASSED(); #else @@ -2880,7 +2881,7 @@ test_nbit_double(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) + new_data) < 0) goto error; /* Check that the values read are the same as the values written @@ -2902,10 +2903,10 @@ test_nbit_double(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -2958,15 +2959,15 @@ test_nbit_array(hid_t file) /* Define dataset array datatype's base datatype and set precision, offset */ base_datatype = H5Tcopy(H5T_NATIVE_UINT); precision = 22; - if(H5Tset_precision(base_datatype,precision)<0) goto error; + if(H5Tset_precision(base_datatype,precision) < 0) goto error; offset = 7; - if(H5Tset_offset(base_datatype,offset)<0) goto error; + if(H5Tset_offset(base_datatype,offset) < 0) goto error; /* Copy to memory array datatype's base datatype before setting order */ mem_base_datatype = H5Tcopy(base_datatype); /* Set order of dataset array datatype's base datatype */ - if(H5Tset_order(base_datatype, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(base_datatype, H5T_ORDER_BE) < 0) goto error; /* Create dataset array datatype */ array_datatype = H5Tarray_create(base_datatype, 2, adims, NULL); @@ -2975,16 +2976,16 @@ test_nbit_array(hid_t file) mem_array_datatype = H5Tarray_create(mem_base_datatype, 2, adims, NULL); /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_nbit(dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_NBIT_ARRAY_NAME, array_datatype, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Initialize data, assuming size of long_long >= size of unsigned int */ for (i= 0;i< (size_t)size[0]; i++) @@ -3008,7 +3009,7 @@ test_nbit_array(hid_t file) #ifdef H5_HAVE_FILTER_NBIT if (H5Dwrite(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) + orig_data) < 0) goto error; PASSED(); @@ -3026,7 +3027,7 @@ test_nbit_array(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if (H5Dread(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) + new_data) < 0) goto error; /* Check that the values read are the same as the values written @@ -3048,13 +3049,13 @@ test_nbit_array(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(array_datatype)<0) goto error; - if (H5Tclose(base_datatype)<0) goto error; - if (H5Tclose(mem_array_datatype)<0) goto error; - if (H5Tclose(mem_base_datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(array_datatype) < 0) goto error; + if (H5Tclose(base_datatype) < 0) goto error; + if (H5Tclose(mem_array_datatype) < 0) goto error; + if (H5Tclose(mem_base_datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -3122,14 +3123,14 @@ test_nbit_compound(hid_t file) f_tid=H5Tcopy(H5T_IEEE_F32BE); /* Set precision and offset etc. */ - if(H5Tset_precision(i_tid,precision[0])<0) goto error; - if(H5Tset_offset(i_tid,offset[0])<0) goto error; + if(H5Tset_precision(i_tid,precision[0]) < 0) goto error; + if(H5Tset_offset(i_tid,offset[0]) < 0) goto error; - if(H5Tset_precision(c_tid,precision[1])<0) goto error; - if(H5Tset_offset(c_tid,offset[1])<0) goto error; + if(H5Tset_precision(c_tid,precision[1]) < 0) goto error; + if(H5Tset_offset(c_tid,offset[1]) < 0) goto error; - if(H5Tset_precision(s_tid,precision[2])<0) goto error; - if(H5Tset_offset(s_tid,offset[2])<0) goto error; + if(H5Tset_precision(s_tid,precision[2]) < 0) goto error; + if(H5Tset_offset(s_tid,offset[2]) < 0) goto error; if(H5Tset_fields(f_tid, (size_t)26, (size_t)20, (size_t)6, (size_t)7, (size_t)13) < 0) goto error; if(H5Tset_offset(f_tid, (size_t)7) < 0) goto error; @@ -3139,34 +3140,34 @@ test_nbit_compound(hid_t file) /* Create a memory compound datatype before setting the order */ mem_cmpd_tid = H5Tcreate(H5T_COMPOUND, sizeof(atomic)); - if(H5Tinsert(mem_cmpd_tid, "i", HOFFSET(atomic, i), i_tid)<0) goto error; - if(H5Tinsert(mem_cmpd_tid, "c", HOFFSET(atomic, c), c_tid)<0) goto error; - if(H5Tinsert(mem_cmpd_tid, "s", HOFFSET(atomic, s), s_tid)<0) goto error; - if(H5Tinsert(mem_cmpd_tid, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT)<0) goto error; + if(H5Tinsert(mem_cmpd_tid, "i", HOFFSET(atomic, i), i_tid) < 0) goto error; + if(H5Tinsert(mem_cmpd_tid, "c", HOFFSET(atomic, c), c_tid) < 0) goto error; + if(H5Tinsert(mem_cmpd_tid, "s", HOFFSET(atomic, s), s_tid) < 0) goto error; + if(H5Tinsert(mem_cmpd_tid, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT) < 0) goto error; /* Set order of dataset compound member datatype */ - if(H5Tset_order(i_tid, H5T_ORDER_BE)<0) goto error; - if(H5Tset_order(c_tid, H5T_ORDER_BE)<0) goto error; - if(H5Tset_order(s_tid, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(i_tid, H5T_ORDER_BE) < 0) goto error; + if(H5Tset_order(c_tid, H5T_ORDER_BE) < 0) goto error; + if(H5Tset_order(s_tid, H5T_ORDER_BE) < 0) goto error; /* Create a dataset compound datatype and insert some atomic types */ cmpd_tid = H5Tcreate(H5T_COMPOUND, sizeof(atomic)); - if(H5Tinsert(cmpd_tid, "i", HOFFSET(atomic, i), i_tid)<0) goto error; - if(H5Tinsert(cmpd_tid, "c", HOFFSET(atomic, c), c_tid)<0) goto error; - if(H5Tinsert(cmpd_tid, "s", HOFFSET(atomic, s), s_tid)<0) goto error; - if(H5Tinsert(cmpd_tid, "f", HOFFSET(atomic, f), f_tid)<0) goto error; + if(H5Tinsert(cmpd_tid, "i", HOFFSET(atomic, i), i_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid, "c", HOFFSET(atomic, c), c_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid, "s", HOFFSET(atomic, s), s_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid, "f", HOFFSET(atomic, f), f_tid) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_nbit(dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME, cmpd_tid, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Initialize data, assuming size of long_long >= size of member datatypes */ for (i= 0;i< (size_t)size[0]; i++) @@ -3201,7 +3202,7 @@ test_nbit_compound(hid_t file) #ifdef H5_HAVE_FILTER_NBIT if (H5Dwrite(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) + orig_data) < 0) goto error; PASSED(); #else @@ -3218,7 +3219,7 @@ test_nbit_compound(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if (H5Dread(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) + new_data) < 0) goto error; /* Check that the values read are the same as the values written @@ -3246,15 +3247,15 @@ test_nbit_compound(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(i_tid)<0) goto error; - if (H5Tclose(c_tid)<0) goto error; - if (H5Tclose(s_tid)<0) goto error; - if (H5Tclose(f_tid)<0) goto error; - if (H5Tclose(cmpd_tid)<0) goto error; - if (H5Tclose(mem_cmpd_tid)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(i_tid) < 0) goto error; + if (H5Tclose(c_tid) < 0) goto error; + if (H5Tclose(s_tid) < 0) goto error; + if (H5Tclose(f_tid) < 0) goto error; + if (H5Tclose(cmpd_tid) < 0) goto error; + if (H5Tclose(mem_cmpd_tid) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -3338,14 +3339,14 @@ test_nbit_compound_2(hid_t file) f_tid=H5Tcopy(H5T_IEEE_F32BE); /* Set precision and offset etc. of atomic compound datatype members */ - if(H5Tset_precision(i_tid,precision[0])<0) goto error; - if(H5Tset_offset(i_tid,offset[0])<0) goto error; + if(H5Tset_precision(i_tid,precision[0]) < 0) goto error; + if(H5Tset_offset(i_tid,offset[0]) < 0) goto error; - if(H5Tset_precision(c_tid,precision[1])<0) goto error; - if(H5Tset_offset(c_tid,offset[1])<0) goto error; + if(H5Tset_precision(c_tid,precision[1]) < 0) goto error; + if(H5Tset_offset(c_tid,offset[1]) < 0) goto error; - if(H5Tset_precision(s_tid,precision[2])<0) goto error; - if(H5Tset_offset(s_tid,offset[2])<0) goto error; + if(H5Tset_precision(s_tid,precision[2]) < 0) goto error; + if(H5Tset_offset(s_tid,offset[2]) < 0) goto error; if(H5Tset_fields(f_tid, (size_t)26, (size_t)20, (size_t)6, (size_t)7, (size_t)13) < 0) goto error; if(H5Tset_offset(f_tid, (size_t)7) < 0) goto error; @@ -3355,31 +3356,31 @@ test_nbit_compound_2(hid_t file) /* Create a memory atomic compound datatype before setting the order */ mem_cmpd_tid1 = H5Tcreate(H5T_COMPOUND, sizeof(atomic)); - if(H5Tinsert(mem_cmpd_tid1, "i", HOFFSET(atomic, i), i_tid)<0) goto error; - if(H5Tinsert(mem_cmpd_tid1, "c", HOFFSET(atomic, c), c_tid)<0) goto error; - if(H5Tinsert(mem_cmpd_tid1, "s", HOFFSET(atomic, s), s_tid)<0) goto error; - if(H5Tinsert(mem_cmpd_tid1, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT)<0) goto error; + if(H5Tinsert(mem_cmpd_tid1, "i", HOFFSET(atomic, i), i_tid) < 0) goto error; + if(H5Tinsert(mem_cmpd_tid1, "c", HOFFSET(atomic, c), c_tid) < 0) goto error; + if(H5Tinsert(mem_cmpd_tid1, "s", HOFFSET(atomic, s), s_tid) < 0) goto error; + if(H5Tinsert(mem_cmpd_tid1, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT) < 0) goto error; /* Set order of dataset atomic compound member datatype */ - if(H5Tset_order(i_tid, H5T_ORDER_BE)<0) goto error; - if(H5Tset_order(c_tid, H5T_ORDER_BE)<0) goto error; - if(H5Tset_order(s_tid, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(i_tid, H5T_ORDER_BE) < 0) goto error; + if(H5Tset_order(c_tid, H5T_ORDER_BE) < 0) goto error; + if(H5Tset_order(s_tid, H5T_ORDER_BE) < 0) goto error; /* Create a dataset atomic compound datatype and insert some atomic types */ cmpd_tid1 = H5Tcreate(H5T_COMPOUND, sizeof(atomic)); - if(H5Tinsert(cmpd_tid1, "i", HOFFSET(atomic, i), i_tid)<0) goto error; - if(H5Tinsert(cmpd_tid1, "c", HOFFSET(atomic, c), c_tid)<0) goto error; - if(H5Tinsert(cmpd_tid1, "s", HOFFSET(atomic, s), s_tid)<0) goto error; - if(H5Tinsert(cmpd_tid1, "f", HOFFSET(atomic, f), f_tid)<0) goto error; + if(H5Tinsert(cmpd_tid1, "i", HOFFSET(atomic, i), i_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid1, "c", HOFFSET(atomic, c), c_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid1, "s", HOFFSET(atomic, s), s_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid1, "f", HOFFSET(atomic, f), f_tid) < 0) goto error; /* Set precision and offset of the other data member */ - if(H5Tset_precision(v_tid,precision[3])<0) goto error; - if(H5Tset_offset(v_tid,offset[3])<0) goto error; + if(H5Tset_precision(v_tid,precision[3]) < 0) goto error; + if(H5Tset_offset(v_tid,offset[3]) < 0) goto error; /* Create the simple array datatype */ base_tid = H5Tcopy(H5T_NATIVE_CHAR); - if(H5Tset_precision(base_tid,precision[4])<0) goto error; - if(H5Tset_offset(base_tid,offset[4])<0) goto error; + if(H5Tset_precision(base_tid,precision[4]) < 0) goto error; + if(H5Tset_offset(base_tid,offset[4]) < 0) goto error; array_tid = H5Tarray_create(base_tid, 2, array_dims, NULL); /* Create the complex memory and dataset array datatype */ @@ -3388,32 +3389,32 @@ test_nbit_compound_2(hid_t file) /* Create a memory complex compound datatype before setting the order */ mem_cmpd_tid2 = H5Tcreate(H5T_COMPOUND, sizeof(complex)); - if(H5Tinsert(mem_cmpd_tid2, "a", HOFFSET(complex, a), mem_cmpd_tid1)<0) goto error; - if(H5Tinsert(mem_cmpd_tid2, "v", HOFFSET(complex, v), v_tid)<0) goto error; - if(H5Tinsert(mem_cmpd_tid2, "b", HOFFSET(complex, b), array_tid)<0) goto error; - if(H5Tinsert(mem_cmpd_tid2, "d", HOFFSET(complex, d), mem_array_cmplx_tid)<0) goto error; + if(H5Tinsert(mem_cmpd_tid2, "a", HOFFSET(complex, a), mem_cmpd_tid1) < 0) goto error; + if(H5Tinsert(mem_cmpd_tid2, "v", HOFFSET(complex, v), v_tid) < 0) goto error; + if(H5Tinsert(mem_cmpd_tid2, "b", HOFFSET(complex, b), array_tid) < 0) goto error; + if(H5Tinsert(mem_cmpd_tid2, "d", HOFFSET(complex, d), mem_array_cmplx_tid) < 0) goto error; /* Set order of dataset other complex compound member datatype */ - if(H5Tset_order(v_tid, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(v_tid, H5T_ORDER_BE) < 0) goto error; /* Create a dataset complex compound datatype and insert members */ cmpd_tid2 = H5Tcreate(H5T_COMPOUND, sizeof(complex)); - if(H5Tinsert(cmpd_tid2, "a", HOFFSET(complex, a), cmpd_tid1)<0) goto error; - if(H5Tinsert(cmpd_tid2, "v", HOFFSET(complex, v), v_tid)<0) goto error; - if(H5Tinsert(cmpd_tid2, "b", HOFFSET(complex, b), array_tid)<0) goto error; - if(H5Tinsert(cmpd_tid2, "d", HOFFSET(complex, d), array_cmplx_tid)<0) goto error; + if(H5Tinsert(cmpd_tid2, "a", HOFFSET(complex, a), cmpd_tid1) < 0) goto error; + if(H5Tinsert(cmpd_tid2, "v", HOFFSET(complex, v), v_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid2, "b", HOFFSET(complex, b), array_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid2, "d", HOFFSET(complex, d), array_cmplx_tid) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Use nbit filter */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_nbit(dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME_2, cmpd_tid2, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Initialize data, assuming size of long_long >= size of member datatypes */ for (i= 0;i< (size_t)size[0]; i++) @@ -3461,7 +3462,7 @@ test_nbit_compound_2(hid_t file) #ifdef H5_HAVE_FILTER_NBIT if (H5Dwrite(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) + orig_data) < 0) goto error; PASSED(); #else @@ -3478,7 +3479,7 @@ test_nbit_compound_2(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if (H5Dread(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) + new_data) < 0) goto error; /* Check that the values read are the same as the values written @@ -3530,22 +3531,22 @@ test_nbit_compound_2(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(i_tid)<0) goto error; - if (H5Tclose(c_tid)<0) goto error; - if (H5Tclose(s_tid)<0) goto error; - if (H5Tclose(f_tid)<0) goto error; - if (H5Tclose(v_tid)<0) goto error; - if (H5Tclose(cmpd_tid2)<0) goto error; - if (H5Tclose(cmpd_tid1)<0) goto error; - if (H5Tclose(mem_cmpd_tid2)<0) goto error; - if (H5Tclose(mem_cmpd_tid1)<0) goto error; - if (H5Tclose(array_tid)<0) goto error; - if (H5Tclose(base_tid)<0) goto error; - if (H5Tclose(array_cmplx_tid)<0) goto error; - if (H5Tclose(mem_array_cmplx_tid)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(i_tid) < 0) goto error; + if (H5Tclose(c_tid) < 0) goto error; + if (H5Tclose(s_tid) < 0) goto error; + if (H5Tclose(f_tid) < 0) goto error; + if (H5Tclose(v_tid) < 0) goto error; + if (H5Tclose(cmpd_tid2) < 0) goto error; + if (H5Tclose(cmpd_tid1) < 0) goto error; + if (H5Tclose(mem_cmpd_tid2) < 0) goto error; + if (H5Tclose(mem_cmpd_tid1) < 0) goto error; + if (H5Tclose(array_tid) < 0) goto error; + if (H5Tclose(base_tid) < 0) goto error; + if (H5Tclose(array_cmplx_tid) < 0) goto error; + if (H5Tclose(mem_array_cmplx_tid) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -3611,37 +3612,37 @@ test_nbit_compound_3(hid_t file) if(H5Tset_size(str_tid, (size_t)30) < 0) goto error; vl_str_tid = H5Tcopy(H5T_C_S1); - if(H5Tset_size(vl_str_tid,H5T_VARIABLE)<0) goto error; + if(H5Tset_size(vl_str_tid,H5T_VARIABLE) < 0) goto error; - if((v_tid = H5Tvlen_create(H5T_NATIVE_UINT))<0) goto error; + if((v_tid = H5Tvlen_create(H5T_NATIVE_UINT)) < 0) goto error; if((o_tid = H5Tcreate(H5T_OPAQUE, (size_t)5)) < 0) goto error; - if(H5Tset_tag(o_tid, "testing opaque field")<0) goto error; + if(H5Tset_tag(o_tid, "testing opaque field") < 0) goto error; /* Create a dataset compound datatype and insert some atomic types */ cmpd_tid = H5Tcreate(H5T_COMPOUND, sizeof(atomic)); - if(H5Tinsert(cmpd_tid, "i", HOFFSET(atomic, i), i_tid)<0) goto error; - if(H5Tinsert(cmpd_tid, "str", HOFFSET(atomic, str), str_tid)<0) goto error; - if(H5Tinsert(cmpd_tid, "vl_str", HOFFSET(atomic, vl_str), vl_str_tid)<0) goto error; - if(H5Tinsert(cmpd_tid, "v", HOFFSET(atomic, v), v_tid)<0) goto error; - if(H5Tinsert(cmpd_tid, "r", HOFFSET(atomic, r), H5T_STD_REF_OBJ)<0) goto error; - if(H5Tinsert(cmpd_tid, "o", HOFFSET(atomic, o), o_tid)<0) goto error; + if(H5Tinsert(cmpd_tid, "i", HOFFSET(atomic, i), i_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid, "str", HOFFSET(atomic, str), str_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid, "vl_str", HOFFSET(atomic, vl_str), vl_str_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid, "v", HOFFSET(atomic, v), v_tid) < 0) goto error; + if(H5Tinsert(cmpd_tid, "r", HOFFSET(atomic, r), H5T_STD_REF_OBJ) < 0) goto error; + if(H5Tinsert(cmpd_tid, "o", HOFFSET(atomic, o), o_tid) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(1, size, NULL))<0) goto error; + if ((space = H5Screate_simple(1, size, NULL)) < 0) goto error; /* Use nbit filter */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dc, 1, chunk_size)<0) goto error; - if (H5Pset_nbit(dc)<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if (H5Pset_chunk(dc, 1, chunk_size) < 0) goto error; + if (H5Pset_nbit(dc) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME_3, cmpd_tid, - space, dc))<0) goto error; + space, dc)) < 0) goto error; /* Create the dataset object reference points to */ if ((obj_ref_dataset = H5Dcreate(file, "nbit_obj_ref", H5T_NATIVE_INT, - space, H5P_DEFAULT))<0) goto error; + space, H5P_DEFAULT)) < 0) goto error; /* Initialize data */ for(i = 0; i < (size_t)size[0]; i++) { @@ -3654,7 +3655,7 @@ test_nbit_compound_3(hid_t file) for(k = 0; k < (i+1); k++) ((unsigned int *)orig_data[i].v.p)[k] = (unsigned int)(i*100 + k); /* Create reference to the dataset "nbit_obj_ref" */ - if(H5Rcreate(&orig_data[i].r, file, "nbit_obj_ref", H5R_OBJECT, -1)<0) goto error; + if(H5Rcreate(&orig_data[i].r, file, "nbit_obj_ref", H5R_OBJECT, -1) < 0) goto error; for(j = 0; j < 5; j++) orig_data[i].o[j] = (unsigned char)(i + j); } @@ -3674,7 +3675,7 @@ test_nbit_compound_3(hid_t file) #ifdef H5_HAVE_FILTER_NBIT if (H5Dwrite(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) + orig_data) < 0) goto error; PASSED(); #else @@ -3691,7 +3692,7 @@ test_nbit_compound_3(hid_t file) #ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if (H5Dread(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) + new_data) < 0) goto error; /* Check that the values read are the same as the values written */ @@ -3731,18 +3732,18 @@ test_nbit_compound_3(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data)<0) goto error; - if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data)<0) goto error; - if (H5Tclose(i_tid)<0) goto error; - if (H5Tclose(str_tid)<0) goto error; - if (H5Tclose(vl_str_tid)<0) goto error; - if (H5Tclose(v_tid)<0) goto error; - if (H5Tclose(o_tid)<0) goto error; - if (H5Tclose(cmpd_tid)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(obj_ref_dataset)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error; + if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error; + if (H5Tclose(i_tid) < 0) goto error; + if (H5Tclose(str_tid) < 0) goto error; + if (H5Tclose(vl_str_tid) < 0) goto error; + if (H5Tclose(v_tid) < 0) goto error; + if (H5Tclose(o_tid) < 0) goto error; + if (H5Tclose(cmpd_tid) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(obj_ref_dataset) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -3793,24 +3794,24 @@ test_scaleoffset_int(hid_t file) datatype = H5Tcopy(H5T_NATIVE_INT); /* Set order of dataset datatype */ - if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Fill value undefined */ - if (H5Pset_fill_value(dc, datatype, NULL)<0) goto error; + if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error; /* Set up to use scaleoffset filter, let library calculate minbits */ - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT)<0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME, datatype, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Initialize data */ for (i= 0;i< (size_t)size[0]; i++) @@ -3837,7 +3838,7 @@ test_scaleoffset_int(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) goto error; + orig_data) < 0) goto error; PASSED(); #else SKIPPED(); @@ -3853,7 +3854,7 @@ test_scaleoffset_int(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) goto error; + new_data) < 0) goto error; /* Check that the values read are the same as the values written */ for (i=0; i<(size_t)size[0]; i++) { @@ -3871,10 +3872,10 @@ test_scaleoffset_int(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -3928,28 +3929,28 @@ test_scaleoffset_int_2(hid_t file) datatype = H5Tcopy(H5T_NATIVE_INT); /* Set order of dataset datatype */ - if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space for the dataset */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ fillval = 10000; - if (H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval)<0) goto error; + if (H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, let library calculate minbits */ - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT)<0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME_2, datatype, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Create the memory data space */ - if ((mspace = H5Screate_simple(2, size, NULL))<0) goto error; + if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Select hyperslab for data to write, using 1x5 blocks, * (1,1) stride and (1,1) count starting at the position (0,0). @@ -3959,7 +3960,7 @@ test_scaleoffset_int_2(hid_t file) count[0] = 1; count[1] = 1; block[0] = 1; block[1] = 5; if(H5Sselect_hyperslab(mspace, H5S_SELECT_SET, start, - stride, count, block)<0) goto error; + stride, count, block) < 0) goto error; /* Initialize data of hyperslab */ for (j = 0; j < (size_t)size[1]; j++) { @@ -3986,7 +3987,7 @@ test_scaleoffset_int_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* only data in the hyperslab will be written, other value should be fill value */ if (H5Dwrite(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT, - orig_data)<0) goto error; + orig_data) < 0) goto error; PASSED(); #else SKIPPED(); @@ -4002,7 +4003,7 @@ test_scaleoffset_int_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if (H5Dread(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT, - new_data)<0) goto error; + new_data) < 0) goto error; /* Check that the values read are the same as the values written */ for (j=0; j<(size_t)size[1]; j++) { @@ -4018,10 +4019,10 @@ test_scaleoffset_int_2(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4070,26 +4071,26 @@ test_scaleoffset_float(hid_t file) datatype = H5Tcopy(H5T_NATIVE_FLOAT); /* Set order of dataset datatype */ - if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Fill value undefined */ - if (H5Pset_fill_value(dc, datatype, NULL)<0) goto error; + if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 3, * use variable-minimum-bits method */ - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3)<0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME, datatype, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Initialize data */ for (i= 0;i< (size_t)size[0]; i++) @@ -4116,7 +4117,7 @@ test_scaleoffset_float(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) goto error; + orig_data) < 0) goto error; PASSED(); #else SKIPPED(); @@ -4132,7 +4133,7 @@ test_scaleoffset_float(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) goto error; + new_data) < 0) goto error; /* Check that the values read are the same as the values written */ for (i=0; i<(size_t)size[0]; i++) { @@ -4150,10 +4151,10 @@ test_scaleoffset_float(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4207,30 +4208,30 @@ test_scaleoffset_float_2(hid_t file) datatype = H5Tcopy(H5T_NATIVE_FLOAT); /* Set order of dataset datatype */ - if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space for the dataset */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ fillval = 10000.0; - if (H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval)<0) goto error; + if (H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 3, * use variable-minimum-bits method */ - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3)<0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME_2, datatype, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Create the memory data space */ - if ((mspace = H5Screate_simple(2, size, NULL))<0) goto error; + if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Select hyperslab for data to write, using 1x5 blocks, * (1,1) stride and (1,1) count starting at the position (0,0). @@ -4240,7 +4241,7 @@ test_scaleoffset_float_2(hid_t file) count[0] = 1; count[1] = 1; block[0] = 1; block[1] = 5; if(H5Sselect_hyperslab(mspace, H5S_SELECT_SET, start, - stride, count, block)<0) goto error; + stride, count, block) < 0) goto error; /* Initialize data of hyperslab */ for (j = 0; j < (size_t)size[1]; j++) { @@ -4267,7 +4268,7 @@ test_scaleoffset_float_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* only data in the hyperslab will be written, other value should be fill value */ if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT, - orig_data)<0) goto error; + orig_data) < 0) goto error; PASSED(); #else SKIPPED(); @@ -4283,7 +4284,7 @@ test_scaleoffset_float_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if (H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT, - new_data)<0) goto error; + new_data) < 0) goto error; /* Check that the values read are the same as the values written */ for (j=0; j<(size_t)size[1]; j++) { @@ -4298,10 +4299,10 @@ test_scaleoffset_float_2(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4350,26 +4351,26 @@ test_scaleoffset_double(hid_t file) datatype = H5Tcopy(H5T_NATIVE_DOUBLE); /* Set order of dataset datatype */ - if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Fill value undefined */ - if (H5Pset_fill_value(dc, datatype, NULL)<0) goto error; + if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 7, * use variable-minimum-bits method */ - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7)<0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME, datatype, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Initialize data */ for (i= 0;i< (size_t)size[0]; i++) @@ -4396,7 +4397,7 @@ test_scaleoffset_double(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, - orig_data)<0) goto error; + orig_data) < 0) goto error; PASSED(); #else SKIPPED(); @@ -4412,7 +4413,7 @@ test_scaleoffset_double(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, - new_data)<0) goto error; + new_data) < 0) goto error; /* Check that the values read are the same as the values written */ for (i=0; i<(size_t)size[0]; i++) { @@ -4430,10 +4431,10 @@ test_scaleoffset_double(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4487,30 +4488,30 @@ test_scaleoffset_double_2(hid_t file) datatype = H5Tcopy(H5T_NATIVE_DOUBLE); /* Set order of dataset datatype */ - if(H5Tset_order(datatype, H5T_ORDER_BE)<0) goto error; + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error; /* Create the data space for the dataset */ - if ((space = H5Screate_simple(2, size, NULL))<0) goto error; + if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Create the dataset property list */ - if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error; + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ fillval = 10000.0; - if (H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval)<0) goto error; + if (H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 7, * use variable-minimum-bits method */ - if (H5Pset_chunk(dc, 2, chunk_size)<0) goto error; - if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7)<0) goto error; + if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error; + if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME_2, datatype, - space,dc))<0) goto error; + space,dc)) < 0) goto error; /* Create the memory data space */ - if ((mspace = H5Screate_simple(2, size, NULL))<0) goto error; + if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error; /* Select hyperslab for data to write, using 1x5 blocks, * (1,1) stride and (1,1) count starting at the position (0,0). @@ -4520,7 +4521,7 @@ test_scaleoffset_double_2(hid_t file) count[0] = 1; count[1] = 1; block[0] = 1; block[1] = 5; if(H5Sselect_hyperslab(mspace, H5S_SELECT_SET, start, - stride, count, block)<0) goto error; + stride, count, block) < 0) goto error; /* Initialize data of hyperslab */ for (j = 0; j < (size_t)size[1]; j++) { @@ -4547,7 +4548,7 @@ test_scaleoffset_double_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* only data in the hyperslab will be written, other value should be fill value */ if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT, - orig_data)<0) goto error; + orig_data) < 0) goto error; PASSED(); #else SKIPPED(); @@ -4563,7 +4564,7 @@ test_scaleoffset_double_2(hid_t file) #ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if (H5Dread(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT, - new_data)<0) goto error; + new_data) < 0) goto error; /* Check that the values read are the same as the values written */ for (j=0; j<(size_t)size[1]; j++) { @@ -4579,10 +4580,10 @@ test_scaleoffset_double_2(hid_t file) * Cleanup *---------------------------------------------------------------------- */ - if (H5Tclose(datatype)<0) goto error; - if (H5Pclose(dc)<0) goto error; - if (H5Sclose(space)<0) goto error; - if (H5Dclose(dataset)<0) goto error; + if (H5Tclose(datatype) < 0) goto error; + if (H5Pclose(dc) < 0) goto error; + if (H5Sclose(space) < 0) goto error; + if (H5Dclose(dataset) < 0) goto error; PASSED(); #else @@ -4617,7 +4618,7 @@ error: static herr_t test_multiopen (hid_t file) { - hid_t dcpl=-1, space=-1, dset1=-1, dset2=-1; + hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1; hsize_t cur_size[1] = {10}; static hsize_t max_size[1] = {H5S_UNLIMITED}; hsize_t tmp_size[1]; @@ -4625,41 +4626,40 @@ test_multiopen (hid_t file) TESTING("multi-open with extending"); /* Create the dataset and open it twice */ - if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk (dcpl, 1, cur_size)<0) goto error; - if ((space=H5Screate_simple (1, cur_size, max_size))<0) goto error; - if ((dset1=H5Dcreate (file, "multiopen", H5T_NATIVE_INT, space, - dcpl))<0) goto error; - if ((dset2=H5Dopen (dset1, "."))<0) goto error; - if (H5Sclose (space)<0) goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk(dcpl, 1, cur_size) < 0) goto error; + if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; + if((dset1 = H5Dcreate(file, "multiopen", H5T_NATIVE_INT, space, dcpl)) < 0) goto error; + if((dset2 = H5Dopen(dset1, ".")) < 0) goto error; + if(H5Sclose(space) < 0) goto error; /* Extend with the first handle */ cur_size[0] = 20; - if (H5Dextend (dset1, cur_size)<0) goto error; + if(H5Dset_extent(dset1, cur_size) < 0) goto error; /* Get the size from the second handle */ - if ((space = H5Dget_space (dset2))<0) goto error; - if (H5Sget_simple_extent_dims (space, tmp_size, NULL)<0) goto error; - if (cur_size[0]!=tmp_size[0]) { + if((space = H5Dget_space(dset2)) < 0) goto error; + if(H5Sget_simple_extent_dims(space, tmp_size, NULL) < 0) goto error; + if(cur_size[0] != tmp_size[0]) { H5_FAILED(); - printf (" Got %d instead of %d!\n", - (int)tmp_size[0], (int)cur_size[0]); + printf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]); goto error; } - if (H5Dclose (dset1)<0) goto error; - if (H5Dclose (dset2)<0) goto error; - if (H5Sclose (space)<0) goto error; - if (H5Pclose (dcpl)<0) goto error; + if(H5Dclose(dset1) < 0) goto error; + if(H5Dclose(dset2) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Pclose(dcpl) < 0) goto error; + PASSED(); return 0; error: H5E_BEGIN_TRY { - H5Dclose (dset1); - H5Dclose (dset2); - H5Sclose (space); - H5Pclose (dcpl); + H5Dclose(dset1); + H5Dclose(dset2); + H5Sclose(space); + H5Pclose(dcpl); } H5E_END_TRY; return -1; } @@ -4694,30 +4694,30 @@ test_types(hid_t file) /* bitfield_1 */ nelmts = sizeof(buf); - if ((type=H5Tcopy(H5T_STD_B8LE))<0 || - (space=H5Screate_simple(1, &nelmts, NULL))<0 || - (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT))<0) + if ((type=H5Tcopy(H5T_STD_B8LE)) < 0 || + (space=H5Screate_simple(1, &nelmts, NULL)) < 0 || + (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT)) < 0) goto error; for (i=0; i max_size[0] || size[1] > max_size[1]) { + if(size[0] > max_size[0]) + max_size[0] = size[0]; + if(size[1] > max_size[1]) + max_size[1] = size[1]; + if(H5Dset_extent(dataset, max_size) < 0) TEST_ERROR; + } /* end if */ + + /* Select a hyperslab */ + if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR; + if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR; + + /* Write to the hyperslab */ + if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1) < 0) TEST_ERROR; + if(H5Sclose(file_space) < 0) TEST_ERROR; + } /* end for */ + + /* Read the data */ + if((half_space = H5Screate_simple(2, half_dims, NULL)) < 0) TEST_ERROR; + if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR; + for(i = 0; i < 10; i++) { + for(j = 0; j < 10; j++) { + + /* Select a hyperslab */ + offset[0] = i * (NX / 2); + offset[1] = j * (NY / 2); + if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR; + + /* Read */ + if(H5Dread(dataset, H5T_NATIVE_INT, half_space, file_space, H5P_DEFAULT, buf2) < 0) TEST_ERROR; + + /* Compare */ + for(k = 0; k < (NX / 2); k++) + for(m = 0; m < (NY / 2); m++) + if(buf2[k][m] != buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]) { + printf(" i=%d, j=%d, k=%d, m=%d\n", i, j, k, m); + printf(" buf2[%d][%d]=%d\n", k, m, buf2[k][m]); + printf(" buf1[%d][%d]=%d\n", (i % 2) * (NX / 2) + k, (j % 2) * (NY / 2) + m, buf1[(i % 2) * (NX / 2) + k][(j % 2) * (NY / 2) + m]); + TEST_ERROR; + } /* end if */ + } /* end for */ + } /* end for */ + + + /* Cleanup */ + if(H5Dclose(dataset) < 0) TEST_ERROR; + if(H5Sclose(file_space) < 0) TEST_ERROR; + if(H5Sclose(half_space) < 0) TEST_ERROR; + + PASSED(); + return 0; + +error: + return -1; +} /* end write_data() */ + +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/*------------------------------------------------------------------------- + * Function: write_data_deprec + * + * Purpose: Create extendible dataset and test extend/write/read, with + * deprecated API routine (H5Dextend) + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Quincey Koziol + * Monday, October 8, 2007 + * + *------------------------------------------------------------------------- + */ +static int +write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t mem_space) +{ + hid_t dataset, file_space, half_space; + static const hsize_t dims[2] = {NX, NY}; + static const hsize_t half_dims[2] = {NX / 2, NY / 2}; static hsize_t size[2]; hsize_t offset[2]; int i, j, k, m; TESTING(msg); - if ((dataset = H5Dcreate (file, name, H5T_NATIVE_INT, mem_space, - cparms))<0) TEST_ERROR; + /* Create the dataset */ + if((dataset = H5Dcreate(file, name, H5T_NATIVE_INT, mem_space, cparms)) < 0) TEST_ERROR; + /* Write the data */ - for (i=0; i<5; i++) { - for (j=0; j<5; j++) { + for(i = 0; i < 5; i++) + for(j = 0; j < 5; j++) { /* Extend the dataset */ offset[0] = i * NX; offset[1] = j * NY; size[0] = offset[0] + NX; size[1] = offset[1] + NY; - if (H5Dextend (dataset, size)<0) TEST_ERROR; + if(H5Dextend(dataset, size) < 0) TEST_ERROR; /* Select a hyperslab */ - if ((file_space = H5Dget_space (dataset))<0) TEST_ERROR; - if (H5Sselect_hyperslab (file_space, H5S_SELECT_SET, offset, - NULL, dims, NULL)<0) TEST_ERROR; + if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR; + if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR; /* Write to the hyperslab */ - if (H5Dwrite (dataset, H5T_NATIVE_INT, mem_space, file_space, - H5P_DEFAULT, buf1)<0) TEST_ERROR; - if (H5Sclose (file_space)<0) TEST_ERROR; - } - } + if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1) < 0) TEST_ERROR; + if(H5Sclose(file_space) < 0) TEST_ERROR; + } /* end for */ /* Read the data */ - if ((half_space = H5Screate_simple (2, half_dims, NULL))<0) TEST_ERROR; - if ((file_space = H5Dget_space (dataset))<0) TEST_ERROR; - for (i=0; i<10; i++) { - for (j=0; j<10; j++) { + if((half_space = H5Screate_simple(2, half_dims, NULL)) < 0) TEST_ERROR; + if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR; + for(i = 0; i < 10; i++) { + for(j = 0; j < 10; j++) { /* Select a hyperslab */ - offset[0] = i * NX/2; - offset[1] = j * NY/2; - if (H5Sselect_hyperslab (file_space, H5S_SELECT_SET, offset, - NULL, half_dims, NULL)<0) TEST_ERROR; + offset[0] = i * (NX / 2); + offset[1] = j * (NY / 2); + if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR; /* Read */ - if (H5Dread (dataset, H5T_NATIVE_INT, half_space, file_space, - H5P_DEFAULT, buf2)<0) TEST_ERROR; + if(H5Dread(dataset, H5T_NATIVE_INT, half_space, file_space, H5P_DEFAULT, buf2) < 0) TEST_ERROR; /* Compare */ - for (k=0; k0) goto error; - if (H5Fclose(file)<0) goto error; + if (H5Fclose(file) < 0) goto error; puts("All external storage tests passed."); if (h5_cleanup(FILENAME, fapl)) { remove("extern_1a.raw"); diff --git a/test/fillval.c b/test/fillval.c index 6d4597b..53ff8f3 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -1569,7 +1569,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, /* Extend the dataset one element in each dimension */ for(i = 0; i < 5; i++) extend_size[i] = start_size[i] + 1; - if(H5Dextend(dset, extend_size) < 0) TEST_ERROR + if(H5Dset_extent(dset, extend_size) < 0) TEST_ERROR /* Re-open file dataspace */ if(H5Sclose(fspace) < 0) TEST_ERROR @@ -1608,7 +1608,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, /* Extend the dataset to the maximum dimension sizes */ - if(H5Dextend(dset, max_size) < 0) TEST_ERROR + if(H5Dset_extent(dset, max_size) < 0) TEST_ERROR /* Re-open file dataspace */ if(H5Sclose(fspace) < 0) TEST_ERROR diff --git a/test/objcopy.c b/test/objcopy.c index 5e620fa..be6d236 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -2335,7 +2335,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) new_dim2d[1] = DIM_SIZE_2 * 2; /* Extend dataset's dimensions */ - if(H5Dextend(did, new_dim2d) < 0) TEST_ERROR + if(H5Dset_extent(did, new_dim2d) < 0) TEST_ERROR /* close dataspace */ if(H5Sclose(sid) < 0) TEST_ERROR diff --git a/test/testmeta.c b/test/testmeta.c index db97b28..74e9aa8 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -180,27 +180,24 @@ int main(void) status = H5Gclose(group_id); /* Extend attribute arrays */ - for(i=0; i= 0), ""); break; diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 40c7e0c..4f8de21 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -1238,8 +1238,8 @@ extend_writeInd(void) /* Extend its current dim sizes before writing */ dims[0] = dim0; dims[1] = dim1; - ret = H5Dextend (dataset1, dims); - VRFY((ret >= 0), "H5Dextend succeeded"); + ret = H5Dset_extent(dataset1, dims); + VRFY((ret >= 0), "H5Dset_extent succeeded"); /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); @@ -1298,8 +1298,8 @@ extend_writeInd(void) /* Extend dataset2 and try again. Should succeed. */ dims[0] = dim0; dims[1] = dim1; - ret = H5Dextend (dataset2, dims); - VRFY((ret >= 0), "H5Dextend succeeded"); + ret = H5Dset_extent(dataset2, dims); + VRFY((ret >= 0), "H5Dset_extent succeeded"); /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); @@ -1448,9 +1448,9 @@ extend_writeInd2(void) /* ------------------------- * Extend the dataset & retrieve new dataspace * -------------------------*/ - ret =H5Dextend(dataset, &new_size); - VRFY((ret >= 0), "H5Dextend succeeded"); - ret=H5Sclose(fs); + ret = H5Dset_extent(dataset, &new_size); + VRFY((ret >= 0), "H5Dset_extent succeeded"); + ret = H5Sclose(fs); VRFY((ret >= 0), "H5Sclose succeeded"); fs = H5Dget_space(dataset); VRFY((fs >= 0), "H5Dget_space succeeded"); @@ -1572,11 +1572,11 @@ extend_readInd(void) file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sget_simple_extent_dims(file_dataspace, dims, NULL); + ret = H5Sget_simple_extent_dims(file_dataspace, dims, NULL); VRFY((ret > 0), "H5Sget_simple_extent_dims succeeded"); dims[0]++; - ret=H5Dextend(dataset1, dims); - VRFY((ret < 0), "H5Dextend failed as expected"); + ret = H5Dset_extent(dataset1, dims); + VRFY((ret < 0), "H5Dset_extent failed as expected"); /* restore auto error reporting */ H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data); @@ -1812,8 +1812,8 @@ extend_writeAll(void) /* Extend its current dim sizes before writing */ dims[0] = dim0; dims[1] = dim1; - ret = H5Dextend (dataset1, dims); - VRFY((ret >= 0), "H5Dextend succeeded"); + ret = H5Dset_extent(dataset1, dims); + VRFY((ret >= 0), "H5Dset_extent succeeded"); /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); @@ -1895,8 +1895,8 @@ extend_writeAll(void) /* Extend dataset2 and try again. Should succeed. */ dims[0] = dim0; dims[1] = dim1; - ret = H5Dextend (dataset2, dims); - VRFY((ret >= 0), "H5Dextend succeeded"); + ret = H5Dset_extent(dataset2, dims); + VRFY((ret >= 0), "H5Dset_extent succeeded"); /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); @@ -2004,11 +2004,11 @@ extend_readAll(void) file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sget_simple_extent_dims(file_dataspace, dims, NULL); + ret = H5Sget_simple_extent_dims(file_dataspace, dims, NULL); VRFY((ret > 0), "H5Sget_simple_extent_dims succeeded"); dims[0]++; - ret=H5Dextend(dataset1, dims); - VRFY((ret < 0), "H5Dextend failed as expected"); + ret = H5Dset_extent(dataset1, dims); + VRFY((ret < 0), "H5Dset_extent failed as expected"); /* restore auto error reporting */ H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data); -- cgit v0.12