Index: trunk/Ohana/src/kapa2/src/Image.c
===================================================================
--- trunk/Ohana/src/kapa2/src/Image.c	(revision 26891)
+++ trunk/Ohana/src/kapa2/src/Image.c	(revision 27435)
@@ -11,5 +11,5 @@
 
   channel->coords.Npolyterms = 0;
-  channel->matrix.size = 0; /* a flag to show there is no data in the matrix */
+  channel->matrix.datasize = 0; /* a flag to show there is no data in the matrix */
   ALLOCATE (channel->matrix.buffer, char, 1);  /* allocate so later free will not crash! */
 
Index: trunk/Ohana/src/kapa2/src/LoadPicture.c
===================================================================
--- trunk/Ohana/src/kapa2/src/LoadPicture.c	(revision 26891)
+++ trunk/Ohana/src/kapa2/src/LoadPicture.c	(revision 27435)
@@ -5,5 +5,5 @@
   Header header;
   char *buff;
-  int status, bytes_left;
+  off_t status, bytes_left;
   Section *section;
   KapaImageWidget *image;
@@ -24,5 +24,5 @@
   Xoffset = 0.0;
   Yoffset = 0.0;
-  if (image[0].image[0].matrix.size) {
+  if (image[0].image[0].matrix.datasize) {
     // XXX enforce int center here?
     Xoffset = image[0].picture.Xc - 0.5*image[0].image[0].matrix.Naxis[0];
@@ -32,5 +32,5 @@
   gfits_init_header (&header);
   header.Naxes = 2;
-  KiiScanMessage (sock, "%d %d", &header.Naxis[0], &header.Naxis[1]);
+  KiiScanMessage (sock, "%lld %lld", (long long *) &header.Naxis[0], (long long *) &header.Naxis[1]);
 
   // internal image are 32 bit floats; sender must send in this format
@@ -41,5 +41,5 @@
 
   KiiScanMessage (sock, "%lf %lf %s %s",  &image[0].image[0].zero, &image[0].image[0].range, image[0].image[0].name, image[0].image[0].file);
-  KiiScanMessage (sock, "%lf %lf %d", &image[0].image[0].min,  &image[0].image[0].max, &header.size);
+  KiiScanMessage (sock, "%lf %lf %lld", &image[0].image[0].min,  &image[0].image[0].max, (long long *) &header.datasize);
   KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].image[0].coords.crval1, &image[0].image[0].coords.crpix1, &image[0].image[0].coords.cdelt1, &image[0].image[0].coords.pc1_1, &image[0].image[0].coords.pc1_2);
   KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].image[0].coords.crval2, &image[0].image[0].coords.crpix2, &image[0].image[0].coords.cdelt2, &image[0].image[0].coords.pc2_1, &image[0].image[0].coords.pc2_2);
@@ -67,6 +67,6 @@
   status = 1;
   buff = image[0].image[0].matrix.buffer;
-  bytes_left = header.size;
-  image[0].image[0].matrix.size = 0;
+  bytes_left = header.datasize;
+  image[0].image[0].matrix.datasize = 0;
   while (bytes_left > 0) {
     status = read (sock, buff, bytes_left);
@@ -77,5 +77,5 @@
     }
     if (status != -1) { /* pipe has data */
-      image[0].image[0].matrix.size += status;
+      image[0].image[0].matrix.datasize += status;
       bytes_left -= status;
       buff = (char *)(buff + status);
@@ -85,8 +85,8 @@
   fcntl (sock, F_SETFL, !O_NONBLOCK);  
 
-  if (DEBUG) fprintf (stderr, "read %d bytes\n", image[0].image[0].matrix.size);
-  /* it it not obvious this condition should kill kii, but ... */
-  if (image[0].image[0].matrix.size != header.size) {  
-    fprintf (stderr, "error: expected %d bytes, but got only %d\n", header.size, image[0].image[0].matrix.size);
+  if (DEBUG) fprintf (stderr, "read %lld bytes\n", (long long) image[0].image[0].matrix.datasize);
+  /* it it not obvious this condition should kill kapa, but ... */
+  if (image[0].image[0].matrix.datasize != header.datasize) {  
+    fprintf (stderr, "error: expected %lld bytes, but got only %lld\n", (long long) header.datasize, (long long) image[0].image[0].matrix.datasize);
     return (FALSE);
   }
Index: trunk/Ohana/src/kapa2/src/PNGit.c
===================================================================
--- trunk/Ohana/src/kapa2/src/PNGit.c	(revision 26891)
+++ trunk/Ohana/src/kapa2/src/PNGit.c	(revision 27435)
@@ -9,5 +9,4 @@
   int Npalette;
   char filename[1024];
-  int Nbytes, status;
   bDrawBuffer *buffer;
   Graphic *graphic;
Index: trunk/Ohana/src/kapa2/src/PPMit.c
===================================================================
--- trunk/Ohana/src/kapa2/src/PPMit.c	(revision 26891)
+++ trunk/Ohana/src/kapa2/src/PPMit.c	(revision 27435)
@@ -5,5 +5,5 @@
   FILE *f;
   char *line, filename[1024];
-  int Nbytes, status, dx, dy, i, j, Npalette, color;
+  int dx, dy, i, j, Npalette, color;
   png_color *palette;
   bDrawBuffer *buffer;
Index: trunk/Ohana/src/kapa2/src/Relocate.c
===================================================================
--- trunk/Ohana/src/kapa2/src/Relocate.c	(revision 26891)
+++ trunk/Ohana/src/kapa2/src/Relocate.c	(revision 27435)
@@ -4,8 +4,6 @@
 int Relocate (int sock) {
  
-  int i, Nsection;
   int x, y, dX, dY;
   Graphic *graphic;
-  Section *section;
 
   graphic = GetGraphic();
Index: trunk/Ohana/src/kapa2/src/SetImageData.c
===================================================================
--- trunk/Ohana/src/kapa2/src/SetImageData.c	(revision 26891)
+++ trunk/Ohana/src/kapa2/src/SetImageData.c	(revision 27435)
@@ -17,5 +17,5 @@
   
   // get image data from client 
-  KiiScanMessage (sock, "%lf %lf %s", 
+  KiiScanMessage (sock, "%lf %lf %s %s", 
 		  &image[0].image[0].zero, 
 		  &image[0].image[0].range, 
