diff options
author | kmu <kmu@hdfgroup.org> | 2019-12-06 20:12:57 (GMT) |
---|---|---|
committer | kmu <kmu@hdfgroup.org> | 2019-12-06 20:12:57 (GMT) |
commit | 189935ff260cae6fb4e061fa68bd7b93e219c635 (patch) | |
tree | 835e1ace051ca3cd146ee86b62b884a96fc04721 | |
parent | 132fa33dad6badacec90e80768d8dc8e8aa33172 (diff) | |
download | hdf5-189935ff260cae6fb4e061fa68bd7b93e219c635.zip hdf5-189935ff260cae6fb4e061fa68bd7b93e219c635.tar.gz hdf5-189935ff260cae6fb4e061fa68bd7b93e219c635.tar.bz2 |
remove unnecessary check macro
-rw-r--r-- | hl/tools/gif2h5/decompress.c | 3 | ||||
-rw-r--r-- | src/H5Aint.c | 2 | ||||
-rw-r--r-- | src/H5B2cache.c | 6 | ||||
-rw-r--r-- | src/H5B2int.c | 2 | ||||
-rw-r--r-- | src/H5EAcache.c | 8 | ||||
-rw-r--r-- | src/H5FAcache.c | 4 | ||||
-rw-r--r-- | src/H5FScache.c | 6 | ||||
-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 | 4 | ||||
-rw-r--r-- | src/H5Oginfo.c | 2 | ||||
-rw-r--r-- | src/H5Oint.c | 2 | ||||
-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-- | test/dsets.c | 8 | ||||
-rw-r--r-- | test/dtypes.c | 5 | ||||
-rw-r--r-- | test/ntypes.c | 2 | ||||
-rw-r--r-- | tools/src/h5import/h5import.c | 5 | ||||
-rw-r--r-- | tools/test/h5diff/dynlib_diff.c | 5 | ||||
-rw-r--r-- | tools/test/h5dump/dynlib_dump.c | 5 | ||||
-rw-r--r-- | tools/test/h5dump/h5dumpgentest.c | 8 | ||||
-rw-r--r-- | tools/test/h5ls/dynlib_ls.c | 5 |
31 files changed, 53 insertions, 62 deletions
diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c index b3e20ac..bd9a37d 100644 --- a/hl/tools/gif2h5/decompress.c +++ b/hl/tools/gif2h5/decompress.c @@ -12,7 +12,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include <stdio.h> #include <stdlib.h> -#include "H5private.h" #include "gif.h" @@ -174,7 +173,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) /* Now read in values from the image descriptor */ IWidth = GifImageDesc->ImageWidth; IHeight = GifImageDesc->ImageHeight; - H5_CHECKED_ASSIGN(Interlace, uint8_t, GifImageDesc->PackedField & 0x40, int); + Interlace = (uint8_t)(GifImageDesc->PackedField & 0x40); /* * Note that I ignore the possible existence of a local color map. I'm diff --git a/src/H5Aint.c b/src/H5Aint.c index 831dab2..046d709 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 */ - H5_CHECKED_ASSIGN(version, uint8_t, MAX(version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]), int); + 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 7d163bf..09bb389 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 */ - H5_CHECKED_ASSIGN(*image++, uint8_t, hdr->cls->id, int); + *image++ = (uint8_t)hdr->cls->id; /* 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 */ - H5_CHECKED_ASSIGN(*image++, uint8_t, internal->hdr->cls->id, int); + *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 +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 */ - H5_CHECKED_ASSIGN(*image++, uint8_t, leaf->hdr->cls->id, int); + *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 932f5f3..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 */ - H5_CHECKED_ASSIGN(mid_record, uint16_t, old_node_nrec / 2, int); + 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), diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 02b12e1..7b1968e 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 */ - H5_CHECKED_ASSIGN(*image++, uint8_t, hdr->cparam.cls->id, int); + *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 +875,7 @@ H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5EA_IBLOCK_VERSION; /* Extensible array type */ - H5_CHECKED_ASSIGN(*image++, uint8_t, iblock->hdr->cparam.cls->id, int); + *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 +1284,7 @@ H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5EA_SBLOCK_VERSION; /* Extensible array type */ - H5_CHECKED_ASSIGN(*image++, uint8_t, sblock->hdr->cparam.cls->id, int); + *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 +1698,7 @@ H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5EA_DBLOCK_VERSION; /* Extensible array type */ - H5_CHECKED_ASSIGN(*image++, uint8_t, dblock->hdr->cparam.cls->id, int); + *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 7ea7fd6..e142ae2 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 */ - H5_CHECKED_ASSIGN(*image++, uint8_t, hdr->cparam.cls->id, int); + *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 +805,7 @@ H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5FA_DBLOCK_VERSION; /* Fixed array type */ - H5_CHECKED_ASSIGN(*image++, uint8_t, dblock->hdr->cparam.cls->id, int); + *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 28c35e4..cb0abe9 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -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 = 1; /* Current section size */ - size_t node_count = 1; /* # 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 = 1; /* 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/H5HFtest.c b/src/H5HFtest.c index 7484961..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 */ - H5_CHECKED_ASSIGN(*obj_type, uint8_t, *id & H5HF_ID_TYPE_MASK, int); + *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 d954973..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 */ - H5_CHECKED_ASSIGN(flags, uint8_t, ainfo->track_corder ? H5O_AINFO_TRACK_CORDER : 0, int); + 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 f3d0fa1..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) - H5_CHECKED_ASSIGN(*p++, uint8_t, attr->shared->encoding, int); + *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 93f2a65..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 */ - H5_CHECKED_ASSIGN(*p++, uint8_t, fill->alloc_time, int); + *p++ = (uint8_t)fill->alloc_time; /* Fill value writing time */ - H5_CHECKED_ASSIGN(*p++, uint8_t, fill->fill_time, int); + *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 212475e..25a6754 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 */ - H5_CHECKED_ASSIGN(*p++, uint8_t, fsinfo->strategy, unsigned); /* 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 a461613..237bf6c 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -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 */ - H5_CHECKED_ASSIGN(flags, uint8_t, flags | (ginfo->store_est_entry_info ? H5O_GINFO_STORE_EST_ENTRY_INFO : 0), int); + flags = (unsigned char)(flags | (ginfo->store_est_entry_info ? H5O_GINFO_STORE_EST_ENTRY_INFO : 0)); *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 0867318..7c922da 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 */ - H5_CHECKED_ASSIGN(version, uint8_t, MAX(version, (uint8_t)H5O_obj_ver_bounds[H5F_LOW_BOUND(f)]), int); + 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)]) diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 069ee7c..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 */ - H5_CHECKED_ASSIGN(*p++, uint8_t, mesg->type, int); + *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 9e57185..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 */ - H5_CHECKED_ASSIGN(index_flags, uint8_t, linfo->track_corder ? H5O_LINFO_TRACK_CORDER : 0, int); + 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 afa0947..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) - H5_CHECKED_ASSIGN(*p++, uint8_t, lnk->type, int); + *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 83bc2b4..33310dc 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -256,9 +256,8 @@ 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) { - H5_CHECKED_ASSIGN(*p++, uint8_t, sdim->type, int); - } + if(sdim->version > H5O_SDSPACE_VERSION_1) + *p++ = (uint8_t)sdim->type; else { *p++ = 0; /*reserved*/ *p++ = 0; /*reserved*/ diff --git a/src/H5Rint.c b/src/H5Rint.c index 45c5a9d..c015715 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 */ - H5_CHECKED_ASSIGN(ref->type, int8_t, (H5R_type_t)*p++, int); + 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 218f1ae..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? */ - H5_CHECKED_ASSIGN(*image++, uint8_t, table->indexes[u].index_type, int); + *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 4c0033c..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); - H5_CHECKED_ASSIGN(*raw++, uint8_t, message->location, int); + *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 57fa043..4796fb9 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); - H5_CHECKED_ASSIGN(*enc_size, uint8_t, MAX(enc1, enc2), int); + *enc_size = (uint8_t)MAX(enc1, enc2); } /* end if */ else { hsize_t max_size = block_count; diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 073bb51..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) { - H5_CHECKED_ASSIGN(buf[idx++], uint8_t, value ? 0xff : 0x00, int); + 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; - H5_CHECKED_ASSIGN(buf[idx], uint8_t, acc & 0xff, unsigned); + buf[idx] = (uint8_t)(acc & 0xff); idx++; size -= 8; } diff --git a/test/dsets.c b/test/dsets.c index 6cc38db..b8cd1dc 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -5293,7 +5293,7 @@ test_types(hid_t file) (space=H5Screate_simple(1, &nelmts, NULL)) < 0 || (dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - for(i=0; i<sizeof buf; i++) H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)(0xff ^ i); if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; @@ -5307,7 +5307,7 @@ test_types(hid_t file) (space=H5Screate_simple(1, &nelmts, NULL)) < 0 || (dset=H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - for(i=0; i<sizeof buf; i++) H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)(0xff ^ i); if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; if(H5Sclose(space) < 0) goto error; @@ -5322,7 +5322,7 @@ test_types(hid_t file) (dset = H5Dcreate2(grp, "opaque_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; for(i = 0; i < sizeof buf; i++) - H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + buf[i] = (unsigned char)(0xff ^ i); if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; if(H5Sclose(space) < 0) goto error; if(H5Tclose(type) < 0) goto error; @@ -5336,7 +5336,7 @@ test_types(hid_t file) (dset = H5Dcreate2(grp, "opaque_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; for(i = 0; i < sizeof buf; i++) - H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + buf[i] = (unsigned char)(0xff ^ i); if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; if(H5Sclose(space) < 0) goto error; if(H5Tclose(type) < 0) goto error; diff --git a/test/dtypes.c b/test/dtypes.c index 93f56b8..6f59175 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -21,7 +21,6 @@ #include "testhdf5.h" #include "H5srcdir.h" #include "H5Iprivate.h" /* For checking that datatype id's don't leak */ -#include "H5private.h" /* Number of elements in each test */ #define NTESTELEM 100000 @@ -1217,8 +1216,8 @@ test_compound_6(void) orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st)); for (i=0; i<(int)nelmts; i++) { s_ptr = ((struct st*)((void *)orig)) + i; - H5_CHECKED_ASSIGN(s_ptr->b, int16_t, (i*8+1) & 0x7fff, int); - H5_CHECKED_ASSIGN(s_ptr->d, int16_t, (i*8+6) & 0x7fff, int); + s_ptr->b = (int16_t)((i*8+1) & 0x7fff); + s_ptr->d = (int16_t)((i*8+6) & 0x7fff); } HDmemcpy(buf, orig, nelmts*sizeof(struct st)); diff --git a/test/ntypes.c b/test/ntypes.c index 82da8ce..f1d2449 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -2484,7 +2484,7 @@ test_opaque_dtype(hid_t file) TEST_ERROR; for(i = 0; i < sizeof(wbuf); i++) - H5_CHECKED_ASSIGN(wbuf[i], uint8_t, 0xff ^ i, size_t); + wbuf[i] = (unsigned char)(0xff ^ i); if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR; if(H5Sclose(space) < 0) TEST_ERROR; diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index c627b6d..7ca12c2 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -4714,10 +4714,7 @@ uint16_t swap_uint16(uint16_t val) int16_t swap_int16(int16_t val) { - int16_t ret; - - H5_CHECKED_ASSIGN(ret, int16_t, ((val & 0xff) << 8) | ((val & 0xff00) >> 8), int); - return ret; + return (uint16_t)(((val & 0xff) << 8) | ((val & 0xff00) >> 8)); } uint32_t swap_uint32(uint32_t val) diff --git a/tools/test/h5diff/dynlib_diff.c b/tools/test/h5diff/dynlib_diff.c index ceff5e1..661a6dc 100644 --- a/tools/test/h5diff/dynlib_diff.c +++ b/tools/test/h5diff/dynlib_diff.c @@ -16,7 +16,6 @@ #include <stdlib.h> #include <stdio.h> #include "H5PLextern.h" -#include "H5private.h" #define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 @@ -70,7 +69,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp - MULTIPLIER, int); + *int_ptr = (int8_t)(temp - MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ @@ -79,7 +78,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Add the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp + MULTIPLIER, int); + *int_ptr = (int8_t)(temp + MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ diff --git a/tools/test/h5dump/dynlib_dump.c b/tools/test/h5dump/dynlib_dump.c index ceff5e1..661a6dc 100644 --- a/tools/test/h5dump/dynlib_dump.c +++ b/tools/test/h5dump/dynlib_dump.c @@ -16,7 +16,6 @@ #include <stdlib.h> #include <stdio.h> #include "H5PLextern.h" -#include "H5private.h" #define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 @@ -70,7 +69,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp - MULTIPLIER, int); + *int_ptr = (int8_t)(temp - MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ @@ -79,7 +78,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Add the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp + MULTIPLIER, int); + *int_ptr = (int8_t)(temp + MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 29c8245..ed0287c 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -2565,7 +2565,7 @@ static void gent_bitfields(void) goto error; for(i = 0; i < sizeof buf; i++) - H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + buf[i] = (uint8_t)(0xff ^ i); if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; if(H5Sclose(space) < 0) goto error; @@ -2579,7 +2579,7 @@ static void gent_bitfields(void) (dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; for(i = 0; i < sizeof buf; i++) - H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + buf[i] = (uint8_t)(0xff ^ i); if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; if(H5Sclose(space) < 0) goto error; @@ -9814,7 +9814,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - H5_CHECKED_ASSIGN(buf[i], uint8_t, 0xff ^ i, size_t); + buf[i] = (uint8_t)(0xff ^ i); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); H5Dclose(dset); @@ -9829,7 +9829,7 @@ static void gent_bitnopaquefields(void) if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) { if ((dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { for (i = 0; i < nelmts; i++) { - H5_CHECKED_ASSIGN(buf2[i], uint16_t, 0xffff ^ (i * 16), size_t); + buf2[i] = (uint16_t)(0xffff ^ (i * 16)); } H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); H5Dclose(dset); diff --git a/tools/test/h5ls/dynlib_ls.c b/tools/test/h5ls/dynlib_ls.c index ceff5e1..661a6dc 100644 --- a/tools/test/h5ls/dynlib_ls.c +++ b/tools/test/h5ls/dynlib_ls.c @@ -16,7 +16,6 @@ #include <stdlib.h> #include <stdio.h> #include "H5PLextern.h" -#include "H5private.h" #define H5Z_FILTER_DYNLIBUD 300 #define MULTIPLIER 3 @@ -70,7 +69,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp - MULTIPLIER, int); + *int_ptr = (int8_t)(temp - MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ @@ -79,7 +78,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Add the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp + MULTIPLIER, int); + *int_ptr = (int8_t)(temp + MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ |