Index: trunk/Mars/mcore/zofits.h
===================================================================
--- trunk/Mars/mcore/zofits.h	(revision 17261)
+++ trunk/Mars/mcore/zofits.h	(revision 17262)
@@ -21,6 +21,4 @@
 namespace std
 {
-#else
-using namespace std;
 #endif
 
@@ -478,6 +476,6 @@
             for (auto it=fCatalog.begin(); it!= fCatalog.end(); it++)
             {
-                compressed_offset += sizeof(TileHeader);
-                heap_size         += sizeof(TileHeader);
+                compressed_offset += sizeof(FITS::TileHeader);
+                heap_size         += sizeof(FITS::TileHeader);
                 for (uint32_t j=0; j<it->size(); j++)
                 {
@@ -539,5 +537,5 @@
         bool AddColumn(uint32_t cnt, char typechar, const string& name, const string& unit, const string& comment="", bool addHeaderKeys=true)
         {
-            return AddColumn(kFactRaw, cnt, typechar, name, unit, comment, addHeaderKeys);
+            return AddColumn(FITS::kFactRaw, cnt, typechar, name, unit, comment, addHeaderKeys);
         }
 
@@ -612,5 +610,5 @@
         void reallocateBuffers()
         {
-            const size_t chunk_size = fRealRowWidth*fNumRowsPerTile + fRealColumns.size()*sizeof(BlockHeader) + sizeof(TileHeader) + 8; //+8 for checksuming;
+            const size_t chunk_size = fRealRowWidth*fNumRowsPerTile + fRealColumns.size()*sizeof(FITS::BlockHeader) + sizeof(FITS::TileHeader) + 8; //+8 for checksuming;
             fMemPool.setChunkSize(chunk_size);
 
@@ -741,6 +739,6 @@
         uint64_t compressBuffer(char* dest, char* src, uint32_t num_rows, CatalogRow& catalog_row)
         {
-            const uint32_t thisRoundNumRows  = (num_rows%fNumRowsPerTile) ? num_rows%fNumRowsPerTile : fNumRowsPerTile;
-            uint32_t       offset            = 0;
+            const uint32_t thisRoundNumRows = (num_rows%fNumRowsPerTile) ? num_rows%fNumRowsPerTile : fNumRowsPerTile;
+            uint32_t       offset           = 0;
 
             //skip the checksum reserved area
@@ -748,5 +746,5 @@
 
             //skip the 'TILE' marker and tile size entry
-            uint64_t compressedOffset = sizeof(TileHeader);
+            uint64_t compressedOffset = sizeof(FITS::TileHeader);
 
             //now compress each column one by one by calling compression on arrays
@@ -758,5 +756,5 @@
                     continue;
 
-                Compression& head = fRealColumns[i].block_head;
+                FITS::Compression& head = fRealColumns[i].block_head;
 
                 //set the default byte telling if uncompressed the compressed Flag
@@ -770,14 +768,14 @@
                     switch (head.getProc(j))
                     {
-                    case kFactRaw:
+                    case FITS::kFactRaw:
                         compressedOffset += compressUNCOMPRESSED(dest + compressedOffset, src  + offset, thisRoundNumRows*fRealColumns[i].col.size*fRealColumns[i].col.num);
                         break;
 
-                    case kFactSmoothing:
+                    case FITS::kFactSmoothing:
                         applySMOOTHING(src + offset, thisRoundNumRows*fRealColumns[i].col.num);
                         break;
 
-                    case kFactHuffman16:
-                        if (head.getOrdering() == kOrderByCol)
+                    case FITS::kFactHuffman16:
+                        if (head.getOrdering() == FITS::kOrderByCol)
                             compressedOffset += compressHUFFMAN16(dest + compressedOffset, src  + offset, thisRoundNumRows, fRealColumns[i].col.size, fRealColumns[i].col.num);
                         else
@@ -787,12 +785,13 @@
                 }
 
-               //check if compressed size is larger than uncompressed
-                if ((head.getProc(0) != kFactRaw) && (compressedOffset - previousOffset > fRealColumns[i].col.size*fRealColumns[i].col.num*thisRoundNumRows+head.getSizeOnDisk()))// && two)
-                {//if so set flag and redo it uncompressed
+                //check if compressed size is larger than uncompressed
+                //if so set flag and redo it uncompressed
+                if ((head.getProc(0) != FITS::kFactRaw) && (compressedOffset - previousOffset > fRealColumns[i].col.size*fRealColumns[i].col.num*thisRoundNumRows+head.getSizeOnDisk()))// && two)
+                {
                     //de-smooth !
-                    if (head.getProc(0) == kFactSmoothing)
+                    if (head.getProc(0) == FITS::kFactSmoothing)
                         UnApplySMOOTHING(src+offset, fRealColumns[i].col.num*thisRoundNumRows);
 
-                    Compression he;
+                    FITS::Compression he;
 
                     compressedOffset = previousOffset + he.getSizeOnDisk();
@@ -815,6 +814,6 @@
             }
 
-            const TileHeader tile_head(thisRoundNumRows, compressedOffset);
-            memcpy(dest, &tile_head, sizeof(TileHeader));
+            const FITS::TileHeader tile_head(thisRoundNumRows, compressedOffset);
+            memcpy(dest, &tile_head, sizeof(FITS::TileHeader));
 
             return compressedOffset;
@@ -833,5 +832,5 @@
                 switch (fRealColumns[i].block_head.getOrdering())
                 {
-                case kOrderByRow:
+                case FITS::kOrderByRow:
                     //regular, "semi-transposed" copy
                     for (uint32_t k=0;k<thisRoundNumRows;k++)
@@ -842,5 +841,5 @@
                     break;
 
-                case kOrderByCol:
+                case FITS::kOrderByCol:
                     //transposed copy
                     for (uint32_t j=0;j<fRealColumns[i].col.num;j++)
@@ -965,9 +964,9 @@
         struct CompressedColumn
         {
-            CompressedColumn(const Table::Column& c, const Compression& h) : col(c),
+            CompressedColumn(const Table::Column& c, const FITS::Compression& h) : col(c),
                 block_head(h)
             {}
-            Table::Column col;         ///< the regular column entry
-            Compression   block_head;  ///< the compression data associated with that column
+            Table::Column col;             ///< the regular column entry
+            FITS::Compression block_head;  ///< the compression data associated with that column
         };
         vector<CompressedColumn> fRealColumns;     ///< Vector hosting the columns of the file
