Index: trunk/Ohana/src/getstar/include/dvoImageExtract.h
===================================================================
--- trunk/Ohana/src/getstar/include/dvoImageExtract.h	(revision 27142)
+++ trunk/Ohana/src/getstar/include/dvoImageExtract.h	(revision 27435)
@@ -21,5 +21,5 @@
 int  args_extract    	 PROTO((int argc, char **argv));
 int  ConfigInit_extract  PROTO((int *argc, char **argv));
-int  Shutdown         	 PROTO((char *format, ...));
+int  Shutdown         	 PROTO((char *format, ...)) OHANA_FORMAT(printf, 1, 2);
 void TrapSignal       	 PROTO((int sig));
 void SetProtect       	 PROTO((int mode));
@@ -30,4 +30,4 @@
 
 int  WriteImageFITS (FILE *f, Image *image);
-int  WriteImages (char *filename, Image *images, int Nimages, int *matches, int Nmatches);
-int *SelectImages (char *filename, Image *dbImages, int NdbImages, int *Nmatch);
+int  WriteImages (char *filename, Image *images, off_t Nimages, off_t *matches, off_t Nmatches);
+off_t *SelectImages (char *filename, Image *dbImages, off_t NdbImages, off_t *Nmatch);
Index: trunk/Ohana/src/getstar/include/dvoImageOverlaps.h
===================================================================
--- trunk/Ohana/src/getstar/include/dvoImageOverlaps.h	(revision 27142)
+++ trunk/Ohana/src/getstar/include/dvoImageOverlaps.h	(revision 27435)
@@ -24,13 +24,13 @@
 int  args_overlaps    	 PROTO((int argc, char **argv));
 int  ConfigInit_overlaps PROTO((int *argc, char **argv));
-int  Shutdown         PROTO((char *format, ...));
+int  Shutdown         PROTO((char *format, ...) OHANA_FORMAT(printf, 1, 2));
 void TrapSignal       PROTO((int sig));
 void SetProtect       PROTO((int mode));
 int  SetSignals       PROTO((void));
 
-Image *ReadImageFiles (char *filename, int *Nimages);
+Image *ReadImageFiles (char *filename, off_t *Nimages);
 int ReadImageHeader (Header *header, Image *image);
-int *MatchImage (Image *dbImages, int NdbImages, Image *image, int *Nmatch);
-int ListImageOverlaps (Image *dbImages, Image *image, int *matches, int Nmatches);
+off_t *MatchImage (Image *dbImages, off_t NdbImages, Image *image, off_t *Nmatch);
+int ListImageOverlaps (Image *dbImages, Image *image, off_t *matches, off_t Nmatches);
 
 int GetFileMode (Header *header);
Index: trunk/Ohana/src/getstar/include/dvoImagesAtCoords.h
===================================================================
--- trunk/Ohana/src/getstar/include/dvoImagesAtCoords.h	(revision 27142)
+++ trunk/Ohana/src/getstar/include/dvoImagesAtCoords.h	(revision 27435)
@@ -39,12 +39,12 @@
 int  args_coords    	 PROTO((int argc, char **argv));
 int  ConfigInit_coords PROTO((int *argc, char **argv));
-int  Shutdown         PROTO((char *format, ...));
+int  Shutdown         PROTO((char *format, ...) OHANA_FORMAT(printf, 1, 2));
 void TrapSignal       PROTO((int sig));
 void SetProtect       PROTO((int mode));
 int  SetSignals       PROTO((void));
 
-Image *ReadImageFiles (char *filename, int *Nimages);
+Image *ReadImageFiles (char *filename, off_t *Nimages);
 int ReadImageHeader (Header *header, Image *image);
-int MatchCoords(Image *, int, Point *, int);
+off_t MatchCoords (Image *dbImages, off_t NdbImages, Point *points, int Npoints);
 
 int GetFileMode (Header *header);
Index: trunk/Ohana/src/getstar/include/getstar.h
===================================================================
--- trunk/Ohana/src/getstar/include/getstar.h	(revision 27142)
+++ trunk/Ohana/src/getstar/include/getstar.h	(revision 27435)
@@ -37,5 +37,5 @@
 int  args             	     PROTO((int argc, char **argv));
 int  ConfigInit       	     PROTO((int *argc, char **argv));
-int  Shutdown         	     PROTO((char *format, ...));
+int  Shutdown         	     PROTO((char *format, ...)) OHANA_FORMAT(printf, 1, 2);
 int  load_pt_catalog  	     PROTO((Catalog *catalog, SkyRegion *region));
 int  select_by_region 	     PROTO((Catalog *output, Catalog *catalog, SkyRegion *region, int start, int end));
Index: trunk/Ohana/src/getstar/src/ConfigInit_coords.c
===================================================================
--- trunk/Ohana/src/getstar/src/ConfigInit_coords.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/ConfigInit_coords.c	(revision 27435)
@@ -4,6 +4,4 @@
 
   char *config, *file;
-  char CatdirPhotcodeFile[256];
-  char MasterPhotcodeFile[256];
 
   /*** load configuration info ***/
@@ -21,5 +19,4 @@
   ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
-  ScanConfig (config, "PHOTCODE_FILE",         	"%s",  0, MasterPhotcodeFile);
   if (!ScanConfig (config, "SKY_DEPTH",         "%d",  0, &SKY_DEPTH)) {
     SKY_DEPTH = 2;
Index: trunk/Ohana/src/getstar/src/ConfigInit_extract.c
===================================================================
--- trunk/Ohana/src/getstar/src/ConfigInit_extract.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/ConfigInit_extract.c	(revision 27435)
@@ -4,6 +4,4 @@
 
   char *config, *file;
-  char CatdirPhotcodeFile[256];
-  char MasterPhotcodeFile[256];
 
   /*** load configuration info ***/
@@ -21,5 +19,4 @@
   ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
-  ScanConfig (config, "PHOTCODE_FILE",         	"%s",  0, MasterPhotcodeFile);
   if (!ScanConfig (config, "SKY_DEPTH",         "%d",  0, &SKY_DEPTH)) {
     SKY_DEPTH = 2;
@@ -33,11 +30,4 @@
   if (*CATFORMAT == 0) strcpy (CATFORMAT, "ELIXIR");
 
-  /* XXX this does not yet write out the master photcode table */
-  sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
-  if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, TRUE)) {
-    fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);
-    exit (1);
-  }
-
   free (config);
   free (file);
Index: trunk/Ohana/src/getstar/src/ConfigInit_overlaps.c
===================================================================
--- trunk/Ohana/src/getstar/src/ConfigInit_overlaps.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/ConfigInit_overlaps.c	(revision 27435)
@@ -4,6 +4,4 @@
 
   char *config, *file;
-  char CatdirPhotcodeFile[256];
-  char MasterPhotcodeFile[256];
 
   /*** load configuration info ***/
@@ -21,5 +19,4 @@
   ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
-  ScanConfig (config, "PHOTCODE_FILE",         	"%s",  0, MasterPhotcodeFile);
   if (!ScanConfig (config, "SKY_DEPTH",         "%d",  0, &SKY_DEPTH)) {
     SKY_DEPTH = 2;
@@ -33,11 +30,4 @@
   if (*CATFORMAT == 0) strcpy (CATFORMAT, "ELIXIR");
 
-  /* XXX this does not yet write out the master photcode table */
-  sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
-  if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, FALSE)) {
-    fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);
-    exit (1);
-  }
-
   free (config);
   free (file);
Index: trunk/Ohana/src/getstar/src/GetFileMode.c
===================================================================
--- trunk/Ohana/src/getstar/src/GetFileMode.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/GetFileMode.c	(revision 27435)
@@ -8,9 +8,9 @@
   int simple, extend, haveNaxis, haveCTYPE;
 
-  gfits_scan (header, "SIMPLE", "%t", 1, &simple);
+  gfits_scan_alt (header, "SIMPLE", "%t", 1, &simple);
   haveNaxis = gfits_scan (header, "NAXIS",  "%d", 1, &Naxis);
   haveCTYPE = gfits_scan (header, "CTYPE1", "%s", 1, ctype);
 
-  gfits_scan (header, "EXTEND", "%t", 1, &extend);
+  gfits_scan_alt (header, "EXTEND", "%t", 1, &extend);
     
   if ((Naxis == 2) || !simple) {
Index: trunk/Ohana/src/getstar/src/ListImageOverlaps.c
===================================================================
--- trunk/Ohana/src/getstar/src/ListImageOverlaps.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/ListImageOverlaps.c	(revision 27435)
@@ -2,7 +2,7 @@
 
 /* given image, find catalog images which overlap it */
-int ListImageOverlaps (Image *dbImages, Image *image, int *matches, int Nmatches) {
+int ListImageOverlaps (Image *dbImages, Image *image, off_t *matches, off_t Nmatches) {
   
-  int i, N;
+  off_t i, N;
 
   for (i = 0; i < Nmatches; i++) {
Index: trunk/Ohana/src/getstar/src/MatchCoords.c
===================================================================
--- trunk/Ohana/src/getstar/src/MatchCoords.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/MatchCoords.c	(revision 27435)
@@ -5,12 +5,10 @@
 
 /* given coordinate, find images in list that contain the point */
-int MatchCoords (Image *dbImages, int NdbImages, Point *points, int Npoints) {
+off_t MatchCoords (Image *dbImages, off_t NdbImages, Point *points, int Npoints) {
   
-  int i, j, N;
+  off_t i;
+  int j;
   int totalMatches = 0;
-  Coords tcoords;
-  double r, d;
-  double Xi[4], Yi[4], Xo[4], Yo[4];  /* image and original corners */
-  double Xmin, Xmax, Ymin, Ymax;
+  double Xi[4], Yi[4];  /* image and original corners */
   double xmin, xmax, ymin, ymax;
 
Index: trunk/Ohana/src/getstar/src/MatchImages.c
===================================================================
--- trunk/Ohana/src/getstar/src/MatchImages.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/MatchImages.c	(revision 27435)
@@ -5,8 +5,8 @@
 
 /* given image, find catalog images which overlap it */
-int *MatchImage (Image *dbImages, int NdbImages, Image *image, int *Nmatch) {
+off_t *MatchImage (Image *dbImages, off_t NdbImages, Image *image, off_t *Nmatch) {
   
-  int i, j, N, addtolist, status;
-  int NMATCH, nmatch, *match;
+  off_t i, NMATCH, nmatch, *match;
+  int j, N, addtolist, status;
   Coords tcoords;
   double r, d;
@@ -64,5 +64,5 @@
   nmatch = 0;
   NMATCH = 20;
-  ALLOCATE (match, int, NMATCH);
+  ALLOCATE (match, off_t, NMATCH);
 
   /* setup links for mosaic WRP and DIS entries */
@@ -128,9 +128,9 @@
     if (nmatch == NMATCH) {
       NMATCH += 20;
-      REALLOCATE (match, int, NMATCH);
+      REALLOCATE (match, off_t, NMATCH);
     }
   }
   
-  if (VERBOSE) fprintf (stderr, "found %d overlapping images\n", nmatch);
+  if (VERBOSE) fprintf (stderr, "found %lld overlapping images\n", (long long) nmatch);
 
   *Nmatch = nmatch;
Index: trunk/Ohana/src/getstar/src/ReadImageFiles.c
===================================================================
--- trunk/Ohana/src/getstar/src/ReadImageFiles.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/ReadImageFiles.c	(revision 27435)
@@ -2,13 +2,14 @@
 # define DVO_IMAGE_NAME_LEN 128
 
-Image *ReadImageFiles (char *filename, int *Nimages) {
-
-  int i, j, N, Nfile, Nheader, NHEADER, Nimage, NIMAGE;
-  int Nskip, Nhead, Ndata, done, status, mode;
+Image *ReadImageFiles (char *filename, off_t *Nimages) {
+
+  off_t Nskip, *extsize;
+  int i, j, N, Nfile, Nheader, Nimage, NHEADER, NIMAGE;
+  int Nhead, Ndata, done, status, mode;
   char **file, *name;
   FILE *f;
   glob_t globList;
   char **exthead, **extdata, **exttype, tmpword[80];
-  int *extnum_head, *extnum_data, *extsize;
+  int *extnum_head, *extnum_data;
   Header *header, **headers;
   Image *image;
@@ -89,5 +90,5 @@
   headers[0] = header;
   Nskip = gfits_data_size (header);
-  fseek (f, Nskip, SEEK_CUR); 
+  fseeko (f, Nskip, SEEK_CUR); 
 
   // load all headers into memory
@@ -118,5 +119,5 @@
   ALLOCATE (extnum_head, int, NIMAGE);
   ALLOCATE (extnum_data, int, NIMAGE);
-  ALLOCATE (extsize, int, Nheader);
+  ALLOCATE (extsize, off_t, Nheader);
 
   if (mode == MOSAIC_MEF) {
@@ -130,5 +131,5 @@
   // now examine the headers, count the table entries, find corresponding headers
   for (i = 0; i < Nheader; i++) {
-      extsize[i] = headers[i][0].size + gfits_data_size (headers[i]);
+      extsize[i] = headers[i][0].datasize + gfits_data_size (headers[i]);
       gfits_scan (headers[i], "EXTTYPE", "%s", 1, tmpword);
 
@@ -166,6 +167,6 @@
   // extension matched to the header in the PHU
   if (Nimage == 0) {
-      extsize[0] = headers[0][0].size + gfits_data_size (headers[0]);
-      extsize[1] = headers[1][0].size + gfits_data_size (headers[1]);
+      extsize[0] = headers[0][0].datasize + gfits_data_size (headers[0]);
+      extsize[1] = headers[1][0].datasize + gfits_data_size (headers[1]);
       gfits_scan (headers[1], "EXTNAME", "%s", 1, tmpword);
       if (!strcmp (tmpword, "SMPFILE")) {
Index: trunk/Ohana/src/getstar/src/SelectImages.c
===================================================================
--- trunk/Ohana/src/getstar/src/SelectImages.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/SelectImages.c	(revision 27435)
@@ -2,8 +2,8 @@
 
 /* given image, find catalog images which overlap it */
-int *SelectImages (char *filename, Image *images, int Nimages, int *Nmatch) {
+off_t *SelectImages (char *filename, Image *images, off_t Nimages, off_t *Nmatch) {
   
-  int i, Nchar;
-  int NMATCH, nmatch, *match;
+  int Nchar;
+  off_t i, NMATCH, nmatch, *match;
 
   /* matches here are only based on string comparisons */
@@ -12,5 +12,5 @@
   nmatch = 0;
   NMATCH = 20;
-  ALLOCATE (match, int, NMATCH);
+  ALLOCATE (match, off_t, NMATCH);
 
   /* setup links for mosaic WRP and DIS entries */
@@ -27,9 +27,9 @@
     if (nmatch == NMATCH) {
       NMATCH += 20;
-      REALLOCATE (match, int, NMATCH);
+      REALLOCATE (match, off_t, NMATCH);
     }
   }  
 
-  if (VERBOSE) fprintf (stderr, "found %d matching images\n", nmatch);
+  if (VERBOSE) fprintf (stderr, "found %lld matching images\n", (long long) nmatch);
 
   *Nmatch = nmatch;
Index: trunk/Ohana/src/getstar/src/WriteImages.c
===================================================================
--- trunk/Ohana/src/getstar/src/WriteImages.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/WriteImages.c	(revision 27435)
@@ -2,5 +2,5 @@
 
 /* given image, find catalog images which overlap it */
-int WriteImages (char *filename, Image *images, int Nimages, int *matches, int Nmatches) {
+int WriteImages (char *filename, Image *images, off_t Nimages, off_t *matches, off_t Nmatches) {
   
   int i, N;
Index: trunk/Ohana/src/getstar/src/dvoImageExtract.c
===================================================================
--- trunk/Ohana/src/getstar/src/dvoImageExtract.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/dvoImageExtract.c	(revision 27435)
@@ -3,6 +3,6 @@
 int main (int argc, char **argv) {
 
-  int Nimages, status;
-  int Nmatches, *matches;
+  off_t Nimages, Nmatches, *matches;
+  int status;
   Image *images;
   FITS_DB db;
Index: trunk/Ohana/src/getstar/src/dvoImageOverlaps.c
===================================================================
--- trunk/Ohana/src/getstar/src/dvoImageOverlaps.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/dvoImageOverlaps.c	(revision 27435)
@@ -3,6 +3,7 @@
 int main (int argc, char **argv) {
 
-  int i, Nimages, NdbImages, status;
-  int Nmatches, *matches;
+  off_t NdbImages, Nimages;
+  int status;
+  off_t i, Nmatches, *matches;
   Image *images, *dbImages;
   FITS_DB db;
Index: trunk/Ohana/src/getstar/src/dvoImagesAtCoords.c
===================================================================
--- trunk/Ohana/src/getstar/src/dvoImagesAtCoords.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/dvoImagesAtCoords.c	(revision 27435)
@@ -12,6 +12,6 @@
 int main (int argc, char **argv) {
 
-  int i, Nimages, NdbImages, status;
-  int Nmatches, *matches;
+  off_t NdbImages;
+  int status;
   Image *dbImages;
   int Npoints;
Index: trunk/Ohana/src/getstar/src/select_by_region.c
===================================================================
--- trunk/Ohana/src/getstar/src/select_by_region.c	(revision 27142)
+++ trunk/Ohana/src/getstar/src/select_by_region.c	(revision 27435)
@@ -156,6 +156,6 @@
   output[0].Nsecf_mem = Nave*Nsecfilt;
 
-  fprintf (stderr, "output catalog has %d stars (%d measures, %d secfilt)\n",
-	   output[0].Naverage, output[0].Nmeasure, output[0].Nsecfilt);
+  fprintf (stderr, "output catalog has %lld stars (%lld measures, %d secfilt)\n",
+	   (long long) output[0].Naverage, (long long) output[0].Nmeasure, output[0].Nsecfilt);
   return (TRUE);
 }
