Mercurial > octave-nkf
diff libinterp/octave-value/ov-usr-fcn.cc @ 17856:97e49b588f5d classdef
maint: periodic merge of default to classdef
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 05 Nov 2013 12:27:42 -0500 |
parents | 93b3d03b05e7 175b392e91fe |
children | 6a71e5030df5 |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-usr-fcn.cc Wed Oct 23 22:48:29 2013 -0400 +++ b/libinterp/octave-value/ov-usr-fcn.cc Tue Nov 05 12:27:42 2013 -0500 @@ -232,7 +232,7 @@ delete jit_info; #endif - // FIXME -- this is really playing with fire. + // FIXME: this is really playing with fire. symbol_table::erase_scope (local_scope); } @@ -423,7 +423,8 @@ octave_value_list octave_user_function::subsref (const std::string& type, const std::list<octave_value_list>& idx, - int nargout, const std::list<octave_lvalue>* lvalue_list) + int nargout, + const std::list<octave_lvalue>* lvalue_list) { octave_value_list retval; @@ -450,7 +451,7 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_builtin::subsref. @@ -727,7 +728,8 @@ void octave_user_function::bind_automatic_vars (const string_vector& arg_names, int nargin, int nargout, - const octave_value_list& va_args, const std::list<octave_lvalue> *lvalue_list) + const octave_value_list& va_args, + const std::list<octave_lvalue> *lvalue_list) { if (! arg_names.empty ()) { @@ -736,7 +738,8 @@ // which might be redefined in a function. Keep the old argn name // for backward compatibility of functions that use it directly. - symbol_table::force_assign ("argn", charMatrix (arg_names, Vstring_fill_char)); + symbol_table::force_assign ("argn", + charMatrix (arg_names, Vstring_fill_char)); symbol_table::force_assign (".argn.", Cell (arg_names)); symbol_table::mark_hidden (".argn."); @@ -777,8 +780,8 @@ // Only assign the hidden variable if black holes actually present. Matrix bh (1, nbh); octave_idx_type k = 0, l = 0; - for (std::list<octave_lvalue>::const_iterator p = lvalue_list->begin (); - p != lvalue_list->end (); p++) + for (std::list<octave_lvalue>::const_iterator + p = lvalue_list->begin (); p != lvalue_list->end (); p++) { if (p->is_black_hole ()) bh(l++) = k+1; @@ -820,7 +823,7 @@ } DEFUN (nargin, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} nargin ()\n\ @deftypefnx {Built-in Function} {} nargin (@var{fcn})\n\ Within a function, return the number of arguments passed to the function.\n\ @@ -865,7 +868,8 @@ } else { - // Matlab gives up for histc, so maybe it's ok we give up somtimes too. + // Matlab gives up for histc, + // so maybe it's ok that that we give up somtimes too? error ("nargin: nargin information not available for builtin functions"); } } @@ -886,7 +890,7 @@ } DEFUN (nargout, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} nargout ()\n\ @deftypefnx {Built-in Function} {} nargout (@var{fcn})\n\ Within a function, return the number of values the caller expects to\n\ @@ -915,7 +919,7 @@ In the second usage,\n\ \n\ @example\n\ -nargout (@@histc) \% or nargout ('histc')\n\ +nargout (@@histc) \% or nargout (\"histc\")\n\ @end example\n\ \n\ @noindent\n\ @@ -976,7 +980,7 @@ if (fcn) { tree_parameter_list *ret_list = fcn->return_list (); - + retval = ret_list ? ret_list->length () : 0; if (fcn->takes_var_return ()) @@ -984,9 +988,10 @@ } else { - // JWE said this information is not available (currently, 2011-03-10) + // JWE said this information is not available (2011-03-10) // without making intrusive changes to Octave. - // Matlab gives up for histc, so maybe it's ok we give up somtimes too. + // Matlab gives up for histc, + // so maybe it's ok that we give up somtimes too? error ("nargout: nargout information not available for builtin functions."); } } @@ -1012,7 +1017,7 @@ } DEFUN (optimize_subsasgn_calls, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} optimize_subsasgn_calls ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} optimize_subsasgn_calls (@var{new_val})\n\ @deftypefnx {Built-in Function} {} optimize_subsasgn_calls (@var{new_val}, \"local\")\n\ @@ -1049,7 +1054,7 @@ } DEFUN (isargout, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isargout (@var{k})\n\ Within a function, return a logical value indicating whether the argument\n\ @var{k} will be assigned on output to a variable. If the result is false,\n\ @@ -1096,7 +1101,9 @@ if (! error_state) { boolNDArray r (ka.dims ()); - for (octave_idx_type i = 0; i < ka.numel () && ! error_state; i++) + for (octave_idx_type i = 0; + i < ka.numel () && ! error_state; + i++) r(i) = isargout1 (nargout1, ignored, ka(i)); retval = r;