summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2013-08-19 22:13:15 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2013-08-19 22:13:15 (GMT)
commit482a9c28e71b0c1b3767bcf30be3c534bbc65ed9 (patch)
tree79a9cae55a104fadf1cc5ca8d11afc493c856690 /tools
parentc502d81a8c87dd2bce47a5476e3331b04fc69322 (diff)
downloadhdf5-482a9c28e71b0c1b3767bcf30be3c534bbc65ed9.zip
hdf5-482a9c28e71b0c1b3767bcf30be3c534bbc65ed9.tar.gz
hdf5-482a9c28e71b0c1b3767bcf30be3c534bbc65ed9.tar.bz2
[svn-r24030] Description:
Clean up more compiler warnings. Tested on: Mac OSX/64 10.8.4 (amazon) w/gcc, C++ & FORTRAN (too minor to require h5committest)
Diffstat (limited to 'tools')
-rw-r--r--tools/h5diff/h5diffgentest.c56
-rw-r--r--tools/h5dump/h5dump_ddl.c8
-rw-r--r--tools/h5dump/h5dump_xml.c82
-rw-r--r--tools/h5dump/h5dump_xml.h81
-rw-r--r--tools/lib/h5tools_dump.c2
-rw-r--r--tools/lib/h5tools_dump.h2
-rw-r--r--tools/lib/h5trav.c48
7 files changed, 144 insertions, 135 deletions
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index d8b3b34..2271703 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -560,10 +560,10 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3)
int data4[3][2] = {{0,0},{0,0},{0,0}};
int data5[2][2] = {{0,0},{0,0}};
unsigned int data6[3][2] = {{0,0},{0,0},{0,0}};
- cmp1_t data7[1] = {{1,2}};
- cmp2_t data8[1] = {{1,2}};
- hsize_t dims3[2] = { 2,2 };
- hsize_t dims4[1] = { 1 };
+ cmp1_t data7[1] = {{1.0f, 2}};
+ cmp2_t data8[1] = {{1, 2.0f}};
+ hsize_t dims3[2] = {2, 2};
+ hsize_t dims4[1] = {1};
size_t type_size;
hid_t tid;
@@ -4419,6 +4419,7 @@ static void test_comps_array (const char *fname, const char *dset, const char *a
* Create an attribute in root group
*/
tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT);
+ assert(tid_attr > 0);
ret = H5Awrite(tid_attr, tid_cmpd1, wdata);
assert(ret >= 0);
@@ -4461,6 +4462,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a
hid_t fid; /* HDF5 File ID */
hid_t did_dset; /* dataset ID */
hid_t sid_dset; /* dataset space ID */
+ hid_t tid_attr;
hid_t tid_cmpd2; /* compound2 type ID */
hid_t tid_cmpd1; /* compound1 type ID */
hid_t tid_cmpd1_vlen;
@@ -4525,22 +4527,22 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a
ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
assert(ret >= 0);
- /* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
- assert(ret >= 0);
-
/*-----------------------------------
* Create an attribute in root group
*/
- /* TODO: creating vlen with compound type doesn't work for attribute now.
- * so add this later when it's fixed
tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT);
+ assert(tid_attr > 0);
ret = H5Awrite(tid_attr, tid_cmpd1, wdata);
assert(ret >= 0);
- */
+
+ /* Reclaim the write VL data */
+ ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* ----------------
* Close IDs */
+ ret = H5Aclose(tid_attr);
+ assert(ret >= 0);
ret = H5Dclose(did_dset);
assert(ret >= 0);
ret = H5Tclose(tid_cmpd2);
@@ -4577,6 +4579,7 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch
hid_t fid; /* HDF5 File IDs */
hid_t did_dset; /* Dataset ID */
hid_t sid_dset; /* Dataspace ID */
+ hid_t tid_attr;
hid_t tid_cmpd1; /* Compound1 Datatype ID */
hid_t tid_arry1; /* Array Datatype ID */
hid_t tid_cmpd2; /* Compound2 Datatype ID */
@@ -4664,22 +4667,22 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch
ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
assert(ret >= 0);
- /* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
- assert(ret >= 0);
-
/*-----------------------------------
* Create an attribute in root group
*/
- /* TODO: creating vlen with compound type doesn't work for attribute now.
- * so add this later when it's fixed
tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT);
+ assert(tid_attr > 0);
ret = H5Awrite(tid_attr, tid_cmpd1, wdata);
assert(ret >= 0);
- */
+
+ /* Reclaim the write VL data */
+ ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/*-------------------
* Close IDs */
+ ret = H5Aclose(tid_attr);
+ assert(ret >= 0);
ret = H5Tclose(tid_arry1);
assert(ret >= 0);
ret = H5Dclose(did_dset);
@@ -4724,6 +4727,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch
hid_t fid; /* HDF5 File ID */
hid_t did_dset; /* dataset ID */
hid_t sid_dset; /* dataset space ID */
+ hid_t tid_attr;
hid_t tid_cmpd3; /* compound3 type ID */
hid_t tid_cmpd2; /* compound2 type ID */
hid_t tid_cmpd2_arry;
@@ -4809,22 +4813,22 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch
ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
assert(ret >= 0);
- /* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
- assert(ret >= 0);
-
/*-----------------------------------
* Create an attribute in root group
*/
- /* TODO: creating vlen with compound type doesn't work for attribute now.
- * so add this later when it's fixed
tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT);
+ assert(tid_attr > 0);
ret = H5Awrite(tid_attr, tid_cmpd1, wdata);
assert(ret >= 0);
- */
+
+ /* Reclaim the write VL data */
+ ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* ----------------
* Close IDs */
+ ret = H5Aclose(tid_attr);
+ assert(ret >= 0);
ret = H5Dclose(did_dset);
assert(ret >= 0);
ret = H5Sclose(sid_dset);
@@ -4870,7 +4874,7 @@ static void test_data_nocomparables (const char * fname, int make_diffs)
int data1[DIM_ARRY] = {0,0,0};
int data2[DIM_ARRY] = {1,1,1};
int data3[DIM_ARRY+1] = {1,1,1,1};
- int data1_dim2[DIM_ARRY][1] = {{0,0,0}};
+ int data1_dim2[DIM_ARRY][1] = {0,0,0};
int rank_attr;
char data1_str[DIM_ARRY][STR_SIZE]= {"ab","cd","ef"};
herr_t status = SUCCEED;
diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c
index ec93778..380eb8e 100644
--- a/tools/h5dump/h5dump_ddl.c
+++ b/tools/h5dump/h5dump_ddl.c
@@ -148,7 +148,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo
outputformat = &string_dataformat;
h5dump_type_table = type_table;
- h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char);
+ h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id, display_ai, display_char);
h5dump_type_table = NULL;
if(attr_id < 0) {
@@ -1360,7 +1360,7 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *ainfo, vo
} /* end attr_search() */
static herr_t
-obj_search(const char *path, const H5O_info_t *oi, const char *already_visited, void *_op_data)
+obj_search(const char *path, const H5O_info_t *oi, const char UNUSED *already_visited, void *_op_data)
{
trav_handle_udata_t *handle_data = (trav_handle_udata_t*)_op_data;
char *op_name = (char*)handle_data->op_name;
@@ -1452,7 +1452,7 @@ lnk_search(const char *path, const H5L_info_t *li, void *_op_data)
*-------------------------------------------------------------------------
*/
void
-handle_paths(hid_t fid, const char *path_name, void* data, int pe, const char *display_name)
+handle_paths(hid_t fid, const char *path_name, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name)
{
hid_t gid = -1;
@@ -1613,7 +1613,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
attr_data_output = display_attr_data;
h5dump_type_table = type_table;
- h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char);
+ h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id, display_ai, display_char);
h5dump_type_table = NULL;
if(attr_id < 0) {
diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c
index 53ad894..f3fefba 100644
--- a/tools/h5dump/h5dump_xml.c
+++ b/tools/h5dump/h5dump_xml.c
@@ -26,6 +26,88 @@
const char *xmlnsprefix="hdf5:";
+/*
+ * Alternative formating for data dumped to XML
+ * In general, the numbers are the same, but separators
+ * except spaces are not used.
+ *
+ * Some of these are not used, as some kinds of data are
+ * dumped in completely new subroutines.
+ *
+ * Some of this formatting may yet need to change.
+ *
+ * This table only affects XML output.
+ */
+static h5tool_format_t xml_dataformat = {
+ 0, /*raw */
+
+ "", /*fmt_raw */
+ "%d", /*fmt_int */
+ "%u", /*fmt_uint */
+ "%hhd", /*fmt_schar */
+ "%u", /*fmt_uchar */
+ "%d", /*fmt_short */
+ "%u", /*fmt_ushort */
+ "%ld", /*fmt_long */
+ "%lu", /*fmt_ulong */
+ NULL, /*fmt_llong */
+ NULL, /*fmt_ullong */
+ "%g", /*fmt_double */
+ "%g", /*fmt_float */
+
+ 0, /*ascii */
+ 0, /*str_locale */
+ 0, /*str_repeat */
+
+ "", /*arr_pre */
+ "", /*arr_sep */
+ "", /*arr_suf */
+ 1, /*arr_linebreak */
+
+ "", /*cmpd_name */
+ "", /*cmpd_sep */
+ "", /*cmpd_pre */
+ "", /*cmpd_suf */
+ "", /*cmpd_end */
+
+ " ", /*vlen_sep */
+ " ", /*vlen_pre */
+ "", /*vlen_suf */
+ "", /*vlen_end */
+
+ "%s", /*elmt_fmt */
+ "", /*elmt_suf1 */
+ " ", /*elmt_suf2 */
+
+ "", /*idx_n_fmt */
+ "", /*idx_sep */
+ "", /*idx_fmt */
+
+ 80, /*line_ncols *//*standard default columns */
+ 0, /*line_per_line */
+ "", /*line_pre */
+ "%s", /*line_1st */
+ "%s", /*line_cont */
+ "", /*line_suf */
+ "", /*line_sep */
+ 1, /*line_multi_new */
+ " ", /*line_indent */
+
+ 1, /*skip_first */
+
+ 1, /*obj_hidefileno */
+ " "H5_PRINTF_HADDR_FMT, /*obj_format */
+
+ 1, /*dset_hidefileno */
+ "DATASET %s ", /*dset_format */
+ "%s", /*dset_blockformat_pre */
+ "%s", /*dset_ptformat_pre */
+ "%s", /*dset_ptformat */
+ 0, /*array indices */
+ 0 /*escape non printable characters */
+};
+
+
/* internal functions */
static int xml_name_to_XID(const char *, char *, int , int );
diff --git a/tools/h5dump/h5dump_xml.h b/tools/h5dump/h5dump_xml.h
index 258fd38..c1d6c62 100644
--- a/tools/h5dump/h5dump_xml.h
+++ b/tools/h5dump/h5dump_xml.h
@@ -17,87 +17,6 @@
extern const char *xmlnsprefix;
-/*
- * Alternative formating for data dumped to XML
- * In general, the numbers are the same, but separators
- * except spaces are not used.
- *
- * Some of these are not used, as some kinds of data are
- * dumped in completely new subroutines.
- *
- * Some of this formatting may yet need to change.
- *
- * This table only affects XML output.
- */
-static h5tool_format_t xml_dataformat = {
- 0, /*raw */
-
- "", /*fmt_raw */
- "%d", /*fmt_int */
- "%u", /*fmt_uint */
- "%hhd", /*fmt_schar */
- "%u", /*fmt_uchar */
- "%d", /*fmt_short */
- "%u", /*fmt_ushort */
- "%ld", /*fmt_long */
- "%lu", /*fmt_ulong */
- NULL, /*fmt_llong */
- NULL, /*fmt_ullong */
- "%g", /*fmt_double */
- "%g", /*fmt_float */
-
- 0, /*ascii */
- 0, /*str_locale */
- 0, /*str_repeat */
-
- "", /*arr_pre */
- "", /*arr_sep */
- "", /*arr_suf */
- 1, /*arr_linebreak */
-
- "", /*cmpd_name */
- "", /*cmpd_sep */
- "", /*cmpd_pre */
- "", /*cmpd_suf */
- "", /*cmpd_end */
-
- " ", /*vlen_sep */
- " ", /*vlen_pre */
- "", /*vlen_suf */
- "", /*vlen_end */
-
- "%s", /*elmt_fmt */
- "", /*elmt_suf1 */
- " ", /*elmt_suf2 */
-
- "", /*idx_n_fmt */
- "", /*idx_sep */
- "", /*idx_fmt */
-
- 80, /*line_ncols *//*standard default columns */
- 0, /*line_per_line */
- "", /*line_pre */
- "%s", /*line_1st */
- "%s", /*line_cont */
- "", /*line_suf */
- "", /*line_sep */
- 1, /*line_multi_new */
- " ", /*line_indent */
-
- 1, /*skip_first */
-
- 1, /*obj_hidefileno */
- " "H5_PRINTF_HADDR_FMT, /*obj_format */
-
- 1, /*dset_hidefileno */
- "DATASET %s ", /*dset_format */
- "%s", /*dset_blockformat_pre */
- "%s", /*dset_ptformat_pre */
- "%s", /*dset_ptformat */
- 0, /*array indices */
- 0 /*escape non printable characters */
-};
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index cde249c..75d3c67 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -3497,7 +3497,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info,
*/
void
h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info,
- h5tools_context_t *ctx, hid_t oid, const char *attr_name, hid_t attr_id,
+ h5tools_context_t *ctx, const char *attr_name, hid_t attr_id,
int display_index, int display_char)
{
h5tools_str_t buffer; /* string into which to render */
diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h
index 86f9f99..061a3db 100644
--- a/tools/lib/h5tools_dump.h
+++ b/tools/lib/h5tools_dump.h
@@ -52,7 +52,7 @@ H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *i
H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx/*in,out*/, hid_t space);
H5TOOLS_DLL void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info,
- h5tools_context_t *ctx/*in,out*/, hid_t oid, const char *attr_name,
+ h5tools_context_t *ctx/*in,out*/, const char *attr_name,
hid_t attr_id, int display_index, int display_char);
H5TOOLS_DLL void h5tools_dump_oid(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx/*in,out*/, hid_t oid);
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 8455360..58d7959 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -724,22 +724,22 @@ trav_table_add(trav_table_t *table,
const char *path,
const H5O_info_t *oinfo)
{
- size_t new;
+ size_t new_obj;
if(table->nobjs == table->size) {
table->size = MAX(1, table->size * 2);
table->objs = (trav_obj_t*)HDrealloc(table->objs, table->size * sizeof(trav_obj_t));
} /* end if */
- new = table->nobjs++;
- table->objs[new].objno = oinfo ? oinfo->addr : HADDR_UNDEF;
- table->objs[new].flags[0] = table->objs[new].flags[1] = 0;
- table->objs[new].is_same_trgobj = 0;
- table->objs[new].name = (char *)HDstrdup(path);
- table->objs[new].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK;
- table->objs[new].nlinks = 0;
- table->objs[new].sizelinks = 0;
- table->objs[new].links = NULL;
+ new_obj = table->nobjs++;
+ table->objs[new_obj].objno = oinfo ? oinfo->addr : HADDR_UNDEF;
+ table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0;
+ table->objs[new_obj].is_same_trgobj = 0;
+ table->objs[new_obj].name = (char *)HDstrdup(path);
+ table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK;
+ table->objs[new_obj].nlinks = 0;
+ table->objs[new_obj].sizelinks = 0;
+ table->objs[new_obj].links = NULL;
}
/*-------------------------------------------------------------------------
@@ -807,23 +807,23 @@ void trav_table_addflags(unsigned *flags,
h5trav_type_t type,
trav_table_t *table)
{
- unsigned int new;
+ unsigned int new_obj;
if(table->nobjs == table->size) {
table->size = MAX(1, table->size * 2);
table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t));
} /* end if */
- new = table->nobjs++;
- table->objs[new].objno = 0;
- table->objs[new].flags[0] = flags[0];
- table->objs[new].flags[1] = flags[1];
- table->objs[new].is_same_trgobj = 0;
- table->objs[new].name = (char *)HDstrdup(name);
- table->objs[new].type = type;
- table->objs[new].nlinks = 0;
- table->objs[new].sizelinks = 0;
- table->objs[new].links = NULL;
+ new_obj = table->nobjs++;
+ table->objs[new_obj].objno = 0;
+ table->objs[new_obj].flags[0] = flags[0];
+ table->objs[new_obj].flags[1] = flags[1];
+ table->objs[new_obj].is_same_trgobj = 0;
+ table->objs[new_obj].name = (char *)HDstrdup(name);
+ table->objs[new_obj].type = type;
+ table->objs[new_obj].nlinks = 0;
+ table->objs[new_obj].sizelinks = 0;
+ table->objs[new_obj].links = NULL;
}
@@ -890,7 +890,11 @@ void trav_table_free( trav_table_t *table )
}
static herr_t
-trav_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *op_data)
+trav_attr(hid_t
+#ifndef H5TRAV_PRINT_SPACE
+UNUSED
+#endif /* H5TRAV_PRINT_SPACE */
+obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *op_data)
{
char *buf;