changeset 7724:932b0cf51834

octave_stream::read: allow single data type specification but return double
author John W. Eaton <jwe@octave.org>
date Sun, 20 Apr 2008 09:04:47 -0400
parents 74f5e0c7de9e
children 7c9ba697a479
files src/ChangeLog src/oct-stream.cc
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Apr 19 01:59:31 2008 -0400
+++ b/src/ChangeLog	Sun Apr 20 09:04:47 2008 -0400
@@ -1,3 +1,8 @@
+2008-04-20  John W. Eaton  <jwe@octave.org>
+
+	* oct-stream.cc (octave_stream::read): Allow single data type
+	specification but return double.
+
 2008-04-18  John W. Eaton  <jwe@octave.org>
 
 	* lex.l, lex.h (process_comment): New arg, start_in_block.  Call
--- a/src/oct-stream.cc	Sat Apr 19 01:59:31 2008 -0400
+++ b/src/oct-stream.cc	Sun Apr 20 09:04:47 2008 -0400
@@ -3270,6 +3270,10 @@
       FILL_TABLE_ROW (oct_data_conv::dt_uint32, uint32NDArray);
       FILL_TABLE_ROW (oct_data_conv::dt_int64, int64NDArray);
       FILL_TABLE_ROW (oct_data_conv::dt_uint64, uint64NDArray);
+      // FIXME -- the following line allows things like int8=>single
+      // to work, but they will actually return a double value.  We
+      // need a floatNDArray for this to work properly.
+      FILL_TABLE_ROW (oct_data_conv::dt_single, NDArray);
       FILL_TABLE_ROW (oct_data_conv::dt_double, NDArray);
       FILL_TABLE_ROW (oct_data_conv::dt_char, charNDArray);
       FILL_TABLE_ROW (oct_data_conv::dt_schar, charNDArray);