summaryrefslogtreecommitdiffstats
path: root/test/tgenprop.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-08-31 19:04:23 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-08-31 19:04:23 (GMT)
commitc226e58005f54b29dc9fc5f762f7aa6382e790ff (patch)
treefa288e15e01237434f2193d99bc21bb50963b12f /test/tgenprop.c
parente6f9fc5f7f58e4c0a9a8541bc5674b440abd658c (diff)
downloadhdf5-c226e58005f54b29dc9fc5f762f7aa6382e790ff.zip
hdf5-c226e58005f54b29dc9fc5f762f7aa6382e790ff.tar.gz
hdf5-c226e58005f54b29dc9fc5f762f7aa6382e790ff.tar.bz2
[svn-r27626] Various minor warning fixes before major SWMR and VDS merges.
gcc 4.9.2 was used to create the warning list - implicit casts - shadowed variables - various enum issues - other minor fixes (comments, unused macros, etc.) Tested on: h5committest
Diffstat (limited to 'test/tgenprop.c')
-rw-r--r--test/tgenprop.c82
1 files changed, 36 insertions, 46 deletions
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 10cae6d..fda4161 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -61,6 +61,18 @@ double prop4_def=1.41F; /* Property 4 default value */
#define PROP4_SIZE sizeof(prop4_def)
#define PROP4_DEF_VALUE (&prop4_def)
+/* Structs used during iteration */
+typedef struct iter_data_t {
+ int iter_count;
+ char **names;
+} iter_data_t;
+
+typedef struct count_data_t {
+ int count;
+ hid_t id;
+} count_data_t;
+
+
/****************************************************************
**
** test_genprop_basic_class(): Test basic generic property list code.
@@ -284,17 +296,12 @@ test_genprop_basic_class_prop(void)
**
****************************************************************/
static int
-test_genprop_iter1(hid_t id, const char *name, void *iter_data)
+test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name,
+ void *iter_data)
{
- struct { /* Struct for iterations */
- int iter_count;
- const char **names;
- } *iter_struct = iter_data;
-
- /* Shut compiler up */
- id = id;
+ iter_data_t *idata = (iter_data_t *)iter_data;
- return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++]));
+ return HDstrcmp(name,idata->names[idata->iter_count++]);
}
/****************************************************************
@@ -373,43 +380,34 @@ test_genprop_class_iter(void)
static herr_t
test_genprop_cls_crt_cb1(hid_t list_id, void *create_data)
{
- struct { /* Struct for iterations */
- int count;
- hid_t id;
- } *count_struct=create_data;
+ count_data_t *cdata = (count_data_t *)create_data;
- count_struct->count++;
- count_struct->id=list_id;
+ cdata->count++;
+ cdata->id = list_id;
- return(SUCCEED);
+ return SUCCEED;
}
static herr_t
test_genprop_cls_cpy_cb1(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *copy_data)
{
- struct { /* Struct for iterations */
- int count;
- hid_t id;
- } *count_struct=copy_data;
+ count_data_t *cdata = (count_data_t *)copy_data;
- count_struct->count++;
- count_struct->id=new_list_id;
+ cdata->count++;
+ cdata->id = new_list_id;
- return(SUCCEED);
+ return SUCCEED;
}
static herr_t
test_genprop_cls_cls_cb1(hid_t list_id, void *create_data)
{
- struct { /* Struct for iterations */
- int count;
- hid_t id;
- } *count_struct=create_data;
+ count_data_t *cdata = (count_data_t *)create_data;
- count_struct->count++;
- count_struct->id=list_id;
+ cdata->count++;
+ cdata->id = list_id;
- return(SUCCEED);
+ return SUCCEED;
}
/****************************************************************
@@ -843,17 +841,12 @@ test_genprop_basic_list_prop(void)
**
****************************************************************/
static int
-test_genprop_iter2(hid_t id, const char *name, void *iter_data)
+test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name,
+ void *iter_data)
{
- struct { /* Struct for iterations */
- int iter_count;
- const char **names;
- } *iter_struct=iter_data;
-
- /* Shut compiler up */
- id=id;
+ iter_data_t *idata = (iter_data_t *)iter_data;
- return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++]));
+ return HDstrcmp(name,idata->names[idata->iter_count++]);
}
/****************************************************************
@@ -995,15 +988,12 @@ prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */
static herr_t
test_genprop_cls_cpy_cb2(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *create_data)
{
- struct { /* Struct for iterations */
- int count;
- hid_t id;
- } *count_struct=create_data;
+ count_data_t *cdata = (count_data_t *)create_data;
- count_struct->count++;
- count_struct->id=new_list_id;
+ cdata->count++;
+ cdata->id = new_list_id;
- return(SUCCEED);
+ return SUCCEED;
}
/****************************************************************