changeset 14323:ec99c8c185be

maint: periodic merge of stable to default
author John W. Eaton <jwe@octave.org>
date Fri, 03 Feb 2012 19:16:01 -0500
parents 17de694961f5 (current diff) 45f5a5d5656f (diff)
children 5a2b012b10c7
files configure.ac scripts/io/strread.m scripts/plot/semilogx.m src/graphics.cc
diffstat 6 files changed, 60 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac
+++ b/configure.ac
@@ -649,7 +649,7 @@
 
 OCTAVE_CHECK_LIBRARY(qhull, QHull,
   [Qhull library not found -- this will result in loss of functionality of some geometry functions.],
-  [qhull/libqhull.h libqhull.h qhull/qhull.h qhull.h], [qh_qhull], [], [],
+  [libqhull/libqhull.h qhull/libqhull.h libqhull.h qhull/qhull.h qhull.h], [qh_qhull], [], [],
   [warn_qhull=
    OCTAVE_CHECK_QHULL_VERSION
    OCTAVE_CHECK_QHULL_OK([TEXINFO_QHULL="@set HAVE_QHULL"
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -937,7 +937,13 @@
     octave_cv_lib_qhull_version,  [
       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <stdio.h>
-#if defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
+#if defined (HAVE_LIBQHULL_LIBQHULL_H)
+# include <libqhull/libqhull.h>
+# include <libqhull/qset.h>
+# include <libqhull/geom.h>
+# include <libqhull/poly.h>
+# include <libqhull/io.h>
+#elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
 # if defined (HAVE_QHULL_LIBQHULL_H)
 #  include <qhull/libqhull.h>
 # else
@@ -974,7 +980,13 @@
     octave_cv_lib_qhull_ok, [
       AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <stdio.h>
-#if defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
+#if defined (HAVE_LIBQHULL_LIBQHULL_H)
+# include <libqhull/libqhull.h>
+# include <libqhull/qset.h>
+# include <libqhull/geom.h>
+# include <libqhull/poly.h>
+# include <libqhull/io.h>
+#elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
 # if defined (HAVE_QHULL_LIBQHULL_H)
 #  include <qhull/libqhull.h>
 # else
--- a/scripts/io/strread.m
+++ b/scripts/io/strread.m
@@ -439,14 +439,13 @@
       iwrd = 1; iwrdp = 0; iwrdl = length (words{iwrd});
       for ii = 1:numel (fmt_words)
 
+        nxt_wrd = 0;
+
         if (idf(ii))
           ## Literal expected
           if (isempty (strfind (fmt_words{ii}, words(iwrd))))
             ## Not found in current word; supposed to be in next word
-            ++iwrd; iwrdp = 0;
-            if (ii < numel (fmt_words))
-              iwrdl = length (words{iwrd});
-            endif
+            nxt_wrd = 1;
           else
             ## Found it in current word.  Subtract literal length
             iwrdp += length (fmt_words{ii});
@@ -455,34 +454,28 @@
               warning ("strread: literal '%s' (fmt spec # %d) does not match data", ...
                 fmt_words{ii}, ii);
               ## Word assumed to be completely "used up". Next word
-              ++iwrd; iwrdp = 0;
-              if (ii < numel (fmt_words))
-                iwrdl = length (words{iwrd});
-              endif
+              nxt_wrd = 1;
             elseif (iwrdp == iwrdl)
               ## Word completely "used up". Next word
-              ++iwrd; iwrdp = 0;
-              if (ii < numel (fmt_words))
-                iwrdl = length (words{iwrd});
-              endif
+              nxt_wrd = 1;
             endif
           endif
 
         elseif (idg(ii))
           ## Fixed width specifier (%N or %*N): read just a part of word
-            iwrdp += floor ...
-             (str2double (fmt_words{ii}(regexp(fmt_words{ii}, '\d') : end-1)));
-            if (iwrdp > iwrdl)
-              ## Match error. Field extends beyond word boundary.
-              warning  ...
-              ("strread: field width '%s' (fmt spec # %d) extends beyond actual word limit", ...
-                 fmt_words{ii}, ii);
-              ## Assume word to be completely "used up".  Next word
-              ++iwrd; iwrdp = 0; iwrdl = length (words{iwrd});
-            elseif (iwrdp == iwrdl)
-              ## Word completely "used up".  Next word
-              ++iwrd; iwrdp = 0; iwrdl = length (words{iwrd});
-            endif
+          iwrdp += floor ...
+           (str2double (fmt_words{ii}(regexp(fmt_words{ii}, '\d') : end-1)));
+          if (iwrdp > iwrdl)
+            ## Match error. Field extends beyond word boundary.
+            warning  ...
+            ("strread: field width '%s' (fmt spec # %d) extends beyond actual word limit", ...
+               fmt_words{ii}, ii);
+            ## Assume word to be completely "used up".  Next word
+            nxt_wrd = 1;
+          elseif (iwrdp == iwrdl)
+            ## Word completely "used up".  Next word
+            nxt_wrd = 1;
+          endif
 
         else
           ## A simple format conv. specifier. Either (1) uses rest of word, or
@@ -492,20 +485,25 @@
             ## Next fmt_word is a literal...
             if (! index (words{iwrd}(iwrdp+1:end), fmt_words{ii+1}))
               ## ...but not found in current word => field uses rest of word
-              ++iwrd; iwrdp = 0; iwrdl = length (words{iwrd});
+              nxt_wrd = 1;
             else
               ## ..or it IS found.  Add inferred width of current conversion field
               iwrdp += index (words{iwrd}(iwrdp+1:end), fmt_words{ii+1}) - 1;
             endif
           elseif (iwrdp < iwrdl)
             ## No bordering literal to the right => field occupies (rest of) word
-            ++iwrd; iwrdp = 0;
-            if (ii < numel (fmt_words))
-              iwrdl = length (words{iwrd});
-            endif
+            nxt_wrd = 1;
           endif
 
         endif
+
+        if (nxt_wrd)
+          ++iwrd; iwrdp = 0;
+          if (ii < numel (fmt_words))
+            iwrdl = length (words{iwrd});
+          endif
+        endif
+
       endfor
       ## Done
       words_period = max (iwrd - 1, 1);
@@ -670,7 +668,7 @@
               k++;
             case "s"
               if (pad_out)
-                data(end+1:num_lines) = {""}
+                data(end+1:num_lines) = {""};
               endif
               varargout{k} = strtrunc (data, swidth)';
               k++;
--- a/scripts/plot/semilogx.m
+++ b/scripts/plot/semilogx.m
@@ -112,11 +112,11 @@
 %!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
-%!   a = logspace (-5, 1, 10);
-%!   b =-logspace (-5, 1, 10);
+%!   a =-logspace (-5, 1, 10);
+%!   b = logspace (-5, 1, 10);
 %!   semilogx (a, b);
 %!   axis tight;
-%!   assert (all (get (gca, "ytick") < 0));
+%!   assert (all (get (gca, "xtick") < 0));
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
--- a/src/DLD-FUNCTIONS/oct-qhull.h
+++ b/src/DLD-FUNCTIONS/oct-qhull.h
@@ -27,7 +27,13 @@
 
 extern "C" {
 
-#if defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
+#if defined (HAVE_LIBQHULL_LIBQHULL_H)
+# include <libqhull/libqhull.h>
+# include <libqhull/qset.h>
+# include <libqhull/geom.h>
+# include <libqhull/poly.h>
+# include <libqhull/io.h>
+#elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
 # if defined (HAVE_QHULL_LIBQHULL_H)
 #  include <qhull/libqhull.h>
 # else
--- a/src/graphics.cc
+++ b/src/graphics.cc
@@ -5995,7 +5995,7 @@
 
   ticks = tmp_ticks;
 
-  int n = is_logscale ? 9 : 4;
+  int n = is_logscale ? 8 : 4;
   Matrix tmp_mticks (1, n * (tmp_ticks.numel () - 1));
 
   for (int i = 0; i < tmp_ticks.numel ()-1; i++)
@@ -6632,8 +6632,11 @@
   double max_neg_y = -octave_Inf;
   get_children_limits (miny, maxy, min_pos_y, max_neg_y, kids, 'y');
 
-  xlims = do_zoom (x, factor, xlims, xscale_is ("log"));
-  ylims = do_zoom (y, factor, ylims, yscale_is ("log"));
+  if (! xscale_is ("log"))
+    xlims = do_zoom (x, factor, xlims, xscale_is ("log"));
+
+  if (! yscale_is ("log"))
+    ylims = do_zoom (y, factor, ylims, yscale_is ("log"));
 
   zoom (xlims, ylims, push_to_zoom_stack);
 }