summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-18 04:10:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-18 04:10:09 (GMT)
commit0a29514b9dd967deb64b53b39e12d6b55177b76c (patch)
treea0a2fce3c7a13fcdf1deed6c022a47bfb5a2cbf1 /tools/lib
parent432f394cbbc6f77861501f91dc2fc5c209f3811f (diff)
downloadhdf5-0a29514b9dd967deb64b53b39e12d6b55177b76c.zip
hdf5-0a29514b9dd967deb64b53b39e12d6b55177b76c.tar.gz
hdf5-0a29514b9dd967deb64b53b39e12d6b55177b76c.tar.bz2
[svn-r8383] Purpose:
Code cleanup Description: Clean up lots of warnings based on those reported from the SGI compilers as well as gcc. Platforms tested: SGI O3900, IRIX64 6.5 (Cheryl's SGI machine) FreeBSD 4.9 (sleipnir) w/ & w/o parallel h5committest
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c14
-rw-r--r--tools/lib/h5diff_array.c24
-rw-r--r--tools/lib/h5diff_attr.c21
-rw-r--r--tools/lib/h5diff_dset.c9
-rw-r--r--tools/lib/h5diff_util.c2
-rw-r--r--tools/lib/h5tools.c6
-rw-r--r--tools/lib/h5tools_filters.c1
-rw-r--r--tools/lib/h5tools_str.c9
8 files changed, 34 insertions, 52 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 38acf82..9ac321b 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -12,13 +12,9 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
+#include <stdlib.h>
#include "h5diff.h"
#include "H5private.h"
-#include <stdlib.h>
-#include <assert.h>
-
-
/*-------------------------------------------------------------------------
* Function: h5diff
@@ -375,10 +371,10 @@ int diff( hid_t file1_id,
diff_opt_t *options,
H5G_obj_t type )
{
- hid_t type1_id;
- hid_t type2_id;
- hid_t grp1_id;
- hid_t grp2_id;
+ hid_t type1_id=-1;
+ hid_t type2_id=-1;
+ hid_t grp1_id=-1;
+ hid_t grp2_id=-1;
int ret;
H5G_stat_t sb1;
H5G_stat_t sb2;
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 90a50cd..838cc3d 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -12,12 +12,9 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
+#include <math.h>
#include "h5diff.h"
#include "H5private.h"
-#include <assert.h>
-#include <math.h>
-
static int diff_datum(void *_mem1,
void *_mem2,
@@ -35,7 +32,6 @@ static int diff_datum(void *_mem1,
static int diff_native_uchar(unsigned char *mem1,
unsigned char *mem2,
- size_t type_size,
hsize_t i,
int rank,
hsize_t *acc,
@@ -47,7 +43,6 @@ static int diff_native_uchar(unsigned char *mem1,
static int diff_char(unsigned char *mem1,
unsigned char *mem2,
- size_t type_size,
hsize_t i,
int rank,
hsize_t *acc,
@@ -119,7 +114,7 @@ int diff_array( void *_mem1,
tmp1,
tmp2,
m_type,
- 0,
+ (hsize_t)0,
rank,
acc,
pos,
@@ -270,8 +265,8 @@ int diff_datum( void *_mem1,
nmembs = H5Tget_nmembers(m_type);
for (j = 0; j < nmembs; j++)
{
- offset = H5Tget_member_offset(m_type, j);
- memb_type = H5Tget_member_type(m_type, j);
+ offset = H5Tget_member_offset(m_type, (unsigned)j);
+ memb_type = H5Tget_member_type(m_type, (unsigned)j);
nfound+=diff_datum(
mem1+offset,
mem2+offset,
@@ -305,7 +300,6 @@ int diff_datum( void *_mem1,
nfound+=diff_char(
mem1 + u,
mem2 + u, /* offset */
- type_size,
i, /* index position */
rank,
acc,
@@ -329,7 +323,6 @@ int diff_datum( void *_mem1,
nfound+=diff_native_uchar(
mem1 + u,
mem2 + u, /* offset */
- type_size,
i, /* index position */
rank,
acc,
@@ -352,7 +345,6 @@ int diff_datum( void *_mem1,
nfound+=diff_native_uchar(
mem1 + u,
mem2 + u, /* offset */
- type_size,
i, /* index position */
rank,
acc,
@@ -403,7 +395,6 @@ int diff_datum( void *_mem1,
nfound+=diff_native_uchar(
mem1 + u,
mem2 + u, /* offset */
- type_size,
i, /* index position */
rank,
acc,
@@ -466,7 +457,7 @@ int diff_datum( void *_mem1,
/* get the number of sequence elements */
nelmts = ((hvl_t *)mem1)->len;
- for (j = 0; j < nelmts; j++)
+ for (j = 0; j < (int)nelmts; j++)
nfound+=diff_datum(
((char *)(((hvl_t *)mem1)->p)) + j * size,
((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */
@@ -1526,7 +1517,6 @@ int diff_datum( void *_mem1,
static
int diff_native_uchar(unsigned char *mem1,
unsigned char *mem2,
- size_t type_size,
hsize_t i,
int rank,
hsize_t *acc,
@@ -1620,7 +1610,6 @@ int diff_native_uchar(unsigned char *mem1,
static
int diff_char(unsigned char *mem1,
unsigned char *mem2,
- size_t type_size,
hsize_t i,
int rank,
hsize_t *acc,
@@ -1823,4 +1812,5 @@ static int diff_region(hid_t region1_id, hid_t region2_id)
}
return ret;
-} \ No newline at end of file
+}
+
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index ed051f8..65e16ba 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -14,7 +14,6 @@
#include "h5diff.h"
#include "H5private.h"
-#include <assert.h>
/*-------------------------------------------------------------------------
@@ -45,14 +44,14 @@ int diff_attr(hid_t loc1_id,
diff_opt_t *options
)
{
- hid_t attr1_id; /* attr ID */
- hid_t attr2_id; /* attr ID */
- hid_t space1_id; /* space ID */
- hid_t space2_id; /* space ID */
- hid_t ftype1_id; /* file data type ID */
- hid_t ftype2_id; /* file data type ID */
- hid_t mtype1_id; /* memory data type ID */
- hid_t mtype2_id; /* memory data type ID */
+ hid_t attr1_id=-1; /* attr ID */
+ hid_t attr2_id=-1; /* attr ID */
+ hid_t space1_id=-1; /* space ID */
+ hid_t space2_id=-1; /* space ID */
+ hid_t ftype1_id=-1; /* file data type ID */
+ hid_t ftype2_id=-1; /* file data type ID */
+ hid_t mtype1_id=-1; /* memory data type ID */
+ hid_t mtype2_id=-1; /* memory data type ID */
size_t msize1; /* memory size of memory type */
size_t msize2; /* memory size of memory type */
void *buf1=NULL; /* data buffer */
@@ -87,9 +86,9 @@ int diff_attr(hid_t loc1_id,
*-------------------------------------------------------------------------
*/
/* open attribute */
- if ((attr1_id = H5Aopen_idx(loc1_id, i))<0)
+ if ((attr1_id = H5Aopen_idx(loc1_id, (unsigned)i))<0)
goto error;
- if ((attr2_id = H5Aopen_idx(loc2_id, i))<0)
+ if ((attr2_id = H5Aopen_idx(loc2_id, (unsigned)i))<0)
goto error;
/* get name */
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index 8cd5b32..55a0f73 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -15,7 +15,6 @@
#include "h5diff.h"
#include "H5private.h"
#include "h5tools.h"
-#include <assert.h>
/*-------------------------------------------------------------------------
* Function: diff_dataset
@@ -39,8 +38,8 @@ int diff_dataset( hid_t file1_id,
{
hid_t dset1_id =-1;
hid_t dset2_id =-1;
- hid_t dcpl1_id;
- hid_t dcpl2_id;
+ hid_t dcpl1_id=-1;
+ hid_t dcpl2_id=-1;
int gout=0, nfound=0;
@@ -146,11 +145,9 @@ int diff_datasetid( hid_t dset1_id,
int nfound=0; /* number of differences found */
const char *name1=NULL; /* relative names */
const char *name2=NULL;
- int maxdim_diff=0; /* maximum dimensions are different */
- int dim_diff=0; /* current dimensions are different */
hsize_t storage_size1;
hsize_t storage_size2;
- int i, gout=0;
+ int i;
/* Get the dataspace handle */
if ( (space1_id = H5Dget_space(dset1_id)) < 0 )
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 9c1d2d1..7af48c4 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -15,8 +15,6 @@
#include "h5diff.h"
#include "H5private.h"
-#include <assert.h>
-
/*-------------------------------------------------------------------------
* Function: print_pos
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index b07742b..3a5b68a 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -53,7 +53,9 @@ FILE *rawdatastream; /* should initialize to stdout but gcc moans about it
/* module-scoped variables */
static int h5tools_init_g; /* if h5tools lib has been initialized */
+#ifdef H5_HAVE_PARALLEL
static int h5tools_mpi_init_g; /* if MPI_Init() has been called */
+#endif /* H5_HAVE_PARALLEL */
/* Names of VFDs */
static const char *drivernames[]={
@@ -220,7 +222,7 @@ h5tools_get_fapl(const char *driver, unsigned *drivernum, int argc, const char *
/* Initialize the MPI library, if it wasn't already */
if(!h5tools_mpi_init_g) {
- MPI_Init(&argc, &argv);
+ MPI_Init(&argc, (char ***)&argv);
h5tools_mpi_init_g=1;
} /* end if */
@@ -235,7 +237,7 @@ h5tools_get_fapl(const char *driver, unsigned *drivernum, int argc, const char *
/* Initialize the MPI library, if it wasn't already */
if(!h5tools_mpi_init_g) {
- MPI_Init(&argc, &argv);
+ MPI_Init(&argc, (char ***)&argv);
h5tools_mpi_init_g=1;
} /* end if */
diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c
index c76c3de..bb69798 100644
--- a/tools/lib/h5tools_filters.c
+++ b/tools/lib/h5tools_filters.c
@@ -15,6 +15,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "hdf5.h"
+#include "h5tools.h"
/*-------------------------------------------------------------------------
* print a warning message
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 0ed66b4..5398d76 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -43,7 +43,7 @@
/* Variable length string datatype */
#define STR_INIT_LEN 4096 /*initial length */
-static char *h5tools_escape(char *s, size_t size, int escape_spaces);
+static char *h5tools_escape(char *s, size_t size);
static hbool_t h5tools_is_zero(const void *_mem, size_t size);
/*-------------------------------------------------------------------------
@@ -753,7 +753,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container,
char enum_name[1024];
if (H5Tenum_nameof(type, vp, enum_name, sizeof enum_name) >= 0) {
- h5tools_str_append(str, h5tools_escape(enum_name, sizeof(enum_name), TRUE));
+ h5tools_str_append(str, h5tools_escape(enum_name, sizeof(enum_name)));
} else {
size_t i;
n = H5Tget_size(type);
@@ -939,8 +939,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container,
* Function: h5tools_escape
*
* Purpose: Changes all "funny" characters in S into standard C escape
- * sequences. If ESCAPE_SPACES is non-zero then spaces are
- * escaped by prepending a backslash.
+ * sequences.
*
* Return: Success: S
*
@@ -956,7 +955,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container,
*-------------------------------------------------------------------------
*/
static char *
-h5tools_escape(char *s/*in,out*/, size_t size, int escape_spaces)
+h5tools_escape(char *s/*in,out*/, size_t size)
{
register size_t i;
size_t n = strlen(s);