From 51ed3d256e87b423265c17867c80f588ee48fa3b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 23 Jan 2020 21:19:24 -0800 Subject: Cleaned up warnings in test/tid.c. --- test/tid.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/test/tid.c b/test/tid.c index d0ae3e4..7a839d2 100644 --- a/test/tid.c +++ b/test/tid.c @@ -19,6 +19,13 @@ #define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" +static herr_t +free_wrapper(void *p) +{ + HDfree(p); + return SUCCEED; +} + /* Test basic functionality of registering and deleting types and IDs */ static int basic_id_test(void) { @@ -69,7 +76,7 @@ static int basic_id_test(void) goto out; /* Register a type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + myType = H5Iregister_type((size_t)64, 0, free_wrapper); CHECK(myType, H5I_BADID, "H5Iregister_type"); if(myType == H5I_BADID) @@ -163,7 +170,7 @@ static int basic_id_test(void) H5E_END_TRY /* Register another type and another object in that type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + myType = H5Iregister_type((size_t)64, 0, free_wrapper); CHECK(myType, H5I_BADID, "H5Iregister_type"); if(myType == H5I_BADID) @@ -238,7 +245,7 @@ out: /* A dummy search function for the next test */ -static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; } +static int test_search_func(void H5_ATTR_UNUSED * ptr1, hid_t H5_ATTR_UNUSED id, void H5_ATTR_UNUSED * ptr2) { return 0; } /* Ensure that public functions cannot access "predefined" ID types */ static int id_predefined_test(void ) @@ -264,7 +271,7 @@ static int id_predefined_test(void ) goto out; H5E_BEGIN_TRY - testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); + testPtr = H5Isearch(H5I_GENPROP_LST, test_search_func, testObj); H5E_END_TRY CHECK_PTR_NULL(testPtr, "H5Isearch"); @@ -492,7 +499,7 @@ static int test_id_type_list(void) H5I_type_t testType; int i; /* Just a counter variable */ - startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + startType = H5Iregister_type((size_t)8, 0, free_wrapper); CHECK(startType, H5I_BADID, "H5Iregister_type"); if(startType == H5I_BADID) goto out; @@ -507,7 +514,7 @@ static int test_id_type_list(void) /* Create types up to H5I_MAX_NUM_TYPES */ for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + currentType = H5Iregister_type((size_t)8, 0, free_wrapper); CHECK(currentType, H5I_BADID, "H5Iregister_type"); if(currentType == H5I_BADID) goto out; @@ -516,7 +523,7 @@ static int test_id_type_list(void) /* Wrap around to low type ID numbers */ for(i = H5I_NTYPES; i < startType; i++) { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + currentType = H5Iregister_type((size_t)8, 0, free_wrapper); CHECK(currentType, H5I_BADID, "H5Iregister_type"); if(currentType == H5I_BADID) goto out; @@ -524,7 +531,7 @@ static int test_id_type_list(void) /* There should be no room at the inn for a new ID type*/ H5E_BEGIN_TRY - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + testType = H5Iregister_type((size_t)8, 0, free_wrapper); H5E_END_TRY VERIFY(testType, H5I_BADID, "H5Iregister_type"); @@ -533,7 +540,7 @@ static int test_id_type_list(void) /* Now delete a type and try to insert again */ H5Idestroy_type(H5I_NTYPES); - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + testType = H5Iregister_type((size_t)8, 0, free_wrapper); VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); if(testType != H5I_NTYPES) -- cgit v0.12