Mercurial > octave
changeset 23452:0af6dbede266
also use DEFUN macros for local function declarations
* defun-int.h (DECLARE_STATIC_FUN, DECLARE_STATIC_FUNX): New macros.
* graphics.cc (waitfor_listener, waitfor_del_listener):
Use DECLARE_STATIC_FUNX for definition.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 28 Apr 2017 13:59:51 -0400 |
parents | e4fca7cc471c |
children | 2eb7dc15f9fa |
files | libinterp/corefcn/defun-int.h libinterp/corefcn/graphics.cc |
diffstat | 2 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/defun-int.h Fri Apr 28 11:53:54 2017 -0400 +++ b/libinterp/corefcn/defun-int.h Fri Apr 28 13:59:51 2017 -0400 @@ -111,6 +111,13 @@ #define DECLARE_FUN(name, args_name, nargout_name) \ DECLARE_FUNX (F ## name, args_name, nargout_name) +#define DECLARE_STATIC_FUNX(name, args_name, nargout_name) \ + static octave_value_list \ + name (const octave_value_list& args_name, int nargout_name) + +#define DECLARE_STATIC_FUN(name, args_name, nargout_name) \ + DECLARE_FUNX (F ## name, args_name, nargout_name) + // Define the code that will be used to insert the new function into // the symbol table. We look for this name instead of the actual // function so that we can easily install the doc std::string too.
--- a/libinterp/corefcn/graphics.cc Fri Apr 28 11:53:54 2017 -0400 +++ b/libinterp/corefcn/graphics.cc Fri Apr 28 13:59:51 2017 -0400 @@ -11745,8 +11745,7 @@ cleanup_waitfor_predelete_listener (const octave_value& listener) { do_cleanup_waitfor_listener (listener, PREDELETE); } -static octave_value_list -waitfor_listener (const octave_value_list& args, int) +DECLARE_STATIC_FUNX (waitfor_listener, args, ) { if (args.length () > 3) { @@ -11778,8 +11777,7 @@ return ovl (); } -static octave_value_list -waitfor_del_listener (const octave_value_list& args, int) +DECLARE_STATIC_FUNX (waitfor_del_listener, args, ) { if (args.length () > 2) {