# HG changeset patch # User Markus Mützel # Date 1640435897 -3600 # Node ID 00d82e792b8bd5ada9901515450f633a0bd7f00b # Parent 85c0a085ded75ef8838a4d7650c683c81f5b6b3c# Parent b876de975edf8ace4dffc3b6c9388d91d3f8ef3f maint: merge stable to default. diff -r b876de975edf -r 00d82e792b8b Makefile.am diff -r b876de975edf -r 00d82e792b8b configure.ac --- a/configure.ac Sat Dec 25 12:36:11 2021 +0100 +++ b/configure.ac Sat Dec 25 13:38:17 2021 +0100 @@ -27,7 +27,7 @@ ### Initialize Autoconf AC_PREREQ([2.65]) -AC_INIT([GNU Octave], [7.0.1], [https://octave.org/bugs.html], [octave], +AC_INIT([GNU Octave], [8.0.0], [https://octave.org/bugs.html], [octave], [https://www.gnu.org/software/octave/]) ### Declare version numbers @@ -39,9 +39,9 @@ ## explains how to update these numbers for release and development ## versions. -OCTAVE_MAJOR_VERSION=7 +OCTAVE_MAJOR_VERSION=8 OCTAVE_MINOR_VERSION=0 -OCTAVE_PATCH_VERSION=1 +OCTAVE_PATCH_VERSION=0 dnl PACKAGE_VERSION is set by the AC_INIT VERSION argument. OCTAVE_VERSION="$PACKAGE_VERSION" @@ -2658,10 +2658,10 @@ ### Determine whether libraries should be linked with visibility attributes -ENABLE_LIB_VISIBILITY_FLAGS=no +ENABLE_LIB_VISIBILITY_FLAGS=yes AC_ARG_ENABLE(lib-visibility-flags, - [AS_HELP_STRING([--enable-lib-visibility-flags], - [Build libraries with visibility flags (don't export all symbols). This feature is experimental and should only be used for testing.])], + [AS_HELP_STRING([--disable-lib-visibility-flags], + [don't build libraries with visibility flags (export all symbols)])], [case $enableval in yes) ENABLE_LIB_VISIBILITY_FLAGS=yes ;; no) ENABLE_LIB_VISIBILITY_FLAGS=no ;; diff -r b876de975edf -r 00d82e792b8b etc/HACKING.md --- a/etc/HACKING.md Sat Dec 25 12:36:11 2021 +0100 +++ b/etc/HACKING.md Sat Dec 25 13:38:17 2021 +0100 @@ -399,6 +399,80 @@ These guidelines also appear in the GNU libtool manual, see https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html. +Merging the default branch to stable before a release +----------------------------------------------------- + +To merge default to stable for a release with version == MAJOR: + +NOTE, I use two separate repos, one in `/path/to/octave-stable` that is +updated to the stable branch and one in `/path/to/octave-default` that +is updated to the default branch. + +1. Update the repo in `/path/to/octave-stable` to the most recent change + on the stable branch. Ensure that there are no pending changes (be + careful to avoid wiping out any changes you are currently working + on!): + + cd /path/to/octave-stable + hg update -C stable + +2. Merge default to stable (there should never be any conflicts here; + you are just making the stable branch be whatever is on the current + default branch): + + hg merge default + +3. Commit the change (replace VERSION with the correct version; it + should be of the form MAJOR.1.0): + + hg commit -m "maint: Merge default to stable to begin VERSION release process." + +4. Bump version numbers and release date in `configure.ac` for pre-release: + + * Set version in AC_INIT to MAJOR.0.1 + * OCTAVE_MAJOR_VERSION should already be correct. + * Set OCTAVE_MINOR_VERSION to 0. + * Set OCTAVE_PATCH_VERSION to 1. + * Set OCTAVE_RELEASE_DATE to the current date. + * Set the year in OCTAVE_COPYRIGHT to the current year. The + copyright dates in the source files should have already been + updated during the development cycle. If not, that should be done + in a separate change before the merge. + * OCTAVE_API_VERSION and shared library version numbers may be + updated in a separate changeset just prior to creating the first + test release. + + hg commit ## Use commit message similar to the one in 8f8fab4c93ae + +5. Update the repo in `/path/to/octave-default` to the most recent change + on the default branch. Ensure that there are no pending changes (be + careful to avoid wiping out any changes you are currently working + on!): + + cd /path/to/octave-default + hg update -C default + +6. Merge stable back to default (there should not be conflicts in this + merge): + + hg merge stable + hg commit -m "maint: Merge stable to default." + +7. Bump versions in `configure.ac` to begin active development of MAJOR+1: + + * Set version in AC_INIT to MAJOR+1.0.0 + * Set OCTAVE_MAJOR_VERSION to MAJOR+1 + * Set OCTAVE_MINOR_VERSION to 0 + * Set OCTAVE_PATCH_VERSION to 0 + + hg commit ## Use commit message similar to the one in 1455418a5c4c + +8. Remove functions and properties deprecated in MAJOR-1 (see ecf207896f76, + for example) + +9. Update NEWS file for next development cycle (see 0ec5eaabaf2c, for + example). + ################################################################################ diff -r b876de975edf -r 00d82e792b8b etc/NEWS.7.md diff -r b876de975edf -r 00d82e792b8b etc/NEWS.8.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etc/NEWS.8.md Sat Dec 25 13:38:17 2021 +0100 @@ -0,0 +1,47 @@ +Summary of important user-visible changes for version 8 (yyyy-mm-dd): +--------------------------------------------------------------------- + +### General improvements + + +### Graphical User Interface + + +### Graphics backend + + +### Matlab compatibility + + +### Alphabetical list of new functions added in Octave 8 + + +### Deprecated functions, properties, and operators + +The following functions and properties have been deprecated in Octave 8 +and will be removed from Octave 10 (or whatever version is the second +major release after 8): + + +The following functions were deprecated in Octave 6 and have been removed +from Octave 8. + +- Functions + + Function | Replacement + -----------------------|------------------ + `runtests` | `oruntests` + +- The environment variable used by `mkoctfile` for linker flags is now + `LDFLAGS` rather than `LFLAGS`. `LFLAGS` was deprecated in Octave 6, + and will be removed in a future version of Octave. + +### Old release news + +- [Octave 7.x](etc/NEWS.7) +- [Octave 6.x](etc/NEWS.6) +- [Octave 5.x](etc/NEWS.5) +- [Octave 4.x](etc/NEWS.4) +- [Octave 3.x](etc/NEWS.3) +- [Octave 2.x](etc/NEWS.2) +- [Octave 1.x](etc/NEWS.1) diff -r b876de975edf -r 00d82e792b8b etc/module.mk --- a/etc/module.mk Sat Dec 25 12:36:11 2021 +0100 +++ b/etc/module.mk Sat Dec 25 13:38:17 2021 +0100 @@ -12,6 +12,7 @@ %reldir%/NEWS.5.md \ %reldir%/NEWS.6.md \ %reldir%/NEWS.7.md \ + %reldir%/NEWS.8.md \ %reldir%/gdbinit %canon_reldir%_EXTRA_DIST += \ diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/__isprimelarge__.cc --- a/libinterp/corefcn/__isprimelarge__.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/__isprimelarge__.cc Sat Dec 25 13:38:17 2021 +0100 @@ -98,7 +98,8 @@ bool isprimescalar (uint64_t n) { - // Fast return for even numbers. n==2 is excluded by the time this function is called. + // Fast return for even numbers. + // n==2 is excluded by the time this function is called. if (! (n & 1)) return false; @@ -197,7 +198,10 @@ %!assert (__isprimelarge__ (uint64 (2305843009213693951)), true) %!assert (__isprimelarge__ (uint64 (18446744073709551557)), true) -%!assert (__isprimelarge__ ([uint64(12345), uint64(2147483647), uint64(2305843009213693951), uint64(18446744073709551557)]), logical ([0 1 1 1])) +%!assert (__isprimelarge__ ([uint64(12345), uint64(2147483647), ... +%! uint64(2305843009213693951), ... +%! uint64(18446744073709551557)]), +%! logical ([0 1 1 1])) %!error (__isprimelarge__ ({'foo'; 'bar'})) */ diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/bsxfun.cc --- a/libinterp/corefcn/bsxfun.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/bsxfun.cc Sat Dec 25 13:38:17 2021 +0100 @@ -719,10 +719,12 @@ %!assert (bsxfun (f, a, b), a - repmat (b, [4, 1, 1])) %!assert (bsxfun (f, a, c), a - repmat (c, [1, 4, 1])) %!assert (bsxfun (f, a, d), a - repmat (d, [1, 1, 4])) -%!assert (bsxfun ("minus", ones ([4, 0, 4]), ones ([4, 1, 4])), zeros ([4, 0, 4])) +%!assert (bsxfun ("minus", ones ([4, 0, 4]), ones ([4, 1, 4])), +%! zeros ([4, 0, 4])) ## The test below is a very hard case to treat -%!assert (bsxfun (f, ones ([4, 1, 4, 1]), ones ([1, 4, 1, 4])), zeros ([4, 4, 4, 4])) +%!assert (bsxfun (f, ones ([4, 1, 4, 1]), ones ([1, 4, 1, 4])), +%! zeros ([4, 4, 4, 4])) %!shared a, b, aa, bb %! ## FIXME: Set a known "good" random seed. See bug #51779. diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/cellfun.cc Sat Dec 25 13:38:17 2021 +0100 @@ -859,19 +859,27 @@ %! A = cellfun (@(x,y) cell2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "ErrorHandler", @__cellfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) cell2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); ## Input arguments can be of type cell arrays of character or strings @@ -886,18 +894,26 @@ %!test %! A = cellfun (@(x,y) cell2str (x,y), {"a", "d"}, {"c", "f"}, ... %! "ErrorHandler", @__cellfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) cell2str (x,y), {"a", "d"}, {"c", "f"}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); ## Structures cannot be handled by cellfun @@ -920,18 +936,26 @@ %!test %! A = cellfun (@(x,y) mat2str (x,y), {{1.1}, {4.2}}, {{3.1}, {2}}, ... %! "ErrorHandler", @__cellfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) mat2str (x,y), {{1.1}, {4.2}}, {{3.1}, {2}}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); ## Input arguments can be of type cell array of structure arrays @@ -984,7 +1008,8 @@ %!assert (cellfun ("size", {zeros([1,2,3]),1}, 2), [2,1]) %!assert (cellfun ("size", {zeros([1,2,3]),1}, 3), [3,1]) %!assert (cellfun (@atan2, {1,1}, {1,2}), [atan2(1,1), atan2(1,2)]) -%!assert (cellfun (@atan2, {1,1}, {1,2},"UniformOutput", false), {atan2(1,1), atan2(1,2)}) +%!assert (cellfun (@atan2, {1,1}, {1,2},"UniformOutput", false), +%! {atan2(1,1), atan2(1,2)}) %!assert (cellfun (@sin, {1,2;3,4}), sin ([1,2;3,4])) %!assert (cellfun (@atan2, {1,1;1,1}, {1,2;1,2}), atan2 ([1,1;1,1],[1,2;1,2])) %!error cellfun (@factorial, {-1,3}) @@ -997,9 +1022,12 @@ %! assert (c, {".d", ".h"}); %!assert <*40467> (cellfun (@isreal, {1 inf nan []}), [true, true, true, true]) -%!assert <*40467> (cellfun (@isreal, {1 inf nan []}, "UniformOutput", false), {true, true, true, true}) -%!assert <*40467> (cellfun (@iscomplex, {1 inf nan []}), [false, false, false, false]) -%!assert <*40467> (cellfun (@iscomplex, {1 inf nan []}, "UniformOutput", false), {false, false, false, false}) +%!assert <*40467> (cellfun (@isreal, {1 inf nan []}, "UniformOutput", false), +%! {true, true, true, true}) +%!assert <*40467> (cellfun (@iscomplex, {1 inf nan []}), +%! [false, false, false, false]) +%!assert <*40467> (cellfun (@iscomplex, {1 inf nan []}, "UniformOutput", false), +%! {false, false, false, false}) %!error cellfun (1) %!error cellfun ("isclass", 1) @@ -1015,7 +1043,8 @@ %!endfunction %!test <*58411> %! global __errmsg; -%! assert (cellfun (@factorial, {1, 2, -3}, "ErrorHandler", @__errfcn), [1, 2, NaN]); +%! assert (cellfun (@factorial, {1, 2, -3}, "ErrorHandler", @__errfcn), +%! [1, 2, NaN]); %! assert (! isempty (__errmsg)); %! clear -global __errmsg; */ @@ -1537,19 +1566,27 @@ %! A = arrayfun (@(x,y) array2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "ErrorHandler", @__arrayfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test # Overwriting setting of "UniformOutput" true %! A = arrayfun (@(x,y) array2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "UniformOutput", true, "ErrorHandler", @__arrayfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); ## Input arguments can be of type character or strings @@ -1565,7 +1602,8 @@ %!test %! A = arrayfun (@(x,y) cell2str (x,y), ["a", "d"], ["c", "f"], ... %! "ErrorHandler", @__arrayfunerror); -%! B = isfield (A(1), "identifier") && isfield (A(1), "message") && isfield (A(1), "index"); +%! B = isfield (A(1), "identifier") && isfield (A(1), "message") ... +%! && isfield (A(1), "index"); %! assert (B, true); ## Input arguments can be of type structure @@ -1609,18 +1647,26 @@ %! assert (A, {true, false}); %!test %! A = arrayfun (@(x,y) num2str(x,y), {1.1, 4.2}, {3.1, 2}, "ErrorHandler", @__arrayfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); %!test %! A = arrayfun (@(x,y) num2str (x,y), {1.1, 4.2}, {3.1, 2}, ... %! "UniformOutput", true, "ErrorHandler", @__arrayfunerror); -%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); -%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], [true, true]); -%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); -%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); +%! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], +%! [true, true]); +%! assert ([(isfield (A(1), "message")), (isfield (A(2), "message"))], +%! [true, true]); +%! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], +%! [true, true]); +%! assert ([(isempty (A(1).message)), (isempty (A(2).message))], +%! [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); */ diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/chol.cc --- a/libinterp/corefcn/chol.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/chol.cc Sat Dec 25 13:38:17 2021 +0100 @@ -314,7 +314,8 @@ /* %!assert (chol ([2, 1; 1, 1]), [sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)], sqrt (eps)) -%!assert (chol (single ([2, 1; 1, 1])), single ([sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)]), sqrt (eps ("single"))) +%!assert (chol (single ([2, 1; 1, 1])), +%! single ([sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)]), sqrt (eps ("single"))) %!assert (chol ([2, 1; 1, 1], "upper"), [sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)], %! sqrt (eps)) diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/data.cc Sat Dec 25 13:38:17 2021 +0100 @@ -703,8 +703,10 @@ %!assert (rem ([1, 2, 3; -1, -2, -3], 2), [1, 0, 1; -1, 0, -1]) %!assert (rem ([1, 2, 3; -1, -2, -3], 2 * ones (2, 3)),[1, 0, 1; -1, 0, -1]) %!assert (rem ([0, 1, 2], [0, 0, 1]), [NaN, NaN, 0]) -%!assert (rem (uint8 ([1, 2, 3; -1, -2, -3]), uint8 (2)), uint8 ([1, 0, 1; -1, 0, -1])) -%!assert (uint8 (rem ([1, 2, 3; -1, -2, -3], 2 * ones (2, 3))),uint8 ([1, 0, 1; -1, 0, -1])) +%!assert (rem (uint8 ([1, 2, 3; -1, -2, -3]), uint8 (2)), +%! uint8 ([1, 0, 1; -1, 0, -1])) +%!assert (uint8 (rem ([1, 2, 3; -1, -2, -3], 2 * ones (2, 3))), +%! uint8 ([1, 0, 1; -1, 0, -1])) %!assert (rem (uint8 ([0, 1, 2]), [0, 0, 1]), uint8 ([0, 0, 0])) ## Test sparse implementations @@ -1020,12 +1022,15 @@ %!assert (cumprod ([1, 2, 3]), [1, 2, 6]) %!assert (cumprod ([-1; -2; -3]), [-1; 2; -6]) %!assert (cumprod ([i, 2+i, -3+2i, 4]), [i, -1+2i, -1-8i, -4-32i]) -%!assert (cumprod ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), [1, 2, 3; i, 4i, 9i; -1+i, -8+8i, -27+27i]) +%!assert (cumprod ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), +%! [1, 2, 3; i, 4i, 9i; -1+i, -8+8i, -27+27i]) %!assert (cumprod (single ([1, 2, 3])), single ([1, 2, 6])) %!assert (cumprod (single ([-1; -2; -3])), single ([-1; 2; -6])) -%!assert (cumprod (single ([i, 2+i, -3+2i, 4])), single ([i, -1+2i, -1-8i, -4-32i])) -%!assert (cumprod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), single ([1, 2, 3; i, 4i, 9i; -1+i, -8+8i, -27+27i])) +%!assert (cumprod (single ([i, 2+i, -3+2i, 4])), +%! single ([i, -1+2i, -1-8i, -4-32i])) +%!assert (cumprod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +%! single ([1, 2, 3; i, 4i, 9i; -1+i, -8+8i, -27+27i])) %!assert (cumprod ([2, 3; 4, 5], 1), [2, 3; 8, 15]) %!assert (cumprod ([2, 3; 4, 5], 2), [2, 6; 4, 20]) @@ -1170,12 +1175,15 @@ %!assert (cumsum ([1, 2, 3]), [1, 3, 6]) %!assert (cumsum ([-1; -2; -3]), [-1; -3; -6]) %!assert (cumsum ([i, 2+i, -3+2i, 4]), [i, 2+2i, -1+4i, 3+4i]) -%!assert (cumsum ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), [1, 2, 3; 1+i, 2+2i, 3+3i; 2+2i, 4+4i, 6+6i]) +%!assert (cumsum ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), +%! [1, 2, 3; 1+i, 2+2i, 3+3i; 2+2i, 4+4i, 6+6i]) %!assert (cumsum (single ([1, 2, 3])), single ([1, 3, 6])) %!assert (cumsum (single ([-1; -2; -3])), single ([-1; -3; -6])) -%!assert (cumsum (single ([i, 2+i, -3+2i, 4])), single ([i, 2+2i, -1+4i, 3+4i])) -%!assert (cumsum (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), single ([1, 2, 3; 1+i, 2+2i, 3+3i; 2+2i, 4+4i, 6+6i])) +%!assert (cumsum (single ([i, 2+i, -3+2i, 4])), +%! single ([i, 2+2i, -1+4i, 3+4i])) +%!assert (cumsum (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +%! single ([1, 2, 3; 1+i, 2+2i, 3+3i; 2+2i, 4+4i, 6+6i])) %!assert (cumsum ([1, 2; 3, 4], 1), [1, 2; 4, 6]) %!assert (cumsum ([1, 2; 3, 4], 2), [1, 3; 3, 7]) @@ -1254,35 +1262,53 @@ %!assert (full (diag ([1; 2; 3])), [1, 0, 0; 0, 2, 0; 0, 0, 3]) %!assert (diag ([1; 2; 3], 1), [0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]) -%!assert (diag ([1; 2; 3], 2), [0, 0, 1, 0, 0; 0, 0, 0, 2, 0; 0, 0, 0, 0, 3; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0]) -%!assert (diag ([1; 2; 3],-1), [0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]) -%!assert (diag ([1; 2; 3],-2), [0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 1, 0, 0, 0, 0; 0, 2, 0, 0, 0; 0, 0, 3, 0, 0]) +%!assert (diag ([1; 2; 3], 2), +%! [0 0 1 0 0; 0 0 0 2 0; 0 0 0 0 3; 0 0 0 0 0; 0 0 0 0 0]) +%!assert (diag ([1; 2; 3],-1), +%! [0 0 0 0; 1 0 0 0; 0 2 0 0; 0 0 3 0]) +%!assert (diag ([1; 2; 3],-2), +%! [0 0 0 0 0; 0 0 0 0 0; 1 0 0 0 0; 0 2 0 0 0; 0 0 3 0 0]) %!assert (diag ([1, 0, 0; 0, 2, 0; 0, 0, 3]), [1; 2; 3]) -%!assert (diag ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0], 1), [1; 2; 3]) -%!assert (diag ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0], -1), [1; 2; 3]) +%!assert (diag ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0], 1), +%! [1; 2; 3]) +%!assert (diag ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0], -1), +%! [1; 2; 3]) %!assert (diag (ones (1, 0), 2), zeros (2)) %!assert (diag (1:3, 4, 2), [1, 0; 0, 2; 0, 0; 0, 0]) -%!assert (full (diag (single ([1; 2; 3]))), single ([1, 0, 0; 0, 2, 0; 0, 0, 3])) -%!assert (diag (single ([1; 2; 3]), 1), single ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0])) -%!assert (diag (single ([1; 2; 3]), 2), single ([0, 0, 1, 0, 0; 0, 0, 0, 2, 0; 0, 0, 0, 0, 3; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0])) -%!assert (diag (single ([1; 2; 3]),-1), single ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0])) -%!assert (diag (single ([1; 2; 3]),-2), single ([0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 1, 0, 0, 0, 0; 0, 2, 0, 0, 0; 0, 0, 3, 0, 0])) +%!assert (full (diag (single ([1; 2; 3]))), +%! single ([1, 0, 0; 0, 2, 0; 0, 0, 3])) +%!assert (diag (single ([1; 2; 3]), 1), +%! single ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0])) +%!assert (diag (single ([1; 2; 3]), 2), +%! single ([0 0 1 0 0; 0 0 0 2 0; 0 0 0 0 3; 0 0 0 0 0; 0 0 0 0 0])) +%!assert (diag (single ([1; 2; 3]),-1), +%! single ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0])) +%!assert (diag (single ([1; 2; 3]),-2), +%! single ([0 0 0 0 0; 0 0 0 0 0; 1 0 0 0 0; 0 2 0 0 0; 0 0 3 0 0])) %!assert (diag (single ([1, 0, 0; 0, 2, 0; 0, 0, 3])), single ([1; 2; 3])) -%!assert (diag (single ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]), 1), single ([1; 2; 3])) -%!assert (diag (single ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]), -1), single ([1; 2; 3])) +%!assert (diag (single ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]), 1), +%! single ([1; 2; 3])) +%!assert (diag (single ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]), -1), +%! single ([1; 2; 3])) %!assert (diag (int8 ([1; 2; 3])), int8 ([1, 0, 0; 0, 2, 0; 0, 0, 3])) -%!assert (diag (int8 ([1; 2; 3]), 1), int8 ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0])) -%!assert (diag (int8 ([1; 2; 3]), 2), int8 ([0, 0, 1, 0, 0; 0, 0, 0, 2, 0; 0, 0, 0, 0, 3; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0])) -%!assert (diag (int8 ([1; 2; 3]),-1), int8 ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0])) -%!assert (diag (int8 ([1; 2; 3]),-2), int8 ([0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 1, 0, 0, 0, 0; 0, 2, 0, 0, 0; 0, 0, 3, 0, 0])) +%!assert (diag (int8 ([1; 2; 3]), 1), +%! int8 ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0])) +%!assert (diag (int8 ([1; 2; 3]), 2), +%! int8 ([0 0 1 0 0; 0 0 0 2 0; 0 0 0 0 3; 0 0 0 0 0; 0 0 0 0 0])) +%!assert (diag (int8 ([1; 2; 3]),-1), +%! int8 ([0 0 0 0; 1 0 0 0; 0 2 0 0; 0 0 3 0])) +%!assert (diag (int8 ([1; 2; 3]),-2), +%! int8 ([0 0 0 0 0; 0 0 0 0 0; 1 0 0 0 0; 0 2 0 0 0; 0 0 3 0 0])) %!assert (diag (int8 ([1, 0, 0; 0, 2, 0; 0, 0, 3])), int8 ([1; 2; 3])) -%!assert (diag (int8 ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]), 1), int8 ([1; 2; 3])) -%!assert (diag (int8 ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]), -1), int8 ([1; 2; 3])) +%!assert (diag (int8 ([0, 1, 0, 0; 0, 0, 2, 0; 0, 0, 0, 3; 0, 0, 0, 0]), 1), +%! int8 ([1; 2; 3])) +%!assert (diag (int8 ([0, 0, 0, 0; 1, 0, 0, 0; 0, 2, 0, 0; 0, 0, 3, 0]), -1), +%! int8 ([1; 2; 3])) %!assert (diag (1, 3, 3), diag ([1, 0, 0])) %!assert (diag (i, 3, 3), diag ([i, 0, 0])) @@ -1295,7 +1321,8 @@ %!assert <*37411> (diag (diag ([5, 2, 3])(:,1)), diag([5 0 0 ])) %!assert <*37411> (diag (diag ([5, 2, 3])(:,1), 2), [0 0 5 0 0; zeros(4, 5)]) -%!assert <*37411> (diag (diag ([5, 2, 3])(:,1), -2), [[0 0 5 0 0]', zeros(5, 4)]) +%!assert <*37411> (diag (diag ([5, 2, 3])(:,1), -2), +%! [[0 0 5 0 0]', zeros(5, 4)]) ## Test non-square size %!assert (diag ([1,2,3], 6, 3), [1 0 0; 0 2 0; 0 0 3; 0 0 0; 0 0 0; 0 0 0]) @@ -1464,14 +1491,16 @@ %!assert (prod (single ([1, 2, 3])), single (6)) %!assert (prod (single ([-1; -2; -3])), single (-6)) %!assert (prod (single ([i, 2+i, -3+2i, 4])), single (-4 - 32i)) -%!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), single ([-1+i, -8+8i, -27+27i])) +%!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +%! single ([-1+i, -8+8i, -27+27i])) ## Test sparse %!assert (prod (sparse ([1, 2, 3])), sparse (6)) %!assert (prod (sparse ([-1; -2; -3])), sparse (-6)) ## Commented out until bug #42290 is fixed #%!assert (prod (sparse ([i, 2+i, -3+2i, 4])), sparse (-4 - 32i)) -#%!assert (prod (sparse ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), sparse ([-1+i, -8+8i, -27+27i])) +#%!assert (prod (sparse ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +#%! sparse ([-1+i, -8+8i, -27+27i])) %!assert (prod ([1, 2; 3, 4], 1), [3, 8]) %!assert (prod ([1, 2; 3, 4], 2), [2; 12]) @@ -1507,7 +1536,8 @@ %!assert (prod (single ([1, 2, 3]), "double"), 6) %!assert (prod (single ([-1; -2; -3]), "double"), -6) %!assert (prod (single ([i, 2+i, -3+2i, 4]), "double"), -4 - 32i) -%!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), "double"), [-1+i, -8+8i, -27+27i]) +%!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), "double"), +%! [-1+i, -8+8i, -27+27i]) ## Test "native" type argument %!assert (prod (uint8 ([1, 2, 3]), "native"), uint8 (6)) @@ -2254,7 +2284,8 @@ /* %!test %! c = {"foo"; "bar"; "bazoloa"}; -%! assert (vertcat (c, "a", "bc", "def"), {"foo"; "bar"; "bazoloa"; "a"; "bc"; "def"}); +%! assert (vertcat (c, "a", "bc", "def"), +%! {"foo"; "bar"; "bazoloa"; "a"; "bc"; "def"}); */ DEFUN (cat, args, , @@ -2321,11 +2352,13 @@ %! assert (cat (1, cast (1, t1), cast (2, t2)), cast ([1; 2], tr)); %! assert (cat (1, cast (1, t1), cast ([2; 3], t2)), cast ([1; 2; 3], tr)); %! assert (cat (1, cast ([1; 2], t1), cast (3, t2)), cast ([1; 2; 3], tr)); -%! assert (cat (1, cast ([1; 2], t1), cast ([3; 4], t2)), cast ([1; 2; 3; 4], tr)); +%! assert (cat (1, cast ([1; 2], t1), cast ([3; 4], t2)), +%! cast ([1; 2; 3; 4], tr)); %! assert (cat (2, cast (1, t1), cast (2, t2)), cast ([1, 2], tr)); %! assert (cat (2, cast (1, t1), cast ([2, 3], t2)), cast ([1, 2, 3], tr)); %! assert (cat (2, cast ([1, 2], t1), cast (3, t2)), cast ([1, 2, 3], tr)); -%! assert (cat (2, cast ([1, 2], t1), cast ([3, 4], t2)), cast ([1, 2, 3, 4], tr)); +%! assert (cat (2, cast ([1, 2], t1), cast ([3, 4], t2)), +%! cast ([1, 2, 3, 4], tr)); %! %! assert ([cast(1, t1); cast(2, t2)], cast ([1; 2], tr)); %! assert ([cast(1, t1); cast([2; 3], t2)], cast ([1; 2; 3], tr)); @@ -2340,12 +2373,13 @@ %! assert (cat (1, cast (1i, t1), cast (2, t2)), cast ([1i; 2], tr)); %! assert (cat (1, cast (1i, t1), cast ([2; 3], t2)), cast ([1i; 2; 3], tr)); %! assert (cat (1, cast ([1i; 2], t1), cast (3, t2)), cast ([1i; 2; 3], tr)); -%! assert (cat (1, cast ([1i; 2], t1), cast ([3; 4], t2)), cast ([1i; 2; 3; 4], tr)); +%! assert (cat (1, cast ([1i; 2], t1), cast ([3; 4], t2)), +%! cast ([1i; 2; 3; 4], tr)); %! assert (cat (2, cast (1i, t1), cast (2, t2)), cast ([1i, 2], tr)); %! assert (cat (2, cast (1i, t1), cast ([2, 3], t2)), cast ([1i, 2, 3], tr)); %! assert (cat (2, cast ([1i, 2], t1), cast (3, t2)), cast ([1i, 2, 3], tr)); -%! assert (cat (2, cast ([1i, 2], t1), cast ([3, 4], t2)), cast ([1i, 2, 3, 4], tr)); -%! +%! assert (cat (2, cast ([1i, 2], t1), cast ([3, 4], t2)), +%! cast ([1i, 2, 3, 4], tr)); %! assert ([cast(1i, t1); cast(2, t2)], cast ([1i; 2], tr)); %! assert ([cast(1i, t1); cast([2; 3], t2)], cast ([1i; 2; 3], tr)); %! assert ([cast([1i; 2], t1); cast(3, t2)], cast ([1i; 2; 3], tr)); @@ -2358,12 +2392,13 @@ %! assert (cat (1, cast (1, t1), cast (2i, t2)), cast ([1; 2i], tr)); %! assert (cat (1, cast (1, t1), cast ([2i; 3], t2)), cast ([1; 2i; 3], tr)); %! assert (cat (1, cast ([1; 2], t1), cast (3i, t2)), cast ([1; 2; 3i], tr)); -%! assert (cat (1, cast ([1; 2], t1), cast ([3i; 4], t2)), cast ([1; 2; 3i; 4], tr)); +%! assert (cat (1, cast ([1; 2], t1), cast ([3i; 4], t2)), +%! cast ([1; 2; 3i; 4], tr)); %! assert (cat (2, cast (1, t1), cast (2i, t2)), cast ([1, 2i], tr)); %! assert (cat (2, cast (1, t1), cast ([2i, 3], t2)), cast ([1, 2i, 3], tr)); %! assert (cat (2, cast ([1, 2], t1), cast (3i, t2)), cast ([1, 2, 3i], tr)); -%! assert (cat (2, cast ([1, 2], t1), cast ([3i, 4], t2)), cast ([1, 2, 3i, 4], tr)); -%! +%! assert (cat (2, cast ([1, 2], t1), cast ([3i, 4], t2)), +%! cast ([1, 2, 3i, 4], tr)); %! assert ([cast(1, t1); cast(2i, t2)], cast ([1; 2i], tr)); %! assert ([cast(1, t1); cast([2i; 3], t2)], cast ([1; 2i; 3], tr)); %! assert ([cast([1; 2], t1); cast(3i, t2)], cast ([1; 2; 3i], tr)); @@ -2374,22 +2409,30 @@ %! assert ([cast([1, 2], t1), cast([3i, 4], t2)], cast ([1, 2, 3i, 4], tr)); %! %! assert (cat (1, cast (1i, t1), cast (2i, t2)), cast ([1i; 2i], tr)); -%! assert (cat (1, cast (1i, t1), cast ([2i; 3], t2)), cast ([1i; 2i; 3], tr)); -%! assert (cat (1, cast ([1i; 2], t1), cast (3i, t2)), cast ([1i; 2; 3i], tr)); -%! assert (cat (1, cast ([1i; 2], t1), cast ([3i; 4], t2)), cast ([1i; 2; 3i; 4], tr)); +%! assert (cat (1, cast (1i, t1), cast ([2i; 3], t2)), +%! cast ([1i; 2i; 3], tr)); +%! assert (cat (1, cast ([1i; 2], t1), cast (3i, t2)), +%! cast ([1i; 2; 3i], tr)); +%! assert (cat (1, cast ([1i; 2], t1), cast ([3i; 4], t2)), +%! cast ([1i; 2; 3i; 4], tr)); %! assert (cat (2, cast (1i, t1), cast (2i, t2)), cast ([1i, 2i], tr)); -%! assert (cat (2, cast (1i, t1), cast ([2i, 3], t2)), cast ([1i, 2i, 3], tr)); -%! assert (cat (2, cast ([1i, 2], t1), cast (3i, t2)), cast ([1i, 2, 3i], tr)); -%! assert (cat (2, cast ([1i, 2], t1), cast ([3i, 4], t2)), cast ([1i, 2, 3i, 4], tr)); +%! assert (cat (2, cast (1i, t1), cast ([2i, 3], t2)), +%! cast ([1i, 2i, 3], tr)); +%! assert (cat (2, cast ([1i, 2], t1), cast (3i, t2)), +%! cast ([1i, 2, 3i], tr)); +%! assert (cat (2, cast ([1i, 2], t1), cast ([3i, 4], t2)), +%! cast ([1i, 2, 3i, 4], tr)); %! %! assert ([cast(1i, t1); cast(2i, t2)], cast ([1i; 2i], tr)); %! assert ([cast(1i, t1); cast([2i; 3], t2)], cast ([1i; 2i; 3], tr)); %! assert ([cast([1i; 2], t1); cast(3i, t2)], cast ([1i; 2; 3i], tr)); -%! assert ([cast([1i; 2], t1); cast([3i; 4], t2)], cast ([1i; 2; 3i; 4], tr)); +%! assert ([cast([1i; 2], t1); cast([3i; 4], t2)], +%! cast ([1i; 2; 3i; 4], tr)); %! assert ([cast(1i, t1), cast(2i, t2)], cast ([1i, 2i], tr)); %! assert ([cast(1i, t1), cast([2i, 3], t2)], cast ([1i, 2i, 3], tr)); %! assert ([cast([1i, 2], t1), cast(3i, t2)], cast ([1i, 2, 3i], tr)); -%! assert ([cast([1i, 2], t1), cast([3i, 4], t2)], cast ([1i, 2, 3i, 4], tr)); +%! assert ([cast([1i, 2], t1), cast([3i, 4], t2)], +%! cast ([1i, 2, 3i, 4], tr)); %! endif %! ret = true; %!endfunction @@ -3173,7 +3216,8 @@ %!assert (sum (single ([1, 2, 3])), single (6)) %!assert (sum (single ([-1; -2; -3])), single (-6)) %!assert (sum (single ([i, 2+i, -3+2i, 4])), single (3+4i)) -%!assert (sum (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), single ([2+2i, 4+4i, 6+6i])) +%!assert (sum (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), +%! single ([2+2i, 4+4i, 6+6i])) %!assert (sum ([1, 2; 3, 4], 1), [4, 6]) %!assert (sum ([1, 2; 3, 4], 2), [3; 7]) @@ -4715,7 +4759,8 @@ %!assert (Inf (3, 2), [Inf, Inf; Inf, Inf; Inf, Inf]) %!assert (size (Inf (3, 4, 5)), [3, 4, 5]) -%!assert (Inf (3, "single"), single ([Inf, Inf, Inf; Inf, Inf, Inf; Inf, Inf, Inf])) +%!assert (Inf (3, "single"), +%! single ([Inf, Inf, Inf; Inf, Inf, Inf; Inf, Inf, Inf])) %!assert (Inf (2, 3, "single"), single ([Inf, Inf, Inf; Inf, Inf, Inf])) %!assert (Inf (3, 2, "single"), single ([Inf, Inf; Inf, Inf; Inf, Inf])) %!assert (size (inf (3, 4, 5, "single")), [3, 4, 5]) @@ -4723,7 +4768,8 @@ %!assert (Inf (2, 2, "like", speye (2)), sparse ([Inf, Inf; Inf, Inf])) %!assert (Inf (2, 2, "like", complex (ones (2, 2))), [Inf, Inf; Inf, Inf]) %!assert (Inf (2, 2, "like", double (1)), double ([Inf, Inf; Inf, Inf])) -%!assert (Inf (3, 3, "like", single (1)), single ([Inf, Inf, Inf; Inf, Inf, Inf; Inf, Inf, Inf])) +%!assert (Inf (3, 3, "like", single (1)), +%! single ([Inf, Inf, Inf; Inf, Inf, Inf; Inf, Inf, Inf])) %!assert (Inf (2, "like", single (1i)), single ([Inf, Inf; Inf, Inf])) %!error Inf (3, "like", int8 (1)) @@ -4794,14 +4840,16 @@ %!assert (NaN (3, 2), [NaN, NaN; NaN, NaN; NaN, NaN]) %!assert (size (NaN (3, 4, 5)), [3, 4, 5]) -%!assert (NaN (3, "single"), single ([NaN, NaN, NaN; NaN, NaN, NaN; NaN, NaN, NaN])) +%!assert (NaN (3, "single"), +%! single ([NaN, NaN, NaN; NaN, NaN, NaN; NaN, NaN, NaN])) %!assert (NaN (2, 3, "single"), single ([NaN, NaN, NaN; NaN, NaN, NaN])) %!assert (NaN (3, 2, "single"), single ([NaN, NaN; NaN, NaN; NaN, NaN])) %!assert (size (NaN (3, 4, 5, "single")), [3, 4, 5]) %!assert (NaN (2, 2, "like", double (1)), double ([NaN, NaN; NaN, NaN])) %!assert (NaN (2, 2, "like", complex (ones(2, 2))), [NaN, NaN; NaN, NaN]) -%!assert (NaN (3, 3, "like", single (1)), single ([NaN, NaN, NaN; NaN, NaN, NaN; NaN, NaN, NaN])) +%!assert (NaN (3, 3, "like", single (1)), +%! single ([NaN, NaN, NaN; NaN, NaN, NaN; NaN, NaN, NaN])) %!assert (NaN (2, "like", single (1i)), single ([NaN, NaN; NaN, NaN])) %!assert (NaN (2, 2, "like", speye (2)), sparse ([NaN, NaN; NaN, NaN])) @@ -4952,7 +5000,7 @@ %!assert (eps (Inf), NaN) %!assert (eps (NaN), NaN) %!assert (eps ([1/2 1 2 realmax 0 realmin/2 realmin/16 Inf NaN]), -%! [2^(-53) 2^(-52) 2^(-51) 2^971 2^(-1074) 2^(-1074) 2^(-1074) NaN NaN]) +%! [2^-53 2^-52 2^-51 2^971 2^-1074 2^-1074 2^-1074 NaN NaN]) %!assert (eps (single (1/2)), single (2^(-24))) %!assert (eps (single (1)), single (2^(-23))) %!assert (eps (single (2)), single (2^(-22))) @@ -4963,7 +5011,7 @@ %!assert (eps (single (Inf)), single (NaN)) %!assert (eps (single (NaN)), single (NaN)) %!assert (eps (single ([1/2 1 2 realmax("single") 0 realmin("single")/2 realmin("single")/16 Inf NaN])), -%! single ([2^(-24) 2^(-23) 2^(-22) 2^104 2^(-149) 2^(-149) 2^(-149) NaN NaN])) +%! single ([2^-24 2^-23 2^-22 2^104 2^-149 2^-149 2^-149 NaN NaN])) %!error eps (uint8 ([0 1 2])) */ @@ -7026,16 +7074,26 @@ ## Single %!assert (sort (single ([NaN, 1, -1, 2, Inf])), single ([-1, 1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 1), single ([NaN, 1, -1, 2, Inf])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2), single ([-1, 1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 3), single ([NaN, 1, -1, 2, Inf])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), "ascend"), single ([-1, 1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2, "ascend"), single ([-1, 1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), "descend"), single ([NaN, Inf, 2, 1, -1])) -%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2, "descend"), single ([NaN, Inf, 2, 1, -1])) -%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4])), single ([3, 1, 6, 4; 8, 2, 7, 5])) -%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4]), 1), single ([3, 1, 6, 4; 8, 2, 7, 5])) -%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4]), 2), single ([1, 3, 5, 7; 2, 4, 6, 8])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 1), +%! single ([NaN, 1, -1, 2, Inf])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2), +%! single ([-1, 1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 3), +%! single ([NaN, 1, -1, 2, Inf])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), "ascend"), +%! single ([-1, 1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2, "ascend"), +%! single ([-1, 1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), "descend"), +%! single ([NaN, Inf, 2, 1, -1])) +%!assert (sort (single ([NaN, 1, -1, 2, Inf]), 2, "descend"), +%! single ([NaN, Inf, 2, 1, -1])) +%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4])), +%! single ([3, 1, 6, 4; 8, 2, 7, 5])) +%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4]), 1), +%! single ([3, 1, 6, 4; 8, 2, 7, 5])) +%!assert (sort (single ([3, 1, 7, 5; 8, 2, 6, 4]), 2), +%! single ([1, 3, 5, 7; 2, 4, 6, 8])) %!assert (sort (single (1)), single (1)) %!test @@ -7045,16 +7103,26 @@ ## Single Complex %!assert (sort (single ([NaN, 1i, -1, 2, Inf])), single ([1i, -1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 1), single ([NaN, 1i, -1, 2, Inf])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2), single ([1i, -1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 3), single ([NaN, 1i, -1, 2, Inf])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), "ascend"), single ([1i, -1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2, "ascend"), single ([1i, -1, 2, Inf, NaN])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), "descend"), single ([NaN, Inf, 2, -1, 1i])) -%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2, "descend"), single ([NaN, Inf, 2, -1, 1i])) -%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4])), single ([3, 1i, 6, 4; 8, 2, 7, 5])) -%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4]), 1), single ([3, 1i, 6, 4; 8, 2, 7, 5])) -%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4]), 2), single ([1i, 3, 5, 7; 2, 4, 6, 8])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 1), +%! single ([NaN, 1i, -1, 2, Inf])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2), +%! single ([1i, -1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 3), +%! single ([NaN, 1i, -1, 2, Inf])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), "ascend"), +%! single ([1i, -1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2, "ascend"), +%! single ([1i, -1, 2, Inf, NaN])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), "descend"), +%! single ([NaN, Inf, 2, -1, 1i])) +%!assert (sort (single ([NaN, 1i, -1, 2, Inf]), 2, "descend"), +%! single ([NaN, Inf, 2, -1, 1i])) +%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4])), +%! single ([3, 1i, 6, 4; 8, 2, 7, 5])) +%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4]), 1), +%! single ([3, 1i, 6, 4; 8, 2, 7, 5])) +%!assert (sort (single ([3, 1i, 7, 5; 8, 2, 6, 4]), 2), +%! single ([1i, 3, 5, 7; 2, 4, 6, 8])) %!assert (sort (single (1i)), single (1i)) %!test @@ -7067,10 +7135,14 @@ %!assert (sort ([true, false, true, false], 1), [true, false, true, false]) %!assert (sort ([true, false, true, false], 2), [false, false, true, true]) %!assert (sort ([true, false, true, false], 3), [true, false, true, false]) -%!assert (sort ([true, false, true, false], "ascend"), [false, false, true, true]) -%!assert (sort ([true, false, true, false], 2, "ascend"), [false, false, true, true]) -%!assert (sort ([true, false, true, false], "descend"), [true, true, false, false]) -%!assert (sort ([true, false, true, false], 2, "descend"), [true, true, false, false]) +%!assert (sort ([true, false, true, false], "ascend"), +%! [false, false, true, true]) +%!assert (sort ([true, false, true, false], 2, "ascend"), +%! [false, false, true, true]) +%!assert (sort ([true, false, true, false], "descend"), +%! [true, true, false, false]) +%!assert (sort ([true, false, true, false], 2, "descend"), +%! [true, true, false, false]) %!assert (sort (true), true) %!test @@ -7079,14 +7151,22 @@ %! assert (i, [2, 4, 1, 3]); ## Sparse Double -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf])), sparse ([-1, 0, 0, 1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 1), sparse ([0, NaN, 1, 0, -1, 2, Inf])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2), sparse ([-1, 0, 0, 1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 3), sparse ([0, NaN, 1, 0, -1, 2, Inf])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), "ascend"), sparse ([-1, 0, 0, 1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2, "ascend"), sparse ([-1, 0, 0, 1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), "descend"), sparse ([NaN, Inf, 2, 1, 0, 0, -1])) -%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2, "descend"), sparse ([NaN, Inf, 2, 1, 0, 0, -1])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf])), +%! sparse ([-1, 0, 0, 1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 1), +%! sparse ([0, NaN, 1, 0, -1, 2, Inf])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2), +%! sparse ([-1, 0, 0, 1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 3), +%! sparse ([0, NaN, 1, 0, -1, 2, Inf])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), "ascend"), +%! sparse ([-1, 0, 0, 1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2, "ascend"), +%! sparse ([-1, 0, 0, 1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), "descend"), +%! sparse ([NaN, Inf, 2, 1, 0, 0, -1])) +%!assert (sort (sparse ([0, NaN, 1, 0, -1, 2, Inf]), 2, "descend"), +%! sparse ([NaN, Inf, 2, 1, 0, 0, -1])) %!shared a %! a = randn (10, 10); @@ -7101,14 +7181,22 @@ %! assert (is, i); ## Sparse Complex -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf])), sparse ([0, 0, 1i, -1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 1), sparse ([0, NaN, 1i, 0, -1, 2, Inf])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2), sparse ([0, 0, 1i, -1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 3), sparse ([0, NaN, 1i, 0, -1, 2, Inf])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), "ascend"), sparse ([0, 0, 1i, -1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2, "ascend"), sparse ([0, 0, 1i, -1, 2, Inf, NaN])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), "descend"), sparse ([NaN, Inf, 2, -1, 1i, 0, 0])) -%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2, "descend"), sparse ([NaN, Inf, 2, -1, 1i, 0, 0])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf])), +%! sparse ([0, 0, 1i, -1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 1), +%! sparse ([0, NaN, 1i, 0, -1, 2, Inf])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2), +%! sparse ([0, 0, 1i, -1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 3), +%! sparse ([0, NaN, 1i, 0, -1, 2, Inf])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), "ascend"), +%! sparse ([0, 0, 1i, -1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2, "ascend"), +%! sparse ([0, 0, 1i, -1, 2, Inf, NaN])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), "descend"), +%! sparse ([NaN, Inf, 2, -1, 1i, 0, 0])) +%!assert (sort (sparse ([0, NaN, 1i, 0, -1, 2, Inf]), 2, "descend"), +%! sparse ([NaN, Inf, 2, -1, 1i, 0, 0])) %!shared a %! a = randn (10, 10); @@ -7124,14 +7212,22 @@ %! assert (is, i); ## Sparse Bool -%!assert (sort (sparse ([true, false, true, false])), sparse ([false, false, true, true])) -%!assert (sort (sparse ([true, false, true, false]), 1), sparse ([true, false, true, false])) -%!assert (sort (sparse ([true, false, true, false]), 2), sparse ([false, false, true, true])) -%!assert (sort (sparse ([true, false, true, false]), 3), sparse ([true, false, true, false])) -%!assert (sort (sparse ([true, false, true, false]), "ascend"), sparse ([false, false, true, true])) -%!assert (sort (sparse ([true, false, true, false]), 2, "ascend"), sparse ([false, false, true, true])) -%!assert (sort (sparse ([true, false, true, false]), "descend"), sparse ([true, true, false, false])) -%!assert (sort (sparse ([true, false, true, false]), 2, "descend"), sparse ([true, true, false, false])) +%!assert (sort (sparse ([true, false, true, false])), +%! sparse ([false, false, true, true])) +%!assert (sort (sparse ([true, false, true, false]), 1), +%! sparse ([true, false, true, false])) +%!assert (sort (sparse ([true, false, true, false]), 2), +%! sparse ([false, false, true, true])) +%!assert (sort (sparse ([true, false, true, false]), 3), +%! sparse ([true, false, true, false])) +%!assert (sort (sparse ([true, false, true, false]), "ascend"), +%! sparse ([false, false, true, true])) +%!assert (sort (sparse ([true, false, true, false]), 2, "ascend"), +%! sparse ([false, false, true, true])) +%!assert (sort (sparse ([true, false, true, false]), "descend"), +%! sparse ([true, true, false, false])) +%!assert (sort (sparse ([true, false, true, false]), 2, "descend"), +%! sparse ([true, true, false, false])) %!test %! [v, i] = sort (sparse ([true, false, true, false])); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/error.cc Sat Dec 25 13:38:17 2021 +0100 @@ -2187,8 +2187,3 @@ } OCTAVE_NAMESPACE_END - -// Deprecated variables and functions. - -// This variable is obsolete and always has the value 0. -int error_state = 0; diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/error.h --- a/libinterp/corefcn/error.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/error.h Sat Dec 25 13:38:17 2021 +0100 @@ -174,7 +174,8 @@ octave_map warning_options (void) const { return m_warning_options; } - void set_warning_options (const octave_map& val) { m_warning_options = val; } + void set_warning_options (const octave_map& val) + { m_warning_options = val; } octave_map warning_options (const octave_map& new_val) { @@ -187,9 +188,7 @@ last_error_message (const octave_value_list& args, int nargout); void set_last_error_message (const std::string& val) - { - m_last_error_message = val; - } + { m_last_error_message = val; } std::string last_error_message (void) const { return m_last_error_message; } @@ -203,9 +202,11 @@ OCTINTERP_API octave_value last_warning_message (const octave_value_list& args, int nargout); - void set_last_warning_message (const std::string& val) { m_last_warning_message = val; } + void set_last_warning_message (const std::string& val) + { m_last_warning_message = val; } - std::string last_warning_message (void) const { return m_last_warning_message; } + std::string last_warning_message (void) const + { return m_last_warning_message; } std::string last_warning_message (const std::string& s) { @@ -217,7 +218,8 @@ OCTINTERP_API octave_value last_warning_id (const octave_value_list& args, int nargout); - void set_last_warning_id (const std::string& val) { m_last_warning_id = val; } + void set_last_warning_id (const std::string& val) + { m_last_warning_id = val; } std::string last_warning_id (void) const { return m_last_warning_id; } @@ -566,14 +568,6 @@ octave::interpreter_try (uwp); } -OCTAVE_DEPRECATED (6, "this function is obsolete and should not be needed") -inline void reset_error_handler (void) { } #endif -// This symbol must have be declared with the correct visibility -// attributes when Octave is built, so it must appear unconditionally in -// this header file. -OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0") -extern OCTINTERP_API int error_state; - #endif diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/errwarn.h --- a/libinterp/corefcn/errwarn.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/errwarn.h Sat Dec 25 13:38:17 2021 +0100 @@ -188,11 +188,4 @@ extern OCTINTERP_API void warn_wrong_type_arg (const char *name, const octave_value& tc); -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "this function will be removed in a future version of Octave") -inline void -warn_divide_by_zero (void) -{ } #endif - -#endif diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/event-manager.h --- a/libinterp/corefcn/event-manager.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/event-manager.h Sat Dec 25 13:38:17 2021 +0100 @@ -623,7 +623,8 @@ return false; } - bool gui_status_update (const std::string& feature, const std::string& status) + bool gui_status_update (const std::string& feature, + const std::string& status) { if (enabled ()) { diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/file-io.cc --- a/libinterp/corefcn/file-io.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/file-io.cc Sat Dec 25 13:38:17 2021 +0100 @@ -67,7 +67,6 @@ #include "defun.h" #include "error.h" #include "errwarn.h" -#include "file-io.h" #include "interpreter-private.h" #include "interpreter.h" #include "load-path.h" @@ -3253,24 +3252,4 @@ return const_value ("stderr", args, streams.stderr_file ()); } -// Deprecated variables and functions. - -// Remove when corresponding global deprecated function is removed. -void mark_for_deletion_deprecated (const std::string& file) -{ - octave::interpreter& interp - = octave::__get_interpreter__ ("mark_for_deletion"); - - interp.mark_for_deletion (file); -} - -// Remove when corresponding global deprecated function is removed. -void cleanup_tmp_files_deprecated (void) -{ - octave::interpreter& interp - = octave::__get_interpreter__ ("cleanup_tmp_files"); - - interp.cleanup_tmp_files (); -} - OCTAVE_NAMESPACE_END diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/file-io.h --- a/libinterp/corefcn/file-io.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/file-io.h Sat Dec 25 13:38:17 2021 +0100 @@ -23,43 +23,9 @@ // //////////////////////////////////////////////////////////////////////// -// Written by John C. Campbell - #if ! defined (octave_file_io_h) #define octave_file_io_h 1 -#include "octave-config.h" - -#include - -OCTAVE_NAMESPACE_BEGIN - -// Use this function internally until the function that uses it is -// removed. Remove when corresponding global deprecated function is -// removed. -extern void mark_for_deletion_deprecated (const std::string&); - -// Use this function internally until the function that uses it is -// removed. Remove when corresponding global deprecated function is -// removed. -extern void cleanup_tmp_files_deprecated (void); - -OCTAVE_NAMESPACE_END - -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - -OCTAVE_DEPRECATED (6, "use 'interpreter::mark_for_deletion' instead") -inline void mark_for_deletion (const std::string& fname) -{ - octave::mark_for_deletion_deprecated (fname); -} - -OCTAVE_DEPRECATED (6, "use 'interpreter::cleanup_tmp_files' instead") -inline void cleanup_tmp_files (void) -{ - octave::cleanup_tmp_files_deprecated (); -} +#warning "file-io.h was deprecated in Octave 8 and will be removed in a future version." #endif - -#endif diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/filter.cc --- a/libinterp/corefcn/filter.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/filter.cc Sat Dec 25 13:38:17 2021 +0100 @@ -596,14 +596,16 @@ %!assert (filter (1, ones (10,1) / 10, []), []) %!assert (filter (1, ones (10,1) / 10, zeros (0,10)), zeros (0,10)) -%!assert (filter (1, ones (10,1) / 10, single (1:5)), repmat (single (10), 1, 5)) +%!assert (filter (1, ones (10,1) / 10, single (1:5)), +%! repmat (single (10), 1, 5)) ## Test using initial conditions %!assert (filter ([1, 1, 1], [1, 1], [1 2], [1, 1]), [2 2]) %!assert (filter ([1, 1, 1], [1, 1], [1 2], [1, 1]'), [2 2]) %!assert (filter ([1, 3], [1], [1 2; 3 4; 5 6], [4, 5]), [5 7; 6 10; 14 18]) %!error filter ([1, 3], [1], [1 2; 3 4; 5 6], [4, 5]') -%!assert (filter ([1, 3, 2], [1], [1 2; 3 4; 5 6], [1 0 0; 1 0 0], 2), [2 6; 3 13; 5 21]) +%!assert (filter ([1, 3, 2], [1], [1 2; 3 4; 5 6], [1 0 0; 1 0 0], 2), +%! [2 6; 3 13; 5 21]) ## Test of DIM parameter %!test diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/find.cc --- a/libinterp/corefcn/find.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/find.cc Sat Dec 25 13:38:17 2021 +0100 @@ -54,7 +54,8 @@ idx = nda.find (); // The maximum element is always at the end. - octave_idx_type iext = (idx.isempty () ? 0 : idx.xelem (idx.numel () - 1) + 1); + octave_idx_type iext = (idx.isempty () ? 0 + : idx.xelem (idx.numel () - 1) + 1); switch (nargout) { diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/gcd.cc --- a/libinterp/corefcn/gcd.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/gcd.cc Sat Dec 25 13:38:17 2021 +0100 @@ -514,7 +514,8 @@ /* %!assert (gcd (200, 300, 50, 35), 5) %!assert (gcd (int16 (200), int16 (300), int16 (50), int16 (35)), int16 (5)) -%!assert (gcd (uint64 (200), uint64 (300), uint64 (50), uint64 (35)), uint64 (5)) +%!assert (gcd (uint64 (200), uint64 (300), uint64 (50), uint64 (35)), +%! uint64 (5)) %!assert (gcd (18-i, -29+3i), -3-4i) %!test diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/gl-render.h --- a/libinterp/corefcn/gl-render.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/gl-render.h Sat Dec 25 13:38:17 2021 +0100 @@ -146,7 +146,8 @@ double p1, double p1N, double p2, double p2N, int xyz, bool is_3D); - virtual void render_tickmarks (const Matrix& ticks, double lim1, double lim2, + virtual void render_tickmarks (const Matrix& ticks, + double lim1, double lim2, double p1, double p1N, double p2, double p2N, double dx, double dy, double dz, int xyz, bool doubleside); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/gl2ps-print.cc --- a/libinterp/corefcn/gl2ps-print.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/gl2ps-print.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1325,16 +1325,20 @@ std::swap (vp_lim_min(1), vp_lim_max(1)); float clip_xmin - = do_clip ? (vp_lim_min(0) > m_xmin ? vp_lim_min(0) : m_xmin) : vp_lim_min(0); + = do_clip ? (vp_lim_min(0) > m_xmin ? vp_lim_min(0) : m_xmin) + : vp_lim_min(0); float clip_ymin - = do_clip ? (vp_lim_min(1) > m_ymin ? vp_lim_min(1) : m_ymin) : vp_lim_min(1); + = do_clip ? (vp_lim_min(1) > m_ymin ? vp_lim_min(1) : m_ymin) + : vp_lim_min(1); float clip_xmax - = do_clip ? (vp_lim_max(0) < m_xmax ? vp_lim_max(0) : m_xmax) : vp_lim_max(0); + = do_clip ? (vp_lim_max(0) < m_xmax ? vp_lim_max(0) : m_xmax) + : vp_lim_max(0); float clip_ymax - = do_clip ? (vp_lim_max(1) < m_ymax ? vp_lim_max(1) : m_ymax) : vp_lim_max(1); + = do_clip ? (vp_lim_max(1) < m_ymax ? vp_lim_max(1) : m_ymax) + : vp_lim_max(1); if (im_xmin < clip_xmin) j0 += (clip_xmin - im_xmin)/nor_dx + 1; diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/graphics-toolkit.h --- a/libinterp/corefcn/graphics-toolkit.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/graphics-toolkit.h Sat Dec 25 13:38:17 2021 +0100 @@ -284,12 +284,4 @@ }; } -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "use 'octave::graphics_toolkit' instead") -typedef octave::graphics_toolkit graphics_toolkit; - -OCTAVE_DEPRECATED (6, "use 'octave::base_graphics_toolkit' instead") -typedef octave::base_graphics_toolkit base_graphics_toolkit; #endif - -#endif diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/graphics.cc Sat Dec 25 13:38:17 2021 +0100 @@ -4138,7 +4138,8 @@ %! set (0, "units", "pixels"); %! assert (get (0, "screensize"), sz + [1, 1, 0, 0]); %! set (0, "units", "characters"); -%! assert (get (0, "screensize"), sz / dpi * (74.951 / 12.0), 0.5 / dpi * (74.951 / 12.0)); +%! assert (get (0, "screensize"), +%! sz / dpi * (74.951 / 12.0), 0.5 / dpi * (74.951 / 12.0)); %! unwind_protect_cleanup %! set (0, "units", old_units); %! end_unwind_protect @@ -5190,7 +5191,8 @@ yaxislocation_is ("origin"), m_xscale.is ("log") ? 2 : (xaxislocation_is ("origin") ? 0 : (xaxislocation_is ("bottom") ? -1 : 1)), m_ylim); - calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false, 2, m_zlim); + calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), + false, 2, m_zlim); xset (m_xlabel.handle_value (), "handlevisibility", "off"); xset (m_ylabel.handle_value (), "handlevisibility", "off"); @@ -6486,7 +6488,8 @@ if (xlabel_props.horizontalalignmentmode_is ("auto")) { xlabel_props.set_horizontalalignment - (m_xstate > AXE_DEPTH_DIR ? "center" : (m_xyzSym ? "left" : "right")); + (m_xstate > AXE_DEPTH_DIR ? "center" + : (m_xyzSym ? "left" : "right")); xlabel_props.set_horizontalalignmentmode ("auto"); } @@ -6590,7 +6593,8 @@ if (ylabel_props.horizontalalignmentmode_is ("auto")) { ylabel_props.set_horizontalalignment - (m_ystate > AXE_DEPTH_DIR ? "center" : (! m_xyzSym ? "left" : "right")); + (m_ystate > AXE_DEPTH_DIR ? "center" + : (! m_xyzSym ? "left" : "right")); ylabel_props.set_horizontalalignmentmode ("auto"); } @@ -10324,8 +10328,8 @@ if (! cd.isempty () && (c_rows != 1 || c_cols != 3) && (c_rows != x_rows || (c_cols != 1 && c_cols != 3))) { - m_bad_data_msg = "cdata must be an rgb triplet or have the same number of " - "rows as X and one or three columns"; + m_bad_data_msg = "cdata must be an rgb triplet or have the same number " + "of rows as X and one or three columns"; return; } diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/graphics.in.h Sat Dec 25 13:38:17 2021 +0100 @@ -950,7 +950,8 @@ const std::string& current_value (void) const { return m_current_val; } - std::string values_as_string (void) const { return m_vals.values_as_string (); } + std::string values_as_string (void) const + { return m_vals.values_as_string (); } Cell values_as_cell (void) const { return m_vals.values_as_cell (); } @@ -1378,7 +1379,8 @@ array_property (void) : base_property ("", graphics_handle ()), m_data (Matrix ()), m_min_val (), m_max_val (), m_min_pos (), m_max_neg (), - m_type_constraints (), m_size_constraints (), m_finite_constraint (NO_CHECK), + m_type_constraints (), m_size_constraints (), + m_finite_constraint (NO_CHECK), m_minval (std::pair (octave_NaN, true)), m_maxval (std::pair (octave_NaN, true)) { @@ -1389,7 +1391,8 @@ const octave_value& m) : base_property (nm, h), m_data (m.issparse () ? m.full_value () : m), m_min_val (), m_max_val (), m_min_pos (), m_max_neg (), - m_type_constraints (), m_size_constraints (), m_finite_constraint (NO_CHECK), + m_type_constraints (), m_size_constraints (), + m_finite_constraint (NO_CHECK), m_minval (std::pair (octave_NaN, true)), m_maxval (std::pair (octave_NaN, true)) { @@ -1401,8 +1404,10 @@ // copy constraints. array_property (const array_property& p) : base_property (p), m_data (p.m_data), - m_min_val (p.m_min_val), m_max_val (p.m_max_val), m_min_pos (p.m_min_pos), m_max_neg (p.m_max_neg), - m_type_constraints (), m_size_constraints (), m_finite_constraint (NO_CHECK), + m_min_val (p.m_min_val), m_max_val (p.m_max_val), + m_min_pos (p.m_min_pos), m_max_neg (p.m_max_neg), + m_type_constraints (), m_size_constraints (), + m_finite_constraint (NO_CHECK), m_minval (std::pair (octave_NaN, true)), m_maxval (std::pair (octave_NaN, true)) { } @@ -3383,7 +3388,9 @@ graphics_xform (const Matrix& xm, const Matrix& xim, const scaler& x, const scaler& y, const scaler& z, const Matrix& zl) - : m_xform (xm), m_xform_inv (xim), m_sx (x), m_sy (y), m_sz (z), m_zlim (zl) { } + : m_xform (xm), m_xform_inv (xim), m_sx (x), m_sy (y), + m_sz (z), m_zlim (zl) + { } graphics_xform (const graphics_xform& g) : m_xform (g.m_xform), m_xform_inv (g.m_xform_inv), m_sx (g.m_sx), @@ -3553,7 +3560,10 @@ OCTINTERP_API void update_title_position (void); graphics_xform get_transform (void) const - { return graphics_xform (m_x_render, m_x_render_inv, m_sx, m_sy, m_sz, m_x_zlim); } + { + return graphics_xform (m_x_render, m_x_render_inv, + m_sx, m_sy, m_sz, m_x_zlim); + } Matrix get_transform_matrix (void) const { return m_x_render; } Matrix get_inverse_transform_matrix (void) const { return m_x_render_inv; } @@ -3603,7 +3613,10 @@ bool get_nearhoriz (void) const { return m_nearhoriz; } ColumnVector pixel2coord (double px, double py) const - { return get_transform ().untransform (px, py, (m_x_zlim(0)+m_x_zlim(1))/2); } + { + return get_transform ().untransform (px, py, + (m_x_zlim(0)+m_x_zlim(1))/2); + } ColumnVector coord2pixel (double x, double y, double z) const { return get_transform ().transform (x, y, z); } @@ -3766,7 +3779,8 @@ radio_property gridcolormode , "{auto}|manual" radio_property gridlinestyle , "{-}|--|:|-.|none" array_property innerposition sg , default_axes_position () - // FIXME: Should be an array of "interaction objects". Make it read-only for now. + // FIXME: Should be an array of "interaction objects". + // Make it read-only for now. any_property interactions r , Matrix () double_property labelfontsizemultiplier u , 1.1 radio_property layer u , "{bottom}|top" @@ -4109,7 +4123,8 @@ void update_zticklabelmode (void) { if (m_zticklabelmode.is ("auto")) - calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false, 2, m_zlim); + calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), + false, 2, m_zlim); } void update_fontname (void) diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/hash.cc --- a/libinterp/corefcn/hash.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/hash.cc Sat Dec 25 13:38:17 2021 +0100 @@ -206,18 +206,19 @@ %!assert <*31689> (hash ("md2", "abc\0"), "5a636d615002a7874ac1c9e9a43361f7") %!assert <*31689> (hash ("md4", "abc\0"), "0ee5201897ecb206c4eaba1d2da5224d") %!assert <*31689> (hash ("md5", "abc\0"), "147a664a2ca9410911e61986d3f0d52a") -%!assert <*31689> (hash ("sha1", "abc\0"), "686483805ac47ca14e03514f7481a7973b401762") +%!assert <*31689> (hash ("sha1", "abc\0"), +%! "686483805ac47ca14e03514f7481a7973b401762") %!assert <*31689> (hash ("sha224", "abc\0"), -%! "fbc8e47920e108bb1d0b631d18b36ae9b1549d28362aa15ebe960cfb"); +%! "fbc8e47920e108bb1d0b631d18b36ae9b1549d28362aa15ebe960cfb"); %!assert <*31689> (hash ("sha256", "abc\0"), -%! "dc1114cd074914bd872cc1f9a23ec910ea2203bc79779ab2e17da25782a624fc"); +%! "dc1114cd074914bd872cc1f9a23ec910ea2203bc79779ab2e17da25782a624fc"); %!assert <*31689> (hash ("sha384", "abc\0"), -%! ["eba81f2dfba4ec60d3f786c89d91b08e6c0b63d55986874378e385", ... -%! "e6fac587cce7a520ca9437290fe626cbf75c855e17"]); +%! ["eba81f2dfba4ec60d3f786c89d91b08e6c0b63d55986874378e385", ... +%! "e6fac587cce7a520ca9437290fe626cbf75c855e17"]); %!assert <*31689> (hash ("sha512", "abc\0"), -%! ["7ce05eda233e545a2d5c626862a5ddaafb09b9d8ec3bec08aa458b", ... -%! "7c9e7d939d84a57d5a20d8a9002983aabae2457b19c50ba326bf5b", ... -%! "081f75b41342f42c3383"]); +%! ["7ce05eda233e545a2d5c626862a5ddaafb09b9d8ec3bec08aa458b", ... +%! "7c9e7d939d84a57d5a20d8a9002983aabae2457b19c50ba326bf5b", ... +%! "081f75b41342f42c3383"]); ## Test equivalence to deprecated md5sum offering file hashing %!test diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/help.cc Sat Dec 25 13:38:17 2021 +0100 @@ -637,7 +637,8 @@ std::string name; int i = 0; int c; - while (file && (c = file.get ()) != std::istream::traits_type::eof ()) + while (file + && (c = file.get ()) != std::istream::traits_type::eof ()) { if (c == '\n' || c == '\r') { diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/hex2num.cc --- a/libinterp/corefcn/hex2num.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/hex2num.cc Sat Dec 25 13:38:17 2021 +0100 @@ -361,8 +361,10 @@ } /* -%!assert (num2hex (-2:2), ["c000000000000000";"bff0000000000000";"0000000000000000";"3ff0000000000000";"4000000000000000"]) -%!assert (num2hex (single (-2:2)), ["c0000000";"bf800000";"00000000";"3f800000";"40000000"]) +%!assert (num2hex (-2:2), +%! ["c000000000000000";"bff0000000000000";"0000000000000000";"3ff0000000000000";"4000000000000000"]) +%!assert (num2hex (single (-2:2)), +%! ["c0000000";"bf800000";"00000000";"3f800000";"40000000"]) %!assert (num2hex (intmax ("uint8")), "ff") %!assert (num2hex (intmax ("uint16")), "ffff") %!assert (num2hex (intmax ("uint32")), "ffffffff") diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/input.cc --- a/libinterp/corefcn/input.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/input.cc Sat Dec 25 13:38:17 2021 +0100 @@ -89,11 +89,6 @@ // the next user prompt. bool Vdrawnow_requested = false; -// TRUE if we are recording line numbers in a source file. -// Always true except when debugging and taking input directly from -// the terminal. -bool Vtrack_line_num = true; - OCTAVE_NAMESPACE_BEGIN static std::string @@ -966,7 +961,8 @@ : m_rep (new file_reader (interp, file)) { } - input_reader::input_reader (interpreter& interp, FILE *file, const std::string& enc) + input_reader::input_reader (interpreter& interp, FILE *file, + const std::string& enc) : m_rep (new file_reader (interp, file, enc)) { } diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/input.h --- a/libinterp/corefcn/input.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/input.h Sat Dec 25 13:38:17 2021 +0100 @@ -48,11 +48,6 @@ // the next user prompt. extern OCTINTERP_API bool Vdrawnow_requested; -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "'Vtrack_line_num' is an obsolete internal variable; any uses should be removed") -extern OCTINTERP_API bool Vtrack_line_num; -#endif - extern OCTINTERP_API octave::sys::time Vlast_prompt_time; class octave_value; diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/interpreter.cc --- a/libinterp/corefcn/interpreter.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/interpreter.cc Sat Dec 25 13:38:17 2021 +0100 @@ -56,7 +56,6 @@ #include "display.h" #include "error.h" #include "event-manager.h" -#include "file-io.h" #include "graphics.h" #include "help.h" #include "input.h" @@ -1998,24 +1997,6 @@ return found; } - // Remove when corresponding public deprecated function is removed. - void interpreter::add_atexit_function_deprecated (const std::string& fname) - { - interpreter& interp - = __get_interpreter__ ("interpreter::add_atexit_function"); - - interp.add_atexit_fcn (fname); - } - - // Remove when corresponding public deprecated function is removed. - bool interpreter::remove_atexit_function_deprecated (const std::string& fname) - { - interpreter& interp - = __get_interpreter__ ("interpreter::remove_atexit_function"); - - return interp.remove_atexit_fcn (fname); - } - // What internal options get configured by --traditional. void interpreter::maximum_braindamage (void) diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/interpreter.h --- a/libinterp/corefcn/interpreter.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/interpreter.h Sat Dec 25 13:38:17 2021 +0100 @@ -538,30 +538,6 @@ bool remove_atexit_fcn (const std::string& fname); - private: - - // Remove when corresponding public deprecated function is removed. - static void add_atexit_function_deprecated (const std::string& fname); - - // Remove when corresponding public deprecated function is removed. - static bool remove_atexit_function_deprecated (const std::string& fname); - - public: - -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - OCTAVE_DEPRECATED (6, "use interpreter::add_atexit_fcn member function instead") - static void add_atexit_function (const std::string& fname) - { - add_atexit_function_deprecated (fname); - } - - OCTAVE_DEPRECATED (6, "use interpreter::remove_atexit_fcn member function instead") - static bool remove_atexit_function (const std::string& fname) - { - return remove_atexit_function_deprecated (fname); - } - #endif - static interpreter * the_interpreter (void) { return m_instance; } private: diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/inv.cc --- a/libinterp/corefcn/inv.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/inv.cc Sat Dec 25 13:38:17 2021 +0100 @@ -268,7 +268,8 @@ %!error inv (diag (complex ([0, 0]))) %!testif HAVE_UMFPACK <*56232> -%! fail ("A = inv (sparse ([1, 0, 0; 0, 0, 0; 0, 0, 1]))", "warning", "matrix singular"); +%! fail ("A = inv (sparse ([1, 0, 0; 0, 0, 0; 0, 0, 1]))", +%! "warning", "matrix singular"); %! assert (A, sparse ([Inf, 0, 0; 0, 0, 0; 0, 0, Inf])); %!error inv () diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/load-path.cc Sat Dec 25 13:38:17 2021 +0100 @@ -974,7 +974,8 @@ source_file (file, "base"); } - // FIXME: maybe we should also maintain a map to speed up this method of access. + // FIXME: maybe we should also maintain a map to speed up this method of + // access. load_path::const_dir_info_list_iterator load_path::find_dir_info (const std::string& dir_arg) const @@ -1745,7 +1746,8 @@ if (p != fcn_file_map.end ()) { std::string fname - = sys::file_ops::concat (sys::file_ops::concat (dir, "private"), fcn); + = sys::file_ops::concat (sys::file_ops::concat (dir, "private"), + fcn); if (check_file_type (fname, type, p->second, fcn, "load_path::find_private_fcn")) @@ -1916,7 +1918,8 @@ if (symtab.is_built_in_function_name (base)) { - std::string fcn_path = sys::file_ops::concat (dir_name, fname); + std::string fcn_path = sys::file_ops::concat (dir_name, + fname); warning_with_id ("Octave:shadowed-function", "function %s shadows a built-in function", @@ -1938,7 +1941,8 @@ && s_sys_path.find (old.dir_name) != std::string::npos && in_path_list (s_sys_path, old.dir_name)) { - std::string fcn_path = sys::file_ops::concat (dir_name, fname); + std::string fcn_path = sys::file_ops::concat (dir_name, + fname); warning_with_id ("Octave:shadowed-function", "function %s shadows a core library function", @@ -2038,7 +2042,8 @@ void load_path::package_info::move_fcn_map (const std::string& dir_name, - const string_vector& fcn_files, bool at_end) + const string_vector& fcn_files, + bool at_end) { octave_idx_type len = fcn_files.numel (); @@ -2392,7 +2397,8 @@ sys::file_stat fs (nm); if (fs && fs.is_dir ()) - retval += directory_path::path_sep_str () + genpath (nm, skip); + retval += (directory_path::path_sep_str () + + genpath (nm, skip)); } } } diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/load-save.cc --- a/libinterp/corefcn/load-save.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/load-save.cc Sat Dec 25 13:38:17 2021 +0100 @@ -855,7 +855,8 @@ OCTAVE_VERSION ", %Y-%m-%d %T UTC"; std::string comment_string = now.strftime (matlab_format); - std::size_t len = std::min (comment_string.length (), static_cast (124)); + std::size_t len = std::min (comment_string.length (), + static_cast (124)); memset (headertext, ' ', 124); memcpy (headertext, comment_string.data (), len); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/ls-hdf5.cc --- a/libinterp/corefcn/ls-hdf5.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/ls-hdf5.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1272,7 +1272,8 @@ if (space_hid < 0) return space_hid; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/ls-hdf5.h --- a/libinterp/corefcn/ls-hdf5.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/ls-hdf5.h Sat Dec 25 13:38:17 2021 +0100 @@ -53,7 +53,8 @@ ~hdf5_fstreambase () { close (); } - OCTINTERP_API hdf5_fstreambase (const char *name, int mode, int /* prot */ = 0); + OCTINTERP_API hdf5_fstreambase (const char *name, int mode, + int /* prot */ = 0); OCTINTERP_API void close (void); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/ls-mat5.cc --- a/libinterp/corefcn/ls-mat5.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/ls-mat5.cc Sat Dec 25 13:38:17 2021 +0100 @@ -913,7 +913,8 @@ if (ov_fcn.is_defined ()) // XXX FCN_HANDLE: SIMPLE/SCOPED - tc = octave_value (new octave_fcn_handle (ov_fcn, fname)); + tc = octave_value (new octave_fcn_handle (ov_fcn, + fname)); } else { @@ -940,7 +941,8 @@ if (ov_fcn.is_defined ()) // XXX FCN_HANDLE: SIMPLE/SCOPED - tc = octave_value (new octave_fcn_handle (ov_fcn, fname)); + tc = octave_value (new octave_fcn_handle (ov_fcn, + fname)); else { warning_with_id ("Octave:load:file-not-found", @@ -1041,7 +1043,8 @@ error ("load: failed to load anonymous function handle"); // XXX FCN_HANDLE: ANONYMOUS - tc = octave_value (new octave_fcn_handle (fh->fcn_val (), local_vars)); + tc = octave_value (new octave_fcn_handle (fh->fcn_val (), + local_vars)); } else error ("load: invalid function handle type"); @@ -2703,7 +2706,8 @@ { if (tc.is_inline_function () || tc.isobject ()) { - std::string classname = (tc.isobject () ? tc.class_name () : "inline"); + std::string classname = (tc.isobject () ? tc.class_name () + : "inline"); std::size_t namelen = classname.length (); if (namelen > max_namelen) diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/lu.cc --- a/libinterp/corefcn/lu.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/lu.cc Sat Dec 25 13:38:17 2021 +0100 @@ -781,14 +781,16 @@ %! [L,U] = luupdate (L,U,P*single (u), single (v)); %! assert (norm (vec (tril (L)-L), Inf) == 0); %! assert (norm (vec (triu (U)-U), Inf) == 0); -%! assert (norm (vec (P'*L*U - single (A) - single (u)*single (v).'), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (P'*L*U - single (A) - single (u)*single (v).'), Inf) +%! < norm (single (A))*1e1*eps ("single")); %! %!testif HAVE_QRUPDATE_LUU %! [L,U,P] = lu (single (Ac)); %! [L,U] = luupdate (L,U,P*single (uc),single (vc)); %! assert (norm (vec (tril (L)-L), Inf) == 0); %! assert (norm (vec (triu (U)-U), Inf) == 0); -%! assert (norm (vec (P'*L*U - single (Ac) - single (uc)*single (vc).'), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (P'*L*U - single (Ac) - single (uc)*single (vc).'), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); %!testif HAVE_QRUPDATE_LUU %! [L,U,P] = lu (A); @@ -823,14 +825,16 @@ %! [L,U,P] = luupdate (L,U,P,single (u),single (v)); %! assert (norm (vec (tril (L)-L), Inf) == 0); %! assert (norm (vec (triu (U)-U), Inf) == 0); -%! assert (norm (vec (P'*L*U - single (A) - single (u)*single (v).'), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (P'*L*U - single (A) - single (u)*single (v).'), Inf) +%! < norm (single (A))*1e1*eps ("single")); %! %!testif HAVE_QRUPDATE_LUU %! [L,U,P] = lu (single (Ac)); %! [L,U,P] = luupdate (L,U,P,single (uc),single (vc)); %! assert (norm (vec (tril (L)-L), Inf) == 0); %! assert (norm (vec (triu (U)-U), Inf) == 0); -%! assert (norm (vec (P'*L*U - single (Ac) - single (uc)*single (vc).'), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (P'*L*U - single (Ac) - single (uc)*single (vc).'), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); */ OCTAVE_NAMESPACE_END diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/mappers.cc --- a/libinterp/corefcn/mappers.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/mappers.cc Sat Dec 25 13:38:17 2021 +0100 @@ -280,7 +280,8 @@ %! assert (arg (single (-1)), single (pi)); %! endif %!assert (arg (single (-i)), single (-pi/2)) -%!assert (arg (single ([1, i; -1, -i])), single ([0, pi/2; pi, -pi/2]), 2e1*eps ("single")) +%!assert (arg (single ([1, i; -1, -i])), +%! single ([0, pi/2; pi, -pi/2]), 2e1*eps ("single")) %!error arg () %!error arg (1, 2) @@ -535,7 +536,8 @@ %!assert (ceil (single ([2, 1.1, -1.1, -1])), single ([2, 2, -1, -1])) ## complex single precision -%!assert (ceil (single ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i])), single ([2+2i, 2+2i, -1-i, -1-i])) +%!assert (ceil (single ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i])), +%! single ([2+2i, 2+2i, -1-i, -1-i])) %!error ceil () %!error ceil (1, 2) @@ -732,13 +734,18 @@ /* ## middle region %!assert (erf (erfinv ([-0.9 -0.3 0 0.4 0.8])), [-0.9 -0.3 0 0.4 0.8], eps) -%!assert (erf (erfinv (single ([-0.9 -0.3 0 0.4 0.8]))), single ([-0.9 -0.3 0 0.4 0.8]), eps ("single")) +%!assert (erf (erfinv (single ([-0.9 -0.3 0 0.4 0.8]))), +%! single ([-0.9 -0.3 0 0.4 0.8]), eps ("single")) ## tail region -%!assert (erf (erfinv ([-0.999 -0.99 0.9999 0.99999])), [-0.999 -0.99 0.9999 0.99999], eps) -%!assert (erf (erfinv (single ([-0.999 -0.99 0.9999 0.99999]))), single ([-0.999 -0.99 0.9999 0.99999]), eps ("single")) +%!assert (erf (erfinv ([-0.999 -0.99 0.9999 0.99999])), +%! [-0.999 -0.99 0.9999 0.99999], eps) +%!assert (erf (erfinv (single ([-0.999 -0.99 0.9999 0.99999]))), +%! single ([-0.999 -0.99 0.9999 0.99999]), eps ("single")) ## backward - loss of accuracy -%!assert (erfinv (erf ([-3 -1 -0.4 0.7 1.3 2.8])), [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) -%!assert (erfinv (erf (single ([-3 -1 -0.4 0.7 1.3 2.8]))), single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) +%!assert (erfinv (erf ([-3 -1 -0.4 0.7 1.3 2.8])), +%! [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) +%!assert (erfinv (erf (single ([-3 -1 -0.4 0.7 1.3 2.8]))), +%! single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) ## exceptional %!assert (erfinv ([-1, 1, 1.1, -2.1]), [-Inf, Inf, NaN, NaN]) %!error erfinv (1+2i) @@ -769,13 +776,18 @@ /* ## middle region %!assert (erfc (erfcinv ([1.9 1.3 1 0.6 0.2])), [1.9 1.3 1 0.6 0.2], eps) -%!assert (erfc (erfcinv (single ([1.9 1.3 1 0.6 0.2]))), single ([1.9 1.3 1 0.6 0.2]), eps ("single")) +%!assert (erfc (erfcinv (single ([1.9 1.3 1 0.6 0.2]))), +%! single ([1.9 1.3 1 0.6 0.2]), eps ("single")) ## tail region -%!assert (erfc (erfcinv ([0.001 0.01 1.9999 1.99999])), [0.001 0.01 1.9999 1.99999], eps) -%!assert (erfc (erfcinv (single ([0.001 0.01 1.9999 1.99999]))), single ([0.001 0.01 1.9999 1.99999]), eps ("single")) +%!assert (erfc (erfcinv ([0.001 0.01 1.9999 1.99999])), +%! [0.001 0.01 1.9999 1.99999], eps) +%!assert (erfc (erfcinv (single ([0.001 0.01 1.9999 1.99999]))), +%! single ([0.001 0.01 1.9999 1.99999]), eps ("single")) ## backward - loss of accuracy -%!assert (erfcinv (erfc ([-3 -1 -0.4 0.7 1.3 2.8])), [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) -%!assert (erfcinv (erfc (single ([-3 -1 -0.4 0.7 1.3 2.8]))), single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) +%!assert (erfcinv (erfc ([-3 -1 -0.4 0.7 1.3 2.8])), +%! [-3 -1 -0.4 0.7 1.3 2.8], -1e-12) +%!assert (erfcinv (erfc (single ([-3 -1 -0.4 0.7 1.3 2.8]))), +%! single ([-3 -1 -0.4 0.7 1.3 2.8]), -1e-4) ## exceptional %!assert (erfcinv ([2, 0, -0.1, 2.1]), [-Inf, Inf, NaN, NaN]) %!error erfcinv (1+2i) @@ -957,8 +969,10 @@ /* %!assert (exp ([0, 1, -1, -1000]), [1, e, 1/e, 0], sqrt (eps)) %!assert (exp (1+i), e * (cos (1) + sin (1) * i), sqrt (eps)) -%!assert (exp (single ([0, 1, -1, -1000])), single ([1, e, 1/e, 0]), sqrt (eps ("single"))) -%!assert (exp (single (1+i)), single (e * (cos (1) + sin (1) * i)), sqrt (eps ("single"))) +%!assert (exp (single ([0, 1, -1, -1000])), +%! single ([1, e, 1/e, 0]), sqrt (eps ("single"))) +%!assert (exp (single (1+i)), +%! single (e * (cos (1) + sin (1) * i)), sqrt (eps ("single"))) %!assert (exp ([Inf, -Inf, NaN]), [Inf 0 NaN]) %!assert (exp (single ([Inf, -Inf, NaN])), single ([Inf 0 NaN])) @@ -1061,7 +1075,8 @@ %!assert (fix ([1.1, 1, -1.1, -1]), [1, 1, -1, -1]) %!assert (fix ([1.1+1.1i, 1+i, -1.1-1.1i, -1-i]), [1+i, 1+i, -1-i, -1-i]) %!assert (fix (single ([1.1, 1, -1.1, -1])), single ([1, 1, -1, -1])) -%!assert (fix (single ([1.1+1.1i, 1+i, -1.1-1.1i, -1-i])), single ([1+i, 1+i, -1-i, -1-i])) +%!assert (fix (single ([1.1+1.1i, 1+i, -1.1-1.1i, -1-i])), +%! single ([1+i, 1+i, -1-i, -1-i])) %!error fix () %!error fix (1, 2) @@ -1094,7 +1109,8 @@ %!assert (floor ([2, 1.1, -1.1, -1]), [2, 1, -2, -1]) %!assert (floor ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i]), [2+2i, 1+i, -2-2i, -1-i]) %!assert (floor (single ([2, 1.1, -1.1, -1])), single ([2, 1, -2, -1])) -%!assert (floor (single ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i])), single ([2+2i, 1+i, -2-2i, -1-i])) +%!assert (floor (single ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i])), +%! single ([2+2i, 1+i, -2-2i, -1-i])) %!error floor () %!error floor (1, 2) @@ -1360,13 +1376,15 @@ %!assert (! isinf (NaN)) %!assert (! isinf (NA)) %!assert (isinf (rand (1,10)), false (1,10)) -%!assert (isinf ([NaN -Inf -1 0 1 Inf NA]), [false, true, false, false, false, true, false]) +%!assert (isinf ([NaN -Inf -1 0 1 Inf NA]), +%! [false, true, false, false, false, true, false]) %!assert (isinf (single (Inf))) %!assert (! isinf (single (NaN))) %!assert (! isinf (single (NA))) %!assert (isinf (single (rand (1,10))), false (1,10)) -%!assert (isinf (single ([NaN -Inf -1 0 1 Inf NA])), [false, true, false, false, false, true, false]) +%!assert (isinf (single ([NaN -Inf -1 0 1 Inf NA])), +%! [false, true, false, false, false, true, false]) %!assert (! isinf ('a')) %!error isinf () @@ -1454,13 +1472,15 @@ %!assert (! isna (NaN)) %!assert (isna (NA)) %!assert (isna (rand (1,10)), false (1,10)) -%!assert (isna ([NaN -Inf -1 0 1 Inf NA]), [false, false, false, false, false, false, true]) +%!assert (isna ([NaN -Inf -1 0 1 Inf NA]), +%! [false, false, false, false, false, false, true]) %!assert (! isna (single (Inf))) %!assert (! isna (single (NaN))) %!assert (isna (single (NA))) %!assert (isna (single (rand (1,10))), false (1,10)) -%!assert (isna (single ([NaN -Inf -1 0 1 Inf NA])), [false, false, false, false, false, false, true]) +%!assert (isna (single ([NaN -Inf -1 0 1 Inf NA])), +%! [false, false, false, false, false, false, true]) %!error isna () %!error isna (1, 2) @@ -1494,13 +1514,15 @@ %!assert (isnan (NaN)) %!assert (isnan (NA)) %!assert (isnan (rand (1,10)), false (1,10)) -%!assert (isnan ([NaN -Inf -1 0 1 Inf NA]), [true, false, false, false, false, false, true]) +%!assert (isnan ([NaN -Inf -1 0 1 Inf NA]), +%! [true, false, false, false, false, false, true]) %!assert (! isnan (single (Inf))) %!assert (isnan (single (NaN))) %!assert (isnan (single (NA))) %!assert (isnan (single (rand (1,10))), false (1,10)) -%!assert (isnan (single ([NaN -Inf -1 0 1 Inf NA])), [true, false, false, false, false, false, true]) +%!assert (isnan (single ([NaN -Inf -1 0 1 Inf NA])), +%! [true, false, false, false, false, false, true]) %!assert (! isnan ('a')) %!error isnan () @@ -1714,7 +1736,8 @@ %!assert (log ([-0.5, -1.5, -2.5]), log ([0.5, 1.5, 2.5]) + pi*1i, sqrt (eps)) %!assert (log (single ([1, e, e^2])), single ([0, 1, 2]), sqrt (eps ("single"))) -%!assert (log (single ([-0.5, -1.5, -2.5])), single (log ([0.5, 1.5, 2.5]) + pi*1i), 4*eps ("single")) +%!assert (log (single ([-0.5, -1.5, -2.5])), +%! single (log ([0.5, 1.5, 2.5]) + pi*1i), 4*eps ("single")) %!error log () %!error log (1, 2) @@ -1735,7 +1758,8 @@ /* %!assert (log10 ([0.01, 0.1, 1, 10, 100]), [-2, -1, 0, 1, 2], sqrt (eps)) -%!assert (log10 (single ([0.01, 0.1, 1, 10, 100])), single ([-2, -1, 0, 1, 2]), sqrt (eps ("single"))) +%!assert (log10 (single ([0.01, 0.1, 1, 10, 100])), +%! single ([-2, -1, 0, 1, 2]), sqrt (eps ("single"))) %!error log10 () %!error log10 (1, 2) @@ -1763,7 +1787,8 @@ /* %!assert (log1p ([0, 2*eps, -2*eps]), [0, 2*eps, -2*eps], 1e-29) -%!assert (log1p (single ([0, 2*eps, -2*eps])), single ([0, 2*eps, -2*eps]), 1e-29) +%!assert (log1p (single ([0, 2*eps, -2*eps])), +%! single ([0, 2*eps, -2*eps]), 1e-29) %!error log1p () %!error log1p (1, 2) @@ -2054,12 +2079,16 @@ %!assert (sqrt (4), 2) %!assert (sqrt (-1), i) %!assert (sqrt (1+i), exp (0.5 * log (1+i)), sqrt (eps)) -%!assert (sqrt ([4, -4; i, 1-i]), [2, 2i; exp(0.5 * log (i)), exp(0.5 * log (1-i))], sqrt (eps)) +%!assert (sqrt ([4, -4; i, 1-i]), +%! [2, 2i; exp(0.5 * log (i)), exp(0.5 * log (1-i))], sqrt (eps)) %!assert (sqrt (single (4)), single (2)) %!assert (sqrt (single (-1)), single (i)) -%!assert (sqrt (single (1+i)), single (exp (0.5 * log (1+i))), sqrt (eps ("single"))) -%!assert (sqrt (single ([4, -4; i, 1-i])), single ([2, 2i; exp(0.5 * log (i)), exp(0.5 * log (1-i))]), sqrt (eps ("single"))) +%!assert (sqrt (single (1+i)), +%! single (exp (0.5 * log (1+i))), sqrt (eps ("single"))) +%!assert (sqrt (single ([4, -4; i, 1-i])), +%! single ([2, 2i; exp(0.5 * log (i)), exp(0.5 * log (1-i))]), +%! sqrt (eps ("single"))) %!error sqrt () %!error sqrt (1, 2) @@ -2155,10 +2184,12 @@ /* %!assert (tolower ("OCTAVE"), "octave") %!assert (tolower ("123OCTave! _&"), "123octave! _&") -%!assert (tolower ({"ABC", "DEF", {"GHI", {"JKL"}}}), {"abc", "def", {"ghi", {"jkl"}}}) +%!assert (tolower ({"ABC", "DEF", {"GHI", {"JKL"}}}), +%! {"abc", "def", {"ghi", {"jkl"}}}) %!assert (tolower (["ABC"; "DEF"]), ["abc"; "def"]) %!assert (tolower ({["ABC"; "DEF"]}), {["abc";"def"]}) -%!assert (tolower (["ABCÄÖÜSS"; "abcäöüß"]), ["abcäöüss"; "abcäöüß"]) +%!assert (tolower (["ABCÄÖÜSS"; "abcäöüß"]), +%! ["abcäöüss"; "abcäöüß"]) %!assert (tolower (repmat ("ÄÖÜ", 2, 1, 3)), repmat ("äöü", 2, 1, 3)) %!assert (tolower (68), 68) %!assert (tolower ({[68, 68; 68, 68]}), {[68, 68; 68, 68]}) @@ -2221,10 +2252,12 @@ /* %!assert (toupper ("octave"), "OCTAVE") %!assert (toupper ("123OCTave! _&"), "123OCTAVE! _&") -%!assert (toupper ({"abc", "def", {"ghi", {"jkl"}}}), {"ABC", "DEF", {"GHI", {"JKL"}}}) +%!assert (toupper ({"abc", "def", {"ghi", {"jkl"}}}), +%! {"ABC", "DEF", {"GHI", {"JKL"}}}) %!assert (toupper (["abc"; "def"]), ["ABC"; "DEF"]) %!assert (toupper ({["abc"; "def"]}), {["ABC";"DEF"]}) -%!assert (toupper (["ABCÄÖÜSS"; "abcäöüß"]), ["ABCÄÖÜSS"; "ABCÄÖÜSS"]) +%!assert (toupper (["ABCÄÖÜSS"; "abcäöüß"]), +%! ["ABCÄÖÜSS"; "ABCÄÖÜSS"]) %!assert (toupper (repmat ("äöü", 2, 1, 3)), repmat ("ÄÖÜ", 2, 1, 3)) %!assert (toupper (100), 100) %!assert (toupper ({[100, 100; 100, 100]}), {[100, 100; 100, 100]}) diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/matrix_type.cc --- a/libinterp/corefcn/matrix_type.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/matrix_type.cc Sat Dec 25 13:38:17 2021 +0100 @@ -458,10 +458,13 @@ %!assert (matrix_type (speye (10,10)), "Diagonal") %!assert (matrix_type (speye (10,10)([2:10,1],:)), "Permuted Diagonal") -%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]]), "Upper") -%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]](:,[2,1,3:11])), "Permuted Upper") +%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]]), +%! "Upper") +%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1;sparse(9,1);1]](:,[2,1,3:11])), +%! "Permuted Upper") %!assert (matrix_type ([speye(10,10),sparse(10,1);1,sparse(1,9),1]), "Lower") -%!assert (matrix_type ([speye(10,10),sparse(10,1);1,sparse(1,9),1]([2,1,3:11],:)), "Permuted Lower") +%!assert (matrix_type ([speye(10,10),sparse(10,1);1,sparse(1,9),1]([2,1,3:11],:)), +%! "Permuted Lower") %!test %! bnd = spparms ("bandden"); @@ -486,30 +489,40 @@ %!assert (matrix_type (speye (10,11)([2:10,1],:)), "Permuted Diagonal") %!assert (matrix_type (speye (11,10)), "Diagonal") %!assert (matrix_type (speye (11,10)([2:11,1],:)), "Permuted Diagonal") -%#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]]), "Upper") -%#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]](:,[2,1,3:12])), "Permuted Upper") +%!#assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]]), "Upper") +%!#assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1,1];sparse(9,2);[1,1]]](:,[2,1,3:12])), "Permuted Upper") %!assert (matrix_type ([speye(11,9),[1;sparse(8,1);1;0]]), "Upper") -%!assert (matrix_type ([speye(11,9),[1;sparse(8,1);1;0]](:,[2,1,3:10])), "Permuted Upper") -%#!assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]), "Lower") -%#!assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]([2,1,3:12],:)), "Permuted Lower") +%!assert (matrix_type ([speye(11,9),[1;sparse(8,1);1;0]](:,[2,1,3:10])), +%! "Permuted Upper") + +%!#assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]), +%! "Lower") +%!#assert (matrix_type ([speye(10,10),sparse(10,1);[1;1],sparse(2,9),[1;1]]([2,1,3:12],:)), +%! "Permuted Lower") %!assert (matrix_type ([speye(9,11);[1,sparse(1,8),1,0]]), "Lower") -%!assert (matrix_type ([speye(9,11);[1,sparse(1,8),1,0]]([2,1,3:10],:)), "Permuted Lower") +%!assert (matrix_type ([speye(9,11);[1,sparse(1,8),1,0]]([2,1,3:10],:)), +%! "Permuted Lower") %!assert (matrix_type (spdiags (randn (10,4),[-2:1],10,9)), "Rectangular") %!assert (matrix_type (1i*speye (10,10)), "Diagonal") %!assert (matrix_type (1i*speye (10,10)([2:10,1],:)), "Permuted Diagonal") -%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]]), "Upper") -%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]](:,[2,1,3:11])), "Permuted Upper") +%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]]), +%! "Upper") +%!assert (matrix_type ([[speye(10,10);sparse(1,10)],[1i;sparse(9,1);1]](:,[2,1,3:11])), +%! "Permuted Upper") %!assert (matrix_type ([speye(10,10),sparse(10,1);1i,sparse(1,9),1]), "Lower") -%!assert (matrix_type ([speye(10,10),sparse(10,1);1i,sparse(1,9),1]([2,1,3:11],:)), "Permuted Lower") +%!assert (matrix_type ([speye(10,10),sparse(10,1);1i,sparse(1,9),1]([2,1,3:11],:)), +%! "Permuted Lower") %!test %! bnd = spparms ("bandden"); %! spparms ("bandden", 0.5); -%! assert (matrix_type (spdiags (1i*randn (10,3),[-1,0,1],10,10)), "Tridiagonal"); +%! assert (matrix_type (spdiags (1i*randn (10,3),[-1,0,1],10,10)), +%! "Tridiagonal"); %! a = 1i*(rand (9,1)-0.5); %! a = [[a;0],ones(10,1),[0;-a]]; -%! assert (matrix_type (spdiags (a,[-1,0,1],10,10)), "Tridiagonal Positive Definite"); +%! assert (matrix_type (spdiags (a,[-1,0,1],10,10)), +%! "Tridiagonal Positive Definite"); %! spparms ("bandden", bnd); %!test %! bnd = spparms ("bandden"); @@ -531,11 +544,13 @@ %#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1i,1i];sparse(9,2);[1i,1i]]]), "Upper") %#!assert (matrix_type ([[speye(10,10);sparse(1,10)],[[1i,1i];sparse(9,2);[1i,1i]]](:,[2,1,3:12])), "Permuted Upper") %!assert (matrix_type ([speye(11,9),[1i;sparse(8,1);1i;0]]), "Upper") -%!assert (matrix_type ([speye(11,9),[1i;sparse(8,1);1i;0]](:,[2,1,3:10])), "Permuted Upper") +%!assert (matrix_type ([speye(11,9),[1i;sparse(8,1);1i;0]](:,[2,1,3:10])), +%! "Permuted Upper") %#!assert (matrix_type ([speye(10,10),sparse(10,1);[1i;1i],sparse(2,9),[1i;1i]]), "Lower") %#!assert (matrix_type ([speye(10,10),sparse(10,1);[1i;1i],sparse(2,9),[1i;1i]]([2,1,3:12],:)), "Permuted Lower") %!assert (matrix_type ([speye(9,11);[1i,sparse(1,8),1i,0]]), "Lower") -%!assert (matrix_type ([speye(9,11);[1i,sparse(1,8),1i,0]]([2,1,3:10],:)), "Permuted Lower") +%!assert (matrix_type ([speye(9,11);[1i,sparse(1,8),1i,0]]([2,1,3:10],:)), +%! "Permuted Lower") %!assert (matrix_type (1i*spdiags(randn(10,4),[-2:1],10,9)), "Rectangular") %!test diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/max.cc --- a/libinterp/corefcn/max.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/max.cc Sat Dec 25 13:38:17 2021 +0100 @@ -290,7 +290,8 @@ retval(0) = range.max (); if (nargout > 1) retval(1) = static_cast - (range.increment () >= 0 ? range.numel () : 1); + (range.increment () >= 0 ? range.numel () + : 1); } } else if (arg.issparse ()) diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/mex.cc --- a/libinterp/corefcn/mex.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/mex.cc Sat Dec 25 13:38:17 2021 +0100 @@ -772,9 +772,11 @@ GET_DATA_METHOD (mxUint64, get_uint64s, mxUINT64_CLASS, mxREAL); - GET_DATA_METHOD (mxComplexDouble, get_complex_doubles, mxDOUBLE_CLASS, mxCOMPLEX); - - GET_DATA_METHOD (mxComplexSingle, get_complex_singles, mxDOUBLE_CLASS, mxCOMPLEX); + GET_DATA_METHOD (mxComplexDouble, get_complex_doubles, + mxDOUBLE_CLASS, mxCOMPLEX); + + GET_DATA_METHOD (mxComplexSingle, get_complex_singles, + mxDOUBLE_CLASS, mxCOMPLEX); #if 0 /* We don't have these yet. */ @@ -1531,8 +1533,8 @@ protected: mxArray_matlab (bool interleaved, mxClassID id = mxUNKNOWN_CLASS) - : mxArray_base (interleaved), m_class_name (nullptr), m_id (id), m_ndims (0), - m_dims (nullptr) + : mxArray_base (interleaved), m_class_name (nullptr), m_id (id), + m_ndims (0), m_dims (nullptr) { } mxArray_matlab (bool interleaved, mxClassID id, mwSize ndims, @@ -1582,7 +1584,8 @@ } mxArray_matlab (bool interleaved, mxClassID id, mwSize m, mwSize n) - : mxArray_base (interleaved), m_class_name (nullptr), m_id (id), m_ndims (2), + : mxArray_base (interleaved), m_class_name (nullptr), m_id (id), + m_ndims (2), m_dims (static_cast (mxArray::malloc (m_ndims * sizeof (mwSize)))) { m_dims[0] = m; diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/mxarray.h --- a/libinterp/corefcn/mxarray.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/mxarray.h Sat Dec 25 13:38:17 2021 +0100 @@ -652,7 +652,8 @@ void set_field_by_number (mwIndex index, int key_num, mxArray *val) { DO_VOID_MUTABLE_METHOD (set_field_by_number (index, key_num, val)); } - int get_number_of_fields (void) const { return m_rep->get_number_of_fields (); } + int get_number_of_fields (void) const + { return m_rep->get_number_of_fields (); } const char * get_field_name_by_number (int key_num) const { DO_MUTABLE_METHOD (const char*, get_field_name_by_number (key_num)); } @@ -668,7 +669,8 @@ mwIndex calc_single_subscript (mwSize nsubs, mwIndex *subs) const { return m_rep->calc_single_subscript (nsubs, subs); } - std::size_t get_element_size (void) const { return m_rep->get_element_size (); } + std::size_t get_element_size (void) const + { return m_rep->get_element_size (); } bool mutation_needed (void) const { return m_rep->mutation_needed (); } diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/oct-errno.in.cc --- a/libinterp/corefcn/oct-errno.in.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/oct-errno.in.cc Sat Dec 25 13:38:17 2021 +0100 @@ -321,7 +321,8 @@ int octave_errno::do_lookup (const std::string& name) { - return (m_errno_tbl.find (name) != m_errno_tbl.end ()) ? m_errno_tbl[name] : -1; + return (m_errno_tbl.find (name) != m_errno_tbl.end ()) ? m_errno_tbl[name] + : -1; } octave_scalar_map diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/oct-map.cc --- a/libinterp/corefcn/oct-map.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/oct-map.cc Sat Dec 25 13:38:17 2021 +0100 @@ -984,7 +984,8 @@ octave_map octave_map::page (octave_idx_type k) const { - static Array ia (dim_vector (3, 1), octave::idx_vector::colon); + static Array ia (dim_vector (3, 1), + octave::idx_vector::colon); ia(2) = k; return index (ia); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/oct-stream.cc Sat Dec 25 13:38:17 2021 +0100 @@ -348,9 +348,9 @@ void add_elt_to_list (int width, bool discard, char type, char modifier, const std::string& char_class = ""); - void process_conversion (const std::string& s, std::size_t& i, std::size_t n, - int& width, bool& discard, char& type, - char& modifier); + void process_conversion (const std::string& s, std::size_t& i, + std::size_t n, int& width, bool& discard, + char& type, char& modifier); int finish_conversion (const std::string& s, std::size_t& i, std::size_t n, int width, bool discard, char& type, @@ -1752,7 +1752,8 @@ int read_first_row (delimited_stream& is, textscan& ts); - std::list out_buf (void) const { return (m_output_container); } + std::list out_buf (void) const + { return (m_output_container); } private: @@ -2907,7 +2908,7 @@ // Check for +/- inf and NaN if (! valid && width_left >= 3) { - int i = lookahead (is, m_inf_nan, 3, false); // false -> case insensitive + int i = lookahead (is, m_inf_nan, 3, false); // false->case insensitive if (i == 0) { retval = numeric_limits::Inf (); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/oct-stream.h --- a/libinterp/corefcn/oct-stream.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/oct-stream.h Sat Dec 25 13:38:17 2021 +0100 @@ -476,7 +476,8 @@ lookup (const octave_value& fid, const std::string& who = "") const; OCTINTERP_API int remove (int fid, const std::string& who = ""); - OCTINTERP_API int remove (const octave_value& fid, const std::string& who = ""); + OCTINTERP_API int remove (const octave_value& fid, + const std::string& who = ""); OCTINTERP_API void clear (bool flush = true); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/pr-output.cc --- a/libinterp/corefcn/pr-output.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/pr-output.cc Sat Dec 25 13:38:17 2021 +0100 @@ -2558,7 +2558,8 @@ octave_idx_type col = 0; while (col < num_elem) { - octave_idx_type lim = (col + inc < num_elem ? col + inc : num_elem); + octave_idx_type lim = (col + inc < num_elem ? col + inc + : num_elem); pr_col_num_header (os, total_width, max_width, lim, col, extra_indent); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/psi.cc --- a/libinterp/corefcn/psi.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/psi.cc Sat Dec 25 13:38:17 2021 +0100 @@ -179,7 +179,8 @@ ## Interesting identities of the digamma function, in section of 5.1.3 %!assert (psi (1/3), - em - (3/2) * log (3) - ((sqrt (3) / 6) * pi), eps*10) %!assert (psi (1/4), - em -3 * log (2) - pi/2, eps*10) -%!assert (psi (1/6), - em -2 * log (2) - (3/2) * log (3) - ((sqrt (3) / 2) * pi), eps*10) +%!assert (psi (1/6), +%! - em -2 * log (2) - (3/2) * log (3) - ((sqrt (3) / 2) * pi), eps*10) ## First 6 zeros of the digamma function, in section of 5.1.5 (and also on ## Abramowitz and Stegun, page 258, eq 6.3.19) diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/qr.cc --- a/libinterp/corefcn/qr.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/qr.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1417,14 +1417,16 @@ %! [Q,R] = qrupdate (Q, R, single (u), single (v)); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R)-R), Inf) == 0); -%! assert (norm (vec (Q*R - single (A) - single (u)*single (v)'), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single (A) - single (u)*single (v)'), Inf) +%! < norm (single (A))*1e1*eps ("single")); %! %!test %! [Q,R] = qr (single (Ac)); %! [Q,R] = qrupdate (Q, R, single (uc), single (vc)); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R)-R), Inf) == 0); -%! assert (norm (vec (Q*R - single (Ac) - single (uc)*single (vc)'), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single (Ac) - single (uc)*single (vc)'), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); */ DEFUN (qrinsert, args, , @@ -1599,13 +1601,15 @@ %! [Q,R] = qrinsert (Q, R, 3, single (u)); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - single ([A(:,1:2) u A(:,3)])), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single ([A(:,1:2) u A(:,3)])), Inf) +%! < norm (single (A))*1e1*eps ("single")); %!test %! [Q,R] = qr (single (Ac)); %! [Q,R] = qrinsert (Q, R, 3, single (uc)); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - single ([Ac(:,1:2) uc Ac(:,3)])), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single ([Ac(:,1:2) uc Ac(:,3)])), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); %!test %! x = single ([0.85082 0.76426 0.42883 ]); %! @@ -1613,7 +1617,8 @@ %! [Q,R] = qrinsert (Q, R, 3, x, "row"); %! assert (norm (vec (Q'*Q - eye (6,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - single ([A(1:2,:);x;A(3:5,:)])), Inf) < norm (single (A))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single ([A(1:2,:);x;A(3:5,:)])), Inf) +%! < norm (single (A))*1e1*eps ("single")); %!test %! x = single ([0.20351 + 0.05401i 0.13141 + 0.43708i 0.29808 + 0.08789i ]); %! @@ -1621,7 +1626,8 @@ %! [Q,R] = qrinsert (Q, R, 3, x, "row"); %! assert (norm (vec (Q'*Q - eye (6,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - single ([Ac(1:2,:);x;Ac(3:5,:)])), Inf) < norm (single (Ac))*1e1*eps ("single")); +%! assert (norm (vec (Q*R - single ([Ac(1:2,:);x;Ac(3:5,:)])), Inf) +%! < norm (single (Ac))*1e1*eps ("single")); */ DEFUN (qrdelete, args, , @@ -1815,7 +1821,8 @@ %! [Q,R] = qrdelete (Q, R, 3); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(:,1:2) AA(:,4)]), Inf) < norm (AA)*1e1*eps ("single")); +%! assert (norm (vec (Q*R - [AA(:,1:2) AA(:,4)]), Inf) +%! < norm (AA)*1e1*eps ("single")); %! %!test %! AA = single ([0.364554 + 0.993117i 0.669818 + 0.510234i 0.426568 + 0.041337i 0.847051 + 0.233291i; @@ -1828,8 +1835,9 @@ %! [Q,R] = qrdelete (Q, R, 3); %! assert (norm (vec (Q'*Q - eye (5,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(:,1:2) AA(:,4)]), Inf) < norm (AA)*1e1*eps ("single")); -%! +%! assert (norm (vec (Q*R - [AA(:,1:2) AA(:,4)]), Inf) +%! < norm (AA)*1e1*eps ("single")); + %!test %! AA = single ([0.091364 0.613038 0.027504 0.999083; %! 0.594638 0.425302 0.562834 0.603537; @@ -1841,7 +1849,8 @@ %! [Q,R] = qrdelete (Q, R, 3, "row"); %! assert (norm (vec (Q'*Q - eye (4,"single")), Inf) < 1.5e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) < norm (AA)*1e1*eps ("single")); +%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) +%! < norm (AA)*1e1*eps ("single")); %!testif HAVE_QRUPDATE %! ## Same test as above but with more precicision %! AA = single ([0.091364 0.613038 0.027504 0.999083; @@ -1854,7 +1863,8 @@ %! [Q,R] = qrdelete (Q, R, 3, "row"); %! assert (norm (vec (Q'*Q - eye (4,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) < norm (AA)*1e1*eps ("single")); +%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) +%! < norm (AA)*1e1*eps ("single")); %! %!test %! AA = single ([0.364554 + 0.993117i 0.669818 + 0.510234i 0.426568 + 0.041337i 0.847051 + 0.233291i; @@ -1867,7 +1877,8 @@ %! [Q,R] = qrdelete (Q, R, 3, "row"); %! assert (norm (vec (Q'*Q - eye (4,"single")), Inf) < 1e1*eps ("single")); %! assert (norm (vec (triu (R) - R), Inf) == 0); -%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) < norm (AA)*1e1*eps ("single")); +%! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) +%! < norm (AA)*1e1*eps ("single")); */ DEFUN (qrshift, args, , diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/rand.cc --- a/libinterp/corefcn/rand.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/rand.cc Sat Dec 25 13:38:17 2021 +0100 @@ -797,7 +797,7 @@ /* %!test %! randg ("state", 12); -%! assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]); # *** Please report +%! assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]); %!test %! ## Test a known fixed state @@ -902,7 +902,7 @@ %! endif %!test %! randg ("seed", 12); -%!assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]) # *** Please report +%! assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]); %!test %! if (__random_statistical_tests__) %! ## statistical tests may fail occasionally. @@ -1022,7 +1022,7 @@ /* %!test %! randp ("state", 12); -%! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); # *** Please report +%! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); %!test %! ## Test a known fixed state %! randp ("state", 1); @@ -1034,7 +1034,9 @@ %!test %! ## Test a known fixed state %! randp ("state", 1); -%! assert (randp (1e9, 1, 6), [999915677 999976657 1000047684 1000019035 999985749 999977692], -1e-6); +%! assert (randp (1e9, 1, 6), +%! [999915677 999976657 1000047684 1000019035 999985749 999977692], +%! -1e-6); %!test %! ## Test a known fixed seed %! randp ("seed", 1); @@ -1047,7 +1049,9 @@ %!test %! ## Test a known fixed seed %! randp ("seed", 1); -%! assert (randp (1e9, 1, 6), [1000006208 1000012224 999981120 999963520 999963072 999981440], -1e-6); +%! assert (randp (1e9, 1, 6), +%! [1000006208 1000012224 999981120 999963520 999963072 999981440], +%! -1e-6); %!test %! if (__random_statistical_tests__) %! ## statistical tests may fail occasionally. @@ -1076,7 +1080,7 @@ %! endif %!test %! randp ("seed", 12); -%! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); # *** Please report +%! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); %!test %! if (__random_statistical_tests__) %! ## statistical tests may fail occasionally. diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/regexp.cc --- a/libinterp/corefcn/regexp.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/regexp.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1127,8 +1127,10 @@ %! assert (isempty (fieldnames (nm))); %! assert (sp, { "", "", "A", "", "E", "" }); -%!assert (regexp ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, '-'), {6;[1,5,9];zeros(1,0)}) -%!assert (regexp ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, {'-';'f';'q'}), {6;[3,7];[1,9]}) +%!assert (regexp ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, '-'), +%! {6;[1,5,9];zeros(1,0)}) +%!assert (regexp ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, {'-';'f';'q'}), +%! {6;[3,7];[1,9]}) %!assert (regexp ('Strings', {'t','s'}), {2, 7}) ## Test case for lookaround operators @@ -1351,9 +1353,12 @@ %!error regexpi ('string', 'tri', 'BadArg') %!error regexpi ('string') -%!assert (regexpi ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, '-'), {6;[1,5,9];zeros(1, 0)}) -%!assert (regexpi ({'asdfg-dfd', '-dfd-dfd-', 'qasfdfdaq'}, '-'), {6, [1,5,9], zeros(1,0)}) -%!assert (regexpi ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, {'-';'f';'q'}), {6;[3,7];[1,9]}) +%!assert (regexpi ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, '-'), +%! {6;[1,5,9];zeros(1, 0)}) +%!assert (regexpi ({'asdfg-dfd', '-dfd-dfd-', 'qasfdfdaq'}, '-'), +%! {6, [1,5,9], zeros(1,0)}) +%!assert (regexpi ({'asdfg-dfd';'-dfd-dfd-';'qasfdfdaq'}, {'-';'f';'q'}), +%! {6;[3,7];[1,9]}) %!assert (regexpi ('Strings', {'t', 's'}), {2, [1, 7]}) %!assert (regexpi ("\n", '\n'), 1) @@ -1588,7 +1593,8 @@ ## Empty matches were broken on ARM architecture %!test <*52810> -%! assert (strcmp (regexprep ("\nabc", "^(\t*)(abc)$", "$1$2", "lineanchors"), "\nabc")) +%! assert (strcmp (regexprep ("\nabc", "^(\t*)(abc)$", "$1$2", "lineanchors"), +%! "\nabc")); */ OCTAVE_NAMESPACE_END diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/sparse-xdiv.h --- a/libinterp/corefcn/sparse-xdiv.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/sparse-xdiv.h Sat Dec 25 13:38:17 2021 +0100 @@ -157,7 +157,8 @@ OCTAVE_DEPRECATED (7, "use 'octave::xdiv' instead") inline SparseComplexMatrix -xdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, MatrixType& typ) +xdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, + MatrixType& typ) { return octave::xdiv (a, b, typ); } @@ -269,7 +270,8 @@ OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline SparseComplexMatrix -xleftdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, MatrixType& typ) +xleftdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, + MatrixType& typ) { return octave::xleftdiv (a, b, typ); } @@ -297,7 +299,8 @@ OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline SparseComplexMatrix -xleftdiv (const ComplexDiagMatrix& a, const SparseComplexMatrix& b, MatrixType& typ) +xleftdiv (const ComplexDiagMatrix& a, const SparseComplexMatrix& b, + MatrixType& typ) { return octave::xleftdiv (a, b, typ); } diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/stack-frame.cc --- a/libinterp/corefcn/stack-frame.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/stack-frame.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1041,7 +1041,8 @@ const std::shared_ptr& parent_link, const std::shared_ptr& static_link) { - return new compiled_fcn_stack_frame (tw, fcn, index, parent_link, static_link); + return new compiled_fcn_stack_frame (tw, fcn, index, + parent_link, static_link); } stack_frame * stack_frame::create (tree_evaluator& tw, @@ -1059,7 +1060,8 @@ const std::shared_ptr& static_link, const std::shared_ptr& access_link) { - return new user_fcn_stack_frame (tw, fcn, index, parent_link, static_link, access_link); + return new user_fcn_stack_frame (tw, fcn, index, + parent_link, static_link, access_link); } stack_frame * stack_frame::create (tree_evaluator& tw, @@ -1069,7 +1071,9 @@ const local_vars_map& local_vars, const std::shared_ptr& access_link) { - return new user_fcn_stack_frame (tw, fcn, index, parent_link, static_link, local_vars, access_link); + return new user_fcn_stack_frame (tw, fcn, index, + parent_link, static_link, local_vars, + access_link); } stack_frame * stack_frame::create (tree_evaluator& tw, diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/strfind.cc --- a/libinterp/corefcn/strfind.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/strfind.cc Sat Dec 25 13:38:17 2021 +0100 @@ -299,8 +299,10 @@ %!assert (strfind ("abababa", "aba", "forcecelloutput", false), [1, 3, 5]) %!assert (strfind ("abababa", "aba", "forcecelloutput", true), {[1, 3, 5]}) %!assert (strfind ({"abababa", "bla", "bla"}, "a"), {[1, 3, 5, 7], 3, 3}) -%!assert (strfind ({"abababa", "bla", "bla"}, "a", "forcecelloutput", false), {[1, 3, 5, 7], 3, 3}) -%!assert (strfind ({"abababa", "bla", "bla"}, "a", "forcecelloutput", true), {[1, 3, 5, 7], 3, 3}) +%!assert (strfind ({"abababa", "bla", "bla"}, "a", "forcecelloutput", false), +%! {[1, 3, 5, 7], 3, 3}) +%!assert (strfind ({"abababa", "bla", "bla"}, "a", "forcecelloutput", true), +%! {[1, 3, 5, 7], 3, 3}) %!assert (strfind ("Linux _is_ user-friendly. It just isn't ignorant-friendly or idiot-friendly.", "friendly"), [17, 50, 68]) %!assert (strfind ("abc", ""), []) %!assert (strfind ("abc", {"", "b", ""}), {[], 2, []}) diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/strfns.cc --- a/libinterp/corefcn/strfns.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/strfns.cc Sat Dec 25 13:38:17 2021 +0100 @@ -665,7 +665,8 @@ %!assert (strncmp ("abce", {"abcd", "bca", "abc"}, 3), logical ([1, 0, 1])) %!assert (strncmp ("abc", {"abcd", "bca", "abc"}, 4), logical ([0, 0, 1])) %!assert (strncmp ({"abcd", "bca", "abc"},"abce", 3), logical ([1, 0, 1])) -%!assert (strncmp ({"abcd", "bca", "abc"},{"abcd", "bca", "abe"}, 3), logical ([1, 1, 0])) +%!assert (strncmp ({"abcd", "bca", "abc"},{"abcd", "bca", "abe"}, 3), +%! logical ([1, 1, 0])) %!assert (strncmp ("abc", {"abcd", 10}, 2), logical ([1, 0])) %!assert <*54373> (strncmp ("abc", "abc", 100)) diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/sylvester.cc --- a/libinterp/corefcn/sylvester.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/sylvester.cc Sat Dec 25 13:38:17 2021 +0100 @@ -158,8 +158,10 @@ } /* -%!assert (sylvester ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]), [1/2, 2/3; 2/3, 1/2], sqrt (eps)) -%!assert (sylvester (single ([1, 2; 3, 4]), single ([5, 6; 7, 8]), single ([9, 10; 11, 12])), single ([1/2, 2/3; 2/3, 1/2]), sqrt (eps ("single"))) +%!assert (sylvester ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]), +%! [1/2, 2/3; 2/3, 1/2], sqrt (eps)) +%!assert (sylvester (single ([1, 2; 3, 4]), single ([5, 6; 7, 8]), single ([9, 10; 11, 12])), +%! single ([1/2, 2/3; 2/3, 1/2]), sqrt (eps ("single"))) ## Test input validation %!error sylvester () diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/symbfact.cc --- a/libinterp/corefcn/symbfact.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/symbfact.cc Sat Dec 25 13:38:17 2021 +0100 @@ -427,7 +427,8 @@ %! fail ("symbfact (sparse (1), {1})", "TYP must be a string"); %! fail ("symbfact (sparse (1), 'foobar')", 'unrecognized TYP "foobar"'); %! fail ("symbfact (sparse (1), 'sym', {'L'})", "MODE must be a string"); -%! fail ('symbfact (sparse (1), "sym", "foobar")', 'unrecognized MODE "foobar"'); +%! fail ('symbfact (sparse (1), "sym", "foobar")', +%! 'unrecognized MODE "foobar"'); %! fail ("symbfact (sparse ([1, 2; 3, 4; 5, 6]))", "S must be a square matrix"); */ diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/symrec.h --- a/libinterp/corefcn/symrec.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/symrec.h Sat Dec 25 13:38:17 2021 +0100 @@ -194,11 +194,13 @@ explicit operator bool () const { return is_valid (); } - void set_frame_offset (std::size_t offset) { m_rep->set_frame_offset (offset); } + void set_frame_offset (std::size_t offset) + { m_rep->set_frame_offset (offset); } std::size_t frame_offset (void) const { return m_rep->frame_offset (); } - void set_data_offset (std::size_t offset) { m_rep->set_data_offset (offset); } + void set_data_offset (std::size_t offset) + { m_rep->set_data_offset (offset); } std::size_t data_offset (void) const { return m_rep->data_offset (); } diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/symscope.cc --- a/libinterp/corefcn/symscope.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/symscope.cc Sat Dec 25 13:38:17 2021 +0100 @@ -335,7 +335,8 @@ } bool symbol_scope_rep::look_nonlocal (const std::string& name, - std::size_t offset, symbol_record& result) + std::size_t offset, + symbol_record& result) { offset++; diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/symtab.cc --- a/libinterp/corefcn/symtab.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/symtab.cc Sat Dec 25 13:38:17 2021 +0100 @@ -722,98 +722,6 @@ return octave_value (info_map); } - // Remove when corresponding public deprecated function is removed. - bool symbol_table::at_top_level_deprecated (void) - { - return m_interpreter.at_top_level (); - } - - // Remove when corresponding public deprecated function is removed. - octave_value symbol_table::varval_deprecated (const std::string& name) const - { - return m_interpreter.varval (name); - } - - // Remove when corresponding public deprecated function is removed. - octave_value symbol_table::global_varval_deprecated (const std::string& name) const - { - return m_interpreter.global_varval (name); - } - - // Remove when corresponding public deprecated function is removed. - octave_value symbol_table::top_level_varval_deprecated (const std::string& name) const - { - return m_interpreter.top_level_varval (name); - } - - // Remove when corresponding public deprecated function is removed. - std::list symbol_table::global_variable_names_deprecated (void) - { - return m_interpreter.global_variable_names (); - } - - // Remove when corresponding public deprecated function is removed. - std::list symbol_table::top_level_variable_names_deprecated (void) - { - return m_interpreter.top_level_variable_names (); - } - - // Remove when corresponding public deprecated function is removed. - std::list symbol_table::variable_names_deprecated (void) - { - return m_interpreter.variable_names (); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::assign_deprecated (const std::string& name, const octave_value& value) - { - return m_interpreter.assign (name, value); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_all_deprecated (bool force) - { - return m_interpreter.clear_all (force); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_global_deprecated (const std::string& name) - { - return m_interpreter.clear_global_variable (name); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_global_pattern_deprecated (const std::string& pattern) - { - return m_interpreter.clear_global_variable_pattern (pattern); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_symbol_deprecated (const std::string& name) - { - return m_interpreter.clear_symbol (name); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::clear_symbol_pattern_deprecated (const std::string& pattern) - { - return m_interpreter.clear_symbol_pattern (pattern); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::global_assign_deprecated (const std::string& name, - const octave_value& value) - { - return m_interpreter.global_assign (name, value); - } - - // Remove when corresponding public deprecated function is removed. - void symbol_table::top_level_assign_deprecated (const std::string& name, - const octave_value& value) - { - return m_interpreter.top_level_assign (name, value); - } - DEFMETHOD (__dump_symtab_info__, interp, args, , doc: /* -*- texinfo -*- @deftypefn {} {} __dump_symtab_info__ () diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/symtab.h --- a/libinterp/corefcn/symtab.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/symtab.h Sat Dec 25 13:38:17 2021 +0100 @@ -185,170 +185,6 @@ fcn_info * get_fcn_info (const std::string& name); - // The remaining functions are all provided for backward - // compatibility. New code should use the functions provided by the - // interpreter class. - - private: - - // Remove when corresponding public deprecated function is removed. - bool at_top_level_deprecated (void); - - // Remove when corresponding public deprecated function is removed. - octave_value varval_deprecated (const std::string& name) const; - - // Remove when corresponding public deprecated function is removed. - octave_value global_varval_deprecated (const std::string& name) const; - - // Remove when corresponding public deprecated function is removed. - octave_value top_level_varval_deprecated (const std::string& name) const; - - // Remove when corresponding public deprecated function is removed. - std::list global_variable_names_deprecated (void); - - // Remove when corresponding public deprecated function is removed. - std::list top_level_variable_names_deprecated (void); - - // Remove when corresponding public deprecated function is removed. - std::list variable_names_deprecated (void); - - // Remove when corresponding public deprecated function is removed. - void assign_deprecated (const std::string& name, - const octave_value& value = octave_value ()); - - // Remove when corresponding public deprecated function is removed. - // Note, FORCE_ADD no longer has any meaning. - void assign_deprecated (const std::string& name, const octave_value& value, - bool /*force_add*/); - - // Remove when corresponding public deprecated function is removed. - void clear_all_deprecated (bool force = false); - - // Remove when corresponding public deprecated function is removed. - void clear_global_deprecated (const std::string& name); - - // Remove when corresponding public deprecated function is removed. - void clear_global_pattern_deprecated (const std::string& pattern); - - // Remove when corresponding public deprecated function is removed. - void clear_symbol_deprecated (const std::string& name); - - // Remove when corresponding public deprecated function is removed. - void clear_symbol_pattern_deprecated (const std::string& pattern); - - // Remove when corresponding public deprecated function is removed. - void global_assign_deprecated (const std::string& name, - const octave_value& value = octave_value ()); - - // Remove when corresponding public deprecated function is removed. - void top_level_assign_deprecated (const std::string& name, - const octave_value& value = octave_value ()); - - public: - -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - OCTAVE_DEPRECATED (6, "use 'interpreter::at_top_level' instead") - bool at_top_level (void) - { - return at_top_level_deprecated (); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::varval' instead") - octave_value varval (const std::string& name) const - { - return varval_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::global_varval' instead") - octave_value global_varval (const std::string& name) const - { - return global_varval_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::top_level_varval' instead") - octave_value top_level_varval (const std::string& name) const - { - return top_level_varval_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::global_variable_names' instead") - std::list global_variable_names (void) - { - return global_variable_names_deprecated (); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::top_level_variable_names' instead") - std::list top_level_variable_names (void) - { - return top_level_variable_names_deprecated (); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::variable_names' instead") - std::list variable_names (void) - { - return variable_names_deprecated (); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::assign' instead") - void assign (const std::string& name, - const octave_value& value = octave_value ()) - { - assign_deprecated (name, value); - } - - // Note, FORCE_ADD no longer has any meaning. - OCTAVE_DEPRECATED (6, "use 'interpreter::assign' instead") - void assign (const std::string& name, const octave_value& value, - bool /*force_add*/) - { - assign_deprecated (name, value); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_all' instead") - void clear_all (bool force = false) - { - clear_all_deprecated (force); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_global' instead") - void clear_global (const std::string& name) - { - clear_global_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_global_pattern' instead") - void clear_global_pattern (const std::string& pattern) - { - clear_global_pattern_deprecated (pattern); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_symbol' instead") - void clear_symbol (const std::string& name) - { - clear_symbol_deprecated (name); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::clear_symbol_pattern' instead") - void clear_symbol_pattern (const std::string& pattern) - { - clear_symbol_pattern_deprecated (pattern); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::global_assign' instead") - void global_assign (const std::string& name, - const octave_value& value = octave_value ()) - { - global_assign_deprecated (name, value); - } - - OCTAVE_DEPRECATED (6, "use 'interpreter::top_level_assign' instead") - void top_level_assign (const std::string& name, - const octave_value& value = octave_value ()) - { - top_level_assign_deprecated (name, value); - } -#endif - private: interpreter& m_interpreter; diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/toplev.cc --- a/libinterp/corefcn/toplev.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/toplev.cc Sat Dec 25 13:38:17 2021 +0100 @@ -54,7 +54,6 @@ #include "defaults.h" #include "defun.h" #include "error.h" -#include "file-io.h" #include "help.h" #include "interpreter-private.h" #include "octave.h" diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/typecast.cc --- a/libinterp/corefcn/typecast.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/typecast.cc Sat Dec 25 13:38:17 2021 +0100 @@ -239,8 +239,8 @@ ; else if (numclass == "char") retval = octave_value (reinterpret_copy - (data, byte_size, old_dims), array.is_dq_string () ? '"' - : '\''); + (data, byte_size, old_dims), + array.is_dq_string () ? '"' : '\''); else if (numclass[0] == 'i') { if (numclass == "int8") diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/utils.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1491,7 +1491,8 @@ return s.length (); } - std::size_t format (std::ostream& os, const std::string& enc, const char *fmt, ...) + std::size_t format (std::ostream& os, const std::string& enc, + const char *fmt, ...) { std::size_t retval; @@ -1505,8 +1506,8 @@ return retval; } - std::size_t vformat (std::ostream& os, const std::string& enc, const char *fmt, - va_list args) + std::size_t vformat (std::ostream& os, const std::string& enc, + const char *fmt, va_list args) { std::string s = vasprintf (fmt, args); diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/variables.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1525,45 +1525,3 @@ } OCTAVE_NAMESPACE_END - -// DEPRECATED in Octave 6 - -octave_function * -extract_function (const octave_value& arg, const std::string& warn_for, - const std::string& fname, const std::string& header, - const std::string& trailer) -{ - octave_function *retval = is_valid_function (arg, warn_for, 0); - - if (! retval) - { - std::string s = arg.xstring_value ("%s: argument must be a string", - warn_for.c_str ()); - - std::string cmd = header; - cmd.append (s); - cmd.append (trailer); - - int parse_status; - - octave::interpreter& interp - = octave::__get_interpreter__ ("extract_function"); - - interp.eval_string (cmd, true, parse_status, 0); - - if (parse_status != 0) - error ("%s: '%s' is not valid as a function", - warn_for.c_str (), fname.c_str ()); - - retval = is_valid_function (fname, warn_for, 0); - - if (! retval) - error ("%s: '%s' is not valid as a function", - warn_for.c_str (), fname.c_str ()); - - warning ("%s: passing function body as a string is obsolete; please use anonymous functions", - warn_for.c_str ()); - } - - return retval; -} diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/variables.h --- a/libinterp/corefcn/variables.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/variables.h Sat Dec 25 13:38:17 2021 +0100 @@ -124,29 +124,34 @@ OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (bool& var, const octave_value_list& args, int nargout, const char *nm) +set_internal_variable (bool& var, const octave_value_list& args, int nargout, + const char *nm) { return octave::set_internal_variable (var, args, nargout, nm); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (char& var, const octave_value_list& args, int nargout, const char *nm) +set_internal_variable (char& var, const octave_value_list& args, int nargout, + const char *nm) { return octave::set_internal_variable (var, args, nargout, nm); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (int& var, const octave_value_list& args, int nargout, const char *nm, - int minval = std::numeric_limits::min (), int maxval = std::numeric_limits::max ()) +set_internal_variable (int& var, const octave_value_list& args, int nargout, + const char *nm, + int minval = std::numeric_limits::min (), + int maxval = std::numeric_limits::max ()) { return octave::set_internal_variable (var, args, nargout, nm, minval, maxval); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (double& var, const octave_value_list& args, int nargout, const char *nm, +set_internal_variable (double& var, const octave_value_list& args, int nargout, + const char *nm, double minval = -octave::numeric_limits::Inf (), double maxval = octave::numeric_limits::Inf ()) { @@ -155,24 +160,24 @@ OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (std::string& var, const octave_value_list& args, int nargout, const char *nm, - bool empty_ok = true) +set_internal_variable (std::string& var, const octave_value_list& args, + int nargout, const char *nm, bool empty_ok = true) { return octave::set_internal_variable (var, args, nargout, nm, empty_ok); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (std::string& var, const octave_value_list& args, int nargout, const char *nm, - const char **choices) +set_internal_variable (std::string& var, const octave_value_list& args, + int nargout, const char *nm, const char **choices) { return octave::set_internal_variable (var, args, nargout, nm, choices); } OCTAVE_DEPRECATED (7, "use 'octave::set_internal_variable' instead") inline octave_value -set_internal_variable (int& var, const octave_value_list& args, int nargout, const char *nm, - const char **choices) +set_internal_variable (int& var, const octave_value_list& args, int nargout, + const char *nm, const char **choices) { return octave::set_internal_variable (var, args, nargout, nm, choices); } @@ -184,12 +189,6 @@ return octave::maybe_missing_function_hook (name); } -OCTAVE_DEPRECATED (6, "use 'octave::get_function_handle' instead") -extern OCTINTERP_API octave_function * -extract_function (const octave_value& arg, const std::string& warn_for, - const std::string& fname, const std::string& header, - const std::string& trailer); - #endif // The following macros should also be considered obsolete. diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/xdiv.h --- a/libinterp/corefcn/xdiv.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/xdiv.h Sat Dec 25 13:38:17 2021 +0100 @@ -77,7 +77,8 @@ extern FloatMatrix elem_xdiv (float a, const FloatMatrix& b); extern FloatComplexMatrix elem_xdiv (float a, const FloatComplexMatrix& b); -extern FloatComplexMatrix elem_xdiv (const FloatComplex a, const FloatMatrix& b); +extern FloatComplexMatrix elem_xdiv (const FloatComplex a, + const FloatMatrix& b); extern FloatComplexMatrix elem_xdiv (const FloatComplex a, const FloatComplexMatrix& b); @@ -243,31 +244,32 @@ OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline Matrix -xleftdiv (const Matrix& a, const Matrix& b, MatrixType& typ, blas_trans_type transt = blas_no_trans) +xleftdiv (const Matrix& a, const Matrix& b, + MatrixType& typ, blas_trans_type transt = blas_no_trans) { return octave::xleftdiv (a, b, typ, transt); } OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline ComplexMatrix -xleftdiv (const Matrix& a, const ComplexMatrix& b, MatrixType& typ, - blas_trans_type transt = blas_no_trans) +xleftdiv (const Matrix& a, const ComplexMatrix& b, + MatrixType& typ, blas_trans_type transt = blas_no_trans) { return octave::xleftdiv (a, b, typ, transt); } OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline ComplexMatrix -xleftdiv (const ComplexMatrix& a, const Matrix& b, MatrixType& typ, - blas_trans_type transt = blas_no_trans) +xleftdiv (const ComplexMatrix& a, const Matrix& b, + MatrixType& typ, blas_trans_type transt = blas_no_trans) { return octave::xleftdiv (a, b, typ, transt); } OCTAVE_DEPRECATED (7, "use 'octave::xleftdiv' instead") inline ComplexMatrix -xleftdiv (const ComplexMatrix& a, const ComplexMatrix& b, MatrixType& typ, - blas_trans_type transt = blas_no_trans) +xleftdiv (const ComplexMatrix& a, const ComplexMatrix& b, + MatrixType& typ, blas_trans_type transt = blas_no_trans) { return octave::xleftdiv (a, b, typ, transt); } diff -r b876de975edf -r 00d82e792b8b libinterp/corefcn/xpow.h --- a/libinterp/corefcn/xpow.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/corefcn/xpow.h Sat Dec 25 13:38:17 2021 +0100 @@ -77,7 +77,8 @@ extern OCTINTERP_API octave_value elem_xpow (double a, const Matrix& b); extern OCTINTERP_API octave_value elem_xpow (double a, const ComplexMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (double a, const octave::range& r); +extern OCTINTERP_API octave_value elem_xpow (double a, + const octave::range& r); extern OCTINTERP_API octave_value elem_xpow (const Matrix& a, double b); extern OCTINTERP_API octave_value elem_xpow (const Matrix& a, const Matrix& b); @@ -88,7 +89,8 @@ extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const Matrix& b); extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const ComplexMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const octave::range& r); +extern OCTINTERP_API octave_value elem_xpow (const Complex& a, + const octave::range& r); extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, double b); extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, diff -r b876de975edf -r 00d82e792b8b libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/dldfcn/__init_fltk__.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1340,7 +1340,8 @@ return 0; } - octave_scalar_map format_key_event (int e_key, const char *e_text, int e_state) + octave_scalar_map format_key_event (int e_key, const char *e_text, + int e_state) { octave_scalar_map evt; @@ -1798,7 +1799,8 @@ case FL_RELEASE: if (! m_fp.get_windowbuttonupfcn ().isempty ()) { - set_currentpoint (Fl::event_x (), Fl::event_y () - menu_dy ()); + set_currentpoint (Fl::event_x (), + Fl::event_y () - menu_dy ()); m_fp.execute_windowbuttonupfcn (); } diff -r b876de975edf -r 00d82e792b8b libinterp/dldfcn/__ode15__.cc --- a/libinterp/dldfcn/__ode15__.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/dldfcn/__ode15__.cc Sat Dec 25 13:38:17 2021 +0100 @@ -863,7 +863,8 @@ } else if (index.numel () > 0) - // Not first step: register all events and test if stop integration or not + // Not first step: register all events and test + // if stop integration or not { te.resize (temp + index.numel ()); ye.resize (temp + index.numel (), m_num); diff -r b876de975edf -r 00d82e792b8b libinterp/dldfcn/audiodevinfo.cc --- a/libinterp/dldfcn/audiodevinfo.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/dldfcn/audiodevinfo.cc Sat Dec 25 13:38:17 2021 +0100 @@ -500,7 +500,8 @@ %! devinfo = audiodevinfo; %! nout = audiodevinfo (0); %! nin = audiodevinfo (1); -%! ## There might be multiple devices with the same name (e.g. on Windows WDM-KS) +%! ## There might be multiple devices with the same name +%! ## (e.g., on Windows WDM-KS) %! ## Check only the first of each unique device name. %! [unq_out_name, idx_unique] = unique ({devinfo.output(:).Name}); %! unq_out_id = [devinfo.output(idx_unique).ID]; diff -r b876de975edf -r 00d82e792b8b libinterp/dldfcn/audioread.cc --- a/libinterp/dldfcn/audioread.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/dldfcn/audioread.cc Sat Dec 25 13:38:17 2021 +0100 @@ -545,17 +545,26 @@ ## Test input validation %!testif HAVE_SNDFILE %! fail ("audiowrite (1, 1, 8e3)", "FILENAME must be a string"); -%! fail ("audiowrite ('foo', int64 (1), 8e3)", "wrong type argument 'int64 scalar'"); -%! fail ("audiowrite ('foo', [0 1], [8e3, 8e3])", "FS must be a positive scalar"); +%! fail ("audiowrite ('foo', int64 (1), 8e3)", +%! "wrong type argument 'int64 scalar'"); +%! fail ("audiowrite ('foo', [0 1], [8e3, 8e3])", +%! "FS must be a positive scalar"); %! fail ("audiowrite ('foo', 1, {8e3})", "FS must be a .* integer"); %! fail ("audiowrite ('foo', 1, -8e3)", "FS must be a positive"); -%! fail ("audiowrite ('foo', 1, 8e3, 'bitspersample')", "invalid number of arguments"); -%! fail ("audiowrite ('foo', 1, 8e3, 'bitspersample', 48)", "wrong number of bits specified"); -%! fail ("audiowrite ('foo', 1, 8e3, 'quality', [2 3 4])", "Quality value must be a scalar"); -%! fail ("audiowrite ('foo', 1, 8e3, 'quality', NaN)", "Quality value must be .* between 0 and 100"); -%! fail ("audiowrite ('foo', 1, 8e3, 'quality', -1)", "Quality value must be .* between 0 and 100"); -%! fail ("audiowrite ('foo', 1, 8e3, 'quality', 101)", "Quality value must be .* between 0 and 100"); -%! fail ("audiowrite ('foo', 1, 8e3, 'foo', 'bar')", "unrecognized option: 'foo'"); +%! fail ("audiowrite ('foo', 1, 8e3, 'bitspersample')", +%! "invalid number of arguments"); +%! fail ("audiowrite ('foo', 1, 8e3, 'bitspersample', 48)", +%! "wrong number of bits specified"); +%! fail ("audiowrite ('foo', 1, 8e3, 'quality', [2 3 4])", +%! "Quality value must be a scalar"); +%! fail ("audiowrite ('foo', 1, 8e3, 'quality', NaN)", +%! "Quality value must be .* between 0 and 100"); +%! fail ("audiowrite ('foo', 1, 8e3, 'quality', -1)", +%! "Quality value must be .* between 0 and 100"); +%! fail ("audiowrite ('foo', 1, 8e3, 'quality', 101)", +%! "Quality value must be .* between 0 and 100"); +%! fail ("audiowrite ('foo', 1, 8e3, 'foo', 'bar')", +%! "unrecognized option: 'foo'"); */ DEFUN_DLD (audioinfo, args, , diff -r b876de975edf -r 00d82e792b8b libinterp/dldfcn/convhulln.cc --- a/libinterp/dldfcn/convhulln.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/dldfcn/convhulln.cc Sat Dec 25 13:38:17 2021 +0100 @@ -304,7 +304,8 @@ %! [h, v] = convhulln (cube, "Qt"); %! assert (size (h), [12 3]); %! h = sortrows (sort (h, 2), [1:3]); -%! assert (h, [1 2 4; 1 2 6; 1 4 8; 1 5 6; 1 5 8; 2 3 4; 2 3 7; 2 6 7; 3 4 7; 4 7 8; 5 6 7; 5 7 8]); +%! assert (h, +%! [1 2 4; 1 2 6; 1 4 8; 1 5 6; 1 5 8; 2 3 4; 2 3 7; 2 6 7; 3 4 7; 4 7 8; 5 6 7; 5 7 8]); %! assert (v, 1, 10*eps); %! [h2, v2] = convhulln (cube); # Test default option = "Qt" %! assert (size (h2), size (h)); @@ -316,7 +317,8 @@ %! cube = [0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1]; %! [h, v] = convhulln (cube, "QJ"); %! assert (size (h), [12 3]); -%! assert (sortrows (sort (h, 2), [1:3]), [1 2 4; 1 2 5; 1 4 5; 2 3 4; 2 3 6; 2 5 6; 3 4 8; 3 6 7; 3 7 8; 4 5 8; 5 6 8; 6 7 8]); +%! assert (sortrows (sort (h, 2), [1:3]), +%! [1 2 4; 1 2 5; 1 4 5; 2 3 4; 2 3 6; 2 5 6; 3 4 8; 3 6 7; 3 7 8; 4 5 8; 5 6 8; 6 7 8]); %! assert (v, 1.0, 1e6*eps); %!testif HAVE_QHULL diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/cdef-class.cc --- a/libinterp/octave-value/cdef-class.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/cdef-class.cc Sat Dec 25 13:38:17 2021 +0100 @@ -312,7 +312,8 @@ } void - cdef_class::cdef_class_rep::find_methods (std::map& meths, + cdef_class::cdef_class_rep::find_methods (std::map& meths, bool only_inherited, bool include_ctor) { @@ -1020,9 +1021,9 @@ // Look for all external methods visible on octave path at the // time of loading of the class. // - // FIXME: This is an "extension" to Matlab behavior, which only looks - // in the @-folder containing the original classdef file. However, - // this is easier to implement it that way at the moment. + // FIXME: This is an "extension" to Matlab behavior, which only + // looks in the @-folder containing the original classdef file. + // However, this is easier to implement it that way at the moment. std::list external_methods = lp.methods (full_class_name); @@ -1052,9 +1053,9 @@ // Property blocks // FIXME: default property expression should be able to call static - // methods of the class being constructed. A restricted CLASSNAME - // symbol should be added to the scope before evaluating default - // value expressions. + // methods of the class being constructed. A restricted + // CLASSNAME symbol should be added to the scope before + // evaluating default value expressions. std::list pb_list = b->properties_list (); @@ -1127,17 +1128,17 @@ // list of all valid properties that can be used to // validate the attribute list (see bug #60593). - // Install property attributes. This is done before assigning - // the property accessors so we can do validation by using - // cdef_property methods. + // Install property attributes. This is done before + // assigning the property accessors so we can do validation + // by using cdef_property methods. for (auto& attrnm_val : amap) prop.put (attrnm_val.first, attrnm_val.second); // Install property access methods, if any. Remove the - // accessor methods from the temporary storage map, so we can - // detect which ones are invalid and do not correspond to a - // defined property. + // accessor methods from the temporary storage map, so we + // can detect which ones are invalid and do not correspond + // to a defined property. auto git = get_methods.find (prop_name); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/cdef-class.h --- a/libinterp/octave-value/cdef-class.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/cdef-class.h Sat Dec 25 13:38:17 2021 +0100 @@ -214,7 +214,7 @@ bool m_handle_class; // The list of super-class constructors that are called implicitly by the - // the classdef engine when creating an object. These constructors are not + // classdef engine when creating an object. These constructors are not // called explicitly by the class constructor. std::list m_implicit_ctor_list; @@ -239,7 +239,8 @@ cdef_class (void) : cdef_meta_object () { } - cdef_class (const std::string& nm, const std::list& superclasses) + cdef_class (const std::string& nm, + const std::list& superclasses) : cdef_meta_object (new cdef_class_rep (superclasses)) { get_rep ()->set_name (nm); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/cdef-manager.cc --- a/libinterp/octave-value/cdef-manager.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/cdef-manager.cc Sat Dec 25 13:38:17 2021 +0100 @@ -281,7 +281,8 @@ static octave_value_list package_getAllPackages (interpreter& interp, - const octave_value_list& /* args */, int /* nargout */) + const octave_value_list& /* args */, + int /* nargout */) { std::map toplevel_packages; diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/cdef-method.cc --- a/libinterp/octave-value/cdef-method.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/cdef-method.cc Sat Dec 25 13:38:17 2021 +0100 @@ -218,7 +218,8 @@ switch (type[0]) { case '(': - retval = (execute (idx.front (), type.length () > 1 ? 1 : nargout, true)); + retval = (execute (idx.front (), + type.length () > 1 ? 1 : nargout, true)); break; default: diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/cdef-object.cc diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/cdef-object.h --- a/libinterp/octave-value/cdef-object.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/cdef-object.h Sat Dec 25 13:38:17 2021 +0100 @@ -207,7 +207,8 @@ // FIXME: use a null object? cdef_object (void) : m_rep (new cdef_object_rep ()) { } - cdef_object (const cdef_object& obj) : m_rep (obj.m_rep) { m_rep->m_count++; } + cdef_object (const cdef_object& obj) : m_rep (obj.m_rep) + { m_rep->m_count++; } cdef_object (cdef_object_rep *r) : m_rep (r) { } @@ -256,7 +257,8 @@ bool is_meta_object (void) const { return m_rep->is_meta_object (); } - Array array_value (void) const { return m_rep->array_value (); } + Array array_value (void) const + { return m_rep->array_value (); } void put (const std::string& pname, const octave_value& val) { diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/cdef-package.h --- a/libinterp/octave-value/cdef-package.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/cdef-package.h Sat Dec 25 13:38:17 2021 +0100 @@ -61,7 +61,8 @@ ~cdef_package_rep (void) = default; - cdef_object_rep * copy (void) const { return new cdef_package_rep (*this); } + cdef_object_rep * copy (void) const + { return new cdef_package_rep (*this); } bool is_package (void) const { return true; } diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/cdef-utils.cc --- a/libinterp/octave-value/cdef-utils.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/cdef-utils.cc Sat Dec 25 13:38:17 2021 +0100 @@ -318,16 +318,17 @@ return true; else if (is_strict_superclass (ctx, cls)) { - // Calling a protected method or property in a derived class. - // This is only allowed if the context class knows about it - // and has access to it. + // Calling a protected method or property in a derived + // class. This is only allowed if the context class knows + // about it and has access to it. if (! meth_name.empty ()) { cdef_method m = ctx.find_method (meth_name); if (m.ok ()) - return check_access (ctx, m.get ("Access"), meth_name); + return check_access (ctx, + m.get ("Access"), meth_name); return false; } diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-base-diag.cc --- a/libinterp/octave-value/ov-base-diag.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-base-diag.cc Sat Dec 25 13:38:17 2021 +0100 @@ -299,7 +299,8 @@ // FIXME: We really need some traits so that ad hoc hooks like this // are not necessary. template inline T helper_iscomplex (T) { return false; } -template inline T helper_iscomplex (std::complex) { return true; } +template inline T helper_iscomplex (std::complex) +{ return true; } template double diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-base-int.cc --- a/libinterp/octave-value/ov-base-int.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-base-int.cc Sat Dec 25 13:38:17 2021 +0100 @@ -453,7 +453,8 @@ if (space_hid < 0) return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, octave_H5P_DEFAULT); @@ -742,7 +743,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, octave_H5P_DEFAULT); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-base.h --- a/libinterp/octave-value/ov-base.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-base.h Sat Dec 25 13:38:17 2021 +0100 @@ -301,7 +301,8 @@ virtual octave_value as_uint32 (void) const; virtual octave_value as_uint64 (void) const; - virtual octave_base_value * try_narrowing_conversion (void) { return nullptr; } + virtual octave_base_value * try_narrowing_conversion (void) + { return nullptr; } virtual void maybe_economize (void) { } diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-bool-mat.cc --- a/libinterp/octave-value/ov-bool-mat.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-bool-mat.cc Sat Dec 25 13:38:17 2021 +0100 @@ -456,7 +456,8 @@ if (space_hid < 0) return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_HBOOL, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_HBOOL, space_hid, octave_H5P_DEFAULT); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-bool.cc --- a/libinterp/octave-value/ov-bool.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-bool.cc Sat Dec 25 13:38:17 2021 +0100 @@ -241,7 +241,8 @@ if (space_hid < 0) return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid, octave_H5P_DEFAULT); @@ -253,8 +254,8 @@ } double tmp = double_value (); - retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, &tmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, &tmp) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-cell.cc --- a/libinterp/octave-value/ov-cell.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-cell.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1045,7 +1045,8 @@ #if defined (HAVE_HDF5_18) size_hid = H5Dcreate (data_hid, "dims", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else size_hid = H5Dcreate (data_hid, "dims", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-ch-mat.cc --- a/libinterp/octave-value/ov-ch-mat.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-ch-mat.cc Sat Dec 25 13:38:17 2021 +0100 @@ -320,12 +320,12 @@ p(1) = 0; \ in_m = matrix.permute (p); \ } \ - std::size_t output_length = in_m.numel (); \ + std::size_t output_length = in_m.numel (); \ charNDArray ch_array = charNDArray (in_m.dims ()); \ const uint8_t *in = reinterpret_cast (in_m.data ()); \ uint8_t *buf = reinterpret_cast (ch_array.fortran_vec ()); \ U8_FCN (in, matrix.numel (), nullptr, buf, &output_length); \ - if (output_length != static_cast (matrix.numel ())) \ + if (output_length != static_cast (matrix.numel ())) \ { \ warning_with_id ("Octave:multi_byte_char_length", \ "UMAP: Possible multi-byte error."); \ diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-class.h --- a/libinterp/octave-value/ov-class.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-class.h Sat Dec 25 13:38:17 2021 +0100 @@ -188,7 +188,8 @@ OCTINTERP_API void print (std::ostream& os, bool pr_as_read_syntax = false); - OCTINTERP_API void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; + OCTINTERP_API void print_raw (std::ostream& os, + bool pr_as_read_syntax = false) const; OCTINTERP_API bool reconstruct_exemplar (void); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-classdef.cc Sat Dec 25 13:38:17 2021 +0100 @@ -140,7 +140,8 @@ } } - retval = m_object.subsref (type, idx, 1, skip, octave::cdef_class (), auto_add); + retval = m_object.subsref (type, idx, 1, skip, + octave::cdef_class (), auto_add); if (type.length () > skip && idx.size () > skip) retval = retval(0).next_subsref (1, type, idx, skip); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-colon.h --- a/libinterp/octave-value/ov-colon.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-colon.h Sat Dec 25 13:38:17 2021 +0100 @@ -73,7 +73,8 @@ OCTINTERP_API void print (std::ostream& os, bool pr_as_read_syntax = false); - OCTINTERP_API void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; + OCTINTERP_API void print_raw (std::ostream& os, + bool pr_as_read_syntax = false) const; private: diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-complex.cc --- a/libinterp/octave-value/ov-complex.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-complex.cc Sat Dec 25 13:38:17 2021 +0100 @@ -385,7 +385,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); #endif diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-cx-mat.cc --- a/libinterp/octave-value/ov-cx-mat.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-cx-mat.cc Sat Dec 25 13:38:17 2021 +0100 @@ -596,7 +596,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); #endif diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-cx-sparse.cc --- a/libinterp/octave-value/ov-cx-sparse.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-cx-sparse.cc Sat Dec 25 13:38:17 2021 +0100 @@ -400,7 +400,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -425,7 +426,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -450,7 +452,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -488,7 +491,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -526,7 +530,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -582,7 +587,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "data", type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "data", type_hid, space_hid, octave_H5P_DEFAULT); @@ -601,8 +607,8 @@ { Complex *ctmp = m.xdata (); - retval = H5Dwrite (data_hid, complex_type_hid, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, ctmp) >= 0; + retval = H5Dwrite (data_hid, complex_type_hid, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, ctmp) >= 0; } H5Dclose (data_hid); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-dld-fcn.h --- a/libinterp/octave-value/ov-dld-fcn.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-dld-fcn.h Sat Dec 25 13:38:17 2021 +0100 @@ -69,7 +69,8 @@ ~octave_dld_function (void); - void mark_fcn_file_up_to_date (const octave::sys::time& t) { m_t_checked = t; } + void mark_fcn_file_up_to_date (const octave::sys::time& t) + { m_t_checked = t; } std::string fcn_file_name (void) const; diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-fcn-handle.cc --- a/libinterp/octave-value/ov-fcn-handle.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-fcn-handle.cc Sat Dec 25 13:38:17 2021 +0100 @@ -217,7 +217,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_hid, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_hid, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -289,7 +290,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -362,7 +364,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -552,7 +555,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -656,7 +660,8 @@ bool load_binary (std::istream& is, bool swap, mach_info::float_format fmt); - bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); + bool save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool save_as_floats); bool load_hdf5 (octave_hdf5_id& group_hid, octave_hdf5_id& space_hid, octave_hdf5_id& type_hid); @@ -1359,7 +1364,8 @@ a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, octave_H5P_DEFAULT, octave_H5P_DEFAULT); #else - a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, octave_H5P_DEFAULT); + a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, + octave_H5P_DEFAULT); #endif if (a_id >= 0) @@ -2389,7 +2395,8 @@ retval = false; #if defined (HAVE_HDF5_18) data_hid = H5Gcreate (group_hid, "symbol table", - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Gcreate (group_hid, "symbol table", 0); #endif @@ -2954,14 +2961,16 @@ std::string name; is >> name; - new_rep.reset (new octave::simple_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::simple_fcn_handle (name, fpath, + octaveroot)); } else if (subtype == "scopedfunction") { std::string name; is >> name; - new_rep.reset (new octave::scoped_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::scoped_fcn_handle (name, fpath, + octaveroot)); } else if (subtype == "anonymous") new_rep.reset (new octave::anonymous_fcn_handle ()); @@ -2970,14 +2979,16 @@ std::string name; is >> name; - new_rep.reset (new octave::nested_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::nested_fcn_handle (name, fpath, + octaveroot)); } else if (subtype == "classsimple") { std::string name; is >> name; - new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, + octaveroot)); } } @@ -3077,7 +3088,8 @@ else if (subtype == "nested") new_rep.reset (new octave::nested_fcn_handle (name, fpath, octaveroot)); else if (subtype == "classsimple") - new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, + octaveroot)); } if (! new_rep) @@ -3230,7 +3242,8 @@ else if (subtype == "nested") new_rep.reset (new octave::nested_fcn_handle (name, fpath, octaveroot)); else if (subtype == "classsimple") - new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, octaveroot)); + new_rep.reset (new octave::class_simple_fcn_handle (name, fpath, + octaveroot)); } bool status = false; @@ -3397,16 +3410,6 @@ OCTAVE_NAMESPACE_BEGIN - // DEPRECATED in Octave 6. - - octave_value - make_fcn_handle (interpreter& interp, const std::string& nm) - { - tree_evaluator& tw = interp.get_evaluator (); - - return tw.make_fcn_handle (nm); - } - DEFUN (functions, args, , doc: /* -*- texinfo -*- @deftypefn {} {@var{s} =} functions (@var{fcn_handle}) diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-fcn-handle.h --- a/libinterp/octave-value/ov-fcn-handle.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-fcn-handle.h Sat Dec 25 13:38:17 2021 +0100 @@ -373,14 +373,4 @@ extern bool is_equal_to (const octave_fcn_handle& fh1, const octave_fcn_handle& fh2); -OCTAVE_NAMESPACE_BEGIN - -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - OCTAVE_DEPRECATED (6, "use 'tree_evaluator::make_fcn_handle' instead") - extern octave_value - make_fcn_handle (interpreter& interp, const std::string& name); #endif - -OCTAVE_NAMESPACE_END - -#endif diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-float.cc --- a/libinterp/octave-value/ov-float.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-float.cc Sat Dec 25 13:38:17 2021 +0100 @@ -262,7 +262,8 @@ if (space_hid < 0) return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_FLOAT, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_FLOAT, space_hid, octave_H5P_DEFAULT); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-flt-complex.cc --- a/libinterp/octave-value/ov-flt-complex.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-flt-complex.cc Sat Dec 25 13:38:17 2021 +0100 @@ -326,7 +326,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); #endif diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-flt-cx-diag.cc --- a/libinterp/octave-value/ov-flt-cx-diag.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-flt-cx-diag.cc Sat Dec 25 13:38:17 2021 +0100 @@ -148,8 +148,7 @@ return ::imag (m_matrix); case umap_sqrt: { - FloatComplexColumnVector tmp = m_matrix.extract_diag ().map - (std::sqrt); + FloatComplexColumnVector tmp = m_matrix.extract_diag ().map (std::sqrt); FloatComplexDiagMatrix retval (tmp); retval.resize (m_matrix.rows (), m_matrix.columns ()); return retval; diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-flt-cx-mat.cc --- a/libinterp/octave-value/ov-flt-cx-mat.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-flt-cx-mat.cc Sat Dec 25 13:38:17 2021 +0100 @@ -552,7 +552,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); #endif diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-flt-re-diag.cc --- a/libinterp/octave-value/ov-flt-re-diag.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-flt-re-diag.cc Sat Dec 25 13:38:17 2021 +0100 @@ -166,8 +166,7 @@ return DiagMatrix (m_matrix.rows (), m_matrix.cols (), 0.0); case umap_sqrt: { - FloatComplexColumnVector tmp = m_matrix.extract_diag ().map - (octave::math::rc_sqrt); + FloatComplexColumnVector tmp = m_matrix.extract_diag ().map (octave::math::rc_sqrt); FloatComplexDiagMatrix retval (tmp); retval.resize (m_matrix.rows (), m_matrix.columns ()); return retval; diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-flt-re-mat.cc --- a/libinterp/octave-value/ov-flt-re-mat.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-flt-re-mat.cc Sat Dec 25 13:38:17 2021 +0100 @@ -619,7 +619,8 @@ #endif #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, octave_H5P_DEFAULT); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-java.cc --- a/libinterp/octave-value/ov-java.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-java.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1265,7 +1265,8 @@ } static octave_value -convert_to_string (JNIEnv *jni_env, jobject m_java_object, bool force, char type) +convert_to_string (JNIEnv *jni_env, jobject m_java_object, bool force, + char type) { octave_value retval; @@ -1274,7 +1275,8 @@ jclass_ref cls (jni_env, jni_env->FindClass ("java/lang/String")); if (jni_env->IsInstanceOf (m_java_object, cls)) - retval = octave_value (jstring_to_string (jni_env, m_java_object), type); + retval = octave_value (jstring_to_string (jni_env, m_java_object), + type); else if (force) { cls = jni_env->FindClass ("[Ljava/lang/String;"); @@ -2366,7 +2368,8 @@ JNIEnv *current_env = thread_jni_env (); if (current_env) - return convert_to_string (current_env, TO_JOBJECT (to_java ()), force, type); + return convert_to_string (current_env, TO_JOBJECT (to_java ()), force, + type); else return octave_value (""); @@ -3494,14 +3497,22 @@ ## Check we can create objects that wrap java literals %!testif HAVE_JAVA; usejava ("jvm") <*38821> -%! assert (class (javaObject ("java.lang.Byte", uint8 (1))), "java.lang.Byte"); -%! assert (class (javaObject ("java.lang.Byte", int8 (1))), "java.lang.Byte"); -%! assert (class (javaObject ("java.lang.Short", uint16 (1))), "java.lang.Short"); -%! assert (class (javaObject ("java.lang.Short", int16 (1))), "java.lang.Short"); -%! assert (class (javaObject ("java.lang.Integer", uint32 (1))), "java.lang.Integer"); -%! assert (class (javaObject ("java.lang.Integer", int32 (1))), "java.lang.Integer"); -%! assert (class (javaObject ("java.lang.Long", uint64 (1))), "java.lang.Long"); -%! assert (class (javaObject ("java.lang.Long", int64 (1))), "java.lang.Long"); +%! assert (class (javaObject ("java.lang.Byte", uint8 (1))), +%! "java.lang.Byte"); +%! assert (class (javaObject ("java.lang.Byte", int8 (1))), +%! "java.lang.Byte"); +%! assert (class (javaObject ("java.lang.Short", uint16 (1))), +%! "java.lang.Short"); +%! assert (class (javaObject ("java.lang.Short", int16 (1))), +%! "java.lang.Short"); +%! assert (class (javaObject ("java.lang.Integer", uint32 (1))), +%! "java.lang.Integer"); +%! assert (class (javaObject ("java.lang.Integer", int32 (1))), +%! "java.lang.Integer"); +%! assert (class (javaObject ("java.lang.Long", uint64 (1))), +%! "java.lang.Long"); +%! assert (class (javaObject ("java.lang.Long", int64 (1))), +%! "java.lang.Long"); ## More checks of java numeric and boolean class instances %!testif HAVE_JAVA; usejava ("jvm") @@ -3559,8 +3570,10 @@ %! assert (javaMethod ("valueOf", "java.lang.Long", int64 (1)), 1) %! assert (javaMethod ("valueOf", "java.lang.Float", single (1)), 1) %! assert (javaMethod ("valueOf", "java.lang.Double", double (1)), 1) -%! assert (class (javaMethod ("valueOf", "java.math.BigDecimal", double (1))), "java.math.BigDecimal") -%! assert (class (javaMethod ("valueOf", "java.math.BigInteger", int64 (1))), "java.math.BigInteger") +%! assert (class (javaMethod ("valueOf", "java.math.BigDecimal", double (1))), +%! "java.math.BigDecimal") +%! assert (class (javaMethod ("valueOf", "java.math.BigInteger", int64 (1))), +%! "java.math.BigInteger") ## Automatic conversion from string cell array into String[] %!testif HAVE_JAVA; usejava ("jvm") <*45290> diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-lazy-idx.cc --- a/libinterp/octave-value/ov-lazy-idx.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-lazy-idx.cc Sat Dec 25 13:38:17 2021 +0100 @@ -99,7 +99,8 @@ octave_value octave_lazy_index::squeeze (void) const { - return octave::idx_vector (m_index.as_array ().squeeze (), m_index.extent (0)); + return octave::idx_vector (m_index.as_array ().squeeze (), + m_index.extent (0)); } octave_value diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-lazy-idx.h --- a/libinterp/octave-value/ov-lazy-idx.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-lazy-idx.h Sat Dec 25 13:38:17 2021 +0100 @@ -60,7 +60,8 @@ octave_value fast_elem_extract (octave_idx_type n) const; - std::size_t byte_size (void) const { return numel () * sizeof (octave_idx_type); } + std::size_t byte_size (void) const + { return numel () * sizeof (octave_idx_type); } octave_value squeeze (void) const; diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-range.cc --- a/libinterp/octave-value/ov-range.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-range.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1042,7 +1042,8 @@ } # if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); # else data_hid = H5Dcreate (loc_id, name, type_hid, space_hid, octave_H5P_DEFAULT); # endif diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-re-mat.cc --- a/libinterp/octave-value/ov-re-mat.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-re-mat.cc Sat Dec 25 13:38:17 2021 +0100 @@ -745,7 +745,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, octave_H5P_DEFAULT); @@ -757,8 +758,8 @@ } double *mtmp = m.fortran_vec (); - retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, mtmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, mtmp) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-re-mat.h --- a/libinterp/octave-value/ov-re-mat.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-re-mat.h Sat Dec 25 13:38:17 2021 +0100 @@ -106,7 +106,10 @@ octave_base_value * try_narrowing_conversion (void); octave::idx_vector index_vector (bool /* require_integers */ = false) const - { return idx_cache ? *idx_cache : set_idx_cache (octave::idx_vector (matrix)); } + { + return idx_cache ? *idx_cache + : set_idx_cache (octave::idx_vector (matrix)); + } builtin_type_t builtin_type (void) const { return btyp_double; } diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-re-sparse.cc --- a/libinterp/octave-value/ov-re-sparse.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-re-sparse.cc Sat Dec 25 13:38:17 2021 +0100 @@ -421,7 +421,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nr", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -445,7 +446,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nc", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -470,7 +472,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "nz", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -508,7 +511,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "cidx", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -545,7 +549,8 @@ } #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "ridx", H5T_NATIVE_IDX, space_hid, octave_H5P_DEFAULT); @@ -594,7 +599,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (group_hid, "data", save_type_hid, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (group_hid, "data", save_type_hid, space_hid, octave_H5P_DEFAULT); @@ -607,8 +613,8 @@ } double *dtmp = m.xdata (); - retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, dtmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, dtmp) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); H5Gclose (group_hid); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-scalar.cc --- a/libinterp/octave-value/ov-scalar.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-scalar.cc Sat Dec 25 13:38:17 2021 +0100 @@ -283,7 +283,8 @@ #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_DOUBLE, space_hid, octave_H5P_DEFAULT); @@ -295,8 +296,8 @@ } double tmp = double_value (); - retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, octave_H5S_ALL, - octave_H5P_DEFAULT, &tmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_DOUBLE, octave_H5S_ALL, + octave_H5S_ALL, octave_H5P_DEFAULT, &tmp) >= 0; H5Dclose (data_hid); H5Sclose (space_hid); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-str-mat.cc --- a/libinterp/octave-value/ov-str-mat.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-str-mat.cc Sat Dec 25 13:38:17 2021 +0100 @@ -593,7 +593,8 @@ return false; #if defined (HAVE_HDF5_18) data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_CHAR, space_hid, - octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); + octave_H5P_DEFAULT, octave_H5P_DEFAULT, + octave_H5P_DEFAULT); #else data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_CHAR, space_hid, octave_H5P_DEFAULT); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-struct.cc --- a/libinterp/octave-value/ov-struct.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-struct.cc Sat Dec 25 13:38:17 2021 +0100 @@ -1885,9 +1885,11 @@ %!assert (size (x), [0,0]) %!assert (isstruct (x)) %!assert (isempty (fieldnames (x))) -%!fail ('struct ("a",{1,2},"b",{1,2,3})', 'dimensions of parameter 2 do not match those of parameter 4') +%!fail ('struct ("a",{1,2},"b",{1,2,3})', +%! 'dimensions of parameter 2 do not match those of parameter 4') %!error struct (1,2,3,4) -%!fail ('struct ("1",2,"3")', 'struct: additional arguments must occur as "field", VALUE pairs') +%!fail ('struct ("1",2,"3")', +%! 'struct: additional arguments must occur as "field", VALUE pairs') */ DEFUN (isstruct, args, , diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov-typeinfo.cc --- a/libinterp/octave-value/ov-typeinfo.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov-typeinfo.cc Sat Dec 25 13:38:17 2021 +0100 @@ -645,7 +645,8 @@ { octave_scalar_map retval; - int len = std::min (static_cast (m_binary_ops.columns ()), m_num_types); + int len = std::min (static_cast (m_binary_ops.columns ()), + m_num_types); dim_vector tab_dims (len, len); @@ -697,7 +698,8 @@ { octave_scalar_map retval; - int len = std::min (static_cast (m_assign_ops.columns ()), m_num_types); + int len = std::min (static_cast (m_assign_ops.columns ()), + m_num_types); dim_vector tab_dims (len, len); @@ -722,7 +724,8 @@ { octave_scalar_map retval; - int len = std::min (static_cast (m_assignany_ops.columns ()), m_num_types); + int len = std::min (static_cast (m_assignany_ops.columns ()), + m_num_types); dim_vector tab_dims (1, len); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov.cc Sat Dec 25 13:38:17 2021 +0100 @@ -3179,28 +3179,36 @@ return make_range (base, increment, limit, is_for_cmd_expr); case btyp_int8: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_int16: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_int32: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_int64: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_uint8: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_uint16: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_uint32: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_uint64: - return make_range (base, increment, limit, is_for_cmd_expr); + return make_range (base, increment, limit, + is_for_cmd_expr); case btyp_char: return make_range (base, increment, limit, is_for_cmd_expr); diff -r b876de975edf -r 00d82e792b8b libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave-value/ov.h Sat Dec 25 13:38:17 2021 +0100 @@ -1526,7 +1526,8 @@ bool islocked (void) const { return m_rep->islocked (); } - void call_object_destructor (void) { return m_rep->call_object_destructor (); } + void call_object_destructor (void) + { return m_rep->call_object_destructor (); } octave_value dump (void) const { return m_rep->dump (); } diff -r b876de975edf -r 00d82e792b8b libinterp/octave.cc --- a/libinterp/octave.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave.cc Sat Dec 25 13:38:17 2021 +0100 @@ -242,7 +242,7 @@ octave_scalar_map m; m.assign ("sys_argc", sys_argc ()); - m.assign ("sys_argv", string_vector (sys_argv ())); + m.assign ("sys_argv", Cell (string_vector (sys_argv ()))); m.assign ("echo_commands", echo_commands ()); m.assign ("forced_interactive", forced_interactive ()); m.assign ("forced_line_editing", forced_line_editing ()); @@ -267,8 +267,8 @@ m.assign ("info_file", info_file ()); m.assign ("info_program", info_program ()); m.assign ("texi_macros_file", texi_macros_file ()); - m.assign ("all_args", all_args ()); - m.assign ("remaining_args", remaining_args ()); + m.assign ("all_args", Cell (all_args ())); + m.assign ("remaining_args", Cell (remaining_args ())); return m; } diff -r b876de975edf -r 00d82e792b8b libinterp/octave.h --- a/libinterp/octave.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/octave.h Sat Dec 25 13:38:17 2021 +0100 @@ -57,11 +57,13 @@ bool echo_commands (void) const { return m_echo_commands; } - bool experimental_terminal_widget (void) const { return m_experimental_terminal_widget; } + bool experimental_terminal_widget (void) const + { return m_experimental_terminal_widget; } bool forced_interactive (void) const { return m_forced_interactive; } bool forced_line_editing (void) const { return m_forced_line_editing; } bool gui (void) const { return m_gui; } - bool inhibit_startup_message (void) const { return m_inhibit_startup_message; } + bool inhibit_startup_message (void) const + { return m_inhibit_startup_message; } bool line_editing (void) const { return m_line_editing; } bool no_window_system (void) const { return m_no_window_system; } @@ -74,7 +76,8 @@ bool traditional (void) const { return m_traditional; } bool verbose_flag (void) const { return m_verbose_flag; } std::string code_to_eval (void) const { return m_code_to_eval; } - std::list command_line_path (void) const { return m_command_line_path; } + std::list command_line_path (void) const + { return m_command_line_path; } std::string docstrings_file (void) const { return m_docstrings_file; } std::string doc_cache_file (void) const { return m_doc_cache_file; } std::string exec_path (void) const { return m_exec_path; } @@ -87,7 +90,8 @@ void echo_commands (bool arg) { m_echo_commands = arg; } - void experimental_terminal_widget (bool arg) { m_experimental_terminal_widget = arg; } + void experimental_terminal_widget (bool arg) + { m_experimental_terminal_widget = arg; } void forced_line_editing (bool arg) { m_forced_line_editing = arg; } void forced_interactive (bool arg) { m_forced_interactive = arg; } void gui (bool arg) { m_gui = arg; } @@ -104,7 +108,8 @@ void traditional (bool arg) { m_traditional = arg; } void verbose_flag (bool arg) { m_verbose_flag = arg; } void code_to_eval (const std::string& arg) { m_code_to_eval = arg; } - void command_line_path (const std::list& arg) { m_command_line_path = arg; } + void command_line_path (const std::list& arg) + { m_command_line_path = arg; } void docstrings_file (const std::string& arg) { m_docstrings_file = arg; } void doc_cache_file (const std::string& arg) { m_doc_cache_file = arg; } void exec_path (const std::string& arg) { m_exec_path = arg; } @@ -282,7 +287,8 @@ virtual bool gui_running (void) const { return false; } virtual void gui_running (bool) { } - void program_invocation_name (const std::string& nm) { m_program_invocation_name = nm; } + void program_invocation_name (const std::string& nm) + { m_program_invocation_name = nm; } void program_name (const std::string& nm) { m_program_name = nm; } diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/bp-table.cc --- a/libinterp/parse-tree/bp-table.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/bp-table.cc Sat Dec 25 13:38:17 2021 +0100 @@ -176,7 +176,7 @@ { Array W = U.index (0); if (W.isempty () || W(0).isempty ()) - es.debug_on_caught (true); // like "dbstop if caught error" with no ID + es.debug_on_caught (true); // like "dbstop if caught error" with no ID else if (! W(0).iscell ()) fail = true; else @@ -670,7 +670,8 @@ // a breakpoint there. Put the system into debug_mode. int bp_table::add_breakpoint_in_function (const std::string& fname, const std::string& class_name, - int line, const std::string& condition) + int line, + const std::string& condition) { bp_lines line_info; line_info.insert (line); diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/bp-table.h --- a/libinterp/parse-tree/bp-table.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/bp-table.h Sat Dec 25 13:38:17 2021 +0100 @@ -208,9 +208,12 @@ bool condition_valid (const std::string& cond); - void parse_dbfunction_params (const char *who, const octave_value_list& args, - std::string& func_name, std::string& class_name, - bp_table::bp_lines& lines, std::string& cond); + void parse_dbfunction_params (const char *who, + const octave_value_list& args, + std::string& func_name, + std::string& class_name, + bp_table::bp_lines& lines, + std::string& cond); private: diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/lex.h --- a/libinterp/parse-tree/lex.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/lex.h Sat Dec 25 13:38:17 2021 +0100 @@ -777,7 +777,8 @@ { } lexer (FILE *file, interpreter& interp, const std::string& encoding) - : base_lexer (interp), m_reader (interp, file, encoding), m_initial_input (true) + : base_lexer (interp), m_reader (interp, file, encoding), + m_initial_input (true) { } lexer (const std::string& eval_string, interpreter& interp) diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/oct-lvalue.h --- a/libinterp/parse-tree/oct-lvalue.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/oct-lvalue.h Sat Dec 25 13:38:17 2021 +0100 @@ -68,7 +68,8 @@ octave_idx_type numel (void) const; - void set_index (const std::string& t, const std::list& i); + void set_index (const std::string& t, + const std::list& i); void clear_index (void) { m_type = ""; m_idx.clear (); } diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/profiler.cc --- a/libinterp/parse-tree/profiler.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/profiler.cc Sat Dec 25 13:38:17 2021 +0100 @@ -99,7 +99,8 @@ void profiler::tree_node::build_flat (flat_profile& data) const { - // If this is not the top-level node, update profile entry for this function. + // If this is not the top-level node, + // update profile entry for this function. if (m_fcn_id != 0) { stats& entry = data[m_fcn_id - 1]; @@ -230,19 +231,21 @@ if (m_active_fcn) { assert (m_call_tree); - // FIXME: This assert statements doesn't make sense if profile() is called - // from within a function hierarchy to begin with. See bug #39587. + // FIXME: This assert statements doesn't make sense if profile() is + // called from within a function hierarchy to begin with. See bug + // #39587. //assert (m_active_fcn != m_call_tree); - // Usually, if we are disabled this function is not even called. But the - // call disabling the profiler is an exception. So also check here + // Usually, if we are disabled this function is not even called. But + // the call disabling the profiler is an exception. So also check here // and only record the time if enabled. if (enabled ()) add_current_time (); fcn_index_map::iterator pos = m_fcn_index.find (fcn); - // FIXME: This assert statements doesn't make sense if profile() is called - // from within a function hierarchy to begin with. See bug #39587. + // FIXME: This assert statements doesn't make sense if profile() is + // called from within a function hierarchy to begin with. See bug + // #39587. //assert (pos != m_fcn_index.end ()); m_active_fcn = m_active_fcn->exit (pos->second); diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/profiler.h --- a/libinterp/parse-tree/profiler.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/profiler.h Sat Dec 25 13:38:17 2021 +0100 @@ -185,7 +185,8 @@ // Each function we see in the profiler is given a unique index (which // simply counts starting from 1). We thus have to map profiler-names to - // those indices. For all other stuff, we identify functions by their index. + // those indices. For all other stuff, we identify functions by their + // index. typedef std::vector function_set; typedef std::map fcn_index_map; @@ -198,7 +199,8 @@ tree_node *m_call_tree; tree_node *m_active_fcn; - // Store last timestamp we had, when the currently active function was called. + // Store last timestamp we had, when the currently active function was + // called. double m_last_time; // These are private as only the unwind-protecting inner class enter diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/pt-binop.h --- a/libinterp/parse-tree/pt-binop.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/pt-binop.h Sat Dec 25 13:38:17 2021 +0100 @@ -76,7 +76,8 @@ void mark_braindead_shortcircuit (void) { - if (m_etype == octave_value::op_el_and || m_etype == octave_value::op_el_or) + if (m_etype == octave_value::op_el_and + || m_etype == octave_value::op_el_or) { m_eligible_for_braindead_shortcircuit = true; diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/pt-colon.cc --- a/libinterp/parse-tree/pt-colon.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/pt-colon.cc Sat Dec 25 13:38:17 2021 +0100 @@ -42,7 +42,8 @@ tree_colon_expression *new_ce = new tree_colon_expression (m_base ? m_base->dup (scope) : nullptr, m_limit ? m_limit->dup (scope) : nullptr, - m_increment ? m_increment->dup (scope) : nullptr, + m_increment ? m_increment->dup (scope) + : nullptr, line (), column ()); new_ce->copy_base (*this); diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/pt-eval.cc Sat Dec 25 13:38:17 2021 +0100 @@ -4294,11 +4294,11 @@ { if (m_dbstep_flag == 1 || is_end_of_fcn_or_script) { - // We get here if we are doing a "dbstep" or a "dbstep N" and the - // count has reached 1 so that we must stop and return to debug - // prompt. Alternatively, "dbstep N" has been used but the end - // of the frame has been reached so we stop at the last line and - // return to prompt. + // We get here if we are doing a "dbstep" or a "dbstep N" and + // the count has reached 1 so that we must stop and return to + // debug prompt. Alternatively, "dbstep N" has been used but + // the end of the frame has been reached so we stop at the last + // line and return to prompt. break_on_this_statement = true; } diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/pt-exp.h --- a/libinterp/parse-tree/pt-exp.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/pt-exp.h Sat Dec 25 13:38:17 2021 +0100 @@ -89,7 +89,8 @@ int paren_count (void) const { return m_num_parens; } - bool is_postfix_indexed (void) const { return (m_postfix_index_type != '\0'); } + bool is_postfix_indexed (void) const + { return (m_postfix_index_type != '\0'); } char postfix_index (void) const { return m_postfix_index_type; } diff -r b876de975edf -r 00d82e792b8b libinterp/parse-tree/pt-select.h --- a/libinterp/parse-tree/pt-select.h Sat Dec 25 12:36:11 2021 +0100 +++ b/libinterp/parse-tree/pt-select.h Sat Dec 25 13:38:17 2021 +0100 @@ -45,7 +45,8 @@ public: tree_if_clause (int l = -1, int c = -1) - : tree (l, c), m_expr (nullptr), m_list (nullptr), m_lead_comm (nullptr) { } + : tree (l, c), m_expr (nullptr), m_list (nullptr), m_lead_comm (nullptr) + { } tree_if_clause (tree_statement_list *sl, comment_list *lc = nullptr, int l = -1, int c = -1) @@ -130,7 +131,8 @@ tree_if_command (tree_if_command_list *lst, comment_list *lc, comment_list *tc, int l = -1, int c = -1) - : tree_command (l, c), m_list (lst), m_lead_comm (lc), m_trail_comm (tc) { } + : tree_command (l, c), m_list (lst), m_lead_comm (lc), m_trail_comm (tc) + { } // No copying! @@ -170,7 +172,8 @@ public: tree_switch_case (int l = -1, int c = -1) - : tree (l, c), m_label (nullptr), m_list (nullptr), m_lead_comm (nullptr) { } + : tree (l, c), m_label (nullptr), m_list (nullptr), m_lead_comm (nullptr) + { } tree_switch_case (tree_statement_list *sl, comment_list *lc = nullptr, int l = -1, int c = -1) diff -r b876de975edf -r 00d82e792b8b liboctave/system/lo-sysdep.cc --- a/liboctave/system/lo-sysdep.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/liboctave/system/lo-sysdep.cc Sat Dec 25 13:38:17 2021 +0100 @@ -699,17 +699,19 @@ = (oct_ascii_dir + file_ops::dir_sep_str () + crypto::hash ("SHA1", orig_file_name)); + // FIXME: This is just to check if the file exists. Use a more efficient + // method. std::string abs_filename_hash = canonicalize_file_name (filename_hash); if (! abs_filename_hash.empty ()) sys::unlink (filename_hash); - wchar_t w_filename_hash[filename_hash.length ()+1] = {0}; + // At this point, we know that we have only ASCII characters. + // So instead of converting, just copy the characters to std::wstring. + std::wstring w_filename_hash (filename_hash.begin (), + filename_hash.end ()); - for (std::size_t i=0; i < filename_hash.length (); i++) - w_filename_hash[i] = filename_hash.at (i); - - if (CreateHardLinkW (w_filename_hash, w_orig_file_name, nullptr)) + if (CreateHardLinkW (w_filename_hash.c_str (), w_orig_file_name, nullptr)) return filename_hash; #else diff -r b876de975edf -r 00d82e792b8b liboctave/util/lo-array-errwarn.cc --- a/liboctave/util/lo-array-errwarn.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/liboctave/util/lo-array-errwarn.cc Sat Dec 25 13:38:17 2021 +0100 @@ -301,21 +301,6 @@ "matrix singular to machine precision, rcond = %g", rcond); } } - - // DEPRECATED in Octave 6. - - // Complain of an index that is out of range, but we don't know matrix size - void - err_index_out_of_range (int nd, int dim, octave_idx_type idx, - octave_idx_type ext) - { - // The dim_vector setting here doesn't really make sense. However, - // this function has been deprecated and will be removed in version - // 8, so there's no need to attempt to fix it. - - throw out_of_range (std::to_string (idx), nd, dim, ext, - dim_vector (1, 1, 1, 1, 1, 1, 1)); - } } /* Tests in test/index.tst */ diff -r b876de975edf -r 00d82e792b8b liboctave/util/lo-array-errwarn.h --- a/liboctave/util/lo-array-errwarn.h Sat Dec 25 12:36:11 2021 +0100 +++ b/liboctave/util/lo-array-errwarn.h Sat Dec 25 13:38:17 2021 +0100 @@ -131,13 +131,6 @@ err_index_out_of_range (int ndims, int dim, octave_idx_type idx, octave_idx_type ext, const dim_vector& dv); -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) - OCTAVE_DEPRECATED (6, "use err_index_out_of_range (int, int, octave_idx_type, octave_idx_type, const dim_vector&) instead") - OCTAVE_NORETURN extern OCTAVE_API void - err_index_out_of_range (int ndims, int dim, octave_idx_type idx, - octave_idx_type ext); -#endif - OCTAVE_NORETURN extern OCTAVE_API void err_del_index_out_of_range (bool is1d, octave_idx_type iext, octave_idx_type ext); diff -r b876de975edf -r 00d82e792b8b liboctave/util/quit.cc --- a/liboctave/util/quit.cc Sat Dec 25 12:36:11 2021 +0100 +++ b/liboctave/util/quit.cc Sat Dec 25 13:38:17 2021 +0100 @@ -37,32 +37,11 @@ sig_atomic_t octave_interrupt_state = 0; -// DEPRECATED in Octave 6. -// This variable should never have been public. -sig_atomic_t octave_exception_state = 0; -// Use this variable internally until the functions that use it can be -// removed. -static sig_atomic_t internal_exception_state; - volatile sig_atomic_t octave_signal_caught = 0; void (*octave_signal_hook) (void) = nullptr; void (*octave_interrupt_hook) (void) = nullptr; -// DEPRECATED in Octave 6. -void (*octave_bad_alloc_hook) (void) = nullptr; - -// The octave_exception enum values were DEPRECATED in Octave 6. -// Use these values internally until the functions that use them can be -// removed. -enum octave_internal_exception -{ - octave_internal_no_exception = 0, - octave_internal_exec_exception = 1, - octave_internal_alloc_exception = 3, - octave_internal_quit_exception = 4 -}; - namespace octave { std::string execution_exception::stack_trace (void) const @@ -130,61 +109,3 @@ throw octave::interrupt_exception (); } } - -// DEPRECATED in Octave 6 -void -octave_throw_interrupt_exception (void) -{ - if (octave_interrupt_hook) - octave_interrupt_hook (); - - throw octave::interrupt_exception (); -} - -// DEPRECATED in Octave 6 -void -octave_throw_execution_exception (void) -{ - // FIXME: would a hook function be useful here? - - internal_exception_state = octave_internal_exec_exception; - - throw octave::execution_exception (); -} - -// DEPRECATED in Octave 6 -void -octave_throw_bad_alloc (void) -{ - internal_exception_state = octave_internal_alloc_exception; - - throw std::bad_alloc (); -} - -// DEPRECATED in Octave 6 -void -octave_rethrow_exception (void) -{ - if (octave_interrupt_state) - { - octave_interrupt_state = -1; - - throw octave::interrupt_exception (); - } - else - { - switch (internal_exception_state) - { - case octave_internal_exec_exception: - throw octave::execution_exception (); - break; - - case octave_internal_alloc_exception: - throw std::bad_alloc (); - break; - - default: - break; - } - } -} diff -r b876de975edf -r 00d82e792b8b liboctave/util/quit.h --- a/liboctave/util/quit.h Sat Dec 25 12:36:11 2021 +0100 +++ b/liboctave/util/quit.h Sat Dec 25 13:38:17 2021 +0100 @@ -224,29 +224,10 @@ */ extern OCTAVE_API sig_atomic_t octave_interrupt_state; -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "'octave_exception_state' is an obsolete internal variable; any uses should be removed") -extern OCTAVE_API sig_atomic_t octave_exception_state; -#endif - extern OCTAVE_API volatile sig_atomic_t octave_signal_caught; extern OCTAVE_API void octave_handle_signal (void); -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "use 'throw octave::interrupt_exception' instead") -OCTAVE_NORETURN extern OCTAVE_API void octave_throw_interrupt_exception (void); - -OCTAVE_DEPRECATED (6, "use 'throw octave::execution_exception' instead") -OCTAVE_NORETURN extern OCTAVE_API void octave_throw_execution_exception (void); - -OCTAVE_DEPRECATED (6, "use 'throw std::bad_alloc' instead") -OCTAVE_NORETURN extern OCTAVE_API void octave_throw_bad_alloc (void); - -OCTAVE_DEPRECATED (6, "use 'throw' instead") -extern OCTAVE_API void octave_rethrow_exception (void); -#endif - #if defined (__cplusplus) inline void octave_quit (void) @@ -312,11 +293,6 @@ extern OCTAVE_API void (*octave_signal_hook) (void); extern OCTAVE_API void (*octave_interrupt_hook) (void); -#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) -OCTAVE_DEPRECATED (6, "'octave_bad_alloc_hook' is obsolete and no longer used") -extern OCTAVE_API void (*octave_bad_alloc_hook) (void); #endif #endif - -#endif diff -r b876de975edf -r 00d82e792b8b scripts/deprecated/module.mk --- a/scripts/deprecated/module.mk Sat Dec 25 12:36:11 2021 +0100 +++ b/scripts/deprecated/module.mk Sat Dec 25 13:38:17 2021 +0100 @@ -4,8 +4,7 @@ %reldir%/.oct-config \ %reldir%/disable_diagonal_matrix.m \ %reldir%/disable_permutation_matrix.m \ - %reldir%/disable_range.m \ - %reldir%/runtests.m + %reldir%/disable_range.m %canon_reldir%dir = $(fcnfiledir)/deprecated diff -r b876de975edf -r 00d82e792b8b scripts/deprecated/runtests.m --- a/scripts/deprecated/runtests.m Sat Dec 25 12:36:11 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -######################################################################## -## -## Copyright (C) 2010-2021 The Octave Project Developers -## -## See the file COPYRIGHT.md in the top-level directory of this -## distribution or . -## -## This file is part of Octave. -## -## Octave is free software: you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . -## -######################################################################## - -## -*- texinfo -*- -## @deftypefn {} {} runtests () -## @deftypefnx {} {} runtests (@var{directory}) -## -## -## @code{runtests} is deprecated and will be removed in Octave version 8. -## Use @code{oruntests} instead. -## -## Execute built-in tests for all m-files in the specified @var{directory}. -## -## Test blocks in any C++ source files (@file{*.cc}) will also be executed -## for use with dynamically linked oct-file functions. -## -## If no directory is specified, operate on all directories in Octave's search -## path for functions. -## @seealso{oruntests, rundemos, test, path} -## @end deftypefn - -## FIXME: DEPRECATED: Remove in version 8. - -function runtests (varargin) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "runtests is obsolete and will be removed from a future version of Octave, please use oruntests instead\n"); - endif - - oruntests (varargin{:}); - -endfunction diff -r b876de975edf -r 00d82e792b8b scripts/statistics/var.m --- a/scripts/statistics/var.m Sat Dec 25 12:36:11 2021 +0100 +++ b/scripts/statistics/var.m Sat Dec 25 13:38:17 2021 +0100 @@ -216,7 +216,7 @@ endif den = sum (w); mu = sum (w .* x, dim) ./ sum (w); - retval = sum (w .* ((x .- mu) .^ 2), dim) / den; + retval = sum (w .* ((x - mu) .^ 2), dim) / den; endif endif endif diff -r b876de975edf -r 00d82e792b8b src/mkoctfile.in.cc