Index: /trunk/SophyaExt/FitsIOServer/fbtntintf.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fbtntintf.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fbtntintf.cc	(revision 3167)
@@ -167,5 +167,5 @@
      printerror(sta);
    ColName.push_back(colname);
-   if(fits_get_coltype(FitsPtr,icol+1,&typecode,NULL,NULL,&sta))
+   if(fits_get_coltypell(FitsPtr,icol+1,&typecode,NULL,NULL,&sta))
      printerror(sta);
    if(typecode!=TSTRING && typecode!=TCOMPLEX &&  typecode!=TDBLCOMPLEX)
Index: /trunk/SophyaExt/FitsIOServer/fitsarrhand.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsarrhand.h	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitsarrhand.h	(revision 3167)
@@ -50,5 +50,5 @@
     if (is.CurrentHDUType() != IMAGE_HDU)  return 0;
     T x = 0;
-    long naxes[BASEARRAY_MAXNDIMS];
+    LONGLONG naxes[BASEARRAY_MAXNDIMS];
     int naxis=BASEARRAY_MAXNDIMS;
     int imgtyp = is.GetImageHDUInfo(naxis, naxes);
@@ -68,5 +68,5 @@
       if ( dobj == NULL) 
 	throw NullPtrError("FitsArrayHandler<T>::Write() dobj=NULL ");
-      long naxes[BASEARRAY_MAXNDIMS] = {0,0,0,0,0};
+      LONGLONG naxes[BASEARRAY_MAXNDIMS] = {0,0,0,0,0};
       for(int_4 id=0; id<dobj->NbDimensions(); id++) 
 	naxes[id] = dobj->Size(id);
@@ -83,5 +83,5 @@
   virtual void     Read(FitsInOutFile& is)
     {
-      long naxes[BASEARRAY_MAXNDIMS];
+      LONGLONG naxes[BASEARRAY_MAXNDIMS];
       int naxis=BASEARRAY_MAXNDIMS;
       is.GetImageHDUInfo(naxis, naxes);
Index: /trunk/SophyaExt/FitsIOServer/fitsblkrw.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsblkrw.h	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitsblkrw.h	(revision 3167)
@@ -17,11 +17,11 @@
 //! Write image HDU data to a fits file 
 static void WriteImageData(FitsInOutFile& fios, const T * d, size_t sz, 
-			   long * fpixel=NULL)
+			   LONGLONG * fpixel=NULL)
 {
   int status = 0;
-  long fpix[5] = {1,1,1,1,1};
+  LONGLONG fpix[5] = {1,1,1,1,1};
   if (fpixel == NULL) fpixel = fpix;
   T * ncd = const_cast<T *>(d);
-  fits_write_pix(fios.FitsPtr(), FitsTypes::DataType(d[0]), fpixel,
+  fits_write_pixll(fios.FitsPtr(), FitsTypes::DataType(d[0]), fpixel,
 		 sz, ncd, &status);
   if ( status ) {
@@ -37,11 +37,11 @@
 //! Read image HDU data from a fits file 
 static void ReadImageData(FitsInOutFile& fios,  T * d, size_t sz, 
-			  long * fpixel=NULL)
+			  LONGLONG * fpixel=NULL)
 {
   int status = 0;
-  long fpix[5] = {1,1,1,1,1};
+  LONGLONG fpix[5] = {1,1,1,1,1};
   if (fpixel == NULL) fpixel = fpix;
   int anynul = 0;
-  fits_read_pix(fios.FitsPtr(), FitsTypes::DataType(d[0]), fpixel,
+  fits_read_pixll(fios.FitsPtr(), FitsTypes::DataType(d[0]), fpixel,
 		 sz, NULL, d, &anynul, &status);
   if ( status ) {
@@ -66,6 +66,6 @@
   \param sz : number of data elements to be written
 */
-static void WriteColumnData(FitsInOutFile& fios, int colnum, long firstrow,
-			    long firstelem, const T * d, size_t sz)
+static void WriteColumnData(FitsInOutFile& fios, int colnum, LONGLONG firstrow,
+			    LONGLONG firstelem, const T * d, size_t sz)
 {
   int status = 0;
@@ -93,6 +93,6 @@
   \param sz : number of data elements to be read
 */
-static void ReadColumnData(FitsInOutFile& fios, int colnum, long firstrow,
-			    long firstelem, T * d, size_t sz)
+static void ReadColumnData(FitsInOutFile& fios, int colnum, LONGLONG firstrow,
+			   LONGLONG firstelem, T * d, size_t sz)
 {
   int status = 0;
@@ -119,5 +119,5 @@
 //! Write image HDU with string data type not supported (throws exception) 
 static void WriteImageData(FitsInOutFile& fios, const std::string * d, size_t sz, 
-			   long * fpixel=NULL)
+			   LONGLONG * fpixel=NULL)
 {
   throw FitsIOException(
@@ -126,5 +126,5 @@
 //! Read image HDU with string data type not supported (throws exception) 
 static void ReadImageData(FitsInOutFile& fios,  std::string * d, size_t sz, 
-			  long * fpixel=NULL)
+			  LONGLONG * fpixel=NULL)
 {
   throw FitsIOException(
@@ -133,6 +133,6 @@
 
 //! Write character string data to binary/ascii HDU data in a fits file. 
-static void WriteColumnData(FitsInOutFile& fios, int colnum, long firstrow,
-			    long firstelem, const std::string * d, size_t sz)
+static void WriteColumnData(FitsInOutFile& fios, int colnum, LONGLONG firstrow,
+			    LONGLONG firstelem, const std::string * d, size_t sz)
 {
   int status = 0;
@@ -163,6 +163,6 @@
 
 //! Read character string data to binary/ascii HDU data in a fits file. 
-static void ReadColumnData(FitsInOutFile& fios, int colnum, long firstrow,
-			   long firstelem, std::string * d, size_t sz)
+static void ReadColumnData(FitsInOutFile& fios, int colnum, LONGLONG firstrow,
+			   LONGLONG firstelem, std::string * d, size_t sz)
 {
   int status = 0;
Index: /trunk/SophyaExt/FitsIOServer/fitsgenedata.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsgenedata.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitsgenedata.cc	(revision 3167)
@@ -139,10 +139,10 @@
 
   //--- Nb de lignes et de colonnes 
-  vector<string> colnames; vector<int> coltypes; vector<long> repcnt, width;
+  vector<string> colnames; vector<int> coltypes; vector<LONGLONG> repcnt, width;
   is.GetColInfo(colnames,coltypes,repcnt,width);
   long ncol = colnames.size();
   if(ncol<=0)
     throw FitsIOException("FitsHandler<GeneralFitData>::Read() bad number of table columns");
-  long nbrows = is.GetNbRows();
+  int_8 nbrows = is.GetNbRows();
   if(nbrows<=0)
     throw FitsIOException("FitsHandler<GeneralFitData>::Read() number of rows is zero, no reading");
Index: /trunk/SophyaExt/FitsIOServer/fitshdtable.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitshdtable.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitshdtable.cc	(revision 3167)
@@ -200,8 +200,8 @@
   vector<string> colnames;
   vector<int> coltypes;
-  vector<long> repcnt, width;
-  vector<long> colpos;
+  vector<LONGLONG> repcnt, width;
+  vector<sa_size_t> colpos;
   is.GetColInfo(colnames, coltypes, repcnt, width);
-  long nbrows = is.GetNbRows();
+  int_8 nbrows = is.GetNbRows();
 
   if (dobj == NULL) { // On cree la table si besoin 
Index: /trunk/SophyaExt/FitsIOServer/fitshisterr.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitshisterr.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitshisterr.cc	(revision 3167)
@@ -112,5 +112,5 @@
   vector<string> colnames;
   vector<int> coltypes;
-  vector<long> repcnt, width;
+  vector<LONGLONG> repcnt, width;
   is.GetColInfo(colnames,coltypes,repcnt,width);
   long ncol = colnames.size();
@@ -265,5 +265,5 @@
 
   //--- Nb de lignes et de colonnes 
-  vector<string> colnames; vector<int> coltypes; vector<long> repcnt, width;
+  vector<string> colnames; vector<int> coltypes; vector<LONGLONG> repcnt, width;
   is.GetColInfo(colnames,coltypes,repcnt,width);
   long ncol = colnames.size();
Index: /trunk/SophyaExt/FitsIOServer/fitshistos.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitshistos.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitshistos.cc	(revision 3167)
@@ -150,5 +150,5 @@
   vector<string> colnames;
   vector<int> coltypes;
-  vector<long> repcnt, width;
+  vector<LONGLONG> repcnt, width;
   is.GetColInfo(colnames,coltypes,repcnt,width);
   long ncol = colnames.size();
@@ -393,5 +393,5 @@
 
   //--- Nb de lignes et de colonnes 
-  vector<string> colnames; vector<int> coltypes; vector<long> repcnt, width;
+  vector<string> colnames; vector<int> coltypes; vector<LONGLONG> repcnt, width;
   is.GetColInfo(colnames,coltypes,repcnt,width);
   long ncol = colnames.size();
Index: /trunk/SophyaExt/FitsIOServer/fitsinoutfile.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsinoutfile.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitsinoutfile.cc	(revision 3167)
@@ -337,5 +337,5 @@
   if (CurrentHDU() != 1) return false;
   int naxis = 2;
-  long naxes[2];
+  LONGLONG naxes[2];
   GetImageHDUInfo(naxis, naxes);
   if ((naxis == 0) &&  (NbHDUs() > 1)) {
@@ -347,8 +347,8 @@
 
 /*-- Methode --*/
-void FitsInOutFile::CreateImageHDU(int bitpix, int naxis, long* naxes)
-{
-  int status = 0;
-  fits_create_img(fptr_, bitpix, naxis, naxes, &status);
+void FitsInOutFile::CreateImageHDU(int bitpix, int naxis, LONGLONG* naxes)
+{
+  int status = 0;
+  fits_create_imgll(fptr_, bitpix, naxis, naxes, &status);
   FitsCheckStatus(status,"FitsInOutFile::CreateImageHDU() Error: ");
   return;
@@ -361,10 +361,10 @@
    Rc : return the image type (bitpix) 
  */
-int FitsInOutFile::GetImageHDUInfo(int& naxis, long* naxes) const
+int FitsInOutFile::GetImageHDUInfo(int& naxis, LONGLONG* naxes) const
 {
   int status = 0;
   int maxdim = naxis;
   int bitpix = 0;
-  fits_get_img_param(fptr_, maxdim, &bitpix, &naxis, naxes, &status);
+  fits_get_img_paramll(fptr_, maxdim, &bitpix, &naxis, naxes, &status);
   FitsCheckStatus(status, "FitsInOutFile::GetImageHDUInfo() Error: ");
   return bitpix;
@@ -372,9 +372,9 @@
 
 /*-- Methode --*/
-long FitsInOutFile::GetNbRows()  const
-{
-  int status = 0;
-  long nbrow = 0;
-  fits_get_num_rows(FitsPtr() , &nbrow, &status);
+LONGLONG FitsInOutFile::GetNbRows()  const
+{
+  int status = 0;
+  LONGLONG nbrow = 0;
+  fits_get_num_rowsll(FitsPtr() , &nbrow, &status);
   FitsCheckStatus(status, "FitsInOutFile::GetNbRows() Error: " );
   return nbrow;
@@ -466,6 +466,6 @@
 long FitsInOutFile::GetColInfo(vector<string> & colnames, 
 				 vector<int> & coltypes,
-				 vector<long> & repcnt,
-				 vector<long> & width)
+				 vector<LONGLONG> & repcnt,
+				 vector<LONGLONG> & width)
 {
 
@@ -478,5 +478,5 @@
 
   int colnum, typecode;
-  long repeat, colw;
+  LONGLONG repeat, colw;   // $CHECK$ LONGLONG ???
   int ncols = 0;
   char colname[128];  // longueur max d'un nom de colonne
@@ -493,5 +493,5 @@
     }
     int sta2 = 0;
-    fits_get_coltype(FitsPtr(), colnum, &typecode, &repeat, &colw, &sta2);
+    fits_get_coltypell(FitsPtr(), colnum, &typecode, &repeat, &colw, &sta2); // $CHECK$ LONGLONG ???fits_get_coltypell
     FitsCheckStatus(sta2, "FitsInOutFile::GetColInfo() Error(2): ");
 
@@ -608,5 +608,5 @@
   CheckFitsPtr(FitsPtr()); 
   char keyname[FLEN_KEYWORD], comm[FLEN_COMMENT], sval[FLEN_VALUE];
-  long lval;
+  LONGLONG lval;
   double dval;
   string s;
@@ -621,5 +621,5 @@
   case MuTyV::MTVInteger :
     lval = mtv.GetIntPart();
-    fits_write_key(FitsPtr(), TLONG, keyname, &lval, comm, &status);
+    fits_write_key(FitsPtr(), TLONGLONG, keyname, &lval, comm, &status);
     break;
   case MuTyV::MTVFloat : 
Index: /trunk/SophyaExt/FitsIOServer/fitsinoutfile.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsinoutfile.h	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitsinoutfile.h	(revision 3167)
@@ -117,11 +117,11 @@
  //---- IMAGE_HDU manipulation methods
  //! Creates a new HDU of type image (see fits_create_img)
- void              CreateImageHDU(int bitpix, int naxis, long* naxes);
+ void              CreateImageHDU(int bitpix, int naxis, LONGLONG* naxes);
  //! Get information about the current image HDU. - return the image type TBYTE,TINT ...
- int               GetImageHDUInfo(int& naxis, long* naxes) const;
+ int               GetImageHDUInfo(int& naxis, LONGLONG* naxes) const;
 
  //---- BINARY_TBL or ASCII_TBL 
  //! Return number of rows in a table HDU
- long              GetNbRows() const;
+ LONGLONG          GetNbRows() const;
  //! Return number of columns in a table HDU
  int               GetNbCols() const;
@@ -139,6 +139,6 @@
  long              GetColInfo(vector<string> & colnames, 
 			      vector<int> & coltypes,
-			      vector<long> & repcnt,
-			      vector<long> & width);
+			      vector<LONGLONG> & repcnt,
+			      vector<LONGLONG> & width);
 
  //! Defines the extension name for the next table creation 
Index: /trunk/SophyaExt/FitsIOServer/fitslocalmap.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitslocalmap.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitslocalmap.cc	(revision 3167)
@@ -87,5 +87,5 @@
   if (clsnm != "LocalMap") return 0;
   
-  long naxes[2];
+  LONGLONG naxes[2];
   int naxis=2;
   int imgtyp = is.GetImageHDUInfo(naxis, naxes);
Index: /trunk/SophyaExt/FitsIOServer/fitsmanager.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsmanager.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitsmanager.cc	(revision 3167)
@@ -194,5 +194,5 @@
     int hdutyp = is.CurrentHDUType();
     if (hdutyp == IMAGE_HDU) {
-      long naxes[5] = {0,0,0,0,0};
+      LONGLONG naxes[5] = {0,0,0,0,0};
       int naxis=5;
       int imgtyp = is.GetImageHDUInfo(naxis, naxes);
@@ -207,6 +207,5 @@
       vector<string> colnames;
       vector<int> coltypes;
-      vector<long> repcnt;
-      vector<long> width;
+      vector<LONGLONG> repcnt, width;
       int ncols = is.GetColInfo(colnames, coltypes, repcnt, width);
       if (hdutyp == BINARY_TBL) os << ">> BINARY_TBL :  NRows= " << is.GetNbRows();
Index: /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitsspherehealpix.cc	(revision 3167)
@@ -98,6 +98,5 @@
   vector<string> colnames; 
   vector<int> coltypes;
-  vector<long> repcnt;
-  vector<long> width;
+  vector<LONGLONG> repcnt, width;
   long ncols = is.GetColInfo(colnames, coltypes, repcnt, width); 
   if (ncols < 1) return 0;
Index: /trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.cc	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.cc	(revision 3167)
@@ -90,6 +90,5 @@
   vector<string> colnames; 
   vector<int> coltypes;
-  vector<long> repcnt;
-  vector<long> width;
+  vector<LONGLONG> repcnt, width;
   long ncols = is.GetColInfo(colnames, coltypes, repcnt, width); 
   if (ncols < 1) return 0;
Index: /trunk/SophyaExt/FitsIOServer/fitsswapper.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fitsswapper.h	(revision 3166)
+++ /trunk/SophyaExt/FitsIOServer/fitsswapper.h	(revision 3167)
@@ -62,5 +62,5 @@
   {
     /* fios->MoveAbsToHDU(fhdu);  On suppose qu'on est sur le bon HDU - Reza 30/12/2005 */
-    long row = rowos;
+    LONGLONG row = rowos;
     if (osw)  row = oswp;
     if (dtp != NULL)
@@ -73,5 +73,5 @@
   virtual void  ReadFromSwap(int_8 idx, int_8 swp, T* d, size_t sz)
   {
-    long nrows = fios.GetNbRows();
+    int_8 nrows = fios.GetNbRows();
     size_t szi = sz;
     if ((swp+sz-1) > nrows) sz = nrows-swp+1;  
@@ -94,5 +94,5 @@
   FitsInOutFile fios;
   int fcol; 
-  long rowos;
+  LONGLONG rowos;
   BaseDataTable* dtp;
 };
