summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-05-07 19:37:48 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-05-07 19:37:48 (GMT)
commitbbe03d73613afbcdeca14c045c8b90fac37e0fe8 (patch)
tree6c6468ecf923ad7f1101e0719d2af1894e63ad64 /src
parentc952661afbac41d4bf2622899bf2a4c2c02b07b5 (diff)
downloadhdf5-bbe03d73613afbcdeca14c045c8b90fac37e0fe8.zip
hdf5-bbe03d73613afbcdeca14c045c8b90fac37e0fe8.tar.gz
hdf5-bbe03d73613afbcdeca14c045c8b90fac37e0fe8.tar.bz2
[svn-r10736] Purpose:
Code cleanup Description: Clean up some compiler warnings Platforms tested: FreeBSD 4.11 (sleipnir) h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5.c2
-rw-r--r--src/H5A.c6
-rw-r--r--src/H5B.c12
-rw-r--r--src/H5Bpkg.h2
-rw-r--r--src/H5C.c2
-rw-r--r--src/H5Dprivate.h2
-rw-r--r--src/H5E.c4
-rw-r--r--src/H5F.c28
-rw-r--r--src/H5Fpkg.h10
-rw-r--r--src/H5G.c4
-rw-r--r--src/H5Gpkg.h2
-rw-r--r--src/H5Ipublic.h1
-rw-r--r--src/H5Opkg.h2
-rw-r--r--src/H5P.c2
-rw-r--r--src/H5SHcache.c2
-rw-r--r--src/H5T.c4
-rw-r--r--src/H5Znbit.c6
-rw-r--r--src/H5Zscaleoffset.c19
-rw-r--r--src/H5public.h2
19 files changed, 59 insertions, 53 deletions
diff --git a/src/H5.c b/src/H5.c
index ab488ba..821ee3a 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -1564,7 +1564,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
if (argname) {
unsigned n = (unsigned)MAX (0, (int)HDstrlen(argname)-3); /*lint !e666 Allow expression with side effects */
if (!HDstrcmp (argname+n, "_id")) {
- HDstrncpy (buf, argname, MIN ((int)sizeof(buf)-1, n));
+ HDstrncpy (buf, argname, (size_t)MIN ((int)sizeof(buf)-1, n));
buf[MIN((int)sizeof(buf)-1, n)] = '\0';
argname = buf;
}
diff --git a/src/H5A.c b/src/H5A.c
index 863cf75..a8acc3a 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -77,7 +77,7 @@ H5A_init_interface(void)
/*
* Create attribute group.
*/
- if (H5I_register_type(H5I_ATTR, H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, (H5I_free_t)H5A_close)<H5I_FILE)
+ if (H5I_register_type(H5I_ATTR, (size_t)H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, (H5I_free_t)H5A_close)<H5I_FILE)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to initialize interface")
done:
@@ -692,7 +692,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id)
HDmemcpy(tconv_buf,buf,(src_type_size*nelmts));
/* Perform datatype conversion */
- if (H5T_convert(tpath, src_id, dst_id, nelmts, 0, 0, tconv_buf, bkg_buf, dxpl_id)<0)
+ if (H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id)<0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed")
/* Free the previous attribute data buffer, if there is one */
@@ -858,7 +858,7 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id)
HDmemcpy(tconv_buf,attr->data,(src_type_size*nelmts));
/* Perform datatype conversion. */
- if (H5T_convert(tpath, src_id, dst_id, nelmts, 0, 0, tconv_buf, bkg_buf, dxpl_id)<0)
+ if (H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id)<0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed")
/* Copy the converted data into the user's buffer */
diff --git a/src/H5B.c b/src/H5B.c
index 525e12e..aa752cf 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -230,7 +230,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata,
shared=H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
if (NULL==(bt->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) ||
- NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,shared->two_k)))
+ NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree root node")
if (HADDR_UNDEF==(*addr_p=H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)shared->sizeof_rnode)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree root node")
@@ -307,7 +307,7 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
shared=H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
if (NULL==(bt->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) ||
- NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,shared->two_k)))
+ NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
if (H5F_block_read(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page)<0)
@@ -316,7 +316,7 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
p = shared->page;
/* magic number */
- if (HDmemcmp(p, H5B_MAGIC, H5B_SIZEOF_MAGIC))
+ if (HDmemcmp(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree signature")
p += 4;
@@ -400,7 +400,7 @@ H5B_serialize(const H5F_t *f, const H5B_t *bt)
p = shared->page;
/* magic number */
- HDmemcpy(p, H5B_MAGIC, H5B_SIZEOF_MAGIC);
+ HDmemcpy(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC);
p += 4;
/* node type and level */
@@ -1537,7 +1537,7 @@ H5B_iterate (H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op
* We've reached the left-most leaf. Now follow the right-sibling
* pointer from leaf to leaf until we've processed all leaves.
*/
- if (NULL==(child=H5FL_SEQ_MALLOC(haddr_t,shared->two_k)) ||
+ if (NULL==(child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)) ||
NULL==(key=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
@@ -2114,7 +2114,7 @@ H5B_copy(const H5B_t *old_bt)
HDmemcpy(new_node,old_bt,sizeof(H5B_t));
if ( NULL==(new_node->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) ||
- NULL==(new_node->child=H5FL_SEQ_MALLOC(haddr_t,shared->two_k)))
+ NULL==(new_node->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree root node")
/* Copy the other structures */
diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h
index 37047e7..74fa393 100644
--- a/src/H5Bpkg.h
+++ b/src/H5Bpkg.h
@@ -49,9 +49,9 @@ struct H5B_t {
/* first field in structure */
H5RC_t *rc_shared; /*ref-counted shared info */
unsigned level; /*node level */
+ unsigned nchildren; /*number of child pointers */
haddr_t left; /*address of left sibling */
haddr_t right; /*address of right sibling */
- unsigned nchildren; /*number of child pointers */
uint8_t *native; /*array of keys in native format */
haddr_t *child; /*2k child pointers */
};
diff --git a/src/H5C.c b/src/H5C.c
index 0e1064a..28cb17a 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -1919,7 +1919,7 @@ H5C_create(size_t max_cache_size,
"memory allocation failed")
}
- if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,16))
+ if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16))
== NULL ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.")
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h
index d6d2333..732af1f 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -192,12 +192,12 @@ typedef struct H5D_dxpl_cache_t {
void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */
void *bkgr_buf; /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */
H5T_bkg_t bkgr_buf_type; /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */
+ H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */
double btree_split_ratio[3];/* B-tree split ratios (H5D_XFER_BTREE_SPLIT_RATIO_NAME) */
size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */
#endif /*H5_HAVE_PARALLEL*/
- H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */
H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */
H5Z_data_xform_t *data_xform_prop; /* Data transform prop (H5D_XFER_XFORM_NAME) */
} H5D_dxpl_cache_t;
diff --git a/src/H5E.c b/src/H5E.c
index 74c67fa..2323288 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -105,7 +105,7 @@ static herr_t H5E_set_current_stack(H5E_t *estack);
static herr_t H5E_close_stack(H5E_t *err_stack);
static int H5E_get_num(const H5E_t *err_stack);
static herr_t H5E_pop(H5E_t *err_stack, size_t count);
-static herr_t H5E_clear_entries(H5E_t *estack, unsigned nentries);
+static herr_t H5E_clear_entries(H5E_t *estack, size_t nentries);
static herr_t H5E_print_stack(const H5E_t *estack, FILE *stream);
static herr_t H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func,
void *client_data);
@@ -1755,7 +1755,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5E_clear_entries(H5E_t *estack, unsigned nentries)
+H5E_clear_entries(H5E_t *estack, size_t nentries)
{
H5E_error_t *error; /* Pointer to error stack entry to clear */
unsigned u; /* Local index variable */
diff --git a/src/H5F.c b/src/H5F.c
index 8ad29cb..442baac 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -227,8 +227,8 @@ H5F_init_interface(void)
* which are pending completion because there are object headers still
* open within the file.
*/
- if (H5I_register_type(H5I_FILE, H5I_FILEID_HASHSIZE, 0, (H5I_free_t)H5F_close)<H5I_FILE ||
- H5I_register_type(H5I_FILE_CLOSING, H5I_FILEID_HASHSIZE, 0, (H5I_free_t)H5F_close)<H5I_FILE)
+ if (H5I_register_type(H5I_FILE, (size_t)H5I_FILEID_HASHSIZE, 0, (H5I_free_t)H5F_close)<H5I_FILE ||
+ H5I_register_type(H5I_FILE_CLOSING, (size_t)H5I_FILEID_HASHSIZE, 0, (H5I_free_t)H5F_close)<H5I_FILE)
HGOTO_ERROR (H5E_FILE, H5E_CANTINIT, FAIL, "unable to initialize interface")
/* ========== File Creation Property Class Initialization ============*/
@@ -1304,9 +1304,9 @@ H5F_locate_signature(H5FD_t *file, hid_t dxpl_id)
addr = (8==n) ? 0 : (haddr_t)1 << n;
if (H5FD_set_eoa(file, addr+H5F_SIGNATURE_LEN)<0)
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to set EOA value for file signature")
- if (H5FD_read(file, H5FD_MEM_SUPER, dxpl_id, addr, H5F_SIGNATURE_LEN, buf)<0)
+ if (H5FD_read(file, H5FD_MEM_SUPER, dxpl_id, addr, (size_t)H5F_SIGNATURE_LEN, buf)<0)
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to read file signature")
- if (!HDmemcmp(buf, H5F_SIGNATURE, H5F_SIGNATURE_LEN))
+ if (!HDmemcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN))
break;
}
@@ -1955,7 +1955,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
#endif /* H5_HAVE_FPHDF5 */
/* Read the superblock if it hasn't been read before. */
- if (H5F_read_superblock(file, dxpl_id, &root_ent, HADDR_UNDEF, NULL, 0) < 0)
+ if (H5F_read_superblock(file, dxpl_id, &root_ent, HADDR_UNDEF, NULL, (size_t)0) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
#ifdef H5_HAVE_FPHDF5
@@ -2523,7 +2523,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr
dbuf_size=sizeof(dbuf);
if (H5FD_set_eoa(lf, drv_addr + 16) < 0 ||
- H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, drv_addr, 16, p) < 0)
+ H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, drv_addr, (size_t)16, p) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read driver information block")
} /* end if */
else {
@@ -2541,7 +2541,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr
UINT32DECODE(p, driver_size);
/* Driver name and/or version */
- HDstrncpy(driver_name, (const char *)p, 8);
+ HDstrncpy(driver_name, (const char *)p, (size_t)8);
driver_name[8] = '\0';
p += 8; /* advance past name/version */
@@ -2754,7 +2754,7 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id, uint8_t *buf)
/* Encode the file super block */
p = sbuf;
- HDmemcpy(p, H5F_SIGNATURE, H5F_SIGNATURE_LEN);
+ HDmemcpy(p, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN);
p += H5F_SIGNATURE_LEN;
*p++ = (uint8_t)super_vers;
*p++ = (uint8_t)freespace_vers;
@@ -2817,7 +2817,7 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id, uint8_t *buf)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information")
/* Driver name */
- HDmemcpy(dbuf + 8, driver_name, 8);
+ HDmemcpy(dbuf + 8, driver_name, (size_t)8);
} /* end if */
/* Compute super block checksum */
@@ -3103,7 +3103,7 @@ H5F_close(H5F_t *f)
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5F_close, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT(H5F_close)
assert(f->nrefs>0);
@@ -3232,7 +3232,7 @@ H5F_close(H5F_t *f)
int i; /* Local index variable */
/* Get the list of IDs of open dataset objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATASET, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATASET, (int)(sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -3241,7 +3241,7 @@ H5F_close(H5F_t *f)
} /* end while */
/* Get the list of IDs of open group objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_GROUP, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_GROUP, (int)(sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -3250,7 +3250,7 @@ H5F_close(H5F_t *f)
} /* end while */
/* Get the list of IDs of open named datatype objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATATYPE, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATATYPE, (int)(sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -3259,7 +3259,7 @@ H5F_close(H5F_t *f)
} /* end while */
/* Get the list of IDs of open attribute objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_ATTR, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_ATTR, (int)(sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index c281da3..17dcfdc 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -78,16 +78,16 @@
* pointing to this struct.
*/
typedef struct H5F_file_t {
- unsigned flags; /* Access Permissions for file */
H5FD_t *lf; /* Lower level file handle for I/O */
unsigned nrefs; /* Ref count for times file is opened */
uint32_t consist_flags; /* File Consistency Flags */
+ unsigned flags; /* Access Permissions for file */
/* Cached values from FCPL */
- size_t sizeof_addr; /* Size of addresses in file */
- size_t sizeof_size; /* Size of offsets in file */
unsigned sym_leaf_k; /* Size of leaves in symbol tables */
unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */
+ size_t sizeof_addr; /* Size of addresses in file */
+ size_t sizeof_size; /* Size of offsets in file */
haddr_t super_addr; /* Absolute address of super block */
haddr_t base_addr; /* Absolute base address for rel.addrs. */
haddr_t freespace_addr; /* Relative address of free-space info */
@@ -102,6 +102,7 @@ typedef struct H5F_file_t {
/* fixed at creation time and should */
/* not change thereafter. */
hid_t fcpl_id; /* File creation property list ID */
+ H5F_close_degree_t fc_degree; /* File close behavior degree */
size_t rdcc_nelmts; /* Size of raw data chunk cache (elmts) */
size_t rdcc_nbytes; /* Size of raw data chunk cache (bytes) */
double rdcc_w0; /* Preempt read chunks first? [0.0..1.0]*/
@@ -109,11 +110,10 @@ typedef struct H5F_file_t {
hsize_t threshold; /* Threshold for alignment */
hsize_t alignment; /* Alignment */
unsigned gc_ref; /* Garbage-collect references? */
- struct H5G_t *root_grp; /* Open root group */
int ncwfs; /* Num entries on cwfs list */
struct H5HG_heap_t **cwfs; /* Global heap cache */
+ struct H5G_t *root_grp; /* Open root group */
H5FO_t *open_objs; /* Open objects in file */
- H5F_close_degree_t fc_degree; /* File close behavior degree */
H5RC_t *grp_btree_shared; /* Ref-counted group B-tree node info */
} H5F_file_t;
diff --git a/src/H5G.c b/src/H5G.c
index 7f0b9ca..fa4bbfb 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -975,7 +975,7 @@ H5G_init_interface(void)
FUNC_ENTER_NOAPI_NOINIT(H5G_init_interface);
/* Initialize the atom group for the group IDs */
- if (H5I_register_type(H5I_GROUP, H5I_GROUPID_HASHSIZE, H5G_RESERVED_ATOMS,
+ if (H5I_register_type(H5I_GROUP, (size_t)H5I_GROUPID_HASHSIZE, H5G_RESERVED_ATOMS,
(H5I_free_t)H5G_close) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to initialize interface");
@@ -1700,7 +1700,7 @@ H5G_mkroot (H5F_t *f, hid_t dxpl_id, H5G_entry_t *ent)
if (!ent) {
ent = &new_root;
HDmemset(ent, 0, sizeof(H5G_entry_t));
- if (H5G_stab_create (f, dxpl_id, H5G_SIZE_HINT, ent/*out*/)<0)
+ if (H5G_stab_create (f, dxpl_id, (size_t)H5G_SIZE_HINT, ent/*out*/)<0)
HGOTO_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "unable to create root group");
if (1 != H5O_link (ent, 1, dxpl_id))
HGOTO_ERROR (H5E_SYM, H5E_LINK, FAIL, "internal error (wrong link count)");
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index 9bee5ee..47056d4 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -97,9 +97,9 @@ typedef struct H5G_bt_ud2_t {
/* downward */
hid_t group_id; /*group id to pass to iteration operator */
H5G_entry_t *ent; /*the entry to which group_id points */
- int skip; /*initial entries to skip */
H5G_iterate_t op; /*iteration operator */
void *op_data; /*user-defined operator data */
+ int skip; /*initial entries to skip */
/* upward */
int final_ent; /*final entry looked at */
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index 0f6e1b7..78915a6 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -54,6 +54,7 @@ typedef enum H5I_type_t {
/* Type of atoms to return to users */
typedef int hid_t;
+#define H5_SIZEOF_HID_T H5_SIZEOF_INT
/* An invalid object ID. This is also negative for error return. */
#define H5I_INVALID_HID (-1)
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index 5735d9c..116c223 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -77,10 +77,10 @@ typedef struct H5O_mesg_t {
const H5O_class_t *type; /*type of message */
hbool_t dirty; /*raw out of date wrt native */
uint8_t flags; /*message flags */
+ unsigned chunkno; /*chunk number for this mesg */
void *native; /*native format message */
uint8_t *raw; /*ptr to raw data */
size_t raw_size; /*size with alignment */
- unsigned chunkno; /*chunk number for this mesg */
} H5O_mesg_t;
typedef struct H5O_chunk_t {
diff --git a/src/H5P.c b/src/H5P.c
index c11a3ec..fc3359f 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -5166,7 +5166,7 @@ H5P_close(void *_plist)
H5SL_t *seen=NULL; /* Skip list to hold names of properties already seen */
size_t nseen; /* Number of items 'seen' */
hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */
- ssize_t ndel; /* Number of items deleted */
+ size_t ndel; /* Number of items deleted */
H5SL_node_t *curr_node; /* Current node in skip list */
H5P_genprop_t *tmp; /* Temporary pointer to properties */
unsigned make_cb=0; /* Operator data for property free callback */
diff --git a/src/H5SHcache.c b/src/H5SHcache.c
index e8cdf30..5a57084 100644
--- a/src/H5SHcache.c
+++ b/src/H5SHcache.c
@@ -122,7 +122,7 @@ H5SH_cache_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1
HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong segmented heap info version")
/* Type of data in heap blocks */
- sh->heap_type = *p++;
+ sh->heap_type = (H5SH_data_type_t)*p++;
if(sh->heap_type == H5SH_RAW)
sh->file_mem_type = H5FD_MEM_DRAW;
else
diff --git a/src/H5T.c b/src/H5T.c
index bc20caf..0c41d7f 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -675,7 +675,9 @@ H5T_init_interface(void)
H5T_t *native_ullong=NULL; /* Datatype structure for native unsigned llong */
H5T_t *native_float=NULL; /* Datatype structure for native float */
H5T_t *native_double=NULL; /* Datatype structure for native double */
+#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
H5T_t *native_ldouble=NULL; /* Datatype structure for native double */
+#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
H5T_t *std_u8le=NULL; /* Datatype structure for unsigned 8-bit little-endian integer */
H5T_t *std_u8be=NULL; /* Datatype structure for unsigned 8-bit big-endian integer */
H5T_t *std_u16le=NULL; /* Datatype structure for unsigned 16-bit little-endian integer */
@@ -747,8 +749,10 @@ H5T_init_interface(void)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object");
if (NULL==(native_double=H5I_object(H5T_NATIVE_DOUBLE_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object");
+#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
if (NULL==(native_ldouble=H5I_object(H5T_NATIVE_LDOUBLE_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object");
+#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
/*------------------------------------------------------------
* Native types
diff --git a/src/H5Znbit.c b/src/H5Znbit.c
index ab47461..938528c 100644
--- a/src/H5Znbit.c
+++ b/src/H5Znbit.c
@@ -130,18 +130,16 @@ static unsigned parms_index = 0;
static herr_t
H5Z_can_apply_nbit(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id)
{
- H5T_class_t dtype_class; /* Datatype's class */
- unsigned dtype_size; /* Datatype's size (in bytes) */
herr_t ret_value=TRUE; /* Return value */
FUNC_ENTER_NOAPI(H5Z_can_apply_nbit, FAIL)
/* Get datatype's class, for checking the "datatype class" */
- if((dtype_class = H5Tget_class(type_id)) == H5T_NO_CLASS )
+ if(H5Tget_class(type_id) == H5T_NO_CLASS )
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class")
/* Get datatype's size, for checking the "datatype size" */
- if((dtype_size = H5Tget_size(type_id)) == 0)
+ if(H5Tget_size(type_id) == 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
done:
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 417d60b..cfbe59c 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -31,7 +31,7 @@ typedef struct {
unsigned mem_order; /* current memory endianness order */
} parms_atomic;
-enum H5Z_scaleoffset_type {t_uchar=1, t_ushort, t_uint, t_ulong, t_ulong_long,
+enum H5Z_scaleoffset_type {t_bad=0, t_uchar=1, t_ushort, t_uint, t_ulong, t_ulong_long,
t_schar, t_short, t_int, t_long, t_long_long,
t_float, t_double};
@@ -584,7 +584,6 @@ static herr_t
H5Z_can_apply_scaleoffset(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id)
{
H5T_class_t dtype_class; /* Datatype's class */
- unsigned dtype_size; /* Datatype's size (in bytes) */
H5T_order_t dtype_order; /* Datatype's endianness order */
herr_t ret_value=TRUE; /* Return value */
@@ -595,7 +594,7 @@ H5Z_can_apply_scaleoffset(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED spac
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class")
/* Get datatype's size, for checking the "datatype size" */
- if((dtype_size = H5Tget_size(type_id)) == 0)
+ if(H5Tget_size(type_id) == 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
if(dtype_class == H5T_INTEGER || dtype_class == H5T_FLOAT) {
@@ -634,9 +633,9 @@ static enum H5Z_scaleoffset_type
H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign)
{
enum H5Z_scaleoffset_type type; /* integer type */
- unsigned ret_value; /* return value */
+ enum H5Z_scaleoffset_type ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5Z_scaleoffset_get_type, 0)
+ FUNC_ENTER_NOAPI_NOINIT(H5Z_scaleoffset_get_type)
if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) {
if(dtype_sign==H5Z_SCALEOFFSET_SGN_NONE) { /* unsigned integer */
@@ -646,7 +645,7 @@ H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dty
else if(dtype_size == sizeof(unsigned long)) type = t_ulong;
else if(dtype_size == sizeof(unsigned long_long)) type = t_ulong_long;
else
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot find matched memory dataype")
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype")
}
if(dtype_sign==H5Z_SCALEOFFSET_SGN_2) { /* signed integer */
@@ -656,7 +655,7 @@ H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dty
else if(dtype_size == sizeof(long)) type = t_long;
else if(dtype_size == sizeof(long_long)) type = t_long_long;
else
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot find matched memory dataype")
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype")
}
}
@@ -664,11 +663,13 @@ H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dty
if(dtype_size == sizeof(float)) type = t_float;
else if(dtype_size == sizeof(double)) type = t_double;
else
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot find matched memory dataype")
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype")
}
-done:
+ /* Set return value */
ret_value = type;
+
+done:
FUNC_LEAVE_NOAPI(ret_value)
}
diff --git a/src/H5public.h b/src/H5public.h
index d4ccce1..ce4aa22 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -152,11 +152,13 @@ typedef long_long ssize_t;
typedef unsigned long_long hsize_t;
typedef signed long_long hssize_t;
# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG
+# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG
# endif
#else /* H5_HAVE_LARGE_HSIZET */
typedef size_t hsize_t;
typedef ssize_t hssize_t;
# define H5_SIZEOF_HSIZE_T H5_SIZEOF_SIZE_T
+# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_SIZE_T
#endif /* H5_HAVE_LARGE_HSIZET */
/*