Index: trunk/Ohana/src/imregister/imreg/cadc.c
===================================================================
--- trunk/Ohana/src/imregister/imreg/cadc.c	(revision 16040)
+++ trunk/Ohana/src/imregister/imreg/cadc.c	(revision 27435)
@@ -4,7 +4,7 @@
 static int REFCCD;
 
-void DumpCADCTable (char *filename, RegImage *image, int *match, int Nmatch) {
-  
-  int i, Obsid, Nobsid, Nsubset, ref;
+void DumpCADCTable (char *filename, RegImage *image, off_t *match, off_t Nmatch) {
+  
+  off_t i, Obsid, Nobsid, Nsubset, ref;
   char *datestr, *line, hdrname[99];
   time_t tsecond;
@@ -13,7 +13,7 @@
   FTable table;
   RegImage *row;
-  int *index, *entry, *obsid;
+  off_t *index, *entry, *obsid;
   MosaicLayout *layout;
-  int *subset;
+  off_t *subset;
   double left, right, center, outer, top, bottom;
   double iqx, iqy, iqr, iqf, iqo;
@@ -127,13 +127,13 @@
 }
 
-int *GetObsIDSubset (RegImage *image, int start, int *index, int *entry, int Nindex, int *Nsubset) {
-
-  int i, N, NSUBSET;
-  int *subset;
+off_t *GetObsIDSubset (RegImage *image, off_t start, off_t *index, off_t *entry, off_t Nindex, off_t *Nsubset) {
+
+  off_t i, N, NSUBSET;
+  off_t *subset;
 
   /* create output index */
   N = 0;
   NSUBSET = 64;
-  ALLOCATE (subset, int, NSUBSET);
+  ALLOCATE (subset, off_t, NSUBSET);
 
   /* find unique sequences */
@@ -143,5 +143,5 @@
     if (N == NSUBSET) {
       NSUBSET += 64;
-      REALLOCATE (subset, int, NSUBSET);
+      REALLOCATE (subset, off_t, NSUBSET);
     }
   }
@@ -152,13 +152,13 @@
 
 /* return an index list of unique obs id entries at start of sequence */
-int *GetUniqueObsID (RegImage *image, int *index, int *entry, int Nindex, int *Nmatch) {
-  
-  int i, j, N, NMATCH;
-  int *match;
+off_t *GetUniqueObsID (RegImage *image, off_t *index, off_t *entry, off_t Nindex, off_t *Nmatch) {
+  
+  off_t i, j, N, NMATCH;
+  off_t *match;
 
   /* create output index */
   N = 0;
   NMATCH = 1000;
-  ALLOCATE (match, int, NMATCH);
+  ALLOCATE (match, off_t, NMATCH);
 
   /* find unique sequences */
@@ -171,5 +171,5 @@
     if (N == NMATCH) {
       NMATCH += 1000;
-      REALLOCATE (match, int, NMATCH);
+      REALLOCATE (match, off_t, NMATCH);
     }
 
@@ -182,13 +182,13 @@
 
 /* return seeing for ccd == REFCCD */
-int GetREFCCD (RegImage *image, int *index, int *entry, int Nindex, int start) {
-  
-  int i, N, NMATCH;
-  int *match;
+off_t GetREFCCD (RegImage *image, off_t *index, off_t *entry, off_t Nindex, off_t start) {
+  
+  off_t i, N, NMATCH;
+  off_t *match;
 
   /* create output index */
   N = 0;
   NMATCH = 1000;
-  ALLOCATE (match, int, NMATCH);
+  ALLOCATE (match, off_t, NMATCH);
 
   /* find unique sequences */
@@ -199,12 +199,12 @@
 }
 
-void GetObsIDIndex (RegImage *image, int *match, int Nmatch, int **Index, int **Entry) {
-
-  int i;
-  int *index, *entry;
+void GetObsIDIndex (RegImage *image, off_t *match, off_t Nmatch, off_t **Index, off_t **Entry) {
+
+  off_t i;
+  off_t *index, *entry;
 
   /* index = OBSID */
-  ALLOCATE (index, int, Nmatch);
-  ALLOCATE (entry, int, Nmatch);
+  ALLOCATE (index, off_t, Nmatch);
+  ALLOCATE (entry, off_t, Nmatch);
   for (i = 0; i < Nmatch; i++) {
     index[i] = atoi (image[match[i]].filename);
@@ -212,5 +212,5 @@
     entry[i] = match[i];
   }
-  isortpair (index, entry, Nmatch);
+  llsortpair (index, entry, Nmatch);
   *Index = index;
   *Entry = entry;
@@ -218,7 +218,8 @@
 
 /* match is a list of image entries with the same obsid */
-double MosaicIQStats (RegImage *image, int *match, int Nmatch, MosaicRegion *region) {
-
-  int i, j, N, Nccd;
+double MosaicIQStats (RegImage *image, off_t *match, off_t Nmatch, MosaicRegion *region) {
+
+  int i, N, Nccd;
+  off_t j;
   double *list, value;
 
