Mercurial > hg > octave-max
changeset 9881:b3089dba88bf
Remove HDF5 cruft for older versions of HDF5
line wrap: on
line diff
--- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2009-11-27 David Bateman <dbateman@free.fr> + + * doc/interpreter/contributors.in: Add Kacper Kowalik. + 2009-11-27 David Bateman <dbateman@free.fr> * interpreter/install.txi: Document that curl libraries impact ftp
--- a/doc/interpreter/contributors.in +++ b/doc/interpreter/contributors.in @@ -105,6 +105,7 @@ Geoffrey Knauth Heine Kolltveit Ken Kouno +Kacper Kowalik Oyvind Kristiansen Piotr Krzyzanowski Volker Kuhlmann
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,64 @@ +2009-11-27 Kacper Kowalik <xarthisius.kk@gmail.com> + + * ls-hdf5.cc (have_h5giterate_bug): Drop this group iteration flag + for buggy pre 1.2.2 versions of hdf5. + * ov-base-int.cc (octave_base_int_matrix<T>::load_hdf5) + octave_base_int_scalar<T>::load_hdf5), + ov-base-int.h (octave_base_int_matrix<T>::load_hdf5, + octave_base_int_scalar<T>::load_hdf5), + ov-base.cc (octave_base_value::load_hdf5), + ov-base.h (octave_base_value::load_hdf5), + ov-bool-mat.cc (octave_bool_matrix::load_hdf5), + ov-bool-mat.h (octave_bool_matrix::load_hdf5), + ov-bool-sparse.cc (octave_sparse_bool_matrix::load_hdf5), + ov-bool-sparse.h (octave_sparse_bool_matrix::load_hdf5), + ov-bool.cc (octave_bool::load_hdf5), + ov-bool.h (octave_bool::load_hdf5), + ov-cell.cc (octave_cell::load_hdf5), + ov-cell.h (octave_cell::load_hdf5), + ov-class.cc (octave_class::load_hdf5), + ov-class.h (octave_class::load_hdf5), + ov-complex.cc (octave_complex::load_hdf5), + ov-complex.h (octave_complex::load_hdf5), + ov-cx-mat.cc (octave_complex_matrix::load_hdf5), + ov-cx-mat.h (octave_complex_matrix::load_hdf5), + ov-cx-sparse.cc (octave_sparse_complex_matrix::load_hdf5), + ov-cx-sparse.h (octave_sparse_complex_matrix::load_hdf5), + ov-fcn-handle.cc (octave_fcn_handle::load_hdf5), + ov-fcn-handle.h (octave_fcn_handle::load_hdf5), + ov-fcn-inline.cc (octave_fcn_inline::load_hdf5), + ov-fcn-inline.h (octave_fcn_inline::load_hdf5), + ov-float.cc (octave_float_scalar::load_hdf5), + ov-float.h (octave_float_scalar::load_hdf5), + ov-flt-complex.cc (octave_float_complex::load_hdf5), + ov-flt-complex.h (octave_float_complex::load_hdf5), + ov-flt-cx-mat.cc (octave_float_complex_matrix::load_hdf5), + ov-flt-cx-mat.h (octave_float_complex_matrix::load_hdf5), + ov-flt-re-mat.cc (octave_float_matrix::load_hdf5), + ov-flt-re-mat.h (octave_float_matrix::load_hdf5), + ov-list.cc (octave_list::load_hdf5), + ov-list.h (octave_list::load_hdf5), + ov-range.cc (octave_range::load_hdf5), + ov-range.h (octave_range::load_hdf5), + ov-re-mat.cc (octave_matrix::load_hdf5), + ov-re-mat.h (octave_matrix::load_hdf5), + ov-re-sparse.cc (octave_sparse_matrix::load_hdf5), + ov-re-sparse.h (octave_sparse_matrix::load_hdf5), + ov-scalar.cc (octave_scalar::load_hdf5), + ov-scalar.h (octave_scalar::load_hdf5), + ov-str-mat.cc (octave_char_matrix_str::load_hdf5), + ov-str-mat.h (octave_char_matrix_str::load_hdf5), + ov-struct.cc (octave_struct::load_hdf5), + ov-struct.h (octave_struct::load_hdf5), + ov.h (octave_value::load_hdf5): + Remove have_hg5iterate_bug from the call to load_hdf5. + * ov-cell.cc (octave_bool::load_hdf5), + ov-class.cc (octave_class::load_hdf5), + ov-fcn-handle.cc (octave_fcn_handle::load_hdf5), + ov-list.cc (octave_list::load_hdf5), + ov-struct.cc (octave_struct::load_hdf5): + Remove HAVE_H5GGET_NUM_OBJS cruft for old hdf5 versions. + 2009-11-27 David Bateman <dbateman@free.fr> * DLD-FUNCTIONS/urlwrite.cc (curl_handle, curl_handles): Add classes
--- a/src/ls-hdf5.cc +++ b/src/ls-hdf5.cc @@ -177,11 +177,6 @@ return type_id; } -// This variable, set in read_hdf5_data(), tells whether we are using -// a version of HDF5 with a buggy H5Giterate (i.e. which neglects to -// increment the index parameter to the next unread item). -static bool have_h5giterate_bug = false; - // This function is designed to be passed to H5Giterate, which calls it // on each data item in an HDF5 file. For the item whose name is NAME in // the group GROUP_ID, this function sets dv->tc to an Octave representation @@ -271,8 +266,7 @@ d->tc = octave_value_typeinfo::lookup_type (typ); - retval = (d->tc.load_hdf5 (subgroup_id, "value", - have_h5giterate_bug) ? 1 : -1); + retval = (d->tc.load_hdf5 (subgroup_id, "value") ? 1 : -1); // check for OCTAVE_GLOBAL attribute: d->global = hdf5_check_attr (subgroup_id, "OCTAVE_GLOBAL"); @@ -295,8 +289,7 @@ H5Gclose (subgroup_id); - retval = (d->tc.load_hdf5 (group_id, name, have_h5giterate_bug) - ? 1 : -1); + retval = (d->tc.load_hdf5 (group_id, name) ? 1 : -1); } } @@ -471,8 +464,7 @@ H5Tclose (type_id); H5Dclose (data_id); - retval = (d->tc.load_hdf5 (group_id, name, have_h5giterate_bug) - ? 1 : -1); + retval = (d->tc.load_hdf5 (group_id, name) ? 1 : -1); } if (!ident_valid) @@ -528,39 +520,16 @@ hdf5_ifstream& hs = dynamic_cast<hdf5_ifstream&> (is); hdf5_callback_data d; - // Versions of HDF5 prior to 1.2.2 had a bug in H5Giterate where it - // would return the index of the last item processed instead of the - // next item to be processed, forcing us to increment the index manually. - - unsigned int vers_major, vers_minor, vers_release; - - H5get_libversion (&vers_major, &vers_minor, &vers_release); - - // FIXME -- this test looks wrong. - have_h5giterate_bug - = (vers_major < 1 - || (vers_major == 1 && (vers_minor < 2 - || (vers_minor == 2 && vers_release < 2)))); - herr_t H5Giterate_retval = -1; -#ifdef HAVE_H5GGET_NUM_OBJS hsize_t num_obj = 0; hid_t group_id = H5Gopen (hs.file_id, "/"); H5Gget_num_objs (group_id, &num_obj); H5Gclose (group_id); if (hs.current_item < static_cast<int> (num_obj)) -#endif H5Giterate_retval = H5Giterate (hs.file_id, "/", &hs.current_item, hdf5_read_next_data, &d); - if (have_h5giterate_bug) - { - // H5Giterate sets current_item to the last item processed; we want - // the index of the next item (for the next call to read_hdf5_data) - - hs.current_item++; - } if (H5Giterate_retval > 0) {
--- a/src/ov-base-int.cc +++ b/src/ov-base-int.cc @@ -370,8 +370,7 @@ template <class T> bool -octave_base_int_matrix<T>::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_base_int_matrix<T>::load_hdf5 (hid_t loc_id, const char *name) { hid_t save_type_hid = HDF5_SAVE_TYPE; bool retval = false; @@ -560,8 +559,7 @@ template <class T> bool -octave_base_int_scalar<T>::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_base_int_scalar<T>::load_hdf5 (hid_t loc_id, const char *name) { hid_t save_type_hid = HDF5_SAVE_TYPE; hid_t data_hid = H5Dopen (loc_id, name);
--- a/src/ov-base-int.h +++ b/src/ov-base-int.h @@ -79,7 +79,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif }; @@ -122,7 +122,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool ); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif };
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -1042,7 +1042,7 @@ } bool -octave_base_value::load_hdf5 (hid_t, const char *, bool) +octave_base_value::load_hdf5 (hid_t, const char *) { gripe_wrong_type_arg ("octave_base_value::load_binary()", type_name ());
--- a/src/ov-base.h +++ b/src/ov-base.h @@ -593,7 +593,7 @@ save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); virtual bool - load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + load_hdf5 (hid_t loc_id, const char *name); #endif virtual int
--- a/src/ov-bool-mat.cc +++ b/src/ov-bool-mat.cc @@ -458,8 +458,7 @@ } bool -octave_bool_matrix::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_bool_matrix::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false;
--- a/src/ov-bool-mat.h +++ b/src/ov-bool-mat.h @@ -196,7 +196,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-bool-sparse.cc +++ b/src/ov-bool-sparse.cc @@ -510,8 +510,7 @@ } bool -octave_sparse_bool_matrix::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_sparse_bool_matrix::load_hdf5 (hid_t loc_id, const char *name) { octave_idx_type nr, nc, nz; hid_t group_hid, data_hid, space_hid;
--- a/src/ov-bool-sparse.h +++ b/src/ov-bool-sparse.h @@ -134,7 +134,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif mxArray *as_mxArray (void) const;
--- a/src/ov-bool.cc +++ b/src/ov-bool.cc @@ -190,8 +190,7 @@ } bool -octave_bool::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_bool::load_hdf5 (hid_t loc_id, const char *name) { hid_t data_hid = H5Dopen (loc_id, name); hid_t space_id = H5Dget_space (data_hid);
--- a/src/ov-bool.h +++ b/src/ov-bool.h @@ -197,7 +197,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-cell.cc +++ b/src/ov-cell.cc @@ -1104,8 +1104,7 @@ } bool -octave_cell::load_hdf5 (hid_t loc_id, const char *name, - bool have_h5giterate_bug) +octave_cell::load_hdf5 (hid_t loc_id, const char *name) { clear_cellstr_cache (); @@ -1166,24 +1165,17 @@ int current_item = 0; - if (have_h5giterate_bug) - current_item = 1; // Skip dims items in group. - -#ifdef HAVE_H5GGET_NUM_OBJS hsize_t num_obj = 0; group_id = H5Gopen (loc_id, name); H5Gget_num_objs (group_id, &num_obj); H5Gclose (group_id); -#endif for (octave_idx_type i = 0; i < dv.numel (); i++) { -#ifdef HAVE_H5GGET_NUM_OBJS if (current_item >= static_cast<int> (num_obj)) - retval2 = -1; + retval2 = -1; else -#endif retval2 = H5Giterate (loc_id, name, ¤t_item, hdf5_read_next_data, &dsub); @@ -1193,9 +1185,6 @@ octave_value ov = dsub.tc; m.elem (i) = ov; - if (have_h5giterate_bug) - current_item++; // H5Giterate returned the last index processed. - } if (retval2 >= 0)
--- a/src/ov-cell.h +++ b/src/ov-cell.h @@ -152,7 +152,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif octave_value map (unary_mapper_t umap) const;
--- a/src/ov-class.cc +++ b/src/ov-class.cc @@ -1471,8 +1471,7 @@ } bool -octave_class::load_hdf5 (hid_t loc_id, const char *name, - bool have_h5giterate_bug) +octave_class::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false; @@ -1548,7 +1547,6 @@ reconstruct_exemplar (); -#ifdef HAVE_H5GGET_NUM_OBJS subgroup_hid = H5Gopen (group_hid, name); H5Gget_num_objs (subgroup_hid, &num_obj); H5Gclose (subgroup_hid); @@ -1556,10 +1554,6 @@ while (current_item < static_cast<int> (num_obj) && (retval2 = H5Giterate (group_hid, name, ¤t_item, hdf5_read_next_data, &dsub)) > 0) -#else - while ((retval2 = H5Giterate (group_hid, name, ¤t_item, - hdf5_read_next_data, &dsub)) > 0) -#endif { octave_value t2 = dsub.tc; @@ -1573,8 +1567,6 @@ m.assign (dsub.name, tcell); - if (have_h5giterate_bug) - current_item++; // H5Giterate returned the last index processed } if (retval2 >= 0)
--- a/src/ov-class.h +++ b/src/ov-class.h @@ -170,7 +170,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif mxArray *as_mxArray (void) const;
--- a/src/ov-complex.cc +++ b/src/ov-complex.cc @@ -341,8 +341,7 @@ } bool -octave_complex::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_complex::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false; hid_t data_hid = H5Dopen (loc_id, name);
--- a/src/ov-complex.h +++ b/src/ov-complex.h @@ -172,7 +172,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-cx-mat.cc +++ b/src/ov-cx-mat.cc @@ -615,8 +615,7 @@ } bool -octave_complex_matrix::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_complex_matrix::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false;
--- a/src/ov-cx-mat.h +++ b/src/ov-cx-mat.h @@ -154,7 +154,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-cx-sparse.cc +++ b/src/ov-cx-sparse.cc @@ -599,8 +599,7 @@ } bool -octave_sparse_complex_matrix::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_sparse_complex_matrix::load_hdf5 (hid_t loc_id, const char *name) { octave_idx_type nr, nc, nz; hid_t group_hid, data_hid, space_hid;
--- a/src/ov-cx-sparse.h +++ b/src/ov-cx-sparse.h @@ -148,7 +148,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif mxArray *as_mxArray (void) const;
--- a/src/ov-fcn-handle.cc +++ b/src/ov-fcn-handle.cc @@ -839,8 +839,7 @@ } bool -octave_fcn_handle::load_hdf5 (hid_t loc_id, const char *name, - bool have_h5giterate_bug) +octave_fcn_handle::load_hdf5 (hid_t loc_id, const char *name) { bool success = true; @@ -1020,7 +1019,6 @@ if (len > 0 && success) { -#ifdef HAVE_H5GGET_NUM_OBJS hsize_t num_obj = 0; data_hid = H5Gopen (group_hid, "symbol table"); H5Gget_num_objs (data_hid, &num_obj); @@ -1031,7 +1029,6 @@ error ("load: failed to load anonymous function handle"); success = false; } -#endif if (! error_state) { @@ -1047,9 +1044,6 @@ break; } - if (have_h5giterate_bug) - current_item++; // H5Giterate returns last index processed - symbol_table::varref (dsub.name, local_scope) = dsub.tc; } }
--- a/src/ov-fcn-handle.h +++ b/src/ov-fcn-handle.h @@ -118,7 +118,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif void print (std::ostream& os, bool pr_as_read_syntax = false) const;
--- a/src/ov-fcn-inline.cc +++ b/src/ov-fcn-inline.cc @@ -389,8 +389,7 @@ } bool -octave_fcn_inline::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_fcn_inline::load_hdf5 (hid_t loc_id, const char *name) { hid_t group_hid, data_hid, space_hid, type_hid, type_class_hid, st_id; hsize_t rank;
--- a/src/ov-fcn-inline.h +++ b/src/ov-fcn-inline.h @@ -81,7 +81,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif void print (std::ostream& os, bool pr_as_read_syntax = false) const;
--- a/src/ov-float.cc +++ b/src/ov-float.cc @@ -209,8 +209,7 @@ } bool -octave_float_scalar::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_float_scalar::load_hdf5 (hid_t loc_id, const char *name) { hid_t data_hid = H5Dopen (loc_id, name); hid_t space_id = H5Dget_space (data_hid);
--- a/src/ov-float.h +++ b/src/ov-float.h @@ -231,7 +231,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-flt-complex.cc +++ b/src/ov-flt-complex.cc @@ -326,8 +326,7 @@ } bool -octave_float_complex::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_float_complex::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false; hid_t data_hid = H5Dopen (loc_id, name);
--- a/src/ov-flt-complex.h +++ b/src/ov-flt-complex.h @@ -170,7 +170,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-flt-cx-mat.cc +++ b/src/ov-flt-cx-mat.cc @@ -582,8 +582,7 @@ } bool -octave_float_complex_matrix::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_float_complex_matrix::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false;
--- a/src/ov-flt-cx-mat.h +++ b/src/ov-flt-cx-mat.h @@ -152,7 +152,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-flt-re-mat.cc +++ b/src/ov-flt-re-mat.cc @@ -595,8 +595,7 @@ } bool -octave_float_matrix::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_float_matrix::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false;
--- a/src/ov-flt-re-mat.h +++ b/src/ov-flt-re-mat.h @@ -188,7 +188,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-list.cc +++ b/src/ov-list.cc @@ -712,8 +712,7 @@ } bool -octave_list::load_hdf5 (hid_t loc_id, const char *name, - bool have_h5giterate_bug) +octave_list::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false; @@ -722,7 +721,6 @@ herr_t retval2 = -1; octave_value_list lst; int current_item = 0; -#ifdef HAVE_H5GGET_NUM_OBJS hsize_t num_obj = 0; hid_t group_id = H5Gopen (loc_id, name); H5Gget_num_objs (group_id, &num_obj); @@ -731,15 +729,8 @@ while (current_item < static_cast<int> (num_obj) && (retval2 = H5Giterate (loc_id, name, ¤t_item, hdf5_read_next_data, &dsub)) > 0) -#else - while ((retval2 = H5Giterate (loc_id, name, ¤t_item, - hdf5_read_next_data, &dsub)) > 0) -#endif { lst.append (dsub.tc); - - if (have_h5giterate_bug) - current_item++; // H5Giterate returned the last index processed } if (retval2 >= 0)
--- a/src/ov-list.h +++ b/src/ov-list.h @@ -111,7 +111,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif protected:
--- a/src/ov-range.cc +++ b/src/ov-range.cc @@ -488,8 +488,7 @@ } bool -octave_range::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_range::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false;
--- a/src/ov-range.h +++ b/src/ov-range.h @@ -278,7 +278,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-re-mat.cc +++ b/src/ov-re-mat.cc @@ -623,8 +623,7 @@ } bool -octave_matrix::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_matrix::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false;
--- a/src/ov-re-mat.h +++ b/src/ov-re-mat.h @@ -202,7 +202,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-re-sparse.cc +++ b/src/ov-re-sparse.cc @@ -597,8 +597,7 @@ } bool -octave_sparse_matrix::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_sparse_matrix::load_hdf5 (hid_t loc_id, const char *name) { octave_idx_type nr, nc, nz; hid_t group_hid, data_hid, space_hid;
--- a/src/ov-re-sparse.h +++ b/src/ov-re-sparse.h @@ -147,7 +147,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif mxArray *as_mxArray (void) const;
--- a/src/ov-scalar.cc +++ b/src/ov-scalar.cc @@ -224,8 +224,7 @@ } bool -octave_scalar::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_scalar::load_hdf5 (hid_t loc_id, const char *name) { hid_t data_hid = H5Dopen (loc_id, name); hid_t space_id = H5Dget_space (data_hid);
--- a/src/ov-scalar.h +++ b/src/ov-scalar.h @@ -232,7 +232,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-str-mat.cc +++ b/src/ov-str-mat.cc @@ -585,8 +585,7 @@ } bool -octave_char_matrix_str::load_hdf5 (hid_t loc_id, const char *name, - bool /* have_h5giterate_bug */) +octave_char_matrix_str::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false;
--- a/src/ov-str-mat.h +++ b/src/ov-str-mat.h @@ -152,7 +152,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif int write (octave_stream& os, int block_size,
--- a/src/ov-struct.cc +++ b/src/ov-struct.cc @@ -1518,8 +1518,7 @@ } bool -octave_struct::load_hdf5 (hid_t loc_id, const char *name, - bool have_h5giterate_bug) +octave_struct::load_hdf5 (hid_t loc_id, const char *name) { bool retval = false; @@ -1528,7 +1527,6 @@ herr_t retval2 = 0; Octave_map m (dim_vector (1, 1)); int current_item = 0; -#ifdef HAVE_H5GGET_NUM_OBJS hsize_t num_obj = 0; hid_t group_id = H5Gopen (loc_id, name); H5Gget_num_objs (group_id, &num_obj); @@ -1540,10 +1538,6 @@ while (current_item < static_cast<int> (num_obj) && (retval2 = H5Giterate (loc_id, name, ¤t_item, hdf5_read_next_data, &dsub)) > 0) -#else - while ((retval2 = H5Giterate (loc_id, name, ¤t_item, - hdf5_read_next_data, &dsub)) > 0) -#endif { octave_value t2 = dsub.tc; @@ -1557,8 +1551,6 @@ m.assign (dsub.name, tcell); - if (have_h5giterate_bug) - current_item++; // H5Giterate returned the last index processed } if (retval2 >= 0)
--- a/src/ov-struct.h +++ b/src/ov-struct.h @@ -142,7 +142,7 @@ #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); - bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); + bool load_hdf5 (hid_t loc_id, const char *name); #endif mxArray *as_mxArray (void) const;
--- a/src/ov.h +++ b/src/ov.h @@ -1029,9 +1029,8 @@ bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) { return rep->save_hdf5 (loc_id, name, save_as_floats); } - bool load_hdf5 (hid_t loc_id, const char *name, - bool have_h5giterate_bug) - { return rep->load_hdf5 (loc_id, name, have_h5giterate_bug); } + bool load_hdf5 (hid_t loc_id, const char *name) + { return rep->load_hdf5 (loc_id, name); } #endif int write (octave_stream& os, int block_size,