diff options
author | kmu <kmu@hdfgroup.org> | 2019-12-04 02:52:55 (GMT) |
---|---|---|
committer | kmu <kmu@hdfgroup.org> | 2019-12-04 02:52:55 (GMT) |
commit | 132fa33dad6badacec90e80768d8dc8e8aa33172 (patch) | |
tree | b296c329b62c9152fce3ca228c121a8cdf55d0c8 /src | |
parent | ea0759d047dc6421da90375a9c27f7cde0a8e117 (diff) | |
download | hdf5-132fa33dad6badacec90e80768d8dc8e8aa33172.zip hdf5-132fa33dad6badacec90e80768d8dc8e8aa33172.tar.gz hdf5-132fa33dad6badacec90e80768d8dc8e8aa33172.tar.bz2 |
fix intel compile warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Aint.c | 2 | ||||
-rw-r--r-- | src/H5B2cache.c | 6 | ||||
-rw-r--r-- | src/H5B2int.c | 14 | ||||
-rw-r--r-- | src/H5Dchunk.c | 5 | ||||
-rw-r--r-- | src/H5EAcache.c | 8 | ||||
-rw-r--r-- | src/H5FAcache.c | 4 | ||||
-rw-r--r-- | src/H5FScache.c | 8 | ||||
-rw-r--r-- | src/H5Fprivate.h | 2 | ||||
-rw-r--r-- | src/H5HFtest.c | 2 | ||||
-rw-r--r-- | src/H5Oainfo.c | 2 | ||||
-rw-r--r-- | src/H5Oattr.c | 2 | ||||
-rw-r--r-- | src/H5Ofill.c | 4 | ||||
-rw-r--r-- | src/H5Ofsinfo.c | 2 | ||||
-rw-r--r-- | src/H5Oginfo.c | 5 | ||||
-rw-r--r-- | src/H5Oint.c | 4 | ||||
-rw-r--r-- | src/H5Olayout.c | 2 | ||||
-rw-r--r-- | src/H5Olinfo.c | 2 | ||||
-rw-r--r-- | src/H5Olink.c | 2 | ||||
-rw-r--r-- | src/H5Osdspace.c | 5 | ||||
-rw-r--r-- | src/H5Rint.c | 2 | ||||
-rw-r--r-- | src/H5SMcache.c | 2 | ||||
-rw-r--r-- | src/H5SMmessage.c | 2 | ||||
-rw-r--r-- | src/H5Shyper.c | 2 | ||||
-rw-r--r-- | src/H5Tbit.c | 4 | ||||
-rw-r--r-- | src/H5Ztrans.c | 2 |
25 files changed, 47 insertions, 48 deletions
diff --git a/src/H5Aint.c b/src/H5Aint.c index 436fced..831dab2 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -2026,7 +2026,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)]); + H5_CHECKED_ASSIGN(version, uint8_t, MAX(version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]), int); /* 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..7d163bf 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -398,7 +398,7 @@ 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, hdr->cls->id, int); /* Node size (in bytes) */ UINT32ENCODE(image, hdr->node_size); @@ -818,7 +818,7 @@ 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, internal->hdr->cls->id, int); HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); /* Serialize records for internal node */ @@ -1219,7 +1219,7 @@ 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, leaf->hdr->cls->id, int); 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..932f5f3 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; + H5_CHECKED_ASSIGN(mid_record, uint16_t, old_node_nrec / 2, int); /* 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 4d139c7..62303bb 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -2193,7 +2193,7 @@ 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); + schunk_points = (hsize_t)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) HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "can't create chunk memory selection") @@ -5670,7 +5670,7 @@ H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) 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); @@ -5678,7 +5678,6 @@ 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) } /* H5D__chunk_addrmap_cb() */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index da67e6b..02b12e1 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -487,7 +487,7 @@ 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, hdr->cparam.cls->id, int); /* General array creation/configuration information */ *image++ = hdr->cparam.raw_elmt_size; /* Element size in file (in bytes) */ @@ -875,7 +875,7 @@ 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, iblock->hdr->cparam.cls->id, int); /* Address of array header for array which owns this block */ H5F_addr_encode(f, &image, iblock->hdr->addr); @@ -1284,7 +1284,7 @@ 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, sblock->hdr->cparam.cls->id, int); /* Address of array header for array which owns this block */ H5F_addr_encode(f, &image, sblock->hdr->addr); @@ -1698,7 +1698,7 @@ 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, dblock->hdr->cparam.cls->id, int); /* 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..7ea7fd6 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -417,7 +417,7 @@ 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, hdr->cparam.cls->id, int); /* General array creation/configuration information */ *image++ = hdr->cparam.raw_elmt_size; /* Element size in file (in bytes) */ @@ -805,7 +805,7 @@ 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, dblock->hdr->cparam.cls->id, int); /* 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..28c35e4 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 = 1; /* Current section size */ + size_t node_count = 1; /* # 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 = 1; /* 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 e1a8a2f..eaf8093 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..7484961 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; + H5_CHECKED_ASSIGN(*obj_type, uint8_t, *id & H5HF_ID_TYPE_MASK, int); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5HF_get_id_type_test() */ diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 7f4f17f..d954973 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; + H5_CHECKED_ASSIGN(flags, uint8_t, ainfo->track_corder ? H5O_AINFO_TRACK_CORDER : 0, int); 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..f3d0fa1 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; + H5_CHECKED_ASSIGN(*p++, uint8_t, attr->shared->encoding, int); /* 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..93f2a65 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; + H5_CHECKED_ASSIGN(*p++, uint8_t, fill->alloc_time, int); /* Fill value writing time */ - *p++ = fill->fill_time; + H5_CHECKED_ASSIGN(*p++, uint8_t, fill->fill_time, int); /* Whether fill value is defined */ *p++ = (uint8_t)fill->fill_defined; diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index e5e6741..212475e 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -224,7 +224,7 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c HDassert(fsinfo); *p++ = (uint8_t)fsinfo->version; /* message version */ - *p++ = fsinfo->strategy; /* File space strategy */ + H5_CHECKED_ASSIGN(*p++, uint8_t, fsinfo->strategy, unsigned); /* 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..a461613 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,8 +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)(flags | (ginfo->store_est_entry_info ? H5O_GINFO_STORE_EST_ENTRY_INFO : 0)); + H5_CHECKED_ASSIGN(flags, uint8_t, flags | (ginfo->store_est_entry_info ? H5O_GINFO_STORE_EST_ENTRY_INFO : 0), int); *p++ = flags; /* Store the max. # of links to store compactly & the min. # of links to store densely */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 0029976..0867318 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)]); + H5_CHECKED_ASSIGN(version, uint8_t, MAX(version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]), int); /* Version bounds check */ if(version > H5O_obj_ver_bounds[H5F_HIGH_BOUND(f)]) @@ -2379,7 +2379,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..069ee7c 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; + H5_CHECKED_ASSIGN(*p++, uint8_t, mesg->type, int); /* Write out layout class specific information */ switch(mesg->type) { diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index 9827b6a..9e57185 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; + H5_CHECKED_ASSIGN(index_flags, uint8_t, linfo->track_corder ? H5O_LINFO_TRACK_CORDER : 0, int); 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..afa0947 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; + H5_CHECKED_ASSIGN(*p++, uint8_t, lnk->type, int); /* 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..83bc2b4 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -256,8 +256,9 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) *p++ = (uint8_t)flags; /* Dataspace type */ - if(sdim->version > H5O_SDSPACE_VERSION_1) - *p++ = sdim->type; + if(sdim->version > H5O_SDSPACE_VERSION_1) { + H5_CHECKED_ASSIGN(*p++, uint8_t, sdim->type, int); + } else { *p++ = 0; /*reserved*/ *p++ = 0; /*reserved*/ diff --git a/src/H5Rint.c b/src/H5Rint.c index 9fbc7ef..45c5a9d 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -1002,7 +1002,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++; + H5_CHECKED_ASSIGN(ref->type, int8_t, (H5R_type_t)*p++, int); 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..218f1ae 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; + H5_CHECKED_ASSIGN(*image++, uint8_t, table->indexes[u].index_type, int); /* 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..4c0033c 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; + H5_CHECKED_ASSIGN(*raw++, uint8_t, message->location, int); UINT32ENCODE(raw, message->hash); if(message->location == H5SM_IN_HEAP) { diff --git a/src/H5Shyper.c b/src/H5Shyper.c index ab06eff..57fa043 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); + H5_CHECKED_ASSIGN(*enc_size, uint8_t, MAX(enc1, enc2), int); } /* end if */ else { hsize_t max_size = block_count; diff --git a/src/H5Tbit.c b/src/H5Tbit.c index df6d2c3..073bb51 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; + H5_CHECKED_ASSIGN(buf[idx++], uint8_t, value ? 0xff : 0x00, int); 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; + H5_CHECKED_ASSIGN(buf[idx], uint8_t, acc & 0xff, unsigned); 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)); \ } |