Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/include/relastro.h
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/include/relastro.h	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/include/relastro.h	(revision 27312)
@@ -140,5 +140,5 @@
 char         *GetPhotnamebyCode   PROTO((PhotCodeData *photcodes, int code));
 void          InterpolateGrid     PROTO((float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords));
-int          *SelectRefMosaic     PROTO((Mosaic **refmosaic, int *Nimage));
+off_t          *SelectRefMosaic     PROTO((Mosaic **refmosaic, off_t *Nimage));
 int           args                PROTO((int argc, char **argv));
 int           bcatalog            PROTO((Catalog *subcatalog, Catalog *catalog));
@@ -153,5 +153,5 @@
 void          findImages          PROTO((Catalog *catalog, int Ncatalog));
 int           findMosaics         PROTO((Catalog *catalog, int Ncatalog));
-Image        *find_images         PROTO((FITS_DB *db, GSCRegion *region, int Nregion, int *Nimage, int **LineNum));
+Image        *find_images         PROTO((FITS_DB *db, GSCRegion *region, off_t Nregion, off_t *Nimage, off_t **LineNum));
 void set_db (FITS_DB *in);
 int Shutdown (char *format, ...);
@@ -160,5 +160,5 @@
 int SetSignals (void);
 
-GSCRegion    *find_regions        PROTO((Image *image, int Nimage, int *Nregions, GSCRegion *fullregion));
+GSCRegion    *find_regions        PROTO((Image *image, off_t Nimage, int *Nregions, GSCRegion *fullregion));
 void          freeGridBins        PROTO((int Ncatalog));
 void          freeImageBins       PROTO((int Ncatalog));
@@ -166,21 +166,21 @@
 void          free_catalogs       PROTO((Catalog *catalog, int Ncatalog));
 int           gcatalog            PROTO((Catalog *catalog, int FINAL));
-Coords       *getCoords           PROTO((int meas, int cat));
-float         getMcal             PROTO((int meas, int cat));
-float         getMgrid            PROTO((int meas, int cat));
-float         getMmos             PROTO((int meas, int cat));
-float         getMrel             PROTO((Catalog *catalog, int meas, int cat));
-GSCRegion    *get_regions         PROTO((double minRa, double maxRa, double minDec, double maxDec, int *Nregions));
-void          getfullregion       PROTO((Image *image, int Nimage, GSCRegion *fullregion));
-Image        *getimage            PROTO((int N));
-Image        *getimages           PROTO((int *N));
+Coords       *getCoords           PROTO((off_t meas, int cat));
+float         getMcal             PROTO((off_t meas, int cat));
+float         getMgrid            PROTO((off_t meas, int cat));
+float         getMmos             PROTO((off_t meas, int cat));
+float         getMrel             PROTO((Catalog *catalog, off_t meas, int cat));
+GSCRegion    *get_regions         PROTO((double minRa, double maxRa, double minDec, double maxDec, off_t *Nregions));
+void          getfullregion       PROTO((Image *image, off_t Nimage, GSCRegion *fullregion));
+Image        *getimage            PROTO((off_t N));
+Image        *getimages           PROTO((off_t *N));
 void          global_stats        PROTO((Catalog *catalog, int Ncatalog));
 void          initGrid            PROTO((int dX, int dY));
 void          initGridBins        PROTO((Catalog *catalog, int Ncatalog));
 void          initImageBins       PROTO((Catalog *catalog, int Ncatalog));
-void          initImages          PROTO((Image *input, int N));
+void          initImages          PROTO((Image *input, off_t N));
 void          initMosaicBins      PROTO((Catalog *catalog, int Ncatalog));
-void          initMosaicGrid      PROTO((Image *image, int Nimage));
-void          initMosaics         PROTO((Image *image, int Nimage));
+void          initMosaicGrid      PROTO((Image *image, off_t Nimage));
+void          initMosaics         PROTO((Image *image, off_t Nimage));
 void          initMrel            PROTO((Catalog *catalog, int Ncatalog));
 void          initialize          PROTO((int argc, char **argv));
@@ -189,5 +189,5 @@
 Catalog      *load_catalogs       PROTO((SkyList *skylist, int *Ncatalog, int subselect));
 SkyList      *load_images         PROTO((FITS_DB *db, SkyRegion *region));
-Image        *select_images       PROTO((SkyList *skylist, Image *timage, int Ntimage, int **LineNumber, int *Nimage));
+Image        *select_images       PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage));
 
 void check_permissions (char *basefile);
@@ -198,8 +198,8 @@
 
 int           main                PROTO((int argc, char **argv));
-void          mark_images         PROTO((Image *image, int Nimage, Image *timage, int Ntimage));
-void          matchImage          PROTO((Catalog *catalog, int meas, int cat));
-void          matchMosaics        PROTO((Catalog *catalog, int meas, int cat));
-GSCRegion    *name_region         PROTO((char *name, int *Nregions));
+void          mark_images         PROTO((Image *image, off_t Nimage, Image *timage, off_t Ntimage));
+void          matchImage          PROTO((Catalog *catalog, off_t meas, int cat));
+void          matchMosaics        PROTO((Catalog *catalog, off_t meas, int cat));
+GSCRegion    *name_region         PROTO((char *name, off_t *Nregions));
 double        opening_angle       PROTO((double x1, double y1, double x2, double y2, double x3, double y3));
 void          plot_chisq          PROTO((Catalog *catalog, int Ncatalog));
@@ -224,5 +224,5 @@
 int           setMrelOutput       PROTO((Catalog *catalog, int Ncatalog, int mark));
 void          set_ZP              PROTO((double ZERO));
-int           setrefcode          PROTO((Image *image, int Nimage));
+int           setrefcode          PROTO((Image *image, off_t Nimage));
 void          skip_measurements   PROTO((Catalog *catalog, int pass));
 void          sortA               PROTO((double *X, int N));
@@ -268,5 +268,5 @@
 int UpdateMosaic (Catalog *catalog, int Ncatalog);
 int UpdateMeasures (Catalog *catalog, int Ncatalog);
-void fixImageRaw (Catalog *catalog, int Ncatalog, int im);
+void fixImageRaw (Catalog *catalog, int Ncatalog, off_t im);
 void FlagOutliers(Catalog *catalog);
 int MeasFilterTest(Measure *measure);
@@ -278,14 +278,14 @@
 int FitPMandPar (PMFit *fit, double *X, double *dX, double *Y, double *dY, double *T, double *pR, double *pD, int Npts);
 
-Mosaic *getMosaicForImage (int N);
-
-StarData *getImageRef (Catalog *catalog, int Ncatalog, int im, int *Nstars, CoordMode mode);
-StarData *getImageRaw (Catalog *catalog, int Ncatalog, int im, int *Nstars, CoordMode mode);
-
-Mosaic *getmosaics (int *N);
-void initMosaics (Image *image, int Nimage);
-StarData *getMosaicRaw (Catalog *catalog, int Ncatalog, int mos, int *Nstars);
-StarData *getMosaicRef (Catalog *catalog, int Ncatalog, int mos, int *Nstars);
-Mosaic *getMosaicForImage (int im);
+Mosaic *getMosaicForImage (off_t N);
+
+StarData *getImageRef (Catalog *catalog, int Ncatalog, off_t im, off_t *Nstars, CoordMode mode);
+StarData *getImageRaw (Catalog *catalog, int Ncatalog, off_t im, off_t *Nstars, CoordMode mode);
+
+Mosaic *getmosaics (off_t *N);
+void initMosaics (Image *image, off_t Nimage);
+StarData *getMosaicRaw (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars);
+StarData *getMosaicRef (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars);
+Mosaic *getMosaicForImage (off_t im);
 
 double getMeanR (Measure *measure, Average *average, SecFilt *secfilt);
@@ -297,2 +297,8 @@
 int relastro_objects (void);
 int UpdateObjectOffsets (SkyList *skylist);
+
+int relastroVisualPlotRawRef(StarData *raw, StarData *ref, double dRmax, int numObj);
+int relastroVisualPlotScatter(double values[], double thresh, int npts);
+int relastroVisualPlotOutliers(Catalog *catalog, int offset, int Nmeasure, 
+			       StatType statsR, StatType statsD, double thresh);
+
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/ImageOps.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/ImageOps.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/ImageOps.c	(revision 27312)
@@ -4,26 +4,26 @@
 static unsigned int *start;
 static unsigned int *stop;
-static int         **bin;
-
-static int         **clist;
-static int         **mlist;
-static int          *Nlist;
-static int          *NLIST;
-
-static Image        *image;
-static int          Nimage;
-
-Image *getimages (int *N) {
+
+static off_t       **bin;     // link from catalog,measure to image
+static int         **clist;   // catalog which supplied measurement on image
+static off_t       **mlist;   // measure reference for measurement on image
+static off_t        *Nlist;   // number of measurements on image
+static off_t        *NLIST;   // allocated number of measurements on image
+
+static Image        *image;   // list of available images
+static off_t        Nimage;   // number of available images
+
+Image *getimages (off_t *N) {
   *N = Nimage;
   return (image);
 }
 
-Image *getimage (int N) {
+Image *getimage (off_t N) {
   return (&image[N]);
 }
 
-void initImages (Image *input, int N) {
-
-  int i;
+void initImages (Image *input, off_t N) {
+
+  off_t i;
 
   image = input;
@@ -41,16 +41,16 @@
 void initImageBins (Catalog *catalog, int Ncatalog) {
 
-  int i, j;
-
-  ALLOCATE (bin, int *, Ncatalog);
+  off_t i, j;
+
+  ALLOCATE (bin, off_t *, Ncatalog);
   for (i = 0; i < Ncatalog; i++) {
-    ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1));
+    ALLOCATE (bin[i], off_t, MAX (catalog[i].Nmeasure, 1));
     for (j = 0; j < catalog[i].Nmeasure; j++) bin[i][j] = -1;
   }
 
-  ALLOCATE (Nlist, int, Nimage);
-  ALLOCATE (NLIST, int, Nimage);
-  ALLOCATE (clist, int *, Nimage);
-  ALLOCATE (mlist, int *, Nimage);
+  ALLOCATE (Nlist, off_t,   Nimage);
+  ALLOCATE (NLIST, off_t,   Nimage);
+  ALLOCATE (clist, int *,   Nimage);
+  ALLOCATE (mlist, off_t *, Nimage);
 
   for (i = 0; i < Nimage; i++) {
@@ -58,5 +58,5 @@
     NLIST[i] = 100;
     ALLOCATE (clist[i], int, NLIST[i]);
-    ALLOCATE (mlist[i], int, NLIST[i]);
+    ALLOCATE (mlist[i], off_t, NLIST[i]);
   }
 }
@@ -64,5 +64,5 @@
 void freeImageBins (int Ncatalog) {
 
-  int i;
+  off_t i;
 
   for (i = 0; i < Ncatalog; i++) {
@@ -81,5 +81,5 @@
 void findImages (Catalog *catalog, int Ncatalog) {
 
-  int i, j;
+  off_t i, j;
   char *name;
 
@@ -92,5 +92,5 @@
   for (i = 0; VERBOSE && (i < Nimage); i++) {
     name = GetPhotcodeNamebyCode (image[i].photcode);
-    fprintf (stderr, "image %d has %d measures (%s, %s)\n", i, Nlist[i],
+    fprintf (stderr, "image %lld has %lld measures (%s, %s)\n", (long long) i, (long long) Nlist[i],
              ohana_sec_to_date(image[i].tzero), name);
   }
@@ -98,7 +98,7 @@
 
 /* modify this function to use the measure->imageID field */
-void matchImage (Catalog *catalog, int meas, int cat) {
-
-  int i;
+void matchImage (Catalog *catalog, off_t meas, int cat) {
+
+  off_t i;
   Measure *measure;
 
@@ -124,6 +124,6 @@
     if (Nlist[i] == NLIST[i]) {
       NLIST[i] += 100;
-      REALLOCATE (clist[i], int, NLIST[i]);
-      REALLOCATE (mlist[i], int, NLIST[i]);
+      REALLOCATE (clist[i], int,   NLIST[i]);
+      REALLOCATE (mlist[i], off_t, NLIST[i]);
     }
     return;
@@ -131,7 +131,7 @@
 }
 
-Coords *getCoords (int meas, int cat) {
-
-  int i;
+Coords *getCoords (off_t meas, int cat) {
+
+  off_t i;
 
   i = bin[cat][meas];
@@ -142,5 +142,5 @@
 void plot_images () {
 
-  int i, bin;
+  off_t i, bin;
   double *xlist, *Mlist, *dlist;
   Graphdata graphdata;
@@ -188,7 +188,7 @@
 // return StarData values for detections in the specified image, converting coordinates from the
 // chip positions: X,Y -> L,M -> P,Q -> R,D
-void fixImageRaw (Catalog *catalog, int Ncatalog, int im) {
-
-  int i, m, c, n;
+void fixImageRaw (Catalog *catalog, int Ncatalog, off_t im) {
+
+  off_t i, m, c, n;
   double X, Y, L, M, P, Q, R, D, dR, dD;
 
@@ -257,7 +257,7 @@
 // chip positions: X,Y -> L,M -> P,Q -> R,D.  This function is used by the image fitting steps, for
 // which the detections have already been filtered when they were loaded (bcatalog)
-StarData *getImageRaw (Catalog *catalog, int Ncatalog, int im, int *Nstars, CoordMode mode) {
-
-  int i, m, c, n;
+StarData *getImageRaw (Catalog *catalog, int Ncatalog, off_t im, off_t *Nstars, CoordMode mode) {
+
+  off_t i, m, c, n;
 
   Mosaic *mosaic;
@@ -332,7 +332,7 @@
 // the sky positions: R,D -> P,Q -> L,M -> X,Y
 
-StarData *getImageRef (Catalog *catalog, int Ncatalog, int im, int *Nstars, CoordMode mode) {
-
-  int i, m, c, n;
+StarData *getImageRef (Catalog *catalog, int Ncatalog, off_t im, off_t *Nstars, CoordMode mode) {
+
+  off_t i, m, c, n;
 
   Mosaic *mosaic;
@@ -399,5 +399,6 @@
   return;
 
-  int i, j, k, m, N, Ndel, Nave, Nmax, TOOFEW, Nsecfilt;
+  int Ndel, Nave;
+  off_t i, j, k, m, N, Nmax, TOOFEW, Nsecfilt;
   double Ns, theta, x, y;
   double *R, *D, *dR, *dD;
@@ -490,5 +491,6 @@
 void FlagOutliers2D (Catalog *catalog) {
 
-  int i, j, k, m, N, Ndel, Nave, Nmax, TOOFEW, Nsecfilt;
+  int Ndel, Nave;
+  off_t i, j, k, m, N, Nmax, TOOFEW, Nsecfilt;
   double *index;
   double Ns, theta, x, y;
@@ -569,5 +571,5 @@
     // recalculate image center, sigma based on closest 50% of points
     for(k = 0;  k < N; k++) {
-      int ind = (int) index[k];
+      off_t ind = (off_t) index[k];
       R[k] = catalog[0].measure[ind].dR;
       D[k] = catalog[0].measure[ind].dD;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/MosaicOps.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/MosaicOps.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/MosaicOps.c	(revision 27312)
@@ -2,17 +2,17 @@
 
 // array of mosaic definition structures
-static int    Nmosaic;
+static off_t    Nmosaic;
 static Mosaic *mosaic;
 
 // list of all images associated with a mosaic
-static int   *Nmosaic_own_images; // number of images for this mosaic
-static int   *Amosaic_own_images; // size of allocated array
-static int   **mosaic_own_images; // array of arrays: mosaic -> images
+static off_t   *Nmosaic_own_images; // number of images for this mosaic
+static off_t   *Amosaic_own_images; // size of allocated array
+static off_t   **mosaic_own_images; // array of arrays: mosaic -> images
 
 // list of mosaic associated with each image  
-static int    Nmosaic_for_images; // number of images (for internal checks)
-static int    *mosaic_for_images; // array of: image -> mosaic
+static off_t    Nmosaic_for_images; // number of images (for off_ternal checks)
+static off_t    *mosaic_for_images; // array of: image -> mosaic
 
-Mosaic *getmosaics (int *N) {
+Mosaic *getmosaics (off_t *N) {
   *N = Nmosaic;
   return (mosaic);
@@ -20,7 +20,7 @@
 
 // find mosaic frames (unique time periods & photcode name matches mosaic) 
-void initMosaics (Image *image, int Nimage) {
+void initMosaics (Image *image, off_t Nimage) {
 
-  int i, j, found, NMOSAIC;
+  off_t i, j, found, NMOSAIC;
   unsigned int start, stop;
 
@@ -29,7 +29,7 @@
   ALLOCATE (mosaic, Mosaic, NMOSAIC);
 
-  ALLOCATE (Nmosaic_own_images, int, NMOSAIC);
-  ALLOCATE (Amosaic_own_images, int, NMOSAIC);
-  ALLOCATE (mosaic_own_images, int *, NMOSAIC);
+  ALLOCATE (Nmosaic_own_images, off_t, NMOSAIC);
+  ALLOCATE (Amosaic_own_images, off_t, NMOSAIC);
+  ALLOCATE (mosaic_own_images, off_t *, NMOSAIC);
 
   /* find the mosaic images (coords.ctype = DIS); generate list of unique mosaics */
@@ -54,5 +54,5 @@
     Nmosaic_own_images[Nmosaic] = 0;
     Amosaic_own_images[Nmosaic] = 10;
-    ALLOCATE (mosaic_own_images[Nmosaic], int, Amosaic_own_images[Nmosaic]);
+    ALLOCATE (mosaic_own_images[Nmosaic], off_t, Amosaic_own_images[Nmosaic]);
 
     Nmosaic ++;
@@ -60,7 +60,7 @@
       NMOSAIC += 10;
       REALLOCATE (mosaic, Mosaic, NMOSAIC);
-      REALLOCATE (mosaic_own_images, int *, NMOSAIC);
-      REALLOCATE (Nmosaic_own_images, int, NMOSAIC);
-      REALLOCATE (Amosaic_own_images, int, NMOSAIC);
+      REALLOCATE (mosaic_own_images, off_t *, NMOSAIC);
+      REALLOCATE (Nmosaic_own_images, off_t, NMOSAIC);
+      REALLOCATE (Amosaic_own_images, off_t, NMOSAIC);
     }
   }
@@ -68,5 +68,5 @@
   // array to store image->mosaic index
   Nmosaic_for_images = Nimage;
-  ALLOCATE (mosaic_for_images, int, Nmosaic_for_images);
+  ALLOCATE (mosaic_for_images, off_t, Nmosaic_for_images);
 
   /* now assign the WRP images to these mosaics */
@@ -99,5 +99,5 @@
     if (Nmosaic_own_images[j] == Amosaic_own_images[j]) {
       Amosaic_own_images[j] += 10;
-      REALLOCATE (mosaic_own_images[j], int, Amosaic_own_images[j]);
+      REALLOCATE (mosaic_own_images[j], off_t, Amosaic_own_images[j]);
     }
     assert (Nmosaic_own_images[j] < Amosaic_own_images[j]);
@@ -109,7 +109,7 @@
 // return StarData values for detections in the specified image, converting coordinates from the
 // chip positions: X,Y -> L,M -> P,Q -> R,D
-StarData *getMosaicRaw (Catalog *catalog, int Ncatalog, int mos, int *Nstars) {
+StarData *getMosaicRaw (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars) {
 
-  int i, j, im, Nraw, Nnew;
+  off_t i, j, im, Nraw, Nnew;
   StarData *raw, *new;
 
@@ -142,7 +142,7 @@
 // return StarData values for averages positions in the specified image, converting coordinates from
 // the sky positions: R,D -> P,Q -> L,M -> X,Y
-StarData *getMosaicRef (Catalog *catalog, int Ncatalog, int mos, int *Nstars) {
+StarData *getMosaicRef (Catalog *catalog, int Ncatalog, off_t mos, off_t *Nstars) {
 
-  int i, j, im, Nref, Nnew;
+  off_t i, j, im, Nref, Nnew;
   StarData *ref, *new;
   
@@ -172,7 +172,7 @@
 }
 
-Mosaic *getMosaicForImage (int im) {
+Mosaic *getMosaicForImage (off_t im) {
 
-  int mos;
+  off_t mos;
 
   if (im < 0) abort();
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateChips.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateChips.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateChips.c	(revision 27312)
@@ -4,5 +4,5 @@
 
   /* we can measure new image parameters for each non-mosaic chip independently */
-  int i, Nimage, Nraw, Nref;
+  off_t i, Nimage, Nraw, Nref;
   Image *image;
   StarData *raw, *ref;
@@ -25,5 +25,5 @@
 
     // FitChip does iterative, clipped fitting
-    fprintf (stderr, "image %d : Nstars: %d\n", i, Nraw);
+    fprintf (stderr, "image %lld : Nstars: %lld\n", (long long) i, (long long) Nraw);
     FitChip (raw, ref, Nraw, &image[i].coords);
 
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateMeasures.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateMeasures.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateMeasures.c	(revision 27312)
@@ -3,5 +3,5 @@
 int UpdateMeasures (Catalog *catalog, int Ncatalog) {
 
-  int i, Nimage;
+  off_t i, Nimage;
   Image *image;
 
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateMosaic.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateMosaic.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateMosaic.c	(revision 27312)
@@ -4,5 +4,5 @@
 
   /* we can measure new image parameters for each mosaic independently */
-  int i, Nmosaic, Nstars;
+  off_t i, Nmosaic, Nstars;
   Mosaic *mosaic;
   StarData *raw, *ref;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateObjects.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateObjects.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateObjects.c	(revision 27312)
@@ -1,5 +1,5 @@
 # include "relastro.h"
 
-static int Nmax;
+static off_t   Nmax;
 static double *X, *dX;
 static double *Y, *dY;
@@ -13,5 +13,5 @@
 void initObjectData (Catalog *catalog, int Ncatalog) {
 
-  int i, j;
+  off_t i, j;
   
   Nmax = 0;
@@ -40,5 +40,5 @@
 int UpdateObjects (Catalog *catalog, int Ncatalog) {
 
-  int i, j, k, m, N, Nsecfilt, found, kp;
+  int i, j, k, m, N, Nsecfilt;
   StatType statsR, statsD;
   Coords coords;
@@ -47,7 +47,4 @@
   int mode, Nave, Npm, Npar, Nskip;
   double Tmin, Tmax;
-  float mag;
-  int mask;
-  PhotCode *code;
 
   initObjectData (catalog, Ncatalog);
@@ -74,5 +71,5 @@
   for (i = 0; i < Ncatalog; i++) {
 
-    if (VERBOSE) fprintf (stderr, "astrometrize catalog %d : %d ave, %d meas\n", i, catalog[i].Naverage, catalog[i].Nmeasure);
+    if (VERBOSE) fprintf (stderr, "astrometrize catalog %d : %lld ave, %lld meas\n", i, (long long) catalog[i].Naverage, (long long) catalog[i].Nmeasure);
 
     Nskip = 0;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/bcatalog.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/bcatalog.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/bcatalog.c	(revision 27312)
@@ -3,9 +3,7 @@
 int bcatalog (Catalog *subcatalog, Catalog *catalog) {
 
-  int i, j, k, offset, found;
-  int NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm, Nsecfilt;
-  float mag;
-  int mask;
-  PhotCode *code;
+  off_t i, j, offset;
+  off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm;
+  int Nsecfilt;
 
   // XXX in the future, use catalog[0].Nsecfilt only?  allow catalogs to have variable Nsecfilt?
@@ -106,6 +104,5 @@
 
   if (VERBOSE) {
-    fprintf (stderr, "%d: using %d stars (%d measures) for catalog\n", i,
-             subcatalog[0].Naverage, subcatalog[0].Nmeasure);
+    fprintf (stderr, "%lld: using %lld stars (%lld measures) for catalog\n", (long long) i, (long long) subcatalog[0].Naverage, (long long) subcatalog[0].Nmeasure);
    }
   return (TRUE);
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/load_images.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/load_images.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/load_images.c	(revision 27312)
@@ -4,6 +4,6 @@
 
   Image     *image, *subset;
-  int        Nimage, Nsubset;
-  int       *LineNumber;
+  off_t      Nimage, Nsubset;
+  off_t     *LineNumber;
 
   SkyTable *sky = NULL;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/select_images.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/select_images.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/select_images.c	(revision 27312)
@@ -13,11 +13,11 @@
 } SkyRegionCoords;
 
-Image *select_images (SkyList *skylist, Image *timage, int Ntimage, int **LineNumber, int *Nimage) {
+Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage) {
   
   Image *image;
-  int i, j, k, m, found, nimage, NIMAGE;
-  int InRange;
+  off_t i, j, k, m, nimage, NIMAGE;
+  int InRange, found;
   double Ri[5], Di[5], Xi[5], Yi[5], dx, dy;
-  int *line_number;
+  off_t *line_number;
   Coords tcoords;
   SkyRegionCoords *skycoords;
@@ -71,5 +71,5 @@
   NIMAGE = 100;
   ALLOCATE (image, Image, NIMAGE);
-  ALLOCATE (line_number, int, NIMAGE);
+  ALLOCATE (line_number, off_t, NIMAGE);
   
   // go through the complete list of images, selecting ones which overlap any region
@@ -161,13 +161,13 @@
 	NIMAGE += 100;
 	REALLOCATE (image, Image, NIMAGE);
-	REALLOCATE (line_number, int, NIMAGE);
+	REALLOCATE (line_number, off_t, NIMAGE);
       }
     }
   }
       
-  if (VERBOSE) fprintf (stderr, "found %d images\n", nimage);
+  if (VERBOSE) fprintf (stderr, "found %lld images\n", (long long) nimage);
 
   REALLOCATE (image, Image, MAX (nimage, 1));
-  REALLOCATE (line_number, int, MAX (nimage, 1));
+  REALLOCATE (line_number, off_t, MAX (nimage, 1));
   free (skycoords);
 
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/include/relphot.h
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/include/relphot.h	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/include/relphot.h	(revision 27312)
@@ -7,12 +7,4 @@
 # define GRID_V2
 # define NO_IMAGE -100
-
-# if (0)
-typedef struct {
-  double xmin, xmax, ymin, ymax;
-  int style, ptype, ltype, etype, color;
-  double lweight, size;
-} Graphdata;
-# endif
 
 typedef struct {
@@ -110,9 +102,9 @@
 
 # ifdef GRID_V1
-int setGridMeasure (int meas, int cat, double X, double Y);
+int setGridMeasure (off_t meas, int cat, double X, double Y);
 # endif
 
 # ifdef GRID_V2
-int setGridMeasure (int meas, int cat, double X, double Y, int ccdnum);
+int setGridMeasure (off_t meas, int cat, double X, double Y, int ccdnum);
 # endif
 
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/GridOps.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/GridOps.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/GridOps.c	(revision 27312)
@@ -7,20 +7,20 @@
 };
 
-static int     Ngrid;
+static int     Ngrid;  // number of grid elements (gridX * gridY)
 static float   *gridM; // magnitude offset for this grid cell 
 static float   *gridS; // stdev of the magnitude offset for this grid cell 
 static int     *gridN; // number of stars used to measure the magnitude offset for this grid cell 
 static int     *gridV; // data mode for this cell: fitted, frozen, reference
-static int      gridX;
-static int      gridY;
-
-static int    **bin;
-static int    **Xmeas;
-static int    **Ymeas;
+static int      gridX; // number of grid elements in X direction
+static int      gridY; // number of grid elements in Y direction
+
+static int    **bin;   // link from catalog, measure to grid element
+static int    **Xmeas; // grid x-coordinate for a measurement
+static int    **Ymeas; // grid y-coordinate for a measurement
 
 static int    **clist; // link from measurement on a cell to catalog containing measurement
-static int    **mlist; // link from measurement on a cell to measurement in a catalog
-static int     *Nlist; // list of measurements for each grid cell
-static int     *NLIST;
+static off_t  **mlist; // link from measurement on a cell to measurement in a catalog
+static off_t   *Nlist; // number of measurements for each grid cell
+static off_t   *NLIST; // allocated number of measurements for each grid cell
 
 static struct {
@@ -159,5 +159,5 @@
   ALLOCATE (Ymeas, int *, Ncatalog);
   for (i = 0; i < Ncatalog; i++) {
-    ALLOCATE (bin[i], int, MAX (catalog[i].Nmeasure, 1));
+    ALLOCATE (bin[i],   int, MAX (catalog[i].Nmeasure, 1));
     ALLOCATE (Xmeas[i], int, MAX (catalog[i].Nmeasure, 1));
     ALLOCATE (Ymeas[i], int, MAX (catalog[i].Nmeasure, 1));
@@ -166,14 +166,14 @@
 
   /* define grid -> cat,meas pointers */
-  ALLOCATE (Nlist, int, Ngrid);
-  ALLOCATE (NLIST, int, Ngrid);
-  ALLOCATE (clist, int *, Ngrid);
-  ALLOCATE (mlist, int *, Ngrid);
+  ALLOCATE (Nlist, off_t,   Ngrid);
+  ALLOCATE (NLIST, off_t,   Ngrid);
+  ALLOCATE (clist, int *,   Ngrid);
+  ALLOCATE (mlist, off_t *, Ngrid);
 
   for (i = 0; i < Ngrid; i++) {
     Nlist[i] = 0;
     NLIST[i] = 100;
-    ALLOCATE (clist[i], int, NLIST[i]);
-    ALLOCATE (mlist[i], int, NLIST[i]);
+    ALLOCATE (clist[i], int,   NLIST[i]);
+    ALLOCATE (mlist[i], off_t, NLIST[i]);
   }
 }
@@ -206,5 +206,5 @@
 }
 
-int setGridMeasure (int meas, int cat, double X, double Y, int ccdnum) {
+int setGridMeasure (off_t meas, int cat, double X, double Y, int ccdnum) {
 
   int ix, iy, Cx, Cy, i;
@@ -241,6 +241,6 @@
   if (Nlist[i] == NLIST[i]) {
     NLIST[i] += 100;
-    REALLOCATE (clist[i], int, NLIST[i]);
-    REALLOCATE (mlist[i], int, NLIST[i]);
+    REALLOCATE (clist[i], int,   NLIST[i]);
+    REALLOCATE (mlist[i], off_t, NLIST[i]);
   }	
   return (TRUE);
@@ -264,5 +264,5 @@
 }
 
-float getMgrid (int meas, int cat) {
+float getMgrid (off_t meas, int cat) {
 
   int i;
@@ -673,6 +673,7 @@
 void dump_grid () { 
 
-  int i, j, Nimage, Nbytes, Nformat;
-  int *imlist;
+  off_t i, Nimage;
+  int j, Nbytes, Nformat;
+  off_t *imlist;
   FILE *f;
   Header header, theader;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/ImageOps.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/ImageOps.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/ImageOps.c	(revision 27312)
@@ -165,7 +165,8 @@
 /* XXX convert this to use the values of measure->Xccd,Yccd */
 /* XXX need to apply the conversion for ELIXIR and LONEOS formats */
-void matchImage (Catalog *catalog, off_t meas, off_t cat) {
-
-  off_t i, ccdnum;
+void matchImage (Catalog *catalog, off_t meas, int cat) {
+
+  off_t i;
+  int ccdnum;
   double X, Y;
   char *pname, *filter, *p, base[256];
@@ -229,5 +230,5 @@
 }
 
-off_t getImageEntry (off_t meas, off_t cat) {
+off_t getImageEntry (off_t meas, int cat) {
 
   off_t i;
@@ -237,5 +238,5 @@
 }
 
-float getMcal (off_t meas, off_t cat) {
+float getMcal (off_t meas, int cat) {
 
   off_t i;
@@ -250,5 +251,5 @@
 }
 
-Coords *getCoords (off_t meas, off_t cat) {
+Coords *getCoords (off_t meas, int cat) {
 
   off_t i;
@@ -262,5 +263,6 @@
 void setMcal (Catalog *catalog, int PoorImages) {
 
-  off_t i, j, m, c, n, N, Nmax, mark, bad, Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys;
+  off_t i, j, m, c, n, N, Nmax, mark, bad;
+  int Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys;
   float Msys, Mrel, Mmos, Mgrid;
   double *list, *dlist;
@@ -360,5 +362,6 @@
 void clean_images () {
 
-  off_t i, N, mark, Nmark;
+  int mark, Nmark;
+  off_t i, N;
   double *mlist, *slist, *dlist;
   double MaxOffset, MaxScatter, MedOffset;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/MosaicOps.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/MosaicOps.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/MosaicOps.c	(revision 27312)
@@ -8,5 +8,5 @@
 static off_t   **bin;    /* catalog, measure -> mosaic */
 
-static off_t   **clist;  /* mosaic -> catalog[] */
+static int     **clist;  /* mosaic -> catalog[] */
 static off_t   **mlist;  /* mosiac -> measure[] */
 static off_t    *Nlist;
@@ -26,7 +26,7 @@
   ALLOCATE (mosaic, Mosaic, NMOSAIC);
 
-  ALLOCATE (imlist, off_t *, NMOSAIC);
-  ALLOCATE (Nimlist, off_t, NMOSAIC);
-  ALLOCATE (NIMLIST, off_t, NMOSAIC);
+  ALLOCATE (imlist,  off_t *, NMOSAIC);
+  ALLOCATE (Nimlist, off_t,   NMOSAIC);
+  ALLOCATE (NIMLIST, off_t,   NMOSAIC);
 
   /* generate list of unique mosaics */
@@ -78,8 +78,8 @@
     if (Nmosaic == NMOSAIC) {
       NMOSAIC += 10;
-      REALLOCATE (mosaic, Mosaic, NMOSAIC);
-      REALLOCATE (imlist, off_t *, NMOSAIC);
-      REALLOCATE (Nimlist, off_t, NMOSAIC);
-      REALLOCATE (NIMLIST, off_t, NMOSAIC);
+      REALLOCATE (mosaic,  Mosaic,  NMOSAIC);
+      REALLOCATE (imlist,  off_t *, NMOSAIC);
+      REALLOCATE (Nimlist, off_t,   NMOSAIC);
+      REALLOCATE (NIMLIST, off_t,   NMOSAIC);
     }
   }
@@ -201,7 +201,7 @@
 
   /* mosaic -> measure */
-  ALLOCATE (Nlist, off_t, Nmosaic);
-  ALLOCATE (NLIST, off_t, Nmosaic);
-  ALLOCATE (clist, off_t *, Nmosaic);
+  ALLOCATE (Nlist, off_t,   Nmosaic);
+  ALLOCATE (NLIST, off_t,   Nmosaic);
+  ALLOCATE (clist, int *,   Nmosaic);
   ALLOCATE (mlist, off_t *, Nmosaic);
 
@@ -209,5 +209,5 @@
     Nlist[i] = 0;
     NLIST[i] = 100;
-    ALLOCATE (clist[i], off_t, NLIST[i]);
+    ALLOCATE (clist[i], int,   NLIST[i]);
     ALLOCATE (mlist[i], off_t, NLIST[i]);
   }
@@ -239,6 +239,6 @@
 int findMosaics (Catalog *catalog, int Ncatalog) {
   
+  int i, ecode;
   off_t j;
-  int i, ecode;
 
   if (!MOSAIC_ZEROPT) return (FALSE);
@@ -260,5 +260,5 @@
 void matchMosaics (Catalog *catalog, off_t meas, int cat) {
 
-  int off_t;
+  int i;
 
   for (i = 0; i < Nmosaic; i++) {
@@ -286,6 +286,6 @@
     if (Nlist[i] == NLIST[i]) {
       NLIST[i] += 100;
-      REALLOCATE (clist[i], int, NLIST[i]);
-      REALLOCATE (mlist[i], int, NLIST[i]);
+      REALLOCATE (clist[i], int,   NLIST[i]);
+      REALLOCATE (mlist[i], off_t, NLIST[i]);
     }	
     return;
@@ -295,5 +295,5 @@
 }
 
-float getMmos (off_t meas, off_t cat) {
+float getMmos (off_t meas, int cat) {
 
   off_t i;
@@ -392,5 +392,5 @@
       mark = (N < IMAGE_TOOFEW) || (N < IMAGE_GOOD_FRACTION*Nlist[i]);
       if (mark) {
-	fprintf (stderr, "marked image %s (%d), (%d < %d) || (%d < %f*%d)\n", image[imlist[i][0]].name, i, N, IMAGE_TOOFEW, N, IMAGE_GOOD_FRACTION, Nlist[i]);
+	fprintf (stderr, "marked image %s (%lld), (%lld < %d) || (%lld < %f*%lld)\n", image[imlist[i][0]].name, (long long) i, (long long) N, IMAGE_TOOFEW, (long long) N, IMAGE_GOOD_FRACTION, (long long) Nlist[i]);
 	mosaic[i].flags |= ID_IMAGE_FEW;
 	Nfew ++;
@@ -400,5 +400,5 @@
     }
     liststats (list, dlist, N, &stats);
-    if (PoorImages) fprintf (stderr, "Mmos: %f %f %d %d\n", stats.mean, stats.sigma, stats.Nmeas, N);
+    if (PoorImages) fprintf (stderr, "Mmos: %f %f %d %lld\n", stats.mean, stats.sigma, stats.Nmeas, (long long) N);
     mosaic[i].Mcal  = stats.mean;
     mosaic[i].dMcal = stats.sigma;
@@ -511,5 +511,5 @@
     n++;
   }
-  fprintf (stderr, "Nmosaic: %d, n: %d\n", Nmosaic, n);
+  fprintf (stderr, "Nmosaic: %lld, n: %lld\n", (long long) Nmosaic, (long long) n);
 
   liststats (list, dlist, n, &stats);
@@ -591,5 +591,5 @@
   }
 
-  fprintf (stderr, "%d mosaics marked poor\n", Nmark);
+  fprintf (stderr, "%lld mosaics marked poor\n", (long long) Nmark);
   initstats (STATMODE);
   free (mlist);
@@ -635,5 +635,5 @@
     }
   
-    sprintf (string, "Mosaic %d", i);
+    sprintf (string, "Mosaic %lld", (long long) i);
     plot_defaults (&graphdata);
     plot_list (&graphdata, xlist, ylist, N, string, NULL);
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/StarOps.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/StarOps.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/StarOps.c	(revision 27312)
@@ -20,5 +20,5 @@
 }  
 
-float getMrel (Catalog *catalog, int meas, int cat) {
+float getMrel (Catalog *catalog, off_t meas, int cat) {
 
   int ave;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/select_images.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/select_images.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/select_images.c	(revision 27312)
@@ -151,5 +151,5 @@
   }
       
-  if (VERBOSE) fprintf (stderr, "found %d images\n", nimage);
+  if (VERBOSE) fprintf (stderr, "found %lld images\n", (long long) nimage);
 
   REALLOCATE (image, Image, MAX (nimage, 1));
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/setExclusions.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/setExclusions.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/setExclusions.c	(revision 27312)
@@ -50,7 +50,7 @@
     }
   }
-  if (VERBOSE) fprintf (stderr, "%d measurements marked by area\n", Narea);
-  if (VERBOSE) fprintf (stderr, "%d measurements marked nocal\n", Nnocal);
-  if (VERBOSE) fprintf (stderr, "%d measurements kept for analysis\n", Ngood);
+  if (VERBOSE) fprintf (stderr, "%lld measurements marked by area\n",    (long long) Narea);
+  if (VERBOSE) fprintf (stderr, "%lld measurements marked nocal\n",      (long long) Nnocal);
+  if (VERBOSE) fprintf (stderr, "%lld measurements kept for analysis\n", (long long) Ngood);
   return (TRUE);
 }
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/setMrelFinal.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/setMrelFinal.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/setMrelFinal.c	(revision 27312)
@@ -68,5 +68,5 @@
 
   off_t i, k, m;
-  int ecode, d1, d2;
+  int ecode;
   off_t Ntot, Ntry, Nkeep, Nskip;
   float mag;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/tools/src/ftable.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/tools/src/ftable.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/tools/src/ftable.c	(revision 27312)
@@ -213,5 +213,5 @@
 	fprintf (stderr, "missing %s\n", axisname);
       }
-      fprintf (stdout, " %7d", Nelem);
+      fprintf (stdout, " %7lld", (long long) Nelem);
     }
     fprintf (stdout, "\n");
@@ -358,5 +358,5 @@
 	  if (!strcmp (type, "int64_t")) {
 	    memcpy (line, &data[i*Nv*Nb + Nb*j], Nb);
-	    fprintf (stdout, "%d ", *(int64_t*)line);
+	    fprintf (stdout, "%lld ", (long long) *(int64_t*)line);
 	  }
 	  if (!strcmp (type, "float")) {
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/tools/src/mktemp.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/tools/src/mktemp.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/tools/src/mktemp.c	(revision 27312)
@@ -5,4 +5,6 @@
 # define FALSE 0
 # define TRUE 1
+
+void usage(void);
 
 int main (int argc, char **argv) {
@@ -95,5 +97,5 @@
 
   if (make_directory) {
-    if (mkdtemp (template) == -1) {
+    if (mkdtemp (template) == NULL) {
       if (!fail_silently) fprintf (stderr, "failed to make temp file from %s\n", template);
       exit (1);
@@ -111,5 +113,5 @@
 }
  
-usage() {
+void usage(void) {
   fprintf (stderr, "Usage: mktemp [-V] | [-dqtu] [-p prefix] [template]\n");
   exit (1);
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/include/uniphot.h
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/include/uniphot.h	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/include/uniphot.h	(revision 27312)
@@ -93,14 +93,14 @@
 void          wcatalog           PROTO((Catalog *catalog));
 void          wimages            PROTO((Image *image, int Nimage));
-void check_permissions (char *basefile);
-void lock_image_db (FITS_DB *db, char *filename);
-void unlock_image_db (FITS_DB *db);
-void create_image_db (FITS_DB *db);
-void set_db (FITS_DB *in);
-int Shutdown (char *format, ...);
-void TrapSignal (int sig);
-void SetProtect (int mode);
-int SetSignals (void);
-int subset_images (FITS_DB *db);
-void update (FITS_DB *db, Group *sgroup, int Nsgroup);
-void sort_time (unsigned int *value, int N);
+void 	      check_permissions  PROTO((char *basefile));
+void 	      lock_image_db 	 PROTO((FITS_DB *db, char *filename));
+void	      unlock_image_db 	 PROTO((FITS_DB *db));
+void	      create_image_db 	 PROTO((FITS_DB *db));
+void	      set_db 		 PROTO((FITS_DB *in));
+int 	      Shutdown 		 PROTO((char *format, ...));
+void 	      TrapSignal 	 PROTO((int sig));
+void 	      SetProtect 	 PROTO((int mode));
+int 	      SetSignals 	 PROTO((void));
+int 	      subset_images 	 PROTO((FITS_DB *db));
+void 	      update 		 PROTO((FITS_DB *db, Group *sgroup, int Nsgroup));
+void 	      sort_time 	 PROTO((unsigned int *value, int N));
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/find_image_sgroups.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/find_image_sgroups.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/find_image_sgroups.c	(revision 27312)
@@ -3,5 +3,6 @@
 Group *find_image_sgroups (FITS_DB *db, ImageLink **Imlink, int *Nsgroup) {
 
-  int i, j, Nimage, Ngroup, Nentry, NENTRY;
+  off_t i, Nimage;
+  int j, Ngroup, Nentry, NENTRY;
   double r, d, x, y, radius;
   Group *group;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/find_image_tgroups.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/find_image_tgroups.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/find_image_tgroups.c	(revision 27312)
@@ -4,5 +4,6 @@
 
   char *start, *stop;
-  int i, j, Nimage, Ngroup, NGROUP, Nentry, NENTRY;
+  int j, Ngroup, NGROUP, Nentry, NENTRY;
+  off_t i, Nimage;
   unsigned int *time, *tmin, *tmax;
   Group *group;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/subset_images.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/subset_images.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/subset_images.c	(revision 27312)
@@ -3,6 +3,6 @@
 int subset_images (FITS_DB *db) {
 
-  int    i, Nimage, equiv;
-  int    Nkeep, *keep;
+  off_t i, Nimage, Nkeep, *keep;
+  int equiv;
   Image *image;
 
@@ -11,5 +11,5 @@
 
   Nkeep = 0;
-  ALLOCATE (keep, int, Nimage);
+  ALLOCATE (keep, off_t, Nimage);
 
   /* mark images to be calibrated */
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/update.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/update.c	(revision 27311)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/uniphot/src/update.c	(revision 27312)
@@ -4,5 +4,6 @@
 void update (FITS_DB *db, Group *sgroup, int Nsgroup) {
 
-  int i, j, status, Nmin, Nimage;
+  off_t i, Nimage;
+  int j, status, Nmin;
   char line[256];
   glob_t pglob;
