diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-09-25 17:46:32 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-09-25 17:46:32 (GMT) |
commit | ed663577a5394d34a0cfbe5cd5443af1f7957dc5 (patch) | |
tree | f334d37a08de1f77ce046907bce49c9ff56c6597 /examples | |
parent | a6036953db9be2210acbed0882cf62c594b3a168 (diff) | |
download | hdf5-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 'examples')
-rw-r--r-- | examples/h5_group.c | 18 | ||||
-rw-r--r-- | examples/h5_read.c | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/examples/h5_group.c b/examples/h5_group.c index f55262a..72982ec 100644 --- a/examples/h5_group.c +++ b/examples/h5_group.c @@ -176,7 +176,7 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata) { hid_t did; /* dataset identifier */ hid_t tid; /* datatype identifier */ - H5T_class_t class; + H5T_class_t t_class; hid_t pid; /* data_property identifier */ hsize_t chunk_dims_out[2]; @@ -216,22 +216,22 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata) (unsigned long)(chunk_dims_out[1])); } else{ - class = H5Tget_class(tid); - if(class < 0){ + t_class = H5Tget_class(tid); + if(t_class < 0){ puts(" Invalid datatype.\n"); } else { - if(class == H5T_INTEGER) + if(t_class == H5T_INTEGER) puts(" Datatype is 'H5T_NATIVE_INTEGER'.\n"); - if(class == H5T_FLOAT) + if(t_class == H5T_FLOAT) puts(" Datatype is 'H5T_NATIVE_FLOAT'.\n"); - if(class == H5T_STRING) + if(t_class == H5T_STRING) puts(" Datatype is 'H5T_NATIVE_STRING'.\n"); - if(class == H5T_BITFIELD) + if(t_class == H5T_BITFIELD) puts(" Datatype is 'H5T_NATIVE_BITFIELD'.\n"); - if(class == H5T_OPAQUE) + if(t_class == H5T_OPAQUE) puts(" Datatype is 'H5T_NATIVE_OPAQUE'.\n"); - if(class == H5T_COMPOUND) + if(t_class == H5T_COMPOUND) puts(" Datatype is 'H5T_NATIVE_COMPOUND'.\n"); } } diff --git a/examples/h5_read.c b/examples/h5_read.c index b96322b..cd8d9f7 100644 --- a/examples/h5_read.c +++ b/examples/h5_read.c @@ -23,7 +23,7 @@ main (void) hid_t file, dataset; /* handles */ hid_t datatype, dataspace; hid_t memspace; - H5T_class_t class; /* data type class */ + H5T_class_t t_class; /* data type class */ H5T_order_t order; /* data order */ size_t size; /* * size of the data element @@ -59,8 +59,8 @@ main (void) * dataset class, order, size, rank and dimensions. */ datatype = H5Dget_type(dataset); /* datatype handle */ - class = H5Tget_class(datatype); - if (class == H5T_INTEGER) printf("Data set has INTEGER type \n"); + t_class = H5Tget_class(datatype); + if (t_class == H5T_INTEGER) printf("Data set has INTEGER type \n"); order = H5Tget_order(datatype); if (order == H5T_ORDER_LE) printf("Little endian order \n"); |