changeset 24225:b8cb5a05955e

improve on lto fix made in changeset ff81c6772664 * ov-intx.h (OCTAVE_VALUE_INT_MATRIX_T::hdf5_save_type, OCTAVE_VALUE_INT_MATRIX_T::hdf5_save_type, OCTAVE_VALUE_INT_MATRIX_T::hdf5_save_type, OCTAVE_VALUE_INT_MATRIX_T::hdf5_save_type): New static data members. * ov-int16.cc, ov-int32.cc, ov-int64.cc, ov-int8.cc, ov-uint16.cc, ov-uint32.cc, ov-uint64.cc, ov-uint8.cc: Initialize new static data members. Don't define load_hdf5 and save_hdf5. * ov-intx.h (OCTAVE_VALUE_INT_MATRIX_T::save_hdf5, OCTAVE_VALUE_INT_MATRIX_T::load_hdf5, OCTAVE_VALUE_INT_MATRIX_T::save_hdf5, OCTAVE_VALUE_INT_MATRIX_T::load_hdf5): Use new static hdf5_save_type and forward to internal functions.
author John W. Eaton <jwe@octave.org>
date Fri, 10 Nov 2017 14:54:36 -0500
parents ff81c6772664
children dc85329e6778
files libinterp/octave-value/ov-int16.cc libinterp/octave-value/ov-int32.cc libinterp/octave-value/ov-int64.cc libinterp/octave-value/ov-int8.cc libinterp/octave-value/ov-intx.h libinterp/octave-value/ov-uint16.cc libinterp/octave-value/ov-uint32.cc libinterp/octave-value/ov-uint64.cc libinterp/octave-value/ov-uint8.cc
diffstat 9 files changed, 45 insertions(+), 213 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-int16.cc	Thu Nov 09 18:20:19 2017 -0500
+++ b/libinterp/octave-value/ov-int16.cc	Fri Nov 10 14:54:36 2017 -0500
@@ -56,6 +56,9 @@
 #include "ls-utils.h"
 #include "ls-hdf5.h"
 
+octave_hdf5_id octave_int16_matrix::hdf5_save_type = HDF5_SAVE_TYPE;
+octave_hdf5_id octave_int16_scalar::hdf5_save_type = HDF5_SAVE_TYPE;
+
 // Prevent implicit instantiations on some systems (Windows, others?)
 // that can lead to duplicate definitions of static data members.
 
@@ -68,36 +71,9 @@
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_int16_matrix,
                                      "int16 matrix", "int16");
 
-
-bool
-octave_int16_matrix::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_int16_matrix::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
-
 template class octave_base_scalar<octave_int16>;
 
 template class octave_base_int_scalar<octave_int16>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_int16_scalar,
                                      "int16 scalar", "int16");
-
-bool
-octave_int16_scalar::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_int16_scalar::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
--- a/libinterp/octave-value/ov-int32.cc	Thu Nov 09 18:20:19 2017 -0500
+++ b/libinterp/octave-value/ov-int32.cc	Fri Nov 10 14:54:36 2017 -0500
@@ -56,6 +56,9 @@
 #include "ls-utils.h"
 #include "ls-hdf5.h"
 
+octave_hdf5_id octave_int32_matrix::hdf5_save_type = HDF5_SAVE_TYPE;
+octave_hdf5_id octave_int32_scalar::hdf5_save_type = HDF5_SAVE_TYPE;
+
 // Prevent implicit instantiations on some systems (Windows, others?)
 // that can lead to duplicate definitions of static data members.
 
@@ -67,18 +70,6 @@
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_int32_matrix,
                                      "int32 matrix", "int32");
-bool
-octave_int32_matrix::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_int32_matrix::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
 
 template class octave_base_scalar<octave_int32>;
 
@@ -86,16 +77,3 @@
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_int32_scalar,
                                      "int32 scalar", "int32");
-
-bool
-octave_int32_scalar::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_int32_scalar::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
--- a/libinterp/octave-value/ov-int64.cc	Thu Nov 09 18:20:19 2017 -0500
+++ b/libinterp/octave-value/ov-int64.cc	Fri Nov 10 14:54:36 2017 -0500
@@ -56,6 +56,9 @@
 #include "ls-utils.h"
 #include "ls-hdf5.h"
 
+octave_hdf5_id octave_int64_matrix::hdf5_save_type = HDF5_SAVE_TYPE;
+octave_hdf5_id octave_int64_scalar::hdf5_save_type = HDF5_SAVE_TYPE;
+
 // Prevent implicit instantiations on some systems (Windows, others?)
 // that can lead to duplicate definitions of static data members.
 
@@ -68,35 +71,9 @@
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_int64_matrix,
                                      "int64 matrix", "int64");
 
-bool
-octave_int64_matrix::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_int64_matrix::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
-
 template class octave_base_scalar<octave_int64>;
 
 template class octave_base_int_scalar<octave_int64>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_int64_scalar,
                                      "int64 scalar", "int64");
-
-bool
-octave_int64_scalar::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_int64_scalar::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
--- a/libinterp/octave-value/ov-int8.cc	Thu Nov 09 18:20:19 2017 -0500
+++ b/libinterp/octave-value/ov-int8.cc	Fri Nov 10 14:54:36 2017 -0500
@@ -56,6 +56,9 @@
 #include "ls-utils.h"
 #include "ls-hdf5.h"
 
+octave_hdf5_id octave_int8_matrix::hdf5_save_type = HDF5_SAVE_TYPE;
+octave_hdf5_id octave_int8_scalar::hdf5_save_type = HDF5_SAVE_TYPE;
+
 // Prevent implicit instantiations on some systems (Windows, others?)
 // that can lead to duplicate definitions of static data members.
 
@@ -68,35 +71,9 @@
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_int8_matrix,
                                      "int8 matrix", "int8");
 
-bool
-octave_int8_matrix::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                               bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_int8_matrix::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
-
 template class octave_base_scalar<octave_int8>;
 
 template class octave_base_int_scalar<octave_int8>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_int8_scalar,
                                      "int8 scalar", "int8");
-
-bool
-octave_int8_scalar::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                               bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_int8_scalar::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
--- a/libinterp/octave-value/ov-intx.h	Thu Nov 09 18:20:19 2017 -0500
+++ b/libinterp/octave-value/ov-intx.h	Fri Nov 10 14:54:36 2017 -0500
@@ -369,12 +369,20 @@
       }
   }
 
-  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag);
+  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
+  {
+    return save_hdf5_internal (loc_id, hdf5_save_type, name, flag);
+  }
 
-  bool load_hdf5 (octave_hdf5_id loc_id, const char *name);
+  bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
+  {
+    return load_hdf5_internal (loc_id, hdf5_save_type, name);
+  }
 
 private:
 
+  static octave_hdf5_id hdf5_save_type;
+
   DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
 };
 
@@ -676,11 +684,19 @@
       }
   }
 
-  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag);
+  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
+  {
+    return save_hdf5_internal (loc_id, hdf5_save_type, name, flag);
+  }
 
-  bool load_hdf5 (octave_hdf5_id loc_id, const char *name);
+  bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
+  {
+    return load_hdf5_internal (loc_id, hdf5_save_type, name);
+  }
 
- private:
+private:
+
+  static octave_hdf5_id hdf5_save_type;
 
   DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
 };
--- a/libinterp/octave-value/ov-uint16.cc	Thu Nov 09 18:20:19 2017 -0500
+++ b/libinterp/octave-value/ov-uint16.cc	Fri Nov 10 14:54:36 2017 -0500
@@ -57,6 +57,9 @@
 #include "ls-utils.h"
 #include "ls-hdf5.h"
 
+octave_hdf5_id octave_uint16_matrix::hdf5_save_type = HDF5_SAVE_TYPE;
+octave_hdf5_id octave_uint16_scalar::hdf5_save_type = HDF5_SAVE_TYPE;
+
 // Prevent implicit instantiations on some systems (Windows, others?)
 // that can lead to duplicate definitions of static data members.
 
@@ -69,35 +72,9 @@
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint16_matrix,
                                      "uint16 matrix", "uint16");
 
-bool
-octave_uint16_matrix::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                 bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_uint16_matrix::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
-
 template class octave_base_scalar<octave_uint16>;
 
 template class octave_base_int_scalar<octave_uint16>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint16_scalar,
                                      "uint16 scalar", "uint16");
-
-bool
-octave_uint16_scalar::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                 bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_uint16_scalar::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
--- a/libinterp/octave-value/ov-uint32.cc	Thu Nov 09 18:20:19 2017 -0500
+++ b/libinterp/octave-value/ov-uint32.cc	Fri Nov 10 14:54:36 2017 -0500
@@ -56,6 +56,9 @@
 #include "ls-utils.h"
 #include "ls-hdf5.h"
 
+octave_hdf5_id octave_uint32_matrix::hdf5_save_type = HDF5_SAVE_TYPE;
+octave_hdf5_id octave_uint32_scalar::hdf5_save_type = HDF5_SAVE_TYPE;
+
 // Prevent implicit instantiations on some systems (Windows, others?)
 // that can lead to duplicate definitions of static data members.
 
@@ -68,35 +71,9 @@
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint32_matrix,
                                      "uint32 matrix", "uint32");
 
-bool
-octave_uint32_matrix::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                 bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_uint32_matrix::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
-
 template class octave_base_scalar<octave_uint32>;
 
 template class octave_base_int_scalar<octave_uint32>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint32_scalar,
                                      "uint32 scalar", "uint32");
-
-bool
-octave_uint32_scalar::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                 bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_uint32_scalar::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
--- a/libinterp/octave-value/ov-uint64.cc	Thu Nov 09 18:20:19 2017 -0500
+++ b/libinterp/octave-value/ov-uint64.cc	Fri Nov 10 14:54:36 2017 -0500
@@ -56,6 +56,9 @@
 #include "ls-utils.h"
 #include "ls-hdf5.h"
 
+octave_hdf5_id octave_uint64_matrix::hdf5_save_type = HDF5_SAVE_TYPE;
+octave_hdf5_id octave_uint64_scalar::hdf5_save_type = HDF5_SAVE_TYPE;
+
 // Prevent implicit instantiations on some systems (Windows, others?)
 // that can lead to duplicate definitions of static data members.
 
@@ -68,35 +71,9 @@
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint64_matrix,
                                      "uint64 matrix", "uint64");
 
-bool
-octave_uint64_matrix::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                 bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_uint64_matrix::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
-
 template class octave_base_scalar<octave_uint64>;
 
 template class octave_base_int_scalar<octave_uint64>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint64_scalar,
                                      "uint64 scalar", "uint64");
-
-bool
-octave_uint64_scalar::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                 bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_uint64_scalar::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
--- a/libinterp/octave-value/ov-uint8.cc	Thu Nov 09 18:20:19 2017 -0500
+++ b/libinterp/octave-value/ov-uint8.cc	Fri Nov 10 14:54:36 2017 -0500
@@ -56,6 +56,9 @@
 #include "ls-utils.h"
 #include "ls-hdf5.h"
 
+octave_hdf5_id octave_uint8_matrix::hdf5_save_type = HDF5_SAVE_TYPE;
+octave_hdf5_id octave_uint8_scalar::hdf5_save_type = HDF5_SAVE_TYPE;
+
 // Prevent implicit instantiations on some systems (Windows, others?)
 // that can lead to duplicate definitions of static data members.
 
@@ -68,35 +71,9 @@
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint8_matrix,
                                      "uint8 matrix", "uint8");
 
-bool
-octave_uint8_matrix::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_uint8_matrix::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}
-
 template class octave_base_scalar<octave_uint8>;
 
 template class octave_base_int_scalar<octave_uint8>;
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_uint8_scalar,
                                      "uint8 scalar", "uint8");
-
-bool
-octave_uint8_scalar::save_hdf5 (octave_hdf5_id loc_id, const char *name,
-                                bool flag)
-{
-  return save_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name, flag);
-}
-
-bool
-octave_uint8_scalar::load_hdf5 (octave_hdf5_id loc_id, const char *name)
-{
-  return load_hdf5_internal (loc_id, HDF5_SAVE_TYPE, name);
-}