Index: /branches/eam_branches/largefiles.20100314/Ohana/src/opihi/lib.data/fft.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/opihi/lib.data/fft.c	(revision 27305)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/opihi/lib.data/fft.c	(revision 27306)
@@ -72,5 +72,5 @@
 // This requires 2(Nx*Ny*...) mem copies, but the fft operations are likely to happen in
 // cache.
-int fftND (float *x, float *y, int Ndim, int *Nsize, int forward) {
+int fftND (float *x, float *y, int Ndim, off_t *Nsize, int forward) {
 
   int i, nIndex, minor, major, iDim;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateSimple.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateSimple.c	(revision 27305)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relastro/src/UpdateSimple.c	(revision 27306)
@@ -4,5 +4,5 @@
 
   /* we can measure new image parameters for each non-mosaic chip independently */
-  int i, Nimage, Nstars;
+  off_t i, Nimage, Nstars;
   Image *image;
   StarData *raw, *ref;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/include/relphot.h
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/include/relphot.h	(revision 27305)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/include/relphot.h	(revision 27306)
@@ -122,5 +122,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));
@@ -147,20 +147,20 @@
 void          free_catalogs       PROTO((Catalog *catalog, int Ncatalog));
 int           gcatalog            PROTO((Catalog *catalog, int FINAL));
-Coords       *getCoords           PROTO((int meas, int cat));
-int           getImageEntry       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));
-Image        *getimage            PROTO((int N));
-Image        *getimages           PROTO((int *N));
+Coords       *getCoords           PROTO((off_t meas, int cat));
+off_t         getImageEntry       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));
+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));
@@ -169,10 +169,10 @@
 Catalog       *load_catalogs      PROTO((SkyList *skylist, int *Ncatalog));
 SkyList      *load_images         PROTO((FITS_DB *db, char *regionName, SkyRegion *region, int RegionSelect));
-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));
 
 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));
+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));
 double        opening_angle       PROTO((double x1, double y1, double x2, double y2, double x3, double y3));
 void          plot_chisq          PROTO((Catalog *catalog, int Ncatalog));
@@ -199,5 +199,5 @@
 int           setMave             PROTO((Catalog *catalog, int Ncatalog));
 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));
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/ImageOps.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/ImageOps.c	(revision 27305)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/ImageOps.c	(revision 27306)
@@ -3,17 +3,17 @@
 static unsigned int *start;
 static unsigned int *stop;
-static int         **bin;
-
-static int         **clist;
-static int         **mlist;
-static int          *Nlist;
-static int          *NLIST;
+static off_t       **bin;
+
+static off_t       **clist;
+static off_t       **mlist;
+static off_t        *Nlist;
+static off_t        *NLIST;
 
 static Image        *image;
-static int          Nimage;
-
-void initImages (Image *input, int N) {
-
-  int i;
+static off_t        Nimage;
+
+void initImages (Image *input, off_t N) {
+
+  off_t i;
 
   image = input;
@@ -31,22 +31,22 @@
 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, off_t *, Nimage);
+  ALLOCATE (mlist, off_t *, Nimage);
 
   for (i = 0; i < Nimage; i++) {
     Nlist[i] = 0;
     NLIST[i] = 100;
-    ALLOCATE (clist[i], int, NLIST[i]);
-    ALLOCATE (mlist[i], int, NLIST[i]);
+    ALLOCATE (clist[i], off_t, NLIST[i]);
+    ALLOCATE (mlist[i], off_t, NLIST[i]);
   }
 }
@@ -54,5 +54,5 @@
 void freeImageBins (int Ncatalog) {
 
-  int i;
+  off_t i;
 
   for (i = 0; i < Ncatalog; i++) {
@@ -70,5 +70,5 @@
 /* **** use this to mimic the Mosaic version ***/
 # if (0)
-void initImageGrid (Image *image, int Nimage) {
+void initImageGrid (Image *image, off_t Nimage) {
 
   /* find max dR, dD range for all mosaics */
@@ -76,5 +76,5 @@
   /* send results to initGridBins */
 
-  int i, j, m, NX, NY;
+  off_t i, j, m, NX, NY;
   int dXmax, dYmax;
   double dS, dX, dY;
@@ -151,5 +151,6 @@
 void findImages (Catalog *catalog, int Ncatalog) {
 
-  int i, j, ecode;
+  off_t j;
+  int i, ecode;
 
   for (i = 0; i < Ncatalog; i++) {
@@ -164,7 +165,7 @@
 /* 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, int meas, int cat) {
-
-  int i, ccdnum;
+void matchImage (Catalog *catalog, off_t meas, off_t cat) {
+
+  off_t i, ccdnum;
   double X, Y;
   char *pname, *filter, *p, base[256];
@@ -220,6 +221,6 @@
     if (Nlist[i] == NLIST[i]) {
       NLIST[i] += 100;
-      REALLOCATE (clist[i], int, NLIST[i]);
-      REALLOCATE (mlist[i], int, NLIST[i]);
+      REALLOCATE (clist[i], off_t, NLIST[i]);
+      REALLOCATE (mlist[i], off_t, NLIST[i]);
     }	
     return;
@@ -228,7 +229,7 @@
 }
 
-int getImageEntry (int meas, int cat) {
-
-  int i;
+off_t getImageEntry (off_t meas, off_t cat) {
+
+  off_t i;
 
   i = bin[cat][meas];
@@ -236,7 +237,7 @@
 }
 
-float getMcal (int meas, int cat) {
-
-  int i;
+float getMcal (off_t meas, off_t cat) {
+
+  off_t i;
   float value;
 
@@ -249,7 +250,7 @@
 }
 
-Coords *getCoords (int meas, int cat) {
-
-  int i;
+Coords *getCoords (off_t meas, off_t cat) {
+
+  off_t i;
 
   i = bin[cat][meas];
@@ -261,5 +262,5 @@
 void setMcal (Catalog *catalog, int PoorImages) {
 
-  int 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, Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys;
   float Msys, Mrel, Mmos, Mgrid;
   double *list, *dlist;
@@ -359,5 +360,5 @@
 void clean_images () {
 
-  int i, N, mark, Nmark;
+  off_t i, N, mark, Nmark;
   double *mlist, *slist, *dlist;
   double MaxOffset, MaxScatter, MedOffset;
@@ -409,5 +410,5 @@
 void plot_images () {
 
-  int i, bin;
+  off_t i, bin;
   double *xlist, *Mlist, *dlist;
   Graphdata graphdata;
@@ -457,5 +458,5 @@
 StatType statsImageN (Catalog *catalog) {
 
-  int i, j, m, c, n, N;
+  off_t i, j, m, c, n, N;
   double *list, *dlist;
   float Mcal, Mmos, Mgrid;
@@ -499,5 +500,5 @@
 StatType statsImageX (Catalog *catalog) {
 
-  int i, n;
+  off_t i, n;
   double *list, *dlist;
   StatType stats;
@@ -527,5 +528,5 @@
 StatType statsImageM (Catalog *catalog) {
 
-  int i, n;
+  off_t i, n;
   double *list, *dlist;
   StatType stats;
@@ -555,5 +556,5 @@
 StatType statsImagedM (Catalog *catalog) {
 
-  int i, n;
+  off_t i, n;
   double *list, *dlist;
   StatType stats;
@@ -581,5 +582,5 @@
 }
 
-Image *getimages (int *N) {
+Image *getimages (off_t *N) {
 
   *N = Nimage;
@@ -587,5 +588,5 @@
 }
 
-Image *getimage (int N) {
+Image *getimage (off_t N) {
   return (&image[N]);
 }
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/MosaicOps.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/MosaicOps.c	(revision 27305)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/MosaicOps.c	(revision 27306)
@@ -1,22 +1,20 @@
 # include "relphot.h"
 
-Image *getimages (int *N);
-
-static int    Nmosaic;
+static off_t  Nmosaic;
 static Mosaic *mosaic;
 
-static int    *Nimlist;
-static int   **imlist; /* mosaic -> image[] */
-static int   **bin;    /* catalog, measure -> mosaic */
-
-static int   **clist;  /* mosaic -> catalog[] */
-static int   **mlist;  /* mosiac -> measure[] */
-static int    *Nlist;
-static int    *NLIST;
+static off_t  *Nimlist;
+static off_t   **imlist; /* mosaic -> image[] */
+static off_t   **bin;    /* catalog, measure -> mosaic */
+
+static off_t   **clist;  /* mosaic -> catalog[] */
+static off_t   **mlist;  /* mosiac -> measure[] */
+static off_t    *Nlist;
+static off_t    *NLIST;
 
 /* find mosaic frames (unique time periods & photcode name matches mosaic) */
-void initMosaics (Image *image, int Nimage) {
-
-  int i, j, status, found, NMOSAIC, *NIMLIST;
+void initMosaics (Image *image, off_t Nimage) {
+
+  off_t i, j, status, found, NMOSAIC, *NIMLIST;
   unsigned int start, stop;
   char *pname;
@@ -28,7 +26,7 @@
   ALLOCATE (mosaic, Mosaic, NMOSAIC);
 
-  ALLOCATE (imlist, int *, NMOSAIC);
-  ALLOCATE (Nimlist, int, NMOSAIC);
-  ALLOCATE (NIMLIST, int, NMOSAIC);
+  ALLOCATE (imlist, off_t *, NMOSAIC);
+  ALLOCATE (Nimlist, off_t, NMOSAIC);
+  ALLOCATE (NIMLIST, off_t, NMOSAIC);
 
   /* generate list of unique mosaics */
@@ -56,5 +54,5 @@
       if (Nimlist[j] == NIMLIST[j]) {
 	NIMLIST[j] += 10;
-	REALLOCATE (imlist[j], int, NIMLIST[j]);
+	REALLOCATE (imlist[j], off_t, NIMLIST[j]);
       }
 
@@ -74,5 +72,5 @@
     NIMLIST[Nmosaic] = 10;
     Nimlist[Nmosaic] = 1;
-    ALLOCATE (imlist[Nmosaic], int, NIMLIST[Nmosaic]);
+    ALLOCATE (imlist[Nmosaic], off_t, NIMLIST[Nmosaic]);
     imlist[Nmosaic][0] = i;
 
@@ -81,7 +79,7 @@
       NMOSAIC += 10;
       REALLOCATE (mosaic, Mosaic, NMOSAIC);
-      REALLOCATE (imlist, int *, NMOSAIC);
-      REALLOCATE (Nimlist, int, NMOSAIC);
-      REALLOCATE (NIMLIST, int, NMOSAIC);
+      REALLOCATE (imlist, off_t *, NMOSAIC);
+      REALLOCATE (Nimlist, off_t, NMOSAIC);
+      REALLOCATE (NIMLIST, off_t, NMOSAIC);
     }
   }
@@ -91,5 +89,5 @@
 }
 
-void initMosaicGrid (Image *image, int Nimage) {
+void initMosaicGrid (Image *image, off_t Nimage) {
 
   /* find max dR, dD range for all mosaics */
@@ -97,5 +95,5 @@
   /* send results to initGridBins */
 
-  int i, j, m, NX, NY;
+  off_t i, j, m, NX, NY;
   int dXmax, dYmax;
   double dS, dX, dY;
@@ -170,5 +168,5 @@
 void setMcalFinal () {
 
-  int i, j, im, Nimage;
+  off_t i, j, im, Nimage;
   Image *image;
 
@@ -191,26 +189,26 @@
 void initMosaicBins (Catalog *catalog, int Ncatalog) {
 
-  int i, j;
+  off_t i, j;
 
   /* measure -> mosaic */
   if (!MOSAIC_ZEROPT) return;
 
-  ALLOCATE (bin, int *, Ncatalog);
+  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;
   }
 
   /* mosaic -> measure */
-  ALLOCATE (Nlist, int, Nmosaic);
-  ALLOCATE (NLIST, int, Nmosaic);
-  ALLOCATE (clist, int *, Nmosaic);
-  ALLOCATE (mlist, int *, Nmosaic);
+  ALLOCATE (Nlist, off_t, Nmosaic);
+  ALLOCATE (NLIST, off_t, Nmosaic);
+  ALLOCATE (clist, off_t *, Nmosaic);
+  ALLOCATE (mlist, off_t *, Nmosaic);
 
   for (i = 0; i < Nmosaic; i++) {
     Nlist[i] = 0;
     NLIST[i] = 100;
-    ALLOCATE (clist[i], int, NLIST[i]);
-    ALLOCATE (mlist[i], int, NLIST[i]);
+    ALLOCATE (clist[i], off_t, NLIST[i]);
+    ALLOCATE (mlist[i], off_t, NLIST[i]);
   }
 }
@@ -218,5 +216,5 @@
 void freeMosaicBins (int Ncatalog) {
 
-  int i;
+  off_t i;
 
   /* measure -> mosaic */
@@ -241,5 +239,6 @@
 int findMosaics (Catalog *catalog, int Ncatalog) {
   
-  int i, j, ecode;
+  off_t j;
+  int i, ecode;
 
   if (!MOSAIC_ZEROPT) return (FALSE);
@@ -259,7 +258,7 @@
 }
 
-void matchMosaics (Catalog *catalog, int meas, int cat) {
-
-  int i;
+void matchMosaics (Catalog *catalog, off_t meas, int cat) {
+
+  int off_t;
 
   for (i = 0; i < Nmosaic; i++) {
@@ -296,7 +295,7 @@
 }
 
-float getMmos (int meas, int cat) {
-
-  int i;
+float getMmos (off_t meas, off_t cat) {
+
+  off_t i;
   float value;
 
@@ -313,5 +312,6 @@
 int setMmos (Catalog *catalog, int PoorImages) {
 
-  int i, j, m, c, n, N, Nmax, mark, bad, Nfew, Nbad, Ncal, Nrel, Ngrid, Nsys;
+  off_t i, j, m, c, N, Nmax;
+  int n, mark, bad, Nfew, Nbad, Ncal, Nrel, Ngrid, Nsys;
   float Msys, Mrel, Mcal, Mgrid;
   double *list, *dlist, *Mlist, *dMlist;
@@ -422,5 +422,6 @@
 StatType statsMosaicM (Catalog *catalog) {
 
-  int i, n;
+  off_t i;
+  int n;
   double *list, *dlist;
   StatType stats;
@@ -448,5 +449,5 @@
 StatType statsMosaicdM (Catalog *catalog) {
 
-  int i, n;
+  off_t i, n;
   double *list, *dlist;
   StatType stats;
@@ -476,5 +477,5 @@
 StatType statsMosaicN (Catalog *catalog) {
 
-  int i, j, m, c, n, N;
+  off_t i, j, m, c, n, N;
   double *list, *dlist;
   float Mcal, Mgrid, Mrel;
@@ -520,5 +521,5 @@
 StatType statsMosaicX (Catalog *catalog) {
 
-  int i, n;
+  off_t i, n;
   double *list, *dlist;
   StatType stats;
@@ -549,5 +550,5 @@
 void clean_mosaics () {
 
-  int i, N, mark, Nmark;
+  off_t i, N, mark, Nmark;
   double *mlist, *slist, *dlist;
   double MaxOffset, MedOffset, MaxScatter;
@@ -599,5 +600,5 @@
 void plot_mosaic_fields (Catalog *catalog) {
 
-  int i, j, m, c, N, ave, Nimage;
+  off_t i, j, m, c, N, ave, Nimage;
   double *xlist, *ylist;
   double Xmin, Xmax, Ymin, Ymax;
@@ -645,5 +646,5 @@
 void plot_mosaics () {
 
-  int i, bin;
+  off_t i, bin;
   double *xlist, *Mlist, *dlist;
   Graphdata graphdata;
@@ -694,7 +695,7 @@
 }
 
-int *SelectRefMosaic (Mosaic **refmosaic, int *Nimage) {
-
-  int i, Imax, Nmax;
+off_t *SelectRefMosaic (Mosaic **refmosaic, off_t *Nimage) {
+
+  off_t i, Imax, Nmax;
 
   Imax = 0;
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/bcatalog.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/bcatalog.c	(revision 27305)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/bcatalog.c	(revision 27306)
@@ -114,5 +114,5 @@
 
   if (VERBOSE) {
-    fprintf (stderr, "%d: using %lld stars (%lld measures) for catalog\n", i, 
+    fprintf (stderr, "%lld: using %lld stars (%lld measures) for catalog\n", (long long) i, 
 	     (long long) subcatalog[0].Naverage, (long long) subcatalog[0].Nmeasure);
   }
Index: /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/load_images.c
===================================================================
--- /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/load_images.c	(revision 27305)
+++ /branches/eam_branches/largefiles.20100314/Ohana/src/relphot/src/load_images.c	(revision 27306)
@@ -4,6 +4,6 @@
 
   Image     *image, *subset;
-  int        Nimage, Nsubset, Nchar;
-  int       *LineNumber;
+  off_t      Nimage, Nsubset, Nchar;
+  off_t     *LineNumber;
 
   SkyTable *sky = NULL;
