From f6e12093d8e2c988dbe7069c3fbf52c5b77b3b93 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Fri, 3 Sep 2004 07:53:29 +0000 Subject: [PATCH] Avoid warnings. --- tools/ras2tiff.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tools/ras2tiff.c b/tools/ras2tiff.c index cd3cfb46..ce884589 100644 --- a/tools/ras2tiff.c +++ b/tools/ras2tiff.c @@ -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 #include +#ifdef HAVE_UNISTD_H +# include +#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< 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: */