diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-08-10 22:30:01 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-08-10 22:30:01 (GMT) |
commit | d24ae52673e96864f4e406dd7b277f91d42fbb38 (patch) | |
tree | e9bb3c48c58f43899616fe8d6cda8daec8d4cc8a /tools/gifconv/writehdf.c | |
parent | 48842d60fa84fb69fb0a3dc527132eb93a6be7f2 (diff) | |
download | hdf5-d24ae52673e96864f4e406dd7b277f91d42fbb38.zip hdf5-d24ae52673e96864f4e406dd7b277f91d42fbb38.tar.gz hdf5-d24ae52673e96864f4e406dd7b277f91d42fbb38.tar.bz2 |
[svn-r4326] Purpose:
Code cleanups, mostly..
Description:
Work on pacifying the SGI compiler to get the generic properties working
correctly with --enable-parallel and --enable-fortran. It's not quite
fixed yet, but I need to head home and these patches help... :-/
Platforms tested:
IRIX64 6.5 (modi4)
Diffstat (limited to 'tools/gifconv/writehdf.c')
-rw-r--r-- | tools/gifconv/writehdf.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/tools/gifconv/writehdf.c b/tools/gifconv/writehdf.c index 4d69d01..3a6831a 100644 --- a/tools/gifconv/writehdf.c +++ b/tools/gifconv/writehdf.c @@ -19,7 +19,6 @@ static int write_text_attribute(hid_t dataset_id , const char *attr_name, hsize_t attr_dims_size; /* dimensions for the attribute */ hid_t attr_dataspace_id; /* dataspaces needed for the various attributes */ hid_t attr_attr_id; /* attribute id */ - herr_t status; /* check return status */ hid_t attr_type_id; /* check strings */ @@ -41,15 +40,15 @@ static int write_text_attribute(hid_t dataset_id , const char *attr_name, attr_dataspace_id , H5P_DEFAULT); /* write out the attribute data */ - if ((status = H5Awrite(attr_attr_id , attr_type_id , attr_value)) < 0) + if (H5Awrite(attr_attr_id , attr_type_id , attr_value) < 0) return -1; /* close the attribute */ - if ((status = H5Aclose(attr_attr_id)) < 0) + if (H5Aclose(attr_attr_id) < 0) return -1; /* close the dataspace */ - if ((status = H5Sclose(attr_dataspace_id)) < 0) { + if (H5Sclose(attr_dataspace_id) < 0) { fprintf(stderr , "Unable to close attribute dataspace. Aborting \n"); return -1; } @@ -63,10 +62,12 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) GIFHEAD gifHead; /* GIF Header structure */ GIFIMAGEDESC *gifImageDesc; /* Logical Image Descriptor struct */ - long ImageCount, /* number of images */ - CommentCount, /* number of comments */ + long ImageCount; /* number of images */ +#ifdef UNUSED + long CommentCount, /* number of comments */ ApplicationCount, /* number of application extensions */ PlainTextCount; /* number of plain text extensions */ +#endif /* UNUSED */ char ImageName[256]; /* Image name for the GR Image */ char GroupName[VSNAMELENMAX]; /* so that we can name the subgroups appropriately */ @@ -75,7 +76,6 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) hid_t file_id; /* H5 file id */ hid_t image_id; /* H5 id for the whole image */ hid_t pal_id; /* H5 id for the palette */ - herr_t status; /* status variable */ hobj_ref_t pal_ref; /* Create a reference for the palette */ /* temp counter */ @@ -85,10 +85,12 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) gifHead = *(GifMemoryStruct.GifHeader); /* get some data from gifHead */ - ImageCount = (WORD)gifHead.ImageCount; + ImageCount = gifHead.ImageCount; +#ifdef UNUSED CommentCount = (WORD)gifHead.CommentCount; ApplicationCount = (WORD)gifHead.ApplicationCount; PlainTextCount = (WORD)gifHead.PlainTextCount; +#endif /* UNUSED */ /* get the main group name from GIFFileName */ GroupName[0]= '/'; @@ -138,7 +140,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) /* write the palette data out */ /****** Ask Elena about VOIDP ******/ - if ((status = H5Dwrite(pal_id , H5T_NATIVE_UINT8 , H5S_ALL , H5S_ALL , H5P_DEFAULT , (void *)gifHead.HDFPalette)) < 0) { + if (H5Dwrite(pal_id , H5T_NATIVE_UINT8 , H5S_ALL , H5S_ALL , H5P_DEFAULT , (void *)gifHead.HDFPalette) < 0) { fprintf(stderr , "Error writing dataset. Aborting...\n"); return -1; } @@ -176,36 +178,36 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) ref_dataset_id = H5Dcreate(image_id , "Palette Reference" , H5T_STD_REF_OBJ , ref_dataspace_id , H5P_DEFAULT); /* create a reference to the palette */ - if ((status = H5Rcreate(&pal_ref , image_id , "Global Palette" , H5R_OBJECT , -1)) < 0) { + if (H5Rcreate(&pal_ref , image_id , "Global Palette" , H5R_OBJECT , -1) < 0) { fprintf(stderr , "Unable to create palette reference\n"); return -1; } /* write the reference out */ - if ((status = H5Dwrite(ref_dataset_id , H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL , H5P_DEFAULT, &pal_ref)) < 0) { + if (H5Dwrite(ref_dataset_id , H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL , H5P_DEFAULT, &pal_ref) < 0) { fprintf(stderr , "Unable to write Palette Reference"); return -1; } /* close dataset */ - if ((status = H5Dclose(ref_dataset_id)) < 0) { + if (H5Dclose(ref_dataset_id) < 0) { fprintf(stderr , "Unable to close palette dataset.\n"); return -1; } /* close dataspace */ - if ((status = H5Sclose(ref_dataspace_id)) < 0) { + if (H5Sclose(ref_dataspace_id) < 0) { fprintf(stderr , "Unable to close palette dataspace.\n"); return -1; } /* close everything */ - if ((status = H5Dclose(pal_id)) < 0) { + if (H5Dclose(pal_id) < 0) { fprintf(stderr , "Unable to close palette dataset. Aborting.\n"); return -1; } - if ((status = H5Sclose(dataspace_id)) < 0) { + if (H5Sclose(dataspace_id) < 0) { fprintf(stderr , "Unable to close palette dataspace. Aborting.\n"); return -1; } @@ -251,7 +253,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) /* write out the image */ /****** Ask Elena about VOIDP ******/ - if ((status = H5Dwrite(sub_image_id , H5T_NATIVE_UINT8 , H5S_ALL , H5S_ALL , H5P_DEFAULT , (void *)(gifImageDesc->Image))) < 0) { + if (H5Dwrite(sub_image_id , H5T_NATIVE_UINT8 , H5S_ALL , H5S_ALL , H5P_DEFAULT , (void *)(gifImageDesc->Image)) < 0) { fprintf(stderr , "Error writing image. Aborting... \n"); return -1; } @@ -325,19 +327,19 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) /* create the attribute */ attr_attr_id = H5Acreate(sub_image_id , "PALETTE" , H5T_STD_REF_OBJ , attr_dataspace_id , H5P_DEFAULT); - if ((status = H5Awrite(attr_attr_id , H5T_STD_REF_OBJ , &pal_ref)) < 0) { + if (H5Awrite(attr_attr_id , H5T_STD_REF_OBJ , &pal_ref) < 0) { fprintf(stderr , "Unable to write attribute. Aborting \n"); return -1; } /* close the attribute */ - if ((status = H5Aclose(attr_attr_id)) < 0) { + if (H5Aclose(attr_attr_id) < 0) { fprintf(stderr , "Unable to close CLASS IMAGE attribute. Aborting.\n"); return -1; } /* close the dataspace */ - if ((status = H5Sclose(attr_dataspace_id)) < 0) { + if (H5Sclose(attr_dataspace_id) < 0) { fprintf(stderr , "Unable to close attribute dataspace. Aborting \n"); return -1; } @@ -356,43 +358,43 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) /* create the attribute */ attr_attr_id = H5Acreate(sub_image_id , "IMAGE_MINMAXRANGE" , H5T_NATIVE_UINT8 , attr_dataspace_id , H5P_DEFAULT); - if ((status = H5Awrite(attr_attr_id , H5T_NATIVE_UINT8 , minmax)) < 0) { + if (H5Awrite(attr_attr_id , H5T_NATIVE_UINT8 , minmax) < 0) { fprintf(stderr , "Unable to write attribute. Aborting \n"); return -1; } /* close the attribute */ - if ((status = H5Aclose(attr_attr_id)) < 0) { + if (H5Aclose(attr_attr_id) < 0) { fprintf(stderr , "Unable to close CLASS IMAGE attribute. Aborting.\n"); return -1; } /* close the dataspace */ - if ((status = H5Sclose(attr_dataspace_id)) < 0) { + if (H5Sclose(attr_dataspace_id) < 0) { fprintf(stderr , "Unable to close attribute dataspace. Aborting \n"); return -1; } /* close everything */ - if ((status = H5Dclose(sub_image_id)) < 0) { + if (H5Dclose(sub_image_id) < 0) { fprintf(stderr , "Unable to close image dataset. Aborting \n"); return -1; } - if ((status = H5Sclose(dataspace_id)) < 0) { + if (H5Sclose(dataspace_id) < 0) { fprintf(stderr , "Unable to close image dataspace. Aborting \n"); return -1; } } /* close the main image group */ - if ((status = H5Gclose(image_id)) < 0) { + if (H5Gclose(image_id) < 0) { fprintf(stderr , "Could not close the image group. Aborting...\n"); return -1; } /* close the H5 file */ - if ((status = H5Fclose(file_id)) < 0) { + if (H5Fclose(file_id) < 0) { fprintf(stderr , "Could not close HDF5 file. Aborting...\n"); return -1; } |