Mercurial > octave
changeset 32266:e852dad3734f
VM: Adapt coding style in recent changes.
* libinterp/parse-tree/pt-bytcode-vm-internal.h: Break some very long lines.
* libinterp/parse-tree/pt-bytcode-vm.h: Simplify preprocessor condition using
short-circuit && operator.
* libinterp/parse-tree/pt-bytcode-walk.cc: Use space after logical negation
operator.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Thu, 17 Aug 2023 17:23:55 +0200 |
parents | 4f287cb8002c |
children | 276aa68a290d |
files | libinterp/parse-tree/pt-bytecode-vm-internal.h libinterp/parse-tree/pt-bytecode-vm.h libinterp/parse-tree/pt-bytecode-walk.cc |
diffstat | 3 files changed, 8 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-bytecode-vm-internal.h Thu Aug 17 10:42:07 2023 -0400 +++ b/libinterp/parse-tree/pt-bytecode-vm-internal.h Thu Aug 17 17:23:55 2023 +0200 @@ -400,7 +400,8 @@ if (n_args_on_callee_stack > n_args_callee) \ { \ std::string fn_name = unwind_data->m_name; \ - (*sp++).pee = new execution_exception {"error", "Octave:invalid-fun-call", fn_name + ": function called with too many inputs"};\ + (*sp++).pee = new execution_exception {"error", "Octave:invalid-fun-call", \ + fn_name + ": function called with too many inputs"}; \ (*sp++).i = static_cast<int> (error_type::EXECUTION_EXC); \ goto unwind; \ } \ @@ -409,7 +410,8 @@ if (n_returns >= 0 && nargout > n_returns) \ { \ std::string fn_name = unwind_data->m_name; \ - (*sp++).pee = new execution_exception {"error", "Octave:invalid-fun-call", fn_name + ": function called with too many outputs"};\ + (*sp++).pee = new execution_exception {"error", "Octave:invalid-fun-call", \ + fn_name + ": function called with too many outputs"}; \ (*sp++).i = static_cast<int> (error_type::EXECUTION_EXC); \ goto unwind; \ } \
--- a/libinterp/parse-tree/pt-bytecode-vm.h Thu Aug 17 10:42:07 2023 -0400 +++ b/libinterp/parse-tree/pt-bytecode-vm.h Thu Aug 17 17:23:55 2023 +0200 @@ -539,12 +539,9 @@ loc_entry find_loc (int ip, std::vector<octave::loc_entry> &loc_entries); // Disable some optimizations in GCC that are not suitable for dynamic label dispatch -#if defined __has_attribute -# if __has_attribute (optimize) -# define OCTAVE_VM_EXECUTE_ATTR __attribute__ ((optimize("no-gcse","no-crossjumping"))) -# endif -#endif -#if !defined OCTAVE_VM_EXECUTE_ATTR +#if defined (__has_attribute) && __has_attribute (optimize) +# define OCTAVE_VM_EXECUTE_ATTR __attribute__ ((optimize("no-gcse","no-crossjumping"))) +#else # define OCTAVE_VM_EXECUTE_ATTR #endif
--- a/libinterp/parse-tree/pt-bytecode-walk.cc Thu Aug 17 10:42:07 2023 -0400 +++ b/libinterp/parse-tree/pt-bytecode-walk.cc Thu Aug 17 17:23:55 2023 +0200 @@ -2060,7 +2060,7 @@ } // TODO: The return_list is a nullptr for anonymous functions. - if (!returns) + if (! returns) error ("Compiling anonymous functions is not supported by the VM yet"); // Does the function output varargout?