summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
commit427ff7da2848042f68ecfadf5a321b1d8077e9db (patch)
tree73024b1954031fbb724c2d96a485590348e5cc22 /tools/lib
parent9b96fd2003ae74cca389cc4c2216b4371d6eb173 (diff)
downloadhdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.zip
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.gz
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.bz2
[svn-r9727] Purpose:
Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c12
-rw-r--r--tools/lib/h5diff.h2
-rw-r--r--tools/lib/h5diff_array.c6
-rw-r--r--tools/lib/h5tools.c24
-rw-r--r--tools/lib/h5tools.h2
-rw-r--r--tools/lib/h5tools_filters.c8
-rw-r--r--tools/lib/h5tools_ref.c21
-rw-r--r--tools/lib/h5tools_ref.h2
-rw-r--r--tools/lib/h5tools_type.c1
9 files changed, 37 insertions, 41 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index c271f21..592b016 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -55,7 +55,7 @@ hsize_t h5diff(const char *fname1,
int nobjects1, nobjects2;
trav_info_t *info1=NULL;
trav_info_t *info2=NULL;
- hid_t file1_id, file2_id;
+ hid_t file1_id=(-1), file2_id=(-1);
hsize_t nfound=0;
if (options->m_quiet &&
@@ -414,10 +414,10 @@ hsize_t 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;
@@ -436,7 +436,7 @@ hsize_t diff( hid_t file1_id,
/* always print name */
if (options->m_verbose)
{
- if (print_objname(options,1))
+ if (print_objname(options,(hsize_t)1))
printf( "Dataset: <%s> and <%s>\n",path1,path2);
nfound=diff_dataset(file1_id,file2_id,path1,path2,options);
diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h
index b4ec0b5..4a29259 100644
--- a/tools/lib/h5diff.h
+++ b/tools/lib/h5diff.h
@@ -238,7 +238,6 @@ hsize_t diff_datum(void *_mem1,
-
hsize_t diff_float(unsigned char *mem1,
unsigned char *mem2,
hsize_t nelmts,
@@ -373,5 +372,4 @@ hsize_t diff_ullong(unsigned char *mem1,
-
#endif /* H5DIFF_H__ */
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 6008278..f1c4a74 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -3027,7 +3027,7 @@ hsize_t diff_long(unsigned char *mem1,
memcpy(&temp1_long, mem1, sizeof(long));
memcpy(&temp2_long, mem2, sizeof(long));
- if (labs(temp1_long-temp2_long) > options->delta)
+ if (labs(temp1_long-temp2_long) > (long)options->delta)
{
if ( print_data(options) )
{
@@ -3084,7 +3084,7 @@ hsize_t diff_long(unsigned char *mem1,
memcpy(&temp2_long, mem2, sizeof(long));
if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent &&
- labs(temp1_long-temp2_long) > options->delta )
+ labs(temp1_long-temp2_long) > (long)options->delta )
{
if ( print_data(options) )
{
@@ -3170,7 +3170,7 @@ hsize_t diff_ulong(unsigned char *mem1,
memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
- if (labs(temp1_ulong-temp2_ulong) > options->delta)
+ if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta)
{
if ( print_data(options) )
{
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 801f83c..60377c0 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -168,7 +168,13 @@ h5tools_close(void)
*-------------------------------------------------------------------------
*/
static hid_t
-h5tools_get_fapl(const char *driver, unsigned *drivernum, int argc, const char *argv[])
+h5tools_get_fapl(const char *driver, unsigned *drivernum,
+#ifdef H5_HAVE_PARALLEL
+int argc, const char *argv[]
+#else /* H5_HAVE_PARALLEL */
+int UNUSED argc, const char UNUSED *argv[]
+#endif /* H5_HAVE_PARALLEL */
+)
{
hid_t fapl = H5P_DEFAULT;
@@ -692,7 +698,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5dump_t *info, hid_t dset,
herr_t ret; /*the value to return */
hid_t f_space; /*file data space */
int i; /*counters */
- hssize_t zero = 0; /*vector of zeros */
+ hsize_t zero = 0; /*vector of zeros */
unsigned int flags; /*buffer extent flags */
hsize_t total_size[H5S_MAX_RANK];/*total size of dataset*/
@@ -744,10 +750,10 @@ h5tools_dump_simple_subset(FILE *stream, const h5dump_t *info, hid_t dset,
count--) {
/* calculate the potential number of elements we're going to print */
H5Sselect_hyperslab(f_space, H5S_SELECT_SET,
- (hssize_t*)sset->start,
- (hsize_t*)sset->stride,
- (hsize_t*)sset->count,
- (hsize_t*)sset->block);
+ sset->start,
+ sset->stride,
+ sset->count,
+ sset->block);
sm_nelmts = H5Sget_select_npoints(f_space);
/*
@@ -856,7 +862,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset,
hsize_t elmtno; /*counter */
int i; /*counter */
int carry; /*counter carry value */
- hssize_t zero[8]; /*vector of zeros */
+ hsize_t zero[8]; /*vector of zeros */
unsigned int flags; /*buffer extent flags */
hsize_t total_size[H5S_MAX_RANK];/*total size of dataset*/
@@ -873,7 +879,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset,
hid_t sm_space; /*stripmine data space */
/* Hyperslab info */
- hssize_t hs_offset[H5S_MAX_RANK];/*starting offset */
+ hsize_t hs_offset[H5S_MAX_RANK];/*starting offset */
hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */
hsize_t hs_nelmts; /*elements in request */
@@ -994,7 +1000,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset,
ctx.p_min_idx[i - 1] = ctx.p_max_idx[i - 1];
hs_offset[i - 1] += hs_size[i - 1];
- if (hs_offset[i - 1] == (hssize_t)total_size[i - 1])
+ if (hs_offset[i - 1] == total_size[i - 1])
hs_offset[i - 1] = 0;
else
carry = 0;
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index 93f926e..9254359 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -419,7 +419,7 @@ typedef struct h5tools_context_t {
/* a structure to hold the subsetting particulars for a dataset */
struct subset_t {
- hssize_t *start;
+ hsize_t *start;
hsize_t *stride;
hsize_t *count;
hsize_t *block;
diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c
index 3370409..9c816cd 100644
--- a/tools/lib/h5tools_filters.c
+++ b/tools/lib/h5tools_filters.c
@@ -94,7 +94,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
if (name)
print_warning(name,"user defined");
return 0;
- break;
+
/*-------------------------------------------------------------------------
* H5Z_FILTER_DEFLATE 1 , deflation like gzip
*-------------------------------------------------------------------------
@@ -172,7 +172,6 @@ int h5tools_can_encode( H5Z_filter_t filtn)
int have_szip=0;
int have_shuffle=0;
int have_fletcher=0;
- herr_t status;
unsigned int filter_config_flags;
#ifdef H5_HAVE_FILTER_DEFLATE
@@ -193,7 +192,7 @@ int h5tools_can_encode( H5Z_filter_t filtn)
/* user defined filter */
default:
return 0;
- break;
+
case H5Z_FILTER_DEFLATE:
if (!have_deflate)
{
@@ -205,7 +204,8 @@ int h5tools_can_encode( H5Z_filter_t filtn)
{
return 0;
}
- status =H5Zget_filter_info(filtn, &filter_config_flags);
+ if(H5Zget_filter_info(filtn, &filter_config_flags)<0)
+ return -1;
if ((filter_config_flags &
(H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) {
/* filter present but neither encode nor decode is supported (???) */
diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c
index 7dcccad..b607d7d 100644
--- a/tools/lib/h5tools_ref.c
+++ b/tools/lib/h5tools_ref.c
@@ -41,7 +41,6 @@ extern char *progname;
extern int d_status;
-
ref_path_table_entry_t *ref_path_table = NULL; /* the table */
/*-------------------------------------------------------------------------
@@ -65,10 +64,9 @@ ref_path_table_lookup(const char *thepath)
H5G_stat_t sb;
ref_path_table_entry_t *pte = ref_path_table;
- if(H5Gget_objinfo(thefile, thepath, TRUE, &sb)<0) {
+ if(H5Gget_objinfo(thefile, thepath, TRUE, &sb)<0)
/* fatal error ? */
return NULL;
- }
while(pte!=NULL) {
if (sb.objno==pte->statbuf.objno)
@@ -108,10 +106,9 @@ ref_path_table_put(hid_t obj, const char *path)
/* if not found, then make new entry */
pte = (ref_path_table_entry_t *) malloc(sizeof(ref_path_table_entry_t));
- if (pte == NULL) {
+ if (pte == NULL)
/* fatal error? */
return NULL;
- }
pte->obj = obj;
@@ -158,21 +155,19 @@ get_fake_xid () {
ref_path_table_entry_t *
ref_path_table_gen_fake(const char *path)
{
- ref_path_table_entry_t *pte;
+ ref_path_table_entry_t *pte;
/* look up 'obj'. If already in table, return */
pte = ref_path_table_lookup(path);
- if (pte != NULL) {
+ if (pte != NULL)
return pte;
- }
/* if not found, then make new entry */
pte = (ref_path_table_entry_t *) malloc(sizeof(ref_path_table_entry_t));
- if (pte == NULL) {
+ if (pte == NULL)
/* fatal error? */
return NULL;
- }
pte->obj = (hid_t)-1;
@@ -259,9 +254,8 @@ fill_ref_path_table(hid_t group, const char *name, void UNUSED * op_data)
case H5G_DATASET:
if ((obj = H5Dopen(group, name)) >= 0) {
pte = ref_path_table_lookup(thepath);
- if (pte == NULL) {
+ if (pte == NULL)
ref_path_table_put(obj, thepath);
- }
H5Dclose(obj);
} else {
error_msg(progname, "unable to get dataset \"%s\"\n", name);
@@ -286,9 +280,8 @@ fill_ref_path_table(hid_t group, const char *name, void UNUSED * op_data)
case H5G_TYPE:
if ((obj = H5Topen(group, name)) >= 0) {
pte = ref_path_table_lookup(thepath);
- if (pte == NULL) {
+ if (pte == NULL)
ref_path_table_put(obj, thepath);
- }
H5Tclose(obj);
} else {
error_msg(progname, "unable to get dataset \"%s\"\n", name);
diff --git a/tools/lib/h5tools_ref.h b/tools/lib/h5tools_ref.h
index 2f5fa83..f4a5941 100644
--- a/tools/lib/h5tools_ref.h
+++ b/tools/lib/h5tools_ref.h
@@ -19,7 +19,6 @@
typedef struct ref_path_table_entry_t {
hid_t obj;
- hobj_ref_t *obj_ref;
char *apath;
H5G_stat_t statbuf;
struct ref_path_table_entry_t *next;
@@ -29,7 +28,6 @@ typedef struct ref_path_table_entry_t {
extern "C" {
#endif
-
char* lookup_ref_path(hobj_ref_t ref);
herr_t fill_ref_path_table(hid_t, const char *, void *);
int get_next_xid(void);
diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c
index 53a3505..1ef2579 100644
--- a/tools/lib/h5tools_type.c
+++ b/tools/lib/h5tools_type.c
@@ -45,3 +45,4 @@ h5tools_get_native_type(hid_t type)
return(p_type);
}
+