Index: kit/Imakefile.in
diff -u kit/Imakefile.in:1.44 kit/Imakefile.in:1.45
--- kit/Imakefile.in:1.44	Thu Dec 17 14:48:27 1998
+++ kit/Imakefile.in	Mon Dec 28 17:22:19 1998
@@ -1,4 +1,4 @@
-# $Id: Imakefile.in,v 1.44 1998/12/17 05:48:27 onoe Exp $
+# $Id: Imakefile.in,v 1.45 1998/12/28 08:22:19 itojun Exp $
 
 @SET_MAKE@
 srcdir=	@srcdir@
@@ -19,7 +19,7 @@
 LEX=	@LEX@
 # NOTE: we must not define CC here, since imake may assume other CC to be used.
 
-OPTFLAGS=	@OPTFLAGS@
+OPTFLAGS=	@OPTFLAGS@ -Wall
 DEFS=	@DEFS@ -DMGPLIBDIR=\"$(LIBDIR)/mgp\"
 #DEFS+=	-DGLYPHEDGE
 
Index: kit/README
diff -u kit/README:1.30 kit/README:1.31
--- kit/README:1.30	Mon Nov 16 22:33:55 1998
+++ kit/README	Mon Dec 28 17:22:21 1998
@@ -60,16 +60,20 @@
 
 Note 1: if you have vflib installed AND you do NOT want to compile the
 vflib support into the binary, try the following option: 
+
 	% ./configure --disable-vflib
 
 Note 2: if you have FreeType installed AND you do NOT want to compile the
 FreeType support into the binary, try the following option: 
+
 	% ./configure --disable-freetype
 
 Note 3: if you have to use non-standard compiler, you must declare your
 compiler by using "env" command, like:
+
 	% env CC=gcc ./configure		# force gcc
 	% env CC=shlicc2 ./configure		# force shlicc2 (bsdi3)
+
 We cannot make a guess in configure script, since imake may dislike the
 compiler that was guessed by configure.  This applies to, for example,
 Solaris withous Sun compiler license (gcc-only environment).
Index: kit/background.c
diff -u kit/background.c:1.11 kit/background.c:1.12
--- kit/background.c:1.11	Thu Dec 17 13:32:32 1998
+++ kit/background.c	Mon Dec 28 17:22:22 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: background.c,v 1.11 1998/12/17 04:32:32 onoe Exp $
+ * $Id: background.c,v 1.12 1998/12/28 08:22:22 itojun Exp $
  */
 
 #include <math.h>
@@ -122,10 +122,10 @@
 	byte *pic;
 	const u_int bits = 8;
 	int i, j;
-	int x1, x2;
-	int y1, y2, dpy;
-	int z1, z2, dpz;
-	byte *p1, *p2;
+	int x1 = 0, x2 = 0;
+	int y1 = 0, y2 = 0, dpy = 0;
+	int z1 = 0, z2 = 0, dpz = 0;
+	byte *p1 = NULL, *p2 = NULL;
 	byte mask;
 
 	pic = (byte *)malloc(width * height * 3 * sizeof(byte));
@@ -273,12 +273,12 @@
     td1 = cx - cx*dcost;
     td2 = cy + 0.5*cx*sin2t;
 
-    for (y=0; y < height; y++) {
+    for (y = 0; y < height; y++) {
 	pp = pic + (y * width * 3);
 	dy = (cy-y)*0.5*sin2t + td1;
 	ey = (y-cy)*dsint + td2;
 
-	for (x=0; x < width; x++) {
+	for (x = 0; x < width; x++) {
 	    d = lcdist(x, y, cx, cy, rot, mode, dy, ey);
 	    rat = (d - mind) / del;
 
@@ -400,7 +400,7 @@
 #if USE_COLOR_DEPTH
 #define PM_SCALE(a, b, c) (long)((a) * (c))/(b)
     /* color depth (future use) */
-    maxval=0xff;
+    maxval = 0xff;
 
     destptr= image->data;
     for (y= 0; y < size; y++) {
Index: kit/configure
diff -u kit/configure:1.49 kit/configure:1.50
--- kit/configure:1.49	Mon Dec 21 14:22:29 1998
+++ kit/configure	Mon Dec 28 17:22:24 1998
@@ -863,7 +863,7 @@
 if test "$mgp_use_freetype" = "yes"; then
  	echo $ac_n "checking for freetype library/header""... $ac_c" 1>&6
 echo "configure:866: checking for freetype library/header" >&5
- 	for dir in /usr/local/freetype /usr/local; do
+ 	for dir in /usr/local/freetype /usr/local /opt/freetype; do
  		ac_cv_ft_lib=no
  		ac_cv_ft_include=no
  		if test -d $dir/lib -a -f $dir/lib/libttf.so; then
Index: kit/configure.in
diff -u kit/configure.in:1.46 kit/configure.in:1.47
--- kit/configure.in:1.46	Thu Dec 17 13:58:30 1998
+++ kit/configure.in	Mon Dec 28 17:22:25 1998
@@ -3,7 +3,7 @@
 dnl independent (using srcdir), however, xmkmf and Imake.tmpl do not
 dnl allow us to switch compilation directory.
 dnl
-dnl $Id: configure.in,v 1.46 1998/12/17 04:58:30 onoe Exp $
+dnl $Id: configure.in,v 1.47 1998/12/28 08:22:25 itojun Exp $
 AC_INIT(image/imagetypes.c)
 
 dnl Checks for programs.
@@ -54,7 +54,7 @@
  
 if test "$mgp_use_freetype" = "yes"; then
  	AC_MSG_CHECKING(for freetype library/header)
- 	for dir in /usr/local/freetype /usr/local; do
+ 	for dir in /usr/local/freetype /usr/local /opt/freetype; do
  		ac_cv_ft_lib=no
  		ac_cv_ft_include=no
  		if test -d $dir/lib -a -f $dir/lib/libttf.so; then
Index: kit/ctlwords.pl
diff -u kit/ctlwords.pl:1.2 kit/ctlwords.pl:removed
--- kit/ctlwords.pl:1.2	Sat Sep  5 06:05:08 1998
+++ kit/ctlwords.pl	Mon Jan  4 05:10:10 1999
@@ -1,12 +0,0 @@
-#! /usr/bin/perl
-$counter = 0;	# 0 origin
-print "/* generated by ctlwords.awk. do not edit by hand. */\n";
-
-while (<>) {
-	next if (!/^\/\*CTL\*\//);
-	next if ($_ !~ /(CTL_[A-Z0-9]+)/);
-
-	$word = $1;
-	print "#define $word\t$counter\n";
-	$counter++;
-}
Index: kit/draw.c
diff -u kit/draw.c:1.134 kit/draw.c:1.135
--- kit/draw.c:1.134	Thu Dec 17 13:32:33 1998
+++ kit/draw.c	Mon Dec 28 17:22:27 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.134 1998/12/17 04:32:33 onoe Exp $
+ * $Id: draw.c,v 1.135 1998/12/28 08:22:27 itojun Exp $
  */
 
 #include "mgp.h"
@@ -1355,7 +1355,7 @@
 		obj->data.icon.xpoint = malloc(sizeof(XPoint) * npoint);
 		if (obj->data.icon.xpoint == NULL) {
 			obj_free(state, obj);
-			return NULL;
+			return 0;
 		}
 		for (i = 0; i < npoint; i++)
 			obj->data.icon.xpoint[i] = xpoint[i];
@@ -1590,13 +1590,15 @@
 	u_int xpos, ypos;
 {
 	struct render_object *obj;
-	int x, y;
+	int x = 0, y = 0;
 	int width, height;
 	u_long fore;
 	u_int code;
 	char *registry;
 	XChar2b kch[2];
+#if 0
 	char ch[2];
+#endif
 	u_int isize;
 	int i;
 #ifdef RASTERLIB
@@ -1899,7 +1901,7 @@
 	switch (hyphen) {
 	case 0:
 		/* for "a14", "5x8", or such an short names */
-		if (fontlist = XListFonts(display, seed, 1, &count)) {
+		if ((fontlist = XListFonts(display, seed, 1, &count))) {
 			XFreeFontNames(fontlist);
 			strcpy(buf, seed);
 			break;
Index: kit/embed.c
diff -u kit/embed.c:1.5 kit/embed.c:1.6
--- kit/embed.c:1.5	Sat Sep  5 06:21:41 1998
+++ kit/embed.c	Mon Dec 28 17:22:29 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: embed.c,v 1.5 1998/09/04 21:21:41 itojun Exp $
+ * $Id: embed.c,v 1.6 1998/12/28 08:22:29 itojun Exp $
  */
 
 #include "mgp.h"
@@ -53,7 +53,7 @@
 embed_fname(fname)
 	char *fname;
 {
-	char buf[BUFSIZ], *p;
+	char buf[BUFSIZ];
 
 	if (strncmp(fname, EMBEDDIR, strlen(EMBEDDIR)) != 0)
 		return fname;
@@ -98,7 +98,7 @@
 	}
 	fprintf(pp, "begin 600 %s/%s\n", mgpwdirname, p->ctc_value);
 	while (fgets(buf, sizeof(buf), fp)) {
-		*lineno++;
+		(*lineno)++;
 		if (strncasecmp(buf, "%endembed", 9) == 0)
 			break;
 		fputs(buf, pp);
Index: kit/globals.c
diff -u kit/globals.c:1.33 kit/globals.c:1.34
--- kit/globals.c:1.33	Wed Dec  9 06:49:05 1998
+++ kit/globals.c	Mon Dec 28 17:22:31 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: globals.c,v 1.33 1998/12/08 21:49:05 itojun Exp $
+ * $Id: globals.c,v 1.34 1998/12/28 08:22:31 itojun Exp $
  */
 
 #include "mgp.h"
@@ -131,5 +131,5 @@
 /*CTL*/	{ CTL_EMBED,		T_STR,	"embed", 5 },
 /*CTL*/	{ CTL_ENDEMBED,		T_VOID,	"endembed", 8 },
 /*CTL*/	{ CTL_CHARSET,		T_STR,	"charset", 7 },
-	{ 0, NULL, 0 },
+	{ 0, 0, NULL, 0 },
 };
Index: kit/grammar.y
diff -u kit/grammar.y:1.26 kit/grammar.y:1.27
--- kit/grammar.y:1.26	Thu Dec 17 10:41:48 1998
+++ kit/grammar.y	Mon Dec 28 17:22:33 1998
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.26 1998/12/17 01:41:48 onoe Exp $
+ * $Id: grammar.y,v 1.27 1998/12/28 08:22:33 itojun Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -491,6 +491,8 @@
 	return ct;
 }
 
+#if 0
+
 static struct ctrl *
 gen_argsfromnid(op, nid)
 	int op;
@@ -527,6 +529,8 @@
 	return ct;
 }
 
+#endif
+
 static struct ctrl *
 gen_argsfromstr(op, str, flag)
 	int op;
@@ -550,7 +554,7 @@
 		return ct;
 	}
 	for (h = (char **)ct->cta_argv;
-	     *h = strsep((char **)&str, " ");
+	     (*h = strsep((char **)&str, " "));
 	     /*none*/) {
 		if (**h != '\0') {
 			h++;
@@ -755,8 +759,7 @@
 			  $$ = gen_str2(CTL_XFONT2, p, "iso8859-1");
 			}
 	| KW_XFONT STRorID STRorID
-			{ char *p;
-			  check_xfont($2, $3);	/* lexical check */
+			{ check_xfont($2, $3);	/* lexical check */
 			  $$ = gen_str2(CTL_XFONT2, $2, $3);
 			}
 	| KW_BIMAGE STRorID	{ $$ = gen_str(CTL_BIMAGE, $2); }
Index: kit/keywords.pl
diff -u kit/keywords.pl:1.1 kit/keywords.pl:removed
--- kit/keywords.pl:1.1	Tue Nov 11 15:07:40 1997
+++ kit/keywords.pl	Mon Jan  4 05:10:17 1999
@@ -1,14 +0,0 @@
-@keywords = ();
-
-die if (@ARGV != 1);
-open(IN, "< $ARGV[0]") || die;
-while (<IN>) {
-	next if (! /^\/\*CTL\*\//);
-	next if (! /CTL_([A-Z0-9]+),/);
-	$t = $1;
-	$t =~ tr/A-Z/a-z/;
-	push(@keywords, $t);
-}
-close(IN);
-
-print join(' ', @keywords) . "\n";
Index: kit/mgp.c
diff -u kit/mgp.c:1.92 kit/mgp.c:1.93
--- kit/mgp.c:1.92	Thu Dec 17 13:32:37 1998
+++ kit/mgp.c	Mon Dec 28 17:22:35 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.c,v 1.92 1998/12/17 04:32:37 onoe Exp $
+ * $Id: mgp.c,v 1.93 1998/12/28 08:22:35 itojun Exp $
  */
 
 static char *mgp_version = "1.04a (980906)";
@@ -402,7 +402,8 @@
 	}
 
 	cleanup(0);	/* never returns */
-	/* NOTREACHED */
+	exit(0);	/* avoid warnings */
+	/*NOTREACHED*/
 }
 
 static void
Index: kit/parse.c
diff -u kit/parse.c:1.74 kit/parse.c:1.75
--- kit/parse.c:1.74	Thu Dec 17 13:32:41 1998
+++ kit/parse.c	Mon Dec 28 17:22:37 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: parse.c,v 1.74 1998/12/17 04:32:41 onoe Exp $
+ * $Id: parse.c,v 1.75 1998/12/28 08:22:37 itojun Exp $
  */
 
 #include "mgp.h"
@@ -51,6 +51,11 @@
 extern struct ctrl *root;
 extern char *yyfilename;
 extern int yylineno;
+/* Prevent warning if -Wall.  */
+#ifdef __GNUC__
+extern void lex_init(u_char *);
+extern int yyparse (void);
+#endif
 
 static int filterval = 0;
 
@@ -156,7 +161,9 @@
 	char *filename;
 {
 	char buf[BUFSIZ];
+#if 0
 	struct ctrl *cp;
+#endif
 	int lineno;
 
 	if (2 <= parse_debug)
@@ -668,7 +675,6 @@
 	struct ctrl **ch;
 	struct ctrl *cp;
 	struct ctrl *cp1;
-	struct ctrl *cp2;
 
 	/*
 	 * add CTL_PAUSE to the last line of a page.
@@ -1290,7 +1296,7 @@
 		break;
 	case CTL_ICON:
 		fprintf(stderr, "type=%s color=%x siz=%d",
-			p->ctic_value, p->ctic_color, p->ctic_size);
+			p->ctic_value, (int)p->ctic_color, (int) p->ctic_size);
 		break;
 	default:
 		fprintf(stderr, "???");
@@ -1557,8 +1563,9 @@
 		if (!p)
 			break;
 		strcpy(buf, p);
-		if (p = strrchr(buf, '/'))
+		if ((p = strrchr(buf, '/'))) {
 			p[1] = '\0';
+		}
 		strcat(buf, fname);
 		fp = fopen(buf, mode);
 		if (fp)
Index: kit/plist.c
diff -u kit/plist.c:1.18 kit/plist.c:1.19
--- kit/plist.c:1.18	Wed Aug 26 14:29:57 1998
+++ kit/plist.c	Mon Dec 28 17:22:39 1998
@@ -26,15 +26,15 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: plist.c,v 1.18 1998/08/26 05:29:57 itojun Exp $
+ * $Id: plist.c,v 1.19 1998/12/28 08:22:39 itojun Exp $
  */
 
 #include "mgp.h"
 
 #define	PL_X_MARGIN	10
 
-static Window pl_titlewin = NULL;
-static Window pg_win = NULL;
+static Window pl_titlewin = None;
+static Window pg_win = None;
 static Pixmap pg_tmp;
 static int pg_lastpage = -1;
 static struct ctrl *pg_lastcp = NULL;
@@ -103,10 +103,10 @@
 		return;
 	XUnmapSubwindows(display, window);
 	XDestroyWindow(display, pl_titlewin);
-	pl_titlewin = NULL;
+	pl_titlewin = None;
 	for (i = 1; i <= maxpage; i++) {
 		XDestroyWindow(display, plwin[i]);
-		plwin[i] = NULL;
+		plwin[i] = None;
 	}
 	XMapSubwindows(display, window);
 	XFlush(display);
@@ -292,7 +292,7 @@
 	XDestroyWindow(display, pg_win);
 	XMapSubwindows(display, window);
 	XFlush(display);
-	pg_win = NULL;
+	pg_win = None;
 	pg_lastpage = -1;
 	pg_lastcp = NULL;
 }
Index: kit/print.c
diff -u kit/print.c:1.72 kit/print.c:1.73
--- kit/print.c:1.72	Thu Dec 17 13:54:53 1998
+++ kit/print.c	Mon Dec 28 17:22:40 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: print.c,v 1.72 1998/12/17 04:54:53 onoe Exp $
+ * $Id: print.c,v 1.73 1998/12/28 08:22:40 itojun Exp $
  */
 /*
  * Paper size selection code is based on psutil.c by Angus J. C. Duggan
@@ -202,7 +202,6 @@
 static void image_remember __P((struct ctrl *, struct imagepool *));
 static void image_load_print __P((char *, int, int, int, int, int));
 static void print_usage __P((char *));
-static int set_position __P((void));
 static void setpencolor __P((u_long));
 static void print_full_image __P((XImage *, Visual *));
 static void print_8_image __P((XImage *));
@@ -1192,12 +1191,11 @@
 	struct imagepool *pool;
 {
 	char *epsname;
-	char buf[BUFSIZ];
 	Image *myimage;
 	int xzoom, yzoom;
 	struct render_state state;
 
-	if (epsname = checkeps(cp->ctm_fname)) {
+	if ((epsname = checkeps(cp->ctm_fname))) {
 		int x1, y1, x2, y2, width, height, swidth, sheight, xim, yim;
 
 		if (ps_boundingbox(epsname, &x1, &y1, &x2, &y2) < 0)
@@ -1262,7 +1260,7 @@
 	int backflag;
 	int zoomflag;
 {
-	Image *image, *myimage;
+	Image *myimage;
 	Pixmap mypixmap;
 	XImageInfo *ximageinfo;
 	XImage	*print_image;
@@ -1271,8 +1269,7 @@
 	static Cursor curs;
 	u_int	print_width, print_height;
 	struct render_state state;
-
-	int xpos;
+	int xpos = 0;
 
 	if (zoomflag == 2)
 		ximagesize = yimagesize = 0;
@@ -1408,6 +1405,8 @@
 	exit(0);
 }
 
+#if 0
+
 static int
 set_position()
 {
@@ -1436,6 +1435,8 @@
 	return x;
 }
 
+#endif
+
 static void
 setpencolor(c)
 	u_long c;
@@ -1460,7 +1461,7 @@
 		color.red / 65535.0,
 		color.green / 65535.0,
 		color.blue / 65535.0,
-		color.pixel, depth);
+		(int) color.pixel, depth);
 }
 
 static void
@@ -1588,7 +1589,7 @@
 	char line2[BUFSIZ];
 	char line[BUFSIZ];
 	int x1, y1, x2, y2, height, width, sheight, swidth;
-	int xpos;
+	int xpos = 0;
 	int xzoomrate, yzoomrate;
 	double xscale, yscale;
 	int noboundingbox;
@@ -1676,7 +1677,7 @@
 
 	fprintf(fp, "BeginEPSF\n");
 	fprintf(fp, "%d XMARGIN add ypos translate\n", xpos);
-	fprintf(fp, "%lf %lf scale\n", xscale, yscale);
+	fprintf(fp, "%f %f scale\n", xscale, yscale);
 	fprintf(fp, "%d %d translate\n", -1 * x1, -1 * y2);
 	fprintf(fp, "%%%%BeginDocument: %s\n", filename);
 	fputs(line1, fp);
@@ -1773,7 +1774,7 @@
 	char *p;
 	loadPathsAndExts();
 	strncpy(pathbuf, mgp_fname, sizeof(pathbuf));
-	if (p = rindex(pathbuf, '/')) {
+	if ((p = rindex(pathbuf, '/'))) {
 		*p = '\0';
         	Paths[NumPaths++]= expandPath(pathbuf);
 	}
Index: kit/scanner.l
diff -u kit/scanner.l:1.14 kit/scanner.l:1.15
--- kit/scanner.l:1.14	Thu Dec 17 13:25:13 1998
+++ kit/scanner.l	Mon Dec 28 17:22:42 1998
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: scanner.l,v 1.14 1998/12/17 04:25:13 onoe Exp $
+ * $Id: scanner.l,v 1.15 1998/12/28 08:22:42 itojun Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -86,6 +86,12 @@
 /*#define yylval mgp_lval*/
 extern YYSTYPE yylval;
 extern int n_errors;
+#ifdef HAVE_STDARG_H
+/* GCC complains if we declare this function in traditional style */
+extern void yyerror(char *, ...);
+#else
+extern void yyerror(char *);
+#endif
 
 static char *in_buffer;
 %}
Index: kit/tfont.c
diff -u kit/tfont.c:1.25 kit/tfont.c:1.26
--- kit/tfont.c:1.25	Thu Oct 15 21:37:58 1998
+++ kit/tfont.c	Mon Dec 28 17:22:43 1998
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: tfont.c,v 1.25 1998/10/15 12:37:58 itojun Exp $
+ * $Id: tfont.c,v 1.26 1998/12/28 08:22:43 itojun Exp $
  */
 
 #include "mgp.h"
@@ -44,7 +44,6 @@
 static TT_Glyph			glyph[TFFONT_NUM];
 static TT_Instance		instance[TFFONT_NUM];
 static TT_Glyph_Metrics		metrics;
-static TT_Outline		outline;
 static TT_Error			error;
 static TT_Engine		engine;
 static XImage *xim;
@@ -186,7 +185,7 @@
 tfc_setfont(name)
 	char *name;
 {
-	char *fontname;
+	char *fontname = NULL;
 	u_int i;
 	int res = 96; /* XXX */
 	char pathname[MAXPATHLEN];
Index: kit/image/Imakefile.in
diff -u kit/image/Imakefile.in:1.3 kit/image/Imakefile.in:1.4
--- kit/image/Imakefile.in:1.3	Fri Feb 13 16:48:39 1998
+++ kit/image/Imakefile.in	Mon Dec 28 17:22:51 1998
@@ -12,7 +12,7 @@
 	path.o sunraster.o mcidas.o fbm.o faces.o cmuwmraster.o bright.o\
 	img.o mc_tables.o window.o
 
-DEFS=	@DEFS@
+DEFS=	@DEFS@ -Wall
 
 AllTarget($(TARGET))
 DependTarget()
Index: kit/image/bright.c
diff -u kit/image/bright.c:1.2 kit/image/bright.c:1.3
--- kit/image/bright.c:1.2	Fri Feb 13 16:48:40 1998
+++ kit/image/bright.c	Mon Dec 28 17:22:53 1998
@@ -11,6 +11,8 @@
 #include "copyright.h"
 #include "image.h"
 
+extern void make_gamma(double gamma, int gammamap[]);
+
 /* alter an image's brightness by a given percentage
  */
 
@@ -142,7 +144,7 @@
 { unsigned int  a, x, y;
   unsigned int  min, max;
   Pixel         pixval;
-  Image        *newimage;
+  Image        *newimage=NULL;
   byte         *srcptr, *destptr;
   byte          array[256];
 
@@ -190,11 +192,11 @@
       for (x= 0; x < image->width; x++) {
 	pixval= memToVal(srcptr, image->pixlen);
 	*destptr= array[image->rgb.red[pixval] >> 8];
-	*destptr++;
+	(*destptr)++;
 	*destptr= array[image->rgb.green[pixval] >> 8];
-	*destptr++;
+	(*destptr)++;
 	*destptr= array[image->rgb.blue[pixval] >> 8];
-	*destptr++;
+	(*destptr)++;
 	srcptr += image->pixlen;
       }
     break;
Index: kit/image/clip.c
diff -u kit/image/clip.c:1.3 kit/image/clip.c:1.4
--- kit/image/clip.c:1.3	Sat Sep  5 00:07:06 1998
+++ kit/image/clip.c	Mon Dec 28 17:22:54 1998
@@ -15,7 +15,7 @@
      Image        *simage;
      unsigned int  clipx, clipy, clipw, cliph;
      unsigned int  verbose;
-{ Image *image;
+{ Image *image=NULL;
   unsigned int  x, y;
   unsigned int  slinelen, dlinelen;
   unsigned int  start;
Index: kit/image/cmuwmraster.c
diff -u kit/image/cmuwmraster.c:1.3 kit/image/cmuwmraster.c:1.4
--- kit/image/cmuwmraster.c:1.3	Sat Sep  5 00:07:06 1998
+++ kit/image/cmuwmraster.c	Mon Dec 28 17:22:55 1998
@@ -16,15 +16,15 @@
 
 /* SUPPRESS 558 */
 
-int babble(name, headerp)
+void babble(name, headerp)
 char *name;
 struct cmuwm_header *headerp;
 {
     fprintf(stderr, "%s is a %dx%d %d plane CMU WM raster\n",
 	   name,
-	   memToVal(headerp->width, sizeof(long)),
-	   memToVal(headerp->height, sizeof(long)),
-	   memToVal(headerp->depth, sizeof(short)));
+	   (int) memToVal(headerp->width, sizeof(long)),
+	   (int) memToVal(headerp->height, sizeof(long)),
+	   (int) memToVal(headerp->depth, sizeof(short)));
 }
 
 int cmuwmIdent(fullname, name)
@@ -108,7 +108,7 @@
       {
 	  fprintf(stderr,"CMU WM raster %s is of depth %d, must be 1",
 		  name,
-		  header.depth);
+		  (int) header.depth);
 	  return(NULL);
       }
 
@@ -148,8 +148,3 @@
 
     return image;
 }
-
-	  
-
-
-
Index: kit/image/copyright.h
diff -u kit/image/copyright.h:1.1.1.1 kit/image/copyright.h:1.2
--- kit/image/copyright.h:1.1.1.1	Mon Oct 27 00:26:14 1997
+++ kit/image/copyright.h	Mon Dec 28 17:22:56 1998
@@ -20,7 +20,7 @@
  */
 
 #ifndef __SABER__
-static char *Copyright= "Copyright 1989, 1990, 1991, 1992 Jim Frost";
+static const char *Copyright= "Copyright 1989, 1990, 1991, 1992 Jim Frost";
 #endif
 #define _JIM_COPYRIGHT_
 #endif
Index: kit/image/faces.c
diff -u kit/image/faces.c:1.3 kit/image/faces.c:1.4
--- kit/image/faces.c:1.3	Sat Sep  5 00:07:07 1998
+++ kit/image/faces.c	Mon Dec 28 17:22:58 1998
@@ -172,7 +172,7 @@
      char *fullname, *name;
 { Image *image;
 
-  if (image= facesLoad(fullname, name, 1)) {
+  if ((image = facesLoad(fullname, name, 1))) {
     freeImage(image);
     return(1);
   }
Index: kit/image/fbm.c
diff -u kit/image/fbm.c:1.3 kit/image/fbm.c:1.4
--- kit/image/fbm.c:1.3	Sat Sep  5 00:07:07 1998
+++ kit/image/fbm.c	Mon Dec 28 17:22:59 1998
@@ -14,6 +14,7 @@
  * Copyright 1990 Mark Majhor (see the included file
  * "mrmcpyrght.h" for complete copyright information)
  */
+#include <stdlib.h>
 # include <stdio.h>
 # include <math.h>
 # include <ctype.h>
@@ -50,6 +51,56 @@
 static char *fbmin_img_title;		/* name of image */
 static char *fbmin_img_credit;		/* credit for image */
 
+static int fbmin_image_test()
+{
+  if (fbmin_img_width < 1 || fbmin_img_width > 32767) {
+    fprintf (stderr, "Invalid width (%d) on input\n", fbmin_img_width);
+    return FBMIN_ERR_BAD_SD;
+  }
+
+  if (fbmin_img_height < 1 || fbmin_img_height > 32767) {
+    fprintf (stderr, "Invalid height (%d) on input\n", fbmin_img_height);
+    return (0);
+  }
+
+  if (fbmin_img_depth != 1 && fbmin_img_depth != 3) {
+    fprintf (stderr, "Invalid number of planes (%d) on input %s\n",
+	     fbmin_img_depth, "(must be 1 or 3)");
+    return FBMIN_ERR_BAD_SD;
+  }
+
+  if (fbmin_img_bits < 1 || fbmin_img_bits > 8) {
+    fprintf (stderr, "Invalid number of bits (%d) on input %s\n",
+	     fbmin_img_bits, "(must be [1..8])");
+    return FBMIN_ERR_BAD_SD;
+  }
+
+  if (fbmin_img_physbits != 1 && fbmin_img_physbits != 8) {
+    fprintf (stderr, "Invalid number of physbits (%d) on input %s\n",
+	     fbmin_img_physbits, "(must be 1 or 8)");
+    return FBMIN_ERR_BAD_SD;
+  }
+
+  if (fbmin_img_rowlen < 1 || fbmin_img_rowlen > 32767) {
+    fprintf (stderr, "Invalid row length (%d) on input\n",
+	     fbmin_img_rowlen);
+    return FBMIN_ERR_BAD_SD;
+  }
+
+  if (fbmin_img_depth > 1 && fbmin_img_plnlen < 1) {
+    fprintf (stderr, "Invalid plane length (%d) on input\n",
+	     fbmin_img_plnlen);
+    return FBMIN_ERR_BAD_SD;
+  }
+
+  if (fbmin_img_aspect < 0.01 || fbmin_img_aspect > 100.0) {
+    fprintf (stderr, "Invalid aspect ratio %dg on input\n",
+	     fbmin_img_aspect);
+    return FBMIN_ERR_BAD_SD;
+  }
+    return FBMIN_SUCCESS;
+}
+
 /*
  * open FBM image in the input stream; returns FBMIN_SUCCESS if
  * successful. (might also return various FBMIN_ERR codes.)
@@ -112,56 +163,6 @@
   return FBMIN_SUCCESS;
 }
     
-static fbmin_image_test()
-{
-  if (fbmin_img_width < 1 || fbmin_img_width > 32767) {
-    fprintf (stderr, "Invalid width (%d) on input\n", fbmin_img_width);
-    return FBMIN_ERR_BAD_SD;
-  }
-
-  if (fbmin_img_height < 1 || fbmin_img_height > 32767) {
-    fprintf (stderr, "Invalid height (%d) on input\n", fbmin_img_height);
-    return (0);
-  }
-
-  if (fbmin_img_depth != 1 && fbmin_img_depth != 3) {
-    fprintf (stderr, "Invalid number of planes (%d) on input %s\n",
-	     fbmin_img_depth, "(must be 1 or 3)");
-    return FBMIN_ERR_BAD_SD;
-  }
-
-  if (fbmin_img_bits < 1 || fbmin_img_bits > 8) {
-    fprintf (stderr, "Invalid number of bits (%d) on input %s\n",
-	     fbmin_img_bits, "(must be [1..8])");
-    return FBMIN_ERR_BAD_SD;
-  }
-
-  if (fbmin_img_physbits != 1 && fbmin_img_physbits != 8) {
-    fprintf (stderr, "Invalid number of physbits (%d) on input %s\n",
-	     fbmin_img_physbits, "(must be 1 or 8)");
-    return FBMIN_ERR_BAD_SD;
-  }
-
-  if (fbmin_img_rowlen < 1 || fbmin_img_rowlen > 32767) {
-    fprintf (stderr, "Invalid row length (%d) on input\n",
-	     fbmin_img_rowlen);
-    return FBMIN_ERR_BAD_SD;
-  }
-
-  if (fbmin_img_depth > 1 && fbmin_img_plnlen < 1) {
-    fprintf (stderr, "Invalid plane length (%d) on input\n",
-	     fbmin_img_plnlen);
-    return FBMIN_ERR_BAD_SD;
-  }
-
-  if (fbmin_img_aspect < 0.01 || fbmin_img_aspect > 100.0) {
-    fprintf (stderr, "Invalid aspect ratio %lg on input\n",
-	     fbmin_img_aspect);
-    return FBMIN_ERR_BAD_SD;
-  }
-    return FBMIN_SUCCESS;
-}
-
 #if 0
 /*
  * semi-graceful fatal error mechanism
@@ -199,7 +200,6 @@
   Image *image;
   register int    x, y, j, k, rowlen, plnlen;
   unsigned char *pixptr, *cm;
-  extern int Scrn;
   unsigned char *r, *g, *b;
 
   if (! (zf= zopen(fullname)))
Index: kit/image/g3.c
diff -u kit/image/g3.c:1.3 kit/image/g3.c:1.4
--- kit/image/g3.c:1.3	Sat Sep  5 00:07:08 1998
+++ kit/image/g3.c	Mon Dec 28 17:23:00 1998
@@ -69,8 +69,9 @@
 
 tableentry *whash[HASHSIZE];
 tableentry *bhash[HASHSIZE];
-
-int	g3_addtohash(hash, te, n, a, b)
+
+static
+void	g3_addtohash(hash, te, n, a, b)
 	tableentry	*hash[];
 	tableentry	*te;
 	int	n, a, b;
@@ -85,14 +86,72 @@
 			cleanup(-1);
 #else
 			++g3_error;
-			return(-1);
+			return;
 #endif
 			}
 		hash[pos] = te;
 		te++;
 	}
 }
-
+
+int	g3_rawgetbit(fd)
+	ZFILE	*fd;
+{
+	int	b;
+	static int	shdata;
+
+	if (curbit >= 8) {
+		shdata = zgetc(fd);
+		if (shdata == EOF) {
+#ifdef ALLOW_G3_ERRORS
+		        if (g3_verb) fprintf(stderr, "G3: Premature EOF at line %d.\n", rows);
+			g3_eols = 5;
+			g3_eof = 1;
+			++g3_error;
+			return 0;
+#else
+			return(-1);
+#endif
+			}
+		curbit = 0;
+		}
+	if (shdata & bmask[curbit]) {
+		g3_Xrawzeros = g3_rawzeros;
+		g3_rawzeros = 0;
+		b = 1;
+		}
+	else {
+		g3_rawzeros++;
+		b = 0;
+		}
+	curbit++;
+    return b;
+}
+
+static
+int	g3_bitson(b, c, n)
+	bit	*b;
+	int	c, n;
+{
+	int	i, col;
+	bit	*bP;
+	static int	bitmask[] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
+
+	bP = b;
+	col = c;
+	bP+=(c/8);
+	i = (c - ((c/8)*8));
+	while(col <= (c+n)) { 
+		for(;col <= (c+n) && i < 8; i++) {
+			*bP |= bitmask[i];
+			col++;
+			}
+		i = 0;
+		bP++;
+		}
+	return(0);
+}
+
 tableentry	*g3_hashfind(hash, length, code, a, b)
 	tableentry	*hash[];
 	int	length, code;
@@ -115,7 +174,7 @@
 	te = hash[pos];
 	return ((te && te->length == length && te->code == code) ? te : 0);
 }
-
+
 int	g3_getfaxrow(fd, bitrow)
 	ZFILE	*fd;
 	byte	*bitrow;
@@ -241,64 +300,8 @@
 	while(!g3_rawgetbit(fd) && !g3_eof);
 	return(0);
 }
-
-int	g3_rawgetbit(fd)
-	ZFILE	*fd;
-{
-	int	b;
-	static int	shdata;
 
-	if (curbit >= 8) {
-		shdata = zgetc(fd);
-		if (shdata == EOF) {
-#ifdef ALLOW_G3_ERRORS
-		        if (g3_verb) fprintf(stderr, "G3: Premature EOF at line %d.\n", rows);
-			g3_eols = 5;
-			g3_eof = 1;
-			++g3_error;
-			return 0;
-#else
-			return(-1);
-#endif
-			}
-		curbit = 0;
-		}
-	if (shdata & bmask[curbit]) {
-		g3_Xrawzeros = g3_rawzeros;
-		g3_rawzeros = 0;
-		b = 1;
-		}
-	else {
-		g3_rawzeros++;
-		b = 0;
-		}
-	curbit++;
-    return b;
-}
-
-int	g3_bitson(b, c, n)
-	bit	*b;
-	int	c, n;
-{
-	int	i, col;
-	bit	*bP;
-	static int	bitmask[] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
 
-	bP = b;
-	col = c;
-	bP+=(c/8);
-	i = (c - ((c/8)*8));
-	while(col <= (c+n)) { 
-		for(;col <= (c+n) && i < 8; i++) {
-			*bP |= bitmask[i];
-			col++;
-			}
-		i = 0;
-		bP++;
-		}
-	return(0);
-}
-
 /* All G3 images begin with a G3 EOL codeword which is eleven binary 0's
  * followed by one binary 1.  There could be up to 15 0' so that the image
  * starts on a char boundary.
@@ -314,7 +317,7 @@
 	ZFILE	*fd;
 {
 
-    int		ret = 0, col1, col2, i;
+    int		ret=0, col1=0, col2=0, i;
     byte	*tmpline;
     int		reverse = 0;
     struct cache	*dataptr;
@@ -473,7 +476,7 @@
 	Image *image;
 
 	g3_verb = 0;
-	if (image= g3Load(fullname, name, 1)) {
+	if ((image = g3Load(fullname, name, 1))) {
 		freeImage(image);
 		return(1);
 	}
Index: kit/image/gif.c
diff -u kit/image/gif.c:1.3 kit/image/gif.c:1.4
--- kit/image/gif.c:1.3	Sat Sep  5 00:07:09 1998
+++ kit/image/gif.c	Mon Dec 28 17:23:01 1998
@@ -473,7 +473,7 @@
  * add a new string to the string table
  */
 
-static gifin_add_string(p, e)
+static void gifin_add_string(p, e)
      int p;
      int e;
 {
@@ -493,7 +493,7 @@
  * semi-graceful fatal error mechanism
  */
 
-static gifin_fatal(msg)
+static void gifin_fatal(msg)
      char *msg;
 {
   fprintf(stderr, "Error reading GIF file: %s\n", msg);
Index: kit/image/gif.h
diff -u kit/image/gif.h:1.1.1.1 kit/image/gif.h:1.2
--- kit/image/gif.h:1.1.1.1	Mon Oct 27 00:26:14 1997
+++ kit/image/gif.h	Mon Dec 28 17:23:03 1998
@@ -50,8 +50,8 @@
 static int gifin_skip_extension();
 static int gifin_read_data_block();
 static int gifin_push_string();
-static int gifin_add_string();
-static int gifin_fatal();
+static void gifin_add_string();
+static void gifin_fatal();
 
 /* #defines, typedefs, and such
  */
Index: kit/image/halftone.c
diff -u kit/image/halftone.c:1.2 kit/image/halftone.c:1.3
--- kit/image/halftone.c:1.2	Fri Feb 13 16:48:48 1998
+++ kit/image/halftone.c	Mon Dec 28 17:23:04 1998
@@ -130,23 +130,23 @@
 #define GRAYSTEP ((unsigned long)(65536 / GRAYS))
 
 static byte DitherBits[GRAYS][4] = {
-  0xf, 0xf, 0xf, 0xf,
-  0xe, 0xf, 0xf, 0xf,
-  0xe, 0xf, 0xb, 0xf,
-  0xa, 0xf, 0xb, 0xf,
-  0xa, 0xf, 0xa, 0xf,
-  0xa, 0xd, 0xa, 0xf,
-  0xa, 0xd, 0xa, 0x7,
-  0xa, 0x5, 0xa, 0x7,
-  0xa, 0x5, 0xa, 0x5,
-  0x8, 0x5, 0xa, 0x5,
-  0x8, 0x5, 0x2, 0x5,
-  0x0, 0x5, 0x2, 0x5,
-  0x0, 0x5, 0x0, 0x5,
-  0x0, 0x4, 0x0, 0x5,
-  0x0, 0x4, 0x0, 0x1,
-  0x0, 0x0, 0x0, 0x1,
-  0x0, 0x0, 0x0, 0x0
+  { 0xf, 0xf, 0xf, 0xf },
+  { 0xe, 0xf, 0xf, 0xf },
+  { 0xe, 0xf, 0xb, 0xf },
+  { 0xa, 0xf, 0xb, 0xf },
+  { 0xa, 0xf, 0xa, 0xf },
+  { 0xa, 0xd, 0xa, 0xf },
+  { 0xa, 0xd, 0xa, 0x7 },
+  { 0xa, 0x5, 0xa, 0x7 },
+  { 0xa, 0x5, 0xa, 0x5 },
+  { 0x8, 0x5, 0xa, 0x5 },
+  { 0x8, 0x5, 0x2, 0x5 },
+  { 0x0, 0x5, 0x2, 0x5 },
+  { 0x0, 0x5, 0x0, 0x5 },
+  { 0x0, 0x4, 0x0, 0x5 },
+  { 0x0, 0x4, 0x0, 0x1 },
+  { 0x0, 0x0, 0x0, 0x1 },
+  { 0x0, 0x0, 0x0, 0x0 }
 };
 
 /* simple dithering algorithm, really optimized for the 4x4 array
Index: kit/image/image.h
diff -u kit/image/image.h:1.4 kit/image/image.h:1.5
--- kit/image/image.h:1.4	Thu Dec 17 14:23:42 1998
+++ kit/image/image.h	Mon Dec 28 17:23:05 1998
@@ -205,3 +205,5 @@
 extern unsigned short RedIntensity[];
 extern unsigned short GreenIntensity[];
 extern unsigned short BlueIntensity[];
+
+extern void cleanup(int);
Index: kit/image/imagetypes.c
diff -u kit/image/imagetypes.c:1.3 kit/image/imagetypes.c:1.4
--- kit/image/imagetypes.c:1.3	Sat Sep  5 00:07:09 1998
+++ kit/image/imagetypes.c	Mon Dec 28 17:23:06 1998
@@ -16,6 +16,7 @@
 /* SUPPRESS 560 */
 
 extern int errno;
+extern int findImage(char *, char *);
 
 /* load a named image
  */
@@ -35,7 +36,7 @@
     return(NULL);
   }
   for (a= 0; ImageTypes[a].loader; a++)
-    if (image= ImageTypes[a].loader(fullname, name, verbose)) {
+    if ((image = ImageTypes[a].loader(fullname, name, verbose))) {
       zreset(NULL);
       return(image);
     }
Index: kit/image/imagetypes.h
diff -u kit/image/imagetypes.h:1.1.1.1 kit/image/imagetypes.h:1.2
--- kit/image/imagetypes.h:1.1.1.1	Mon Oct 27 00:26:14 1997
+++ kit/image/imagetypes.h	Mon Dec 28 17:23:08 1998
@@ -49,21 +49,21 @@
   Image *(*loader)();     /* load image if this kind of image */
   char  *name;            /* name of this image format */
 } ImageTypes[] = {
-  fbmIdent,       fbmLoad,       "FBM Image",
-  sunRasterIdent, sunRasterLoad, "Sun Rasterfile",
-  cmuwmIdent,     cmuwmLoad,     "CMU WM Raster",
-  pbmIdent,       pbmLoad,       "Portable Bit Map (PBM, PGM, PPM)",
-  facesIdent,     facesLoad,     "Faces Project",
-  gifIdent,       gifLoad,       "GIF Image",
-  rleIdent,       rleLoad,       "Utah RLE Image",
-  jpegIdent,      jpegLoad,      "JFIF-style JPEG Image",
-  xwdIdent,       xwdLoad,       "X Window Dump",
-  mcidasIdent,    mcidasLoad,    "McIDAS areafile",
-  g3Ident,        g3Load,        "G3 FAX Image",
-  pcxIdent,       pcxLoad,       "PC Paintbrush Image",
-  imgIdent,       imgLoad,       "GEM Bit Image",
-  macIdent,       macLoad,       "MacPaint Image",
-  xpixmapIdent,   xpixmapLoad,   "X Pixmap",
-  xbitmapIdent,   xbitmapLoad,   "X Bitmap",
-  NULL,           NULL,          NULL
+  { fbmIdent,       fbmLoad,       "FBM Image" },
+  { sunRasterIdent, sunRasterLoad, "Sun Rasterfile" },
+  { cmuwmIdent,     cmuwmLoad,     "CMU WM Raster" },
+  { pbmIdent,       pbmLoad,       "Portable Bit Map (PBM, PGM, PPM)" },
+  { facesIdent,     facesLoad,     "Faces Project" },
+  { gifIdent,       gifLoad,       "GIF Image" },
+  { rleIdent,       rleLoad,       "Utah RLE Image" },
+  { jpegIdent,      jpegLoad,      "JFIF-style JPEG Image" },
+  { xwdIdent,       xwdLoad,       "X Window Dump" },
+  { mcidasIdent,    mcidasLoad,    "McIDAS areafile" },
+  { g3Ident,        g3Load,        "G3 FAX Image" },
+  { pcxIdent,       pcxLoad,       "PC Paintbrush Image" },
+  { imgIdent,       imgLoad,       "GEM Bit Image" },
+  { macIdent,       macLoad,       "MacPaint Image" },
+  { xpixmapIdent,   xpixmapLoad,   "X Pixmap" },
+  { xbitmapIdent,   xbitmapLoad,   "X Bitmap" },
+  { NULL,           NULL,          NULL }
 };
Index: kit/image/jpeg.c
diff -u kit/image/jpeg.c:1.4 kit/image/jpeg.c:1.5
--- kit/image/jpeg.c:1.4	Thu Oct  1 17:13:04 1998
+++ kit/image/jpeg.c	Mon Dec 28 17:23:09 1998
@@ -62,7 +62,6 @@
 	struct decompress_info_struct cinfo;
 	struct decompress_methods_struct dc_methods;
 	struct external_methods_struct e_methods;
-	int c;
 	int retv = 0;
 
 	/* Initialize the system-dependent method pointers. */
@@ -119,7 +118,6 @@
 	struct decompress_info_struct cinfo;
 	struct decompress_methods_struct dc_methods;
 	struct external_methods_struct e_methods;
-	int c;
 
 	/* Initialize the system-dependent method pointers. */
 	cinfo.methods = &dc_methods;
@@ -438,7 +436,8 @@
 
   if (cinfo->verbose)
   {
-    fprintf(stderr, "%s is a %dx%d JPEG Image, color space ",cinfo->filename,cinfo->image_width,cinfo->image_height);
+    fprintf(stderr, "%s is a %dx%d JPEG Image, color space ",
+	    cinfo->filename, (int) cinfo->image_width, (int) cinfo->image_height);
 	switch (cinfo->jpeg_color_space)
     {
       case CS_UNKNOWN:
@@ -1261,10 +1260,6 @@
 
 static int rows_in_mem;		/* # of sample rows in full-size buffers */
 /* Full-size image array holding desubsampled, color-converted data. */
-static big_sarray_ptr *fullsize_cnvt_image;
-static JSAMPIMAGE fullsize_cnvt_ptrs; /* workspace for access_big_sarray() results */
-/* Work buffer for color quantization output (full size, only 1 component). */
-static JSAMPARRAY quantize_out;
 
 
 /*
Index: kit/image/mcidas.c
diff -u kit/image/mcidas.c:1.3 kit/image/mcidas.c:1.4
--- kit/image/mcidas.c:1.3	Sat Sep  5 00:07:11 1998
+++ kit/image/mcidas.c	Mon Dec 28 17:23:11 1998
@@ -114,12 +114,12 @@
   if (verbose)
     (void)fprintf(stderr, "%s %d %d (%d, %d) (%d, %d)\n",
 		 mc_sensor(dir.satid),
-		 dir.idate,
-		 dir.itime,
-		 dir.lcor,
-		 dir.ecor,
-		 dir.lres,
-		 dir.eres) ;
+		 (int) dir.idate,
+		 (int) dir.itime,
+		 (int) dir.lcor,
+		 (int) dir.ecor,
+		 (int) dir.lres,
+		 (int) dir.eres) ;
   znocache(zf);
   /* skip the nav */
   if( zread(zf, (byte *)&nav, sizeof(struct navigation)) !=
Index: kit/image/misc.c
diff -u kit/image/misc.c:1.4 kit/image/misc.c:1.5
--- kit/image/misc.c:1.4	Sat Sep  5 00:07:12 1998
+++ kit/image/misc.c	Mon Dec 28 17:23:12 1998
@@ -156,10 +156,10 @@
   }
 
   if (options->xzoom || options->yzoom) { /* zoom image */
-    if (!options->colors && RGBP(image) &&             /* if the image is to */
-	(!options->xzoom && (options->yzoom > 100)) || /* be blown up, */
-	(!options->yzoom && (options->xzoom > 100)) || /* compress before */
-	(options->xzoom + options->yzoom > 200)) {     /* doing it */
+    if (!options->colors && RGBP(image) &&              /* if the image is to */
+	((!options->xzoom && (options->yzoom > 100)) || /* be blown up, */
+	 (!options->yzoom && (options->xzoom > 100)) || /* compress before */
+	 (options->xzoom + options->yzoom > 200))) {    /* doing it */
       compress(image, verbose);
       compressed= 1;
     }
@@ -245,7 +245,7 @@
 { char errortext[BUFSIZ];
 
   XGetErrorText(disp, error->error_code, errortext, BUFSIZ);
-  fprintf(stderr, "xloadimage: X Error: %s on 0x%x\n",
+  fprintf(stderr, "xloadimage: X Error: %s on 0x%lx\n",
 	  errortext, error->resourceid);
   if (_Xdebug) /* if -debug mode is enabled, dump a core when we hit this */
     abort();
Index: kit/image/new.c
diff -u kit/image/new.c:1.2 kit/image/new.c:1.3
--- kit/image/new.c:1.2	Fri Feb 13 16:48:58 1998
+++ kit/image/new.c	Mon Dec 28 17:23:13 1998
@@ -11,7 +11,11 @@
 #include "copyright.h"
 #include "image.h"
 
+#include <malloc.h>
+
 extern int _Xdebug;
+extern void memoryExhausted(void);
+
 
 /* this table is useful for quick conversions between depth and ncolors
  */
@@ -117,7 +121,7 @@
 Image *newRGBImage(width, height, depth)
      unsigned int width, height, depth;
 { Image        *image;
-  unsigned int  pixlen, numcolors, a;
+  unsigned int  pixlen, numcolors;
 
   pixlen= (depth / 8) + (depth % 8 ? 1 : 0);
   if (pixlen == 0) /* special case for `zero' depth image, which is */
@@ -139,7 +143,6 @@
 Image *newTrueImage(width, height)
      unsigned int width, height;
 { Image        *image;
-  unsigned int  pixlen, numcolors, a;
 
   image= (Image *)lmalloc(sizeof(Image));
   image->type= ITRUE;
Index: kit/image/pbm.c
diff -u kit/image/pbm.c:1.3 kit/image/pbm.c:1.4
--- kit/image/pbm.c:1.3	Sat Sep  5 00:07:13 1998
+++ kit/image/pbm.c	Mon Dec 28 17:23:14 1998
@@ -188,16 +188,16 @@
      char         *fullname, *name;
      unsigned int  verbose;
 { ZFILE        *zf;
-  Image        *image;
+  Image        *image=NULL;
   int           pbm_type;
   unsigned int  x, y;
   unsigned int  width, height, maxval, depth;
   unsigned int  linelen;
   byte          srcmask, destmask;
-  byte         *destptr, *destline;
-  int           src, size;
+  byte         *destptr=NULL, *destline;
+  int           src=0, size;
   unsigned int  numbytes, numread;
-  int           red, grn, blu;
+  int           red=0, grn=0, blu=0;
 
   if (! (zf= zopen(fullname)))
     return(NULL);
Index: kit/image/pcx.c
diff -u kit/image/pcx.c:1.3 kit/image/pcx.c:1.4
--- kit/image/pcx.c:1.3	Sat Sep  5 00:07:13 1998
+++ kit/image/pcx.c	Mon Dec 28 17:23:16 1998
@@ -259,7 +259,6 @@
 	ZFILE *zf;
 	Image *image;
 {
-	int pl;
 	switch (PCXH->Zbpp) {	/* What kind of plane do we have ?	*/
 	    case 1 :			/* Bit planes			*/
 		if (PCXH->Znplanes == 1)	/* Only one : Read it	*/
@@ -298,7 +297,7 @@
 	unsigned int verbose;
 {
 	ZFILE *zf;
-	unsigned int i, ret;
+	unsigned int i;
 	int xmin;
 	int xmax;
 	int ymin;
Index: kit/image/reduce.c
diff -u kit/image/reduce.c:1.4 kit/image/reduce.c:1.5
--- kit/image/reduce.c:1.4	Sun Apr 12 12:32:16 1998
+++ kit/image/reduce.c	Mon Dec 28 17:23:17 1998
@@ -20,6 +20,8 @@
 #include "copyright.h"
 #include "image.h"
 
+#include <stdlib.h> /* for qsort */
+
 #define DIST(A, B) ((A) < (B) ? (B) - (A) : (A) - (B))
 
 /* find the distance between two colors.  we loose some accuracy here because
@@ -88,7 +90,7 @@
 /* predicate functions for qsort
  */
 
-static sortRGB(p1, p2)
+static int sortRGB(p1, p2)
      unsigned short *p1, *p2;
 { unsigned int red1, green1, blue1, red2, green2, blue2;
 
@@ -115,7 +117,7 @@
     return(1);
 }
 
-static sortRBG(p1, p2)
+static int sortRBG(p1, p2)
      unsigned short *p1, *p2;
 { unsigned int red1, green1, blue1, red2, green2, blue2;
 
@@ -142,7 +144,7 @@
     return(1);
 }
 
-static sortGRB(p1, p2)
+static int sortGRB(p1, p2)
      unsigned short *p1, *p2;
 { unsigned int red1, green1, blue1, red2, green2, blue2;
 
@@ -169,7 +171,7 @@
     return(1);
 }
 
-static sortGBR(p1, p2)
+static int sortGBR(p1, p2)
      unsigned short *p1, *p2;
 { unsigned int red1, green1, blue1, red2, green2, blue2;
 
@@ -196,7 +198,7 @@
     return(1);
 }
 
-static sortBRG(p1, p2)
+static int sortBRG(p1, p2)
      unsigned short *p1, *p2;
 { unsigned int red1, green1, blue1, red2, green2, blue2;
 
@@ -223,7 +225,7 @@
     return(1);
 }
 
-static sortBGR(p1, p2)
+static int sortBGR(p1, p2)
      unsigned short *p1, *p2;
 { unsigned int red1, green1, blue1, red2, green2, blue2;
 
@@ -254,7 +256,7 @@
  * the color area in the list of color areas.
  */
 
-static insertColorArea(pixel_counts, rlargest, rsmallest, area)
+static void insertColorArea(pixel_counts, rlargest, rsmallest, area)
      unsigned long *pixel_counts;
      struct color_area **rlargest, **rsmallest, *area;
 { int a;
@@ -368,7 +370,7 @@
 { unsigned long pixel_counts[32768]; /* pixel occurrance histogram */
   unsigned short pixel_array[32768];
   unsigned long count, midpoint;
-  int x, y, num_pixels, allocated, depth, ncolors;
+  int x, y, num_pixels, allocated, depth;
   byte *pixel, *dpixel;
   struct color_area *areas, *largest_area, *smallest_area;
   struct color_area *new_area, *old_area;
Index: kit/image/rle.c
diff -u kit/image/rle.c:1.2 kit/image/rle.c:1.3
--- kit/image/rle.c:1.2	Fri Feb 13 16:49:01 1998
+++ kit/image/rle.c	Mon Dec 28 17:23:18 1998
@@ -19,6 +19,7 @@
 
 #define MIN(a,b) ( (a)<(b) ? (a) : (b))
 
+#include <stdlib.h>
 #include <math.h>
 #include <stdio.h>
 #include "image.h"
@@ -32,8 +33,8 @@
 #define BW_M	1		/* black and white, and a map */
 #define SC_M	2		/* single colour channel and colour map */
 #define C_NM	3		/* full colour, no maps */
-#define C_M		4		/* full colour with colour maps */
-static rle_pixel **fmaps;		/* file colour maps from buildmap() */
+#define C_M	4		/* full colour with colour maps */
+static rle_pixel **fmaps;	/* file colour maps from buildmap() */
 static unsigned char **scan;	/* buffer for input data */
 static int x_min;		/* copy of picture x_min */
 static int y_min;		/* copy of picture y_min */
@@ -52,6 +53,53 @@
 int modN[256];
 int divN[256];
 
+#define DMAP(v,x,y)	(modN[v]>magic[x][y] ? divN[v] + 1 : divN[v])
+
+/* run the black and white through its map */
+static void bw_m_line(dp,number)
+     int number;
+     register unsigned char *dp;
+{
+  register unsigned char *r;
+  register int i;
+  
+  for(i=number,r= &scan[0][0];i>0;i--,r++,dp++)
+    {
+      *dp = fmaps[0][*r];
+    }
+}
+
+/* convert a colour line with map to 8 bits per pixel */
+static void c_m_line(dp,number,line)
+     int number,line;
+     register unsigned char *dp;
+{
+  register unsigned char *r, *g, *b;
+  register int i, col, row;
+  
+  if(!bwflag)
+    {		
+      for ( row = line % dith_size, col = x_min % dith_size, i = number, r = &scan[0][0]
+	   ,g= &scan[1][0], b= &scan[2][0];
+	   i > 0; i--, r++, g++, b++, dp++, col = ((col + 1) % dith_size) )
+	{
+	  *dp = DMAP(fmaps[0][*r], col, row) +
+	    DMAP(fmaps[1][*g], col, row) * 6 +
+	      DMAP(fmaps[2][*b], col, row) * 36;
+	}
+    }
+  else
+    {
+      int red,green,blue;
+      for (i = number, r= &scan[0][0], g= &scan[1][0]
+	   ,b= &scan[2][0]; i>0;i--,r++,g++,b++,dp++)
+	{
+	  red = fmaps[0][*r];green=fmaps[1][*g];blue = fmaps[2][*b];
+	  *dp = 0.35* red + 0.55* green + 0.1* blue;
+	}
+    }
+}
+
 int rleIdent(fullname, name)
      char *fullname, *name;
 {
@@ -391,49 +439,3 @@
   return(image);
 }
 
-#define DMAP(v,x,y)	(modN[v]>magic[x][y] ? divN[v] + 1 : divN[v])
-
-/* run the black and white through its map */
-bw_m_line(dp,number)
-     int number;
-     register unsigned char *dp;
-{
-  register unsigned char *r;
-  register int i;
-  
-  for(i=number,r= &scan[0][0];i>0;i--,r++,dp++)
-    {
-      *dp = fmaps[0][*r];
-    }
-}
-
-/* convert a colour line with map to 8 bits per pixel */
-c_m_line(dp,number,line)
-     int number,line;
-     register unsigned char *dp;
-{
-  register unsigned char *r, *g, *b;
-  register int i, col, row;
-  
-  if(!bwflag)
-    {		
-      for ( row = line % dith_size, col = x_min % dith_size, i = number, r = &scan[0][0]
-	   ,g= &scan[1][0], b= &scan[2][0];
-	   i > 0; i--, r++, g++, b++, dp++, col = ((col + 1) % dith_size) )
-	{
-	  *dp = DMAP(fmaps[0][*r], col, row) +
-	    DMAP(fmaps[1][*g], col, row) * 6 +
-	      DMAP(fmaps[2][*b], col, row) * 36;
-	}
-    }
-  else
-    {
-      int red,green,blue;
-      for (i = number, r= &scan[0][0], g= &scan[1][0]
-	   ,b= &scan[2][0]; i>0;i--,r++,g++,b++,dp++)
-	{
-	  red = fmaps[0][*r];green=fmaps[1][*g];blue = fmaps[2][*b];
-	  *dp = 0.35* red + 0.55* green + 0.1* blue;
-	}
-    }
-}
Index: kit/image/rle.h
diff -u kit/image/rle.h:1.1.1.1 kit/image/rle.h:1.2
--- kit/image/rle.h:1.1.1.1	Mon Oct 27 00:26:15 1997
+++ kit/image/rle.h	Mon Dec 28 17:23:19 1998
@@ -27,6 +27,8 @@
  * 
  * Added optimised dither square size globals
  * 88/07/13 Graeme W. Gill
+ *
+ * Added extern declarations. Carlos Puchol, 12/27/98.
  */
 
 enum sv_dispatch {
@@ -191,3 +193,7 @@
 extern int dith_np2;	/* set non-zero to use non-power_of_2 matrix size */
 extern int dith_size;	/* effective size of the dither matrix chosen */
 
+
+extern int rle_get_setup(struct sv_globals *);
+extern int rle_getrow(struct sv_globals *, rle_pixel **);
+extern void make_gamma(double gamma, int gammamap[]);
Index: kit/image/rlelib.c
diff -u kit/image/rlelib.c:1.2 kit/image/rlelib.c:1.3
--- kit/image/rlelib.c:1.2	Sat Sep  5 00:07:14 1998
+++ kit/image/rlelib.c	Mon Dec 28 17:23:21 1998
@@ -822,7 +822,7 @@
  * Algorithm:
  * 	Read in the setup info and fill in sv_globals.
  */
-rle_get_setup( globals )
+int rle_get_setup( globals )
 struct sv_globals * globals;
 {
     struct XtndRsetup setup;
@@ -982,7 +982,8 @@
  *	Returns code.
  */
 
-rle_get_error( code, pgmname, fname )
+int rle_get_error( code, pgmname, fname )
+int code;
 char *pgmname;
 char *fname;
 {
@@ -1101,7 +1102,7 @@
  *	decoding the instructions into scanline data.
  */
 
-rle_getrow( globals, scanline )
+int rle_getrow( globals, scanline )
 struct sv_globals * globals;
 rle_pixel *scanline[];
 {
@@ -1469,7 +1470,76 @@
     make_square( N, divN, modN, magic );
 }
 
+int magic16x16[16][16] = 
+	{
+		{0,128,32,160,8,136,40,168,2,130,34,162,10,138,42,170},
+		{192,64,224,96,200,72,232,104,194,66,226,98,202,74,234,106},
+		{48,176,16,144,56,184,24,152,50,178,18,146,58,186,26,154},
+		{240,112,208,80,248,120,216,88,242,114,210,82,250,122,218,90},
+		{12,140,44,172,4,132,36,164,14,142,46,174,6,134,38,166},
+		{204,76,236,108,196,68,228,100,206,78,238,110,198,70,230,102},
+		{60,188,28,156,52,180,20,148,62,190,30,158,54,182,22,150},
+		{252,124,220,92,244,116,212,84,254,126,222,94,246,118,214,86},
+		{3,131,35,163,11,139,43,171,1,129,33,161,9,137,41,169},
+		{195,67,227,99,203,75,235,107,193,65,225,97,201,73,233,105},
+		{51,179,19,147,59,187,27,155,49,177,17,145,57,185,25,153},
+		{243,115,211,83,251,123,219,91,241,113,209,81,249,121,217,89},
+		{15,143,47,175,7,135,39,167,13,141,45,173,5,133,37,165},
+		{207,79,239,111,199,71,231,103,205,77,237,109,197,69,229,101},
+		{63,191,31,159,55,183,23,151,61,189,29,157,53,181,21,149},
+		{255,127,223,95,247,119,215,87,253,125,221,93,245,117,213,85}
+	};
+
+/*****************************************************************
+ * TAG( make_magic )
+     * 
+ * Create the magic square.
+ * Inputs:
+ * 	size:		Order of the square
+ *  magic:		Address of 16 x 16 magic square.
+ * Outputs:
+ * 	Fills in the 16 x 16 magic square.
+ * Assumptions:
+ * 	size is between 2 and 16
+ * Algorithm:
+ * 	Chose sub cell of 16 by 16 magic square
+     */
+static void
+make_magic( size, magic )
+int size;
+int magic[16][16];
+{
+	int j,i,li,bi,bx=0,by=0;
+	int xx,yy;
+	int total;
+
+	total = size * size;
+
+	i = 0;
+	li = -1;
+	for(j=0;j<total;j++)	
+	{
+		bi = 256;
+
+		for(xx=0;xx<size;xx++)
+		{
+			for(yy=0;yy<size;yy++)
+			{
+				if(magic16x16[xx][yy] >li && magic16x16[xx][yy] < bi)
+				{
+					bx = xx;
+					by = yy;
+					bi = magic16x16[xx][yy];
+				}
+			}
+		}
+		magic[bx][by] = i;
+		i++;
+		li = bi;
+	}
+}
 
+
 /*****************************************************************
  * TAG( make_square )
  * 
@@ -1553,75 +1623,7 @@
 	}
 }
 
-int magic16x16[16][16] = 
-	{
-		{0,128,32,160,8,136,40,168,2,130,34,162,10,138,42,170},
-		{192,64,224,96,200,72,232,104,194,66,226,98,202,74,234,106},
-		{48,176,16,144,56,184,24,152,50,178,18,146,58,186,26,154},
-		{240,112,208,80,248,120,216,88,242,114,210,82,250,122,218,90},
-		{12,140,44,172,4,132,36,164,14,142,46,174,6,134,38,166},
-		{204,76,236,108,196,68,228,100,206,78,238,110,198,70,230,102},
-		{60,188,28,156,52,180,20,148,62,190,30,158,54,182,22,150},
-		{252,124,220,92,244,116,212,84,254,126,222,94,246,118,214,86},
-		{3,131,35,163,11,139,43,171,1,129,33,161,9,137,41,169},
-		{195,67,227,99,203,75,235,107,193,65,225,97,201,73,233,105},
-		{51,179,19,147,59,187,27,155,49,177,17,145,57,185,25,153},
-		{243,115,211,83,251,123,219,91,241,113,209,81,249,121,217,89},
-		{15,143,47,175,7,135,39,167,13,141,45,173,5,133,37,165},
-		{207,79,239,111,199,71,231,103,205,77,237,109,197,69,229,101},
-		{63,191,31,159,55,183,23,151,61,189,29,157,53,181,21,149},
-		{255,127,223,95,247,119,215,87,253,125,221,93,245,117,213,85}
-	};
-
 /*****************************************************************
- * TAG( make_magic )
-     * 
- * Create the magic square.
- * Inputs:
- * 	size:		Order of the square
- *  magic:		Address of 16 x 16 magic square.
- * Outputs:
- * 	Fills in the 16 x 16 magic square.
- * Assumptions:
- * 	size is between 2 and 16
- * Algorithm:
- * 	Chose sub cell of 16 by 16 magic square
-     */
-make_magic( size, magic )
-int size;
-int magic[16][16];
-{
-	int j,i,li,bi,bx,by;
-	int xx,yy;
-	int total;
-
-	total = size * size;
-
-	i = 0;
-	li = -1;
-	for(j=0;j<total;j++)	
-	{
-		bi = 256;
-
-		for(xx=0;xx<size;xx++)
-		{
-			for(yy=0;yy<size;yy++)
-			{
-				if(magic16x16[xx][yy] >li && magic16x16[xx][yy] < bi)
-				{
-					bx = xx;
-					by = yy;
-					bi = magic16x16[xx][yy];
-				}
-			}
-		}
-		magic[bx][by] = i;
-		i++;
-		li = bi;
-	}
-}
-
-/*****************************************************************
  * TAG( make_gamma )
  * 
  * Makes a gamma compenstation map.
@@ -1631,6 +1633,7 @@
  * Outputs:
  *  Changes gamma array entries.
  */
+void
 make_gamma( gamma, gammamap )
 double gamma;
 int gammamap[256];
@@ -1668,6 +1671,7 @@
  * Algorithm:
  * 	see "Note:" in dithermap comment.
  */
+int
 dithergb( x, y, r, g, b, levels, divN, modN, magic )
 int divN[256];
 int modN[256];
@@ -1698,6 +1702,7 @@
  * Algorithm:
  * 	see "Note:" in bwdithermap comment.
  */
+int
 ditherbw( x, y, val, divN, modN, magic )
 int divN[256];
 int modN[256];
Index: kit/image/rotate.c
diff -u kit/image/rotate.c:1.3 kit/image/rotate.c:1.4
--- kit/image/rotate.c:1.3	Sat Sep  5 00:07:15 1998
+++ kit/image/rotate.c	Mon Dec 28 17:23:22 1998
@@ -43,7 +43,7 @@
 { 
   char buf[BUFSIZ];			/* New title                   */
   Image    *image1;			/* Source image                */
-  Image    *image2;			/* Destination image           */
+  Image    *image2=NULL;		/* Destination image           */
   byte         *sp;			/* Pointer to source data      */
   byte         *dp;			/* Pointer to destination data */
   int     slinelen;			/* Length of source line       */
@@ -51,7 +51,6 @@
   int       bit[8];			/* Array of hex values         */
   int         x, y;
   int         i, b;
-  int   newx, newy;
   int   newi, newb;
   byte      **yptr;
 
Index: kit/image/send.c
diff -u kit/image/send.c:1.4 kit/image/send.c:1.5
--- kit/image/send.c:1.4	Sat Sep  5 00:07:15 1998
+++ kit/image/send.c	Mon Dec 28 17:23:23 1998
@@ -26,7 +26,7 @@
     GotError = 1;
     XGetErrorText(disp, pErrorEvent->error_code, buf, MAXERRORLEN);
     fprintf(stderr, "serial #%d (request code %d) Got Error %s\n",
-	pErrorEvent->serial,
+	(int) pErrorEvent->serial,
 	pErrorEvent->request_code,
 	buf);
     return(0);
@@ -89,6 +89,7 @@
 
   fprintf(stderr, "bitsPerPixelAtDepth: Can't find pixmap depth info!\n");
   cleanup(-1);
+  return (-1); /* To avoid -Wall warnings */
 }
      
 XImageInfo *imageToXImage(disp, scrn, visual, ddepth, image, private_cmap, fit,
@@ -103,7 +104,7 @@
      unsigned int  back;
      unsigned int  verbose;
 { Pixel        *index, *redvalue, *greenvalue, *bluevalue;
-  unsigned int  a, b, newmap, x, y, linelen, dpixlen, dbits, again_flag = 0;
+  unsigned int  a, b=0, newmap, x, y, linelen, dpixlen, dbits, again_flag=0;
   XColor        xcolor;
   XGCValues     gcv;
   XImageInfo   *ximageinfo;
@@ -168,7 +169,7 @@
       unsigned int redcolors, greencolors, bluecolors;
       unsigned int redstep, greenstep, bluestep;
       unsigned int redbottom, greenbottom, bluebottom;
-      unsigned int redtop, greentop, bluetop;
+      unsigned int redtop=0, greentop=0, bluetop=0;
 
       redvalue= (Pixel *)lmalloc(sizeof(Pixel) * 256);
       greenvalue= (Pixel *)lmalloc(sizeof(Pixel) * 256);
@@ -412,7 +413,7 @@
 	XUngrabServer(disp);
       }
       else {
-	for (b= 0; b < a; b++) {
+	for (b = 0; b < a; b++) {
 	  xcolor.pixel= *(index + b);
 	  xcolor.red= *(image->rgb.red + b);
 	  xcolor.green= *(image->rgb.green + b);
Index: kit/image/sunraster.c
diff -u kit/image/sunraster.c:1.3 kit/image/sunraster.c:1.4
--- kit/image/sunraster.c:1.3	Sat Sep  5 00:07:16 1998
+++ kit/image/sunraster.c	Mon Dec 28 17:23:24 1998
@@ -42,7 +42,8 @@
   default:
     fprintf(stderr, " unknown-type");
   }
-  fprintf(stderr, " %dx%d", memToVal(header->width, 4), memToVal(header->height, 4));
+  fprintf(stderr, " %ldx%ld",
+	  memToVal(header->width, 4), memToVal(header->height, 4));
 
   switch (memToVal(header->depth, 4)) {
   case 1:
@@ -167,7 +168,7 @@
   unsigned int    fill;      /* # of fill bytes per raster line */
   unsigned int    enc;
   byte            fillchar;
-  Image          *image;
+  Image          *image=NULL;
   byte           *lineptr;
   unsigned int    x, y;
 
@@ -233,7 +234,7 @@
   /*
    *  Handle color...
    */
-  if (mapsize= memToVal(header.maplen, 4)) {
+  if ((mapsize = memToVal(header.maplen, 4))) {
     map= lmalloc(mapsize);
     if (zread(zf, map, mapsize) < mapsize) {
       fprintf(stderr, "sunRasterLoad: Bad read on colormap\n");
Index: kit/image/window.c
diff -u kit/image/window.c:1.5 kit/image/window.c:1.6
--- kit/image/window.c:1.5	Sat Sep  5 00:07:17 1998
+++ kit/image/window.c	Mon Dec 28 17:23:26 1998
@@ -16,6 +16,9 @@
 #include <signal.h>
 #include <errno.h>
 #include <sys/types.h>
+#ifdef SYSV
+#include <unistd.h>
+#endif
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
@@ -244,7 +247,7 @@
     cmap_windows[0]= ImageWindow;
     cmap_windows[1]= ViewportWin;
     XChangeProperty(disp, ViewportWin, cmap_atom, XA_WINDOW, 32,
-		    PropModePrepend, cmap_windows, 2);
+		    PropModePrepend, (unsigned char *) cmap_windows, 2);
   }
 
 }
@@ -269,7 +272,7 @@
    * want to change this.
    */
 
-  if (t= rindex(buf, '/')) {
+  if ((t = rindex(buf, '/'))) {
     for (s= buf, t++; *t; s++, t++)
       *s= *t;
     *s= '\0';
@@ -287,14 +290,14 @@
   int   class; /* numerical value of class */
   char *name;  /* actual name of class */
 } VisualClassName[] = {
-  TrueColor,   "TrueColor",
-  DirectColor, "DirectColor",
-  PseudoColor, "PseudoColor",
-  StaticColor, "StaticColor",
-  GrayScale,   "GrayScale",
-  StaticGray,  "StaticGray",
-  StaticGray,  "StaticGrey",
-  -1,          NULL
+  { TrueColor,   "TrueColor" },
+  { DirectColor, "DirectColor" },
+  { PseudoColor, "PseudoColor" },
+  { StaticColor, "StaticColor" },
+  { GrayScale,   "GrayScale" },
+  { StaticGray,  "StaticGray" },
+  { StaticGray,  "StaticGrey" },
+  { -1,          NULL }
 };
 
 int visualClassFromName(name)
@@ -377,7 +380,7 @@
      unsigned int  *rdepth;
 { unsigned int  depth, a;
   Screen       *screen;
-  Visual       *visual, *default_visual;
+  Visual       *visual=NULL, *default_visual;
 
   /* figure out the best depth the server supports.  note that some servers
    * (such as the HP 11.3 server) actually say they support some depths but
@@ -541,7 +544,7 @@
   Visual               *visual;
   unsigned int          depth;
   Window                oldimagewindow;
-  Colormap              oldcmap;
+  Colormap              oldcmap=None;
   XSetWindowAttributes  swa_img;
   XSetWindowAttributes  swa_view;
   XClassHint            classhint;
@@ -549,7 +552,7 @@
   XSizeHints            sh;
   XWMHints              wmh;
   int                   pixx= -1, pixy= -1;
-  int                   lastx, lasty, mousex, mousey;
+  int                   lastx=0, lasty, mousex, mousey;
   int                   paint;
   static int            old_width= -1, old_height= -1;
   static Atom           proto_atom= None, delete_atom= None;
@@ -684,7 +687,7 @@
     delete_atom = XInternAtom(disp, "WM_DELETE_WINDOW", False);
     if ((proto_atom != None) && (delete_atom != None))
       XChangeProperty(disp, ViewportWin, proto_atom, XA_ATOM, 32,
-		      PropModePrepend, &delete_atom, 1);
+		      PropModePrepend, (unsigned char *) &delete_atom, 1);
    paint= 0;
   }
   else {
@@ -921,7 +924,7 @@
       mousex= event.button.x;
       mousey= event.button.y;
       /*XSync(disp, False); */
-      while (XCheckTypedEvent(disp, MotionNotify, &event) == True) {
+      while (XCheckTypedEvent(disp, MotionNotify, (XEvent *) &event) == True) {
 	mousex= event.button.x;
 	mousey= event.button.y;
       }
Index: kit/image/xbitmap.c
diff -u kit/image/xbitmap.c:1.4 kit/image/xbitmap.c:1.5
--- kit/image/xbitmap.c:1.4	Thu Dec 17 14:23:45 1998
+++ kit/image/xbitmap.c	Mon Dec 28 17:23:27 1998
@@ -137,7 +137,7 @@
   char          name_and_type[MAX_SIZE];
   char         *type;
   int           value;
-  int           v10p;
+  int           v10p=0;
   unsigned int  linelen, dlinelen;
   unsigned int  x, y;
   unsigned int  w = 0, h = 0;
@@ -252,7 +252,7 @@
      char         *fullname, *name;
 { Image *image;
 
-  if (image= xbitmapLoad(fullname, name, (unsigned int)1)) {
+  if ((image = xbitmapLoad(fullname, name, (unsigned int)1))) {
     freeImage(image);
     return(1);
   }
Index: kit/image/xpixmap.c
diff -u kit/image/xpixmap.c:1.5 kit/image/xpixmap.c:1.6
--- kit/image/xpixmap.c:1.5	Thu Dec 17 14:23:46 1998
+++ kit/image/xpixmap.c	Mon Dec 28 17:23:28 1998
@@ -51,7 +51,7 @@
   unsigned int   value;
   unsigned int   format;  /* image format */
   unsigned int   w, h;    /* image dimensions */
-  unsigned int   cpp;     /* chars per pixel */
+  unsigned int   cpp=0;   /* chars per pixel */
   unsigned int   ncolors; /* number of colors */
   unsigned int   depth;   /* depth of image */
   char         **ctable;  /* color table */
@@ -119,8 +119,8 @@
     return(NULL);
   }
 
-  if (p= rindex(what, '_')) {     /* get the name in the image if there is */
-    *p= '\0';                     /* one */
+  if ((p = rindex(what, '_'))) {     /* get the name in the image if there is */
+    *p= '\0';                        /* one */
     imagetitle= dupString(what);
   }
   else {
@@ -197,7 +197,7 @@
       break;
   }
 
-  if (p= rindex(what, '_'))
+  if ((p = rindex(what, '_')))
     p++;
   else
     p= what;
@@ -241,7 +241,7 @@
      char *fullname, *name;
 { Image *image;
 
-  if (image= xpixmapLoad(fullname, name, (unsigned int)1)) {
+  if ((image = xpixmapLoad(fullname, name, (unsigned int)1))) {
     freeImage(image);
     return(1);
   }
Index: kit/image/xwd.c
diff -u kit/image/xwd.c:1.3 kit/image/xwd.c:1.4
--- kit/image/xwd.c:1.3	Sat Sep  5 00:07:19 1998
+++ kit/image/xwd.c	Mon Dec 28 17:23:29 1998
@@ -411,7 +411,7 @@
   XWDHeader  header;
   int        cmaplen;
   XWDColor  *cmap;
-  Image     *image;
+  Image     *image=NULL;
   int        a;
 
   if (! (zf= zopen(fullname)))
Index: kit/image/zio.c
diff -u kit/image/zio.c:1.3 kit/image/zio.c:1.4
--- kit/image/zio.c:1.3	Sat Sep  5 00:07:19 1998
+++ kit/image/zio.c	Mon Dec 28 17:23:31 1998
@@ -109,7 +109,7 @@
   while (ZFileTable[a].data) {
     old= ZFileTable[a].data;
     ZFileTable[a].data= ZFileTable[a].data->next;
-    free(old);
+    lfree(old);
   }
   lfree((byte *)ZFileTable[a].filename);
   ZFileTable[a].filename= NULL;
Index: kit/image/zoom.c
diff -u kit/image/zoom.c:1.2 kit/image/zoom.c:1.3
--- kit/image/zoom.c:1.2	Fri Feb 13 16:49:09 1998
+++ kit/image/zoom.c	Mon Dec 28 17:23:32 1998
@@ -40,7 +40,7 @@
      Image        *oimage;
      unsigned int  xzoom, yzoom;
 { char          buf[BUFSIZ];
-  Image        *image;
+  Image        *image=NULL;
   unsigned int *xindex, *yindex;
   unsigned int  xwidth, ywidth;
   unsigned int  x, y, xsrc, ysrc;
@@ -170,8 +170,10 @@
     break;
   }
 
-  image->title= dupString(buf);
-  image->trans = oimage->trans;
+  if (image) {
+      image->title= dupString(buf);
+      image->trans = oimage->trans;
+  }
   lfree((byte *)xindex);
   lfree((byte *)yindex);
   if (verbose)
