Avoid warnings.
This commit is contained in:
parent
8ae15719de
commit
f6e12093d8
@ -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
|
* Copyright (c) 1988-1997 Sam Leffler
|
||||||
@ -31,6 +31,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "rasterfile.h"
|
#include "rasterfile.h"
|
||||||
#include "tiffio.h"
|
#include "tiffio.h"
|
||||||
|
|
||||||
@ -94,23 +98,23 @@ main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
if (strcmp(h.ras_magic, RAS_MAGIC) == 0) {
|
if (strcmp(h.ras_magic, RAS_MAGIC) == 0) {
|
||||||
#ifndef WORDS_BIGENDIAN
|
#ifndef WORDS_BIGENDIAN
|
||||||
TIFFSwabLong(&h.ras_width);
|
TIFFSwabLong((uint32 *)&h.ras_width);
|
||||||
TIFFSwabLong(&h.ras_height);
|
TIFFSwabLong((uint32 *)&h.ras_height);
|
||||||
TIFFSwabLong(&h.ras_depth);
|
TIFFSwabLong((uint32 *)&h.ras_depth);
|
||||||
TIFFSwabLong(&h.ras_length);
|
TIFFSwabLong((uint32 *)&h.ras_length);
|
||||||
TIFFSwabLong(&h.ras_type);
|
TIFFSwabLong((uint32 *)&h.ras_type);
|
||||||
TIFFSwabLong(&h.ras_maptype);
|
TIFFSwabLong((uint32 *)&h.ras_maptype);
|
||||||
TIFFSwabLong(&h.ras_maplength);
|
TIFFSwabLong((uint32 *)&h.ras_maplength);
|
||||||
#endif
|
#endif
|
||||||
} else if (strcmp(h.ras_magic, RAS_MAGIC_INV) == 0) {
|
} else if (strcmp(h.ras_magic, RAS_MAGIC_INV) == 0) {
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
TIFFSwabLong(&h.ras_width);
|
TIFFSwabLong((uint32 *)&h.ras_width);
|
||||||
TIFFSwabLong(&h.ras_height);
|
TIFFSwabLong((uint32 *)&h.ras_height);
|
||||||
TIFFSwabLong(&h.ras_depth);
|
TIFFSwabLong((uint32 *)&h.ras_depth);
|
||||||
TIFFSwabLong(&h.ras_length);
|
TIFFSwabLong((uint32 *)&h.ras_length);
|
||||||
TIFFSwabLong(&h.ras_type);
|
TIFFSwabLong((uint32 *)&h.ras_type);
|
||||||
TIFFSwabLong(&h.ras_maptype);
|
TIFFSwabLong((uint32 *)&h.ras_maptype);
|
||||||
TIFFSwabLong(&h.ras_maplength);
|
TIFFSwabLong((uint32 *)&h.ras_maplength);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "%s: Not a rasterfile.\n", argv[optind]);
|
fprintf(stderr, "%s: Not a rasterfile.\n", argv[optind]);
|
||||||
@ -144,7 +148,7 @@ main(int argc, char* argv[])
|
|||||||
mapsize = 1<<h.ras_depth;
|
mapsize = 1<<h.ras_depth;
|
||||||
if (h.ras_maplength > mapsize*3) {
|
if (h.ras_maplength > mapsize*3) {
|
||||||
fprintf(stderr,
|
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);
|
argv[optind], h.ras_maplength, mapsize*3);
|
||||||
return (-7);
|
return (-7);
|
||||||
}
|
}
|
||||||
@ -287,3 +291,5 @@ usage(void)
|
|||||||
fprintf(stderr, "%s\n", stuff[i]);
|
fprintf(stderr, "%s\n", stuff[i]);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vim: set ts=8 sts=8 sw=8 noet: */
|
||||||
|
Loading…
Reference in New Issue
Block a user