summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-09-25 17:46:32 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-09-25 17:46:32 (GMT)
commited663577a5394d34a0cfbe5cd5443af1f7957dc5 (patch)
treef334d37a08de1f77ce046907bce49c9ff56c6597 /tools
parenta6036953db9be2210acbed0882cf62c594b3a168 (diff)
downloadhdf5-ed663577a5394d34a0cfbe5cd5443af1f7957dc5.zip
hdf5-ed663577a5394d34a0cfbe5cd5443af1f7957dc5.tar.gz
hdf5-ed663577a5394d34a0cfbe5cd5443af1f7957dc5.tar.bz2
[svn-r4473] Purpose:
Code cleanup for better compatibility with C++ compilers Description: C++ compilers are choking on our C code, for various reasons: we used our UNUSED macro incorrectly when referring to pointer types we used various C++ keywords as variables, etc. we incremented enum's with the ++ operator. Solution: Changed variables, etc.to avoid C++ keywords (new, class, typename, typeid, template) Fixed usage of UNUSED macro from this: char UNUSED *c to this: char * UNUSED c Switched the enums from x++ to x=x+1 Platforms tested: FreeBSD 4.4 (hawkwind)
Diffstat (limited to 'tools')
-rw-r--r--tools/gifconv/gifread.c35
-rw-r--r--tools/h4toh5/h4toh5image.c4
-rw-r--r--tools/h4toh5/h4toh5sds.c8
-rw-r--r--tools/h5dump/h5dump.c58
-rw-r--r--tools/h5ls/h5ls.c6
-rw-r--r--tools/h5toh4/h5toh4.c332
6 files changed, 227 insertions, 216 deletions
diff --git a/tools/gifconv/gifread.c b/tools/gifconv/gifread.c
index 39043f3..3e01801 100644
--- a/tools/gifconv/gifread.c
+++ b/tools/gifconv/gifread.c
@@ -112,9 +112,10 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */
** otherwise 0 if no error occured.
*/
int
-ReadGifImageDesc(GifImageDesc, MemGif2)
-GIFIMAGEDESC *GifImageDesc; /* Pointer to GIF image descriptor structure */
-BYTE **MemGif2; /* GIF image file input FILE stream */
+ReadGifImageDesc(
+ GIFIMAGEDESC *GifImageDesc, /* Pointer to GIF image descriptor structure */
+ BYTE **MemGif2 /* GIF image file input FILE stream */
+ )
{
WORD i; /* Loop counter */
WORD tableSize; /* Number of entries in the Local Color Table */
@@ -208,9 +209,10 @@ BYTE **MemGif2; /* GIF image file input FILE stream */
** otherwise 0 if no error occured.
*/
int
-ReadGifGraphicControl(GifGraphicControl, MemGif2)
-GIFGRAPHICCONTROL *GifGraphicControl; /* Pointer to GC Extension structure */
-BYTE **MemGif2; /* GIF image file input FILE stream */
+ReadGifGraphicControl(
+ GIFGRAPHICCONTROL *GifGraphicControl, /* Pointer to GC Extension structure */
+ BYTE **MemGif2 /* GIF image file input FILE stream */
+ )
{
int i;
@@ -232,9 +234,10 @@ BYTE **MemGif2; /* GIF image file input FILE stream */
** otherwise 0 if no error occured.
*/
int
-ReadGifPlainText(GifPlainText, MemGif2)
-GIFPLAINTEXT *GifPlainText; /* Pointer to Plain Text Extension structure */
-BYTE **MemGif2; /* GIF image file input FILE stream */
+ReadGifPlainText(
+ GIFPLAINTEXT *GifPlainText, /* Pointer to Plain Text Extension structure */
+ BYTE **MemGif2 /* GIF image file input FILE stream */
+ )
{
int i;
@@ -270,9 +273,10 @@ BYTE **MemGif2; /* GIF image file input FILE stream */
** otherwise 0 if no error occured.
*/
int
-ReadGifApplication(GifApplication, MemGif2)
-GIFAPPLICATION *GifApplication; /* Pointer to Application Extension structure */
-BYTE **MemGif2; /* GIF image file input FILE stream */
+ReadGifApplication(
+ GIFAPPLICATION *GifApplication, /* Pointer to Application Extension structure */
+ BYTE **MemGif2 /* GIF image file input FILE stream */
+ )
{
int i;
@@ -307,9 +311,10 @@ BYTE **MemGif2; /* GIF image file input FILE stream
** otherwise 0 if no error occured.
*/
int
-ReadGifComment(GifComment, MemGif2)
-GIFCOMMENT *GifComment; /* Pointer to GIF Comment Extension structure */
-BYTE **MemGif2; /* GIF image file input FILE stream */
+ReadGifComment(
+ GIFCOMMENT *GifComment, /* Pointer to GIF Comment Extension structure */
+ BYTE **MemGif2 /* GIF image file input FILE stream */
+ )
{
/* Read in the Plain Text data sub-blocks */
diff --git a/tools/h4toh5/h4toh5image.c b/tools/h4toh5/h4toh5image.c
index a1ab359..fd32405 100644
--- a/tools/h4toh5/h4toh5image.c
+++ b/tools/h4toh5/h4toh5image.c
@@ -64,8 +64,8 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
char* h5cimage_name;
void* image_data;
HDF_CHUNK_DEF c_def_out;
- int32 chunk_dims[2];
- int32 chunk_dims24[3];
+ hsize_t chunk_dims[2];
+ hsize_t chunk_dims24[3];
int32 c_flags;
int32 interlace_mode;
diff --git a/tools/h4toh5/h4toh5sds.c b/tools/h4toh5/h4toh5sds.c
index 3788c82..28c87f4 100644
--- a/tools/h4toh5/h4toh5sds.c
+++ b/tools/h4toh5/h4toh5sds.c
@@ -29,6 +29,12 @@ Author: Kent Yang(ymuqun@ncsa.uiuc.edu)
#include "h4toh5main.h"
+static int convert_zerosdsunlimit(int32 file_id,
+ int32 sds_id,
+ hid_t h5_group,
+ hid_t h5_dimgroup,
+ int h4_attr);
+
/*-------------------------------------------------------------------------
* Function: Sds_h4_to_h5
*
@@ -1707,7 +1713,7 @@ uint16 get_SDref(int32 file_id,uint16 tag,int32 sds_ref){
return sd_ref;
}
-int convert_zerosdsunlimit(int32 file_id,
+static int convert_zerosdsunlimit(int32 file_id,
int32 sds_id,
hid_t h5_group,
hid_t h5_dimgroup,
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 6eff5f7..82b67ca 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -36,7 +36,7 @@ static int usingdasho = FALSE;
**/
/* fill_ref_path_table is called to inialize the object reference paths. */
-static herr_t fill_ref_path_table(hid_t, const char *, void UNUSED *);
+static herr_t fill_ref_path_table(hid_t, const char *, void *);
/* module-scoped variables for XML option */
#define DEFAULT_DTD "http://hdf.ncsa.uiuc.edu/DTDs/HDF5-File.dtd"
@@ -520,18 +520,18 @@ static void dump_named_datatype(hid_t, const char *);
static void dump_dataset(hid_t, const char *, struct subset_t *);
static void dump_dataspace(hid_t space);
static void dump_datatype(hid_t type);
-static herr_t dump_attr(hid_t, const char *, void UNUSED *);
+static herr_t dump_attr(hid_t, const char *, void *);
static void dump_data(hid_t, int, struct subset_t *);
/* XML format: same interface, alternative output */
static void xml_dump_group(hid_t, const char *);
static void xml_dump_named_datatype(hid_t, const char *);
-static void xml_dump_dataset(hid_t, const char *, struct subset_t UNUSED *);
+static void xml_dump_dataset(hid_t, const char *, struct subset_t *);
static void xml_dump_dataspace(hid_t space);
static void xml_dump_datatype(hid_t type);
-static herr_t xml_dump_attr(hid_t, const char *, void UNUSED *);
-static void xml_dump_data(hid_t, int, struct subset_t UNUSED *);
+static herr_t xml_dump_attr(hid_t, const char *, void *);
+static void xml_dump_data(hid_t, int, struct subset_t *);
/**
** Added for XML **
@@ -1093,7 +1093,7 @@ dump_dataspace(hid_t space)
*-------------------------------------------------------------------------
*/
static herr_t
-dump_attr(hid_t attr, const char *attr_name, void UNUSED *op_data)
+dump_attr(hid_t attr, const char *attr_name, void * UNUSED op_data)
{
hid_t attr_id, type, space;
herr_t ret = SUCCEED;
@@ -1541,7 +1541,7 @@ dump_group(hid_t gid, const char *name)
{
H5G_stat_t statbuf;
hid_t dset, type;
- char typename[1024], *tmp;
+ char type_name[1024], *tmp;
int i, xtype = H5G_UNKNOWN; /* dump all */
tmp = malloc(strlen(prefix) + strlen(name) + 2);
@@ -1560,10 +1560,10 @@ dump_group(hid_t gid, const char *name)
if (!type_table->objs[i].recorded) {
dset = H5Dopen(gid, type_table->objs[i].objname);
type = H5Dget_type(dset);
- sprintf(typename, "#%lu:%lu",
+ sprintf(type_name, "#%lu:%lu",
type_table->objs[i].objno[0],
type_table->objs[i].objno[1]);
- dump_named_datatype(type, typename);
+ dump_named_datatype(type, type_name);
H5Tclose(type);
H5Dclose(dset);
}
@@ -1956,7 +1956,7 @@ set_output_file(const char *fname)
*-------------------------------------------------------------------------
*/
static void
-handle_attributes(hid_t fid, char *attr, void UNUSED *data)
+handle_attributes(hid_t fid, char *attr, void * UNUSED data)
{
dump_selected_attr(fid, attr);
}
@@ -2215,7 +2215,7 @@ handle_datasets(hid_t fid, char *dset, void *data)
*-------------------------------------------------------------------------
*/
static void
-handle_groups(hid_t fid, char *group, void UNUSED *data)
+handle_groups(hid_t fid, char *group, void * UNUSED data)
{
H5G_stat_t statbuf;
hid_t gid;
@@ -2253,7 +2253,7 @@ handle_groups(hid_t fid, char *group, void UNUSED *data)
*-------------------------------------------------------------------------
*/
static void
-handle_links(hid_t fid, char *links, void UNUSED *data)
+handle_links(hid_t fid, char *links, void * UNUSED data)
{
H5G_stat_t statbuf;
@@ -2309,11 +2309,11 @@ handle_links(hid_t fid, char *links, void UNUSED *data)
*-------------------------------------------------------------------------
*/
static void
-handle_datatypes(hid_t fid, char *type, void UNUSED *data)
+handle_datatypes(hid_t fid, char *type, void * UNUSED data)
{
- hid_t typeid;
+ hid_t type_id;
- if ((typeid = H5Topen(fid, type)) < 0) {
+ if ((type_id = H5Topen(fid, type)) < 0) {
/* check if type is unamed data type */
int idx = 0;
@@ -2348,15 +2348,15 @@ handle_datatypes(hid_t fid, char *type, void UNUSED *data)
d_status = EXIT_FAILURE;
} else {
hid_t dsetid = H5Dopen(fid, type_table->objs[idx].objname);
- typeid = H5Dget_type(dsetid);
- dump_named_datatype(typeid, type);
- H5Tclose(typeid);
+ type_id = H5Dget_type(dsetid);
+ dump_named_datatype(type_id, type);
+ H5Tclose(type_id);
H5Dclose(dsetid);
}
} else {
- dump_named_datatype(typeid, type);
+ dump_named_datatype(type_id, type);
- if (H5Tclose(typeid) < 0)
+ if (H5Tclose(type_id) < 0)
d_status = EXIT_FAILURE;
}
}
@@ -3137,7 +3137,7 @@ lookup_ref_path(hobj_ref_t * ref)
*-------------------------------------------------------------------------
*/
static herr_t
-fill_ref_path_table(hid_t group, const char *name, void UNUSED * op_data)
+fill_ref_path_table(hid_t group, const char *name, void * UNUSED op_data)
{
hid_t obj;
char *tmp;
@@ -3912,7 +3912,7 @@ xml_dump_dataspace(hid_t space)
*-------------------------------------------------------------------------
*/
static void
-xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED *sset)
+xml_dump_data(hid_t obj_id, int obj_data, struct subset_t * UNUSED sset)
{
h5dump_t *outputformat = &xml_dataformat;
int status = -1;
@@ -4016,7 +4016,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED *sset)
*-------------------------------------------------------------------------
*/
static herr_t
-xml_dump_attr(hid_t attr, const char *attr_name, void UNUSED * op_data)
+xml_dump_attr(hid_t attr, const char *attr_name, void * UNUSED op_data)
{
hid_t attr_id, type, space;
char *t_aname = xml_escape_the_name(attr_name);
@@ -4275,7 +4275,7 @@ xml_dump_group(hid_t gid, const char *name)
H5G_stat_t statbuf;
char *cp;
hid_t dset, type;
- char typename[1024], *tmp = NULL;
+ char type_name[1024], *tmp = NULL;
char *par = NULL;
int i;
int isRoot = 0;
@@ -4347,10 +4347,10 @@ xml_dump_group(hid_t gid, const char *name)
if (!type_table->objs[i].recorded) {
dset = H5Dopen(gid, type_table->objs[i].objname);
type = H5Dget_type(dset);
- sprintf(typename, "#%lu:%lu",
+ sprintf(type_name, "#%lu:%lu",
type_table->objs[i].objno[0],
type_table->objs[i].objno[1]);
- dump_function_table->dump_named_datatype_function(type, typename);
+ dump_function_table->dump_named_datatype_function(type, type_name);
H5Tclose(type);
H5Dclose(dset);
}
@@ -4377,10 +4377,10 @@ xml_dump_group(hid_t gid, const char *name)
if (!type_table->objs[i].recorded) {
dset = H5Dopen(gid, type_table->objs[i].objname);
type = H5Dget_type(dset);
- sprintf(typename, "#%lu:%lu",
+ sprintf(type_name, "#%lu:%lu",
type_table->objs[i].objno[0],
type_table->objs[i].objno[1]);
- dump_function_table->dump_named_datatype_function(type, typename);
+ dump_function_table->dump_named_datatype_function(type, type_name);
H5Tclose(type);
H5Dclose(dset);
}
@@ -4662,7 +4662,7 @@ check_compression(hid_t dcpl)
*-------------------------------------------------------------------------
*/
static void
-xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED *sset)
+xml_dump_dataset(hid_t did, const char *name, struct subset_t * UNUSED sset)
{
hid_t type, space;
hid_t dcpl;
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 6be56ae..8aa69f9 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1246,7 +1246,7 @@ dump_dataset_values(hid_t dset)
*-------------------------------------------------------------------------
*/
static herr_t
-list_attr (hid_t obj, const char *attr_name, void UNUSED *op_data)
+list_attr (hid_t obj, const char *attr_name, void * UNUSED op_data)
{
hid_t attr, space, type, p_type;
hsize_t size[64], nelmts=1;
@@ -1404,7 +1404,7 @@ dataset_list1(hid_t dset)
*-------------------------------------------------------------------------
*/
static herr_t
-dataset_list2(hid_t dset, const char UNUSED *name)
+dataset_list2(hid_t dset, const char * UNUSED name)
{
hid_t dcpl; /*dataset creation property list*/
hid_t type; /*data type of dataset */
@@ -1591,7 +1591,7 @@ group_list2(hid_t grp, const char *name)
*-------------------------------------------------------------------------
*/
static herr_t
-datatype_list2(hid_t type, const char UNUSED *name)
+datatype_list2(hid_t type, const char * UNUSED name)
{
if (verbose_g>0) {
printf(" %-10s ", "Type:");
diff --git a/tools/h5toh4/h5toh4.c b/tools/h5toh4/h5toh4.c
index fca2cf4..4995c29 100644
--- a/tools/h5toh4/h5toh4.c
+++ b/tools/h5toh4/h5toh4.c
@@ -464,125 +464,125 @@ done:
*-----------------------------------------------------------------------*/
herr_t
convert_group (hid_t gid, char *name, op_data_t *op_data) {
-H5G_stat_t statbuf;
+ H5G_stat_t statbuf;
- int32 hfile_id;
- int32 vgroup_id;
- int32 obj_idx;
- int32 status;
- int idx, flag;
+ int32 hfile_id;
+ int32 vgroup_id;
+ int32 obj_idx;
+ int32 status;
+ int idx, flag;
- hfile_id = op_data->hfile_id;
+ hfile_id = op_data->hfile_id;
- if ((vgroup_id = Vattach(hfile_id, -1, "w")) <= 0 ) {
- fprintf(stderr,"Error: Unable to create new vgroup\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(vgroup_id);
- }
+ if ((vgroup_id = Vattach(hfile_id, -1, "w")) <= 0 ) {
+ fprintf(stderr,"Error: Unable to create new vgroup\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(vgroup_id);
+ }
- if ((status = Vsetname(vgroup_id, name)) != SUCCEED ) {
- fprintf(stderr,"Error: Unable to set name on new vgroup\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(status);
- }
+ if ((status = Vsetname(vgroup_id, name)) != SUCCEED ) {
+ fprintf(stderr,"Error: Unable to set name on new vgroup\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(status);
+ }
- if ((status = Vsetclass(vgroup_id, "HDF5")) != SUCCEED ) {
- fprintf(stderr,"Error: Unable to set class on new vgroup\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(status);
- }
+ if ((status = Vsetclass(vgroup_id, "HDF5")) != SUCCEED ) {
+ fprintf(stderr,"Error: Unable to set class on new vgroup\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(status);
+ }
- if (op_data->vgroup_id == 0) {
- obj_idx = -1; /* Indexes assigned below start from 0 */
- } else {
- if ((obj_idx = Vinsert(op_data->vgroup_id, vgroup_id)) < 0) {
- fprintf(stderr,"Error: Index %d of the new vgroup is illegal\n",(int)obj_idx);
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(obj_idx);
- }
- }
- op_data->vgroup_id = vgroup_id;
- op_data->sds_id = 0;
- op_data->vdata_id = 0;
- op_data->obj_idx = obj_idx;
-
+ if (op_data->vgroup_id == 0) {
+ obj_idx = -1; /* Indexes assigned below start from 0 */
+ } else {
+ if ((obj_idx = Vinsert(op_data->vgroup_id, vgroup_id)) < 0) {
+ fprintf(stderr,"Error: Index %d of the new vgroup is illegal\n",(int)obj_idx);
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(obj_idx);
+ }
+ }
+ op_data->vgroup_id = vgroup_id;
+ op_data->sds_id = 0;
+ op_data->vdata_id = 0;
+ op_data->obj_idx = obj_idx;
+
- /* hard link */
- if ((status = H5Gget_objinfo(gid, ".", TRUE, &statbuf)) != SUCCEED ) {
- fprintf(stderr,"Error: H5Gget_objinfo() did not work\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return (status);
- }
+ /* hard link */
+ if ((status = H5Gget_objinfo(gid, ".", TRUE, &statbuf)) != SUCCEED ) {
+ fprintf(stderr,"Error: H5Gget_objinfo() did not work\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return (status);
+ }
- if (HDstrcmp(name,"/") == 0) { /* this is the root group, just iterate */
+ if (HDstrcmp(name,"/") == 0) { /* this is the root group, just iterate */
- if ((status = H5Aiterate(gid, NULL, (H5A_operator_t)convert_attr, op_data)) != SUCCEED ) {
- fprintf(stderr,"Error: Unable to iterate over all of the attributes\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(status);
- }
+ if ((status = H5Aiterate(gid, NULL, (H5A_operator_t)convert_attr, op_data)) != SUCCEED ) {
+ fprintf(stderr,"Error: Unable to iterate over all of the attributes\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(status);
+ }
- if ((status = H5Giterate(gid, ".", NULL, (H5G_operator_t)convert_all, op_data)) != SUCCEED ) {
- fprintf(stderr,"Error: Unable to iterate over all of the groups\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(status);
- }
+ if ((status = H5Giterate(gid, ".", NULL, (H5G_operator_t)convert_all, op_data)) != SUCCEED ) {
+ fprintf(stderr,"Error: Unable to iterate over all of the groups\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(status);
+ }
- } else {
+ } else {
- if ((idx = get_table_idx(group_table, statbuf.objno)) < 0 ) {
+ if ((idx = get_table_idx(group_table, statbuf.objno)) < 0 ) {
- fprintf(stderr,"Error: object not found, %s\n",name);
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- status = FAIL;
+ fprintf(stderr,"Error: object not found, %s\n",name);
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ status = FAIL;
- } else if((flag = get_tableflag(group_table,idx)) < 0 ) {
-
- fprintf(stderr,"Error: get_tableflag() should never return < 0\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- status = FAIL;
+ } else if((flag = get_tableflag(group_table,idx)) < 0 ) {
+
+ fprintf(stderr,"Error: get_tableflag() should never return < 0\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ status = FAIL;
- } else if(flag == TRUE ) { /* this has already been converted, don't convert the attributes again */
+ } else if(flag == TRUE ) { /* this has already been converted, don't convert the attributes again */
- if ((status = H5Giterate(gid, ".", NULL, (H5G_operator_t)convert_all, op_data)) != SUCCEED ) {
- fprintf(stderr,"Error: Unable to iterate over all of the groups\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(status);
- }
+ if ((status = H5Giterate(gid, ".", NULL, (H5G_operator_t)convert_all, op_data)) != SUCCEED ) {
+ fprintf(stderr,"Error: Unable to iterate over all of the groups\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(status);
+ }
- } else { /* flag == FALSE */
+ } else { /* flag == FALSE */
- /* this is now being converted */
- if ((status = set_tableflag(group_table,idx)) < 0 ) {
- fprintf(stderr,"Error: set_tableflag should never return < 0\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(status);
- }
+ /* this is now being converted */
+ if ((status = set_tableflag(group_table,idx)) < 0 ) {
+ fprintf(stderr,"Error: set_tableflag should never return < 0\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(status);
+ }
- if ((status = H5Aiterate(gid, NULL, (H5A_operator_t)convert_attr, op_data)) != SUCCEED ) {
- fprintf(stderr,"Error: Unable to iterate over all of the attributes\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(status);
- }
+ if ((status = H5Aiterate(gid, NULL, (H5A_operator_t)convert_attr, op_data)) != SUCCEED ) {
+ fprintf(stderr,"Error: Unable to iterate over all of the attributes\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(status);
+ }
- if ((status = H5Giterate(gid, ".", NULL, (H5G_operator_t)convert_all, op_data)) != SUCCEED ) {
- fprintf(stderr,"Error: Unable to iterate over all of the groups\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- return(status);
- }
+ if ((status = H5Giterate(gid, ".", NULL, (H5G_operator_t)convert_all, op_data)) != SUCCEED ) {
+ fprintf(stderr,"Error: Unable to iterate over all of the groups\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ return(status);
+ }
- }
+ }
- }
+ }
- if ((status = Vdetach(vgroup_id)) != SUCCEED ) {
- fprintf(stderr,"Error: Unable to detach the new Vgroup\n");
- DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
- status = FAIL;
- }
+ if ((status = Vdetach(vgroup_id)) != SUCCEED ) {
+ fprintf(stderr,"Error: Unable to detach the new Vgroup\n");
+ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_group", __FILE__, __LINE__);
+ status = FAIL;
+ }
- return status;
+ return status;
}
@@ -601,36 +601,36 @@ H5G_stat_t statbuf;
*-----------------------------------------------------------------------*/
herr_t
convert_dataset (hid_t did, char *name, op_data_t *op_data) {
-hid_t type, space, class, mem_type, type2;
-/* H5G_stat_t statbuf; */
-size_t typesize;
-int i, idx;
-int32 dim_sizes[32], start[32], edges[32];
-int ndims;
-int ndimf;
-hsize_t dims[32], maxdims[32];
-hsize_t dimf[4];
-int permf[4];
-int32 hfile_id;
-int32 sd_id;
-int32 sds_id;
-int32 vdata_id;
-int32 vgroup_id;
-int32 n_values;
-int32 status;
-int32 h4_type;
-int32 recsize;
-int32 n_records, num_of_recs, record_pos;
-int nmembers;
-char *buffer=NULL; /* read/write buffer*/
-char fieldname_list[4096] = "\0";
-char *fieldname=NULL;
-hid_t fieldtype;
-int32 order;
-off_t offset;
-off_t offset_array[512];
-hid_t h4type_array[512], memtype_array[512];
-int32 order_array[512];
+ hid_t type, space, t_class, mem_type, type2;
+ /* H5G_stat_t statbuf; */
+ size_t typesize;
+ int i, idx;
+ int32 dim_sizes[32], start[32], edges[32];
+ int ndims;
+ int ndimf;
+ hsize_t dims[32], maxdims[32];
+ hsize_t dimf[4];
+ int permf[4];
+ int32 hfile_id;
+ int32 sd_id;
+ int32 sds_id;
+ int32 vdata_id;
+ int32 vgroup_id;
+ int32 n_values;
+ int32 status;
+ int32 h4_type;
+ int32 recsize;
+ int32 n_records, num_of_recs, record_pos;
+ int nmembers;
+ char *buffer=NULL; /* read/write buffer*/
+ char fieldname_list[4096] = "\0";
+ char *fieldname=NULL;
+ hid_t fieldtype;
+ int32 order;
+ off_t offset;
+ off_t offset_array[512];
+ hid_t h4type_array[512], memtype_array[512];
+ int32 order_array[512];
/* hard link */
@@ -670,14 +670,14 @@ int32 order_array[512];
return status;
}
- if ((class = H5Tget_class(type)) < 0 ) {
+ if ((t_class = H5Tget_class(type)) < 0 ) {
fprintf(stderr,"Error: problem with getting class\n");
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_dataset", __FILE__, __LINE__);
- status = class;
+ status = t_class;
return status;
}
- switch (class) {
+ switch (t_class) {
case H5T_INTEGER:
case H5T_FLOAT:
sd_id = op_data->sd_id;
@@ -1053,7 +1053,7 @@ int32 order_array[512];
}
break;
default:
- fprintf(stderr,"Error: %d class not found\n",class);
+ fprintf(stderr,"Error: %d class not found\n",t_class);
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_dataset", __FILE__, __LINE__);
}
@@ -1094,20 +1094,20 @@ int32 order_array[512];
herr_t
convert_attr (hid_t attr, char *attr_name, op_data_t *op_data)
{
-hid_t attr_id, type, space, mem_type, class;
-size_t typesize;
-char *attr_values=NULL;
-int32 status;
-int32 h4_type;
-int32 sds_id;
-int32 vdata_id;
-int32 vgroup_id;
-int32 n_values;
-int32 order;
-hid_t fxdlenstr;
-size_t lenstr;
-H5T_cset_t cset;
-H5T_str_t strpad;
+ hid_t attr_id, type, space, mem_type, t_class;
+ size_t typesize;
+ char *attr_values=NULL;
+ int32 status;
+ int32 h4_type;
+ int32 sds_id;
+ int32 vdata_id;
+ int32 vgroup_id;
+ int32 n_values;
+ int32 order;
+ hid_t fxdlenstr;
+ size_t lenstr;
+ H5T_cset_t cset;
+ H5T_str_t strpad;
sds_id = op_data->sds_id;
vdata_id = op_data->vdata_id;
@@ -1122,14 +1122,14 @@ H5T_str_t strpad;
return status;
}
- if ((class = H5Tget_class(type)) < 0 ) {
+ if ((t_class = H5Tget_class(type)) < 0 ) {
fprintf(stderr,"Error: problem with getting class\n");
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_attr", __FILE__, __LINE__);
- status = class;
+ status = t_class;
return status;
}
- switch (class) {
+ switch (t_class) {
case H5T_INTEGER:
case H5T_FLOAT:
@@ -1364,7 +1364,7 @@ H5T_str_t strpad;
fprintf(stderr,"Warning: H5T_COMPOUND attribute not implemented.\n");
break;
default:
- fprintf(stderr,"Error: %d class not found\n",class);
+ fprintf(stderr,"Error: %d class not found\n",t_class);
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_attr", __FILE__, __LINE__);
status = FAIL;
}
@@ -1736,7 +1736,7 @@ convert_shared_dataset(hid_t did, int idx, op_data_t *op_data)
int32 vdata_ref;
int32 sds_index;
int32 numtagref;
- hid_t type, space, class;
+ hid_t type, space, t_class;
hsize_t dims[32], maxdims[32];
int n_values, ndims;
@@ -1782,14 +1782,14 @@ convert_shared_dataset(hid_t did, int idx, op_data_t *op_data)
return status;
}
- if ((class = H5Tget_class(type)) < 0 ) {
+ if ((t_class = H5Tget_class(type)) < 0 ) {
fprintf(stderr,"Error: problem with getting class\n");
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_shared_dataset", __FILE__, __LINE__);
- status = class;
+ status = t_class;
return status;
}
- switch (class) {
+ switch (t_class) {
case H5T_INTEGER:
case H5T_FLOAT:
sd_id = op_data->sd_id;
@@ -1857,7 +1857,7 @@ convert_shared_dataset(hid_t did, int idx, op_data_t *op_data)
}
break;
default:
- fprintf(stderr,"Error: %d class not found\n",class);
+ fprintf(stderr,"Error: %d class not found\n",t_class);
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_shared_dataset", __FILE__, __LINE__);
status = FAIL;
}
@@ -1981,16 +1981,16 @@ convert_dataset_string (hid_t did, char *name, op_data_t *op_data) {
int32 hfile_id;
int32 vgroup_id;
int32 vdata_id;
-hid_t fxdlenstr, space, class, mem_type;
-const char* fieldname = {"string"};
-const char* fieldname_list = fieldname;
-char *buffer;
-int32 status;
-int32 h4_type;
-int32 recsize, n_records, n_values, num_of_recs, record_pos;
-size_t lenstr;
-H5T_cset_t cset;
-H5T_str_t strpad;
+ hid_t fxdlenstr, space, t_class, mem_type;
+ const char* fieldname = {"string"};
+ const char* fieldname_list = fieldname;
+ char *buffer;
+ int32 status;
+ int32 h4_type;
+ int32 recsize, n_records, n_values, num_of_recs, record_pos;
+ size_t lenstr;
+ H5T_cset_t cset;
+ H5T_str_t strpad;
if ((fxdlenstr = H5Dget_type(did)) <= 0) {
fprintf(stderr, "Error: H5Dget_type() didn't return appropriate value.\n");
@@ -1999,10 +1999,10 @@ H5T_str_t strpad;
return status;
}
- if ((class = H5Tget_class(fxdlenstr)) != H5T_STRING ) {
+ if ((t_class = H5Tget_class(fxdlenstr)) != H5T_STRING ) {
fprintf(stderr,"Error: problem with getting class\n");
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "convert_shared_dataset", __FILE__, __LINE__);
- status = class;
+ status = t_class;
return status;
}
@@ -2172,18 +2172,18 @@ H5T_str_t strpad;
*-----------------------------------------------------------------------*/
static herr_t h5atomic_type_to_h4type(const hid_t h5type, hid_t* h5memtype, size_t* h5memsize, int32* h4type)
{
- H5T_class_t class;
+ H5T_class_t t_class;
size_t h5typesize, h4typesize;
H5T_sign_t sign;
hid_t mem_datatype = FAIL;
- if ((class = H5Tget_class(h5type)) < 0 ) {
+ if ((t_class = H5Tget_class(h5type)) < 0 ) {
fprintf(stderr,"Error: problem with getting type class\n");
DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "h5atomic_type_to_h4type", __FILE__, __LINE__);
return FAIL;
}
- switch(class){
+ switch(t_class){
case H5T_INTEGER:
if ((h5typesize = H5Tget_size(h5type)) == 0 ) {
fprintf(stderr,"Error: problem with getting type size\n");