r241: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 4 Dec 2000 03:42:00 +0000 (03:42 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 4 Dec 2000 03:42:00 +0000 (03:42 +0000)
include/fnetorderstream.h
libctsim/array2dfile.cpp
libctsupport/fnetorderstream.cpp

index d341763c47cf6300e45c8d734b5b9711511bab2b..cf20869cf4f7222aff48fbd3d7f799b48313e6d6 100644 (file)
@@ -74,15 +74,15 @@ class fnetorderstream : public fstream {
   ~fnetorderstream (void)
       {}
 
-  virtual fnetorderstream& writeInt16 (kuint16 n);
-  virtual fnetorderstream& writeInt32 (kuint32 n);
-  virtual fnetorderstream& writeFloat32 (kfloat32 n);
-  virtual fnetorderstream& writeFloat64 (kfloat64 n);
+  virtual  writeInt16 (kuint16 n);
+  virtual  writeInt32 (kuint32 n);
+  virtual  writeFloat32 (kfloat32 n);
+  virtual  writeFloat64 (kfloat64 n);
   
-  virtual fnetorderstream& readInt16 (kuint16& n);
-  virtual fnetorderstream& readInt32 (kuint32& n);
-  virtual fnetorderstream& readFloat32 (kfloat32& n);
-  virtual fnetorderstream& readFloat64 (kfloat64& n);
+  virtual  readInt16 (kuint16& n);
+  virtual  readInt32 (kuint32& n);
+  virtual  readFloat32 (kfloat32& n);
+  virtual  readFloat64 (kfloat64& n);
 };
 
 
@@ -91,15 +91,15 @@ class frnetorderstream : public fnetorderstream {
   frnetorderstream (const char* filename, int mode)
     : fnetorderstream (filename, mode) {}
 
-  virtual frnetorderstream& writeInt16 (kuint16 n);
-  virtual frnetorderstream& writeInt32 (kuint32 n);
-  virtual frnetorderstream& writeFloat32 (kfloat32 n);
-  virtual frnetorderstream& writeFloat64 (kfloat64 n);
+  writeInt16 (kuint16 n);
+  writeInt32 (kuint32 n);
+  writeFloat32 (kfloat32 n);
+  writeFloat64 (kfloat64 n);
   
-  virtual frnetorderstream& readInt16 (kuint16& n);
-  virtual frnetorderstream& readInt32 (kuint32& n);
-  virtual frnetorderstream& readFloat32 (kfloat32& n);
-  virtual frnetorderstream& readFloat64 (kfloat64& n);
+  readInt16 (kuint16& n);
+  readInt32 (kuint32& n);
+  readFloat32 (kfloat32& n);
+  readFloat64 (kfloat64& n);
 };
 
 #endif
index f3e6dc9262007fe2e966f7ca4ed1b5d197511902..121f3c862a3bcad3b1940c07ef7303ad168591b4 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: array2dfile.cpp,v 1.11 2000/12/04 03:12:18 kevin Exp $
+**  $Id: array2dfile.cpp,v 1.12 2000/12/04 03:42:00 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
@@ -62,7 +62,7 @@ Array2dFileLabel::Array2dFileLabel()
     init();
 }
 
-Array2dFileLabel::Array2dFileLabel(const char* const str, double ctime = 0.)
+Array2dFileLabel::Array2dFileLabel(const char* const str, double ctime)
     : m_strLabel (str)
 {
     init();
@@ -71,7 +71,7 @@ Array2dFileLabel::Array2dFileLabel(const char* const str, double ctime = 0.)
     m_calcTime = ctime;
 }
 
-Array2dFileLabel::Array2dFileLabel(const int type, const char* const str, double ctime = 0.)
+Array2dFileLabel::Array2dFileLabel(const int type, const char* const str, double ctime)
   :  m_strLabel (str)
 {
     init();
@@ -415,11 +415,11 @@ Array2dFile::arrayDataWrite (frnetorderstream& fs)
       if (NativeBigEndian()) {
          for (unsigned int iy = 0; iy < m_ny; iy++) {
              ConvertReverseNetworkOrder (ptrColumn, m_pixelSize);
-             fs.write (ptrColumn, m_pixelSize);
+             fs.write (reinterpret_cast<const char*>(ptrColumn), m_pixelSize);
              ptrColumn += m_pixelSize;
          }
       } else 
-         fs.write (ptrColumn, columnSize);
+         fs.write (reinterpret_cast<const char*>(ptrColumn), columnSize);
   }
 
   return true;
@@ -443,12 +443,12 @@ Array2dFile::arrayDataRead (frnetorderstream& fs)
       unsigned char* ptrColumn = m_arrayData[ix];
       if (NativeBigEndian()) {
          for (unsigned int iy = 0; iy < m_ny; iy++) {
-             fs.read (ptrColumn, m_pixelSize);
+             fs.read (reinterpret_cast<char*>(ptrColumn), m_pixelSize);
              ConvertReverseNetworkOrder (ptrColumn, m_pixelSize);
              ptrColumn += m_pixelSize;
          } 
       } else
-         fs.read (ptrColumn, columnSize);
+         fs.read (reinterpret_cast<char*>(ptrColumn), columnSize);
   }
 
   return true;
@@ -524,14 +524,14 @@ Array2dFile::labelsWrite (frnetorderstream& fs)
 }
 
 void
-Array2dFile::labelAdd (const char* const lstr, double calc_time=0.)
+Array2dFile::labelAdd (const char* const lstr, double calc_time)
 {
   labelAdd (Array2dFileLabel::L_HISTORY, lstr, calc_time);
 }
 
 
 void
-Array2dFile::labelAdd (int type, const char* const lstr, double calc_time=0.)
+Array2dFile::labelAdd (int type, const char* const lstr, double calc_time)
 {
   Array2dFileLabel label (type, lstr, calc_time);
 
index 7fff7a3623966e9a32553e0cc776b7bf409607ff..569984c22a5f293e754cf05e01743f0b0650b676 100644 (file)
@@ -52,7 +52,7 @@ fnetorderstream& fnetorderstream::writeInt16 (kuint16 n) {
 #ifndef WORDS_BIGENDIAN
   SwapBytes2 (&n);
 #endif
-  write (&n, 2);
+  write (reinterpret_cast<const char*>(&n), 2);
   return (*this);
 }
 
@@ -60,7 +60,7 @@ fnetorderstream& fnetorderstream::writeInt32 (kuint32 n) {
 #ifndef WORDS_BIGENDIAN
   SwapBytes4(&n);
 #endif
-  write (&n, 4);
+  write (reinterpret_cast<const char*>(&n), 4);
   return (*this);
 }
 
@@ -68,7 +68,7 @@ fnetorderstream& fnetorderstream::writeFloat32 (kfloat32 n) {
 #ifndef WORDS_BIGENDIAN
   SwapBytes4 (&n);
 #endif
-  write (&n, 4);
+  write (reinterpret_cast<const char*>(&n), 4);
   return (*this);
 }
 
@@ -76,12 +76,12 @@ fnetorderstream& fnetorderstream::writeFloat64 (kfloat64 n) {
 #ifndef WORDS_BIGENDIAN
   SwapBytes8 (&n);
 #endif
-  write (&n, 8);
+  write (reinterpret_cast<const char*>(&n), 8);
   return (*this);
 }
 
 fnetorderstream& fnetorderstream::readInt16 (kuint16& n) {
-  read (&n, 2);
+  read (reinterpret_cast<char*>(&n), 2);
 #ifndef WORDS_BIGENDIAN
   SwapBytes2 (&n);
 #endif
@@ -89,7 +89,7 @@ fnetorderstream& fnetorderstream::readInt16 (kuint16& n) {
 }
 
 fnetorderstream& fnetorderstream::readInt32 (kuint32& n) {
-  read (&n, 4);
+  read (reinterpret_cast<char*>(&n), 4);
 #ifndef WORDS_BIGENDIAN
   SwapBytes4 (&n);
 #endif
@@ -97,7 +97,7 @@ fnetorderstream& fnetorderstream::readInt32 (kuint32& n) {
 }
 
 fnetorderstream& fnetorderstream::readFloat32 (kfloat32& n) {
-  read (&n, 4);
+  read (reinterpret_cast<char*>(&n), 4);
 #ifndef WORDS_BIGENDIAN
   SwapBytes4 (&n);
 #endif
@@ -105,7 +105,7 @@ fnetorderstream& fnetorderstream::readFloat32 (kfloat32& n) {
 }
 
 fnetorderstream& fnetorderstream::readFloat64 (kfloat64& n) {
-  read (&n, 8);
+  read (reinterpret_cast<char*>(&n), 8);
 #ifndef WORDS_BIGENDIAN
   SwapBytes8 (&n);
 #endif
@@ -118,7 +118,7 @@ frnetorderstream& frnetorderstream::writeInt16 (kuint16 n) {
 #ifdef WORDS_BIGENDIAN
   SwapBytes2 (&n);
 #endif
-  write (&n, 2);
+  write (reinterpret_cast<char*>(&n), 2);
   return (*this);
 }
 
@@ -126,7 +126,7 @@ frnetorderstream& frnetorderstream::writeInt32 (kuint32 n) {
 #ifdef WORDS_BIGENDIAN
   SwapBytes4(&n);
 #endif
-  write (&n, 4);
+  write (reinterpret_cast<char*>(&n), 4);
   return (*this);
 }
 
@@ -134,7 +134,7 @@ frnetorderstream& frnetorderstream::writeFloat32 (kfloat32 n) {
 #ifdef WORDS_BIGENDIAN
   SwapBytes4 (&n);
 #endif
-  write (&n, 4);
+  write (reinterpret_cast<char*>(&n), 4);
   return (*this);
 }
 
@@ -142,12 +142,12 @@ frnetorderstream& frnetorderstream::writeFloat64 (kfloat64 n) {
 #ifdef WORDS_BIGENDIAN
   SwapBytes8 (&n);
 #endif
-  write (&n, 8);
+  write (reinterpret_cast<char*>(&n), 8);
   return (*this);
 }
 
 frnetorderstream& frnetorderstream::readInt16 (kuint16& n) {
-  read (&n, 2);
+  read (reinterpret_cast<char*>(&n), 2);
 #ifdef WORDS_BIGENDIAN
   SwapBytes2 (&n);
 #endif
@@ -155,7 +155,7 @@ frnetorderstream& frnetorderstream::readInt16 (kuint16& n) {
 }
 
 frnetorderstream& frnetorderstream::readInt32 (kuint32& n) {
-  read (&n, 4);
+  read (reinterpret_cast<char*>(&n), 4);
 #ifdef WORDS_BIGENDIAN
   SwapBytes4 (&n);
 #endif
@@ -163,7 +163,7 @@ frnetorderstream& frnetorderstream::readInt32 (kuint32& n) {
 }
 
 frnetorderstream& frnetorderstream::readFloat32 (kfloat32& n) {
-  read (&n, 4);
+  read (reinterpret_cast<char*>(&n), 4);
 #ifdef WORDS_BIGENDIAN
   SwapBytes4 (&n);
 #endif
@@ -171,7 +171,7 @@ frnetorderstream& frnetorderstream::readFloat32 (kfloat32& n) {
 }
 
 frnetorderstream& frnetorderstream::readFloat64 (kfloat64& n) {
-  read (&n, 8);
+  read (reinterpret_cast<char*>(&n), 8);
 #ifdef WORDS_BIGENDIAN
   SwapBytes8 (&n);
 #endif