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

Removed bad function pointer casts #434

Merged
merged 2 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c++/test/dsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
"bogus", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)filter_bogus, /* The actual filter function */
filter_bogus, /* The actual filter function */
}};

/*-------------------------------------------------------------------------
Expand Down
21 changes: 11 additions & 10 deletions c++/test/tfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl,
/* Temporary filter IDs used for testing */
const int H5Z_FILTER_BOGUS = 305;

#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead
static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
#endif
static size_t filter_bogus(size_t nbytes);

/* This message derives from H5Z */
const H5Z_class2_t H5Z_BOGUS[1] = {{
H5Z_CLASS_T_VERS, /* H5Z_class_t version */
Expand All @@ -62,7 +60,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
"bogus", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)filter_bogus, /* The actual filter function */
filter_bogus, /* The actual filter function */
}};

/*-------------------------------------------------------------------------
Expand All @@ -79,13 +77,16 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead
filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
#endif
filter_bogus(size_t nbytes)
filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes,
size_t *buf_size, void **buf)
{
(void)flags;
(void)cd_nelmts;
(void)cd_values;
(void)buf_size;
(void)buf;

return nbytes;
}

Expand Down
2 changes: 1 addition & 1 deletion test/filter_plugin1_dsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const H5Z_class2_t FILTER_INFO[1] = {{
"test filter plugin 1", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)add_sub_value, /* The actual filter function */
add_sub_value, /* The actual filter function */
}};

H5PL_type_t
Expand Down
2 changes: 1 addition & 1 deletion test/filter_plugin2_dsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const H5Z_class2_t FILTER_INFO[1] = {{
"test filter plugin 2", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)mult_div_value, /* The actual filter function */
mult_div_value, /* The actual filter function */
}};

H5PL_type_t
Expand Down
2 changes: 1 addition & 1 deletion test/filter_plugin3_dsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const H5Z_class2_t FILTER_INFO[1] = {{
"test filter plugin 3", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)add_sub_value_hdf5, /* The actual filter function */
add_sub_value_hdf5, /* The actual filter function */
}};

H5PL_type_t
Expand Down
2 changes: 1 addition & 1 deletion test/filter_plugin4_groups.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const H5Z_class2_t FILTER_INFO[1] = {{
"test filter plugin 4", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)append_to_group_name, /* The actual filter function */
append_to_group_name, /* The actual filter function */
}};

H5PL_type_t
Expand Down
2 changes: 1 addition & 1 deletion tools/test/h5copy/dynlib_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
"dynlibud", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
H5Z_filter_dynlibud, /* The actual filter function */
}};

H5PL_type_t
Expand Down
2 changes: 1 addition & 1 deletion tools/test/h5diff/dynlib_diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
"dynlibud", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
H5Z_filter_dynlibud, /* The actual filter function */
}};

H5PL_type_t
Expand Down
2 changes: 1 addition & 1 deletion tools/test/h5dump/dynlib_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
"dynlibud", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
H5Z_filter_dynlibud, /* The actual filter function */
}};

H5PL_type_t
Expand Down
2 changes: 1 addition & 1 deletion tools/test/h5dump/h5dumpgentest.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
"dynlibud", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
H5Z_filter_dynlibud, /* The actual filter function */
}};

/* A UD link traversal function. Shouldn't actually be called. */
Expand Down
2 changes: 1 addition & 1 deletion tools/test/h5ls/dynlib_ls.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
"dynlibud", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
H5Z_filter_dynlibud, /* The actual filter function */
}};

H5PL_type_t
Expand Down
2 changes: 1 addition & 1 deletion tools/test/h5repack/dynlib_rpk.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const H5Z_class2_t H5Z_DYNLIB1[1] = {{
"dynlib1", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */
H5Z_filter_dynlib1, /* The actual filter function */
}};

H5PL_type_t
Expand Down
2 changes: 1 addition & 1 deletion tools/test/h5repack/dynlib_vrpk.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const H5Z_class2_t H5Z_DYNLIB4[1] = {{
"dynlib4", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
(H5Z_func_t)H5Z_filter_dynlib4, /* The actual filter function */
H5Z_filter_dynlib4, /* The actual filter function */
}};

H5PL_type_t
Expand Down