summaryrefslogtreecommitdiffstats
path: root/hl/tools/gif2h5/hdf2gif.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-06-18 20:22:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-06-18 20:22:10 (GMT)
commitd41b9fffdfca2e97c36bc0ad0899fbb7b055f926 (patch)
tree51ed39b08a41a4f6947af07630eb40dfdb013d87 /hl/tools/gif2h5/hdf2gif.c
parentfcaf572430a8eda3f6519bd21311ef7a8e3c3c1f (diff)
downloadhdf5-d41b9fffdfca2e97c36bc0ad0899fbb7b055f926.zip
hdf5-d41b9fffdfca2e97c36bc0ad0899fbb7b055f926.tar.gz
hdf5-d41b9fffdfca2e97c36bc0ad0899fbb7b055f926.tar.bz2
[svn-r4012] Purpose:
Clean up compiler warnings. Description: Just code neatening mostly, some casts, etc. Platforms tested: FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'hl/tools/gif2h5/hdf2gif.c')
-rw-r--r--hl/tools/gif2h5/hdf2gif.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c
index 9c4133e..39c75d1 100644
--- a/hl/tools/gif2h5/hdf2gif.c
+++ b/hl/tools/gif2h5/hdf2gif.c
@@ -19,16 +19,18 @@ extern int hdfWriteGIF(FILE *fp, BYTE *pic, int ptype, int w, int h, BYTE *rmap,
int EndianOrder;
-void PutByte(BYTE b , FILE *fpGif)
+#ifdef NOT_USED
+static void PutByte(BYTE b , FILE *fpGif)
{
if (fputc(b , fpGif) == EOF) {
printf("File Writing Error, cannot continue");
exit(-1);
}
}
+#endif /* NOT_USED */
-void putword(int w, FILE *fp)
+static void putword(int w, FILE *fp)
{
/* writes a 16-bit integer in GIF order (LSB first) */
@@ -37,7 +39,8 @@ void putword(int w, FILE *fp)
fputc((w>>8)&0xff,fp);
}
-void usage() {
+static void usage(void )
+{
printf("Usage: h52gif <h5_file> <gif_file> -i <h5_image> [-p <h5_palette>]\n");
printf("h52gif expects *at least* one h5_image. You may repeat -i <h5_image> [-p <h5_palette>] at most 50 times (maximum of 50 images).\n");
}
@@ -53,8 +56,6 @@ int main(int argc , char **argv) {
CHAR *HDFName = NULL;
CHAR *GIFName = NULL;
- CHAR *image_path = NULL;
- CHAR *pal_path = NULL;
/* reference variables */
int has_local_palette; /* treated as a flag */
@@ -76,7 +77,7 @@ int main(int argc , char **argv) {
int CountDown;
int curx , cury;
int time_out = 0; /* time between two images in the animation */
- int n_images , index;
+ int n_images , idx;
BYTE pc2nc[256] , r1[256] , g1[256] , b1[256];
@@ -172,7 +173,7 @@ int main(int argc , char **argv) {
n_images = number_of_images;
Background = 0;
- for (index = 0 ; index < n_images ; index++) {
+ for (idx = 0 ; idx < n_images ; idx++) {
/* try to read the image and the palette */
/* Lots of funky stuff to support multiple images has been taken off.
@@ -183,7 +184,7 @@ int main(int argc , char **argv) {
** to write the global palette out and then independantly write the smaller local
** palettes
*/
- if (ReadHDF(&Image , GlobalPalette , dim_sizes , HDFName , image_name_arr[index] , pal_name_arr[index]) < 0) {
+ if (ReadHDF(&Image , GlobalPalette , dim_sizes , HDFName , image_name_arr[idx] , pal_name_arr[idx]) < 0) {
fprintf(stderr , "Unable to read HDF file\n");
return -1;
}
@@ -257,7 +258,7 @@ int main(int argc , char **argv) {
/* If it is the first image we do all the header stuff that isn't required for the
** rest of the images.
*/
- if (index == 0) {
+ if (idx == 0) {
/* Write out the GIF header and logical screen descriptor */
if (n_images > 1) {
fwrite("GIF89a", 1, 6, fpGif); /* the GIF magic number */
@@ -331,7 +332,7 @@ int main(int argc , char **argv) {
fputc (InitCodeSize , fpGif);
- i = hdfWriteGIF(fpGif , Image , 0 , dim_sizes[0] , dim_sizes[1] , r1, g1 , b1 , pc2nc , 256 , 8 , BitsPerPixel);
+ i = hdfWriteGIF(fpGif , Image , 0 , (int)dim_sizes[0] , (int)dim_sizes[1] , r1, g1 , b1 , pc2nc , 256 , 8 , BitsPerPixel);
fputc(0x00 , fpGif);
free (Image);
}