Index: /trunk/Mars/mcore/fits.h
===================================================================
--- /trunk/Mars/mcore/fits.h	(revision 17776)
+++ /trunk/Mars/mcore/fits.h	(revision 17777)
@@ -23,5 +23,11 @@
 #endif
 
-#ifndef __MARS__
+#if defined(__MARS__) || defined(__CINT__)
+#include "MLog.h"
+#include "MLogManip.h"
+#define ___err___   err
+#define ___warn___  warn
+#define ___all___   all
+#else
 #include <vector>
 #include <iomanip>
@@ -33,10 +39,4 @@
 #define ___all___   ""
 #endif
-#else
-#include "MLog.h"
-#include "MLogManip.h"
-#define ___err___   err
-#define ___warn___  warn
-#define ___all___   all
 #endif
 
@@ -49,4 +49,5 @@
 #endif
 
+#include "FITS.h"
 #include "checksum.h"
 
@@ -171,5 +172,5 @@
         Keys ParseBlock(const std::vector<std::string> &vec) const
         {
-            std::map<std::string,Entry> rc;
+            Keys rc;
 
             for (unsigned int i=0; i<vec.size(); i++)
@@ -203,5 +204,5 @@
                     // Set value, comment and type
                     // comments could be just spaces. take care of this.
-                    if (ppp!=std::string::npos && val.size() != ppp+1)
+                    if (ppp!=std::string::npos && val.size()!=ppp+1)
                         com = Trim(val.substr(ppp+1));
 
@@ -213,5 +214,5 @@
                     const size_t p = val.find_first_of('/');
 
-                    if (val.size() != p+1)
+                    if (p!=std::string::npos && val.size()!=p+1)
                         com = Trim(val.substr(p+2));
 
@@ -265,6 +266,5 @@
             num_rows      = is_compressed ? Get<size_t>("ZNAXIS2") : Get<size_t>("NAXIS2");
             num_cols      = Get<size_t>("TFIELDS");
-            datasum       = is_compressed ? Get<int64_t>("DATASUM", -1) : Get<int64_t>("DATASUM", -1);
-//cout << "IS COMPRESSED =-========= " << is_compressed << " " << Get<size_t>("NAXIS1") << endl;
+            datasum       = Get<int64_t>("DATASUM", -1);
             size_t bytes = 0;
 
@@ -329,5 +329,5 @@
 
                 cols[id] = col;
-                sorted_cols.push_back(col);
+                sorted_cols.emplace_back(col);
                 bytes  += n*size;
             }
@@ -353,19 +353,10 @@
             for (Keys::const_iterator it=keys.cbegin(); it!=keys.cend(); it++)
             {
-                if (!display_all &&
-                    (it->first.substr(0, 6)=="TTYPE" ||
-                     it->first.substr(0, 6)=="TFORM" ||
-                     it->first.substr(0, 6)=="TUNIT" ||
-                     it->first=="TFIELDS"  ||
-                     it->first=="XTENSION" ||
-                     it->first=="NAXIS"    ||
-                     it->first=="BITPIX"   ||
-                     it->first=="PCOUNT"   ||
-                     it->first=="GCOUNT")
-                   )
+                if (!display_all && FITS::IsReservedKeyWord(it->first))
                     continue;
 
                 gLog << ___all___ << std::setw(2) << it->second.type << '|' << it->first << '=' << it->second.value << '/' << it->second.comment << '|' << std::endl;
-            }}
+            }
+        }
 
         void PrintColumns() const
@@ -423,5 +414,5 @@
             T Get(const std::string &key) const
         {
-            const std::map<std::string,Entry>::const_iterator it = keys.find(key);
+            const Keys::const_iterator it = keys.find(key);
             if (it==keys.end())
             {
@@ -442,5 +433,5 @@
             T Get(const std::string &key, const T &deflt) const
         {
-            const std::map<std::string,Entry>::const_iterator it = keys.find(key);
+            const Keys::const_iterator it = keys.find(key);
             return it==keys.end() ? deflt :it->second.Get<T>();
         }
@@ -543,5 +534,5 @@
             }
 
-            vec.push_back(str);
+            vec.emplace_back(str);
         }
 
@@ -1023,5 +1014,5 @@
     operator bool() const { return fTable && fTable.offset!=0; }
 
-    void PrintKeys() const { fTable.PrintKeys(); }
+    void PrintKeys(bool all_keys=false) const { fTable.PrintKeys(all_keys); }
     void PrintColumns() const { fTable.PrintColumns(); }
 
