Index: trunk/Ohana/src/kapa2/src/CheckVisual.c
===================================================================
--- trunk/Ohana/src/kapa2/src/CheckVisual.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/CheckVisual.c	(revision 34088)
@@ -10,5 +10,5 @@
 
   int i, Nfound, N;
-  int isColor, isDefault;
+  int isDefault;
   XVisualInfo *visual_list, visual_temp;
   unsigned long planes[3];
@@ -35,10 +35,10 @@
   
   // set these based on selected visual
-  isColor = isDefault = FALSE;
+  isDefault = FALSE;
 
   // attempt to select the most desirable type of visual: TrueColor
   for (i = 0; (i < Nfound) && (visual_list[i].class != TrueColor); i++);
   if (i != Nfound) {
-    isColor = TRUE;
+    // isColor = TRUE;
     if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class);
     isDefault = (graphic[0].visual == visual_list[i].visual);
@@ -52,5 +52,5 @@
   for (i = 0; (i < Nfound) && (visual_list[i].class != DirectColor); i++);
   if (i != Nfound) {
-    isColor = TRUE;
+    // isColor = TRUE;
     if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class);
     isDefault = (graphic[0].visual == visual_list[i].visual);
@@ -64,5 +64,5 @@
   for (i = 0; (i < Nfound) && (visual_list[i].class != PseudoColor); i++);
   if (i != Nfound) {
-    isColor = TRUE;
+    // isColor = TRUE;
     if (DEBUG) fprintf (stderr, "selected visual class is %d\n", visual_list[i].class);
     isDefault = (graphic[0].visual == visual_list[i].visual);
Index: trunk/Ohana/src/kapa2/src/DrawFrame.c
===================================================================
--- trunk/Ohana/src/kapa2/src/DrawFrame.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/DrawFrame.c	(revision 34088)
@@ -91,5 +91,5 @@
   int pos, dir, fontsize;
   double size, n, pad;
-  char string[64], *fontname;
+  char string[64];
 
   double fx  = axis->fx;
@@ -130,5 +130,6 @@
     int xt, yt;
 
-    fontname = GetRotFont (&fontsize);
+    // char *fontname is returned by GetRotFont, but not used here
+    GetRotFont (&fontsize);
     
     pad = !isnan(axis->ticktextPad) ? axis->ticktextPad*fontsize : fontsize + 4.0;
@@ -231,6 +232,6 @@
 
   TickMarkData *ticks;
-  double range, major, minor, first, value, dPixels, overshoot;
-  int i, NTICKS, nPixels, done, ifirst, nsignif;
+  double range, major, minor, first, value;
+  int i, NTICKS, done, ifirst, nsignif;
 
   *nticks = 0;
@@ -249,6 +250,6 @@
 
   // length of the axis in pixels
-  nPixels = hypot(axis->dfx, axis->dfy);
-  dPixels = nPixels / range; // axis pixel-scale
+  // int nPixels = hypot(axis->dfx, axis->dfy);
+  // double dPixels = nPixels / range; // axis pixel-scale
 
   AxisTickScale (axis, &major, &minor, &nsignif);
@@ -263,5 +264,5 @@
   
   // allow undershoot by 1 pixel
-  overshoot = (axis->min - first) * dPixels;
+  // double overshoot = (axis->min - first) * dPixels;
   // if (overshoot > 0.5) {
   //   if (range > 0) {
Index: trunk/Ohana/src/kapa2/src/EraseOverlay.c
===================================================================
--- trunk/Ohana/src/kapa2/src/EraseOverlay.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/EraseOverlay.c	(revision 34088)
@@ -4,5 +4,4 @@
 
   int i, N;
-  Graphic *graphic;
   Section *section;
   KapaImageWidget *image;
@@ -11,5 +10,4 @@
   KiiScanCommand (sock, 16, "%*s %d", &N);
 
-  graphic = GetGraphic();
   section = GetActiveSection();
   image = section->image;
Index: trunk/Ohana/src/kapa2/src/JPEGit24.c
===================================================================
--- trunk/Ohana/src/kapa2/src/JPEGit24.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/JPEGit24.c	(revision 34088)
@@ -33,9 +33,8 @@
   int i_start, i_end, j_start, j_end;
   int I_start, J_start;
-  int dropback;  /* this is a bit of a kludge... */
-  int dx, dy, DX, DY, inDX, inDY;
+  int dx, dy, DX, inDX, inDY;
   int quality;
   int expand_in, expand_out;
-  double expand, Ix, Iy;
+  double Ix, Iy;
   unsigned char *out_pix;
   unsigned short *in_pix, *in_pix_ref;
@@ -85,12 +84,10 @@
 
   assert ((image[0].picture.expand >= 1) || (image[0].picture.expand <= -2));
-  expand = expand_in = expand_out = 1.0;
+  expand_in = expand_out = 1.0;
   if (image[0].picture.expand > 0) {
-    expand = 1 / (1.0*image[0].picture.expand);
     expand_out = image[0].picture.expand;
     expand_in  = 1;
   }
   if (image[0].picture.expand < 0) {
-    expand = fabs((double)image[0].picture.expand);
     expand_out = 1;
     expand_in  = -image[0].picture.expand;
@@ -100,5 +97,5 @@
   dy = image[0].picture.dy;
   DX = image[0].image[0].matrix.Naxis[0];
-  DY = image[0].image[0].matrix.Naxis[1];
+  // DY = image[0].image[0].matrix.Naxis[1];
 
   // i_start, j_start are the closest lit screen pixel to 0,0
@@ -118,7 +115,4 @@
   inDX = image[0].picture.flipx ? -1 : +1;
   inDY = image[0].picture.flipy ? -1 : +1;
-
-  dropback = expand_out - (i_end - i_start) % expand_out;
-  if ((i_end - i_start) % expand_out == 0) dropback = 0;
 
   /* output line buffer */
Index: trunk/Ohana/src/kapa2/src/Layout.c
===================================================================
--- trunk/Ohana/src/kapa2/src/Layout.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/Layout.c	(revision 34088)
@@ -5,5 +5,4 @@
 
   int N;
-  Section *section;
   char *namedSocket = NULL;
   
@@ -43,4 +42,5 @@
 
   /* create basic section, empty of image or graph */
-  section = AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1);
+  // Section *section is returned by not used
+  AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1);
 }
Index: trunk/Ohana/src/kapa2/src/PSFrame.c
===================================================================
--- trunk/Ohana/src/kapa2/src/PSFrame.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/PSFrame.c	(revision 34088)
@@ -57,5 +57,5 @@
   int pos, dir, fontsize;
   double size, n, pad;
-  char string[64], *fontname;
+  char string[64];
 
   double fx  = axis->fx;
@@ -90,5 +90,6 @@
     int xt, yt;
 
-    fontname = GetRotFont (&fontsize);
+    // char *fontname is returned by not needed
+    GetRotFont (&fontsize);
 
     pad = !isnan(axis->ticktextPad) ? axis->ticktextPad*fontsize : 0.8*fontsize + 1.0;
Index: trunk/Ohana/src/kapa2/src/PSPixmap.c
===================================================================
--- trunk/Ohana/src/kapa2/src/PSPixmap.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/PSPixmap.c	(revision 34088)
@@ -153,8 +153,7 @@
   int i_start, i_end, j_start, j_end;
   int I_start, J_start;
-  int dropback;  /* this is a bit of a kludge... */
-  int dx, dy, DX, DY, inDX, inDY, Xs, Ys;
+  int dx, dy, DX, inDX, inDY;
   int expand_in, expand_out;
-  double expand, Ix, Iy;
+  double Ix, Iy;
   unsigned short *in_pix, *in_pix_ref;
   unsigned char *pixel1, *pixel2, *pixel3;
@@ -174,22 +173,17 @@
 
   assert ((image[0].picture.expand >= 1) || (image[0].picture.expand <= -2));
-  expand = expand_in = expand_out = 1.0;
+  expand_in = expand_out = 1.0;
   if (image[0].picture.expand > 0) {
-    expand = 1 / (1.0*image[0].picture.expand);
     expand_out = image[0].picture.expand;
     expand_in  = 1;
   }
   if (image[0].picture.expand < 0) {
-    expand = fabs((double)image[0].picture.expand);
     expand_out = 1;
     expand_in  = -image[0].picture.expand;
   }
 
-  Xs = image[0].picture.x;
-  Ys = image[0].picture.y;
   dx = image[0].picture.dx;
   dy = image[0].picture.dy;
   DX = image[0].image[0].matrix.Naxis[0];
-  DY = image[0].image[0].matrix.Naxis[1];
 
   // i_start, j_start are the closest lit screen pixel to 0,0
@@ -209,7 +203,4 @@
   inDX = image[0].picture.flipx ? -1 : +1;
   inDY = image[0].picture.flipy ? -1 : +1;
-
-  dropback = expand_out - (i_end - i_start) % expand_out;
-  if ((i_end - i_start) % expand_out == 0) dropback = 0;
 
   in_pix_ref  = &image[0].pixmap[DX*(int)MAX(Iy,0) + (int)MAX(Ix,0)];
Index: trunk/Ohana/src/kapa2/src/PaintOverlay.c
===================================================================
--- trunk/Ohana/src/kapa2/src/PaintOverlay.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/PaintOverlay.c	(revision 34088)
@@ -5,5 +5,5 @@
   int i;
   int dX, dY, dx, dy;
-  int Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;
+  int Xmin, Ymin, Xmax, Ymax;
   double t, expand, X, Y, pX, pY;
  
@@ -23,6 +23,4 @@
   Xmax = image[0].picture.x + image[0].picture.dx;
   Ymax = image[0].picture.y + image[0].picture.dy;
-  Xrange = image[0].picture.dx;
-  Yrange = image[0].picture.dy;
 
   for (i = 0; i < image[0].overlay[N].Nobjects; i++) {
Index: trunk/Ohana/src/kapa2/src/Remap16.c
===================================================================
--- trunk/Ohana/src/kapa2/src/Remap16.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/Remap16.c	(revision 34088)
@@ -13,6 +13,6 @@
   int I_start, J_start;
   int dropback, inDX, inDY;
-  int dx, dy, DX, DY;
-  double expand, Ix, Iy;
+  int dx, dy, DX;
+  double Ix, Iy;
   int expand_in, expand_out;
   OUT_TYPE *out_pix, *out_pix2, *data;
@@ -49,12 +49,10 @@
   if (picture[0].expand == -1) picture[0].expand = 1;
   assert ((picture[0].expand >= 1) || (picture[0].expand <= -2));
-  expand = expand_in = expand_out = 1.0;
+  expand_in = expand_out = 1.0;
   if (picture[0].expand > 0) {
-    expand = 1 / (1.0*picture[0].expand);
     expand_out = picture[0].expand;
     expand_in  = 1;
   }
   if (picture[0].expand < 0) {
-    expand = fabs((double)picture[0].expand);
     expand_out = 1;
     expand_in  = -picture[0].expand;
@@ -65,5 +63,5 @@
   dy = picture[0].dy;
   DX = matrix[0].Naxis[0];
-  DY = matrix[0].Naxis[1];
+  // int DY = matrix[0].Naxis[1];
 
   // i_start, j_start are the closest lit screen pixel to 0,0
Index: trunk/Ohana/src/kapa2/src/Remap24.c
===================================================================
--- trunk/Ohana/src/kapa2/src/Remap24.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/Remap24.c	(revision 34088)
@@ -7,6 +7,6 @@
   int I_start, J_start;
   int dropback, extra, inDX, inDY;
-  int dx, dy, DX, DY;
-  double expand, Ix, Iy;
+  int dx, dy, DX;
+  double Ix, Iy;
   int expand_in, expand_out;
   unsigned char *out_pix, *out_pix2, *data;
@@ -33,14 +33,12 @@
   if (picture[0].expand == -1) picture[0].expand = 1;
   assert ((picture[0].expand >= 1) || (picture[0].expand <= -2));
-  expand = expand_in = expand_out = 1.0;
+  expand_in = expand_out = 1.0;
   if (picture[0].expand == 0) /* set up expansions */
     picture[0].expand = 1;
   if (picture[0].expand > 0) {
-    expand = 1 / (1.0*picture[0].expand);
     expand_out = picture[0].expand;
     expand_in  = 1;
   }
   if (picture[0].expand < 0) {
-    expand = fabs((double)picture[0].expand);
     expand_out = 1;
     expand_in  = -picture[0].expand;
@@ -50,5 +48,5 @@
   dy = picture[0].dy;
   DX = matrix[0].Naxis[0];
-  DY = matrix[0].Naxis[1];
+  // int DY = matrix[0].Naxis[1];
 
   // each row is padded to a 4-byte word
Index: trunk/Ohana/src/kapa2/src/Remap32.c
===================================================================
--- trunk/Ohana/src/kapa2/src/Remap32.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/Remap32.c	(revision 34088)
@@ -16,6 +16,6 @@
   int I_start, J_start;
   int dropback, inDX, inDY;
-  int dx, dy, DX, DY;
-  double expand, Ix, Iy;
+  int dx, dy, DX;
+  double Ix, Iy;
   int expand_in, expand_out;
   OUT_TYPE *out_pix, *out_pix2, *data;
@@ -52,12 +52,10 @@
   if (picture[0].expand == -1) picture[0].expand = 1;
   assert ((picture[0].expand >= 1) || (picture[0].expand <= -2));
-  expand = expand_in = expand_out = 1.0;
+  expand_in = expand_out = 1.0;
   if (picture[0].expand > 0) {
-    expand = 1 / (1.0*picture[0].expand);
     expand_out = picture[0].expand;
     expand_in  = 1;
   }
   if (picture[0].expand < 0) {
-    expand = fabs((double)picture[0].expand);
     expand_out = 1;
     expand_in  = -picture[0].expand;
@@ -68,5 +66,5 @@
   dy = picture[0].dy;
   DX = matrix[0].Naxis[0];
-  DY = matrix[0].Naxis[1];
+  // int DY = matrix[0].Naxis[1];
 
   // i_start, j_start are the closest lit screen pixel to 0,0
Index: trunk/Ohana/src/kapa2/src/Remap8.c
===================================================================
--- trunk/Ohana/src/kapa2/src/Remap8.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/Remap8.c	(revision 34088)
@@ -8,6 +8,6 @@
   int I_start, J_start;
   int dropback, inDX, inDY;
-  int dx, dy, DX, DY;
-  double expand, Ix, Iy;
+  int dx, dy, DX;
+  double Ix, Iy;
   int expand_in, expand_out;
   OUT_TYPE *out_pix, *out_pix2, *data;
@@ -32,14 +32,12 @@
   if (picture[0].expand == -1) picture[0].expand = 1;
   assert ((picture[0].expand >= 1) || (picture[0].expand <= -2));
-  expand = expand_in = expand_out = 1.0;
+  expand_in = expand_out = 1.0;
   if (picture[0].expand == 0) /* set up expansions */
     picture[0].expand = 1;
   if (picture[0].expand > 0) {
-    expand = 1 / (1.0*picture[0].expand);
     expand_out = picture[0].expand;
     expand_in  = 1;
   }
   if (picture[0].expand < 0) {
-    expand = fabs((double)picture[0].expand);
     expand_out = 1;
     expand_in  = -picture[0].expand;
@@ -50,5 +48,5 @@
   dy = picture[0].dy;
   DX = matrix[0].Naxis[0];
-  DY = matrix[0].Naxis[1];
+  // int DY = matrix[0].Naxis[1];
 
   // i_start, j_start are the closest lit screen pixel to 0,0
Index: trunk/Ohana/src/kapa2/src/SetGraphSize.c
===================================================================
--- trunk/Ohana/src/kapa2/src/SetGraphSize.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/SetGraphSize.c	(revision 34088)
@@ -77,5 +77,5 @@
   double minPADx, maxPADx, minPADy;
   double minPAD, maxPAD;
-  char string[64], *fontname;
+  char string[64];
   KapaGraphWidget *graph;
   Graphic *graphic;
@@ -97,5 +97,6 @@
 
   graphic = GetGraphic ();
-  fontname = GetRotFont (&fontsize);
+  // char *fontname;
+  GetRotFont (&fontsize);
 
   minPAD = 1.0*fontsize + 0;
Index: trunk/Ohana/src/kapa2/src/SetImageData.c
===================================================================
--- trunk/Ohana/src/kapa2/src/SetImageData.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/SetImageData.c	(revision 34088)
@@ -3,9 +3,9 @@
 int SetImageData (int sock) {
   
-  Graphic *graphic;
   Section *section;
   KapaImageWidget *image;
 
-  graphic = GetGraphic();
+  // XXX needed for XClearWindow below 
+  // Graphic *graphic = GetGraphic();
 
   section = GetActiveSection();
@@ -53,9 +53,6 @@
 int SetImageCoords (int sock) {
   
-  Graphic *graphic;
   Section *section;
   KapaImageWidget *image;
-
-  graphic = GetGraphic();
 
   section = GetActiveSection();
Index: trunk/Ohana/src/kapa2/src/bDrawFrame.c
===================================================================
--- trunk/Ohana/src/kapa2/src/bDrawFrame.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/bDrawFrame.c	(revision 34088)
@@ -60,5 +60,5 @@
   int pos, dir, fontsize;
   double size, n, pad;
-  char string[64], *fontname;
+  char string[64];
 
   double fx  = axis->fx;
@@ -93,5 +93,6 @@
     int xt, yt;
 
-    fontname = GetRotFont (&fontsize);
+    // char *fontname is returned but ignored
+    GetRotFont (&fontsize);
 
     pad = !isnan(axis->ticktextPad) ? axis->ticktextPad*fontsize : 0.8*fontsize + 1.0;
Index: trunk/Ohana/src/kapa2/src/bDrawImage.c
===================================================================
--- trunk/Ohana/src/kapa2/src/bDrawImage.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/bDrawImage.c	(revision 34088)
@@ -11,8 +11,8 @@
   int i_start, i_end, j_start, j_end;
   int I_start, J_start;
-  int dropback;  /* this is a bit of a kludge... */
-  int dx, dy, DX, DY, inDX, inDY, Xs, Ys;
+  // int dropback;  /* this is a bit of a kludge... */
+  int dx, dy, DX, inDX, inDY, Xs, Ys;
   int expand_in, expand_out;
-  double expand, Ix, Iy;
+  double Ix, Iy;
   unsigned char *out_pix;
   unsigned short *in_pix, *in_pix_ref;
@@ -35,12 +35,10 @@
 
   assert ((image[0].picture.expand >= 1) || (image[0].picture.expand <= -2));
-  expand = expand_in = expand_out = 1.0;
+  expand_in = expand_out = 1.0;
   if (image[0].picture.expand > 0) {
-    expand = 1 / (1.0*image[0].picture.expand);
     expand_out = image[0].picture.expand;
     expand_in  = 1;
   }
   if (image[0].picture.expand < 0) {
-    expand = fabs((double)image[0].picture.expand);
     expand_out = 1;
     expand_in  = -image[0].picture.expand;
@@ -53,5 +51,5 @@
   dy = image[0].picture.dy;
   DX = image[0].image[0].matrix.Naxis[0];
-  DY = image[0].image[0].matrix.Naxis[1];
+  // int DY = image[0].image[0].matrix.Naxis[1];
 
   // the created buffer is supposed to contain the output windows
@@ -82,6 +80,6 @@
   inDY = image[0].picture.flipy ? -1 : +1;
 
-  dropback = expand_out - (i_end - i_start) % expand_out;
-  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+  // dropback = expand_out - (i_end - i_start) % expand_out;
+  // if ((i_end - i_start) % expand_out == 0) dropback = 0;
 
   ALLOCATE (line_buffer, bDrawColor, 3*dx);
Index: trunk/Ohana/src/kapa2/src/bDrawOverlay.c
===================================================================
--- trunk/Ohana/src/kapa2/src/bDrawOverlay.c	(revision 33650)
+++ trunk/Ohana/src/kapa2/src/bDrawOverlay.c	(revision 34088)
@@ -8,5 +8,5 @@
   int i;
   int dx, dy;
-  int Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;
+  int Xmin, Ymin, Xmax, Ymax;
   double expand, X, Y, dX, dY, pX, pY;
   bDrawColor color;
@@ -28,6 +28,4 @@
   Xmax = image[0].picture.dx;
   Ymax = image[0].picture.dy;
-  Xrange = image[0].picture.dx;
-  Yrange = image[0].picture.dy;
 
   if (N == INFRONT) {
