changeset 3689:9143cd2129c4

[project @ 2000-06-30 09:30:44 by jwe]
author jwe
date Fri, 30 Jun 2000 09:30:46 +0000
parents 8aea513ff224
children 55e59236c5e5
files liboctave/ChangeLog liboctave/dMatrix.h src/ChangeLog src/load-save.cc
diffstat 4 files changed, 8 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,7 @@
+2000-06-29  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* dMatrix.h (read_int): Provide declaration.
+
 2000-06-29  James R. Van Zandt  <jrv@vanzandt.mv.com>
 
 	* data-conv.cc (read_doubles): Handle EIGHT_BYTE_INT cases.
--- a/liboctave/dMatrix.h
+++ b/liboctave/dMatrix.h
@@ -255,6 +255,9 @@
 
 MARRAY_FORWARD_DEFS (MArray2, Matrix, double)
 
+template <class T>
+void read_int (std::istream& is, bool swap_bytes, T& val);
+
 #endif
 
 /*
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,8 +1,6 @@
 2000-06-29  James R. Van Zandt  <jrv@vanzandt.mv.com>
 
-	* load-save.cc (read_int): New template function.  Instantiate it
-	for various integer types.
-	(load_save_format): New value, LS_MAT5_BINARY.
+	* load-save.cc (load_save_format): New value, LS_MAT5_BINARY.
 	(arrayclasstype, mat5_data_type): New enums.
 	(read_mat5_binary_data): New function.
 	(read_mat5_tag): New function.
--- a/src/load-save.cc
+++ b/src/load-save.cc
@@ -70,48 +70,6 @@
 #define PAD(l) (((l)<=4)?4:(((l)+7)/8)*8)
 #define TAGLENGTH(l) ((l)<=4?4:8)
 
-template <class T>
-void
-read_int (std::istream& is, bool swap_bytes, T& val)
-{
-  is.read (X_CAST (char *, &val), sizeof (T));
-
-  if (swap_bytes)
-    {
-      switch (sizeof (T))
-	{
-	case 1:
-	  break;
-
-	case 2:
-	  swap_2_bytes (X_CAST (char *, &val));
-	  break;
-
-	case 4:
-	  swap_4_bytes (X_CAST (char *, &val));
-	  break;
-
-	case 8:
-	  swap_8_bytes (X_CAST (char *, &val));
-	  break;
-
-	default:
-	  (*current_liboctave_error_handler)
-	    ("read_int: unrecognized data format!");
-	}
-    }
-}
-
-template void read_int (std::istream&, bool, char&);
-template void read_int (std::istream&, bool, signed char&);
-template void read_int (std::istream&, bool, unsigned char&);
-template void read_int (std::istream&, bool, short&);
-template void read_int (std::istream&, bool, unsigned short&);
-template void read_int (std::istream&, bool, int&);
-template void read_int (std::istream&, bool, unsigned int&);
-template void read_int (std::istream&, bool, long&);
-template void read_int (std::istream&, bool, unsigned long&);
-
 // Write octave-core file if Octave crashes or is killed by a signal.
 static bool Vcrash_dumps_octave_core;