Avoid warnings.

This commit is contained in:
Andrey Kiselev 2004-09-03 07:53:29 +00:00
parent 8ae15719de
commit f6e12093d8

View File

@ -1,4 +1,4 @@
/* $Id: ras2tiff.c,v 1.9 2004-08-16 19:13:53 dron Exp $ */
/* $Id: ras2tiff.c,v 1.10 2004-09-03 07:53:29 dron Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -31,6 +31,10 @@
#include <string.h>
#include <ctype.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "rasterfile.h"
#include "tiffio.h"
@ -94,23 +98,23 @@ main(int argc, char* argv[])
}
if (strcmp(h.ras_magic, RAS_MAGIC) == 0) {
#ifndef WORDS_BIGENDIAN
TIFFSwabLong(&h.ras_width);
TIFFSwabLong(&h.ras_height);
TIFFSwabLong(&h.ras_depth);
TIFFSwabLong(&h.ras_length);
TIFFSwabLong(&h.ras_type);
TIFFSwabLong(&h.ras_maptype);
TIFFSwabLong(&h.ras_maplength);
TIFFSwabLong((uint32 *)&h.ras_width);
TIFFSwabLong((uint32 *)&h.ras_height);
TIFFSwabLong((uint32 *)&h.ras_depth);
TIFFSwabLong((uint32 *)&h.ras_length);
TIFFSwabLong((uint32 *)&h.ras_type);
TIFFSwabLong((uint32 *)&h.ras_maptype);
TIFFSwabLong((uint32 *)&h.ras_maplength);
#endif
} else if (strcmp(h.ras_magic, RAS_MAGIC_INV) == 0) {
#ifdef WORDS_BIGENDIAN
TIFFSwabLong(&h.ras_width);
TIFFSwabLong(&h.ras_height);
TIFFSwabLong(&h.ras_depth);
TIFFSwabLong(&h.ras_length);
TIFFSwabLong(&h.ras_type);
TIFFSwabLong(&h.ras_maptype);
TIFFSwabLong(&h.ras_maplength);
TIFFSwabLong((uint32 *)&h.ras_width);
TIFFSwabLong((uint32 *)&h.ras_height);
TIFFSwabLong((uint32 *)&h.ras_depth);
TIFFSwabLong((uint32 *)&h.ras_length);
TIFFSwabLong((uint32 *)&h.ras_type);
TIFFSwabLong((uint32 *)&h.ras_maptype);
TIFFSwabLong((uint32 *)&h.ras_maplength);
#endif
} else {
fprintf(stderr, "%s: Not a rasterfile.\n", argv[optind]);
@ -144,7 +148,7 @@ main(int argc, char* argv[])
mapsize = 1<<h.ras_depth;
if (h.ras_maplength > mapsize*3) {
fprintf(stderr,
"%s: Huh, %d colormap entries, should be %d?\n",
"%s: Huh, %ld colormap entries, should be %d?\n",
argv[optind], h.ras_maplength, mapsize*3);
return (-7);
}
@ -287,3 +291,5 @@ usage(void)
fprintf(stderr, "%s\n", stuff[i]);
exit(-1);
}
/* vim: set ts=8 sts=8 sw=8 noet: */