summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2019-11-26 23:23:34 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:20:24 (GMT)
commitf2028c7568c2ad8ef91bc78cc8dac9b2d8c8eb1d (patch)
treef63980b1e4a4aed7a0a3cf4c3d7a3f83496c10e1
parent9a3a13cacb2c519a5c4deab817606a743e9ece0d (diff)
downloadhdf5-f2028c7568c2ad8ef91bc78cc8dac9b2d8c8eb1d.zip
hdf5-f2028c7568c2ad8ef91bc78cc8dac9b2d8c8eb1d.tar.gz
hdf5-f2028c7568c2ad8ef91bc78cc8dac9b2d8c8eb1d.tar.bz2
Revert "using a different MACRO"
This reverts commit fc61b7a9f3a38331809ebcb6247482943947cdb8.
-rwxr-xr-xbin/warnhist2
-rw-r--r--hl/tools/gif2h5/decompress.c3
-rw-r--r--src/H5Aint.c2
-rw-r--r--src/H5B2cache.c6
-rw-r--r--src/H5B2int.c2
-rw-r--r--src/H5EAcache.c2
-rw-r--r--src/H5FAcache.c2
-rw-r--r--src/H5FScache.c2
-rw-r--r--src/H5Fprivate.h3
-rw-r--r--src/H5HFtest.c2
-rw-r--r--src/H5Oainfo.c2
-rw-r--r--src/H5Oattr.c14
-rw-r--r--src/H5Ofill.c4
-rw-r--r--src/H5Ofsinfo.c10
-rw-r--r--src/H5Oginfo.c10
-rw-r--r--src/H5Oint.c2
-rw-r--r--src/H5Olayout.c2
-rw-r--r--src/H5Olinfo.c2
-rw-r--r--src/H5Olink.c18
-rw-r--r--src/H5Osdspace.c14
-rw-r--r--src/H5Rint.c2
-rw-r--r--src/H5SMcache.c17
-rw-r--r--src/H5SMmessage.c8
-rw-r--r--src/H5Shyper.c6
-rw-r--r--src/H5Tbit.c10
-rw-r--r--test/dsets.c6
-rw-r--r--test/dtypes.c4
-rw-r--r--test/ntypes.c2
-rw-r--r--testpar/t_mpi.c10
-rw-r--r--tools/src/h5import/h5import.c4
-rw-r--r--tools/test/h5diff/dynlib_diff.c4
-rw-r--r--tools/test/h5dump/dynlib_dump.c4
-rw-r--r--tools/test/h5dump/h5dumpgentest.c16
-rw-r--r--tools/test/h5ls/dynlib_ls.c2
-rw-r--r--tools/test/h5repack/h5repackgentest.c2
35 files changed, 98 insertions, 103 deletions
diff --git a/bin/warnhist b/bin/warnhist
index a88474b..e48e591 100755
--- a/bin/warnhist
+++ b/bin/warnhist
@@ -206,7 +206,6 @@ while (<>) {
($last_c_name, $toss) = split /\:/, $_;
}
- # Retain C/C++ compile line, which comes with the line of warning
if($_ =~ /.*[A-Za-z0-9_]\.[chC]\(.*[0-9]\):.*#.*/) {
$last_c_name = $_;
}
@@ -267,7 +266,6 @@ while (<>) {
$line =~ s/^\s*line\s*//g;
# print "name:'", $name, "'-'", $line, "'\n";
# print "warning:'", $warning, "'\n";
- # Check for Intel icc warning
} elsif($_ =~ /.*[A-Za-z0-9_]\.[chC]\(.*[0-9]\):.*#.*/) {
($last_c_name, $toss, $warning) = split /\:/, $last_c_name;
($name, $line) = split /\(/, $last_c_name;
diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c
index 3759102..a82998f 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, unsigned char, GifImageDesc->PackedField & 0x40, int);
+ ASSIGN_TO_SMALLER_SIZE(Interlace, unsigned char, GifImageDesc->PackedField & 0x40, int);
/*
* 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 69230c7..aec6dfb 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 */
- H5_CHECKED_ASSIGN(version, uint8_t, MAX(version, (uint8_t)H5O_attr_ver_bounds[H5F_LOW_BOUND(f)]), int);
+ ASSIGN_TO_SMALLER_SIZE(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 ac3fd77..91d8c0f 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -401,7 +401,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);
+ ASSIGN_TO_SMALLER_SIZE(*image++, uint8_t, hdr->cls->id, int);
/* Node size (in bytes) */
UINT32ENCODE(image, hdr->node_size);
@@ -821,7 +821,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);
+ ASSIGN_TO_SMALLER_SIZE(*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 */
@@ -1222,7 +1222,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);
+ ASSIGN_TO_SMALLER_SIZE(*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 932f5f3..ff835eb 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);
+ ASSIGN_TO_SMALLER_SIZE(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),
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index d01742c..585691e 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -492,7 +492,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);
+ ASSIGN_TO_SMALLER_SIZE(*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) */
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index 4c4d49b..834f284 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -421,7 +421,7 @@ H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
/* Fixed array type */
*image++ = (uint8_t)hdr->cparam.cls->id;
- H5_CHECKED_ASSIGN(*image++, uint8_t, hdr->cparam.cls->id, int);
+ ASSIGN_TO_SMALLER_SIZE(*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) */
diff --git a/src/H5FScache.c b/src/H5FScache.c
index 98cf742..9d0dd18 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -737,7 +737,7 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len,
*image++ = H5FS_HDR_VERSION;
/* Client ID */
- H5_CHECKED_ASSIGN(*image++, uint8_t, fspace->client, int);
+ ASSIGN_TO_SMALLER_SIZE(*image++, uint8_t, fspace->client, int);
/* Total space tracked */
H5F_ENCODE_LENGTH(f, image, fspace->tot_space);
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 61ff5af..d82a2ac 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -28,8 +28,7 @@ typedef struct H5F_t H5F_t;
#include "H5FDpublic.h" /* File drivers */
/* Private headers needed by this file */
-#include "H5private.h" /* Generic Functions */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5MMprivate.h" /* Memory management */
#ifdef H5_HAVE_PARALLEL
#include "H5Pprivate.h" /* Property lists */
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5HFtest.c b/src/H5HFtest.c
index 585a1bf..b0291b8 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, unsigned char, *id & H5HF_ID_TYPE_MASK, int);
+ ASSIGN_TO_SMALLER_SIZE(*obj_type, unsigned char, *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 a0730e8..d923a9f 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, unsigned char, ainfo->track_corder ? H5O_AINFO_TRACK_CORDER : 0, int);
+ ASSIGN_TO_SMALLER_SIZE(flags, unsigned char, 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 edb5b2f..b30c3a4 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -16,12 +16,12 @@
#define H5S_FRIEND /*suppress error about including H5Spkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Apkg.h" /* Attributes */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Spkg.h" /* Dataspaces */
+#include "H5private.h" /* Generic Functions */
+#include "H5Apkg.h" /* Attributes */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Spkg.h" /* Dataspaces */
/* PRIVATE PROTOTYPES */
static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg);
@@ -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);
+ ASSIGN_TO_SMALLER_SIZE(*p++, uint8_t, attr->shared->encoding, int);
}
/* Write the name including null terminator */
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index 93f2a65..14b12db 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);
+ ASSIGN_TO_SMALLER_SIZE(*p++, uint8_t, fill->alloc_time, int);
/* Fill value writing time */
- H5_CHECKED_ASSIGN(*p++, uint8_t, fill->fill_time, int);
+ ASSIGN_TO_SMALLER_SIZE(*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 9ef7289..0f6bdd0 100644
--- a/src/H5Ofsinfo.c
+++ b/src/H5Ofsinfo.c
@@ -25,11 +25,11 @@
#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5Opkg.h" /* Object headers */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5Opkg.h" /* Object headers */
/* PRIVATE PROTOTYPES */
static void *H5O_fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
@@ -225,7 +225,7 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
*p++ = (uint8_t)fsinfo->version; /* message version */
*p++ = (uint8_t)fsinfo->strategy; /* File space strategy */
- H5_CHECKED_ASSIGN(*p++, uint8_t, fsinfo->strategy, unsigned);
+ ASSIGN_TO_SMALLER_SIZE(*p++, uint8_t, fsinfo->strategy, unsigned);
*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 f4dfa6d..027f33c 100644
--- a/src/H5Oginfo.c
+++ b/src/H5Oginfo.c
@@ -22,13 +22,13 @@
*-------------------------------------------------------------------------
*/
-#include "H5Omodule.h" /* This source code file is part of the H5O module */
+#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5Opkg.h" /* Object headers */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5Opkg.h" /* Object headers */
/* PRIVATE PROTOTYPES */
@@ -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, unsigned char, ginfo->store_link_phase_change ? H5O_GINFO_STORE_PHASE_CHANGE : 0, int);
+ ASSIGN_TO_SMALLER_SIZE(flags, unsigned char, ginfo->store_link_phase_change ? H5O_GINFO_STORE_PHASE_CHANGE : 0, int);
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 46d012c..3128761 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);
+ ASSIGN_TO_SMALLER_SIZE(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)])
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 069ee7c..143f49e 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);
+ ASSIGN_TO_SMALLER_SIZE(*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 9e57185..f605e8e 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);
+ ASSIGN_TO_SMALLER_SIZE(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 6076556..3453565 100644
--- a/src/H5Olink.c
+++ b/src/H5Olink.c
@@ -24,17 +24,17 @@
#define H5G_FRIEND /*suppress error about including H5Gpkg */
#define H5L_FRIEND /*suppress error about including H5Lpkg */
-#include "H5Omodule.h" /* This source code file is part of the H5O module */
+#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free lists */
-#include "H5Gpkg.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Lpkg.h" /* Links */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
+#include "H5Gpkg.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Lpkg.h" /* Links */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
/* PRIVATE PROTOTYPES */
@@ -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);
+ ASSIGN_TO_SMALLER_SIZE(*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 b7a95f5..7b6c444 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -15,13 +15,13 @@
#define H5S_FRIEND /*prevent warning from including H5Spkg.h */
#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5Gprivate.h" /* Groups */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5Gprivate.h" /* Groups */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Spkg.h" /* Dataspaces */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Spkg.h" /* Dataspaces */
/* PRIVATE PROTOTYPES */
@@ -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) {
- H5_CHECKED_ASSIGN(*p++, uint8_t, sdim->type, int);
+ ASSIGN_TO_SMALLER_SIZE(*p++, uint8_t, sdim->type, int);
}
else {
*p++ = 0; /*reserved*/
diff --git a/src/H5Rint.c b/src/H5Rint.c
index 1149594..2193d8a 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 */
- H5_CHECKED_ASSIGN(ref->type, int8_t, (H5R_type_t)*p++, int);
+ ASSIGN_TO_SMALLER_SIZE(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 448e128..40692cd 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -32,14 +32,13 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5MFprivate.h" /* File memory management */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5SMpkg.h" /* Shared object header messages */
-#include "H5WBprivate.h" /* Wrapped Buffers */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5MFprivate.h" /* File memory management */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5SMpkg.h" /* Shared object header messages */
+#include "H5WBprivate.h" /* Wrapped Buffers */
/****************/
@@ -398,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);
+ ASSIGN_TO_SMALLER_SIZE(*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 9e1eee2..2a04423 100644
--- a/src/H5SMmessage.c
+++ b/src/H5SMmessage.c
@@ -22,9 +22,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5MMprivate.h" /* Memory management */
#include "H5Opkg.h" /* Object Headers */
#include "H5SMpkg.h" /* Shared object header messages */
@@ -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);
+ ASSIGN_TO_SMALLER_SIZE(*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 5504811..7883461 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -30,8 +30,8 @@
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* ID Functions */
#include "H5MMprivate.h" /* Memory management */
#include "H5Spkg.h" /* Dataspace functions */
@@ -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);
+ ASSIGN_TO_SMALLER_SIZE(*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 d2f5657..1a7ea9b 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -21,9 +21,9 @@
#include "H5private.h" /*generic functions */
#include "H5Eprivate.h" /*error handling */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Tpkg.h" /*data-type functions */
-#include "H5WBprivate.h" /* Wrapped Buffers */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Tpkg.h" /*data-type functions */
+#include "H5WBprivate.h" /* Wrapped Buffers */
@@ -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);
+ ASSIGN_TO_SMALLER_SIZE(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;
- H5_CHECKED_ASSIGN(buf[idx], uint8_t, acc & 0xff, unsigned);
+ ASSIGN_TO_SMALLER_SIZE(buf[idx], uint8_t, acc & 0xff, unsigned);
idx++;
size -= 8;
}
diff --git a/test/dsets.c b/test/dsets.c
index 6d90474..9d5b410 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], unsigned char, 0xff ^ i, size_t);
+ for(i=0; i<sizeof buf; i++) ASSIGN_TO_SMALLER_SIZE(buf[i], unsigned char, 0xff ^ i, size_t);
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], unsigned char, 0xff ^ i, size_t);
+ for(i=0; i<sizeof buf; i++) ASSIGN_TO_SMALLER_SIZE(buf[i], unsigned char, 0xff ^ i, size_t);
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], unsigned char, 0xff ^ i, size_t);
+ ASSIGN_TO_SMALLER_SIZE(buf[i], unsigned char, 0xff ^ i, size_t);
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 950086f..33ebe3d 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -1216,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, short, (i*8+1) & 0x7fff, int);
- H5_CHECKED_ASSIGN(s_ptr->d, short, (i*8+6) & 0x7fff, int);
+ ASSIGN_TO_SMALLER_SIZE(s_ptr->b, short, (i*8+1) & 0x7fff, int);
+ ASSIGN_TO_SMALLER_SIZE(s_ptr->d, short, (i*8+6) & 0x7fff, int);
}
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
diff --git a/test/ntypes.c b/test/ntypes.c
index 99bc155..03eefe6 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], unsigned char, 0xff ^ i, size_t);
+ ASSIGN_TO_SMALLER_SIZE(wbuf[i], unsigned char, 0xff ^ i, size_t);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
if(H5Sclose(space) < 0) TEST_ERROR;
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index d2090e5..79eda60 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -303,7 +303,7 @@ static int test_mpio_gb_file(char *filename) {
mpi_rank, mpi_off, mpi_off);
/* set data to some trivial pattern for easy verification */
for (j = 0; j < MB; j++)
- H5_CHECKED_ASSIGN(*(buf + j), char, i * mpi_size + mpi_rank, int);
+ ASSIGN_TO_SMALLER_SIZE(*(buf + j), char, i * mpi_size + mpi_rank, int);
if (VERBOSE_MED)
HDfprintf(stdout,
"proc %d: writing %d bytes at offset %lld\n",
@@ -351,7 +351,7 @@ static int test_mpio_gb_file(char *filename) {
mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE,
&mpi_stat);
INFO((mrc == MPI_SUCCESS), "GB size file read");
- H5_CHECKED_ASSIGN(expected, char, i * mpi_size + (mpi_size - mpi_rank - 1), int);
+ ASSIGN_TO_SMALLER_SIZE(expected, char, i * mpi_size + (mpi_size - mpi_rank - 1), int);
vrfyerrs = 0;
for (j = 0; j < MB; j++) {
if ((*(buf + j) != expected)
@@ -526,7 +526,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
* ==================================================*/
irank = 0;
for (i = 0; i < DIMSIZE; i++)
- H5_CHECKED_ASSIGN(writedata[i], unsigned char, irank * DIMSIZE + i, int)
+ ASSIGN_TO_SMALLER_SIZE(writedata[i], unsigned char, irank * DIMSIZE + i, int)
mpi_off = irank * DIMSIZE;
/* Only one process writes */
@@ -597,7 +597,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
return 1;
};
for (i = 0; i < DIMSIZE; i++) {
- H5_CHECKED_ASSIGN(expect_val, unsigned char, irank * DIMSIZE + i, int);
+ ASSIGN_TO_SMALLER_SIZE(expect_val, unsigned char, irank * DIMSIZE + i, int);
if (readdata[i] != expect_val) {
PRINTID;
HDprintf("read data[%d:%d] got %02x, expect %02x\n", irank, i,
@@ -697,7 +697,7 @@ static int test_mpio_derived_dtype(char *filename) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
retcode = 0;
for (i = 0; i < 3; i++)
- H5_CHECKED_ASSIGN(buf[i], char, i + 1, int);
+ ASSIGN_TO_SMALLER_SIZE(buf[i], char, i + 1, int);
if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh))
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index aa17878..2cd826b 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -4711,7 +4711,7 @@ uint16_t swap_uint16(uint16_t val)
{
uint16_t ret;
- H5_CHECKED_ASSIGN(ret, uint16_t, (val << 8) | (val >> 8), int);
+ ASSIGN_TO_SMALLER_SIZE(ret, uint16_t, (val << 8) | (val >> 8), int);
return ret;
}
@@ -4719,7 +4719,7 @@ int16_t swap_int16(int16_t val)
{
uint16_t ret;
- H5_CHECKED_ASSIGN(ret, int16_t, (val << 8) | ((val >> 8) & 0xFF), int);
+ ASSIGN_TO_SMALLER_SIZE(ret, int16_t, (val << 8) | ((val >> 8) & 0xFF), int);
return ret;
}
diff --git a/tools/test/h5diff/dynlib_diff.c b/tools/test/h5diff/dynlib_diff.c
index 1b98068..5989b38 100644
--- a/tools/test/h5diff/dynlib_diff.c
+++ b/tools/test/h5diff/dynlib_diff.c
@@ -70,7 +70,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, char, temp - MULTIPLIER, int);
+ ASSIGN_TO_SMALLER_SIZE(*int_ptr, char, temp - MULTIPLIER, int);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
@@ -79,7 +79,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, char, temp + MULTIPLIER, int);
+ ASSIGN_TO_SMALLER_SIZE(*int_ptr, char, temp + MULTIPLIER, int);
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 1b98068..5989b38 100644
--- a/tools/test/h5dump/dynlib_dump.c
+++ b/tools/test/h5dump/dynlib_dump.c
@@ -70,7 +70,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, char, temp - MULTIPLIER, int);
+ ASSIGN_TO_SMALLER_SIZE(*int_ptr, char, temp - MULTIPLIER, int);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
@@ -79,7 +79,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, char, temp + MULTIPLIER, int);
+ ASSIGN_TO_SMALLER_SIZE(*int_ptr, char, temp + MULTIPLIER, int);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 4de2463..b3bd188 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], unsigned char, 0xff ^ i, size_t);
+ ASSIGN_TO_SMALLER_SIZE(buf[i], unsigned char, 0xff ^ i, size_t);
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], unsigned char, 0xff ^ i, size_t);
+ ASSIGN_TO_SMALLER_SIZE(buf[i], unsigned char, 0xff ^ i, size_t);
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);
+ ASSIGN_TO_SMALLER_SIZE(buf[i], uint8_t, 0xff ^ i, size_t);
}
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);
+ ASSIGN_TO_SMALLER_SIZE(buf2[i], uint16_t, 0xffff ^ (i * 16), size_t);
}
H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2);
H5Dclose(dset);
@@ -9879,7 +9879,7 @@ static void gent_bitnopaquefields(void)
if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) {
if ((dset = H5Dcreate2(grp, "opaque_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);
+ ASSIGN_TO_SMALLER_SIZE(buf[i], uint8_t, 0xff ^ i, size_t);
H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
H5Dclose(dset);
}
@@ -9895,7 +9895,7 @@ static void gent_bitnopaquefields(void)
if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) {
if ((dset = H5Dcreate2(grp, "opaque_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);
+ ASSIGN_TO_SMALLER_SIZE(buf2[i], uint16_t, 0xffff ^ (i * 16), size_t);
H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2);
H5Dclose(dset);
@@ -9918,8 +9918,8 @@ static void gent_bitnopaquefields(void)
if ((space = H5Screate_simple(1, &nelmts, NULL)) >= 0) {
if ((dset = H5Dcreate2(grp, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
for(i = 0; i < nelmts; i++) {
- H5_CHECKED_ASSIGN(buf5[i].a, uint8_t, 0xff ^ i, size_t);
- H5_CHECKED_ASSIGN(buf5[i].b, uint16_t, 0xffff ^ (i * 16), size_t);
+ ASSIGN_TO_SMALLER_SIZE(buf5[i].a, uint8_t, 0xff ^ i, size_t);
+ ASSIGN_TO_SMALLER_SIZE(buf5[i].b, uint16_t, 0xffff ^ (i * 16), size_t);
buf5[i].c = (uint32_t)0xffffffff ^ (uint32_t)(i * 32);
buf5[i].d = (uint64_t)0xffffffffffffffff ^ (uint64_t)(i * 64);
}
diff --git a/tools/test/h5ls/dynlib_ls.c b/tools/test/h5ls/dynlib_ls.c
index ad0cd0e..089b78f 100644
--- a/tools/test/h5ls/dynlib_ls.c
+++ b/tools/test/h5ls/dynlib_ls.c
@@ -70,7 +70,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, char, temp - MULTIPLIER, int);
+ ASSIGN_TO_SMALLER_SIZE(*int_ptr, char, temp - MULTIPLIER, int);
int_ptr++;
buf_left -= sizeof(*int_ptr);
} /* end while */
diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c
index c2398b6..f3cb7d9 100644
--- a/tools/test/h5repack/h5repackgentest.c
+++ b/tools/test/h5repack/h5repackgentest.c
@@ -266,7 +266,7 @@ generate_uint8be(hbool_t external) {
for (i = 0, n = 0; i < dims[0]; i++) {
for (j = 0; j < dims[1]; j++) {
for (k = 0; k < dims[2]; k++, n++) {
- H5_CHECKED_ASSIGN(wdata[n], uint8_t, n * ((n & 1) ? (-1) : (1)), int);
+ ASSIGN_TO_SMALLER_SIZE(wdata[n], uint8_t, n * ((n & 1) ? (-1) : (1)), int);
}
}
}