summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKimmy Mu <kmu@hdfgroup.org>2020-01-06 18:17:10 (GMT)
committerKimmy Mu <kmu@hdfgroup.org>2020-01-06 18:17:10 (GMT)
commit127f07d64affc285e729923b514b4d7f3c19ceeb (patch)
treecc3a3eef4845d8b6c134e15d60e97aece8a8455c /src
parent4f98de52d64a283b6ff63281c2e06365b3b94df0 (diff)
parent0a2bb11b248df6841daabca3970df5d8504adfc7 (diff)
downloadhdf5-127f07d64affc285e729923b514b4d7f3c19ceeb.zip
hdf5-127f07d64affc285e729923b514b4d7f3c19ceeb.tar.gz
hdf5-127f07d64affc285e729923b514b4d7f3c19ceeb.tar.bz2
Merge pull request #2071 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/intel_warnings to develop
* commit '0a2bb11b248df6841daabca3970df5d8504adfc7': address problems from comments fix and address comments change according to previous comments add missing piece remove unnecessary check macro fix intel compile warnings Revert "fix warnings from Intel compiler" Revert "fix warnings and some text alignment" Revert "let hdf5 pick up the right compiler in Intel environment" Revert "fix issues from previous PR comments" Revert "using a different MACRO" using a different MACRO fix issues from previous PR comments let hdf5 pick up the right compiler in Intel environment fix warnings and some text alignment fix warnings from Intel compiler
Diffstat (limited to 'src')
-rw-r--r--src/H5Aint.c2
-rw-r--r--src/H5B2cache.c9
-rw-r--r--src/H5B2int.c14
-rw-r--r--src/H5Dchunk.c14
-rw-r--r--src/H5EAcache.c12
-rw-r--r--src/H5FAcache.c6
-rw-r--r--src/H5FScache.c8
-rw-r--r--src/H5Fprivate.h2
-rw-r--r--src/H5HFtest.c2
-rw-r--r--src/H5Oainfo.c2
-rw-r--r--src/H5Oattr.c2
-rw-r--r--src/H5Ofill.c4
-rw-r--r--src/H5Ofsinfo.c4
-rw-r--r--src/H5Oginfo.c4
-rw-r--r--src/H5Oint.c4
-rw-r--r--src/H5Olayout.c2
-rw-r--r--src/H5Olinfo.c2
-rw-r--r--src/H5Olink.c2
-rw-r--r--src/H5Osdspace.c2
-rw-r--r--src/H5Rint.c2
-rw-r--r--src/H5SMcache.c2
-rw-r--r--src/H5SMmessage.c2
-rw-r--r--src/H5Shyper.c2
-rw-r--r--src/H5Sprivate.h2
-rw-r--r--src/H5Sselect.c4
-rw-r--r--src/H5Tbit.c4
-rw-r--r--src/H5Ztrans.c2
27 files changed, 62 insertions, 55 deletions
diff --git a/src/H5Aint.c b/src/H5Aint.c
index 02d35e3..90fb5c8 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -2027,7 +2027,7 @@ H5A__set_version(const H5F_t *f, H5A_t *attr)
version = H5O_ATTR_VERSION_1; /* Write out basic version */
/* Upgrade to the version indicated by the file's low bound if higher */
- version = MAX(version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]);
+ version = (uint8_t)MAX(version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]);
/* Version bounds check */
if(version > H5O_attr_ver_bounds[H5F_HIGH_BOUND(f)])
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index 2a77bd5..65286e6 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -398,7 +398,8 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5B2_HDR_VERSION;
/* B-tree type */
- *image++ = hdr->cls->id;
+ HDassert(hdr->cls->id <= 255);
+ *image++ = (uint8_t)hdr->cls->id;
/* Node size (in bytes) */
UINT32ENCODE(image, hdr->node_size);
@@ -818,7 +819,8 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5B2_INT_VERSION;
/* B-tree type */
- *image++ = internal->hdr->cls->id;
+ HDassert(internal->hdr->cls->id <= 255);
+ *image++ = (uint8_t)internal->hdr->cls->id;
HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));
/* Serialize records for internal node */
@@ -1219,7 +1221,8 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H
*image++ = H5B2_LEAF_VERSION;
/* B-tree type */
- *image++ = leaf->hdr->cls->id;
+ HDassert(leaf->hdr->cls->id <= 255);
+ *image++ = (uint8_t)leaf->hdr->cls->id;
HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));
/* Serialize records for leaf node */
diff --git a/src/H5B2int.c b/src/H5B2int.c
index 2d77276..ea03ed6 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -239,7 +239,7 @@ H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr,
old_node_nrec = internal->node_ptrs[idx].node_nrec;
/* Determine "middle" record to promote to internal node */
- mid_record = old_node_nrec / 2;
+ mid_record = (uint16_t)(old_node_nrec / 2);
/* Copy "upper half" of records to new child */
H5MM_memcpy(H5B2_NAT_NREC(right_native, hdr, 0),
@@ -507,8 +507,8 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
if(*left_nrec < *right_nrec) {
/* Moving record from right node to left */
- uint16_t new_right_nrec = (uint16_t)(*left_nrec + *right_nrec) / 2; /* New number of records for right child */
- uint16_t move_nrec = (uint16_t)(*right_nrec - new_right_nrec); /* Number of records to move from right node to left */
+ uint16_t new_right_nrec = (uint16_t)((*left_nrec + *right_nrec) / 2); /* New number of records for right child */
+ uint16_t move_nrec = (uint16_t)(*right_nrec - new_right_nrec); /* Number of records to move from right node to left */
/* Copy record from parent node down into left child */
H5MM_memcpy(H5B2_NAT_NREC(left_native, hdr, *left_nrec), H5B2_INT_NREC(internal, hdr, idx), hdr->cls->nrec_size);
@@ -558,8 +558,8 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
else {
/* Moving record from left node to right */
- uint16_t new_left_nrec = (uint16_t)(*left_nrec + *right_nrec) / 2; /* New number of records for left child */
- uint16_t move_nrec = (uint16_t)(*left_nrec - new_left_nrec); /* Number of records to move from left node to right */
+ uint16_t new_left_nrec = (uint16_t)((*left_nrec + *right_nrec) / 2); /* New number of records for left child */
+ uint16_t move_nrec = (uint16_t)(*left_nrec - new_left_nrec); /* Number of records to move from left node to right */
/* Sanity check */
HDassert(*left_nrec > *right_nrec);
@@ -762,8 +762,8 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
{
/* Compute new # of records in each node */
unsigned total_nrec = (unsigned)(*left_nrec + *middle_nrec + *right_nrec + 2);
- uint16_t new_middle_nrec = (uint16_t)(total_nrec - 2) / 3;
- uint16_t new_left_nrec = (uint16_t)((total_nrec - 2) - new_middle_nrec) / 2;
+ uint16_t new_middle_nrec = (uint16_t)((total_nrec - 2) / 3);
+ uint16_t new_left_nrec = (uint16_t)(((total_nrec - 2) - new_middle_nrec) / 2);
uint16_t new_right_nrec = (uint16_t)((total_nrec - 2) - (unsigned)(new_left_nrec + new_middle_nrec));
uint16_t curr_middle_nrec = *middle_nrec;
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 9f88505..17b0d16 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -2166,7 +2166,7 @@ H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm)
/* Iterate over each chunk in the chunk list */
curr_node = H5SL_first(fm->sel_chunks);
while(curr_node) {
- hssize_t schunk_points; /* Number of elements in chunk selection */
+ hsize_t chunk_points; /* Number of elements in chunk selection */
hsize_t tmp_count = 1;
/* Get pointer to chunk's information */
@@ -2177,12 +2177,12 @@ H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm)
if((chunk_info->mspace = H5S_copy(fm->mem_space, TRUE, FALSE)) == NULL)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space")
- schunk_points = H5S_GET_SELECT_NPOINTS(chunk_info->fspace);
+ chunk_points = H5S_GET_SELECT_NPOINTS(chunk_info->fspace);
- if(H5S_select_hyperslab(chunk_info->mspace, H5S_SELECT_SET, mem_sel_start, NULL, &tmp_count, &schunk_points) < 0)
+ if(H5S_select_hyperslab(chunk_info->mspace, H5S_SELECT_SET, mem_sel_start, NULL, &tmp_count, &chunk_points) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "can't create chunk memory selection")
- mem_sel_start[0] += schunk_points;
+ mem_sel_start[0] += chunk_points;
/* Get the next chunk node in the skip list */
curr_node = H5SL_next(curr_node);
@@ -5651,9 +5651,8 @@ H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
H5D_chunk_it_ud2_t *udata = (H5D_chunk_it_ud2_t *)_udata; /* User data for callback */
unsigned rank = udata->common.layout->ndims - 1; /* # of dimensions of dataset */
hsize_t chunk_index;
- int ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_STATIC
+ FUNC_ENTER_STATIC_NOERR
/* Compute the index for this chunk */
chunk_index = H5VM_array_offset_pre(rank, udata->common.layout->down_chunks, chunk_rec->scaled);
@@ -5661,8 +5660,7 @@ H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
/* Set it in the userdata to return */
udata->chunk_addr[chunk_index] = chunk_rec->chunk_addr;
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(H5_ITER_CONT)
} /* H5D__chunk_addrmap_cb() */
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index da67e6b..1fd9c44 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -487,7 +487,8 @@ H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5EA_HDR_VERSION;
/* Extensible array type */
- *image++ = hdr->cparam.cls->id;
+ HDassert(hdr->cparam.cls->id <= 255);
+ *image++ = (uint8_t)hdr->cparam.cls->id;
/* General array creation/configuration information */
*image++ = hdr->cparam.raw_elmt_size; /* Element size in file (in bytes) */
@@ -875,7 +876,8 @@ H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED
*image++ = H5EA_IBLOCK_VERSION;
/* Extensible array type */
- *image++ = iblock->hdr->cparam.cls->id;
+ HDassert(iblock->hdr->cparam.cls->id <= 255);
+ *image++ = (uint8_t)iblock->hdr->cparam.cls->id;
/* Address of array header for array which owns this block */
H5F_addr_encode(f, &image, iblock->hdr->addr);
@@ -1284,7 +1286,8 @@ H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED
*image++ = H5EA_SBLOCK_VERSION;
/* Extensible array type */
- *image++ = sblock->hdr->cparam.cls->id;
+ HDassert(sblock->hdr->cparam.cls->id <= 255);
+ *image++ = (uint8_t)sblock->hdr->cparam.cls->id;
/* Address of array header for array which owns this block */
H5F_addr_encode(f, &image, sblock->hdr->addr);
@@ -1698,7 +1701,8 @@ H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED
*image++ = H5EA_DBLOCK_VERSION;
/* Extensible array type */
- *image++ = dblock->hdr->cparam.cls->id;
+ HDassert(dblock->hdr->cparam.cls->id <= 255);
+ *image++ = (uint8_t)dblock->hdr->cparam.cls->id;
/* Address of array header for array which owns this block */
H5F_addr_encode(f, &image, dblock->hdr->addr);
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index f440efe..2f0d1b4 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -417,7 +417,8 @@ H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5FA_HDR_VERSION;
/* Fixed array type */
- *image++ = hdr->cparam.cls->id;
+ HDassert(hdr->cparam.cls->id <= 255);
+ *image++ = (uint8_t)hdr->cparam.cls->id;
/* General array creation/configuration information */
*image++ = hdr->cparam.raw_elmt_size; /* Element size in file (in bytes) */
@@ -805,7 +806,8 @@ H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED
*image++ = H5FA_DBLOCK_VERSION;
/* Fixed array type */
- *image++ = dblock->hdr->cparam.cls->id;
+ HDassert(dblock->hdr->cparam.cls->id <= 255);
+ *image++ = (uint8_t)dblock->hdr->cparam.cls->id;
/* Address of array header for array which owns this block */
H5F_addr_encode(f, &image, dblock->hdr->addr);
diff --git a/src/H5FScache.c b/src/H5FScache.c
index b520458..cb0abe9 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -735,7 +735,7 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len,
*image++ = H5FS_HDR_VERSION;
/* Client ID */
- *image++ = fspace->client;
+ H5_CHECKED_ASSIGN(*image++, uint8_t, fspace->client, int);
/* Total space tracked */
H5F_ENCODE_LENGTH(f, image, fspace->tot_space);
@@ -1046,8 +1046,8 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata,
/* Walk through the image, deserializing sections */
do {
- hsize_t sect_size; /* Current section size */
- size_t node_count; /* # of sections of this size */
+ hsize_t sect_size = 0; /* Current section size */
+ size_t node_count = 0; /* # of sections of this size */
size_t u; /* Local index variable */
/* The number of sections of this node's size */
@@ -1061,7 +1061,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata,
/* Loop over nodes of this size */
for(u = 0; u < node_count; u++) {
H5FS_section_info_t *new_sect; /* Section that was deserialized */
- haddr_t sect_addr; /* Address of free space section in the address space */
+ haddr_t sect_addr = 0; /* Address of free space section in the address space */
unsigned sect_type; /* Type of free space section */
unsigned des_flags; /* Flags from deserialize callback */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 75ef0a9..f0c28ca 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -93,7 +93,7 @@ typedef struct H5F_t H5F_t;
for (_i = 0; _i < sizeof(int64_t); _i++, _n >>= 8) \
*_p++ = (uint8_t)(_n & 0xff); \
for (/*void*/; _i < 8; _i++) \
- *_p++ = (n) < 0 ? 0xff : 0; \
+ *_p++ = (uint8_t)((n) < 0 ? 0xff : 0); \
(p) = (uint8_t*)(p)+8; \
}
diff --git a/src/H5HFtest.c b/src/H5HFtest.c
index 6f174bb..d6eecd7 100644
--- a/src/H5HFtest.c
+++ b/src/H5HFtest.c
@@ -481,7 +481,7 @@ H5HF_get_id_type_test(const void *_id, unsigned char *obj_type)
HDassert(obj_type);
/* Get the type for a heap ID */
- *obj_type = *id & H5HF_ID_TYPE_MASK;
+ *obj_type = (uint8_t)(*id & H5HF_ID_TYPE_MASK);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5HF_get_id_type_test() */
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c
index 7f4f17f..23aba09 100644
--- a/src/H5Oainfo.c
+++ b/src/H5Oainfo.c
@@ -194,7 +194,7 @@ H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co
*p++ = H5O_AINFO_VERSION;
/* The flags for the attribute indices */
- flags = ainfo->track_corder ? H5O_AINFO_TRACK_CORDER : 0;
+ flags = (unsigned char)(ainfo->track_corder ? H5O_AINFO_TRACK_CORDER : 0);
flags = (unsigned char)(flags | (ainfo->index_corder ? H5O_AINFO_INDEX_CORDER : 0));
*p++ = flags;
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index 878cb8a..573bb7a 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -329,7 +329,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
/* The character encoding for the attribute's name, in later versions */
if(attr->shared->version >= H5O_ATTR_VERSION_3)
- *p++ = attr->shared->encoding;
+ *p++ = (uint8_t)attr->shared->encoding;
/* Write the name including null terminator */
H5MM_memcpy(p, attr->shared->name, name_len);
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index 0cc58a6..cb75bc3 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -408,10 +408,10 @@ H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
if(fill->version < H5O_FILL_VERSION_3) {
/* Space allocation time */
- *p++ = fill->alloc_time;
+ *p++ = (uint8_t)fill->alloc_time;
/* Fill value writing time */
- *p++ = fill->fill_time;
+ *p++ = (uint8_t)fill->fill_time;
/* Whether fill value is defined */
*p++ = (uint8_t)fill->fill_defined;
diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c
index 7e48b9e..78e8e19 100644
--- a/src/H5Ofsinfo.c
+++ b/src/H5Ofsinfo.c
@@ -223,8 +223,8 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
HDassert(p);
HDassert(fsinfo);
- *p++ = (uint8_t)fsinfo->version; /* message version */
- *p++ = fsinfo->strategy; /* File space strategy */
+ *p++ = (uint8_t)fsinfo->version; /* message version */
+ *p++ = (uint8_t)fsinfo->strategy; /* File space strategy */
*p++ = (unsigned char)fsinfo->persist; /* Free-space persist or not */
H5F_ENCODE_LENGTH(f, p, fsinfo->threshold); /* Free-space section size threshold */
diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c
index 4b34a52..d6190c6 100644
--- a/src/H5Oginfo.c
+++ b/src/H5Oginfo.c
@@ -171,7 +171,7 @@ static herr_t
H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg;
- unsigned char flags; /* Flags for encoding group info */
+ unsigned char flags = 0; /* Flags for encoding group info */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -183,7 +183,7 @@ H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
*p++ = H5O_GINFO_VERSION;
/* The flags for the group info */
- flags = ginfo->store_link_phase_change ? H5O_GINFO_STORE_PHASE_CHANGE : 0;
+ flags = (unsigned char)(ginfo->store_link_phase_change ? H5O_GINFO_STORE_PHASE_CHANGE : 0);
flags = (unsigned char)(flags | (ginfo->store_est_entry_info ? H5O_GINFO_STORE_EST_ENTRY_INFO : 0));
*p++ = flags;
diff --git a/src/H5Oint.c b/src/H5Oint.c
index 23094b9..a16102a 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -240,7 +240,7 @@ H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx
version = H5O_VERSION_1;
/* Upgrade to the version indicated by the file's low bound if higher */
- version = MAX(version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]);
+ version = (uint8_t)MAX(version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]);
/* Version bounds check */
if(version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(f)])
@@ -2322,7 +2322,7 @@ H5O_get_create_plist(const H5O_loc_t *loc, H5P_genplist_t *oc_plist)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set min. # of dense attributes in property list")
/* Mask off non-"user visible" flags */
- ohdr_flags = oh->flags & (H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_STORE_TIMES);
+ H5_CHECKED_ASSIGN(ohdr_flags, uint8_t, oh->flags & (H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_STORE_TIMES), int);
/* Set object header flags */
if(H5P_set(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &ohdr_flags) < 0)
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 138f219..2a2a07b 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -570,7 +570,7 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
H5O_LAYOUT_VERSION_3 : mesg->version);
/* Layout class */
- *p++ = mesg->type;
+ *p++ = (uint8_t)mesg->type;
/* Write out layout class specific information */
switch(mesg->type) {
diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c
index 9827b6a..a2f88d9 100644
--- a/src/H5Olinfo.c
+++ b/src/H5Olinfo.c
@@ -203,7 +203,7 @@ H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co
*p++ = H5O_LINFO_VERSION;
/* The flags for the link indices */
- index_flags = linfo->track_corder ? H5O_LINFO_TRACK_CORDER : 0;
+ index_flags = (uint8_t)(linfo->track_corder ? H5O_LINFO_TRACK_CORDER : 0);
index_flags = (uint8_t)(index_flags | (linfo->index_corder ? H5O_LINFO_INDEX_CORDER : 0));
*p++ = index_flags;
diff --git a/src/H5Olink.c b/src/H5Olink.c
index 4bd952b..1f0c6c7 100644
--- a/src/H5Olink.c
+++ b/src/H5Olink.c
@@ -316,7 +316,7 @@ H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con
/* Store the type of a non-default link */
if(link_flags & H5O_LINK_STORE_LINK_TYPE)
- *p++ = lnk->type;
+ *p++ = (uint8_t)lnk->type;
/* Store the link creation order in the file, if its valid */
if(lnk->corder_valid)
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index b4f00ea..33310dc 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -257,7 +257,7 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg)
/* Dataspace type */
if(sdim->version > H5O_SDSPACE_VERSION_1)
- *p++ = sdim->type;
+ *p++ = (uint8_t)sdim->type;
else {
*p++ = 0; /*reserved*/
*p++ = 0; /*reserved*/
diff --git a/src/H5Rint.c b/src/H5Rint.c
index c6e3875..46e4c0c 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -1020,7 +1020,7 @@ H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_priv_t *ref)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small")
/* Set new reference */
- ref->type = (H5R_type_t)*p++;
+ ref->type = (int8_t)*p++;
if(ref->type <= H5R_BADTYPE || ref->type >= H5R_MAXTYPE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type")
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index 49ce2b4..ee28fa4 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -397,7 +397,7 @@ H5SM__cache_table_serialize(const H5F_t *f, void *_image, size_t len,
*image++ = H5SM_LIST_VERSION;
/* Is message index a list or a B-tree? */
- *image++ = table->indexes[u].index_type;
+ *image++ = (uint8_t)table->indexes[u].index_type;
/* Type of messages in the index */
UINT16ENCODE(image, table->indexes[u].mesg_types);
diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c
index 0cca6bb..e085204 100644
--- a/src/H5SMmessage.c
+++ b/src/H5SMmessage.c
@@ -298,7 +298,7 @@ H5SM__message_encode(uint8_t *raw, const void *_nrecord, void *_ctx)
/* Sanity check */
HDassert(ctx);
- *raw++ = message->location;
+ *raw++ = (uint8_t)message->location;
UINT32ENCODE(raw, message->hash);
if(message->location == H5SM_IN_HEAP) {
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 1e1538e..dc97ea2 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -3688,7 +3688,7 @@ H5S__hyper_get_version_enc_size(const H5S_t *space, hsize_t block_count, uint32_
/* Determine the encoding size */
enc2 = H5S__hyper_get_enc_size_real(max2);
- *enc_size = MAX(enc1, enc2);
+ *enc_size = (uint8_t)MAX(enc1, enc2);
} /* end if */
else {
hsize_t max_size = block_count;
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index f29319f..a61c505 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -238,7 +238,7 @@ H5_DLL herr_t H5S_select_iterate(void *buf, const H5T_t *type, const H5S_t *spac
H5_DLL herr_t H5S_select_fill(const void *fill, size_t fill_size,
const H5S_t *space, void *buf);
H5_DLL htri_t H5S_select_valid(const H5S_t *space);
-H5_DLL hssize_t H5S_get_select_npoints(const H5S_t *space);
+H5_DLL hsize_t H5S_get_select_npoints(const H5S_t *space);
H5_DLL herr_t H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
H5_DLL herr_t H5S_get_select_offset(const H5S_t *space, hsize_t *offset);
H5_DLL int H5S_get_select_unlim_dim(const H5S_t *space);
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 6c8b898..9814e38 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -431,7 +431,7 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-H5_ATTR_PURE hssize_t
+H5_ATTR_PURE hsize_t
H5S_get_select_npoints(const H5S_t *space)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -439,7 +439,7 @@ H5S_get_select_npoints(const H5S_t *space)
/* Check args */
HDassert(space);
- FUNC_LEAVE_NOAPI((hssize_t)space->select.num_elem)
+ FUNC_LEAVE_NOAPI(space->select.num_elem)
} /* end H5S_get_select_npoints() */
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index df6d2c3..c6c1777 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -363,7 +363,7 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value)
/* The middle bytes */
while (size >= 8) {
- buf[idx++] = value ? 0xff : 0x00;
+ buf[idx++] = (uint8_t)(value ? 0xff : 0x00);
size -= 8;
}
@@ -532,7 +532,7 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size)
acc = buf[idx];
acc++;
carry = acc & 0x100;
- buf[idx] = acc & 0xff;
+ buf[idx] = (uint8_t)(acc & 0xff);
idx++;
size -= 8;
}
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index 6d07513..2245bd3 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -324,7 +324,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
#define H5Z_XFORM_DO_OP5(TYPE, SIZE) \
{ \
- TYPE val = ((tree->type == H5Z_XFORM_INTEGER) ? (TYPE)tree->value.int_val : (TYPE)tree->value.float_val); \
+ TYPE val = (TYPE)((tree->type == H5Z_XFORM_INTEGER) ? tree->value.int_val : tree->value.float_val); \
H5VM_array_fill(array, &val, sizeof(TYPE), (SIZE)); \
}