diff --git a/src/modules/Image/encodings/bmp.c b/src/modules/Image/encodings/bmp.c
index 83cc2ed8b18e66c0e6d5c276ea34792feee9cb3b..139e48166e90d6aedc7059a28bce0cfb4d77894d 100644
--- a/src/modules/Image/encodings/bmp.c
+++ b/src/modules/Image/encodings/bmp.c
@@ -1,9 +1,9 @@
-/* $Id: bmp.c,v 1.24 2000/08/04 00:41:59 grubba Exp $ */
+/* $Id: bmp.c,v 1.25 2000/08/04 10:53:20 grubba Exp $ */
 
 /*
 **! module Image
 **! note
-**!	$Id: bmp.c,v 1.24 2000/08/04 00:41:59 grubba Exp $
+**!	$Id: bmp.c,v 1.25 2000/08/04 10:53:20 grubba Exp $
 **! submodule BMP
 **!
 **!	This submodule keeps the BMP (Windows Bitmap)
@@ -22,7 +22,7 @@
 #include <ctype.h>
 
 #include "stralloc.h"
-RCSID("$Id: bmp.c,v 1.24 2000/08/04 00:41:59 grubba Exp $");
+RCSID("$Id: bmp.c,v 1.25 2000/08/04 10:53:20 grubba Exp $");
 #include "pike_macros.h"
 #include "object.h"
 #include "constants.h"
@@ -491,7 +491,8 @@ void i_img_bmp__decode(INT32 args,int header_only)
    struct neo_colortable *nct=NULL;
    struct object *o;
    rgb_group *d;
-   int n=0,j=0,i,y,skip;
+   int n=0,i,y,skip;
+   ptrdiff_t j=0;
    int windows=0;
    int quality=50; /* for JPEG decoding */
 
diff --git a/src/modules/Image/encodings/gif.c b/src/modules/Image/encodings/gif.c
index 38d7ecd1ab4455e58a1f2496cf35cb6e7a116740..a3fab645b63fd1c589d24a5494bd97a06fdb40de 100644
--- a/src/modules/Image/encodings/gif.c
+++ b/src/modules/Image/encodings/gif.c
@@ -1,9 +1,9 @@
-/* $Id: gif.c,v 1.53 2000/08/03 21:25:31 grubba Exp $ */
+/* $Id: gif.c,v 1.54 2000/08/04 10:46:55 grubba Exp $ */
 
 /*
 **! module Image
 **! note
-**!	$Id: gif.c,v 1.53 2000/08/03 21:25:31 grubba Exp $
+**!	$Id: gif.c,v 1.54 2000/08/04 10:46:55 grubba Exp $
 **! submodule GIF
 **!
 **!	This submodule keep the GIF encode/decode capabilities
@@ -31,7 +31,7 @@
 #include <ctype.h>
 
 #include "stralloc.h"
-RCSID("$Id: gif.c,v 1.53 2000/08/03 21:25:31 grubba Exp $");
+RCSID("$Id: gif.c,v 1.54 2000/08/04 10:46:55 grubba Exp $");
 #include "pike_macros.h"
 #include "object.h"
 #include "constants.h"
@@ -1256,7 +1256,7 @@ static void _decode_get_extension(unsigned char **s,
 				  size_t *len)
 {
    int ext;
-   unsigned long n,sz;
+   size_t n,sz;
 
    if (*len<3) { (*s)+=*len; (*len)=0; return; }
    n=0;
@@ -1294,7 +1294,7 @@ static void _decode_get_render(unsigned char **s,
 			       size_t *len)
 {
    int n=0,bpp;
-   unsigned long sz;
+   size_t sz;
 
 /* byte ...
    0  0x2c (render block init)
@@ -1332,7 +1332,7 @@ static void _decode_get_render(unsigned char **s,
    push_int( !!((*s)[9]&64) );
 
    if ( ((*s)[9]&128) ) {
-      if ((*len)>10+(unsigned long)(3<<bpp) )
+      if ((*len)>10+(size_t)(3<<bpp) )
       {
 	 push_string(make_shared_binary_string((char *)(*s)+10,3<<bpp));
 	 (*s)+=10+(3<<bpp);
@@ -2478,7 +2478,8 @@ static void image_gif_lzw_decode(INT32 args)
    int earlychange=0;
    ptrdiff_t len;
    signed long n;
-   signed long clearcode,endcode,last,q,bit,m,dlen,dlen0;
+   signed long clearcode,endcode,last,q,bit,m;
+   ptrdiff_t dlen,dlen0;
    unsigned int mask;
    struct lzwc *c;
    signed long bits,obits=8;
diff --git a/src/modules/Image/encodings/png.c b/src/modules/Image/encodings/png.c
index c5c92ea87436afa33bdd996fd78ff662b1213d01..011fd2b4f2d85bb557026f387adc538bb96bdc75 100644
--- a/src/modules/Image/encodings/png.c
+++ b/src/modules/Image/encodings/png.c
@@ -1,5 +1,5 @@
 #include "global.h"
-RCSID("$Id: png.c,v 1.34 2000/08/03 21:25:32 grubba Exp $");
+RCSID("$Id: png.c,v 1.35 2000/08/04 10:51:49 grubba Exp $");
 
 #include "image_machine.h"
 
@@ -516,7 +516,7 @@ static int _png_write_rgb(rgb_group *w1,
 			  unsigned char *s,
 			  size_t len,
 			  unsigned long width,
-			  unsigned long n,
+			  size_t n,
 			  struct neo_colortable *ct,
 			  struct pike_string *trns)
 {
@@ -530,7 +530,7 @@ static int _png_write_rgb(rgb_group *w1,
    rgb_group *d1=w1;
    rgb_group *da1=wa1;
 
-   unsigned long n0=n;
+   size_t n0=n;
 
    unsigned long x;
    int mz;
diff --git a/src/modules/Image/encodings/x.c b/src/modules/Image/encodings/x.c
index fb90e91d0a74ca0d6d8f9cdcc23b68348e6a7043..e430a55c8cace40a724f2c33ead4ba66425e2434 100644
--- a/src/modules/Image/encodings/x.c
+++ b/src/modules/Image/encodings/x.c
@@ -1,9 +1,9 @@
-/* $Id: x.c,v 1.28 2000/08/03 21:25:32 grubba Exp $ */
+/* $Id: x.c,v 1.29 2000/08/04 10:48:14 grubba Exp $ */
 
 /*
 **! module Image
 **! note
-**!	$Id: x.c,v 1.28 2000/08/03 21:25:32 grubba Exp $
+**!	$Id: x.c,v 1.29 2000/08/04 10:48:14 grubba Exp $
 **! submodule X
 **!
 **!	This submodule handles encoding and decoding of
@@ -29,7 +29,7 @@
 #include <winsock.h>
 #endif
 
-RCSID("$Id: x.c,v 1.28 2000/08/03 21:25:32 grubba Exp $");
+RCSID("$Id: x.c,v 1.29 2000/08/04 10:48:14 grubba Exp $");
 #include "pike_macros.h"
 #include "object.h"
 #include "constants.h"
@@ -779,7 +779,7 @@ static void image_x_decode_truecolor(INT32 args)
 {
    struct pike_string *ps;
    unsigned char *s;
-   unsigned long len;
+   size_t len;
    INT32 width,height,bpp,alignbits,swapbytes;
    INT32 rbits,rshift,gbits,gshift,bbits,bshift;
    int i;
@@ -796,7 +796,7 @@ static void image_x_decode_truecolor(INT32 args)
 
    ps=sp[-args].u.string;
    s=(unsigned char*)ps->str;
-   len=ps->len;
+   len = ps->len;
    width=sp[1-args].u.integer;
    height=sp[2-args].u.integer;
    bpp=sp[3-args].u.integer;
@@ -1017,7 +1017,7 @@ void image_x_decode_pseudocolor(INT32 args)
 {
    struct pike_string *ps;
    unsigned char *s;
-   unsigned long len;
+   size_t len;
    INT32 width,height,bpp,alignbits,swapbytes;
    int i;
    INT32 n, m;
@@ -1042,7 +1042,7 @@ void image_x_decode_pseudocolor(INT32 args)
 
    add_ref(ps=sp[-args].u.string);
    s=(unsigned char*)ps->str;
-   len=ps->len;
+   len = ps->len;
    width=sp[1-args].u.integer;
    height=sp[2-args].u.integer;
    bpp=sp[3-args].u.integer;
diff --git a/src/modules/Image/encodings/xwd.c b/src/modules/Image/encodings/xwd.c
index 140fbe924efb76cc43bf9edd8043bb1b3ca56ae9..b4a420d38030380b89f1e632eb3574ef02782b20 100644
--- a/src/modules/Image/encodings/xwd.c
+++ b/src/modules/Image/encodings/xwd.c
@@ -1,9 +1,9 @@
-/* $Id: xwd.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $ */
+/* $Id: xwd.c,v 1.16 2000/08/04 10:49:52 grubba Exp $ */
 
 /*
 **! module Image
 **! note
-**!	$Id: xwd.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $
+**!	$Id: xwd.c,v 1.16 2000/08/04 10:49:52 grubba Exp $
 **! submodule XWD
 **!
 **!	This submodule keeps the XWD (X Windows Dump) 
@@ -25,7 +25,7 @@
 #include <ctype.h>
 
 #include "stralloc.h"
-RCSID("$Id: xwd.c,v 1.15 2000/07/28 07:13:06 hubbe Exp $");
+RCSID("$Id: xwd.c,v 1.16 2000/08/04 10:49:52 grubba Exp $");
 #include "pike_macros.h"
 #include "object.h"
 #include "constants.h"
@@ -145,7 +145,7 @@ void img_xwd__decode(INT32 args,int header_only,int skipcmap)
       error("Image.XWD._decode: header to small\n");
    header.header_size=CARD32n(s,0);
 
-   if ((unsigned long)s->len<header.header_size || s->len<100)
+   if ((size_t)s->len < header.header_size || s->len<100)
       error("Image.XWD._decode: header to small\n");
 
    header.file_version=CARD32n(s,1);