summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_attr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-09-16 15:52:51 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-09-16 15:52:51 (GMT)
commitbdd7d59902483885dd8b883f3b2393e77383e5e8 (patch)
treeaaf20ab132d057b95b3c016d50fc22b77719084b /tools/lib/h5diff_attr.c
parent8bc0d5ed9019a681e1ea20c24264415d01c1cf2a (diff)
downloadhdf5-bdd7d59902483885dd8b883f3b2393e77383e5e8.zip
hdf5-bdd7d59902483885dd8b883f3b2393e77383e5e8.tar.gz
hdf5-bdd7d59902483885dd8b883f3b2393e77383e5e8.tar.bz2
[svn-r15628] Description:
Remove trailing whitespace from C/C++ source files, with the following script: foreach f (*.[ch] *.cpp) sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f end Tested on: Mac OS X/32 10.5.5 (amazon) No need for h5committest, just whitespace changes...
Diffstat (limited to 'tools/lib/h5diff_attr.c')
-rw-r--r--tools/lib/h5diff_attr.c104
1 files changed, 52 insertions, 52 deletions
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index d6c1c48..6dec22b 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -70,39 +70,39 @@ hsize_t diff_attr(hid_t loc1_id,
hsize_t nfound = 0;
hsize_t nfound_total = 0;
int j;
-
+
if(H5Oget_info(loc1_id, &oinfo1) < 0)
goto error;
if(H5Oget_info(loc2_id, &oinfo2) < 0)
goto error;
-
+
if(oinfo1.num_attrs != oinfo2.num_attrs)
return 1;
-
+
for( u = 0; u < (unsigned)oinfo1.num_attrs; u++)
{
/* reset buffers for every attribute, we might goto out and call free */
buf1 = NULL;
buf2 = NULL;
-
+
/* open attribute */
if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
/* get name */
if(H5Aget_name(attr1_id, 255, name1) < 0)
goto error;
-
+
/* use the name on the first file to open the second file */
- H5E_BEGIN_TRY
+ H5E_BEGIN_TRY
{
if((attr2_id = H5Aopen(loc2_id, name1, H5P_DEFAULT)) < 0)
goto error;
} H5E_END_TRY;
-
+
/* get name */
if(H5Aget_name(attr2_id, 255, name2) < 0)
goto error;
-
+
/* get the datatypes */
if ((ftype1_id = H5Aget_type(attr1_id)) < 0)
goto error;
@@ -115,28 +115,28 @@ hsize_t diff_attr(hid_t loc1_id,
if ((msize1 = H5Tget_size(mtype1_id))==0)
goto error;
if ((msize2 = H5Tget_size(mtype2_id))==0)
- goto error;
-
+ goto error;
+
/* get the dataspace */
if ((space1_id = H5Aget_space(attr1_id)) < 0)
goto error;
if ((space2_id = H5Aget_space(attr2_id)) < 0)
goto error;
-
+
/* get dimensions */
if ( (rank1 = H5Sget_simple_extent_dims(space1_id, dims1, NULL)) < 0 )
goto error;
if ( (rank2 = H5Sget_simple_extent_dims(space2_id, dims2, NULL)) < 0 )
goto error;
-
-
+
+
/*-------------------------------------------------------------------------
* check for comparable TYPE and SPACE
*-------------------------------------------------------------------------
*/
-
+
if ( msize1 != msize2
- ||
+ ||
diff_can_type(ftype1_id,
ftype2_id,
rank1,
@@ -149,44 +149,44 @@ hsize_t diff_attr(hid_t loc1_id,
name2,
options)!=1)
{
-
+
if (options->m_verbose)
printf("Comparison not possible for attribute <%s>\n",
name1);
-
+
options->not_cmp=1;
-
- if (H5Tclose(ftype1_id)<0)
+
+ if (H5Tclose(ftype1_id)<0)
goto error;
- if (H5Tclose(ftype2_id)<0)
+ if (H5Tclose(ftype2_id)<0)
goto error;
- if (H5Sclose(space1_id)<0)
+ if (H5Sclose(space1_id)<0)
goto error;
- if (H5Sclose(space2_id)<0)
+ if (H5Sclose(space2_id)<0)
goto error;
- if (H5Aclose(attr1_id)<0)
+ if (H5Aclose(attr1_id)<0)
goto error;
- if (H5Aclose(attr2_id)<0)
+ if (H5Aclose(attr2_id)<0)
goto error;
- if (H5Tclose(mtype1_id)<0)
+ if (H5Tclose(mtype1_id)<0)
goto error;
- if (H5Tclose(mtype2_id)<0)
+ if (H5Tclose(mtype2_id)<0)
goto error;
continue;
-
-
+
+
}
-
-
+
+
/*-------------------------------------------------------------------------
- * read
+ * read
*-------------------------------------------------------------------------
*/
nelmts1=1;
for (j=0; j<rank1; j++)
nelmts1*=dims1[j];
-
+
buf1=(void *) HDmalloc((unsigned)(nelmts1*msize1));
buf2=(void *) HDmalloc((unsigned)(nelmts1*msize2));
if ( buf1==NULL || buf2==NULL){
@@ -197,16 +197,16 @@ hsize_t diff_attr(hid_t loc1_id,
goto error;
if (H5Aread(attr2_id,mtype2_id,buf2)<0)
goto error;
-
+
/* format output string */
sprintf(np1,"%s of <%s>",name1,path1);
sprintf(np2,"%s of <%s>",name2,path2);
-
+
/*-------------------------------------------------------------------------
* array compare
*-------------------------------------------------------------------------
*/
-
+
/* always print name */
if (options->m_verbose)
{
@@ -224,7 +224,7 @@ hsize_t diff_attr(hid_t loc1_id,
attr1_id,
attr2_id);
print_found(nfound);
-
+
}
/* check first if we have differences */
else
@@ -282,40 +282,40 @@ hsize_t diff_attr(hid_t loc1_id,
attr2_id);
} /*else quiet */
} /*else verbose */
-
-
+
+
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
*/
-
- if (H5Tclose(ftype1_id)<0)
+
+ if (H5Tclose(ftype1_id)<0)
goto error;
- if (H5Tclose(ftype2_id)<0)
+ if (H5Tclose(ftype2_id)<0)
goto error;
- if (H5Sclose(space1_id)<0)
+ if (H5Sclose(space1_id)<0)
goto error;
- if (H5Sclose(space2_id)<0)
+ if (H5Sclose(space2_id)<0)
goto error;
- if (H5Aclose(attr1_id)<0)
+ if (H5Aclose(attr1_id)<0)
goto error;
- if (H5Aclose(attr2_id)<0)
+ if (H5Aclose(attr2_id)<0)
goto error;
- if (H5Tclose(mtype1_id)<0)
+ if (H5Tclose(mtype1_id)<0)
goto error;
- if (H5Tclose(mtype2_id)<0)
+ if (H5Tclose(mtype2_id)<0)
goto error;
-
+
if (buf1)
HDfree(buf1);
if (buf2)
HDfree(buf2);
-
+
nfound_total += nfound;
} /* u */
-
+
return nfound_total;
-
+
error:
H5E_BEGIN_TRY {
H5Tclose(ftype1_id);
@@ -331,7 +331,7 @@ error:
if (buf2)
HDfree(buf2);
} H5E_END_TRY;
-
+
options->err_stat=1;
return nfound_total;
}