diff libinterp/corefcn/oct-stream.cc @ 17463:cc13924a4266 ss-3-7-7

snapshot 3.7.7 * configure.ac (OCTAVE_VERSION): Bump to 3.7.7.
author John W. Eaton <jwe@octave.org>
date Mon, 23 Sep 2013 13:31:02 -0400
parents 669ad11f282d
children d63878346099
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc	Mon Sep 23 08:55:19 2013 -0700
+++ b/libinterp/corefcn/oct-stream.cc	Mon Sep 23 13:31:02 2013 -0400
@@ -2980,21 +2980,47 @@
     {
       SRC_T *data = static_cast<SRC_T *> (*it);
 
-      for (octave_idx_type i = 0; i < input_buf_elts && j < elts_read; i++, j++)
+      if (swap || do_float_fmt_conv)
         {
-          if (swap)
-            swap_bytes<sizeof (SRC_T)> (&data[i]);
-          else if (do_float_fmt_conv)
-            do_float_format_conversion (&data[i], sizeof (SRC_T),
-                                        1, from_flt_fmt,
-                                        oct_mach_info::float_format ());
-
-          dst_elt_type tmp (data[i]);
-
-          if (do_NA_conv && __lo_ieee_is_old_NA (tmp))
-            tmp = __lo_ieee_replace_old_NA (tmp);
-
-          conv_data[j] = tmp;
+          for (octave_idx_type i = 0; i < input_buf_elts && j < elts_read;
+               i++, j++)
+            {
+              if (swap)
+                swap_bytes<sizeof (SRC_T)> (&data[i]);
+              else if (do_float_fmt_conv)
+                do_float_format_conversion (&data[i], sizeof (SRC_T),
+                                            1, from_flt_fmt,
+                                            oct_mach_info::float_format ());
+
+              dst_elt_type tmp (data[i]);
+
+              if (do_NA_conv && __lo_ieee_is_old_NA (tmp))
+                tmp = __lo_ieee_replace_old_NA (tmp);
+
+              conv_data[j] = tmp;
+            }
+        }
+      else
+        {
+          if (do_NA_conv)
+            {
+              for (octave_idx_type i = 0; i < input_buf_elts && j < elts_read;
+                   i++, j++)
+                {
+                  dst_elt_type tmp (data[i]);
+
+                  if (__lo_ieee_is_old_NA (tmp))
+                    tmp = __lo_ieee_replace_old_NA (tmp);
+
+                  conv_data[j] = tmp;
+                }
+            }
+          else
+            {
+              for (octave_idx_type i = 0; i < input_buf_elts && j < elts_read;
+                   i++, j++)
+                conv_data[j] = data[i];
+            }
         }
 
       delete [] data;
@@ -3017,7 +3043,6 @@
 #define TABLE_ELT(T, U, V, W) \
   conv_fptr_table[oct_data_conv::T][oct_data_conv::U] = convert_and_copy<V, W>
 
-#undef FILL_TABLE_ROW
 #define FILL_TABLE_ROW(T, V) \
   TABLE_ELT (T, dt_int8, V, int8NDArray); \
   TABLE_ELT (T, dt_uint8, V, uint8NDArray); \