diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-13 04:52:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-06-13 04:52:22 (GMT) |
commit | 97b6832023ceb7665750de6a0adb3e67c5961df2 (patch) | |
tree | f8894636f01d284a508925d3f165a6b246606295 /src/H5A.c | |
parent | 97e6dc5d876d4e772fd65727f6b9b2c4367cb080 (diff) | |
download | hdf5-97b6832023ceb7665750de6a0adb3e67c5961df2.zip hdf5-97b6832023ceb7665750de6a0adb3e67c5961df2.tar.gz hdf5-97b6832023ceb7665750de6a0adb3e67c5961df2.tar.bz2 |
[svn-r15211] Description:
Update the gcc flags for version 4.3
Clean up warnings
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.5.3 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5A.c')
-rw-r--r-- | src/H5A.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -360,9 +360,11 @@ hid_t H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, const H5S_t *space, hid_t acpl_id, hid_t dxpl_id) { - H5A_t *attr = NULL; - htri_t tri_ret; /* htri_t return value */ - hid_t ret_value; /* Return value */ + H5A_t *attr = NULL; + hssize_t snelmts; /* elements in attribute */ + size_t nelmts; /* elements in attribute */ + htri_t tri_ret; /* htri_t return value */ + hid_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5A_create) @@ -463,9 +465,14 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, attr->dt_size = H5O_msg_raw_size(attr->oloc.file, H5O_DTYPE_ID, FALSE, attr->dt); attr->ds_size = H5O_msg_raw_size(attr->oloc.file, H5O_SDSPACE_ID, FALSE, attr->ds); + /* Get # of elements for attribute's dataspace */ + if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->ds)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, size_t); + HDassert(attr->dt_size > 0); HDassert(attr->ds_size > 0); - H5_ASSIGN_OVERFLOW(attr->data_size, H5S_GET_EXTENT_NPOINTS(attr->ds) * H5T_get_size(attr->dt), hssize_t, size_t); + attr->data_size = nelmts * H5T_get_size(attr->dt); /* Hold the symbol table entry (and file) open */ if(H5O_open(&(attr->oloc)) < 0) |