Mercurial > hg > octave-nkf
changeset 19572:9ef286208da1
maint: Periodic merge of gui-release to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 02 Dec 2014 10:05:03 -0500 |
parents | 009191dbc76d (current diff) 302eef6de090 (diff) |
children | 5db5619fe54e |
files | libinterp/corefcn/graphics.cc libinterp/corefcn/load-save.cc liboctave/numeric/lo-mappers.cc liboctave/numeric/lo-specfun.cc scripts/plot/util/private/__fltk_ginput__.m scripts/testfun/__run_test_suite__.m src/mkoctfile.in.cc |
diffstat | 7 files changed, 38 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc +++ b/libinterp/corefcn/graphics.cc @@ -10713,8 +10713,8 @@ if (tk_name == "qt" || (tk_name == "fltk" - && available_toolkits.find ("qt") - == available_toolkits.end ())) + && (available_toolkits.find ("qt") + == available_toolkits.end ()))) dtk = tk_name; } }
--- a/libinterp/corefcn/load-save.cc +++ b/libinterp/corefcn/load-save.cc @@ -1201,7 +1201,7 @@ char headertext[128]; time (&now); - bdt = *gmtime (&now); + bdt = *gnulib::gmtime (&now); memset (headertext, ' ', 124); // ISO 8601 format date nstrftime (headertext, 124, "MATLAB 5.0 MAT-file, written by Octave "
--- a/liboctave/numeric/lo-specfun.cc +++ b/liboctave/numeric/lo-specfun.cc @@ -685,14 +685,14 @@ if (ax < 0.2) { // approximation log (1+x) ~ 2*sum ((x/(2+x)).^ii ./ ii), ii = 1:2:2n+1 - float u = x / (2 + x), t = 1, s = 0; + float u = x / (2 + x), t = 1.0f, s = 0; for (int i = 2; i < 12; i += 2) s += (t *= u*u) / (i+1); - retval = 2 * (s + 1) * u; + retval = 2 * (s + 1.0f) * u; } else - retval = gnulib::logf (1 + x); + retval = gnulib::logf (1.0f + x); return retval; } @@ -2986,8 +2986,9 @@ FloatComplex rc_log1p (float x) { const float pi = 3.14159265358979323846f; - return x < -1.0f ? FloatComplex (gnulib::logf (-(1.0f + x)), pi) - : FloatComplex (log1pf (x)); + return (x < -1.0f + ? FloatComplex (gnulib::logf (-(1.0f + x)), pi) + : FloatComplex (log1pf (x))); } // This algorithm is due to P. J. Acklam. @@ -3118,10 +3119,16 @@ else if (x > 0.0 && x < 2.0) { // Tail region. - const double q = x < 1 ? sqrt (-2*gnulib::log (0.5*x)) : sqrt (-2*gnulib::log (0.5*(2-x))); + const double q = (x < 1 + ? sqrt (-2*gnulib::log (0.5*x)) + : sqrt (-2*gnulib::log (0.5*(2-x)))); + const double yn = ((((c[0]*q + c[1])*q + c[2])*q + c[3])*q + c[4])*q + c[5]; + const double yd = (((d[0]*q + d[1])*q + d[2])*q + d[3])*q + 1.0; + y = yn / yd; + if (x < pbreak_lo) y = -y; }
--- a/liboctave/system/oct-time.cc +++ b/liboctave/system/oct-time.cc @@ -235,7 +235,7 @@ time_t t = ot.unix_time (); - octave_base_tm::init (localtime (&t)); + octave_base_tm::init (gnulib::localtime (&t)); } void @@ -245,7 +245,7 @@ time_t t = ot.unix_time (); - octave_base_tm::init (gmtime (&t)); + octave_base_tm::init (gnulib::gmtime (&t)); } void
--- a/scripts/plot/util/private/__fltk_ginput__.m +++ b/scripts/plot/util/private/__fltk_ginput__.m @@ -47,7 +47,14 @@ sleep (0.01); [x, y, n0, button] = ginput_accumulator (-1, 0, 0, 0); - until (n0 == n || n0 < 0) + until ((n > -1 && n0 >= n) || n0 < 0) + + if (n0 > n) + ## More clicks than requested due to double-click or too fast clicking + x = x(1:n); + y = y(1:n); + button = button(1:n); + endif unwind_protect_cleanup set (gca, "buttondownfcn", orig_buttondownfcn);
--- a/scripts/testfun/__run_test_suite__.m +++ b/scripts/testfun/__run_test_suite__.m @@ -31,8 +31,10 @@ fcndirs = { liboctavetestdir, libinterptestdir, fcnfiledir }; fixedtestdirs = { fixedtestdir }; endif - global files_with_no_tests = {}; - global files_with_tests = {}; + global files_with_no_tests; + global files_with_tests; + files_with_no_tests = {}; + files_with_tests = {}; ## FIXME: These names don't really make sense if we are running ## tests for an installed copy of Octave. global topsrcdir = fcnfiledir; @@ -40,12 +42,13 @@ pso = page_screen_output (); warn_state = warning ("query", "quiet"); warning ("on", "quiet"); + logfile = make_absolute_filename ("fntests.log"); try page_screen_output (false); warning ("off", "Octave:deprecated-function"); - fid = fopen ("fntests.log", "wt"); + fid = fopen (logfile, "wt"); if (fid < 0) - error ("could not open fntests.log for writing"); + error ("could not open %s for writing", logfile); endif test ("", "explain", fid); dp = dn = dxf = dsk = 0; @@ -76,7 +79,7 @@ printf (" SKIPPED %6d\n", dsk); endif puts ("\n"); - puts ("See the file test/fntests.log for additional details.\n"); + printf ("See the file %s for additional details.\n", logfile); if (dxf > 0) puts ("\n"); puts ("Expected failures (listed as XFAIL above) are known bugs.\n"); @@ -99,8 +102,8 @@ report_files_with_no_tests (files_with_tests, files_with_no_tests, ".m"); - puts ("\nPlease help improve Octave by contributing tests for\n"); - puts ("these files (see the list in the file fntests.log).\n\n"); + puts ("\nPlease help improve Octave by contributing tests for these files\n"); + printf ("(see the list in the file %s).\n\n", logfile); fprintf (fid, "\nFiles with no tests:\n\n%s", list_in_columns (files_with_no_tests, 80));