Index: trunk/Mars/mcore/zfits.h
===================================================================
--- trunk/Mars/mcore/zfits.h	(revision 16863)
+++ trunk/Mars/mcore/zfits.h	(revision 16867)
@@ -14,4 +14,13 @@
 #include "huffman.h"
 
+/*
+#define FACT_RAW       0x0
+#define FACT_SMOOTHING 0x1
+#define FACT_HUFFMAN16 0x2
+
+#define FACT_COL_MAJOR 'C'
+#define FACT_ROW_MAJOR 'R'
+*/
+
 
 #ifndef __MARS__
@@ -19,4 +28,17 @@
 {
 #endif
+
+enum FACT_COMPRESSION_PROCESS
+{
+    FACT_RAW = 0x0,
+    FACT_SMOOTHING = 0x1,
+    FACT_HUFFMAN16 = 0x2
+};
+
+enum FACT_ROW_ORDERING
+{
+    FACT_COL_MAJOR = 'C',
+    FACT_ROW_MAJOR = 'R'
+};
 
 class zfits : public fits
@@ -57,4 +79,5 @@
         return true;
     }
+
 protected:
 
@@ -99,5 +122,5 @@
 
         BlockHeader(uint64_t      s=0,
-                    char          o='R'/*FACT_ROW_MAJOR*/,
+                    char          o=FACT_ROW_MAJOR,
                     unsigned char n=1) : size(s),
                                          ordering(o),
@@ -131,6 +154,5 @@
         fColumnOrdering.resize(fTable.sortedCols.size());
         for (auto it=fColumnOrdering.begin(); it != fColumnOrdering.end(); it++)
-            (*it) = 'R';//FACT_ROW_MAJOR;
-
+            (*it) = FACT_ROW_MAJOR;
         //Get compressed specific keywords
         fNumTiles       = fTable.isCompressed ? GetInt("NAXIS2") : 0;
@@ -272,5 +294,4 @@
             //skip to the beginning of the tile
             seekg(fHeapOff+fCatalog[requestedTile][0].second - sizeof(TileHeader));
-
             TileHeader tHead;
             read((char*)(&tHead), sizeof(TileHeader));
@@ -305,5 +326,5 @@
                 switch (fColumnOrdering[i])
                 {
-                case 'R': //FACT_ROW_MAJOR:
+                    case FACT_ROW_MAJOR:
                         // regular, "semi-transposed" copy
                         for (char *dest=buffer; dest<buffer+thisRoundNumRows*fTable.bytes_per_row; dest+=fTable.bytes_per_row) // row-by-row
@@ -314,5 +335,5 @@
                     break;
 
-                case 'C'://FACT_COL_MAJOR:
+                    case FACT_COL_MAJOR:
                         // transposed copy
                         for (char *elem=buffer; elem<buffer+it->bytes; elem+=it->size) // element-by-element (arrays)
@@ -328,5 +349,5 @@
                         clear(rdstate()|ios::badbit);
     #ifdef __EXCEPTIONS
-                        throw runtime_error("Unkown column ordering scheme");
+                        throw runtime_error("Unkown column ordering scheme found");
     #else
                         gLog << ___err___ << "ERROR - unkown column ordering scheme" << endl;
@@ -410,6 +431,6 @@
             fColumnOrdering[i] = head->ordering;
 
-            const uint32_t numRows = (head->ordering=='R'/*FACT_ROW_MAJOR*/) ? thisRoundNumRows : col.num;
-            const uint32_t numCols = (head->ordering=='C'/*FACT_COL_MAJOR*/) ? thisRoundNumRows : col.num;
+            const uint32_t numRows = (head->ordering==FACT_ROW_MAJOR) ? thisRoundNumRows : col.num;
+            const uint32_t numCols = (head->ordering==FACT_COL_MAJOR) ? thisRoundNumRows : col.num;
 
             const char *src = fCompressedBuffer.data()+compressedOffset+sizeof(BlockHeader)+sizeof(uint16_t)*head->numProcs;
@@ -421,11 +442,11 @@
                 switch (head->processings[j])
                 {
-                case 0x0://FACT_RAW:
+                    case FACT_RAW:
                             sizeWritten = UncompressUNCOMPRESSED(dest, src, numRows*numCols, col.size);
                     break;
-                case 0x1://FACT_SMOOTHING:
+                    case FACT_SMOOTHING:
                             sizeWritten = UnApplySMOOTHING(reinterpret_cast<int16_t*>(dest), numRows*numCols);
                     break;
-                case 0x2://FACT_HUFFMAN16:
+                    case FACT_HUFFMAN16:
                             sizeWritten = UncompressHUFFMAN16(dest, src, numRows);
                     break;
@@ -477,5 +498,5 @@
 
             //a new tile begins here
-            catalog.emplace_back(0);//push_back(vector<pair<int64_t, int64_t> >(0));
+            catalog.push_back(vector<pair<int64_t, int64_t> >(0));
             offsetInHeap += sizeof(TileHeader);
 
@@ -486,5 +507,5 @@
                 if (fTable.sortedCols[i].num == 0)
                 {
-                    catalog.back().emplace_back(0,0);
+                    catalog.back().push_back(make_pair(0,0));
                     continue;
                 }
@@ -494,5 +515,5 @@
                 if (!good())
                     break;
-                catalog.back().emplace_back(int64_t(columnHead.size),offsetInHeap);
+                catalog.back().emplace_back((int64_t)(columnHead.size),offsetInHeap);
                 offsetInHeap += columnHead.size;
                 seekg(fHeapOff+offsetInHeap);
