Index: trunk/Mars/mcore/ofits.h
===================================================================
--- trunk/Mars/mcore/ofits.h	(revision 17263)
+++ trunk/Mars/mcore/ofits.h	(revision 17264)
@@ -33,9 +33,4 @@
 #include "checksum.h"
 
-#ifndef __MARS__
-namespace std
-{
-#endif
-
 // Sloppy:  allow / <--- left
 //          allow all characters (see specs for what is possible)
@@ -43,5 +38,5 @@
 // units: m kg s rad sr K A mol cd Hz J W V N Pa C Ohm S F Wb T Hlm lx
 
-class ofits : public ofstream
+class ofits : public std::ofstream
 {
 public:
@@ -81,5 +76,5 @@
                 throw std::runtime_error("Key name empty.");
 #else
-                gLog << ___err___ << "ERROR - Key name empty." << endl;
+                gLog << ___err___ << "ERROR - Key name empty." << std::endl;
                 return false;
 #endif
@@ -92,5 +87,5 @@
                 throw std::runtime_error(sout.str());
 #else
-                gLog << ___err___ << "ERROR - " << sout.str() << endl;
+                gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
                 return false;
 #endif
@@ -107,5 +102,5 @@
                     throw std::runtime_error(sout.str());
 #else
-                    gLog << ___err___ << "ERROR - " << sout.str() << endl;
+                    gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
                     return false;
 #endif
@@ -127,5 +122,5 @@
                     throw std::runtime_error(sout.str());
 #else
-                    gLog << ___err___ << "ERROR - " << sout.str() << endl;
+                    gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
                     return false;
 #endif
@@ -154,5 +149,5 @@
                 throw std::runtime_error(sout.str());
 #else
-                gLog << ___err___ << "ERROR - " << sout.str() << endl;
+                gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
 #endif
                 return false;
@@ -169,5 +164,5 @@
                 std::ostringstream sout;
                 sout << "Size " << sz << " of entry for key '" << key << "' exceeds 80 characters... removed comment.";
-                gLog << ___warn___ << "WARNING - " << sout.str() << endl;
+                gLog << ___warn___ << "WARNING - " << sout.str() << std::endl;
 #endif
                 return true;
@@ -179,5 +174,5 @@
             throw std::runtime_error(sout.str());
 #else
-            gLog << ___err___ << "ERROR - " << sout.str() << endl;
+            gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
             return false;
 #endif
@@ -199,5 +194,5 @@
 
             std::ostringstream sout;
-            sout << std::left << setw(8) << key;
+            sout << std::left << std::setw(8) << key;
 
             if (!delim)
@@ -209,5 +204,5 @@
             sout << "= ";
             sout << (!value.empty() && value[0]=='\''?std::left:std::right);
-            sout << setw(20) << value << std::left;
+            sout << std::setw(20) << value << std::left;
 
             if (!comment.empty())
@@ -219,5 +214,5 @@
         Checksum checksum;
 
-        void Out(ofstream &fout)
+        void Out(std::ofstream &fout)
         {
             if (!changed)
@@ -286,5 +281,5 @@
                 throw std::runtime_error(sout.str());
 #else
-                gLog << ___err___ << "ERROR - " << sout.str() << endl;
+                gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
                 return false;
 #endif
@@ -357,5 +352,5 @@
     {
     }
-    ofits(const char *fname) : ofstream(),
+    ofits(const char *fname) : std::ofstream(),
                                fCommentTrimming(false),
                                fManualExtName(false)
@@ -388,5 +383,5 @@
         SetStr("DATASUM",  "         0", "Checksum for the data block");
 
-        ofstream::open(filename);
+        std::ofstream::open(filename);
     }
 
@@ -414,5 +409,5 @@
             throw std::runtime_error(sout.str());
 #else
-            gLog << ___err___ << "ERROR - " << sout.str() << endl;
+            gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
             return false;
 #endif
@@ -462,9 +457,9 @@
 
         if (p<0)
-            sout << setprecision(-p) << fixed;
+            sout << std::setprecision(-p) << fixed;
         if (p>0)
-            sout << setprecision(p);
+            sout << std::setprecision(p);
         if (p==0)
-            sout << setprecision(f>1e-100 && f<1e100 ? 15 : 14);
+            sout << std::setprecision(f>1e-100 && f<1e100 ? 15 : 14);
 
         sout << f;
@@ -558,5 +553,5 @@
             throw std::runtime_error(sout.str());
 #else
-            gLog << ___err___ << "ERROR - " << sout.str() << endl;
+            gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
             return false;
 #endif
@@ -570,5 +565,5 @@
             throw std::runtime_error(sout.str());
 #else
-            gLog << ___err___ << "ERROR - " << sout.str() << endl;
+            gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
             return false;
 #endif
@@ -582,5 +577,5 @@
             throw std::runtime_error(sout.str());
 #else
-            gLog << ___err___ << "ERROR - " << sout.str() << endl;
+            gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
             return false;
 #endif
@@ -597,5 +592,5 @@
             throw std::runtime_error(sout.str());
 #else
-            gLog << ___err___ << "ERROR - " << sout.str() << endl;
+            gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
             return false;
 #endif
@@ -727,5 +722,5 @@
 
 
-    Checksum WriteHeader(ofstream &fout)
+    Checksum WriteHeader(std::ofstream &fout)
     {
         Checksum sum;
@@ -796,5 +791,5 @@
             throw std::runtime_error("File not empty anymore.");
 #else
-            gLog << ___err___ << "ERROR - File not empty anymore." << endl;
+            gLog << ___err___ << "ERROR - File not empty anymore." << std::endl;
             return false;
 #endif
@@ -824,5 +819,5 @@
         const char *pend = src + num*N;
         for (const char *ptr = src; ptr<pend; ptr+=N, dest+=N)
-            reverse_copy(ptr, ptr+N, dest);
+            std::reverse_copy(ptr, ptr+N, dest);
     }
 
@@ -835,10 +830,10 @@
         if (cnt!=fTable.bytes_per_row)
         {
-            ostringstream sout;
+            std::ostringstream sout;
             sout << "WriteRow - Size " << cnt << " does not match expected size " << fTable.bytes_per_row;
 #ifdef __EXCEPTIONS
             throw std::runtime_error(sout.str());
 #else
-            gLog << ___err___ << "ERROR - " << sout.str() << endl;
+            gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
             return false;
 #endif
@@ -918,5 +913,5 @@
     {
 
-        ostringstream dataSumStr;
+        std::ostringstream dataSumStr;
         dataSumStr << fDataSum.val();
         SetStr("DATASUM", dataSumStr.str());
@@ -943,20 +938,20 @@
         const Checksum chk = UpdateHeaderChecksum();
 
-        ofstream::close();
+        std::ofstream::close();
 
         if ((chk+fDataSum).valid())
             return true;
 
-        ostringstream sout;
+        std::ostringstream sout;
         sout << "Checksum (" << std::hex << chk.val() << ") invalid.";
 #ifdef __EXCEPTIONS
         throw std::runtime_error(sout.str());
 #else
-        gLog << ___err___ << "ERROR - " << sout.str() << endl;
+        gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
         return false;
 #endif
     }
 
-    pair<string, int> GetChecksumData()
+    std::pair<std::string, int> GetChecksumData()
     {
         std::string datasum;
@@ -972,5 +967,5 @@
         if (datasum[0] == '\'')
             datasum = datasum.substr(1, datasum.size()-2);
-        return make_pair(checksum, atoi(datasum.c_str()));
+        return std::make_pair(checksum, atoi(datasum.c_str()));
     }
 
@@ -997,8 +992,4 @@
     }
 };
-
-#ifndef __MARS__
-};
-#endif
 
 #if 0
