changeset 19379:2a790328fc50 gui-release

maint: Periodic merge of stable to gui-release.
author Rik <rik@octave.org>
date Sat, 22 Nov 2014 20:19:23 -0800
parents cd2a75e5cd6e (current diff) 88847d5d1a96 (diff)
children 112fc552ea22 c364b9a44580
files configure.ac libinterp/corefcn/error.cc test/io.tst
diffstat 4 files changed, 30 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Thu Nov 13 07:02:33 2014 +0100
+++ b/configure.ac	Sat Nov 22 20:19:23 2014 -0800
@@ -928,8 +928,7 @@
   [FFTW3F library not found.  The slower FFTPACK library will be used instead.],
   [fftw3.h], [fftwf_plan_dft_1d])
 
-## Check for the multithreaded FFTW library.
-## Fallback to singlethreaded if not found or disabled
+## Check command line for the option to disable multi-threaded FFTW
 build_fftw_threads=yes
 AC_ARG_ENABLE([fftw-threads],
   [AS_HELP_STRING([--disable-fftw-threads],
@@ -939,19 +938,25 @@
    fi],
   [])
 
-if test $build_fftw_threads = yes; then
-  OCTAVE_CHECK_FFTW_THREADS(fftw3, fftw_plan_with_nthreads)
-  OCTAVE_CHECK_FFTW_THREADS(fftw3f, fftwf_plan_with_nthreads)
-fi
-
-## Octave is currently unable to use FFTW unless both float
-## and double versions are available.
+## Octave is currently unable to use FFTW unless
+## both float and double versions are available.
 
 AM_CONDITIONAL([AMCOND_HAVE_FFTW],
   [test -n "$FFTW3_LIBS" && test -n "$FFTW3F_LIBS"])
 
 if test -n "$FFTW3_LIBS" && test -n "$FFTW3F_LIBS"; then
   AC_DEFINE(HAVE_FFTW, 1, [Define if you have both FFTW3 and FFTW3F libraries.])
+else
+  ## --without-fftw3 given, or one of the FFTW3 libs not installed.
+  ## Don't check for FFTW threads as this is now pointless.
+  build_fftw_threads=no
+fi
+
+## Check for the multithreaded FFTW library.
+## Fallback to singlethreaded if not found or disabled
+if test $build_fftw_threads = yes; then
+  OCTAVE_CHECK_FFTW_THREADS(fftw3, fftw_plan_with_nthreads)
+  OCTAVE_CHECK_FFTW_THREADS(fftw3f, fftwf_plan_with_nthreads)
 fi
 
 ## Subdirectory of liboctave/cruft to build if FFTW is not found.
--- a/libinterp/corefcn/error.cc	Thu Nov 13 07:02:33 2014 +0100
+++ b/libinterp/corefcn/error.cc	Sat Nov 22 20:19:23 2014 -0800
@@ -1029,7 +1029,7 @@
 control will return to the top level without evaluating any more\n\
 commands.  This is useful for aborting from functions or scripts.\n\
 \n\
-If the error message does not end with a new line character, Octave will\n\
+If the error message does not end with a newline character, Octave will\n\
 print a traceback of all the function calls leading to the error.  For\n\
 example, given the following function definitions:\n\
 \n\
@@ -1057,10 +1057,10 @@
 @end group\n\
 @end example\n\
 \n\
-If the error message ends in a new line character, Octave will print the\n\
+If the error message ends in a newline character, Octave will print the\n\
 message but will not display any traceback messages as it returns\n\
 control to the top level.  For example, modifying the error message\n\
-in the previous example to end in a new line causes Octave to only print\n\
+in the previous example to end in a newline causes Octave to only print\n\
 a single message:\n\
 \n\
 @example\n\
@@ -1093,7 +1093,7 @@
 which will only stop execution if an error has been found.\n\
 \n\
 Implementation Note: For compatibility with @sc{matlab}, escape\n\
-sequences (e.g., @qcode{\"\\n\"} => newline) are processed in @var{template}\n\
+sequences (e.g., \"\\n\" => newline) are processed in @var{template}\n\
 regardless of whether @var{template} has been defined within single quotes\n\
 as long as there are two or more input arguments.\n\
 Use a second backslash to stop interpolation of the escape sequence (e.g.,\n\
@@ -1271,7 +1271,7 @@
 workspace.\n\
 \n\
 Implementation Note: For compatibility with @sc{matlab}, escape\n\
-sequences (e.g., @qcode{\"\\n\"} => newline) are processed in @var{template}\n\
+sequences (e.g., \"\\n\" => newline) are processed in @var{template}\n\
 regardless of whether @var{template} has been defined within single quotes\n\
 as long as there are two or more input arguments.\n\
 Use a second backslash to stop interpolation of the escape sequence (e.g.,\n\
--- a/libinterp/corefcn/oct-stream.cc	Thu Nov 13 07:02:33 2014 +0100
+++ b/libinterp/corefcn/oct-stream.cc	Sat Nov 22 20:19:23 2014 -0800
@@ -3330,6 +3330,8 @@
                 {
                   if (count % nr != 0)
                     nc = count / nr + 1;
+                  else
+                    nc = count / nr;
 
                   if (count < nr)
                     nr = count;
--- a/test/io.tst	Thu Nov 13 07:02:33 2014 +0100
+++ b/test/io.tst	Sat Nov 22 20:19:23 2014 -0800
@@ -609,3 +609,12 @@
 %! assert (data, [256, 1798; 770, 3083; 1284, 3597]);
 %! assert (count, 6);
 %! fclose (id);
+
+%!test
+%! id = tmpfile ();
+%! fwrite (id, "abcd");
+%! frewind (id);
+%! [data, count] = fread (id, [2, 3], "char");
+%! assert (data, [97, 99; 98, 100]);
+%! assert (count, 4);
+%! fclose (id);