Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patches from vtk #358

Merged
merged 10 commits into from
Feb 25, 2021
2 changes: 1 addition & 1 deletion c++/src/H5Attribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace H5 {
using std::cerr;
using std::endl;

class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
class H5Object; // forward declaration for UserData4Aiterate

//--------------------------------------------------------------------------
// Function: Attribute default constructor
Expand Down
2 changes: 2 additions & 0 deletions c++/src/H5Location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2153,6 +2153,7 @@ H5Location::childObjType(const char *objname) const
break;
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
case H5O_TYPE_MAP:
default:
throwException("childObjType", "Unknown type of object");
}
Expand Down Expand Up @@ -2231,6 +2232,7 @@ H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_iter_order_t o
break;
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
case H5O_TYPE_MAP:
default:
throwException("childObjType", "Unknown type of object");
}
Expand Down
13 changes: 9 additions & 4 deletions c++/src/H5Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// userAttrOpWrpr interfaces between the user's function and the
// C library function H5Aiterate2
extern "C" herr_t
userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data)
extern "C"
{

static herr_t
userAttrOpWrpr(H5_ATTR_UNUSED hid_t loc_id, const char *attr_name, H5_ATTR_UNUSED const H5A_info_t *ainfo, void *op_data)
{
H5std_string s_attr_name = H5std_string(attr_name);
UserData4Aiterate *myData = reinterpret_cast<UserData4Aiterate *>(op_data);
Expand All @@ -53,15 +56,17 @@ userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, voi

// userVisitOpWrpr interfaces between the user's function and the
// C library function H5Ovisit3
extern "C" herr_t
userVisitOpWrpr(hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info, void *op_data)
static herr_t
userVisitOpWrpr (H5_ATTR_UNUSED hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info, void *op_data)
{
H5std_string s_attr_name = H5std_string(attr_name);
UserData4Visit *myData = reinterpret_cast<UserData4Visit *>(op_data);
int status = myData->op(*myData->obj, s_attr_name, obj_info, myData->opData);
return status;
}

} // extern "C"

//--------------------------------------------------------------------------
// Function: H5Object default constructor (protected)
// Programmer Binh-Minh Ribler - 2000
Expand Down
3 changes: 2 additions & 1 deletion c++/src/H5PredType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "H5DataType.h"
#include "H5AtomType.h"
#include "H5PredType.h"
#include "H5private.h"

namespace H5 {

Expand Down Expand Up @@ -82,7 +83,7 @@ PredType::operator=(const PredType &rhs)
// These dummy functions do not inherit from DataType - they'll
// throw an DataTypeIException if invoked.
void
PredType::commit(H5Location &loc, const char *name)
PredType::commit(H5_ATTR_UNUSED H5Location &loc, H5_ATTR_UNUSED const char *name)
{
throw DataTypeIException("PredType::commit",
"Error: Attempted to commit a predefined datatype. Invalid operation!");
Expand Down
3 changes: 3 additions & 0 deletions c++/src/H5PropList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ PropList::PropList(const hid_t plist_id) : IdComponent()
case H5I_ERROR_STACK:
case H5I_NTYPES:
case H5I_UNINIT:
case H5I_MAP:
case H5I_SPACE_SEL_ITER:
case H5I_EVENTSET:
default:
id = H5P_DEFAULT;
break;
Expand Down
3 changes: 2 additions & 1 deletion c++/src/H5StrType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "H5StrType.h"
#include "H5DataSet.h"
#include "H5PredType.h"
#include "H5private.h"

namespace H5 {

Expand Down Expand Up @@ -102,7 +103,7 @@ StrType::StrType(const PredType &pred_type, const size_t &size) : AtomType()
// This constructor replaced the previous one.
// Programmer Binh-Minh Ribler - Nov 28, 2005
//--------------------------------------------------------------------------
StrType::StrType(const int dummy, const size_t &size) : AtomType()
StrType::StrType(H5_ATTR_UNUSED const int dummy, const size_t &size) : AtomType()
{
// use DataType::copy to make a copy of the string predefined type
// then set its length
Expand Down
2 changes: 1 addition & 1 deletion hl/c++/src/H5PacketTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class H5_HLCPPDLL FL_PacketTable : virtual public PacketTable {
/* Destructor
* Cleans up the packet table
*/
virtual ~FL_PacketTable(){};
virtual ~FL_PacketTable(){}

/* AppendPacket
* Adds a single packet to the packet table. Takes a pointer
Expand Down
7 changes: 1 addition & 6 deletions hl/src/H5IM.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,14 @@ H5IMmake_image_24bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t
*-------------------------------------------------------------------------
*/
static herr_t
find_palette(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_data)
find_palette(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const H5A_info_t *ainfo, H5_ATTR_UNUSED void *op_data)
{
int ret = H5_ITER_CONT;

/* check the arguments */
if (name == NULL)
return -1;

/* Shut compiler up */
loc_id = loc_id;
ainfo = ainfo;
op_data = op_data;

/* Define a positive value for return value if the attribute was found. This will
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
Expand Down
12 changes: 2 additions & 10 deletions hl/src/H5LT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ H5LTget_dataset_info(hid_t loc_id, const char *dset_name, hsize_t *dims, H5T_cla
*/

static herr_t
find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_data)
find_dataset(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const H5L_info2_t *linfo, void *op_data)
{
/* Define a default zero value for return. This will cause the iterator to continue if
* the dataset is not found yet.
Expand All @@ -1308,10 +1308,6 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_
if (name == NULL)
return ret;

/* Shut the compiler up */
loc_id = loc_id;
linfo = linfo;

/* Define a positive value for return value if the dataset was found. This will
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
Expand Down Expand Up @@ -1841,18 +1837,14 @@ H5LTset_attribute_double(hid_t loc_id, const char *obj_name, const char *attr_na
*-------------------------------------------------------------------------
*/
static herr_t
find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_data)
find_attr(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const H5A_info_t *ainfo, void *op_data)
{
int ret = H5_ITER_CONT;

/* check the arguments */
if (name == NULL)
return H5_ITER_CONT;

/* Shut compiler up */
loc_id = loc_id;
ainfo = ainfo;

/* Define a positive value for return value if the attribute was found. This will
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
Expand Down
12 changes: 6 additions & 6 deletions hl/tools/gif2h5/hdfgifwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, byte *gmap
}

/* Shut compiler up... */
ptype = ptype;
rmap = rmap;
gmap = gmap;
bmap = bmap;
numcols = numcols;
colorstyle = colorstyle;
(void)ptype;
(void)rmap;
(void)gmap;
(void)bmap;
(void)numcols;
(void)colorstyle;

for (i = 0; i < 256; i++) {
pc2nc[i] = pc2ncmap[i];
Expand Down
3 changes: 2 additions & 1 deletion src/H5Cimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,8 @@ H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);

/* Set information needed to load cache image */
cache_ptr->image_addr = addr, cache_ptr->image_len = len;
cache_ptr->image_addr = addr;
cache_ptr->image_len = len;
seanm marked this conversation as resolved.
Show resolved Hide resolved
cache_ptr->load_image = TRUE;
cache_ptr->delete_image = rw;

Expand Down
2 changes: 1 addition & 1 deletion src/H5FDmulti.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ static herr_t
H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */)
{
/* Shut compiler up */
_f = _f;
(void)_f;

/* Set the VFL feature flags that this driver supports */
if (flags) {
Expand Down
32 changes: 16 additions & 16 deletions src/H5FDstdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
assert(sizeof(file_offset_t) >= sizeof(size_t));

/* Quiet compiler */
fapl_id = fapl_id;
(void)fapl_id;

/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
Expand Down Expand Up @@ -587,7 +587,7 @@ static herr_t
H5FD_stdio_query(const H5FD_t *_f, unsigned long /*OUT*/ *flags)
{
/* Quiet the compiler */
_f = _f;
(void)_f;

/* Set the VFL feature flags that this driver supports.
*
Expand Down Expand Up @@ -632,8 +632,8 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp
haddr_t addr;

/* Quiet compiler */
type = type;
dxpl_id = dxpl_id;
(void)type;
(void)dxpl_id;

/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
Expand Down Expand Up @@ -671,7 +671,7 @@ H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type)
H5Eclear2(H5E_DEFAULT);

/* Quiet compiler */
type = type;
(void)type;

return file->eoa;
} /* end H5FD_stdio_get_eoa() */
Expand Down Expand Up @@ -701,7 +701,7 @@ H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, haddr_t addr)
H5Eclear2(H5E_DEFAULT);

/* Quiet the compiler */
type = type;
(void)type;

file->eoa = addr;

Expand Down Expand Up @@ -732,13 +732,13 @@ H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type)
const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file;

/* Quiet the compiler */
type = type;
(void)type;

/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);

/* Quiet the compiler */
type = type;
(void)type;

return (file->eof);
} /* end H5FD_stdio_get_eof() */
Expand All @@ -762,7 +762,7 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t /*UNUSED*/ fapl, void **file_handle)
static const char *func = "H5FD_stdio_get_handle"; /* Function Name for error reporting */

/* Quiet the compiler */
fapl = fapl;
(void)fapl;

/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
Expand Down Expand Up @@ -800,8 +800,8 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl
static const char *func = "H5FD_stdio_read"; /* Function Name for error reporting */

/* Quiet the compiler */
type = type;
dxpl_id = dxpl_id;
(void)type;
(void)dxpl_id;

/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
Expand Down Expand Up @@ -902,8 +902,8 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp
static const char *func = "H5FD_stdio_write"; /* Function Name for error reporting */

/* Quiet the compiler */
dxpl_id = dxpl_id;
type = type;
(void)dxpl_id;
(void)type;

/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
Expand Down Expand Up @@ -990,7 +990,7 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t closing)
static const char *func = "H5FD_stdio_flush"; /* Function Name for error reporting */

/* Quiet the compiler */
dxpl_id = dxpl_id;
(void)dxpl_id;

/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
Expand Down Expand Up @@ -1034,8 +1034,8 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/
static const char *func = "H5FD_stdio_truncate"; /* Function Name for error reporting */

/* Quiet the compiler */
dxpl_id = dxpl_id;
closing = closing;
(void)dxpl_id;
(void)closing;

/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
Expand Down
28 changes: 14 additions & 14 deletions src/H5HFhuge.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,32 +113,32 @@ H5HF__huge_bt2_create(H5HF_hdr_t *hdr)
if (hdr->huge_ids_direct) {
if (hdr->filter_len > 0) {
bt2_cparam.rrec_size =
(size_t)((unsigned)hdr->sizeof_addr /* Address of object */
+ (unsigned)hdr->sizeof_size /* Length of object */
+ (unsigned)4 /* Filter mask for filtered object */
+ (unsigned)hdr->sizeof_size); /* Size of de-filtered object in memory */
(uint32_t)((unsigned)hdr->sizeof_addr /* Address of object */
+ (unsigned)hdr->sizeof_size /* Length of object */
+ (unsigned)4 /* Filter mask for filtered object */
+ (unsigned)hdr->sizeof_size); /* Size of de-filtered object in memory */
bt2_cparam.cls = H5HF_HUGE_BT2_FILT_DIR;
} /* end if */
else {
bt2_cparam.rrec_size = (size_t)((unsigned)hdr->sizeof_addr /* Address of object */
+ (unsigned)hdr->sizeof_size); /* Length of object */
bt2_cparam.rrec_size = (uint32_t)((unsigned)hdr->sizeof_addr /* Address of object */
+ (unsigned)hdr->sizeof_size); /* Length of object */
bt2_cparam.cls = H5HF_HUGE_BT2_DIR;
} /* end else */
} /* end if */
else {
if (hdr->filter_len > 0) {
bt2_cparam.rrec_size =
(size_t)((unsigned)hdr->sizeof_addr /* Address of filtered object */
+ (unsigned)hdr->sizeof_size /* Length of filtered object */
+ (unsigned)4 /* Filter mask for filtered object */
+ (unsigned)hdr->sizeof_size /* Size of de-filtered object in memory */
+ (unsigned)hdr->sizeof_size); /* Unique ID for object */
(uint32_t)((unsigned)hdr->sizeof_addr /* Address of filtered object */
+ (unsigned)hdr->sizeof_size /* Length of filtered object */
+ (unsigned)4 /* Filter mask for filtered object */
+ (unsigned)hdr->sizeof_size /* Size of de-filtered object in memory */
+ (unsigned)hdr->sizeof_size); /* Unique ID for object */
bt2_cparam.cls = H5HF_HUGE_BT2_FILT_INDIR;
} /* end if */
else {
bt2_cparam.rrec_size = (size_t)((unsigned)hdr->sizeof_addr /* Address of object */
+ (unsigned)hdr->sizeof_size /* Length of object */
+ (unsigned)hdr->sizeof_size); /* Unique ID for object */
bt2_cparam.rrec_size = (uint32_t)((unsigned)hdr->sizeof_addr /* Address of object */
+ (unsigned)hdr->sizeof_size /* Length of object */
+ (unsigned)hdr->sizeof_size); /* Unique ID for object */
bt2_cparam.cls = H5HF_HUGE_BT2_INDIR;
} /* end else */
} /* end else */
Expand Down
2 changes: 1 addition & 1 deletion src/H5VLpassthru.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ H5VL_pass_through_init(hid_t vipl_id)
#endif

/* Shut compiler up about unused parameter */
vipl_id = vipl_id;
(void)vipl_id;

return 0;
} /* end H5VL_pass_through_init() */
Expand Down
Loading