Mercurial > octave
comparison libinterp/corefcn/variables.cc @ 20897:9aad16a799c9
maint: Replace argc variable name with nargin in C++ code.
* cellfun.cc (Fnum2cell): Remove extra space in nargin declaration.
* error.cc (Fwarning): Rename argc variable to nargin and update code.
* graphics.cc (create): Surround tertiary expression with parentheses before
assignment to variable.
* pager.cc (Fmore): Rename argc variable to nargin and update code. Replace
make_argv() with xstring_value() call. Make error messages more specific.
* pr-output.cc (Fformat): Return empty octave_value_list rather than declaring
retval and then returning it.
* variables.cc (Fwho, Fwhos): Remove unused variable retval.
* variables.cc (Fclear): Return empty octave_value_list rather than declaring
retval and then returning it.
* pt-funcall.cc (print_raw): Rename variable "len" to "n" for clarity.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 14 Dec 2015 15:34:39 -0800 |
parents | 1142cf6abc0d |
children | 03e4ddd49396 |
comparison
equal
deleted
inserted
replaced
20896:5e16d687a701 | 20897:9aad16a799c9 |
---|---|
1818 If called as a function, return a cell array of defined variable names\n\ | 1818 If called as a function, return a cell array of defined variable names\n\ |
1819 matching the given patterns.\n\ | 1819 matching the given patterns.\n\ |
1820 @seealso{whos, isglobal, isvarname, exist, regexp}\n\ | 1820 @seealso{whos, isglobal, isvarname, exist, regexp}\n\ |
1821 @end deftypefn") | 1821 @end deftypefn") |
1822 { | 1822 { |
1823 octave_value retval; | |
1824 | |
1825 if (nargout > 1) | 1823 if (nargout > 1) |
1826 print_usage (); | 1824 print_usage (); |
1827 | 1825 |
1828 int argc = args.length () + 1; | 1826 int argc = args.length () + 1; |
1829 | 1827 |
1894 describing each variable are: name, size, bytes, class, global, sparse,\n\ | 1892 describing each variable are: name, size, bytes, class, global, sparse,\n\ |
1895 complex, nesting, persistent.\n\ | 1893 complex, nesting, persistent.\n\ |
1896 @seealso{who, whos_line_format}\n\ | 1894 @seealso{who, whos_line_format}\n\ |
1897 @end deftypefn") | 1895 @end deftypefn") |
1898 { | 1896 { |
1899 octave_value retval; | |
1900 | |
1901 if (nargout > 1) | 1897 if (nargout > 1) |
1902 print_usage (); | 1898 print_usage (); |
1903 | 1899 |
1904 int argc = args.length () + 1; | 1900 int argc = args.length () + 1; |
1905 | 1901 |
2374 With the exception of @code{exclusive}, all long options can be used\n\ | 2370 With the exception of @code{exclusive}, all long options can be used\n\ |
2375 without the dash as well.\n\ | 2371 without the dash as well.\n\ |
2376 @seealso{who, whos, exist}\n\ | 2372 @seealso{who, whos, exist}\n\ |
2377 @end deftypefn") | 2373 @end deftypefn") |
2378 { | 2374 { |
2379 octave_value_list retval; | |
2380 | |
2381 int argc = args.length () + 1; | 2375 int argc = args.length () + 1; |
2382 | 2376 |
2383 string_vector argv = args.make_argv ("clear"); | 2377 string_vector argv = args.make_argv ("clear"); |
2384 | 2378 |
2385 if (argc == 1) | 2379 if (argc == 1) |
2456 } | 2450 } |
2457 | 2451 |
2458 if (idx <= argc) | 2452 if (idx <= argc) |
2459 { | 2453 { |
2460 if (! have_dash_option) | 2454 if (! have_dash_option) |
2461 { | 2455 do_matlab_compatible_clear (argv, argc, idx); |
2462 do_matlab_compatible_clear (argv, argc, idx); | |
2463 } | |
2464 else | 2456 else |
2465 { | 2457 { |
2466 if (clear_all) | 2458 if (clear_all) |
2467 { | 2459 { |
2468 maybe_warn_exclusive (exclusive); | 2460 maybe_warn_exclusive (exclusive); |
2469 | 2461 |
2470 if (++idx < argc) | 2462 if (++idx < argc) |
2471 warning | 2463 warning ("clear: ignoring extra arguments after -all"); |
2472 ("clear: ignoring extra arguments after -all"); | |
2473 | 2464 |
2474 symbol_table::clear_all (); | 2465 symbol_table::clear_all (); |
2475 } | 2466 } |
2476 else if (have_regexp) | 2467 else if (have_regexp) |
2477 { | 2468 { |
2503 | 2494 |
2504 octave_link::set_workspace (); | 2495 octave_link::set_workspace (); |
2505 } | 2496 } |
2506 } | 2497 } |
2507 | 2498 |
2508 return retval; | 2499 return octave_value_list (); |
2509 } | 2500 } |
2510 | 2501 |
2511 DEFUN (whos_line_format, args, nargout, | 2502 DEFUN (whos_line_format, args, nargout, |
2512 "-*- texinfo -*-\n\ | 2503 "-*- texinfo -*-\n\ |
2513 @deftypefn {} {@var{val} =} whos_line_format ()\n\ | 2504 @deftypefn {} {@var{val} =} whos_line_format ()\n\ |