1From: James Troup <james@nocrew.org> 2Subject: Make the code -Wall clean. 3 4diff -urNad 06.xloadimage.tmp/bright.c 06.xloadimage/bright.c 5--- 06.xloadimage.tmp/bright.c 2003-04-02 23:28:23.000000000 +0100 6+++ 06.xloadimage/bright.c 2003-04-02 23:27:50.000000000 +0100 7@@ -10,6 +10,7 @@ 8 9 #include "copyright.h" 10 #include "image.h" 11+#include "rlelib.h" 12 13 /* alter an image's brightness by a given percentage 14 */ 15@@ -150,6 +151,8 @@ 16 byte *srcptr, *destptr; 17 byte array[256]; 18 19+ newimage = NULL; 20+ 21 goodImage(image, "normalize"); 22 if (BITMAPP(image)) 23 return(image); 24@@ -194,11 +197,11 @@ 25 for (x= 0; x < image->width; x++) { 26 pixval= memToVal(srcptr, image->pixlen); 27 *destptr= array[image->rgb.red[pixval] >> 8]; 28- *destptr++; 29+ destptr++; 30 *destptr= array[image->rgb.green[pixval] >> 8]; 31- *destptr++; 32+ destptr++; 33 *destptr= array[image->rgb.blue[pixval] >> 8]; 34- *destptr++; 35+ destptr++; 36 srcptr += image->pixlen; 37 } 38 break; 39diff -urNad 06.xloadimage.tmp/cmuwmraster.c 06.xloadimage/cmuwmraster.c 40--- 06.xloadimage.tmp/cmuwmraster.c 1993-10-21 22:28:36.000000000 +0100 41+++ 06.xloadimage/cmuwmraster.c 2003-04-02 23:27:50.000000000 +0100 42@@ -16,11 +16,11 @@ 43 44 /* SUPPRESS 558 */ 45 46-int babble(name, headerp) 47+void babble(name, headerp) 48 char *name; 49 struct cmuwm_header *headerp; 50 { 51- printf("%s is a %dx%d %d plane CMU WM raster\n", 52+ printf("%s is a %ldx%ld %ld plane CMU WM raster\n", 53 name, 54 memToVal(headerp->width, sizeof(long)), 55 memToVal(headerp->height, sizeof(long)), 56@@ -108,7 +108,7 @@ 57 { 58 fprintf(stderr,"CMU WM raster %s is of depth %d, must be 1", 59 name, 60- header.depth); 61+ (int) header.depth); 62 return(NULL); 63 } 64 65diff -urNad 06.xloadimage.tmp/compress.c 06.xloadimage/compress.c 66--- 06.xloadimage.tmp/compress.c 2003-04-02 23:28:23.000000000 +0100 67+++ 06.xloadimage/compress.c 2003-04-02 23:27:50.000000000 +0100 68@@ -136,12 +136,13 @@ 69 lfree((byte *)pixel_table); 70 lfree((byte *)pixel_map); 71 72- if (badcount) 73+ if (badcount) { 74 if (verbose) 75 printf("%d out-of-range pixels, ", badcount); 76 else 77 fprintf(stderr, "Warning: %d out-of-range pixels were seen\n", 78 badcount); 79+ } 80 if (verbose) { 81 if ((rgb.used == image->rgb.used) && !badcount) 82 printf("no improvment\n"); 83diff -urNad 06.xloadimage.tmp/copyright.h 06.xloadimage/copyright.h 84--- 06.xloadimage.tmp/copyright.h 1993-10-21 22:28:36.000000000 +0100 85+++ 06.xloadimage/copyright.h 2003-04-02 23:27:50.000000000 +0100 86@@ -20,7 +20,9 @@ 87 */ 88 89 #ifndef __SABER__ 90+#ifndef LINT 91 static char *Copyright= "Copyright 1989, 1993 Jim Frost"; 92+#endif /* LINT */ 93 #endif 94 #define _JIM_COPYRIGHT_ 95 #endif 96diff -urNad 06.xloadimage.tmp/faces.c 06.xloadimage/faces.c 97--- 06.xloadimage.tmp/faces.c 2003-04-02 23:28:23.000000000 +0100 98+++ 06.xloadimage/faces.c 2003-04-02 23:27:50.000000000 +0100 99@@ -178,7 +178,7 @@ 100 char *fullname, *name; 101 { Image *image; 102 103- if (image= facesLoad(fullname, name, 1)) { 104+ if ((image= facesLoad(fullname, name, 1))) { 105 freeImage(image); 106 return(1); 107 } 108diff -urNad 06.xloadimage.tmp/fbm.c 06.xloadimage/fbm.c 109--- 06.xloadimage.tmp/fbm.c 2003-04-02 23:28:23.000000000 +0100 110+++ 06.xloadimage/fbm.c 2003-04-02 23:27:50.000000000 +0100 111@@ -204,7 +204,6 @@ 112 register int x, y, j, k, rowlen, plnlen; 113 unsigned char *pixptr, *cm; 114 unsigned int map_size; 115- extern int Scrn; 116 unsigned char *r, *g, *b; 117 118 if (! (zf= zopen(fullname))) 119diff -urNad 06.xloadimage.tmp/gif.c 06.xloadimage/gif.c 120--- 06.xloadimage.tmp/gif.c 1993-10-21 22:28:37.000000000 +0100 121+++ 06.xloadimage/gif.c 2003-04-02 23:27:50.000000000 +0100 122@@ -468,7 +468,7 @@ 123 * add a new string to the string table 124 */ 125 126-static gifin_add_string(p, e) 127+static void gifin_add_string(p, e) 128 int p; 129 int e; 130 { 131@@ -488,7 +488,7 @@ 132 * semi-graceful fatal error mechanism 133 */ 134 135-static gifin_fatal(msg) 136+static void gifin_fatal(msg) 137 char *msg; 138 { 139 printf("Error reading GIF file: %s\n", msg); 140diff -urNad 06.xloadimage.tmp/gif.h 06.xloadimage/gif.h 141--- 06.xloadimage.tmp/gif.h 1993-10-21 22:28:37.000000000 +0100 142+++ 06.xloadimage/gif.h 2003-04-02 23:27:50.000000000 +0100 143@@ -50,8 +50,8 @@ 144 static int gifin_skip_extension(); 145 static int gifin_read_data_block(); 146 static int gifin_push_string(); 147-static int gifin_add_string(); 148-static int gifin_fatal(); 149+static void gifin_add_string(); 150+static void gifin_fatal(); 151 152 /* #defines, typedefs, and such 153 */ 154diff -urNad 06.xloadimage.tmp/halftone.c 06.xloadimage/halftone.c 155--- 06.xloadimage.tmp/halftone.c 1993-10-21 22:28:37.000000000 +0100 156+++ 06.xloadimage/halftone.c 2003-04-02 23:27:50.000000000 +0100 157@@ -130,23 +130,23 @@ 158 #define GRAYSTEP ((unsigned long)(65536 / GRAYS)) 159 160 static byte DitherBits[GRAYS][4] = { 161- 0xf, 0xf, 0xf, 0xf, 162- 0xe, 0xf, 0xf, 0xf, 163- 0xe, 0xf, 0xb, 0xf, 164- 0xa, 0xf, 0xb, 0xf, 165- 0xa, 0xf, 0xa, 0xf, 166- 0xa, 0xd, 0xa, 0xf, 167- 0xa, 0xd, 0xa, 0x7, 168- 0xa, 0x5, 0xa, 0x7, 169- 0xa, 0x5, 0xa, 0x5, 170- 0x8, 0x5, 0xa, 0x5, 171- 0x8, 0x5, 0x2, 0x5, 172- 0x0, 0x5, 0x2, 0x5, 173- 0x0, 0x5, 0x0, 0x5, 174- 0x0, 0x4, 0x0, 0x5, 175- 0x0, 0x4, 0x0, 0x1, 176- 0x0, 0x0, 0x0, 0x1, 177- 0x0, 0x0, 0x0, 0x0 178+ {0xf, 0xf, 0xf, 0xf}, 179+ {0xe, 0xf, 0xf, 0xf}, 180+ {0xe, 0xf, 0xb, 0xf}, 181+ {0xa, 0xf, 0xb, 0xf}, 182+ {0xa, 0xf, 0xa, 0xf}, 183+ {0xa, 0xd, 0xa, 0xf}, 184+ {0xa, 0xd, 0xa, 0x7}, 185+ {0xa, 0x5, 0xa, 0x7}, 186+ {0xa, 0x5, 0xa, 0x5}, 187+ {0x8, 0x5, 0xa, 0x5}, 188+ {0x8, 0x5, 0x2, 0x5}, 189+ {0x0, 0x5, 0x2, 0x5}, 190+ {0x0, 0x5, 0x0, 0x5}, 191+ {0x0, 0x4, 0x0, 0x5}, 192+ {0x0, 0x4, 0x0, 0x1}, 193+ {0x0, 0x0, 0x0, 0x1}, 194+ {0x0, 0x0, 0x0, 0x0} 195 }; 196 197 /* simple dithering algorithm, really optimized for the 4x4 array 198diff -urNad 06.xloadimage.tmp/image.h 06.xloadimage/image.h 199--- 06.xloadimage.tmp/image.h 2003-04-02 23:28:23.000000000 +0100 200+++ 06.xloadimage/image.h 2003-04-02 23:27:50.000000000 +0100 201@@ -8,6 +8,9 @@ 202 * copyright information. 203 */ 204 205+#ifndef __IMAGE_H__ 206+#define __IMAGE_H__ 207+ 208 #ifdef HAVE_CONFIG_H 209 #include "config.h" 210 #endif 211@@ -320,3 +323,5 @@ 212 #else /* !DEBUG */ 213 #define debug(ARGS) 214 #endif /* !DEBUG */ 215+ 216+#endif /* __IMAGE_H__ */ 217diff -urNad 06.xloadimage.tmp/imagetypes.c 06.xloadimage/imagetypes.c 218--- 06.xloadimage.tmp/imagetypes.c 2003-04-02 23:28:23.000000000 +0100 219+++ 06.xloadimage/imagetypes.c 2003-04-02 23:27:50.000000000 +0100 220@@ -47,7 +47,7 @@ 221 if (opt) { 222 for (a= 0; ImageTypes[a].loader; a++) 223 if (!strncmp(ImageTypes[a].type, opt->info.type, strlen(opt->info.type))) { 224- if (image= ImageTypes[a].loader(fullname, name, verbose)) { 225+ if ((image= ImageTypes[a].loader(fullname, name, verbose))) { 226 zreset(NULL); 227 228 /* this converts a 1-bit RGB image to a bitmap prior to blitting 229@@ -80,7 +80,7 @@ 230 */ 231 for (a= 0; ImageTypes[a].loader; a++) { 232 debug(("Checking %s against loader for %s\n", fullname, ImageTypes[a].name)); 233- if (image= ImageTypes[a].loader(fullname, name, verbose)) { 234+ if ((image= ImageTypes[a].loader(fullname, name, verbose))) { 235 zreset(NULL); 236 237 /* this does the 1-bit conversion as above. 238diff -urNad 06.xloadimage.tmp/imagetypes.h 06.xloadimage/imagetypes.h 239--- 06.xloadimage.tmp/imagetypes.h 2003-04-02 23:28:23.000000000 +0100 240+++ 06.xloadimage/imagetypes.h 2003-04-02 23:27:50.000000000 +0100 241@@ -7,6 +7,9 @@ 242 * jim frost 10.15.89 243 */ 244 245+#ifndef __IMAGETYPES_H__ 246+#define __IMAGETYPES_H__ 247+ 248 Image *niffLoad(); 249 Image *facesLoad(); 250 Image *pbmLoad(); 251@@ -88,35 +91,39 @@ 252 char *type; /* image type name */ 253 char *name; /* name of this image format */ 254 } ImageTypes[] = { 255- niffIdent, niffLoad, niffDump, "niff", "Native Image File Format (NIFF)", 256- sunRasterIdent, sunRasterLoad, NULL, "sunraster", "Sun Rasterfile", 257- gifIdent, gifLoad, NULL, "gif", "GIF Image", 258+ {niffIdent, niffLoad, niffDump, "niff", "Native Image File Format (NIFF)"}, 259+ {sunRasterIdent, sunRasterLoad, NULL, "sunraster", "Sun Rasterfile"}, 260+ {gifIdent, gifLoad, NULL, "gif", "GIF Image"}, 261 #ifdef HAVE_LIBJPEG 262- jpegIdent, jpegLoad, jpegDump, "jpeg", "JFIF-style JPEG Image", 263+ {jpegIdent, jpegLoad, jpegDump, "jpeg", "JFIF-style JPEG Image"}, 264 #endif 265 #ifdef HAVE_LIBTIFF 266- tiffIdent, tiffLoad, tiffDump, "tiff", "TIFF image", 267+ {tiffIdent, tiffLoad, tiffDump, "tiff", "TIFF image"}, 268 #endif 269 #ifdef HAVE_LIBPNG 270- pngIdent, pngLoad, NULL, "png", "PNG image", 271+ {pngIdent, pngLoad, NULL, "png", "PNG image"}, 272 #endif 273- fbmIdent, fbmLoad, NULL, "fbm", "FBM Image", 274- cmuwmIdent, cmuwmLoad, NULL, "cmuraster", "CMU WM Raster", 275- pbmIdent, pbmLoad, pbmDump, "pbm", "Portable Bit Map (PBM, PGM, PPM)", 276- facesIdent, facesLoad, NULL, "faces", "Faces Project", 277- rleIdent, rleLoad, NULL, "rle", "Utah RLE Image", 278- xwdIdent, xwdLoad, NULL, "xwd", "X Window Dump", 279- vffIdent, vffLoad, NULL, "vff", "Sun Visualization File Format", 280- mcidasIdent, mcidasLoad, NULL, "mcidas", "McIDAS areafile", 281+ {fbmIdent, fbmLoad, NULL, "fbm", "FBM Image"}, 282+ {cmuwmIdent, cmuwmLoad, NULL, "cmuraster", "CMU WM Raster"}, 283+ {pbmIdent, pbmLoad, pbmDump, "pbm", "Portable Bit Map (PBM, PGM, PPM)"}, 284+ {facesIdent, facesLoad, NULL, "faces", "Faces Project"}, 285+ {rleIdent, rleLoad, NULL, "rle", "Utah RLE Image"}, 286+ {xwdIdent, xwdLoad, NULL, "xwd", "X Window Dump"}, 287+ {vffIdent, vffLoad, NULL, "vff", "Sun Visualization File Format"}, 288+ {mcidasIdent, mcidasLoad, NULL, "mcidas", "McIDAS areafile"}, 289 #if 0 290- pdsIdent, pdsLoad, NULL, "pds", "PDS/VICAR Image", 291+ {pdsIdent, pdsLoad, NULL, "pds", "PDS/VICAR Image"}, 292 #else 293- vicarIdent, vicarLoad, NULL, "vicar", "VICAR Image", 294+ {vicarIdent, vicarLoad, NULL, "vicar", "VICAR Image"}, 295 #endif 296- pcxIdent, pcxLoad, NULL, "pcx", "PC Paintbrush Image", 297- imgIdent, imgLoad, NULL, "gem", "GEM Bit Image", 298- macIdent, macLoad, NULL, "macpaint", "MacPaint Image", 299- xpixmapIdent, xpixmapLoad, NULL, "xpm", "X Pixmap", 300- xbitmapIdent, xbitmapLoad, NULL, "xbm", "X Bitmap", 301- NULL, NULL, NULL, NULL, NULL 302+ {pcxIdent, pcxLoad, NULL, "pcx", "PC Paintbrush Image"}, 303+ {imgIdent, imgLoad, NULL, "gem", "GEM Bit Image"}, 304+ {macIdent, macLoad, NULL, "macpaint", "MacPaint Image"}, 305+ {xpixmapIdent, xpixmapLoad, NULL, "xpm", "X Pixmap"}, 306+ {xbitmapIdent, xbitmapLoad, NULL, "xbm", "X Bitmap"}, 307+ {NULL, NULL, NULL, NULL, NULL} 308 }; 309+ 310+void dumpImage (Image *image, char *type, char *filename, int verbose); 311+ 312+#endif /* __IMAGETYPES_H__ */ 313diff -urNad 06.xloadimage.tmp/img.c 06.xloadimage/img.c 314--- 06.xloadimage.tmp/img.c 2003-04-02 23:28:23.000000000 +0100 315+++ 06.xloadimage/img.c 2003-04-02 23:27:50.000000000 +0100 316@@ -71,11 +71,15 @@ 317 void (*transf) (); 318 319 static int vdi2pli(); 320+#ifdef UNUSED_FUNCTIONS 321 static int pli2vdi(); 322+#endif /* UNUSED_FUNCTIONS */ 323 324 static void transf0 (); 325 static void transf1 (); 326+#ifdef UNUSED_FUNCTIONS 327 static void transf2 (); 328+#endif /* UNUSED_FUNCTIONS */ 329 static void transf3 (); 330 static void xread_img (); 331 static void xread_line (); 332@@ -89,8 +93,9 @@ 333 unsigned int ScanByteBreite, max_planes, 334 pattern_len, plane, x, y, ByteNr, height; 335 unsigned char *ptr, Muster[ALL_PLANES][BUFSIZ], tmp[BUFSIZ]; 336+#ifdef UNUSED_FUNCTIONS 337 static unsigned char *bitplane[ALL_PLANES], *lastbitplane; 338- 339+#endif /* UNUSED_FUNCTIONS */ 340 341 342 static void transf0(bitimage, plane, value, planes) 343@@ -128,7 +133,7 @@ 344 } 345 346 347- 348+#ifdef UNUSED_FUNCTIONS 349 static void transf2(bitimage, plane, value, planes) 350 unsigned char *bitimage; 351 unsigned int plane; 352@@ -146,6 +151,7 @@ 353 bitplane[plane][x] = value; 354 x++; 355 } 356+#endif /* UNUSED_FUNCTIONS */ 357 358 static void transf3(bitimage, plane, value, planes) 359 unsigned char *bitimage; 360@@ -367,9 +373,10 @@ 361 ZFILE *file; 362 long size = 0; 363 int w, h, nplanes; 364- char extention[5]; 365 366 #if 0 367+ char extention[5]; 368+ 369 strncpy (extention, name+strlen(name)-4, 4); 370 extention[4] = '\0'; 371 if (strcmp(extention, ".IMG") != 0 && strcmp(extention, ".img") != 0) 372@@ -402,7 +409,7 @@ 373 printf("%s is a %dx%d monochrome IMG-file\n",name , w, h); 374 else 375 if (nplanes != 24) 376- printf("%s is a %dx%d IMG-file with %ld colors\n",name , w, h, 377+ printf("%s is a %dx%d IMG-file with %d colors\n",name , w, h, 378 (1 << nplanes)); 379 else 380 printf("%s is a %dx%d %d-bit IMG-file\n",name , w, h, nplanes); 381@@ -564,7 +571,6 @@ 382 ZFILE *file; 383 long size = 0; 384 int w, h, nplanes; 385- char extention[5]; 386 387 if ((file = zopen(name)) == NULL) 388 { 389@@ -593,7 +599,7 @@ 390 391 printf("%s\n is a %dx%d ",name, w, h); 392 if (nplanes != 24) 393- printf("RGB XIMG-file with %ld colors\n", 1<<nplanes); 394+ printf("RGB XIMG-file with %d colors\n", 1<<nplanes); 395 else 396 printf("24-bit XIMG-file\n"); 397 return (1); 398@@ -602,8 +608,6 @@ 399 static int vdi2pli(vdi, plimax) 400 int vdi, plimax; 401 { 402- extern unsigned char indexToCode[]; 403- extern int work_ext[]; 404 static char vdi2pli[] = {0, 15, 1, 2, 4, 6, 3, 5, 7, 8, 9, 10, 12, 14, 11, 13 }; 405 406 if (vdi == 1) 407@@ -614,7 +618,7 @@ 408 } 409 410 411- 412+#ifdef UNUSED_FUNCTIONS 413 static int pli2vdi(pli, plimax) 414 int pli, plimax; 415 { 416@@ -626,6 +630,7 @@ 417 return(pli); 418 return(pli2vdi[pli]); 419 } 420+#endif /* UNUSED_FUNCTIONS */ 421 422 static Image *load_ximg(name) 423 char *name; 424diff -urNad 06.xloadimage.tmp/kljcpyrght.h 06.xloadimage/kljcpyrght.h 425--- 06.xloadimage.tmp/kljcpyrght.h 1993-10-21 22:28:38.000000000 +0100 426+++ 06.xloadimage/kljcpyrght.h 2003-04-02 23:27:50.000000000 +0100 427@@ -22,7 +22,9 @@ 428 ****/ 429 430 #ifndef __SABER__ 431+#ifndef LINT 432 static char *KLJCopyright = "Copyright 1989, 1990 Kirk L. Johnson"; 433+#endif /* LINT */ 434 #endif 435 #define _KLJ_COPYRIGHT_ 436 #endif 437diff -urNad 06.xloadimage.tmp/mcidas.c 06.xloadimage/mcidas.c 438--- 06.xloadimage.tmp/mcidas.c 1993-10-21 22:28:39.000000000 +0100 439+++ 06.xloadimage/mcidas.c 2003-04-02 23:27:50.000000000 +0100 440@@ -94,7 +94,7 @@ 441 char *name; 442 struct area_dir *dir; 443 { 444- printf("%s is a %dx%d McIDAS areafile from %s at %s (%d, %d) (%d, %d)\n", 445+ printf("%s is a %ldx%ld McIDAS areafile from %s at %s (%ld, %ld) (%ld, %ld)\n", 446 name, 447 dir->esiz, dir->lsiz, 448 mc_sensor(dir->satid), 449@@ -163,7 +163,6 @@ 450 struct navigation nav; 451 Image *image; 452 unsigned int y; 453- int doswap = 0 ; 454 455 if (! (zf= zopen(fullname))) { 456 perror("mcidasLoad"); 457@@ -218,7 +217,7 @@ 458 */ 459 zread(zf, image->data, dir.esiz * dir.lsiz * dir.zsiz) ; 460 if (dir.bands > 1) 461- printf("Warning: Only showing first of %d bands\n", dir.bands); 462+ printf("Warning: Only showing first of %ld bands\n", dir.bands); 463 464 zclose(zf); 465 image->title= dupString(name); 466diff -urNad 06.xloadimage.tmp/misc.c 06.xloadimage/misc.c 467--- 06.xloadimage.tmp/misc.c 2003-04-02 23:28:23.000000000 +0100 468+++ 06.xloadimage/misc.c 2003-04-02 23:27:50.000000000 +0100 469@@ -10,6 +10,7 @@ 470 471 #include "copyright.h" 472 #include "xloadimage.h" 473+#include "misc.h" 474 #ifdef VMS 475 #include "patchlevel." 476 #else 477@@ -151,7 +152,7 @@ 478 { char errortext[BUFSIZ]; 479 480 XGetErrorText(disp, error->error_code, errortext, BUFSIZ); 481- fprintf(stderr, "xloadimage: X Error: %s on 0x%x\n", 482+ fprintf(stderr, "xloadimage: X Error: %s on 0x%lx\n", 483 errortext, error->resourceid); 484 if (_Xdebug) /* if -debug mode is enabled, dump a core when we hit this */ 485 abort(); 486diff -urNad 06.xloadimage.tmp/misc.h 06.xloadimage/misc.h 487--- 06.xloadimage.tmp/misc.h 1970-01-01 01:00:00.000000000 +0100 488+++ 06.xloadimage/misc.h 2003-04-02 23:27:50.000000000 +0100 489@@ -0,0 +1 @@ 490+void usageHelp() __attribute__ ((noreturn)); 491diff -urNad 06.xloadimage.tmp/mit.cpyrght 06.xloadimage/mit.cpyrght 492--- 06.xloadimage.tmp/mit.cpyrght 1993-10-21 22:29:06.000000000 +0100 493+++ 06.xloadimage/mit.cpyrght 2003-04-02 23:27:50.000000000 +0100 494@@ -21,8 +21,10 @@ 495 */ 496 497 #ifndef __SABER__ 498+#ifndef LINT 499 static char *MitCopyright= 500 "Copyright 1989 Massachusetts Institute of Technology"; 501+#endif /* LINT */ 502 #endif 503 #define _MIT_COPYRIGHT_ 504 #endif 505diff -urNad 06.xloadimage.tmp/new.c 06.xloadimage/new.c 506--- 06.xloadimage.tmp/new.c 2003-04-02 23:28:23.000000000 +0100 507+++ 06.xloadimage/new.c 2003-04-02 23:27:50.000000000 +0100 508@@ -51,8 +51,8 @@ 509 /* 28 */ 268435456, 510 /* 29 */ 536870912, 511 /* 30 */ 1073741824, 512- /* 31 */ 2147483648, 513- /* 32 */ 2147483648 /* bigger than unsigned int; this is good enough */ 514+ /* 31 */ 2147483648UL, 515+ /* 32 */ 2147483648UL /* bigger than unsigned int; this is good enough */ 516 }; 517 518 unsigned long colorsToDepth(ncolors) 519diff -urNad 06.xloadimage.tmp/niff.c 06.xloadimage/niff.c 520--- 06.xloadimage.tmp/niff.c 2003-04-02 23:28:23.000000000 +0100 521+++ 06.xloadimage/niff.c 2003-04-02 23:27:50.000000000 +0100 522@@ -15,25 +15,26 @@ 523 #include "niff.h" 524 525 static void babble(name, header, title) 526+ char *name; 527 struct niff_header *header; 528 char *title; 529 { 530- printf("%s is a %dx%d ", name, 531+ printf("%s is a %ldx%ld ", name, 532 memToVal(header->width, 4), 533 memToVal(header->height, 4)); 534 if (memToVal(header->version, 4) != NIFF_VERSION) 535- printf("version %d ", memToVal(header->version, 4)); 536+ printf("version %ld ", memToVal(header->version, 4)); 537 printf("NIFF "); 538 switch (header->type) { 539 case NIFF_BITMAP: 540 printf("bitmap image"); 541 break; 542 case NIFF_RGB: 543- printf("%d-bit RGB image with %d colors", 544+ printf("%ld-bit RGB image with %ld colors", 545 memToVal(header->depth, 4), memToVal(header->cmap_size, 4)); 546 break; 547 case NIFF_TRUE: 548- printf("%d-bit true color image", memToVal(header->depth, 4)); 549+ printf("%ld-bit true color image", memToVal(header->depth, 4)); 550 break; 551 default: 552 printf("image with an unknown type"); 553diff -urNad 06.xloadimage.tmp/options.c 06.xloadimage/options.c 554--- 06.xloadimage.tmp/options.c 2003-04-02 23:28:23.000000000 +0100 555+++ 06.xloadimage/options.c 2003-04-02 23:27:50.000000000 +0100 556@@ -12,6 +12,8 @@ 557 #include <stdio.h> 558 #include "image.h" 559 #include "options.h" 560+#include "misc.h" 561+#include "xloadimage.h" 562 563 #undef MIN 564 #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 565diff -urNad 06.xloadimage.tmp/options.h 06.xloadimage/options.h 566--- 06.xloadimage.tmp/options.h 1993-10-28 17:01:00.000000000 +0000 567+++ 06.xloadimage/options.h 2003-04-02 23:27:50.000000000 +0100 568@@ -8,6 +8,9 @@ 569 * copyright information. 570 */ 571 572+#ifndef __OPTIONS_H__ 573+#define __OPTIONS_H__ 574+ 575 /* enum with the options in it. If you add one to this you also have to 576 * add its information to Options[] in options.c before it becomes available. 577 */ 578@@ -98,3 +101,8 @@ 579 Image *loadImage _ArgProto((OptionSet *globalopts, OptionSet *options, 580 char *name, unsigned int verbose)); 581 void identifyImage _ArgProto((char *name)); 582+ 583+void processOptions (int argc, char *argv[], OptionSet **rglobal, OptionSet **rimage); 584+void addOption (OptionSet *optset, Option *newopt); 585+ 586+#endif /* __OPTIONS_H__ */ 587diff -urNad 06.xloadimage.tmp/pcx.c 06.xloadimage/pcx.c 588--- 06.xloadimage.tmp/pcx.c 1993-10-28 16:22:12.000000000 +0000 589+++ 06.xloadimage/pcx.c 2003-04-02 23:27:50.000000000 +0100 590@@ -259,7 +259,6 @@ 591 ZFILE *zf; 592 Image *image; 593 { 594- int pl; 595 switch (PCXH->Zbpp) { /* What kind of plane do we have ? */ 596 case 1 : /* Bit planes */ 597 if (PCXH->Znplanes == 1) /* Only one : Read it */ 598@@ -298,7 +297,7 @@ 599 unsigned int verbose; 600 { 601 ZFILE *zf; 602- unsigned int i, ret; 603+ unsigned int i; 604 int xmin; 605 int xmax; 606 int ymin; 607diff -urNad 06.xloadimage.tmp/pdsuncomp.c 06.xloadimage/pdsuncomp.c 608--- 06.xloadimage.tmp/pdsuncomp.c 1993-10-28 16:20:18.000000000 +0000 609+++ 06.xloadimage/pdsuncomp.c 2003-04-02 23:27:50.000000000 +0100 610@@ -78,7 +78,6 @@ 611 register NODE **np; /* Node list pointer */ 612 613 register long int num_freq; /* Number non-zero frequencies in histogram */ 614- long int sum; /* Sum of all frequencies */ 615 616 register short int num_nodes; /* Counter for DN initialization */ 617 register short int cnt; /* Miscellaneous counter */ 618@@ -114,6 +113,7 @@ 619 unsigned char *cp = (unsigned char *) hist++; 620 unsigned long int j; 621 short int i; 622+ j = 0; 623 for (i=4 ; --i >= 0 ; j = (j << 8) | *(cp+i)) 624 ; 625 626@@ -242,6 +242,7 @@ 627 * 16-AUG-89 Kris Becker USGS, Flagstaff Original Version 628 */ 629 630+#ifdef UNUSED_FUNCTIONS 631 static void free_tree(nfreed) 632 long int *nfreed; /* Return of total count of nodes freed. */ 633 { 634@@ -253,6 +254,7 @@ 635 *nfreed = free_node(tree,total_free); 636 return; 637 } 638+#endif /* UNUSED_FUNCTIONS */ 639 640 /* free_node - deallocates an allocated NODE pointer 641 * 642@@ -351,7 +353,6 @@ 643 char *ibuf; 644 { 645 int length,result,nlen; 646- unsigned int value; 647 unsigned char buf[2]; 648 649 length = 0; 650@@ -361,7 +362,7 @@ 651 return(length); 652 } 653 654-skip_record(zf) 655+void skip_record(zf) 656 ZFILE *zf; 657 { 658 unsigned int value; 659@@ -384,9 +385,6 @@ 660 int type; 661 { 662 if (type == PDSVARIABLE) { 663- char buf[2]; 664- int len; 665- char *dummy; 666 667 Decompressing= 1; /* flag pdsRead() to do decompressions */ 668 669diff -urNad 06.xloadimage.tmp/reduce.c 06.xloadimage/reduce.c 670--- 06.xloadimage.tmp/reduce.c 1993-10-21 22:28:40.000000000 +0100 671+++ 06.xloadimage/reduce.c 2003-04-02 23:27:50.000000000 +0100 672@@ -88,7 +88,7 @@ 673 /* predicate functions for qsort 674 */ 675 676-static sortRGB(p1, p2) 677+static int sortRGB(p1, p2) 678 unsigned short *p1, *p2; 679 { unsigned int red1, green1, blue1, red2, green2, blue2; 680 681@@ -115,7 +115,7 @@ 682 return(1); 683 } 684 685-static sortRBG(p1, p2) 686+static int sortRBG(p1, p2) 687 unsigned short *p1, *p2; 688 { unsigned int red1, green1, blue1, red2, green2, blue2; 689 690@@ -142,7 +142,7 @@ 691 return(1); 692 } 693 694-static sortGRB(p1, p2) 695+static int sortGRB(p1, p2) 696 unsigned short *p1, *p2; 697 { unsigned int red1, green1, blue1, red2, green2, blue2; 698 699@@ -169,7 +169,7 @@ 700 return(1); 701 } 702 703-static sortGBR(p1, p2) 704+static int sortGBR(p1, p2) 705 unsigned short *p1, *p2; 706 { unsigned int red1, green1, blue1, red2, green2, blue2; 707 708@@ -196,7 +196,7 @@ 709 return(1); 710 } 711 712-static sortBRG(p1, p2) 713+static int sortBRG(p1, p2) 714 unsigned short *p1, *p2; 715 { unsigned int red1, green1, blue1, red2, green2, blue2; 716 717@@ -223,7 +223,7 @@ 718 return(1); 719 } 720 721-static sortBGR(p1, p2) 722+static int sortBGR(p1, p2) 723 unsigned short *p1, *p2; 724 { unsigned int red1, green1, blue1, red2, green2, blue2; 725 726@@ -254,7 +254,7 @@ 727 * the color area in the list of color areas. 728 */ 729 730-static insertColorArea(pixel_counts, rlargest, rsmallest, area) 731+static void insertColorArea(pixel_counts, rlargest, rsmallest, area) 732 unsigned long *pixel_counts; 733 struct color_area **rlargest, **rsmallest, *area; 734 { int a; 735@@ -368,7 +368,7 @@ 736 { unsigned long pixel_counts[32768]; /* pixel occurrance histogram */ 737 unsigned short pixel_array[32768]; 738 unsigned long count, midpoint; 739- int x, y, num_pixels, allocated, depth, ncolors; 740+ int x, y, num_pixels, allocated, depth; 741 byte *pixel, *dpixel; 742 struct color_area *areas, *largest_area, *smallest_area; 743 struct color_area *new_area, *old_area; 744diff -urNad 06.xloadimage.tmp/rle.c 06.xloadimage/rle.c 745--- 06.xloadimage.tmp/rle.c 1993-11-08 21:04:56.000000000 +0000 746+++ 06.xloadimage/rle.c 2003-04-02 23:27:50.000000000 +0100 747@@ -14,6 +14,7 @@ 748 #include <stdio.h> 749 #include "image.h" 750 #include "rle.h" 751+#include "rlelib.h" 752 753 #undef DEBUG 754 #undef debug 755@@ -394,7 +395,7 @@ 756 #define DMAP(v,x,y) (modN[v]>magic[x][y] ? divN[v] + 1 : divN[v]) 757 758 /* run the black and white through its map */ 759-bw_m_line(dp,number) 760+void bw_m_line(dp,number) 761 int number; 762 register unsigned char *dp; 763 { 764@@ -408,7 +409,7 @@ 765 } 766 767 /* convert a colour line with map to 8 bits per pixel */ 768-c_m_line(dp,number,line) 769+void c_m_line(dp,number,line) 770 int number,line; 771 register unsigned char *dp; 772 { 773diff -urNad 06.xloadimage.tmp/rle.h 06.xloadimage/rle.h 774--- 06.xloadimage.tmp/rle.h 1993-10-21 22:28:40.000000000 +0100 775+++ 06.xloadimage/rle.h 2003-04-02 23:27:50.000000000 +0100 776@@ -29,6 +29,9 @@ 777 * 88/07/13 Graeme W. Gill 778 */ 779 780+#ifndef __RLE_H__ 781+#define __RLE_H__ 782+ 783 enum sv_dispatch { 784 RUN_DISPATCH 785 }; 786@@ -182,3 +185,7 @@ 787 extern int dith_np2; /* set non-zero to use non-power_of_2 matrix size */ 788 extern int dith_size; /* effective size of the dither matrix chosen */ 789 790+void bw_m_line (unsigned char *dp, int number); 791+void c_m_line(unsigned char *dp, int number, int line); 792+ 793+#endif /* __RLE_H__ */ 794diff -urNad 06.xloadimage.tmp/rlelib.c 06.xloadimage/rlelib.c 795--- 06.xloadimage.tmp/rlelib.c 2003-04-02 23:28:23.000000000 +0100 796+++ 06.xloadimage/rlelib.c 2003-04-02 23:27:50.000000000 +0100 797@@ -17,6 +17,7 @@ 798 799 #include "image.h" /* need ZFILE definition */ 800 #include "rle.h" 801+#include "rlelib.h" 802 803 /* SUPPRESS 530 */ 804 /* SUPPRESS 558 */ 805@@ -710,11 +711,12 @@ 806 { 807 for ( ; *n != '\0' && *n != '=' && *n == *v; n++, v++ ) 808 ; 809- if (*n == '\0' || *n == '=') 810+ if (*n == '\0' || *n == '=') { 811 if ( *v == '\0' ) 812 return v; 813 else if ( *v == '=' ) 814 return ++v; 815+ } 816 817 return NULL; 818 } 819@@ -820,7 +822,7 @@ 820 * Algorithm: 821 * Read in the setup info and fill in sv_globals. 822 */ 823-rle_get_setup( globals ) 824+int rle_get_setup( globals ) 825 struct sv_globals * globals; 826 { 827 struct XtndRsetup setup; 828@@ -1100,7 +1102,7 @@ 829 * decoding the instructions into scanline data. 830 */ 831 832-rle_getrow( globals, scanline ) 833+int rle_getrow( globals, scanline ) 834 struct sv_globals * globals; 835 rle_pixel *scanline[]; 836 { 837@@ -1230,7 +1232,7 @@ 838 839 scanc += nc; 840 scan_x += nc; 841- if ( debug_f ) 842+ if ( debug_f ) { 843 if ( SV_BIT( *globals, channel ) ) 844 { 845 rle_pixel * cp = scanc - nc; 846@@ -1241,6 +1243,7 @@ 847 } 848 else 849 fprintf( stderr, "Pixel data %d (to %d)\n", nc, scan_x ); 850+ } 851 break; 852 853 case RRunDataOp: 854@@ -1586,7 +1589,7 @@ 855 * Algorithm: 856 * Chose sub cell of 16 by 16 magic square 857 */ 858-make_magic( size, magic ) 859+void make_magic( size, magic ) 860 int size; 861 int magic[16][16]; 862 { 863@@ -1630,7 +1633,7 @@ 864 * Outputs: 865 * Changes gamma array entries. 866 */ 867-make_gamma( gamma, gammamap ) 868+void make_gamma( gamma, gammamap ) 869 double gamma; 870 int gammamap[256]; 871 { 872@@ -1667,7 +1670,7 @@ 873 * Algorithm: 874 * see "Note:" in dithermap comment. 875 */ 876-dithergb( x, y, r, g, b, levels, divN, modN, magic ) 877+int dithergb( x, y, r, g, b, levels, divN, modN, magic ) 878 int divN[256]; 879 int modN[256]; 880 int magic[16][16]; 881@@ -1697,7 +1700,7 @@ 882 * Algorithm: 883 * see "Note:" in bwdithermap comment. 884 */ 885-ditherbw( x, y, val, divN, modN, magic ) 886+int ditherbw( x, y, val, divN, modN, magic ) 887 int divN[256]; 888 int modN[256]; 889 int magic[16][16]; 890diff -urNad 06.xloadimage.tmp/rlelib.h 06.xloadimage/rlelib.h 891--- 06.xloadimage.tmp/rlelib.h 1970-01-01 01:00:00.000000000 +0100 892+++ 06.xloadimage/rlelib.h 2003-04-02 23:27:50.000000000 +0100 893@@ -0,0 +1,6 @@ 894+#include "rle.h" 895+ 896+int rle_get_setup (struct sv_globals *globals); 897+int rle_getrow (struct sv_globals *globals, rle_pixel *scanline[]); 898+void make_gamma (double gamma, int gammamap[256]); 899+void make_magic (int size, int magic[16][16]); 900diff -urNad 06.xloadimage.tmp/root.c 06.xloadimage/root.c 901--- 06.xloadimage.tmp/root.c 1993-11-08 21:05:20.000000000 +0000 902+++ 06.xloadimage/root.c 2003-04-02 23:27:50.000000000 +0100 903@@ -78,7 +78,7 @@ 904 if ((XGetWindowProperty(dpy, w, atom, 0, 1, 1/*delete*/, 905 AnyPropertyType, &actual_type, &format, (unsigned long *)&nitems, 906 (unsigned long *)&bytes_after, (unsigned char **)&pm) == Success) && 907- nitems == 1) 908+ nitems == 1) { 909 if ((actual_type == XA_PIXMAP) && (format == 32) && 910 (nitems == 1) && (bytes_after == 0)) { 911 /* blast it away */ 912@@ -90,6 +90,7 @@ 913 "%s: warning: invalid format encountered for property %s\n", 914 RETAIN_PROP_NAME, "xloadimage"); 915 } 916+ } 917 } 918 919 #if FIND_DEC_ROOTWINDOW 920@@ -151,9 +152,11 @@ 921 Window root, rootReturn, parentReturn, *children; 922 unsigned int numChildren; 923 int i; 924+#ifdef FIND_DEC_ROOTWINDOW 925 char *s; 926+#endif /* FIND_DEC_ROOTWINDOW */ 927 928- if (opt= getOption(options, WINDOWID)) 929+ if ((opt= getOption(options, WINDOWID))) 930 root= opt->info.windowid; 931 else { 932 root = RootWindow(disp, scrn); 933diff -urNad 06.xloadimage.tmp/rotate.c 06.xloadimage/rotate.c 934--- 06.xloadimage.tmp/rotate.c 1993-10-21 22:28:41.000000000 +0100 935+++ 06.xloadimage/rotate.c 2003-04-02 23:27:50.000000000 +0100 936@@ -52,7 +52,6 @@ 937 int bit[8]; /* Array of hex values */ 938 int x, y; 939 int i, b; 940- int newx, newy; 941 int newi, newb; 942 byte **yptr; 943 944@@ -74,6 +73,7 @@ 945 sprintf(buf, "%s (rotated by %d degrees)", simage->title, degrees); 946 947 image1 = simage; 948+ image2 = NULL; 949 do { 950 degrees -= 90; 951 switch (image1->type) { 952diff -urNad 06.xloadimage.tmp/send.c 06.xloadimage/send.c 953--- 06.xloadimage.tmp/send.c 2003-04-02 23:28:23.000000000 +0100 954+++ 06.xloadimage/send.c 2003-04-02 23:27:50.000000000 +0100 955@@ -21,7 +21,7 @@ 956 char buf[MAXERRORLEN+1]; 957 GotError = 1; 958 XGetErrorText(disp, pErrorEvent->error_code, buf, MAXERRORLEN); 959- printf("serial #%d (request code %d) Got Error %s\n", 960+ printf("serial #%ld (request code %d) Got Error %s\n", 961 pErrorEvent->serial, 962 pErrorEvent->request_code, 963 buf); 964@@ -166,6 +166,8 @@ 965 unsigned int redbottom, greenbottom, bluebottom; 966 unsigned int redtop, greentop, bluetop; 967 968+ redtop = greentop = bluetop = 0; 969+ 970 redvalue= (Pixel *)lmalloc(sizeof(Pixel) * 256); 971 greenvalue= (Pixel *)lmalloc(sizeof(Pixel) * 256); 972 bluevalue= (Pixel *)lmalloc(sizeof(Pixel) * 256); 973@@ -300,7 +302,7 @@ 974 xcolor.red= *(image->rgb.red + a); 975 xcolor.green= *(image->rgb.green + a); 976 xcolor.blue= *(image->rgb.blue + a); 977- if (! XAllocColor(disp, ximageinfo->cmap, &xcolor)) 978+ if (! XAllocColor(disp, ximageinfo->cmap, &xcolor)) { 979 if ((visual->class == StaticColor) || 980 (visual->class == StaticGray) || 981 (visual->class == TrueColor) || 982@@ -319,6 +321,7 @@ 983 newmap= 1; 984 break; 985 } 986+ } 987 *(index + a)= xcolor.pixel; 988 } 989 } 990@@ -602,8 +605,6 @@ 991 int src_x, src_y, dst_x, dst_y; 992 unsigned int w, h; 993 { XGCValues gcv; 994- int a, orig_depth; 995- char *orig_data; 996 997 /* build and cache the GC 998 */ 999diff -urNad 06.xloadimage.tmp/sunraster.c 06.xloadimage/sunraster.c 1000--- 06.xloadimage.tmp/sunraster.c 2003-04-02 23:28:23.000000000 +0100 1001+++ 06.xloadimage/sunraster.c 2003-04-02 23:27:50.000000000 +0100 1002@@ -42,7 +42,7 @@ 1003 default: 1004 printf(" unknown-type"); 1005 } 1006- printf(" %dx%d", memToVal(header->width, 4), memToVal(header->height, 4)); 1007+ printf(" %ldx%ld", memToVal(header->width, 4), memToVal(header->height, 4)); 1008 1009 switch (memToVal(header->depth, 4)) { 1010 case 1: 1011@@ -256,7 +256,7 @@ 1012 /* 1013 * Handle color... 1014 */ 1015- if (mapsize= memToVal(header.maplen, 4)) { 1016+ if ((mapsize= memToVal(header.maplen, 4))) { 1017 map= lmalloc(mapsize); 1018 if (zread(zf, map, mapsize) < mapsize) { 1019 printf("sunRasterLoad: Bad read on colormap\n"); 1020diff -urNad 06.xloadimage.tmp/tgncpyrght.h 06.xloadimage/tgncpyrght.h 1021--- 06.xloadimage.tmp/tgncpyrght.h 1993-10-21 22:28:42.000000000 +0100 1022+++ 06.xloadimage/tgncpyrght.h 2003-04-02 23:27:50.000000000 +0100 1023@@ -22,7 +22,9 @@ 1024 ****/ 1025 1026 #ifndef __SABER__ 1027+#ifndef LINT 1028 static char *TGNCopyright = "Copyright (C) 1991 Tim Northrup"; 1029+#endif /* LINT */ 1030 #endif 1031 #define _TGN_COPYRIGHT_ 1032 #endif 1033diff -urNad 06.xloadimage.tmp/tiff.c 06.xloadimage/tiff.c 1034--- 06.xloadimage.tmp/tiff.c 2003-04-02 23:28:23.000000000 +0100 1035+++ 06.xloadimage/tiff.c 2003-04-02 23:27:50.000000000 +0100 1036@@ -6,6 +6,7 @@ 1037 */ 1038 1039 #include "image.h" 1040+#include "options.h" 1041 #ifdef HAVE_LIBTIFF 1042 1043 #include <tiffio.h> 1044diff -urNad 06.xloadimage.tmp/uufilter.c 06.xloadimage/uufilter.c 1045--- 06.xloadimage.tmp/uufilter.c 2003-04-02 23:28:23.000000000 +0100 1046+++ 06.xloadimage/uufilter.c 2003-04-02 23:27:50.000000000 +0100 1047@@ -163,6 +163,7 @@ 1048 */ 1049 bp = &buf[1]; 1050 phase = 0; 1051+ outchar = 0; 1052 while (len > 0) { 1053 unsigned char c; 1054 1055diff -urNad 06.xloadimage.tmp/vff.c 06.xloadimage/vff.c 1056--- 06.xloadimage.tmp/vff.c 2003-04-02 23:28:23.000000000 +0100 1057+++ 06.xloadimage/vff.c 2003-04-02 23:27:50.000000000 +0100 1058@@ -361,7 +361,7 @@ 1059 return(0); /* so that we try and see what was wrong */ 1060 } 1061 1062-vffIdent(fullname, name) 1063+int vffIdent(fullname, name) 1064 char *fullname, *name; 1065 { 1066 1067diff -urNad 06.xloadimage.tmp/vicar.c 06.xloadimage/vicar.c 1068--- 06.xloadimage.tmp/vicar.c 2003-04-02 23:28:23.000000000 +0100 1069+++ 06.xloadimage/vicar.c 2003-04-02 23:27:51.000000000 +0100 1070@@ -107,14 +107,12 @@ 1071 char *fullname, *name; 1072 unsigned int verbose; 1073 { 1074- char c; 1075- int i,j; 1076+ int i; 1077 unsigned int mapsize, size; 1078 Image *image; 1079 byte *lineptr; 1080 byte *map; 1081 byte *mapred,*mapgreen,*mapblue; 1082- byte *buf; 1083 ZFILE *zf; 1084 1085 if ( vicarIdent(fullname,name,verbose) == 0 ) 1086diff -urNad 06.xloadimage.tmp/window.c 06.xloadimage/window.c 1087--- 06.xloadimage.tmp/window.c 2003-04-02 23:28:23.000000000 +0100 1088+++ 06.xloadimage/window.c 2003-04-02 23:27:51.000000000 +0100 1089@@ -227,7 +227,7 @@ 1090 int scrn; 1091 Visual *visual; 1092 { XSetWindowAttributes swa; 1093- static cmap_atom= None; 1094+ static Atom cmap_atom= None; 1095 Window cmap_windows[2]; 1096 1097 if (cmap_atom == None) 1098@@ -278,7 +278,7 @@ 1099 * want to change this. 1100 */ 1101 1102- if (t= rindex(buf, '/')) { 1103+ if ((t= rindex(buf, '/'))) { 1104 for (s= buf, t++; *t; s++, t++) 1105 *s= *t; 1106 *s= '\0'; 1107@@ -296,14 +296,14 @@ 1108 int class; /* numerical value of class */ 1109 char *name; /* actual name of class */ 1110 } VisualClassName[] = { 1111- TrueColor, "TrueColor", 1112- DirectColor, "DirectColor", 1113- PseudoColor, "PseudoColor", 1114- StaticColor, "StaticColor", 1115- GrayScale, "GrayScale", 1116- StaticGray, "StaticGray", 1117- StaticGray, "StaticGrey", 1118- -1, NULL 1119+ {TrueColor, "TrueColor"}, 1120+ {DirectColor, "DirectColor"}, 1121+ {PseudoColor, "PseudoColor"}, 1122+ {StaticColor, "StaticColor"}, 1123+ {GrayScale, "GrayScale"}, 1124+ {StaticGray, "StaticGray"}, 1125+ {StaticGray, "StaticGrey"}, 1126+ {-1, NULL} 1127 }; 1128 1129 int visualClassFromName(name) 1130@@ -393,6 +393,7 @@ 1131 * have no visuals that support that depth. seems silly to me.... 1132 */ 1133 1134+ visual = NULL; 1135 depth= 0; 1136 screen= ScreenOfDisplay(disp, scrn); 1137 for (a= 0; a < screen->ndepths; a++) { 1138@@ -575,19 +576,21 @@ 1139 unsigned int private_cmap; 1140 int visual_class; 1141 1142+ oldcmap = 0; 1143+ lastx = 0; 1144 /* get values from options that we'll use a lot 1145 */ 1146 fit= (getOption(global_options, FIT) != NULL); 1147 fullscreen= (getOption(global_options, FULLSCREEN) != NULL); 1148 install= (getOption(global_options, INSTALL) != NULL); 1149 private_cmap= (getOption(global_options, PRIVATE) != NULL); 1150- if (opt= getOption(image_options, DELAY)) 1151+ if ((opt= getOption(image_options, DELAY))) 1152 delay= opt->info.delay; 1153- else if (opt= getOption(global_options, DELAY)) 1154+ else if ((opt= getOption(global_options, DELAY))) 1155 delay= opt->info.delay; 1156 else 1157 delay= 0; 1158- if (opt= getOption(image_options, VISUAL)) 1159+ if ((opt= getOption(image_options, VISUAL))) 1160 visual_class= opt->info.visual; 1161 else 1162 visual_class= -1; 1163diff -urNad 06.xloadimage.tmp/xbitmap.c 06.xloadimage/xbitmap.c 1164--- 06.xloadimage.tmp/xbitmap.c 2003-04-02 23:28:23.000000000 +0100 1165+++ 06.xloadimage/xbitmap.c 2003-04-02 23:27:51.000000000 +0100 1166@@ -247,7 +247,7 @@ 1167 char *fullname, *name; 1168 { Image *image; 1169 1170- if (image= xbitmapLoad(fullname, name, (unsigned int)1)) { 1171+ if ((image= xbitmapLoad(fullname, name, (unsigned int)1))) { 1172 freeImage(image); 1173 return(1); 1174 } 1175diff -urNad 06.xloadimage.tmp/xloadimage.c 06.xloadimage/xloadimage.c 1176--- 06.xloadimage.tmp/xloadimage.c 2003-04-02 23:28:23.000000000 +0100 1177+++ 06.xloadimage/xloadimage.c 2003-04-02 23:27:51.000000000 +0100 1178@@ -10,6 +10,8 @@ 1179 1180 #include "copyright.h" 1181 #include "xloadimage.h" 1182+#include "options.h" 1183+#include "misc.h" 1184 #ifdef VMS 1185 #include "patchlevel." 1186 #define NO_FORK 1187@@ -121,6 +123,10 @@ 1188 case ZOOM: 1189 retimage= zoom(image, option->info.zoom.x, option->info.zoom.y, verbose); 1190 break; 1191+ 1192+ default: 1193+ /* Nothing to do */ 1194+ break; 1195 } 1196 return(retimage); 1197 } 1198@@ -167,7 +173,7 @@ 1199 /* the real thing 1200 */ 1201 1202-main(argc, argv) 1203+int main(argc, argv) 1204 int argc; 1205 char *argv[]; 1206 { Option *opt; 1207@@ -233,7 +239,7 @@ 1208 1209 if (getOption(global_options, IDENTIFY)) { 1210 for (optset= image_options; optset; optset= optset->next) { 1211- if (opt= getOption(optset, NAME)) 1212+ if ((opt= getOption(optset, NAME))) 1213 identifyImage(opt->info.name); 1214 } 1215 exit(0); 1216@@ -272,7 +278,7 @@ 1217 onroot= (getOption(global_options, ONROOT) != NULL); 1218 fullscreen= (getOption(global_options, FULLSCREEN) != NULL); 1219 shrinktofit= (getOption(global_options, SHRINKTOFIT) != NULL); 1220- if (opt= getOption(global_options, GEOMETRY)) { 1221+ if ((opt= getOption(global_options, GEOMETRY))) { 1222 winwidth= opt->info.geometry.w; 1223 winheight= opt->info.geometry.h; 1224 } 1225@@ -354,7 +360,7 @@ 1226 1227 /* retitle the image if we were asked to 1228 */ 1229- if (opt= getOption(optset, TITLE)) { 1230+ if ((opt= getOption(optset, TITLE))) { 1231 if (newimage->title) 1232 lfree((byte *)newimage->title); 1233 newimage->title= dupString(opt->info.title); 1234@@ -428,7 +434,7 @@ 1235 1236 /* handle -at 1237 */ 1238- if (opt= getOption(optset, AT)) 1239+ if ((opt= getOption(optset, AT))) 1240 tmpimage= merge(dispimage, newimage, 1241 opt->info.at.x, opt->info.at.y, verbose); 1242 else 1243@@ -470,7 +476,7 @@ 1244 exit(0); 1245 case ' ': 1246 case 'n': /* next image */ 1247- if (opt= getOption(optset->next, GOTO)) { 1248+ if ((opt= getOption(optset->next, GOTO))) { 1249 char *tag= opt->info.go_to; 1250 1251 for (tmpset= image_options; tmpset; tmpset= tmpset->next) { 1252@@ -539,7 +545,7 @@ 1253 for (optset= image_options; optset && optset->next; optset= optset->next) 1254 /* EMPTY */ 1255 ; 1256- if (opt= getOption(optset, NAME)) { 1257+ if ((opt= getOption(optset, NAME))) { 1258 if (dispimage->title) 1259 lfree((byte *)dispimage->title); 1260 dispimage->title= dupString(opt->info.title); 1261diff -urNad 06.xloadimage.tmp/xloadimage.h 06.xloadimage/xloadimage.h 1262--- 06.xloadimage.tmp/xloadimage.h 1993-10-28 16:26:55.000000000 +0000 1263+++ 06.xloadimage/xloadimage.h 2003-04-02 23:27:51.000000000 +0100 1264@@ -38,6 +38,7 @@ 1265 */ 1266 1267 void supportedImageTypes(); /* imagetypes.c */ 1268+void dumpImage(); 1269 1270 char *tail(); /* misc.c */ 1271 void memoryExhausted(); 1272@@ -47,6 +48,9 @@ 1273 void goodImage(); 1274 int errorHandler(); 1275 1276+void showConfiguration(); /* config.c */ 1277+void listImages(); 1278+ 1279 char *expandPath(); /* path.c */ 1280 int findImage(); 1281 void listImages(); 1282diff -urNad 06.xloadimage.tmp/xpixmap.c 06.xloadimage/xpixmap.c 1283--- 06.xloadimage.tmp/xpixmap.c 1993-10-21 22:28:44.000000000 +0100 1284+++ 06.xloadimage/xpixmap.c 2003-04-02 23:27:51.000000000 +0100 1285@@ -54,6 +54,8 @@ 1286 int c; 1287 byte *dptr; 1288 1289+ cpp = 0; 1290+ 1291 if (! (zf= zopen(fullname))) 1292 return(NULL); 1293 1294@@ -112,7 +114,7 @@ 1295 return(NULL); 1296 } 1297 1298- if (p= rindex(what, '_')) { /* get the name in the image if there is */ 1299+ if ((p= rindex(what, '_'))) { /* get the name in the image if there is */ 1300 *p= '\0'; /* one */ 1301 imagetitle= dupString(what); 1302 } 1303@@ -190,7 +192,7 @@ 1304 break; 1305 } 1306 1307- if (p= rindex(what, '_')) 1308+ if ((p= rindex(what, '_'))) 1309 p++; 1310 else 1311 p= what; 1312@@ -234,7 +236,7 @@ 1313 char *fullname, *name; 1314 { Image *image; 1315 1316- if (image= xpixmapLoad(fullname, name, (unsigned int)1)) { 1317+ if ((image= xpixmapLoad(fullname, name, (unsigned int)1))) { 1318 freeImage(image); 1319 return(1); 1320 } 1321diff -urNad 06.xloadimage.tmp/xwd.c 06.xloadimage/xwd.c 1322--- 06.xloadimage.tmp/xwd.c 1993-10-21 22:28:44.000000000 +0100 1323+++ 06.xloadimage/xwd.c 2003-04-02 23:27:51.000000000 +0100 1324@@ -418,6 +418,8 @@ 1325 Image *image; 1326 int a; 1327 1328+ image = NULL; 1329+ 1330 if (! (zf= zopen(fullname))) 1331 return(NULL); 1332 if (! isXWD(name, zf, &header, verbose)) { 1333diff -urNad 06.xloadimage.tmp/zoom.c 06.xloadimage/zoom.c 1334--- 06.xloadimage.tmp/zoom.c 1993-10-21 22:28:44.000000000 +0100 1335+++ 06.xloadimage/zoom.c 2003-04-02 23:27:51.000000000 +0100 1336@@ -53,6 +53,8 @@ 1337 byte srcmask, destmask, bit; 1338 Pixel value; 1339 1340+ image = NULL; 1341+ 1342 goodImage(oimage, "zoom"); 1343 1344 if (!xzoom && !yzoom) /* stupid user */ 1345