Index: trunk/Ohana/src/opihi/cmd.astro/coord_systems.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/coord_systems.c	(revision 17390)
+++ trunk/Ohana/src/opihi/cmd.astro/coord_systems.c	(revision 17419)
@@ -56,4 +56,6 @@
 	  transform->isIdentity = TRUE;
 	  break;
+	default:
+	  abort();
       }
     case COORD_GALACTIC:
@@ -72,5 +74,9 @@
 	case COORD_ECLIPTIC:
 	  return NULL;
+	default:
+	  abort();
       }
+    default:
+      abort();
   }
  
Index: trunk/Ohana/src/opihi/cmd.data/book_commands.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/book_commands.c	(revision 17390)
+++ trunk/Ohana/src/opihi/cmd.data/book_commands.c	(revision 17419)
@@ -380,8 +380,5 @@
 int book_shuffle (int argc, char **argv) {
 
-  int where, N;
-  char *varName, *keyName, *keyValue;
-  Book *book;
-  Page *page;
+  Book *book;
 
   if (argc != 2) {
Index: trunk/Ohana/src/opihi/cmd.data/vzload.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/vzload.c	(revision 17390)
+++ trunk/Ohana/src/opihi/cmd.data/vzload.c	(revision 17419)
@@ -6,6 +6,5 @@
   int kapa, type;
   char *name;
-  double dx, dy, size;
-  double min, range, MAX_OUTPUT_SIZE;
+  double size, min, range, MAX_OUTPUT_SIZE;
   KiiOverlay *overlay;
   Vector *vecx, *vecy, *vecz;
Index: trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 17390)
+++ trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 17419)
@@ -76,5 +76,4 @@
   double ra, dec, x, y, dT;
 
-  Image *image;
   Coords *mosaic;
   PhotCode *equiv;
@@ -132,5 +131,5 @@
 	    break;
 	  }
-	  Nsec = GetPhotcodeNsec (equiv);
+	  Nsec = GetPhotcodeNsec (equiv->code);
 	  if (Nsec == -1) break;
 	  value = secfilt[Nsec].Ncode;
@@ -141,5 +140,5 @@
 	    break;
 	  }
-	  Nsec = GetPhotcodeNsec (equiv);
+	  Nsec = GetPhotcodeNsec (equiv->code);
 	  if (Nsec == -1) break;
 	  value = secfilt[Nsec].Nused;
@@ -317,10 +316,13 @@
       value = measure[0].Xccd;
 # else
-      ra  = average[0].R - measure[0].dR / 3600.0;
-      dec = average[0].D - measure[0].dD / 3600.0;
-      image = MatchImage (measure[0].t, measure[0].photcode);
-      if (image == NULL) break;
-      RD_to_XY (&x, &y, ra, dec, &image[0].coords);
-      value = x;
+      { 
+	Image *image;
+	ra  = average[0].R - measure[0].dR / 3600.0;
+	dec = average[0].D - measure[0].dD / 3600.0;
+	image = MatchImage (measure[0].t, measure[0].photcode);
+	if (image == NULL) break;
+	RD_to_XY (&x, &y, ra, dec, &image[0].coords);
+	value = x;
+      }
 # endif
       break;
@@ -330,10 +332,13 @@
       value = measure[0].Yccd;
 # else
-      ra  = average[0].R - measure[0].dR / 3600.0;
-      dec = average[0].D - measure[0].dD / 3600.0;
-      image = MatchImage (measure[0].t, measure[0].photcode);
-      if (image == NULL) break;
-      RD_to_XY (&x, &y, ra, dec, &image[0].coords);
-      value = y;
+      {
+	Image *image;
+	ra  = average[0].R - measure[0].dR / 3600.0;
+	dec = average[0].D - measure[0].dD / 3600.0;
+	image = MatchImage (measure[0].t, measure[0].photcode);
+	if (image == NULL) break;
+	RD_to_XY (&x, &y, ra, dec, &image[0].coords);
+	value = y;
+      }
 # endif
       break;
Index: trunk/Ohana/src/opihi/include/astro.h
===================================================================
--- trunk/Ohana/src/opihi/include/astro.h	(revision 17390)
+++ trunk/Ohana/src/opihi/include/astro.h	(revision 17419)
@@ -10,4 +10,5 @@
 
 void InitAstro ();
+void FreeAstro ();
 
 typedef struct {
Index: trunk/Ohana/src/opihi/include/basic.h
===================================================================
--- trunk/Ohana/src/opihi/include/basic.h	(revision 17390)
+++ trunk/Ohana/src/opihi/include/basic.h	(revision 17419)
@@ -5,3 +5,4 @@
 void cleanup ();
 void InitBasic ();
+void FreeBasic ();
 void InitBasic_PantasksClient ();
Index: trunk/Ohana/src/opihi/include/data.h
===================================================================
--- trunk/Ohana/src/opihi/include/data.h	(revision 17390)
+++ trunk/Ohana/src/opihi/include/data.h	(revision 17419)
@@ -34,4 +34,5 @@
 
 void InitData ();
+void FreeData ();
 
 /* in book.c */
@@ -153,4 +154,7 @@
 int ibracket (int *list, int Nlist, int mode, double value);
 
+void FreeKapa ();
+void FreeQueues ();
+void FreeBooks ();
+
 # endif
-
Index: trunk/Ohana/src/opihi/include/dvoshell.h
===================================================================
--- trunk/Ohana/src/opihi/include/dvoshell.h	(revision 17390)
+++ trunk/Ohana/src/opihi/include/dvoshell.h	(revision 17419)
@@ -188,4 +188,5 @@
 int           GetTimeSelection      PROTO((time_t *tz, time_t *te));
 void          InitDVO               PROTO(());
+void          FreeDVO               PROTO(());
 int           InitPhotcodes         PROTO(());
 Image        *LoadImages            PROTO((int *Nimage));
@@ -262,3 +263,6 @@
 int dbExtractMeasuresInitMeas ();
 
+int dbExtractAveragesInitTransform (CoordTransformSystem target);
+int dbExtractAveragesInit ();
+
 # endif
Index: trunk/Ohana/src/opihi/include/mana.h
===================================================================
--- trunk/Ohana/src/opihi/include/mana.h	(revision 17390)
+++ trunk/Ohana/src/opihi/include/mana.h	(revision 17419)
@@ -6,4 +6,5 @@
 
 void InitMana ();
+void FreeMana ();
 int *findrowpeaks (float *row, int Nrow, float threshold, int *npeaks);
 
Index: trunk/Ohana/src/opihi/include/pantasks.h
===================================================================
--- trunk/Ohana/src/opihi/include/pantasks.h	(revision 17390)
+++ trunk/Ohana/src/opihi/include/pantasks.h	(revision 17419)
@@ -162,7 +162,15 @@
 
 void InitPantasks ();
+void FreePantasks ();
+
 void InitPantasksServer ();
+void FreePantasksServer ();
+
 void InitPantasksClient ();
+void FreePantasksClient ();
+
 void InitTasks ();
+void FreeTasks ();
+
 Task *NextTask ();
 Task *FindTask (char *name);
@@ -187,8 +195,11 @@
 
 int NextJobID ();
-int InitJobIDs ();
+void InitJobIDs ();
+void FreeJobIDs ();
 int FreeJobID (int ID);
 
 void InitJobs ();
+void FreeJobs ();
+
 Job *NextJob ();
 Job *FindJob (int JobID);
@@ -256,4 +267,5 @@
 // functions related to the queue of input files
 void InitInputs ();
+void FreeInputs ();
 void AddNewInput (char *input);
 int DeleteInput (char *input);
Index: trunk/Ohana/src/opihi/include/pclient.h
===================================================================
--- trunk/Ohana/src/opihi/include/pclient.h	(revision 17390)
+++ trunk/Ohana/src/opihi/include/pclient.h	(revision 17419)
@@ -45,8 +45,10 @@
 
 int InitChild ();
+int FreeChild ();
 int CheckChild ();
 void CheckChildStatus ();
 
 void InitPclient ();
+void FreePclient ();
 void gotsignal (int signum);
 
Index: trunk/Ohana/src/opihi/include/pcontrol.h
===================================================================
--- trunk/Ohana/src/opihi/include/pcontrol.h	(revision 17390)
+++ trunk/Ohana/src/opihi/include/pcontrol.h	(revision 17419)
@@ -125,7 +125,9 @@
 
 void InitPcontrol ();
+void FreePcontrol ();
 
 /*** StackOps.c ***/
 Stack *InitStack ();
+void   FreeStack (Stack *stack);
 int    PushStack (Stack *stack, int where, void *object, int id, char *name);
 void  *PullStackByLocation (Stack *stack, int where);
@@ -184,4 +186,5 @@
 /*** HostOps.c ***/
 void   InitHostStacks ();
+void   FreeHostStacks ();
 Stack *GetHostStack (int StackID);
 char  *GetHostStackName (int StackID);
@@ -204,4 +207,5 @@
 /*** JobOps.c ***/
 void   InitJobStacks ();
+void   FreeJobStacks ();
 Stack *GetJobStack (int StackID);
 char  *GetJobStackName (int StackID);
Index: trunk/Ohana/src/opihi/include/shell.h
===================================================================
--- trunk/Ohana/src/opihi/include/shell.h	(revision 17390)
+++ trunk/Ohana/src/opihi/include/shell.h	(revision 17419)
@@ -65,5 +65,8 @@
 int           opihi                     PROTO((int argc, char **argv));
 int           multicommand          	PROTO((char *line));
+int getServer ();
 void          multicommand_InitServer   PROTO((void));
+void multicommand_StopServer ();
+
 int           command               	PROTO((char *line, char **outline, int VERBOSE));
 char         *expand_vars           	PROTO((char *line));
@@ -111,4 +114,5 @@
 
 int           ConfigInit            	PROTO((int *argc, char **argv));
+void          ConfigFree            	PROTO((void));
 char         *VarConfig             	PROTO((char *keyword, char *mode, void *ptr));
 char         *VarConfigEntry           	PROTO((char *keyword, char *mode, int entry, void *ptr));
@@ -170,4 +174,10 @@
 int DefineValidIP ();
 
+void FreeCommands ();
+void FreeMacros ();
+void FreeBuffers ();
+void FreeVectors ();
+void FreeVariables ();
+void FreeLists ();
+
 # endif
-
Index: trunk/Ohana/src/opihi/lib.data/page.c
===================================================================
--- trunk/Ohana/src/opihi/lib.data/page.c	(revision 17390)
+++ trunk/Ohana/src/opihi/lib.data/page.c	(revision 17419)
@@ -137,5 +137,4 @@
 
   int i, N, *seq;
-  Page *page;
 
   N = book[0].Npages;
Index: trunk/Ohana/src/opihi/lib.shell/VariableOps.c
===================================================================
--- trunk/Ohana/src/opihi/lib.shell/VariableOps.c	(revision 17390)
+++ trunk/Ohana/src/opihi/lib.shell/VariableOps.c	(revision 17419)
@@ -142,5 +142,5 @@
   
   int i;
-  char *local, *MacroName, *value;
+  char *local, *value;
 
   if (name == NULL) return (NULL);
Index: trunk/Ohana/src/opihi/lib.shell/gprint.c
===================================================================
--- trunk/Ohana/src/opihi/lib.shell/gprint.c	(revision 17390)
+++ trunk/Ohana/src/opihi/lib.shell/gprint.c	(revision 17419)
@@ -223,5 +223,4 @@
 void gprintSetFile (gpStream *stream, gpDest dest, char *filename) {
 
-  int i, Nmatch;
   FILE *file;
 
Index: trunk/Ohana/src/opihi/pantasks/JobIDOps.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/JobIDOps.c	(revision 17390)
+++ trunk/Ohana/src/opihi/pantasks/JobIDOps.c	(revision 17419)
@@ -5,13 +5,12 @@
 static int   JobIDPtr;
 
-int InitJobIDs () {
+void InitJobIDs () {
 
   JobIDPtr = 0;
   ALLOCATE (JobIDList, char, MAX_N_JOBS);
   bzero (JobIDList, MAX_N_JOBS*sizeof(char));
-  return (TRUE);
 }  
 
-int FreeJobIDs () {
+void FreeJobIDs () {
   free (JobIDList);
 }
Index: trunk/Ohana/src/opihi/pclient/init.c
===================================================================
--- trunk/Ohana/src/opihi/pclient/init.c	(revision 17390)
+++ trunk/Ohana/src/opihi/pclient/init.c	(revision 17419)
@@ -1,3 +1,3 @@
-# include "opihi.h"
+# include "pclient.h"
 
 int job	            PROTO((int, char **));
