r246: More modifications for MSVC
[ctsim.git] / libctsim / projections.cpp
index fb24e0d897bf065d9d348a5b09f827eacf1b8b8d..7de82039d629517652649bf741ede6ae4a5f454b 100644 (file)
@@ -8,7 +8,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: projections.cpp,v 1.25 2000/09/02 05:10:39 kevin Exp $
+**  $Id: projections.cpp,v 1.28 2000/12/06 01:46:43 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -25,7 +25,8 @@
 ******************************************************************************/
 
 #include "ct.h"
-
+\r
+const kuint16 Projections::m_signature = ('P'*256 + 'J');\r
 
 /* NAME
  *    Projections              Constructor for projections matrix storage 
@@ -253,14 +254,15 @@ Projections::headerRead (fnetorderstream& fs)
     return false;
   }
 
-  char remarkStorage[_remarksize+1];
-  fs.read (remarkStorage, _remarksize);
+  char* pszRemarkStorage = new char [_remarksize+1];
+  fs.read (pszRemarkStorage, _remarksize);
   if (! fs) {
     sys_error (ERR_SEVERE, "Error reading remark, _remarksize = %d", _remarksize);
     return false;
   }
-  remarkStorage[_remarksize] = 0;
-  m_remark = remarkStorage;
+  pszRemarkStorage[_remarksize] = 0;
+  m_remark = pszRemarkStorage;
+  delete pszRemarkStorage;\r
 
   off_t _hsizeread = fs.tellg();
   if (!fs || _hsizeread != _hsize) {
@@ -343,6 +345,7 @@ Projections::write (const char* filename)
     return false;
   }
 
+#ifdef HAVE_TIME
   time_t t = time(NULL);
   tm* lt = localtime(&t);
   m_year = lt->tm_year;
@@ -351,6 +354,7 @@ Projections::write (const char* filename)
   m_hour = lt->tm_hour;
   m_minute = lt->tm_min;
   m_second = lt->tm_sec;
+#endif
 
   if (! headerWrite (fs))
       return false;