Mercurial > hg > octave-lojdl
changeset 12483:7a5aacf65f81
Rewrite error strings in src/ to use variables named in documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 26 Feb 2011 17:28:11 -0800 |
parents | 3244c6e0af4a |
children | 9c831d357e6f |
files | src/ChangeLog src/DLD-FUNCTIONS/besselj.cc src/DLD-FUNCTIONS/cellfun.cc src/DLD-FUNCTIONS/filter.cc src/DLD-FUNCTIONS/matrix_type.cc src/DLD-FUNCTIONS/strfind.cc src/DLD-FUNCTIONS/sub2ind.cc src/bitfcns.cc src/data.cc src/error.cc src/file-io.cc src/graphics.cc src/help.cc src/input.cc src/load-path.cc src/load-save.cc src/oct-parse.yy src/ov-base.cc src/ov-cell.cc src/ov-class.cc src/ov-fcn-handle.cc src/ov-fcn-inline.cc src/ov-flt-re-mat.cc src/ov-struct.cc src/ov-usr-fcn.cc src/pr-output.cc src/pt-mat.cc src/sparse.cc src/strfns.cc src/syscalls.cc src/sysdep.cc src/toplev.cc src/utils.cc src/variables.cc |
diffstat | 34 files changed, 181 insertions(+), 169 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2010-02-26 Rik <octave@nomad.inbox5.com> + + * DLD-FUNCTIONS/besselj.cc, DLD-FUNCTIONS/cellfun.cc, + DLD-FUNCTIONS/filter.cc, DLD-FUNCTIONS/matrix_type.cc, + DLD-FUNCTIONS/strfind.cc, DLD-FUNCTIONS/sub2ind.cc, bitfcns.cc, + data.cc, error.cc, file-io.cc, graphics.cc, help.cc, input.cc, + load-path.cc, load-save.cc, oct-parse.yy, ov-base.cc, ov-cell.cc, + ov-class.cc, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-flt-re-mat.cc, + ov-struct.cc, ov-usr-fcn.cc, pr-output.cc, pt-mat.cc, sparse.cc, + strfns.cc, syscalls.cc, sysdep.cc, toplev.cc, utils.cc, variables.cc: + Rewrite error strings to use variables named in documentation. + 2011-02-23 John W. Eaton <jwe@octave.org> * mex.cc (mxArray_base::dup): Return retval.
--- a/src/DLD-FUNCTIONS/besselj.cc +++ b/src/DLD-FUNCTIONS/besselj.cc @@ -589,7 +589,7 @@ error ("airy: expecting K = 0, 1, 2, or 3"); } else - error ("airy: expecting integer value for K"); + error ("airy: K must be an integer value"); } if (! error_state) @@ -616,7 +616,7 @@ retval(0) = result; } else - error ("airy: expecting complex matrix for Z"); + error ("airy: Z must be a complex matrix"); } else { @@ -638,7 +638,7 @@ retval(0) = result; } else - error ("airy: expecting complex matrix for Z"); + error ("airy: Z must be a complex matrix"); } } }
--- a/src/DLD-FUNCTIONS/cellfun.cc +++ b/src/DLD-FUNCTIONS/cellfun.cc @@ -214,7 +214,7 @@ if (nargin < 2) { - error ("cellfun: you must supply at least 2 arguments"); + error ("cellfun: function requires at least 2 arguments"); print_usage (); return retval; }
--- a/src/DLD-FUNCTIONS/filter.cc +++ b/src/DLD-FUNCTIONS/filter.cc @@ -79,7 +79,7 @@ dim_vector x_dims = x.dims (); if (dim < 0 || dim > x_dims.length ()) { - error ("filter: filtering over invalid dimension"); + error ("filter: DIM must be a valid dimension"); return y; } @@ -262,7 +262,7 @@ else if (dim < 0 || dim > x_dims.length ()) { - error ("filter: filtering over invalid dimension"); + error ("filter: DIM must be a valid dimension"); return MArray<T> (); } @@ -399,7 +399,7 @@ dim = args(4).nint_value() - 1; if (dim < 0 || dim >= x_dims.length ()) { - error ("filter: filtering over invalid dimension"); + error ("filter: DIM must be a valid dimension"); return retval; } }
--- a/src/DLD-FUNCTIONS/matrix_type.cc +++ b/src/DLD-FUNCTIONS/matrix_type.cc @@ -245,7 +245,7 @@ nu = args(3).nint_value (); if (error_state) - error ("matrix_type: band size must be integer"); + error ("matrix_type: band size NL, NU must be integers"); else { if (nl == 1 && nu == 1)
--- a/src/DLD-FUNCTIONS/strfind.cc +++ b/src/DLD-FUNCTIONS/strfind.cc @@ -393,12 +393,12 @@ retval = retc; } else - error ("strrep: first argument must be a string or cell array of strings"); + error ("strrep: S must be a string or cell array of strings"); } else if (argpat.is_cell () || argrep.is_cell ()) retval = do_simple_cellfun (Fstrrep, "strrep", args); else - error ("strrep: X and Y arguments must be strings or cell arrays of strings"); + error ("strrep: PTN and REP arguments must be strings or cell arrays of strings"); } else print_usage ();
--- a/src/DLD-FUNCTIONS/sub2ind.cc +++ b/src/DLD-FUNCTIONS/sub2ind.cc @@ -40,7 +40,7 @@ octave_idx_type n = dimsv.length (); if (n < 1) - error ("%s: dimension vector must not be empty", name); + error ("%s: dimension vector DIMS must not be empty", name); else { dv.resize (std::max (n, static_cast<octave_idx_type> (2))); @@ -52,7 +52,7 @@ dv(i) = ii; else { - error ("%s: dimension vector must contain integers", name); + error ("%s: dimension vector DIMS must contain integers", name); break; } }
--- a/src/bitfcns.cc +++ b/src/bitfcns.cc @@ -76,7 +76,7 @@ retval = result; \ } \ else \ - error ("%s: size of x and y must match, or one operand must be a scalar", FNAME); \ + error ("%s: size of X and Y must match, or one operand must be a scalar", FNAME); \ } #define BITOP(OP, FNAME) \ @@ -373,7 +373,7 @@ error ("bitshift: size of A and N must match, or one operand must be a scalar"); \ } \ else \ - error ("bitshift: expecting second argument to be integer"); \ + error ("bitshift: expecting integer as second argument"); \ } #define DO_UBITSHIFT(T, N) \ @@ -456,15 +456,15 @@ // FIXME -- for compatibility, we should accept an array // or a scalar as the third argument. if (args(2).numel () > 1) - error ("bitshift: expecting scalar integer as third argument"); + error ("bitshift: N must be a scalar integer"); else { nbits = args(2).int_value (); if (error_state) - error ("bitshift: expecting integer as third argument"); + error ("bitshift: N must be an integer"); else if (nbits < 0) - error ("bitshift: number of bits to mask must be positive"); + error ("bitshift: N must be positive"); } } }
--- a/src/data.cc +++ b/src/data.cc @@ -1256,7 +1256,7 @@ octave_idx_type k = args(1).int_value (); if (error_state) - error ("diag: invalid second argument"); + error ("diag: invalid argument K"); else retval = args(0).diag(k); } @@ -1272,7 +1272,7 @@ error ("diag: invalid dimensions"); } else - error ("diag: first argument must be a vector"); + error ("diag: V must be a vector"); } else print_usage (); @@ -1750,10 +1750,10 @@ if (dim >= 0) retval = do_cat (args.slice (1, args.length () - 1), dim, "cat"); else - error ("cat: invalid dimension specified"); + error ("cat: DIM must be a valid dimension"); } else - error ("cat: expecting first argument to be a integer"); + error ("cat: DIM must be an integer"); } else print_usage (); @@ -2104,7 +2104,7 @@ octave_idx_type nd = args(1).int_value (true); if (error_state) - error ("size: expecting scalar as second argument"); + error ("size: DIM must be a scalar"); else { const dim_vector dv = args(0).dims (); @@ -2117,7 +2117,7 @@ retval(0) = 1; } else - error ("size: requested dimension (= %d) out of range", nd); + error ("size: requested dimension DIM (= %d) out of range", nd); } } else @@ -2303,7 +2303,7 @@ { dim = args(1).int_value () - 1; if (dim < 0) - error ("sum: invalid dimension argument = %d", dim + 1); + error ("sum: invalid dimension DIM = %d", dim + 1); } if (! error_state) @@ -4310,7 +4310,7 @@ } } else - error ("linspace: expecting third argument to be an integer"); + error ("linspace: N must be an integer"); return retval; } @@ -4469,7 +4469,7 @@ { if (new_size(i) < 0) { - error ("reshape: size must be nonnegative"); + error ("reshape: SIZE must be non-negative"); break; } else @@ -4504,7 +4504,7 @@ break; else if (new_dims(i-1) < 0) { - error ("reshape: size must be nonnegative"); + error ("reshape: SIZE must be non-negative"); break; } } @@ -4522,7 +4522,7 @@ octave_idx_type size_empty_dim = a_nel / nel; if (a_nel != size_empty_dim * nel) - error ("reshape: size is not divisible by the product of known dimensions (= %d)", nel); + error ("reshape: SIZE is not divisible by the product of known dimensions (= %d)", nel); else new_dims(empty_dim-1) = size_empty_dim; } @@ -4585,7 +4585,7 @@ dim = args(1).idx_type_value (); if (dim < 1) - error ("vec: dim must greater than zero"); + error ("vec: DIM must be greater than zero"); } if (! error_state) @@ -5482,7 +5482,7 @@ smode = DESCENDING; else { - error ("sort: mode must be either \"ascend\" or \"descend\""); + error ("sort: MODE must be either \"ascend\" or \"descend\""); return retval; } } @@ -5500,7 +5500,7 @@ if (! args(2).is_string ()) { - error ("sort: mode must be a string"); + error ("sort: MODE must be a string"); return retval; } std::string mode = args(2).string_value(); @@ -5510,7 +5510,7 @@ smode = DESCENDING; else { - error ("sort: mode must be either \"ascend\" or \"descend\""); + error ("sort: MODE must be either \"ascend\" or \"descend\""); return retval; } } @@ -5525,7 +5525,7 @@ { if (dim < 0) { - error ("sort: dim must be a valid dimension"); + error ("sort: DIM must be a valid dimension"); return retval; } } @@ -5752,7 +5752,7 @@ smode = DESCENDING; else { - error ("__sort_rows_idx__: mode must be either \"ascend\" or \"descend\""); + error ("__sort_rows_idx__: MODE must be either \"ascend\" or \"descend\""); return retval; } } @@ -5792,7 +5792,7 @@ else if (mode == "either") smode = UNSORTED; else - error ("issorted: expecting MODE to be \"ascending\", \"descending\", or \"either\""); + error ("issorted: MODE must be \"ascending\", \"descending\", or \"either\""); return smode; } @@ -5860,7 +5860,7 @@ if (arg.ndims () == 2) retval = arg.is_sorted_rows (smode) != UNSORTED; else - error ("issorted: needs a 2-dimensional object"); + error ("issorted: A must be a 2-dimensional object"); } else { @@ -5940,7 +5940,7 @@ { dim = args(2).int_value (true) - 1; if (dim < 0) - error ("nth_element: dim must be a valid dimension"); + error ("nth_element: DIM must be a valid dimension"); } if (dim < 0) dim = argx.dims ().first_non_singleton (); @@ -6260,7 +6260,7 @@ if ((! tscl && tval.dims () != dv) || (! fscl && fval.dims () != dv)) - error ("merge: dimensions mismatch"); + error ("merge: MASK, TVAL, and FVAL dimensions must match"); else { T *rv = retval.fortran_vec (); @@ -6580,16 +6580,16 @@ if (args(1).is_scalar_type ()) order = args(1).idx_type_value (true, false); else if (! args(1).is_zero_by_zero ()) - error ("order must be a scalar or []"); + error ("order K must be a scalar or []"); if (! error_state && order < 0) - error ("order must be non-negative"); + error ("order K must be non-negative"); } if (nargin > 2) { dim = args(2).int_value (true, false); if (! error_state && (dim < 1 || dim > args(0).ndims ())) - error ("needs a valid dimension"); + error ("DIM must be a valid dimension"); else dim -= 1; } @@ -6633,7 +6633,7 @@ octave_idx_type k = rep(1, i); if (k < 0) { - error ("repelems: second row must contain nonnegative numbers"); + error ("repelems: second row must contain non-negative numbers"); return retval; } @@ -6690,7 +6690,7 @@ return retval; else if (rm.rows () != 2 || rm.ndims () != 2) { - error ("repelems: second argument must be a matrix with two rows"); + error ("repelems: R must be a matrix with two rows"); return retval; } else @@ -6702,7 +6702,7 @@ octave_idx_type rx = rm(i); if (static_cast<double> (rx) != rm(i)) { - error ("repelems: a matrix of integers is expected"); + error ("repelems: R must be a matrix of integers"); return retval; }
--- a/src/error.cc +++ b/src/error.cc @@ -966,7 +966,7 @@ } } else - error ("rethrow: structure must contain the fields 'message and 'identifier'"); + error ("rethrow: ERR structure must contain the fields 'message and 'identifier'"); } } return retval;
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -893,7 +893,7 @@ result = os.printf (args(fmt_n), tmp_args, who); } else - ::error ("%s: format must be a string", who.c_str ()); + ::error ("%s: format TEMPLATE must be a string", who.c_str ()); } } else @@ -944,7 +944,7 @@ result = stdout_stream.printf (args(0), tmp_args, who); } else - ::error ("%s: format must be a string", who.c_str ()); + ::error ("%s: format TEMPLATE must be a string", who.c_str ()); } else print_usage (); @@ -1052,7 +1052,7 @@ fmt_arg.is_sq_string () ? '\'' : '"'); } else - ::error ("%s: format must be a string", who.c_str ()); + ::error ("%s: format TEMPLATE must be a string", who.c_str ()); } else ::error ("%s: unable to create output buffer", who.c_str ()); @@ -1127,7 +1127,7 @@ if (args(1).is_string ()) retval = os.oscanf (args(1), who); else - ::error ("%s: format must be a string", who.c_str ()); + ::error ("%s: format TEMPLATE must be a string", who.c_str ()); } } else @@ -1200,14 +1200,14 @@ if (args(1).is_string ()) retval = os.oscanf (args(1), who); else - ::error ("%s: format must be a string", who.c_str ()); + ::error ("%s: format TEMPLATE must be a string", who.c_str ()); } else ::error ("%s: unable to create temporary input buffer", who.c_str ()); } else - ::error ("%s: first argument must be a string", who.c_str ()); + ::error ("%s: argument STRING must be a string", who.c_str ()); } else { @@ -1251,14 +1251,14 @@ } } else - ::error ("%s: format must be a string", who.c_str ()); + ::error ("%s: format TEMPLATE must be a string", who.c_str ()); } else ::error ("%s: unable to create temporary input buffer", who.c_str ()); } else - ::error ("%s: first argument must be a string", who.c_str ()); + ::error ("%s: argument STRING must be a string", who.c_str ()); } else print_usage (); @@ -1331,19 +1331,19 @@ output_type, skip, flt_fmt, count); } else - ::error ("fread: architecture type must be a string"); + ::error ("fread: ARCH architecture type must be a string"); } else - ::error ("fread: skip must be an integer"); + ::error ("fread: SKIP must be an integer"); } else - ::error ("fread: invalid data type specified"); + ::error ("fread: invalid PRECISION specified"); } else - ::error ("fread: precision must be a string"); + ::error ("fread: PRECISION must be a string"); } else - ::error ("fread: invalid size specified"); + ::error ("fread: invalid SIZE specified"); return retval; } @@ -1608,16 +1608,16 @@ skip, flt_fmt); } else - ::error ("fwrite: architecture type must be a string"); + ::error ("fwrite: ARCH architecture type must be a string"); } else - ::error ("fwrite: skip must be an integer"); + ::error ("fwrite: SKIP must be an integer"); } else - ::error ("fwrite: invalid precision specified"); + ::error ("fwrite: invalid PRECISION specified"); } else - ::error ("fwrite: precision must be a string"); + ::error ("fwrite: PRECISION must be a string"); return retval; } @@ -1818,13 +1818,13 @@ retval = octave_stream_list::insert (ops); } else - ::error ("popen: invalid mode specified"); + ::error ("popen: invalid MODE specified"); } else - ::error ("popen: mode must be a string"); + ::error ("popen: MODE must be a string"); } else - ::error ("popen: name must be a string"); + ::error ("popen: COMMAND must be a string"); } else print_usage (); @@ -1883,10 +1883,10 @@ if (! error_state) retval = octave_tempnam (dir, pfx); else - ::error ("expecting second argument to be a string"); + ::error ("PREFIX must be a string"); } else - ::error ("expecting first argument to be a string"); + ::error ("DIR argument must be a string"); } else print_usage (); @@ -2026,7 +2026,7 @@ } } else - error ("mkstemp: expecting string as first argument"); + error ("mkstemp: TEMPLATE argument must be a string"); } else print_usage (); @@ -2098,7 +2098,7 @@ else { status = -1; - ::error ("umask: expecting integer argument"); + ::error ("umask: MASK must be an integer"); } } else
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -7684,16 +7684,16 @@ error ("drawnow: nothing to draw"); } else - error ("drawnow: invalid debug_file, expected a string value"); + error ("drawnow: invalid DEBUG_FILE, expected a string value"); } else - error ("drawnow: invalid colormode, expected a boolean value"); + error ("drawnow: invalid colormode MONO, expected a boolean value"); } else - error ("drawnow: invalid file, expected a string value"); + error ("drawnow: invalid FILE, expected a string value"); } else - error ("drawnow: invalid terminal, expected a string value"); + error ("drawnow: invalid terminal TERM, expected a string value"); } else print_usage (); @@ -7950,7 +7950,7 @@ name.c_str ()); } else - error ("addproperty: invalid property type, expected a string value"); + error ("addproperty: invalid property TYPE, expected a string value"); } else error ("addproperty: invalid graphics object (= %g)", h); @@ -7959,7 +7959,7 @@ error ("addproperty: invalid handle value"); } else - error ("addproperty: invalid property name, expected a string value"); + error ("addproperty: invalid property NAME, expected a string value"); } else print_usage ();
--- a/src/help.cc +++ b/src/help.cc @@ -1040,7 +1040,7 @@ } } else - error ("__list_functions__: input must be a string"); + error ("__list_functions__: DIRECTORY argument must be a string"); } return retval;
--- a/src/input.cc +++ b/src/input.cc @@ -932,7 +932,7 @@ if (error_state) { - error ("yes_or_no: expecting argument to be character string"); + error ("yes_or_no: PROMPT must be a character string"); return retval; } }
--- a/src/load-path.cc +++ b/src/load-path.cc @@ -1971,7 +1971,7 @@ if (! error_state) retval = genpath (dirname); else - error ("genpath: expecting argument to be a character string"); + error ("genpath: DIR must be a character string"); } else if (nargin > 1) { @@ -1990,7 +1990,7 @@ if (! error_state) retval = genpath (dirname, skip); else - error ("genpath: expecting all arguments to be character strings"); + error ("genpath: all arguments must be character strings"); } else print_usage (); @@ -2221,7 +2221,7 @@ } } else - error ("addpath: expecting all args to be character strings"); + error ("addpath: all arguments must be character strings"); } if (need_to_update) @@ -2285,7 +2285,7 @@ } } else - error ("addpath: expecting all args to be character strings"); + error ("addpath: all arguments must be character strings"); } if (need_to_update)
--- a/src/load-save.cc +++ b/src/load-save.cc @@ -855,7 +855,7 @@ file.close (); } else - error ("load: unable open input file `%s'", + error ("load: unable to open input file `%s'", orig_fname.c_str ()); } }
--- a/src/oct-parse.yy +++ b/src/oct-parse.yy @@ -4269,7 +4269,7 @@ error ("builtin: lookup for symbol `%s' failed", name.c_str ()); } else - error ("builtin: expecting function name as first argument"); + error ("builtin: function name (F) must be a string"); } else print_usage (); @@ -4609,7 +4609,7 @@ else if (context == "base") octave_call_stack::goto_base_frame (); else - error ("assignin: context must be \"caller\" or \"base\""); + error ("assignin: CONTEXT must be \"caller\" or \"base\""); if (! error_state) { @@ -4622,14 +4622,14 @@ if (valid_identifier (nm)) symbol_table::varref (nm) = args(2); else - error ("assignin: invalid variable name"); + error ("assignin: invalid variable name in argument VARNAME"); } else - error ("assignin: expecting variable name as second argument"); + error ("assignin: VARNAME must be a string"); } } else - error ("assignin: expecting string as first argument"); + error ("assignin: CONTEXT must be a string"); } else print_usage (); @@ -4662,7 +4662,7 @@ else if (context == "base") octave_call_stack::goto_base_frame (); else - error ("evalin: context must be \"caller\" or \"base\""); + error ("evalin: CONTEXT must be \"caller\" or \"base\""); if (! error_state) { @@ -4699,7 +4699,7 @@ } } else - error ("evalin: expecting string as first argument"); + error ("evalin: CONTEXT must be a string"); } else print_usage ();
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -931,7 +931,7 @@ else { if (! error_state) - error ("invalid conversion of multidimensional struct to scalar struct"); + error ("invalid conversion of multi-dimensional struct to scalar struct"); return octave_scalar_map (); }
--- a/src/ov-cell.cc +++ b/src/ov-cell.cc @@ -538,7 +538,7 @@ retval = tmp.is_sorted (mode); } else - error ("issorted: not a cell array of strings"); + error ("issorted: A is not a cell array of strings"); return retval; } @@ -573,7 +573,7 @@ retval = tmp.is_sorted_rows (mode); } else - error ("issorted: not a cell array of strings"); + error ("issorted: A is not a cell array of strings"); return retval; } @@ -1375,7 +1375,7 @@ ? Cell (octave_value (std::string ())) : Cell (s, true)); else - error ("cellstr: expecting argument to be a 2-d character array"); + error ("cellstr: argument STRING must be a 2-D character array"); } } else @@ -1460,7 +1460,7 @@ retval = c; } else - error ("struct2cell: expecting argument to be a cell array"); + error ("struct2cell: argument S must be a structure"); } else print_usage ();
--- a/src/ov-class.cc +++ b/src/ov-class.cc @@ -1697,7 +1697,7 @@ parent_class_names = obj.parent_class_name_list (); } else - error ("invalid call to exmplar_info constructor"); + error ("invalid call to exemplar_info constructor"); } @@ -1826,7 +1826,7 @@ } } else - error ("class: expecting structure as first argument"); + error ("class: expecting structure S as first argument"); } else error ("class: `%s' is invalid as a class name in this context", @@ -1836,7 +1836,7 @@ error ("class: invalid call from outside class constructor or method"); } else - error ("class: expecting character string as second argument"); + error ("class: ID (class name) must be a character string"); } return retval;
--- a/src/ov-fcn-handle.cc +++ b/src/ov-fcn-handle.cc @@ -1646,10 +1646,10 @@ retval = m; } else - error ("functions: invalid function handle object"); + error ("functions: FCN_HANDLE is not a valid function handle object"); } else - error ("functions: argument must be a function handle object"); + error ("functions: FCN_HANDLE argument must be a function handle object"); } else print_usage (); @@ -1686,7 +1686,7 @@ retval = fh_nm; } else - error ("func2str: expecting valid function handle as first argument"); + error ("func2str: FCN_HANDLE must be a valid function handle"); } else print_usage (); @@ -1713,7 +1713,7 @@ if (! error_state) retval = make_fcn_handle (nm, nargin != 2); else - error ("str2func: expecting string as first argument"); + error ("str2func: FCN_NAME must be a string"); } else print_usage ();
--- a/src/ov-fcn-inline.cc +++ b/src/ov-fcn-inline.cc @@ -763,13 +763,13 @@ } else { - error ("inline: numeric argument must be nonnegative"); + error ("inline: N must be positive or zero"); return retval; } } else { - error ("inline: expecting second argument to be an integer"); + error ("inline: N must be an integer"); return retval; } } @@ -794,7 +794,7 @@ retval = octave_value (new octave_fcn_inline (fun, fargs)); } else - error ("inline: first argument must be a string"); + error ("inline: STR argument must be a string"); } else print_usage (); @@ -829,7 +829,7 @@ if (fn) retval = octave_value (fn->fcn_text ()); else - error ("formula: must be an inline function"); + error ("formula: FUN must be an inline function"); } else print_usage (); @@ -865,7 +865,7 @@ retval = t2; } else - error ("argnames: argument must be an inline function"); + error ("argnames: FUN must be an inline function"); } else print_usage ();
--- a/src/ov-flt-re-mat.cc +++ b/src/ov-flt-re-mat.cc @@ -823,7 +823,7 @@ } else if (args(0).is_sparse_type ()) { - error ("single: sparse type do not support single precision"); + error ("single: sparse type does not support single precision"); } else if (args(0).is_complex_type ()) {
--- a/src/ov-struct.cc +++ b/src/ov-struct.cc @@ -707,8 +707,8 @@ %!assert(isstruct(x)); %!assert(isempty(fieldnames(x))); %!fail("struct('a',{1,2},'b',{1,2,3})","dimensions of parameter 2 do not match those of parameter 4") -%!fail("struct(1,2,3,4)","struct expects alternating \"field\", VALUE pairs"); -%!fail("struct('1',2,'3')","struct expects alternating \"field\", VALUE pairs"); +%!fail("struct(1,2,3,4)","struct: expecting alternating \"field\", VALUE pairs"); +%!fail("struct('1',2,'3')","struct: expecting alternating \"field\", VALUE pairs"); */ bool @@ -1725,8 +1725,8 @@ %!assert(isstruct(x)); %!assert(isempty(fieldnames(x))); %!fail("struct('a',{1,2},'b',{1,2,3})","dimensions of parameter 2 do not match those of parameter 4") -%!fail("struct(1,2,3,4)","struct expects alternating \"field\", VALUE pairs"); -%!fail("struct('1',2,'3')","struct expects alternating \"field\", VALUE pairs"); +%!fail("struct(1,2,3,4)","struct: expecting alternating \"field\", VALUE pairs"); +%!fail("struct('1',2,'3')","struct: expecting alternating \"field\", VALUE pairs"); */ DEFUN (struct, args, , @@ -1790,7 +1790,7 @@ { if (! args(i).is_string () || i + 1 >= nargin) { - error ("struct expects alternating \"field\", VALUE pairs"); + error ("struct: expecting alternating \"field\", VALUE pairs"); return retval; } } @@ -2048,11 +2048,11 @@ if (args.length () == 3) { if (! args(0).is_cell ()) - error ("cell2struct: first argument must be a cell"); + error ("cell2struct: argument CELL must be of type cell"); else if (! (args(1).is_cellstr () || args(1).is_char_matrix ())) - error ("cell2struct: second argument must be a cell array of strings or a character matrix"); + error ("cell2struct: FIELDS must be a cell array of strings or a character matrix"); else if (! args(2).is_real_scalar ()) - error ("cell2struct: third argument must be a real scalar"); + error ("cell2struct: DIM must be a real scalar"); else { const Cell vals = args(0).cell_value (); @@ -2061,12 +2061,12 @@ octave_idx_type ext = 0; if (dim < 0) - error ("cell2struct: dim must be a valid dimension"); + error ("cell2struct: DIM must be a valid dimension"); else { ext = vals.ndims () > dim ? vals.dims ()(dim) : 1; if (ext != fields.numel ()) - error ("cell2struct: number of fields doesn't match dimension"); + error ("cell2struct: number of FIELDS does not match dimension"); }
--- a/src/ov-usr-fcn.cc +++ b/src/ov-usr-fcn.cc @@ -639,7 +639,7 @@ error ("nargin: invalid function"); } else - error ("nargin: expecting string as first argument"); + error ("nargin: FCN_NAME must be a string"); } else if (nargin == 0) { @@ -713,7 +713,7 @@ error ("nargout: invalid function"); } else - error ("nargout: expecting string as first argument"); + error ("nargout: FCN_NAME must be a string"); } else if (nargin == 0) { @@ -758,7 +758,7 @@ { if (k != xround (k) || k <= 0) { - error ("isargout: argument must be a positive integer"); + error ("isargout: K must be a positive integer"); return false; } else
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -3422,7 +3422,7 @@ retval = string_vector (lst); } else - error ("rats: expecting numeric input"); + error ("rats: X must be numeric"); } } @@ -3509,7 +3509,7 @@ if (osp) args(1).print (*osp); else - error ("fdisp: stream not open for writing"); + error ("fdisp: stream FID not open for writing"); } } else
--- a/src/pt-mat.cc +++ b/src/pt-mat.cc @@ -904,7 +904,7 @@ } else { - ::error ("cat not find overloaded horzcat function"); + ::error ("cannot find overloaded horzcat function"); goto done; } } @@ -925,7 +925,7 @@ retval = tmp2 (0); } else - ::error ("cat not find overloaded vertcat function"); + ::error ("cannot find overloaded vertcat function"); } } else if (result_type == "double")
--- a/src/sparse.cc +++ b/src/sparse.cc @@ -130,14 +130,14 @@ n = args(1).idx_type_value (); } else - error ("sparse: expecting scalar dimensions"); + error ("sparse: dimensions M,N must be scalar"); if (! error_state) { if (m >= 0 && n >= 0) retval = SparseMatrix (m, n); else - error ("sparse: dimensions must be nonnegative"); + error ("sparse: dimensions M,N must be positive or zero"); } } else if (nargin >= 3) @@ -258,7 +258,7 @@ else if (m >= 0 && n >= 0 && nz >= 0) retval = SparseMatrix (dim_vector (m, n), nz); else - error ("spalloc: m,n,nz must be non-negative"); + error ("spalloc: M,N,NZ must be non-negative"); } else print_usage ();
--- a/src/strfns.cc +++ b/src/strfns.cc @@ -889,7 +889,7 @@ if (! error_state) s.list_in_columns (buf, width); else - error ("list_in_columns: expecting width to be an integer"); + error ("list_in_columns: WIDTH must be an integer"); } retval = buf.str ();
--- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -229,7 +229,7 @@ } } else - error ("exec: first argument must be a string"); + error ("exec: FILE must be a string"); } else print_usage (); @@ -359,7 +359,7 @@ error ("popen2: arguments must be character strings"); } else - error ("popen2: first argument must be a string"); + error ("popen2: COMMAND argument must be a string"); } else print_usage (); @@ -502,7 +502,7 @@ } } else - error ("fcntl: file id, request, and argument must be integers"); + error ("fcntl: FID, REQUEST, and ARG must be integers"); } else print_usage (); @@ -814,7 +814,7 @@ error ("mkfifo: MODE must be an integer"); } else - error ("mkfifo: file name must be a string"); + error ("mkfifo: FILE must be a string"); } else print_usage (); @@ -1022,7 +1022,7 @@ if (! error_state) retval = file_stat::is_reg (static_cast<mode_t> (mode)); else - error ("S_ISREG: invalid mode value"); + error ("S_ISREG: invalid MODE value"); } else print_usage (); @@ -1047,7 +1047,7 @@ if (! error_state) retval = file_stat::is_dir (static_cast<mode_t> (mode)); else - error ("S_ISDIR: invalid mode value"); + error ("S_ISDIR: invalid MODE value"); } else print_usage (); @@ -1072,7 +1072,7 @@ if (! error_state) retval = file_stat::is_chr (static_cast<mode_t> (mode)); else - error ("S_ISCHR: invalid mode value"); + error ("S_ISCHR: invalid MODE value"); } else print_usage (); @@ -1097,7 +1097,7 @@ if (! error_state) retval = file_stat::is_blk (static_cast<mode_t> (mode)); else - error ("S_ISBLK: invalid mode value"); + error ("S_ISBLK: invalid MODE value"); } else print_usage (); @@ -1122,7 +1122,7 @@ if (! error_state) retval = file_stat::is_fifo (static_cast<mode_t> (mode)); else - error ("S_ISFIFO: invalid mode value"); + error ("S_ISFIFO: invalid MODE value"); } else print_usage (); @@ -1147,7 +1147,7 @@ if (! error_state) retval = file_stat::is_lnk (static_cast<mode_t> (mode)); else - error ("S_ISLNK: invalid mode value"); + error ("S_ISLNK: invalid MODE value"); } else print_usage (); @@ -1172,7 +1172,7 @@ if (! error_state) retval = file_stat::is_sock (static_cast<mode_t> (mode)); else - error ("S_ISSOCK: invalid mode value"); + error ("S_ISSOCK: invalid MODE value"); } else print_usage (); @@ -1274,7 +1274,7 @@ retval(1) = msg; } else - error ("unlink: file name must be a string"); + error ("unlink: FILE must be a string"); } else print_usage (); @@ -1388,7 +1388,7 @@ if (! error_state) retval = WIFEXITED (status); else - error ("WIFEXITED: expecting integer argument"); + error ("WIFEXITED: STATUS must be an integer"); } #else warning ("WIFEXITED always returns false in this version of Octave"); @@ -1416,7 +1416,7 @@ if (! error_state) retval = WEXITSTATUS (status); else - error ("WEXITSTATUS: expecting integer argument"); + error ("WEXITSTATUS: STATUS must be an integer"); } #else warning ("WEXITSTATUS always returns false in this version of Octave"); @@ -1443,7 +1443,7 @@ if (! error_state) retval = WIFSIGNALED (status); else - error ("WIFSIGNALED: expecting integer argument"); + error ("WIFSIGNALED: STATUS must be an integer"); } #else warning ("WIFSIGNALED always returns false in this version of Octave"); @@ -1471,7 +1471,7 @@ if (! error_state) retval = WTERMSIG (status); else - error ("WTERMSIG: expecting integer argument"); + error ("WTERMSIG: STATUS must be an integer"); } #else warning ("WTERMSIG always returns false in this version of Octave"); @@ -1501,7 +1501,7 @@ if (! error_state) retval = WCOREDUMP (status); else - error ("WCOREDUMP: expecting integer argument"); + error ("WCOREDUMP: STATUS must be an integer"); } #else warning ("WCOREDUMP always returns false in this version of Octave"); @@ -1530,7 +1530,7 @@ if (! error_state) retval = WIFSTOPPED (status); else - error ("WIFSTOPPED: expecting integer argument"); + error ("WIFSTOPPED: STATUS must be an integer"); } #else warning ("WIFSTOPPED always returns false in this version of Octave"); @@ -1558,7 +1558,7 @@ if (! error_state) retval = WSTOPSIG (status); else - error ("WSTOPSIG: expecting integer argument"); + error ("WSTOPSIG: STATUS must be an integer"); } #else warning ("WSTOPSIG always returns false in this version of Octave"); @@ -1585,7 +1585,7 @@ if (! error_state) retval = WIFCONTINUED (status); else - error ("WIFCONTINUED: expecting integer argument"); + error ("WIFCONTINUED: STATUS must be an integer"); } #else warning ("WIFCONTINUED always returns false in this version of Octave"); @@ -1617,7 +1617,7 @@ retval(0) = result; } else - error ("canonicalize_file_name: argument must be a character string"); + error ("canonicalize_file_name: NAME must be a character string"); } else print_usage ();
--- a/src/sysdep.cc +++ b/src/sysdep.cc @@ -576,10 +576,10 @@ if (! error_state) octave_env::putenv (var, val); else - error ("putenv: second argument should be a string"); + error ("putenv: VALUE must be a string"); } else - error ("putenv: first argument should be a string"); + error ("putenv: VAR must be a string"); } else print_usage ();
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -895,13 +895,13 @@ type = et_async; else { - error ("system: third arg must be \"sync\" or \"async\""); + error ("system: TYPE must be \"sync\" or \"async\""); return retval; } } else { - error ("system: third argument must be a character string"); + error ("system: TYPE must be a character string"); return retval; } } @@ -912,7 +912,7 @@ if (error_state) { - error ("system: expecting second argument to be true or false"); + error ("system: RETURN_OUTPUT must be boolean value true or false"); return retval; } } @@ -991,7 +991,7 @@ } } else - error ("system: expecting std::string as first argument"); + error ("system: expecting string as first argument"); } else print_usage (); @@ -1141,7 +1141,7 @@ add_mode = args(1).bool_value (); if (error_state) - error ("atexit: second argument must be a logical value"); + error ("atexit: FLAG argument must be a logical value"); } if (! error_state) @@ -1158,7 +1158,7 @@ } } else - error ("atexit: argument must be a string"); + error ("atexit: FCN argument must be a string"); } else print_usage ();
--- a/src/utils.cc +++ b/src/utils.cc @@ -317,7 +317,7 @@ } } else - error ("file_in_loadpath: expecting string as first argument"); + error ("file_in_loadpath: FILE argument must be a string"); } else print_usage (); @@ -379,10 +379,10 @@ } } else - error ("file_in_path: expecting string as second argument"); + error ("file_in_path: all arguments must be strings"); } else - error ("file_in_path: expecting string as first argument"); + error ("file_in_path: PATH must be a string"); } else print_usage (); @@ -615,7 +615,7 @@ if (args(0).is_string ()) retval = do_string_escapes (args(0).string_value ()); else - error ("do_string_escapes: argument must be a string"); + error ("do_string_escapes: STRING argument must be of type string"); } else print_usage (); @@ -721,7 +721,7 @@ if (args(0).is_string ()) retval = undo_string_escapes (args(0).string_value ()); else - error ("undo_string_escapes: argument must be a string"); + error ("undo_string_escapes: S argument must be a string"); } else print_usage (); @@ -780,7 +780,7 @@ if (! error_state) retval = octave_env::make_absolute (nm); else - error ("make_absolute_filename: expecting argument to be a file name"); + error ("make_absolute_filename: FILE argument must be a file name"); } else print_usage (); @@ -819,7 +819,7 @@ retval = Cell (load_path::find_matching_dirs (dir)); } else - error ("find_dir_in_path: expecting argument to be a directory name"); + error ("find_dir_in_path: DIR must be a directory name"); } else print_usage ();
--- a/src/variables.cc +++ b/src/variables.cc @@ -344,7 +344,7 @@ if (error_state) { - error ("isglobal: expecting std::string argument"); + error ("isglobal: NAME must be a string"); return retval; } @@ -564,10 +564,10 @@ if (! error_state) retval = symbol_exist (name, type); else - error ("exist: expecting second argument to be a string"); + error ("exist: TYPE must be a string"); } else - error ("exist: expecting first argument to be a string"); + error ("exist: NAME must be a string"); } else print_usage (); @@ -1969,7 +1969,7 @@ if (! error_state) munlock (name); else - error ("munlock: expecting argument to be a function name"); + error ("munlock: FCN must be a string"); } else if (args.length () == 0) { @@ -2004,7 +2004,7 @@ if (! error_state) retval = mislocked (name); else - error ("mislocked: expecting argument to be a function name"); + error ("mislocked: FCN must be a string"); } else if (args.length () == 0) {