Mercurial > octave
changeset 21942:aab79a1885cc
limit gnulib headers to liboctave/wrappers directory
* libinterp/module.mk, liboctave/module.mk, src/module.mk,
libgui/src/module.mk: Don't include libgnu directory in lists of
include directories.
* c-file-ptr-stream.cc, data.cc, dirfns.cc, file-io.cc,
ft-text-renderer.cc, gcd.cc, gl2ps-print.cc, graphics.cc, mex.cc,
oct-fstrm.cc, oct-procbuf.cc, oct-tex-lexer.in.ll,
oct-tex-parser.in.yy, pr-output.cc, quadcc.cc, rand.cc, toplev.cc,
utils.cc, __delaunayn__.cc, __init_fltk__.cc, __voronoi__.cc,
convhulln.cc, ov-cell.cc, ov-float.cc, ov-scalar.cc, lex.ll,
oct-parse.in.yy, Range.cc, idx-vector.cc, Faddeeva/Faddeeva.cc,
lo-mappers.cc, lo-specfun.cc, randgamma.cc, randmtzig.cc,
randpoisson.cc, dir-ops.cc, file-ops.cc, file-stat.cc, oct-env.cc,
oct-syscalls.cc, oct-time.cc, oct-uname.cc, cmd-edit.cc, cmd-hist.cc,
lo-utils.cc, oct-inttypes.cc, oct-shlib.cc, sparse-util.cc,
mkoctfile.in.cc: Use std:: instead of gnulib:: namespace.
* oct-conf-post.in.h: Don't define GNULIB_NAMESPACE.
line wrap: on
line diff
--- a/libgui/src/module.mk Fri Jun 17 11:00:11 2016 -0400 +++ b/libgui/src/module.mk Fri Jun 17 13:45:04 2016 -0400 @@ -214,7 +214,6 @@ -Ilibinterp/parse-tree -I$(srcdir)/libinterp/parse-tree \ -Ilibinterp/corefcn -I$(srcdir)/libinterp/corefcn \ -I$(srcdir)/libinterp/octave-value \ - -Ilibgnu -I$(srcdir)/libgnu \ -I$(srcdir)/liboctave/wrappers libgui_src_libgui_src_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS)
--- a/libinterp/corefcn/c-file-ptr-stream.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/c-file-ptr-stream.cc Fri Jun 17 13:45:04 2016 -0400 @@ -53,7 +53,7 @@ c_file_ptr_buf::overflow (int_type c) { if (f) - return (c != traits_type::eof ()) ? gnulib::fputc (c, f) : flush (); + return (c != traits_type::eof ()) ? std::fputc (c, f) : flush (); else return traits_type::not_eof (c); } @@ -63,7 +63,7 @@ { if (f) { - int_type c = gnulib::fgetc (f); + int_type c = std::fgetc (f); if (! bump && c != traits_type::eof ()) ungetc (c, f); @@ -85,7 +85,7 @@ c_file_ptr_buf::xsputn (const char* s, std::streamsize n) { if (f) - return gnulib::fwrite (s, 1, n, f); + return std::fwrite (s, 1, n, f); else return 0; } @@ -94,7 +94,7 @@ c_file_ptr_buf::xsgetn (char *s, std::streamsize n) { if (f) - return gnulib::fread (s, 1, n, f); + return std::fread (s, 1, n, f); else return 0; } @@ -147,7 +147,7 @@ int c_file_ptr_buf::flush (void) { - return f ? gnulib::fflush (f) : traits_type::eof (); + return f ? std::fflush (f) : traits_type::eof (); } int @@ -181,7 +181,7 @@ int c_file_ptr_buf::file_close (FILE *f) { - return gnulib::fclose (f); + return std::fclose (f); } #if defined (HAVE_ZLIB)
--- a/libinterp/corefcn/data.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/data.cc Fri Jun 17 13:45:04 2016 -0400 @@ -4534,7 +4534,7 @@ else { int expon; - gnulib::frexpf (val, &expon); + std::frexp (val, &expon); epsval(i) = std::pow (2.0f, static_cast<float> (expon - 24)); } @@ -4558,7 +4558,7 @@ else { int expon; - gnulib::frexp (val, &expon); + std::frexp (val, &expon); epsval(i) = std::pow (2.0, static_cast<double> (expon - 53)); }
--- a/libinterp/corefcn/dirfns.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/dirfns.cc Fri Jun 17 13:45:04 2016 -0400 @@ -73,7 +73,7 @@ int cd_ok = octave::sys::env::chdir (xdir); if (! cd_ok) - error ("%s: %s", newdir.c_str (), gnulib::strerror (errno)); + error ("%s: %s", newdir.c_str (), std::strerror (errno)); Vlast_chdir_time.stamp ();
--- a/libinterp/corefcn/file-io.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/file-io.cc Fri Jun 17 13:45:04 2016 -0400 @@ -460,7 +460,7 @@ #if defined (HAVE_ZLIB) if (use_zlib) { - FILE *fptr = gnulib::fopen (fname.c_str (), mode.c_str ()); + FILE *fptr = std::fopen (fname.c_str (), mode.c_str ()); int fd = fileno (fptr); @@ -470,18 +470,18 @@ retval = octave_zstdiostream::create (fname, gzf, fd, md, flt_fmt); else - retval.error (gnulib::strerror (errno)); + retval.error (std::strerror (errno)); } else #endif { - FILE *fptr = gnulib::fopen (fname.c_str (), mode.c_str ()); + FILE *fptr = std::fopen (fname.c_str (), mode.c_str ()); retval = octave_stdiostream::create (fname, fptr, md, flt_fmt); if (! fptr) - retval.error (gnulib::strerror (errno)); + retval.error (std::strerror (errno)); } } @@ -2839,7 +2839,7 @@ octave_value_list retval; - FILE *fid = gnulib::tmpfile (); + FILE *fid = std::tmpfile (); if (fid) { @@ -2856,7 +2856,7 @@ } else { - retval = ovl (-1, gnulib::strerror (errno)); + retval = ovl (-1, std::strerror (errno)); } return retval; @@ -2903,7 +2903,7 @@ if (fd < 0) { retval(0) = fd; - retval(2) = gnulib::strerror (errno); + retval(2) = std::strerror (errno); } else { @@ -2914,7 +2914,7 @@ if (! fid) { retval(0) = -1; - retval(2) = gnulib::strerror (errno); + retval(2) = std::strerror (errno); } else {
--- a/libinterp/corefcn/ft-text-renderer.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/ft-text-renderer.cc Fri Jun 17 13:45:04 2016 -0400 @@ -851,7 +851,7 @@ while (n > 0) { - size_t r = gnulib::mbrtowc (&wc, str.data () + curr, n, &ps); + size_t r = std::mbrtowc (&wc, str.data () + curr, n, &ps); if (r > 0 && r != static_cast<size_t> (-1)
--- a/libinterp/corefcn/gcd.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/gcd.cc Fri Jun 17 13:45:04 2016 -0400 @@ -63,8 +63,8 @@ divide (const std::complex<FP>& a, const std::complex<FP>& b, std::complex<FP>& q, std::complex<FP>& r) { - FP qr = gnulib::floor ((a/b).real () + 0.5); - FP qi = gnulib::floor ((a/b).imag () + 0.5); + FP qr = std::floor ((a/b).real () + 0.5); + FP qi = std::floor ((a/b).imag () + 0.5); q = std::complex<FP> (qr, qi); @@ -128,7 +128,7 @@ while (bb != 0) { - double qq = gnulib::floor (aa / bb); + double qq = std::floor (aa / bb); double tt = fmod (aa, bb); aa = bb;
--- a/libinterp/corefcn/gl2ps-print.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/gl2ps-print.cc Fri Jun 17 13:45:04 2016 -0400 @@ -197,7 +197,7 @@ gl2ps_sort = GL2PS_SIMPLE_SORT; // Use a temporary file in case an overflow happens - FILE* tmpf = gnulib::tmpfile (); + FILE* tmpf = std::tmpfile (); if (! tmpf) error ("gl2ps_renderer::draw: couldn't open temporary file for printing"); @@ -209,7 +209,7 @@ { buffer_overflow = false; buffsize *= 2; - gnulib::fseek (tmpf, 0, SEEK_SET); + std::fseek (tmpf, 0, SEEK_SET); octave_ftruncate_wrapper (fileno (tmpf), 0); // For LaTeX output the fltk print process uses 2 drawnow() commands. @@ -268,16 +268,16 @@ } // Copy temporary file to pipe - gnulib::fseek (tmpf, 0, SEEK_SET); + std::fseek (tmpf, 0, SEEK_SET); char str[256]; size_t nread, nwrite; nread = 1; while (! feof (tmpf) && nread) { - nread = gnulib::fread (str, 1, 256, tmpf); + nread = std::fread (str, 1, 256, tmpf); if (nread) { - nwrite = gnulib::fwrite (str, 1, nread, fp); + nwrite = std::fwrite (str, 1, nread, fp); if (nwrite != nread) { octave_signal_handler (); // Clear SIGPIPE signal @@ -769,7 +769,7 @@ safe_fclose (FILE *f) { if (f) - gnulib::fclose (f); + std::fclose (f); } #endif @@ -809,7 +809,7 @@ { // Write gl2ps output directly to file. - fp = gnulib::fopen (stream.c_str (), "w"); + fp = std::fopen (stream.c_str (), "w"); if (! fp) error ("gl2ps_print: failed to create file \"%s\"", stream.c_str ());
--- a/libinterp/corefcn/graphics.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/graphics.cc Fri Jun 17 13:45:04 2016 -0400 @@ -6670,7 +6670,7 @@ } else { - b = static_cast<int> (gnulib::floor (std::log10 (std::abs (x)))); + b = static_cast<int> (std::floor (std::log10 (std::abs (x)))); a = x / std::pow (10.0, b); } } @@ -6766,14 +6766,14 @@ if (min_val > 0) { // Log plots with all positive data - min_val = pow (10, gnulib::floor (log10 (min_val))); + min_val = pow (10, std::floor (log10 (min_val))); max_val = pow (10, std::ceil (log10 (max_val))); } else { // Log plots with all negative data min_val = -pow (10, std::ceil (log10 (-min_val))); - max_val = -pow (10, gnulib::floor (log10 (-max_val))); + max_val = -pow (10, std::floor (log10 (-max_val))); } } else @@ -6792,7 +6792,7 @@ } double tick_sep = calc_tick_sep (min_val, max_val); - double min_tick = gnulib::floor (min_val / tick_sep); + double min_tick = std::floor (min_val / tick_sep); double max_tick = std::ceil (max_val / tick_sep); // Prevent round-off from cropping ticks min_val = std::min (min_val, tick_sep * min_tick); @@ -6854,7 +6854,7 @@ else tick_sep = calc_tick_sep (lo, hi); - int i1 = static_cast<int> (gnulib::floor (lo / tick_sep)); + int i1 = static_cast<int> (std::floor (lo / tick_sep)); int i2 = static_cast<int> (std::ceil (hi / tick_sep)); if (limmode_is_auto) @@ -6956,9 +6956,9 @@ for (int i = 0; i < values.numel (); i++) { if (values(i) < 0.0) - exponent = gnulib::floor (std::log10 (-values(i))); + exponent = std::floor (std::log10 (-values(i))); else - exponent = gnulib::floor (std::log10 (values(i))); + exponent = std::floor (std::log10 (values(i))); significand = values(i) * std::pow (10., -exponent); os.str ("");
--- a/libinterp/corefcn/mex.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/mex.cc Fri Jun 17 13:45:04 2016 -0400 @@ -2033,7 +2033,7 @@ // Allocate memory. void *malloc_unmarked (size_t n) { - void *ptr = gnulib::malloc (n); + void *ptr = std::malloc (n); if (! ptr) { @@ -2086,7 +2086,7 @@ if (ptr) { - v = gnulib::realloc (ptr, n); + v = std::realloc (ptr, n); std::set<void *>::iterator p = memlist.find (ptr); @@ -2301,7 +2301,7 @@ void * mxArray::malloc (size_t n) { - return mex_context ? mex_context->malloc_unmarked (n) : gnulib::malloc (n); + return mex_context ? mex_context->malloc_unmarked (n) : std::malloc (n); } void * @@ -2403,14 +2403,14 @@ void * mxMalloc (size_t n) { - return mex_context ? mex_context->malloc (n) : gnulib::malloc (n); + return mex_context ? mex_context->malloc (n) : std::malloc (n); } void * mxRealloc (void *ptr, size_t size) { return mex_context ? mex_context->realloc (ptr, size) - : gnulib::realloc (ptr, size); + : std::realloc (ptr, size); } void
--- a/libinterp/corefcn/oct-fstrm.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/oct-fstrm.cc Fri Jun 17 13:45:04 2016 -0400 @@ -46,7 +46,7 @@ if (! fs) // Note: error is inherited from octave_base_stream, not ::error. - error (gnulib::strerror (errno)); + error (std::strerror (errno)); } // Position a stream at OFFSET relative to ORIGIN.
--- a/libinterp/corefcn/oct-procbuf.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/oct-procbuf.cc Fri Jun 17 13:45:04 2016 -0400 @@ -120,7 +120,7 @@ if (fp) { - gnulib::fclose (fp); + std::fclose (fp); fp = 0; } @@ -194,7 +194,7 @@ } } - if (status == 0 && gnulib::fclose (f) == 0) + if (status == 0 && std::fclose (f) == 0) { using namespace std;
--- a/libinterp/corefcn/oct-tex-lexer.in.ll Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/oct-tex-lexer.in.ll Fri Jun 17 13:45:04 2016 -0400 @@ -77,18 +77,6 @@ #define YY_NO_UNISTD_H 1 #define isatty octave_isatty_wrapper -#if defined (GNULIB_NAMESPACE) -// Calls to the following functions appear in the generated output -// from flex without the namespace tag. Redefine them so we will use -// them via the gnulib namespace. -# define fprintf GNULIB_NAMESPACE::fprintf -# define fread GNULIB_NAMESPACE::fread -# define fwrite GNULIB_NAMESPACE::fwrite -# define getc GNULIB_NAMESPACE::getc -# define malloc GNULIB_NAMESPACE::malloc -# define realloc GNULIB_NAMESPACE::realloc -#endif - %} D [0-9]
--- a/libinterp/corefcn/oct-tex-parser.in.yy Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/oct-tex-parser.in.yy Fri Jun 17 13:45:04 2016 -0400 @@ -34,15 +34,6 @@ extern int octave_tex_lex (YYSTYPE *, void *); static void yyerror (text_parser_tex& parser, const char *s); -#if defined (GNULIB_NAMESPACE) -// Calls to the following functions appear in the generated output -// from Bison without the namespace tag. Redefine them so we will use -// them via the gnulib namespace. -# define fclose GNULIB_NAMESPACE::fclose -# define fprintf GNULIB_NAMESPACE::fprintf -# define malloc GNULIB_NAMESPACE::malloc -#endif - #define scanner parser.get_scanner () #if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC)
--- a/libinterp/corefcn/pr-output.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/pr-output.cc Fri Jun 17 13:45:04 2016 -0400 @@ -242,7 +242,7 @@ if (x != 0) { double absval = (x < 0.0 ? -x : x); - int logabsval = static_cast<int> (gnulib::floor (log10 (absval))); + int logabsval = static_cast<int> (std::floor (log10 (absval))); // Avoid using modulo function with negative arguments for // portability. See extended comment at calc_scale_exp if (logabsval < 0.0) @@ -258,7 +258,7 @@ { return 1 + (print_eng ? engineering_exponent (x) - : static_cast<int> (gnulib::floor (log10 (x)))); + : static_cast<int> (std::floor (log10 (x)))); } class @@ -3262,7 +3262,7 @@ { int new_digits = static_cast<int> - (gnulib::floor (log10 (double (abs (nda(i).value ()))) + 1.0)); + (std::floor (log10 (double (abs (nda(i).value ()))) + 1.0)); if (new_digits > digits) digits = new_digits;
--- a/libinterp/corefcn/quadcc.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/quadcc.cc Fri Jun 17 13:45:04 2016 -0400 @@ -1644,7 +1644,7 @@ wrap = true; for (i = 0; i < nivals + 1; i++) if (octave::math::isinf (iivals[i])) - iivals[i] = gnulib::copysign (1.0, iivals[i]); + iivals[i] = std::copysign (1.0, iivals[i]); else iivals[i] = 2.0 * atan (iivals[i]) / M_PI; } @@ -1982,7 +1982,7 @@ && ivl->c[0] / iv->c[0] > 2); if (ivl->ndiv > ndiv_max && 2 * ivl->ndiv > ivl->rdepth) { - igral = gnulib::copysign (octave::numeric_limits<double>::Inf (), igral); + igral = std::copysign (octave::numeric_limits<double>::Inf (), igral); warning ("quadcc: divergent integral detected"); break; } @@ -2073,7 +2073,7 @@ && ivr->c[0] / iv->c[0] > 2); if (ivr->ndiv > ndiv_max && 2 * ivr->ndiv > ivr->rdepth) { - igral = gnulib::copysign (octave::numeric_limits<double>::Inf (), igral); + igral = std::copysign (octave::numeric_limits<double>::Inf (), igral); warning ("quadcc: divergent integral detected"); break; }
--- a/libinterp/corefcn/rand.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/rand.cc Fri Jun 17 13:45:04 2016 -0400 @@ -1135,7 +1135,7 @@ for (octave_idx_type i = 0; i < m; i++) { octave_idx_type k = i + - gnulib::floor (rvec[i] * (n - i)); + std::floor (rvec[i] * (n - i)); // For shuffling first m entries, no need to use extra // storage @@ -1158,7 +1158,7 @@ for (octave_idx_type i = 0; i < m; i++) { octave_idx_type k = i + - gnulib::floor (rvec[i] * (n - i)); + std::floor (rvec[i] * (n - i)); std::swap (ivec[i], ivec[k]); } }
--- a/libinterp/corefcn/toplev.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/toplev.cc Fri Jun 17 13:45:04 2016 -0400 @@ -1715,11 +1715,11 @@ // malloc (0) is unpredictable; avoid it. if (sz == 0) sz = 1; - p = gnulib::malloc (sz); + p = std::malloc (sz); while (p == 0) { (*__new_handler) (); - p = gnulib::malloc (sz); + p = std::malloc (sz); } if (debug_new_delete)
--- a/libinterp/corefcn/utils.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/corefcn/utils.cc Fri Jun 17 13:45:04 2016 -0400 @@ -1321,7 +1321,7 @@ return; double fraction = std::modf (seconds, &seconds); - fraction = gnulib::floor (fraction * 1000000000); // nanoseconds + fraction = std::floor (fraction * 1000000000); // nanoseconds time_t sec = ((seconds > std::numeric_limits<time_t>::max ()) ? std::numeric_limits<time_t>::max ()
--- a/libinterp/dldfcn/__delaunayn__.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/dldfcn/__delaunayn__.cc Fri Jun 17 13:45:04 2016 -0400 @@ -65,7 +65,7 @@ static void close_fcn (FILE *f) { - gnulib::fclose (f); + std::fclose (f); } static bool @@ -150,9 +150,9 @@ // Replace the outfile pointer with stdout for debugging information. #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM) - FILE *outfile = gnulib::fopen ("NUL", "w"); + FILE *outfile = std::fopen ("NUL", "w"); #else - FILE *outfile = gnulib::fopen ("/dev/null", "w"); + FILE *outfile = std::fopen ("/dev/null", "w"); #endif FILE *errfile = stderr;
--- a/libinterp/dldfcn/__init_fltk__.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/dldfcn/__init_fltk__.cc Fri Jun 17 13:45:04 2016 -0400 @@ -496,9 +496,9 @@ { Matrix rgb = uimenup.get_foregroundcolor_rgb (); - uchar r = static_cast<uchar> (gnulib::floor (rgb (0) * 255)); - uchar g = static_cast<uchar> (gnulib::floor (rgb (1) * 255)); - uchar b = static_cast<uchar> (gnulib::floor (rgb (2) * 255)); + uchar r = static_cast<uchar> (std::floor (rgb (0) * 255)); + uchar g = static_cast<uchar> (std::floor (rgb (1) * 255)); + uchar b = static_cast<uchar> (std::floor (rgb (2) * 255)); item->labelcolor (fl_rgb_color (r, g, b)); }
--- a/libinterp/dldfcn/__voronoi__.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/dldfcn/__voronoi__.cc Fri Jun 17 13:45:04 2016 -0400 @@ -59,7 +59,7 @@ static void close_fcn (FILE *f) { - gnulib::fclose (f); + std::fclose (f); } static bool @@ -141,9 +141,9 @@ // Replace the outfile pointer with stdout for debugging information. #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM) - FILE *outfile = gnulib::fopen ("NUL", "w"); + FILE *outfile = std::fopen ("NUL", "w"); #else - FILE *outfile = gnulib::fopen ("/dev/null", "w"); + FILE *outfile = std::fopen ("/dev/null", "w"); #endif FILE *errfile = stderr;
--- a/libinterp/dldfcn/convhulln.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/dldfcn/convhulln.cc Fri Jun 17 13:45:04 2016 -0400 @@ -54,7 +54,7 @@ static void close_fcn (FILE *f) { - gnulib::fclose (f); + std::fclose (f); } static bool @@ -158,9 +158,9 @@ // Replace the outfile pointer with stdout for debugging information. #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM) - FILE *outfile = gnulib::fopen ("NUL", "w"); + FILE *outfile = std::fopen ("NUL", "w"); #else - FILE *outfile = gnulib::fopen ("/dev/null", "w"); + FILE *outfile = std::fopen ("/dev/null", "w"); #endif FILE *errfile = stderr;
--- a/libinterp/module.mk Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/module.mk Fri Jun 17 13:45:04 2016 -0400 @@ -19,7 +19,6 @@ -I$(srcdir)/libinterp/operators \ -Ilibinterp/parse-tree -I$(srcdir)/libinterp/parse-tree \ -Ilibinterp/corefcn -I$(srcdir)/libinterp/corefcn \ - -Ilibgnu -I$(srcdir)/libgnu \ -I$(srcdir)/liboctave/wrappers \ $(HDF5_CPPFLAGS) \ $(MAGICK_CPPFLAGS)
--- a/libinterp/octave-value/ov-cell.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/octave-value/ov-cell.cc Fri Jun 17 13:45:04 2016 -0400 @@ -1037,7 +1037,7 @@ for (octave_idx_type i = 0; i < nel; i++) { std::ostringstream buf; - int digits = static_cast<int> (gnulib::floor (::log10 (static_cast<double> + int digits = static_cast<int> (std::floor (::log10 (static_cast<double> (nel)) + 1.0)); buf << "_" << std::setw (digits) << std::setfill ('0') << i; std::string s = buf.str ();
--- a/libinterp/octave-value/ov-float.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/octave-value/ov-float.cc Fri Jun 17 13:45:04 2016 -0400 @@ -321,7 +321,7 @@ SCALAR_MAPPER (exp, ::expf); SCALAR_MAPPER (expm1, octave::math::expm1); SCALAR_MAPPER (fix, octave::math::fix); - SCALAR_MAPPER (floor, gnulib::floorf); + SCALAR_MAPPER (floor, std::floor); SCALAR_MAPPER (log, octave::math::rc_log); SCALAR_MAPPER (log2, octave::math::rc_log2); SCALAR_MAPPER (log10, octave::math::rc_log10);
--- a/libinterp/octave-value/ov-scalar.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/octave-value/ov-scalar.cc Fri Jun 17 13:45:04 2016 -0400 @@ -344,7 +344,7 @@ SCALAR_MAPPER (exp, ::exp); SCALAR_MAPPER (expm1, octave::math::expm1); SCALAR_MAPPER (fix, octave::math::fix); - SCALAR_MAPPER (floor, gnulib::floor); + SCALAR_MAPPER (floor, std::floor); SCALAR_MAPPER (log, octave::math::rc_log); SCALAR_MAPPER (log2, octave::math::rc_log2); SCALAR_MAPPER (log10, octave::math::rc_log10);
--- a/libinterp/parse-tree/lex.ll Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/parse-tree/lex.ll Fri Jun 17 13:45:04 2016 -0400 @@ -131,16 +131,6 @@ #define YY_NO_UNISTD_H 1 #define isatty octave_isatty_wrapper -#if defined (GNULIB_NAMESPACE) -// Calls to the following functions appear in the generated output from -// flex without the namespace tag. Redefine them so we will use them -// via the gnulib namespace. -# define fprintf GNULIB_NAMESPACE::fprintf -# define fwrite GNULIB_NAMESPACE::fwrite -# define malloc GNULIB_NAMESPACE::malloc -# define realloc GNULIB_NAMESPACE::realloc -#endif - #if ! (defined (FLEX_SCANNER) \ && defined (YY_FLEX_MAJOR_VERSION) && YY_FLEX_MAJOR_VERSION >= 2 \ && defined (YY_FLEX_MINOR_VERSION) && YY_FLEX_MINOR_VERSION >= 5) @@ -1806,19 +1796,19 @@ void * octave_alloc (yy_size_t size, yyscan_t) { - return malloc (size); + return std::malloc (size); } void * octave_realloc (void *ptr, yy_size_t size, yyscan_t) { - return realloc (ptr, size); + return std::realloc (ptr, size); } void octave_free (void *ptr, yyscan_t) { - free (ptr); + std::free (ptr); } static void
--- a/libinterp/parse-tree/oct-parse.in.yy Fri Jun 17 11:00:11 2016 -0400 +++ b/libinterp/parse-tree/oct-parse.in.yy Fri Jun 17 13:45:04 2016 -0400 @@ -89,15 +89,6 @@ // FIXME: to be removed after more parser+lexer refactoring. octave_base_lexer *LEXER = 0; -#if defined (GNULIB_NAMESPACE) -// Calls to the following functions appear in the generated output from -// Bison without the namespace tag. Redefine them so we will use them -// via the gnulib namespace. -# define fclose GNULIB_NAMESPACE::fclose -# define fprintf GNULIB_NAMESPACE::fprintf -# define malloc GNULIB_NAMESPACE::malloc -#endif - // TRUE means we printed messages about reading startup files. bool reading_startup_message_printed = false; @@ -4161,7 +4152,7 @@ FILE *ffile = 0; if (! full_file.empty ()) - ffile = gnulib::fopen (full_file.c_str (), "rb"); + ffile = std::fopen (full_file.c_str (), "rb"); if (ffile) {
--- a/liboctave/array/Range.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/array/Range.cc Fri Jun 17 13:45:04 2016 -0400 @@ -487,11 +487,11 @@ double rmax = q / (2.0 - ct); - double t1 = 1.0 + gnulib::floor (x); + double t1 = 1.0 + std::floor (x); t1 = (ct / q) * (t1 < 0.0 ? -t1 : t1); t1 = rmax < t1 ? rmax : t1; t1 = ct > t1 ? ct : t1; - t1 = gnulib::floor (x + t1); + t1 = std::floor (x + t1); if (x <= 0.0 || (t1 - x) < rmax) return t1;
--- a/liboctave/array/idx-vector.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/array/idx-vector.cc Fri Jun 17 13:45:04 2016 -0400 @@ -149,7 +149,7 @@ // find first non-integer, then gripe about it double b = r.base (); double inc = r.inc (); - err_invalid_index (b != gnulib::floor (b) ? b : b + inc); + err_invalid_index (b != std::floor (b) ? b : b + inc); } } }
--- a/liboctave/cruft/Faddeeva/Faddeeva.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/cruft/Faddeeva/Faddeeva.cc Fri Jun 17 13:45:04 2016 -0400 @@ -200,24 +200,11 @@ // copysign was introduced in C++11 (and is also in POSIX and C99) # if defined(_WIN32) || defined(__WIN32__) # define copysign _copysign // of course MS had to be different -# elif defined(GNULIB_NAMESPACE) // we are using using gnulib <cmath> -# define copysign GNULIB_NAMESPACE::copysign # elif (__cplusplus < 201103L) && !defined(HAVE_COPYSIGN) && !defined(__linux__) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(_AIX) static inline double my_copysign(double x, double y) { return y<0 ? -x : x; } # define copysign my_copysign # endif -// If we are using the gnulib <cmath> (e.g., in the GNU Octave sources), -// gnulib generates a link warning if we use ::floor instead of gnulib::floor. -// This warning is completely innocuous because the only difference between -// gnulib::floor and the system ::floor (and only on ancient OSF systems) -// has to do with floor(-0), which doesn't occur in the usage below, but -// the Octave developers prefer that we silence the warning. -# if defined (GNULIB_NAMESPACE) -# define floor GNULIB_NAMESPACE::floor -# define log GNULIB_NAMESPACE::log -# endif - #else // !__cplusplus, i.e., pure C (requires C99 features) # include "Faddeeva.h"
--- a/liboctave/module.mk Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/module.mk Fri Jun 17 13:45:04 2016 -0400 @@ -16,7 +16,6 @@ -Iliboctave/operators -I$(srcdir)/liboctave/operators \ -I$(srcdir)/liboctave/system \ -I$(srcdir)/liboctave/util \ - -Ilibgnu -I$(srcdir)/libgnu \ -I$(srcdir)/liboctave/wrappers liboctave_liboctave_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS)
--- a/liboctave/numeric/lo-mappers.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/numeric/lo-mappers.cc Fri Jun 17 13:45:04 2016 -0400 @@ -37,8 +37,13 @@ #include "f77-fcn.h" -// Functions that forward to gnulib belong here so we can keep gnulib:: out of -// lo-mappers.h. +// FIXME: We used to have this situation: +// +// Functions that forward to gnulib belong here so we can keep +// gnulib:: out of lo-mappers.h. +// +// but now we just use std:: and explicit wrappers in C++ code so maybe +// some of the forwarding functions can be defined inline here. namespace octave { @@ -180,8 +185,8 @@ return i * log ((i + x) / (i - x)) / 2.0f; } - double log2 (double x) { return gnulib::log2 (x); } - float log2 (float x) { return gnulib::log2f (x); } + double log2 (double x) { return std::log2 (x); } + float log2 (float x) { return std::log2 (x); } Complex log2 (const Complex& x) @@ -189,7 +194,7 @@ #if defined (M_LN2) static double ln2 = M_LN2; #else - static double ln2 = gnulib::log (2.0); + static double ln2 = std::log (2.0); #endif return std::log (x) / ln2; } @@ -208,13 +213,13 @@ double log2 (double x, int& exp) { - return gnulib::frexp (x, &exp); + return std::frexp (x, &exp); } float log2 (float x, int& exp) { - return gnulib::frexpf (x, &exp); + return std::frexp (x, &exp); } Complex @@ -242,7 +247,7 @@ # if defined (M_LN2) static double ln2 = M_LN2; # else - static double ln2 = gnulib::log (2.0); + static double ln2 = std::log (2.0); # endif return exp (x * ln2); #endif @@ -265,23 +270,23 @@ #endif } - double copysign (double x, double y) { return gnulib::copysign (x, y); } - float copysign (float x, float y) { return gnulib::copysignf (x, y); } + double copysign (double x, double y) { return std::copysign (x, y); } + float copysign (float x, float y) { return std::copysign (x, y); } - double signbit (double x) { return ::signbit (x); } - float signbit (float x) { return ::signbit (x); } + double signbit (double x) { return std::signbit (x); } + float signbit (float x) { return std::signbit (x); } bool negative_sign (double x) { return __lo_ieee_signbit (x); } bool negative_sign (float x) { return __lo_ieee_float_signbit (x); } - double trunc (double x) { return gnulib::trunc (x); } - float trunc (float x) { return gnulib::truncf (x); } + double trunc (double x) { return std::trunc (x); } + float trunc (float x) { return std::trunc (x); } - double floor (double x) { return gnulib::floor (x); } - float floor (float x) { return gnulib::floor (x); } + double floor (double x) { return std::floor (x); } + float floor (float x) { return std::floor (x); } - double round (double x) { return gnulib::round (x); } - float round (float x) { return gnulib::roundf (x); } + double round (double x) { return std::round (x); } + float round (float x) { return std::round (x); } bool isnan (double x) @@ -441,14 +446,14 @@ rc_log (double x) { const double pi = 3.14159265358979323846; - return x < 0.0 ? Complex (gnulib::log (-x), pi) : Complex (gnulib::log (x)); + return x < 0.0 ? Complex (std::log (-x), pi) : Complex (std::log (x)); } FloatComplex rc_log (float x) { const float pi = 3.14159265358979323846f; - return x < 0.0f ? FloatComplex (gnulib::logf (-x), pi) : FloatComplex (gnulib::logf (x)); + return x < 0.0f ? FloatComplex (std::log (-x), pi) : FloatComplex (std::log (x)); } Complex
--- a/liboctave/numeric/lo-specfun.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/numeric/lo-specfun.cc Fri Jun 17 13:45:04 2016 -0400 @@ -724,7 +724,7 @@ retval = 2 * (s + 1) * u; } else - retval = gnulib::log (1 + x); + retval = std::log (1 + x); return retval; #endif @@ -795,7 +795,7 @@ retval = 2 * (s + 1.0f) * u; } else - retval = gnulib::logf (1.0f + x); + retval = std::log (1.0f + x); return retval; #endif @@ -2989,7 +2989,7 @@ { const double pi = 3.14159265358979323846; return (x < -1.0 - ? Complex (gnulib::log (-(1.0 + x)), pi) + ? Complex (std::log (-(1.0 + x)), pi) : Complex (log1p (x))); } @@ -2997,7 +2997,7 @@ { const float pi = 3.14159265358979323846f; return (x < -1.0f - ? FloatComplex (gnulib::logf (-(1.0f + x)), pi) + ? FloatComplex (std::log (-(1.0f + x)), pi) : FloatComplex (log1p (x))); } @@ -3053,7 +3053,7 @@ else if (ax < 1.0) { // Tail region. - const double q = sqrt (-2*gnulib::log (0.5*(1-ax))); + const double q = sqrt (-2*std::log (0.5*(1-ax))); 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 * octave::math::signum (-x); @@ -3133,8 +3133,8 @@ { // Tail region. const double q = (x < 1 - ? sqrt (-2*gnulib::log (0.5*x)) - : sqrt (-2*gnulib::log (0.5*(2-x)))); + ? sqrt (-2*std::log (0.5*x)) + : sqrt (-2*std::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]; @@ -3257,8 +3257,8 @@ if (temp <= acu && temp <= acu * value) { - value *= exp (pp * gnulib::log (xx) - + (qq - 1.0) * gnulib::log (cx) - beta) / pp; + value *= exp (pp * std::log (xx) + + (qq - 1.0) * std::log (cx) - beta) / pp; if (indx) { @@ -3347,7 +3347,7 @@ // Calculate the initial approximation. - r = sqrt (- gnulib::log (a * a)); + r = sqrt (- std::log (a * a)); ycur = r - (2.30753 + 0.27061 * r) / (1.0 + (0.99229 + 0.04481 * r) * r); @@ -3368,7 +3368,7 @@ if (t <= 0.0) { - value = 1.0 - exp ((gnulib::log ((1.0 - a) * qq) + beta) / qq); + value = 1.0 - exp ((std::log ((1.0 - a) * qq) + beta) / qq); } else { @@ -3376,7 +3376,7 @@ if (t <= 1.0) { - value = exp ((gnulib::log (a * pp) + beta) / pp); + value = exp ((std::log (a * pp) + beta) / pp); } else { @@ -3418,8 +3418,8 @@ } xin = value; - ycur = (ycur - a) * exp (beta + r * gnulib::log (xin) - + t * gnulib::log (1.0 - xin)); + ycur = (ycur - a) * exp (beta + r * std::log (xin) + + t * std::log (1.0 - xin)); if (ycur * yprev <= 0.0) { @@ -3735,14 +3735,14 @@ inline double xlog (const double& x) { - return gnulib::log (x); + return std::log (x); } template <> inline float xlog (const float& x) { - return gnulib::logf (x); + return std::log (x); } template <typename T> @@ -3802,7 +3802,7 @@ for (octave_idx_type k = z; k > 0; k--) p += 1.0 / (2 * k - 1); - p = - euler_mascheroni - 2 * gnulib::log (2) + 2 * (p); + p = - euler_mascheroni - 2 * std::log (2) + 2 * (p); } else {
--- a/liboctave/numeric/randgamma.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/numeric/randgamma.cc Fri Jun 17 13:45:04 2016 -0400 @@ -118,7 +118,7 @@ goto restart; /* rare, so don't bother moving up */ u = RUNI; xsq = x*x; - if (u >= 1.-0.0331*xsq*xsq && gnulib::log (u) >= 0.5*xsq + d*(1-v+gnulib::log (v))) + if (u >= 1.-0.0331*xsq*xsq && std::log (u) >= 0.5*xsq + d*(1-v+std::log (v))) goto restart; r[i] = d*v; } @@ -173,7 +173,7 @@ goto frestart; /* rare, so don't bother moving up */ u = RUNI; xsq = x*x; - if (u >= 1.-0.0331*xsq*xsq && gnulib::log (u) >= 0.5*xsq + d*(1-v+gnulib::log (v))) + if (u >= 1.-0.0331*xsq*xsq && std::log (u) >= 0.5*xsq + d*(1-v+std::log (v))) goto frestart; r[i] = d*v; }
--- a/liboctave/numeric/randmtzig.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/numeric/randmtzig.cc Fri Jun 17 13:45:04 2016 -0400 @@ -257,17 +257,17 @@ int n = 0; /* Look for entropy in /dev/urandom */ - FILE* urandom = gnulib::fopen ("/dev/urandom", "rb"); + FILE* urandom = std::fopen ("/dev/urandom", "rb"); if (urandom) { while (n < MT_N) { unsigned char word[4]; - if (gnulib::fread (word, 4, 1, urandom) != 1) + if (std::fread (word, 4, 1, urandom) != 1) break; entropy[n++] = word[0]+(word[1]<<8)+(word[2]<<16)+(static_cast<uint32_t>(word[3])<<24); } - gnulib::fclose (urandom); + std::fclose (urandom); } /* If there isn't enough entropy, gather some from various sources */ @@ -503,7 +503,7 @@ /* New x is given by x = f^{-1}(v/x_{i+1} + f(x_{i+1})), thus * need inverse operator of y = exp(-0.5*x*x) -> x = sqrt(-2*ln(y)) */ - x = sqrt (-2. * gnulib::log (NOR_SECTION_AREA / x1 + fi[i+1])); + x = sqrt (-2. * std::log (NOR_SECTION_AREA / x1 + fi[i+1])); ki[i+1] = static_cast<ZIGINT> (x / x1 * NMANTISSA); wi[i] = x / NMANTISSA; fi[i] = exp (-0.5 * x * x); @@ -531,7 +531,7 @@ /* New x is given by x = f^{-1}(v/x_{i+1} + f(x_{i+1})), thus * need inverse operator of y = exp(-x) -> x = -ln(y) */ - x = - gnulib::log (EXP_SECTION_AREA / x1 + fe[i+1]); + x = - std::log (EXP_SECTION_AREA / x1 + fe[i+1]); ke[i+1] = static_cast<ZIGINT> (x / x1 * EMANTISSA); we[i] = x / EMANTISSA; fe[i] = exp (-x); @@ -611,8 +611,8 @@ double xx, yy; do { - xx = - ZIGGURAT_NOR_INV_R * gnulib::log (RANDU); - yy = - gnulib::log (RANDU); + xx = - ZIGGURAT_NOR_INV_R * std::log (RANDU); + yy = - std::log (RANDU); } while ( yy+yy <= xx*xx); return ((rabs & 0x100) ? -ZIGGURAT_NOR_R-xx : ZIGGURAT_NOR_R+xx); @@ -642,7 +642,7 @@ * For the exponential tail, the method of Marsaglia[5] provides: * x = r - ln(U); */ - return ZIGGURAT_EXP_R - gnulib::log (RANDU); + return ZIGGURAT_EXP_R - std::log (RANDU); } else if ((fe[idx-1] - fe[idx]) * RANDU + fe[idx] < exp (-x)) return x; @@ -694,7 +694,7 @@ /* New x is given by x = f^{-1}(v/x_{i+1} + f(x_{i+1})), thus * need inverse operator of y = exp(-0.5*x*x) -> x = sqrt(-2*ln(y)) */ - x = sqrt (-2. * gnulib::log (NOR_SECTION_AREA / x1 + ffi[i+1])); + x = sqrt (-2. * std::log (NOR_SECTION_AREA / x1 + ffi[i+1])); fki[i+1] = static_cast<ZIGINT> (x / x1 * NMANTISSA); fwi[i] = x / NMANTISSA; ffi[i] = exp (-0.5 * x * x); @@ -722,7 +722,7 @@ /* New x is given by x = f^{-1}(v/x_{i+1} + f(x_{i+1})), thus * need inverse operator of y = exp(-x) -> x = -ln(y) */ - x = - gnulib::log (EXP_SECTION_AREA / x1 + ffe[i+1]); + x = - std::log (EXP_SECTION_AREA / x1 + ffe[i+1]); fke[i+1] = static_cast<ZIGINT> (x / x1 * EMANTISSA); fwe[i] = x / EMANTISSA; ffe[i] = exp (-x); @@ -778,8 +778,8 @@ float xx, yy; do { - xx = - ZIGGURAT_NOR_INV_R * gnulib::log (RANDU); - yy = - gnulib::log (RANDU); + xx = - ZIGGURAT_NOR_INV_R * std::log (RANDU); + yy = - std::log (RANDU); } while ( yy+yy <= xx*xx); return ((rabs & 0x100) ? -ZIGGURAT_NOR_R-xx : ZIGGURAT_NOR_R+xx); @@ -809,7 +809,7 @@ * For the exponential tail, the method of Marsaglia[5] provides: * x = r - ln(U); */ - return ZIGGURAT_EXP_R - gnulib::log (RANDU); + return ZIGGURAT_EXP_R - std::log (RANDU); } else if ((ffe[idx-1] - ffe[idx]) * RANDU + ffe[idx] < exp (-x)) return x;
--- a/liboctave/numeric/randpoisson.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/numeric/randpoisson.cc Fri Jun 17 13:45:04 2016 -0400 @@ -102,7 +102,7 @@ { r = 1.0 / k; rr = r * r; - return ((k + 0.5)*gnulib::log (k) - k + C0 + r*(C1 + rr*(C3 + rr*(C5 + rr*C7)))); + return ((k + 0.5)*std::log (k) - k + C0 + r*(C1 + rr*(C3 + rr*(C5 + rr*C7)))); } else return (logfak[static_cast<int> (k)]); @@ -164,9 +164,9 @@ /* mode m, reflection points k2 and k4, and points k1 and k5, */ /* which delimit the centre region of h(x) */ - m = gnulib::floor (my); + m = std::floor (my); k2 = ceil (my - 0.5 - Ds); - k4 = gnulib::floor (my - 0.5 + Ds); + k4 = std::floor (my - 0.5 + Ds); k1 = k2 + k2 - m + 1L; k5 = k4 + k4 - m; @@ -181,11 +181,11 @@ r5 = my / (k5 + 1.0); /* reciprocal values of the scale parameters of exp. tail envelope */ - ll = gnulib::log (r1); /* expon. tail left */ - lr = -gnulib::log (r5); /* expon. tail right*/ + ll = std::log (r1); /* expon. tail left */ + lr = -std::log (r5); /* expon. tail right*/ /* Poisson constants, necessary for computing function values f(k) */ - l_my = gnulib::log (my); + l_my = std::log (my); c_pm = m * l_my - flogfak (m); /* function values f(k) = p(k)/p(m) at k = k2, k4, k1, k5 */ @@ -213,14 +213,14 @@ /* immediate acceptance region R2 = [k2, m) *[0, f2), X = k2, ... m -1 */ - if ((V = U - p1) < 0.0) return (k2 + gnulib::floor (U/f2)); + if ((V = U - p1) < 0.0) return (k2 + std::floor (U/f2)); /* immediate acceptance region R1 = [k1, k2)*[0, f1), X = k1, ... k2-1 */ - if ((W = V / dl) < f1 ) return (k1 + gnulib::floor (V/f1)); + if ((W = V / dl) < f1 ) return (k1 + std::floor (V/f1)); /* computation of candidate X < k2, and its counterpart Y > k2 */ /* either squeeze-acceptance of X or acceptance-rejection of Y */ - Dk = gnulib::floor (dl * RUNI) + 1.0; + Dk = std::floor (dl * RUNI) + 1.0; if (W <= f2 - Dk * (f2 - f2/r2)) { /* quick accept of */ return (k2 - Dk); /* X = k2 - Dk */ @@ -240,14 +240,14 @@ { /* centre right */ /* immediate acceptance region R3 = [m, k4+1)*[0, f4), X = m, ... k4 */ - if ((V = U - p3) < 0.0) return (k4 - gnulib::floor ((U - p2)/f4)); + if ((V = U - p3) < 0.0) return (k4 - std::floor ((U - p2)/f4)); /* immediate acceptance region R4 = [k4+1, k5+1)*[0, f5) */ - if ((W = V / dr) < f5 ) return (k5 - gnulib::floor (V/f5)); + if ((W = V / dr) < f5 ) return (k5 - std::floor (V/f5)); /* computation of candidate X > k4, and its counterpart Y < k4 */ /* either squeeze-acceptance of X or acceptance-rejection of Y */ - Dk = gnulib::floor (dr * RUNI) + 1.0; + Dk = std::floor (dr * RUNI) + 1.0; if (W <= f4 - Dk * (f4 - f4*r4)) { /* quick accept of */ return (k4 + Dk); /* X = k4 + Dk */ @@ -268,7 +268,7 @@ W = RUNI; if (U < p5) { /* expon. tail left */ - Dk = gnulib::floor (1.0 - gnulib::log (W)/ll); + Dk = std::floor (1.0 - std::log (W)/ll); if ((X = k1 - Dk) < 0L) continue; /* 0 <= X <= k1 - 1 */ W *= (U - p4) * ll; /* W -- U(0, h(x)) */ if (W <= f1 - Dk * (f1 - f1/r1)) @@ -276,7 +276,7 @@ } else { /* expon. tail right*/ - Dk = gnulib::floor (1.0 - gnulib::log (W)/lr); + Dk = std::floor (1.0 - std::log (W)/lr); X = k5 + Dk; /* X >= k5 + 1 */ W *= (U - p5) * lr; /* W -- U(0, h(x)) */ if (W <= f5 - Dk * (f5 - f5*r5)) @@ -287,7 +287,7 @@ /* acceptance-rejection test of candidate X from the original area */ /* test, whether W <= f(k), with W = U*h(x) and U -- U(0, 1)*/ /* log f(X) = (X - m)*log(my) - log X! + log m! */ - if (gnulib::log (W) <= X * l_my - flogfak (X) - c_pm) return (X); + if (std::log (W) <= X * l_my - flogfak (X) - c_pm) return (X); } } /* ---- pprsc.c end ------ */ @@ -313,7 +313,7 @@ /* Precompute the table for the u up to and including 0.458. * We will almost certainly need it. */ - int intlambda = static_cast<int> (gnulib::floor (lambda)); + int intlambda = static_cast<int> (std::floor (lambda)); double P; int tableidx; size_t i = n; @@ -376,7 +376,7 @@ /* Precompute the table for the u up to and including 0.458. * We will almost certainly need it. */ - int intlambda = static_cast<int> (gnulib::floor (lambda)); + int intlambda = static_cast<int> (std::floor (lambda)); double P; int tableidx; size_t i = n; @@ -419,7 +419,7 @@ poisson_rejection (double lambda, double *p, size_t n) { double sq = sqrt (2.0*lambda); - double alxm = gnulib::log (lambda); + double alxm = std::log (lambda); double g = lambda*alxm - LGAMMA(lambda+1.0); size_t i; @@ -433,7 +433,7 @@ y = tan (M_PI*RUNI); em = sq * y + lambda; } while (em < 0.0); - em = gnulib::floor (em); + em = std::floor (em); t = 0.9*(1.0+y*y)*exp (em*alxm-flogfak (em)-g); } while (RUNI > t); p[i] = em; @@ -445,7 +445,7 @@ poisson_rejection_float (double lambda, float *p, size_t n) { double sq = sqrt (2.0*lambda); - double alxm = gnulib::log (lambda); + double alxm = std::log (lambda); double g = lambda*alxm - LGAMMA(lambda+1.0); size_t i; @@ -459,7 +459,7 @@ y = tan (M_PI*RUNI); em = sq * y + lambda; } while (em < 0.0); - em = gnulib::floor (em); + em = std::floor (em); t = 0.9*(1.0+y*y)*exp (em*alxm-flogfak (em)-g); } while (RUNI > t); p[i] = em; @@ -500,7 +500,7 @@ const double sqrtL = sqrt (L); for (i = 0; i < n; i++) { - p[i] = gnulib::floor (RNOR*sqrtL + L + 0.5); + p[i] = std::floor (RNOR*sqrtL + L + 0.5); if (p[i] < 0.0) p[i] = 0.0; /* will probably never happen */ } @@ -540,7 +540,7 @@ else { /* normal approximation: from Phys. Rev. D (1994) v50 p1284 */ - ret = gnulib::floor (RNOR*sqrt (L) + L + 0.5); + ret = std::floor (RNOR*sqrt (L) + L + 0.5); if (ret < 0.0) ret = 0.0; /* will probably never happen */ } return ret; @@ -572,7 +572,7 @@ const double sqrtL = sqrt (L); for (i = 0; i < n; i++) { - p[i] = gnulib::floor (RNOR*sqrtL + L + 0.5); + p[i] = std::floor (RNOR*sqrtL + L + 0.5); if (p[i] < 0.0) p[i] = 0.0; /* will probably never happen */ } @@ -613,7 +613,7 @@ else { /* normal approximation: from Phys. Rev. D (1994) v50 p1284 */ - ret = gnulib::floor (RNOR*sqrt (L) + L + 0.5); + ret = std::floor (RNOR*sqrt (L) + L + 0.5); if (ret < 0.0) ret = 0.0; /* will probably never happen */ } return ret;
--- a/liboctave/system/dir-ops.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/system/dir-ops.cc Fri Jun 17 13:45:04 2016 -0400 @@ -58,7 +58,7 @@ dir = octave_opendir_wrapper (fullname.c_str ()); if (! dir) - errmsg = gnulib::strerror (errno); + errmsg = std::strerror (errno); } else errmsg = "dir_entry::open: empty filename";
--- a/liboctave/system/file-ops.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/system/file-ops.cc Fri Jun 17 13:45:04 2016 -0400 @@ -414,7 +414,7 @@ int status = octave_mkdir_wrapper (name.c_str (), mode); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -434,7 +434,7 @@ int status = octave_mkfifo_wrapper (name.c_str (), mode); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -457,7 +457,7 @@ status = octave_link_wrapper (old_name.c_str (), new_name.c_str ()); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -480,7 +480,7 @@ status = octave_symlink_wrapper (old_name.c_str (), new_name.c_str ()); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -502,7 +502,7 @@ char *buf = octave_areadlink_wrapper (path.c_str ()); if (! buf) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); else { result = buf; @@ -527,10 +527,10 @@ msg = ""; - status = gnulib::rename (from.c_str (), to.c_str ()); + status = std::rename (from.c_str (), to.c_str ()); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -552,7 +552,7 @@ status = octave_rmdir_wrapper (name.c_str ()); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -657,7 +657,7 @@ status = octave_unlink_wrapper (name.c_str ()); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -704,7 +704,7 @@ strcpy (tname, templatename.c_str ()); if (octave_gen_tempname_wrapper (tname) == -1) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); else retval = tname; @@ -739,7 +739,7 @@ #endif if (retval.empty ()) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return retval; }
--- a/liboctave/system/file-stat.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/system/file-stat.cc Fri Jun 17 13:45:04 2016 -0400 @@ -202,7 +202,7 @@ if (status < 0) { fail = true; - errmsg = gnulib::strerror (errno); + errmsg = std::strerror (errno); } else { @@ -234,7 +234,7 @@ if (status < 0) { fail = true; - errmsg = gnulib::strerror (errno); + errmsg = std::strerror (errno); } else {
--- a/liboctave/system/oct-env.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/system/oct-env.cc Fri Jun 17 13:45:04 2016 -0400 @@ -594,7 +594,7 @@ void env::error (int err_num) const { - (*current_liboctave_error_handler) ("%s", gnulib::strerror (err_num)); + (*current_liboctave_error_handler) ("%s", std::strerror (err_num)); } void
--- a/liboctave/system/oct-syscalls.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/system/oct-syscalls.cc Fri Jun 17 13:45:04 2016 -0400 @@ -62,7 +62,7 @@ status = octave_dup2_wrapper (old_fd, new_fd); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -87,7 +87,7 @@ string_vector::delete_c_str_vec (argv); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -102,7 +102,7 @@ status = octave_fork_wrapper (); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); } else msg = NOT_SUPPORTED ("fork"); @@ -123,7 +123,7 @@ status = octave_fork_wrapper (); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); } else msg = NOT_SUPPORTED ("vfork"); @@ -137,7 +137,7 @@ pid_t status = octave_getpgrp_wrapper (); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -195,7 +195,7 @@ status = octave_pipe_wrapper (fildes); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; } @@ -217,7 +217,7 @@ retval = octave_waitpid_wrapper (pid, status, options); if (retval < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return retval; } @@ -307,7 +307,7 @@ status = octave_kill_wrapper (pid, sig); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); } else msg = NOT_SUPPORTED ("kill"); @@ -352,7 +352,7 @@ string_vector::delete_c_str_vec (argv); if (pid < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return pid; #endif @@ -375,7 +375,7 @@ status = octave_fcntl_wrapper (fd, cmd, arg); if (status < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); return status; }
--- a/liboctave/system/oct-time.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/system/oct-time.cc Fri Jun 17 13:45:04 2016 -0400 @@ -73,7 +73,7 @@ t.tm_zone = ps; #endif - ot_unix_time = gnulib::mktime (&t); + ot_unix_time = std::mktime (&t); #if defined (HAVE_STRUCT_TM_TM_ZONE) delete [] ps; @@ -239,7 +239,7 @@ time_t t = ot.unix_time (); - base_tm::init (gnulib::localtime (&t)); + base_tm::init (std::localtime (&t)); } void @@ -249,7 +249,7 @@ time_t t = ot.unix_time (); - base_tm::init (gnulib::gmtime (&t)); + base_tm::init (std::gmtime (&t)); } void @@ -286,7 +286,7 @@ && t.tm_year != std::numeric_limits<int>::min ()) { t.tm_isdst = -1; - gnulib::mktime (&t); + std::mktime (&t); } if (t.tm_mon < 0)
--- a/liboctave/system/oct-uname.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/system/oct-uname.cc Fri Jun 17 13:45:04 2016 -0400 @@ -43,7 +43,7 @@ &version, &machine); if (err < 0) - msg = gnulib::strerror (errno); + msg = std::strerror (errno); else { m_sysname = sysname;
--- a/liboctave/util/cmd-edit.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/util/cmd-edit.cc Fri Jun 17 13:45:04 2016 -0400 @@ -819,7 +819,7 @@ if (len > 0) { - retval = static_cast<char *> (gnulib::malloc (len+1)); + retval = static_cast<char *> (std::malloc (len+1)); strcpy (retval, tmp.c_str ()); } @@ -840,7 +840,7 @@ if (len > 0) { - retval = static_cast<char *> (gnulib::malloc (len+1)); + retval = static_cast<char *> (std::malloc (len+1)); strcpy (retval, tmp.c_str ()); } @@ -861,7 +861,7 @@ if (len > 0) { - retval = static_cast<char *> (gnulib::malloc (len+1)); + retval = static_cast<char *> (std::malloc (len+1)); strcpy (retval, tmp.c_str ()); } @@ -953,8 +953,8 @@ std::string default_command_editor::do_readline (const std::string& prompt, bool& eof) { - gnulib::fputs (prompt.c_str (), output_stream); - gnulib::fflush (output_stream); + std::fputs (prompt.c_str (), output_stream); + std::fflush (output_stream); return octave_fgetl (input_stream, eof); } @@ -1902,7 +1902,7 @@ void command_editor::error (int err_num) { - (*current_liboctave_error_handler) ("%s", gnulib::strerror (err_num)); + (*current_liboctave_error_handler) ("%s", std::strerror (err_num)); } void
--- a/liboctave/util/cmd-hist.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/util/cmd-hist.cc Fri Jun 17 13:45:04 2016 -0400 @@ -1013,10 +1013,10 @@ command_history::error (int err_num, const std::string& msg) const { if (msg.empty ()) - (*current_liboctave_error_handler) ("%s", gnulib::strerror (err_num)); + (*current_liboctave_error_handler) ("%s", std::strerror (err_num)); else (*current_liboctave_error_handler) ("%s: %s", msg.c_str (), - gnulib::strerror (err_num)); + std::strerror (err_num)); } void
--- a/liboctave/util/lo-utils.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/util/lo-utils.cc Fri Jun 17 13:45:04 2016 -0400 @@ -98,7 +98,7 @@ // FIXME: This leaks memory, but so would a call to setenv. // Short of extreme measures to track memory, altering the environment // always leaks memory, but the saving grace is that the leaks are small. - char *new_item = static_cast<char*> (gnulib::malloc (new_len)); + char *new_item = static_cast<char*> (std::malloc (new_len)); sprintf (new_item, "%s=%s", name.c_str (), value.c_str ()); @@ -126,13 +126,13 @@ int grow_size = 1024; int max_size = grow_size; - char *buf = static_cast<char *> (gnulib::malloc (max_size)); + char *buf = static_cast<char *> (std::malloc (max_size)); char *bufptr = buf; int len = 0; do { - if (gnulib::fgets (bufptr, grow_size, f)) + if (std::fgets (bufptr, grow_size, f)) { len = strlen (bufptr); @@ -141,7 +141,7 @@ int tmp = bufptr - buf + grow_size - 1; grow_size *= 2; max_size += grow_size; - buf = static_cast<char *> (gnulib::realloc (buf, max_size)); + buf = static_cast<char *> (std::realloc (buf, max_size)); bufptr = buf + tmp; if (*(bufptr-1) == '\n')
--- a/liboctave/util/oct-inttypes.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/util/oct-inttypes.cc Fri Jun 17 13:45:04 2016 -0400 @@ -578,7 +578,7 @@ dblesplit (double x, bool& sign, uint64_t& mtis, int& exp) { sign = x < 0; x = fabs (x); - x = gnulib::frexp (x, &exp); + x = std::frexp (x, &exp); exp -= 52; mtis = static_cast<uint64_t> (ldexp (x, 52)); }
--- a/liboctave/util/oct-shlib.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/util/oct-shlib.cc Fri Jun 17 13:45:04 2016 -0400 @@ -281,7 +281,7 @@ if (! library) { using namespace std; // FIXME: Why have this line? - (*current_liboctave_error_handler) ("%s", gnulib::strerror (errno)); + (*current_liboctave_error_handler) ("%s", std::strerror (errno)); } }
--- a/liboctave/util/sparse-util.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/liboctave/util/sparse-util.cc Fri Jun 17 13:45:04 2016 -0400 @@ -74,8 +74,8 @@ { va_list args; va_start (args, fmt); - int ret = gnulib::vfprintf (stderr, fmt, args); - gnulib::fflush (stderr); + int ret = std::vfprintf (stderr, fmt, args); + std::fflush (stderr); va_end (args); return ret; }
--- a/oct-conf-post.in.h Fri Jun 17 11:00:11 2016 -0400 +++ b/oct-conf-post.in.h Fri Jun 17 13:45:04 2016 -0400 @@ -20,10 +20,6 @@ */ -#if ! defined (GNULIB_NAMESPACE) -# define GNULIB_NAMESPACE gnulib -#endif - /* The C++ standard is evolving to allow attribute hints in a compiler-independent manner. In C++ 2011 support for noreturn was added. In C++ 2014 support for deprecated was added. The Octave
--- a/src/mkoctfile.in.cc Fri Jun 17 11:00:11 2016 -0400 +++ b/src/mkoctfile.in.cc Fri Jun 17 13:45:04 2016 -0400 @@ -59,7 +59,7 @@ while (true) { - c = gnulib::fgetc (fp); + c = std::fgetc (fp); if (c == '\n' || c == EOF) break; if (buf.size () <= idx)
--- a/src/module.mk Fri Jun 17 11:00:11 2016 -0400 +++ b/src/module.mk Fri Jun 17 13:45:04 2016 -0400 @@ -16,8 +16,7 @@ -Iliboctave/wrappers -I$(srcdir)/liboctave/wrappers \ -Ilibinterp -I$(srcdir)/libinterp \ -Ilibinterp/corefcn -I$(srcdir)/libinterp/corefcn \ - -I$(srcdir)/src \ - -Ilibgnu -I$(srcdir)/libgnu + -I$(srcdir)/src EXTRA_DIST += \ src/main.in.cc \