Mercurial > hg > octave-nkf
changeset 15423:53d073233fa4
call more built-in functions directly
* __init_gnuplot__.cc (gnuplot_graphics_toolkit::send_quit):
Call built-in functions directly.
* graphics.cc (gh_manager::do_process_events): Likewise.
* sysdep.cc (Fkbhit, Fpause, Fsleep, Fusleep): Likewise.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 19 Sep 2012 15:34:15 -0400 |
parents | 57e685d135ec |
children | cabe2fa4566c |
files | libinterp/dldfcn/__init_gnuplot__.cc libinterp/interpfcn/graphics.cc libinterp/interpfcn/sysdep.cc |
diffstat | 3 files changed, 14 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/dldfcn/__init_gnuplot__.cc +++ b/libinterp/dldfcn/__init_gnuplot__.cc @@ -33,6 +33,7 @@ #include <config.h> #endif +#include "builtins.h" #include "defun-dld.h" #include "error.h" #include "graphics.h" @@ -148,24 +149,17 @@ if (! error_state) { - args(1) = "\nquit;\n"; - args(0) = fids(0); - feval ("fputs", args); + Ffputs (ovl (fids(0), "\nquit;\n")); - args.resize (1); - feval ("fflush", args); - feval ("pclose", args); + Ffflush (ovl (fids(0))); + Fpclose (ovl (fids(0))); if (fids.numel () > 1) { - args(0) = fids(1); - feval ("pclose", args); + Fpclose (ovl (fids(1))); if (fids.numel () > 2) - { - args(0) = fids(2); - feval ("waitpid", args); - } + Fwaitpid (ovl (fids(2))); } } }
--- a/libinterp/interpfcn/graphics.cc +++ b/libinterp/interpfcn/graphics.cc @@ -42,6 +42,7 @@ #include "oct-locbuf.h" #include "singleton-cleanup.h" +#include "builtins.h" #include "cutils.h" #include "defun.h" #include "display.h" @@ -8202,7 +8203,7 @@ if (Vdrawnow_requested && ! old_Vdrawnow_requested) { - feval ("drawnow"); + Fdrawnow (); Vdrawnow_requested = false; }
--- a/libinterp/interpfcn/sysdep.cc +++ b/libinterp/interpfcn/sysdep.cc @@ -69,6 +69,7 @@ #include "quit.h" #include "Cell.h" +#include "builtins.h" #include "defun.h" #include "error.h" #include "input.h" @@ -645,7 +646,7 @@ if (interactive || forced_interactive) { - feval ("drawnow"); + Fdrawnow (); int c = octave_kbhit (args.length () == 0); @@ -697,7 +698,7 @@ { if (! xisnan (dval)) { - feval ("drawnow"); + Fdrawnow (); if (xisinf (dval)) { @@ -713,7 +714,7 @@ } else { - feval ("drawnow"); + Fdrawnow (); flush_octave_stdout (); octave_kbhit (); } @@ -746,7 +747,7 @@ warning ("sleep: NaN is an invalid delay"); else { - feval ("drawnow"); + Fdrawnow (); octave_sleep (dval); } } @@ -786,7 +787,7 @@ warning ("usleep: NaN is an invalid delay"); else { - feval ("drawnow"); + Fdrawnow (); int delay = NINT (dval);