Index: /trunk/Ohana/src/addstar/src/ConfigInit_skycells.c
===================================================================
--- /trunk/Ohana/src/addstar/src/ConfigInit_skycells.c	(revision 16060)
+++ /trunk/Ohana/src/addstar/src/ConfigInit_skycells.c	(revision 16061)
@@ -6,5 +6,4 @@
 
   char *config, *file;
-  char RadiusWord[80];
   char CatdirPhotcodeFile[256];
   char MasterPhotcodeFile[256];
Index: /trunk/Ohana/src/addstar/src/skycells.c
===================================================================
--- /trunk/Ohana/src/addstar/src/skycells.c	(revision 16060)
+++ /trunk/Ohana/src/addstar/src/skycells.c	(revision 16061)
@@ -3,7 +3,5 @@
 int main (int argc, char **argv) {
 
-  int i, Nimages, status, level;
-  Image *images;
-  Catalog catalog;
+  int status, level;
   FITS_DB db;
 
Index: /trunk/Ohana/src/dvosplit/include/dvosplit.h
===================================================================
--- /trunk/Ohana/src/dvosplit/include/dvosplit.h	(revision 16060)
+++ /trunk/Ohana/src/dvosplit/include/dvosplit.h	(revision 16061)
@@ -35,4 +35,5 @@
 void       SetProtect             PROTO((int mode));
 void       TrapSignal             PROTO((int sig));
+int        Shutdown               PROTO((char *format, ...));
 int        args                   PROTO((int argc, char **argv));
 
Index: /trunk/Ohana/src/getstar/include/getstar.h
===================================================================
--- /trunk/Ohana/src/getstar/include/getstar.h	(revision 16060)
+++ /trunk/Ohana/src/getstar/include/getstar.h	(revision 16061)
@@ -31,15 +31,19 @@
 PhotCode *photcode;
 
-int  args             PROTO((int argc, char **argv));
-int  ConfigInit       PROTO((int *argc, char **argv));
-int  Shutdown         PROTO((char *format, ...));
-int  load_pt_catalog  PROTO((Catalog *catalog, SkyRegion *region));
-int  select_by_region PROTO((Catalog *output, Catalog *catalog, SkyRegion *region, int start, int end));
-void set_db           PROTO((FITS_DB *in));
-void wcatalog         PROTO((char *filename, Catalog *catalog));
-void mkcatalog        PROTO((Catalog *catalog));
-void init_catalog     PROTO((Catalog *catalog));
-void TrapSignal       PROTO((int sig));
-void SetProtect       PROTO((int mode));
-int  SetSignals       PROTO(());
-int  gcatalog         PROTO((Catalog *catalog));
+int  args             	     PROTO((int argc, char **argv));
+int  ConfigInit       	     PROTO((int *argc, char **argv));
+int  Shutdown         	     PROTO((char *format, ...));
+int  load_pt_catalog  	     PROTO((Catalog *catalog, SkyRegion *region));
+int  select_by_region 	     PROTO((Catalog *output, Catalog *catalog, SkyRegion *region, int start, int end));
+void set_db           	     PROTO((FITS_DB *in));
+void wcatalog         	     PROTO((char *filename, Catalog *catalog));
+void mkcatalog        	     PROTO((Catalog *catalog));
+void init_catalog     	     PROTO((Catalog *catalog));
+void TrapSignal       	     PROTO((int sig));
+void SetProtect       	     PROTO((int mode));
+int  SetSignals       	     PROTO(());
+int  gcatalog         	     PROTO((Catalog *catalog));
+int  write_catalog           PROTO((Catalog *catalog));
+int  write_getstar_PS1_DEV_0 PROTO((Catalog *catalog));
+int  write_getstar_PS1_DEV_1 PROTO((Catalog *catalog));
+int  write_getstar_PS1_DEV_2 PROTO((Catalog *catalog));
Index: /trunk/Ohana/src/kapa2/include/prototypes.h
===================================================================
--- /trunk/Ohana/src/kapa2/include/prototypes.h	(revision 16060)
+++ /trunk/Ohana/src/kapa2/include/prototypes.h	(revision 16061)
@@ -15,7 +15,7 @@
 void          CheckGeometry       PROTO((Graphic *graphic, int *argc, char **argv));
 void          TopWindow           PROTO((Graphic *graphic, Icon *icon));
-void           CreateWindow       PROTO((Graphic *graphic, Window parent, int border, long events));
-void	       MakeGC		  PROTO((Graphic *graphic));
-void           MakeCursor         PROTO((Graphic *graphic, unsigned int cursor));
+void          CreateWindow        PROTO((Graphic *graphic, Window parent, int border, long events));
+void	      MakeGC	    	  PROTO((Graphic *graphic));
+void          MakeCursor          PROTO((Graphic *graphic, unsigned int cursor));
 void          LoadFont            PROTO((Graphic *graphic, int *argc, char **argv, char *default_name));
 void          SetNormalHints      PROTO((Graphic *graphic));
@@ -23,5 +23,5 @@
 void          NameWindow          PROTO((Graphic *graphic, char *name));
 void          MapWindow           PROTO((Graphic *graphic));
-void CheckVisual (Graphic *graphic, int *argc, char **argv);
+void          CheckVisual         PROTO((Graphic *graphic, int *argc, char **argv));
 
 /* X drawing utilities */
@@ -71,6 +71,6 @@
 int           GetImageCoords      PROTO((int sock));
 int           GetImageRange       PROTO((int sock));
-int           SetChannel (int sock);
-int           SetColormapFromPipe (int sock);
+int           SetChannel          PROTO((int sock));
+int           SetColormapFromPipe PROTO((int sock));
 
 int           LoadVectorData      PROTO((int sock, KapaGraphWidget *graph, int N, char *type));
@@ -88,5 +88,5 @@
 int           SetActiveSectionByNumber PROTO((int N));
 int           ListSection         PROTO((int sock));
-void SetSectionSizes (Section *section);
+void          SetSectionSizes     PROTO((Section *section));
 
 KapaGraphWidget *InitGraph        PROTO(());
@@ -198,31 +198,31 @@
 
 /* misc functions */
-void SetToolbox (int sock);
-int EraseOverlay (int sock);
-int LoadOverlay (int sock);
-int SaveOverlay (int sock);
-int CSaveOverlay (int sock);
-int JPEGit24 (int sock);
-
-int UpdatePointer (Graphic *graphic, XMotionEvent *event);
-int InterpretPresses (Graphic *graphic, XButtonEvent *event);
-int InterpretKeys (Graphic *graphic, XKeyEvent *event);
-void InitPipe (char *namedSocket);
-void EraseGraph (KapaGraphWidget *graph);
-void StatusBox (Graphic *graphic, KapaImageWidget *image);
-
-void CreatePicture (KapaImageWidget *image, Graphic *graphic);
-void CreateColorbar (KapaImageWidget *image, Graphic *graphic);
-void CreateZoom (KapaImageWidget *image, Graphic *graphic, double x, double y);
-void UpdateStatusBox (Graphic *graphic, KapaImageWidget *image, double x, double y, double z, int mode);
-
-void CreateZoom8  (KapaImageWidget *image, Graphic *graphic, double x, double y);
-void CreateZoom16 (KapaImageWidget *image, Graphic *graphic, double x, double y);
-void CreateZoom24 (KapaImageWidget *image, Graphic *graphic, double x, double y);
-void CreateZoom32 (KapaImageWidget *image, Graphic *graphic, double x, double y);
-
-int GetActiveSocket ();
-void InvertButton (Graphic *graphic, Button *button);
-void bDrawOverlay (KapaImageWidget *image, int N);
+void 	      SetToolbox   (int sock);
+int  	      EraseOverlay (int sock);
+int  	      LoadOverlay  (int sock);
+int  	      SaveOverlay  (int sock);
+int  	      CSaveOverlay (int sock);
+int  	      JPEGit24     (int sock);
+
+int  	      UpdatePointer (Graphic *graphic, XMotionEvent *event);
+int  	      InterpretPresses (Graphic *graphic, XButtonEvent *event);
+int  	      InterpretKeys (Graphic *graphic, XKeyEvent *event);
+void 	      InitPipe (char *namedSocket);
+void 	      EraseGraph (KapaGraphWidget *graph);
+void 	      StatusBox (Graphic *graphic, KapaImageWidget *image);
+
+void 	      CreatePicture (KapaImageWidget *image, Graphic *graphic);
+void 	      CreateColorbar (KapaImageWidget *image, Graphic *graphic);
+void 	      CreateZoom (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void 	      UpdateStatusBox (Graphic *graphic, KapaImageWidget *image, double x, double y, double z, int mode);
+
+void 	      CreateZoom8  (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void 	      CreateZoom16 (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void 	      CreateZoom24 (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void 	      CreateZoom32 (KapaImageWidget *image, Graphic *graphic, double x, double y);
+
+int  	      GetActiveSocket ();
+void 	      InvertButton (Graphic *graphic, Button *button);
+void 	      bDrawOverlay (KapaImageWidget *image, int N);
 
 /* color cube tools */
@@ -243,4 +243,3 @@
 
 int SetColorScale3D_CC (Graphic *graphic, KapaImageWidget *image);
-
-void sort (float *value, int N);
+int SetColorCubeHistogram ();
Index: /trunk/Ohana/src/kapa2/src/ColorCube.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/ColorCube.c	(revision 16060)
+++ /trunk/Ohana/src/kapa2/src/ColorCube.c	(revision 16061)
@@ -94,5 +94,5 @@
   int ix, iy, iz;
 
-  if (current == max) return;
+  if (current == max) return TRUE;
   current ++;
 
@@ -105,5 +105,5 @@
     }
   }
-  return;
+  return TRUE;
 }
 
Index: /trunk/Ohana/src/kapa2/src/ColorHistogram.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/ColorHistogram.c	(revision 16060)
+++ /trunk/Ohana/src/kapa2/src/ColorHistogram.c	(revision 16061)
@@ -4,5 +4,5 @@
 void ColorHistogram (KapaImageWidget *image, CCNode *cube) {
 
-  int i, j, DX, DY, value, nPixels;
+  int i, DX, DY, nPixels;
   float *rData, *bData, *gData, rValue, gValue, bValue;
   float redSlope, blueSlope, greenSlope;
@@ -80,5 +80,5 @@
 void CCNodeSetColorPixels (KapaImageWidget *image, CCNode *cube) {
 
-  int i, j, DX, DY, value, nPixels;
+  int i, DX, DY, nPixels;
   float *rData, *bData, *gData, rValue, gValue, bValue;
   unsigned short *oData;
Index: /trunk/Ohana/src/kapa2/src/CreateZoom32.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/CreateZoom32.c	(revision 16060)
+++ /trunk/Ohana/src/kapa2/src/CreateZoom32.c	(revision 16061)
@@ -7,5 +7,5 @@
   int i_start, i_end, j_start, j_end;
   int dropback;  /* this is a bit of a kludge... */
-  int dx, dy, DX, DY, pixelN;
+  int dx, dy, DX, DY;
   double expand, zoomscale, Rx, Ry;
   int expand_in, expand_out;
Index: /trunk/Ohana/src/kapa2/src/JPEGit24.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/JPEGit24.c	(revision 16060)
+++ /trunk/Ohana/src/kapa2/src/JPEGit24.c	(revision 16061)
@@ -5,15 +5,4 @@
 # define WHITE_G 255
 # define WHITE_B 255
-
-static float slope = 1.0;
-static float start = 0.0;
-static int MaxValue = 255;
-
-// XXX inline this if needed
-static int PixelLookup(float value) {
-  int out;
-  out = MIN (MAX (slope * value - start, 0), MaxValue);
-  return (out);
-}
 
 // XXX this currently writes out the jpeg for just the active image
@@ -32,5 +21,5 @@
   int i_start, i_end, j_start, j_end;
   int dropback;  /* this is a bit of a kludge... */
-  int dx, dy, DX, DY, pixelN;
+  int dx, dy, DX, DY;
   int quality;
   int expand_in, expand_out;
Index: /trunk/Ohana/src/kapa2/src/Remap32.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/Remap32.c	(revision 16060)
+++ /trunk/Ohana/src/kapa2/src/Remap32.c	(revision 16061)
@@ -6,5 +6,5 @@
   int i_start, i_end, j_start, j_end;
   int dropback;  /* this is a bit of a kludge... */
-  int dx, dy, DX, DY, pixelN;
+  int dx, dy, DX, DY;
   double expand, Rx, Ry, X, Y;
   int expand_in, expand_out;
Index: /trunk/Ohana/src/kapa2/src/SetColorScale.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/SetColorScale.c	(revision 16060)
+++ /trunk/Ohana/src/kapa2/src/SetColorScale.c	(revision 16061)
@@ -29,5 +29,5 @@
 
 void SetColorScale1D (Graphic *graphic, KapaImageWidget *image) {
-  int i, j, DX, DY, value, nPixels;
+  int i, DX, DY, value, nPixels;
   float *iData;
   unsigned short *oData;
@@ -73,5 +73,6 @@
 // XXX this uses a crude, uniform-spacing cube
 int SetColorScale3D (Graphic *graphic, KapaImageWidget *image) {
-  int i, j, DX, DY, value, nPixels, rValue, gValue, bValue;
+
+  int i, DX, DY, nPixels, rValue, gValue, bValue;
   float *rData, *bData, *gData;
   unsigned short *oData;
@@ -151,5 +152,5 @@
 
   int i, DX, DY, Nvalues, NVALUES, Npixels, Nmin;
-  float *values, *colors;
+  float *values;
   CCNode *cube;
   Graphic *graphic;
@@ -233,6 +234,4 @@
 int SetColorScale3D_CC (Graphic *graphic, KapaImageWidget *image) {
 
-  int i, DX, DY, Nvalues, NVALUES, Npixels, Nmin;
-  float *values, *colors;
   CCNode *cube;
 
Index: /trunk/Ohana/src/kapa2/src/sort.c
===================================================================
--- /trunk/Ohana/src/kapa2/src/sort.c	(revision 16060)
+++ /trunk/Ohana/src/kapa2/src/sort.c	(revision 16061)
@@ -1,36 +1,0 @@
-# include "Ximage.h"
-
-void sort (float *value, int N) {
-
-  int l,j,ir,i;
-  float temp;
-  
-  if (N < 2) return;
-  l = N >> 1;
-  ir = N - 1;
-  for (;;) {
-    if (l > 0) {
-      temp = value[--l];
-    }
-    else {
-      temp = value[ir];
-      value[ir] = value[0];
-      if (--ir == 0) {
-	value[0] = temp;
-	return;
-      }
-    }
-    i = l;
-    j = (l << 1) + 1;
-    while (j <= ir) {
-      if (j < ir && value[j] < value[j+1]) ++j;
-      if (temp < value[j]) {
-	value[i]=value[j];
-	j += (i=j) + 1;
-      }
-      else j = ir + 1;
-    }
-    value[i] = temp;
-  }
-}
-
Index: /trunk/Ohana/src/uniphot/include/uniphot.h
===================================================================
--- /trunk/Ohana/src/uniphot/include/uniphot.h	(revision 16060)
+++ /trunk/Ohana/src/uniphot/include/uniphot.h	(revision 16061)
@@ -104,2 +104,3 @@
 int subset_images (FITS_DB *db);
 void update (FITS_DB *db, Group *sgroup, int Nsgroup);
+void sort_time (unsigned int *value, int N);
