changeset 3695:64ca92e02a7e

[project @ 2000-07-14 18:49:06 by jwe]
author jwe
date Fri, 14 Jul 2000 18:49:08 +0000
parents 48415caaea35
children 5a7174ebc684
files scripts/ChangeLog scripts/strings/strcmp.m src/ChangeLog src/Makefile.in src/load-save.cc src/octave.cc
diffstat 6 files changed, 57 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Fri Jul 07 21:32:32 2000 +0000
+++ b/scripts/ChangeLog	Fri Jul 14 18:49:08 2000 +0000
@@ -1,3 +1,8 @@
+2000-07-14  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* strings/strcmp.m: Return 0 instead of an error if row and column
+	dimensions don't match.
+
 2000-06-30  Kai Habel  <kahacjde@calvados.zrz.TU-Berlin.DE>
 
 	* plot/hist.m: Allow 3 argument form to work.
--- a/scripts/strings/strcmp.m	Fri Jul 07 21:32:32 2000 +0000
+++ b/scripts/strings/strcmp.m	Fri Jul 14 18:49:08 2000 +0000
@@ -36,9 +36,9 @@
 
   status = 0;
   if (isstr (s1) && isstr(s2))
-    c1 = columns (s1);
-    c2 = columns (s2);
-    if (c1 == c2)
+    [r1, c1] = size (s1);
+    [r2, c2] = size (s2);
+    if (r1 == r2 && c1 == c2)
       if (c1 == 0)
         status = 1;
       else
--- a/src/ChangeLog	Fri Jul 07 21:32:32 2000 +0000
+++ b/src/ChangeLog	Fri Jul 14 18:49:08 2000 +0000
@@ -1,3 +1,18 @@
+2000-07-14  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* Makefile.in (octave): Link to ../libcruft/blas-xtra/xerbla.o here.
+
+	* octave.cc (main): Remove kluge to attempt linking our version of
+	xerbla.
+
+2000-07-07  Steven G. Johnson  <stevenj@alum.mit.edu>
+
+	* load-save.cc (have_h5giterate_bug): New file-scope variable.
+	(hdf5_read_next_data): Only increment current_item if
+	have_h5giterate_bug is true.
+	(read_hdf5_data): Set have_h5giterate_bug here.
+	Only increment hs.current_item if have_h5giterate_bug is true.
+
 2000-07-05  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* c-file-ptr-stream.cc (c_file_ptr_buf::close):
--- a/src/Makefile.in	Fri Jul 07 21:32:32 2000 +0000
+++ b/src/Makefile.in	Fri Jul 14 18:49:08 2000 +0000
@@ -211,17 +211,22 @@
 
 objects: $(OBJECTS)
 
+XERBLA = ../libcruft/blas-xtra/xerbla.o
+
 ifeq ($(SHARED_LIBS), true)
   ifeq ($(STATIC_LIBS), true)
     LIBRARIES = liboctinterp.$(LIBEXT) liboctinterp.$(SHLEXT)
   else
     LIBRARIES = liboctinterp.$(SHLEXT)
+    XERBLA = ../libcruft/blas-xtra/pic/xerbla.o
   endif
 else
   ifeq ($(STATIC_LIBS), true)
     LIBRARIES = liboctinterp.$(LIBEXT)
   else
+    ## This is not going to work, but hey, you asked for it...
     LIBRARIES =
+    XERBLA =
   endif
 endif
 
@@ -254,7 +259,7 @@
 	octave.o builtins.o ops.o $(DLD_STATIC_OBJ)
 	$(CXX) $(CPPFLAGS) $(ALL_CXXFLAGS) $(RDYNAMIC_FLAG) \
 	$(ALL_LDFLAGS) -o octave \
-	octave.o builtins.o ops.o $(DLD_STATIC_OBJ) \
+	octave.o builtins.o ops.o $(XERBLA) $(DLD_STATIC_OBJ) \
 	$(OCTAVE_LFLAGS) \
 	$(OCTAVE_LIBS) \
 	$(LEXLIB) $(TERMLIBS) $(BLAS_LIBS) $(LIBS) $(FLIBS)
--- a/src/load-save.cc	Fri Jul 07 21:32:32 2000 +0000
+++ b/src/load-save.cc	Fri Jul 14 18:49:08 2000 +0000
@@ -1307,6 +1307,11 @@
   bool import;
 };
 
+// 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
@@ -1688,7 +1693,8 @@
 	  if (dsub.doc)
 	    delete [] dsub.doc;
 
-	  current_item++;  // H5Giterate returned the last index processed
+	  if (have_h5giterate_bug)
+	    current_item++;  // H5Giterate returned the last index processed
 	}
 
       if (retval2 < 0)
@@ -1799,12 +1805,30 @@
   d.range_type = hdf5_make_range_type (H5T_NATIVE_DOUBLE);
   d.import = import;
 
+  // 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);
+
+  // XXX FIXME XXX -- this test looks wrong.
+  have_h5giterate_bug
+    = (vers_major < 1
+       || (vers_major == 1 && (vers_minor < 2
+			       || (vers_minor == 2 && vers_release < 2))));
+
   herr_t retval = H5Giterate (hs.file_id, "/", &hs.current_item,
 			      hdf5_read_next_data, &d);
 
-  // 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 (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 (retval > 0)
     {
--- a/src/octave.cc	Fri Jul 07 21:32:32 2000 +0000
+++ b/src/octave.cc	Fri Jul 14 18:49:08 2000 +0000
@@ -582,17 +582,6 @@
     retval = 0;
 
   clean_up_and_exit (retval);
-
-  // The following code should never be reached.  It is a hack to make
-  // sure that the xerbla.f from libcruft/blas-xtra is linked with
-  // octave, in preference to the xerbla function from any standard
-  // BLAS that we link to.
-
-  // XXX FIXME XXX -- this may not work on some systems if libcruft
-  // and the external blas libraries are both shared libraries.
-
-  if (retval < 0)
-    F77_FCN (xerbla, XERBLA) ("foobar", 0);
 }
 
 /*