# HG changeset patch # User John W. Eaton # Date 1713376707 14400 # Node ID 5fded8395daab8e2a29401262e3d598e4663a95d # Parent f57b492b552792f32915b99beac6302306646176 rename yTYPE_value functions strict_TYPE_value * ov.h, ov.cc (octave_value::strict_int_value): Rename from yint_value. Change all uses. (octave_value::strict_idx_type_value): Rename from yidx_type_value. Change all uses. (octave_value::strict_bool_value): Rename from ybool_value. Change all uses. diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/__eigs__.cc --- a/libinterp/corefcn/__eigs__.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/__eigs__.cc Wed Apr 17 13:58:27 2024 -0400 @@ -345,7 +345,7 @@ if (tmp.numel () != 1) error ("eigs: OPTS.issym must be a scalar value"); - symmetric = tmp.ybool_value ("eigs: OPTS.issym must be a logical value"); + symmetric = tmp.strict_bool_value ("eigs: OPTS.issym must be a logical value"); sym_tested = true; } @@ -358,7 +358,7 @@ if (tmp.numel () != 1) error ("eigs: OPTS.isreal must be a scalar value"); - a_is_complex = ! tmp.ybool_value ("eigs: OPTS.isreal must be a logical value"); + a_is_complex = ! tmp.strict_bool_value ("eigs: OPTS.isreal must be a logical value"); } } @@ -393,7 +393,7 @@ if (tmp.numel () != 1) error ("eigs: OPTS.cholB must be a scalar value"); - cholB = tmp.ybool_value ("eigs: OPTS.cholB must be a logical value"); + cholB = tmp.strict_bool_value ("eigs: OPTS.cholB must be a logical value"); } tmp = map.getfield ("permB"); diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/besselj.cc --- a/libinterp/corefcn/besselj.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/besselj.cc Wed Apr 17 13:58:27 2024 -0400 @@ -598,7 +598,7 @@ } else { - octave_idx_type kind = args(1).yint_value ("besselh: invalid value of K"); + octave_idx_type kind = args(1).strict_int_value ("besselh: invalid value of K"); octave_value_list tmp_args; @@ -687,13 +687,13 @@ int kind = 0; if (nargin > 1) { - kind = args(0).yint_value ("airy: K must be an integer value"); + kind = args(0).strict_int_value ("airy: K must be an integer value"); if (kind < 0 || kind > 3) error ("airy: K must be 0, 1, 2, or 3"); } - bool scale = (nargin == 3) && args(2).ybool_value ("airy: scale option must be a logical value"); + bool scale = (nargin == 3) && args(2).strict_bool_value ("airy: scale option must be a logical value"); int idx = (nargin == 1 ? 0 : 1); diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/bitfcns.cc --- a/libinterp/corefcn/bitfcns.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/bitfcns.cc Wed Apr 17 13:58:27 2024 -0400 @@ -583,7 +583,7 @@ if (args(2).numel () > 1) error ("bitshift: N must be a scalar integer"); - nbits = args(2).yint_value ("bitshift: N must be an integer"); + nbits = args(2).strict_int_value ("bitshift: N must be an integer"); if (nbits < 0) error ("bitshift: N must be positive"); diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/data.cc Wed Apr 17 13:58:27 2024 -0400 @@ -96,7 +96,7 @@ print_usage (); int dim = (nargin == 1 ? -1 - : args(1).yint_value ("all: DIM must be an integer")-1); + : args(1).strict_int_value ("all: DIM must be an integer")-1); if (dim < -1) error ("all: invalid dimension argument = %d", dim + 1); @@ -161,7 +161,7 @@ print_usage (); int dim = (nargin == 1 ? -1 - : args(1).yint_value ("any: DIM must be an integer")-1); + : args(1).strict_int_value ("any: DIM must be an integer")-1); if (dim < -1) error ("any: invalid dimension argument = %d", dim + 1); @@ -1267,7 +1267,7 @@ retval = args(0).diag (); else if (nargin == 2) { - octave_idx_type k = args(1).yidx_type_value ("diag: invalid argument K"); + octave_idx_type k = args(1).strict_idx_type_value ("diag: invalid argument K"); retval = args(0).diag (k); } @@ -1278,8 +1278,8 @@ if (arg0.ndims () != 2 || (arg0.rows () != 1 && arg0.columns () != 1)) error ("diag: V must be a vector"); - octave_idx_type m = args(1).yidx_type_value ("diag: invalid dimension M"); - octave_idx_type n = args(2).yidx_type_value ("diag: invalid dimension N"); + octave_idx_type m = args(1).strict_idx_type_value ("diag: invalid dimension M"); + octave_idx_type n = args(2).strict_idx_type_value ("diag: invalid dimension N"); retval = arg0.diag (m, n); } @@ -2375,7 +2375,7 @@ if (args.length () == 0) print_usage (); - int dim = args(0).yint_value ("cat: DIM must be an integer") - 1; + int dim = args(0).strict_int_value ("cat: DIM must be an integer") - 1; if (dim < 0) error ("cat: DIM must be a valid dimension"); diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/file-io.cc --- a/libinterp/corefcn/file-io.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/file-io.cc Wed Apr 17 13:58:27 2024 -0400 @@ -3223,7 +3223,7 @@ if (args.length () != 1) print_usage (); - int mask = args(0).yint_value ("umask: MASK must be an integer"); + int mask = args(0).strict_int_value ("umask: MASK must be an integer"); if (mask < 0) error ("umask: MASK must be a positive integer value"); diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/interpreter.cc --- a/libinterp/corefcn/interpreter.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/interpreter.cc Wed Apr 17 13:58:27 2024 -0400 @@ -290,7 +290,7 @@ std::string arg = args(0).xstring_value ("atexit: FCN argument must be a string"); bool add_mode = (nargin == 2) - ? args(1).ybool_value ("atexit: FLAG argument must be a logical value") + ? args(1).strict_bool_value ("atexit: FLAG argument must be a logical value") : true; octave_value_list retval; diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/jsondecode.cc --- a/libinterp/corefcn/jsondecode.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/jsondecode.cc Wed Apr 17 13:58:27 2024 -0400 @@ -601,7 +601,7 @@ "option argument must be a string"); if (string::strcmpi (parameter, "makeValidName")) { - use_makeValidName = args(i + 1).ybool_value ("jsondecode: " + use_makeValidName = args(i + 1).strict_bool_value ("jsondecode: " "'makeValidName' value must be a bool"); } else diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/load-path.cc Wed Apr 17 13:58:27 2024 -0400 @@ -2701,7 +2701,7 @@ } else if (option_arg.isnumeric ()) { - int val = option_arg.yint_value ("addpath: OPTION must be '-begin'/0 or '-end'/1"); + int val = option_arg.strict_int_value ("addpath: OPTION must be '-begin'/0 or '-end'/1"); if (val == 0) nargin--; diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/oct-stream.cc Wed Apr 17 13:58:27 2024 -0400 @@ -3682,7 +3682,7 @@ } else if (param == "collectoutput") { - m_collect_output = args(i+1).ybool_value ("%s: CollectOutput must be logical or numeric", + m_collect_output = args(i+1).strict_bool_value ("%s: CollectOutput must be logical or numeric", m_who.c_str ()); } else if (param == "emptyvalue") @@ -3700,11 +3700,11 @@ else if (param == "multipledelimsasone") { m_multiple_delims_as_one = args(i - +1).ybool_value ("%s: MultipleDelimsAsOne must be logical or numeric", m_who.c_str ()); + +1).strict_bool_value ("%s: MultipleDelimsAsOne must be logical or numeric", m_who.c_str ()); } else if (param == "returnonerror") { - m_return_on_error = args(i+1).ybool_value ("%s: ReturnOnError must be logical or numeric", + m_return_on_error = args(i+1).strict_bool_value ("%s: ReturnOnError must be logical or numeric", m_who.c_str ()); } else if (param == "whitespace") diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/psi.cc --- a/libinterp/corefcn/psi.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/psi.cc Wed Apr 17 13:58:27 2024 -0400 @@ -78,7 +78,7 @@ print_usage (); const octave_value oct_z = (nargin == 1) ? args(0) : args(1); - const octave_idx_type k = (nargin == 1) ? 0 : args(0).yidx_type_value ("psi: K must be an integer"); + const octave_idx_type k = (nargin == 1) ? 0 : args(0).strict_idx_type_value ("psi: K must be an integer"); if (k < 0) error ("psi: K must be non-negative"); diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/sparse.cc --- a/libinterp/corefcn/sparse.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/sparse.cc Wed Apr 17 13:58:27 2024 -0400 @@ -199,8 +199,8 @@ } else if (nargin == 2) { - octave_idx_type m = args(0).yidx_type_value ("sparse: M must be a non-negative integer"); - octave_idx_type n = args(1).yidx_type_value ("sparse: N must be a non-negative integer"); + octave_idx_type m = args(0).strict_idx_type_value ("sparse: M must be a non-negative integer"); + octave_idx_type n = args(1).strict_idx_type_value ("sparse: N must be a non-negative integer"); if (m < 0 || n < 0) error ("sparse: dimensions M and N must be non-negative"); @@ -233,8 +233,8 @@ if (nargin == 5) { - m = args(3).yidx_type_value ("sparse: M must be a non-negative integer"); - n = args(4).yidx_type_value ("sparse: N must be a non-negative integer"); + m = args(3).strict_idx_type_value ("sparse: M must be a non-negative integer"); + n = args(4).strict_idx_type_value ("sparse: N must be a non-negative integer"); if (m < 0 || n < 0) error ("sparse: dimensions M and N must be non-negative"); diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/strfns.cc --- a/libinterp/corefcn/strfns.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/strfns.cc Wed Apr 17 13:58:27 2024 -0400 @@ -1221,7 +1221,7 @@ int width = -1; if (nargin > 1 && ! args(1).isempty ()) - width = args(1).yint_value ("list_in_columns: WIDTH must be an integer"); + width = args(1).strict_int_value ("list_in_columns: WIDTH must be an integer"); std::string prefix; diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/syscalls.cc --- a/libinterp/corefcn/syscalls.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/syscalls.cc Wed Apr 17 13:58:27 2024 -0400 @@ -465,8 +465,8 @@ if (fid < 0) error ("fcntl: invalid file id FID"); - int req = args(1).yint_value ("fcntl: REQUEST must be an integer"); - int arg = args(2).yint_value ("fcntl: ARG must be an integer"); + int req = args(1).strict_int_value ("fcntl: REQUEST must be an integer"); + int arg = args(2).strict_int_value ("fcntl: ARG must be an integer"); octave_value_list retval; std::string msg; @@ -741,7 +741,7 @@ std::string name = args(0).xstring_value ("mkfifo: FILE must be a string"); - int octal_mode = args(1).yint_value ("mkfifo: MODE must be an integer"); + int octal_mode = args(1).strict_int_value ("mkfifo: MODE must be an integer"); if (octal_mode < 0) error ("mkfifo: MODE must be a positive integer value"); @@ -1258,12 +1258,12 @@ if (nargin != 1 && nargin != 2) print_usage (); - pid_t pid = args(0).yint_value ("waitpid: OPTIONS must be an integer"); + pid_t pid = args(0).strict_int_value ("waitpid: OPTIONS must be an integer"); int options = 0; if (nargin == 2) - options = args(1).yint_value ("waitpid: PID must be an integer value"); + options = args(1).strict_int_value ("waitpid: PID must be an integer value"); std::string msg; int status; @@ -1285,7 +1285,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).yint_value ("WIFEXITED: STATUS must be an integer"); + int status = args(0).strict_int_value ("WIFEXITED: STATUS must be an integer"); return ovl (sys::wifexited (status)); } @@ -1304,7 +1304,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).yint_value ("WEXITSTATUS: STATUS must be an integer"); + int status = args(0).strict_int_value ("WEXITSTATUS: STATUS must be an integer"); return ovl (sys::wexitstatus (status)); } @@ -1321,7 +1321,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).yint_value ("WIFSIGNALED: STATUS must be an integer"); + int status = args(0).strict_int_value ("WIFSIGNALED: STATUS must be an integer"); return ovl (sys::wifsignaled (status)); } @@ -1340,7 +1340,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).yint_value ("WTERMSIG: STATUS must be an integer"); + int status = args(0).strict_int_value ("WTERMSIG: STATUS must be an integer"); return ovl (sys::wtermsig (status)); } @@ -1361,7 +1361,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).yint_value ("WCOREDUMP: STATUS must be an integer"); + int status = args(0).strict_int_value ("WCOREDUMP: STATUS must be an integer"); return ovl (sys::wcoredump (status)); } @@ -1381,7 +1381,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).yint_value ("WIFSTOPPED: STATUS must be an integer"); + int status = args(0).strict_int_value ("WIFSTOPPED: STATUS must be an integer"); return ovl (sys::wifstopped (status)); } @@ -1400,7 +1400,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).yint_value ("WSTOPSIG: STATUS must be an integer"); + int status = args(0).strict_int_value ("WSTOPSIG: STATUS must be an integer"); return ovl (sys::wstopsig (status)); } @@ -1417,7 +1417,7 @@ if (args.length () != 1) print_usage (); - int status = args(0).yint_value ("WIFCONTINUED: STATUS must be an integer"); + int status = args(0).strict_int_value ("WIFCONTINUED: STATUS must be an integer"); return ovl (sys::wifcontinued (status)); } diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/time.cc --- a/libinterp/corefcn/time.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/time.cc Wed Apr 17 13:58:27 2024 -0400 @@ -69,7 +69,7 @@ octave_value v = m.getfield (k); if (! v.isempty ()) - retval = v.yint_value ("%s: invalid TM_STRUCT argument", who); + retval = v.strict_int_value ("%s: invalid TM_STRUCT argument", who); return retval; } diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/utils.cc Wed Apr 17 13:58:27 2024 -0400 @@ -1295,7 +1295,7 @@ } else { - int val = args(0).yint_value ("errno: argument must be string or integer"); + int val = args(0).strict_int_value ("errno: argument must be string or integer"); retval = octave_errno::set (val); } diff -r f57b492b5527 -r 5fded8395daa libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/corefcn/variables.cc Wed Apr 17 13:58:27 2024 -0400 @@ -601,7 +601,7 @@ if (nargin == 1) { - bool bval = args(0).ybool_value ("%s: argument must be a logical value", nm); + bool bval = args(0).strict_bool_value ("%s: argument must be a logical value", nm); var = bval; } @@ -675,7 +675,7 @@ if (nargin == 1) { - int ival = args(0).yint_value ("%s: argument must be an integer value", nm); + int ival = args(0).strict_int_value ("%s: argument must be an integer value", nm); if (ival < minval) error ("%s: arg must be greater than %d", nm, minval); diff -r f57b492b5527 -r 5fded8395daa libinterp/dldfcn/__glpk__.cc --- a/libinterp/dldfcn/__glpk__.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/dldfcn/__glpk__.cc Wed Apr 17 13:58:27 2024 -0400 @@ -332,7 +332,7 @@ if (tmp.is_defined ()) \ { \ if (! tmp.isempty ()) \ - VAL = tmp.yint_value ("glpk: invalid value in PARAM" NAME); \ + VAL = tmp.strict_int_value ("glpk: invalid value in PARAM" NAME); \ else \ error ("glpk: invalid value in PARAM" NAME); \ } \ diff -r f57b492b5527 -r 5fded8395daa libinterp/dldfcn/__ode15__.cc --- a/libinterp/dldfcn/__ode15__.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/dldfcn/__ode15__.cc Wed Apr 17 13:58:27 2024 -0400 @@ -1350,7 +1350,7 @@ // Provided number of arguments in the ode callback function octave_idx_type num_event_args - = args(5).yidx_type_value ("__ode15__: NUM_EVENT_ARGS must be an integer"); + = args(5).strict_idx_type_value ("__ode15__: NUM_EVENT_ARGS must be an integer"); if (num_event_args != 2 && num_event_args != 3) error ("__ode15__: number of input arguments in event callback must be 2 or 3"); diff -r f57b492b5527 -r 5fded8395daa libinterp/octave-value/ov-cell.cc --- a/libinterp/octave-value/ov-cell.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/octave-value/ov-cell.cc Wed Apr 17 13:58:27 2024 -0400 @@ -1237,7 +1237,7 @@ for (int i = 0; i < nargin; i++) dims(i) = (args(i).isempty () - ? 0 : args(i).yidx_type_value ("cell: dimension must be a scalar integer")); + ? 0 : args(i).strict_idx_type_value ("cell: dimension must be a scalar integer")); } break; } diff -r f57b492b5527 -r 5fded8395daa libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/octave-value/ov.cc Wed Apr 17 13:58:27 2024 -0400 @@ -2196,11 +2196,11 @@ // especially for parsing integer arguments that cannot be floating point. // See bug #65538. -XVALUE_EXTRACTOR (int, yint_value, strict_int_value) - -XVALUE_EXTRACTOR (bool, ybool_value, strict_bool_value) - -XVALUE_EXTRACTOR (octave_idx_type, yidx_type_value, strict_idx_type_value) +XVALUE_EXTRACTOR (int, strict_int_value, strict_int_value) + +XVALUE_EXTRACTOR (bool, strict_bool_value, strict_bool_value) + +XVALUE_EXTRACTOR (octave_idx_type, strict_idx_type_value, strict_idx_type_value) #undef XVALUE_EXTRACTOR diff -r f57b492b5527 -r 5fded8395daa libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/octave-value/ov.h Wed Apr 17 13:58:27 2024 -0400 @@ -1113,7 +1113,7 @@ OCTINTERP_API int xint_value (const char *fmt, ...) const; - OCTINTERP_API int yint_value (const char *fmt, ...) const; + OCTINTERP_API int strict_int_value (const char *fmt, ...) const; OCTINTERP_API unsigned int xuint_value (const char *fmt, ...) const; @@ -1129,7 +1129,7 @@ OCTINTERP_API octave_idx_type xidx_type_value (const char *fmt, ...) const; - OCTINTERP_API octave_idx_type yidx_type_value (const char *fmt, ...) const; + OCTINTERP_API octave_idx_type strict_idx_type_value (const char *fmt, ...) const; OCTINTERP_API double xdouble_value (const char *fmt, ...) const; @@ -1165,7 +1165,7 @@ OCTINTERP_API bool xbool_value (const char *fmt, ...) const; - OCTINTERP_API bool ybool_value (const char *fmt, ...) const; + OCTINTERP_API bool strict_bool_value (const char *fmt, ...) const; OCTINTERP_API boolMatrix xbool_matrix_value (const char *fmt, ...) const; diff -r f57b492b5527 -r 5fded8395daa libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Mon Apr 22 17:52:32 2024 +0200 +++ b/libinterp/parse-tree/pt-eval.cc Wed Apr 17 13:58:27 2024 -0400 @@ -5136,13 +5136,13 @@ if (nargin == 3) { octave_idx_type index_position - = args(1).yidx_type_value ("end: K must be integer value"); + = args(1).strict_idx_type_value ("end: K must be integer value"); if (index_position < 1) error ("end: K must be greater than zero"); octave_idx_type num_indices - = args(2).yidx_type_value ("end: N must be integer value"); + = args(2).strict_idx_type_value ("end: N must be integer value"); if (num_indices < 1) error ("end: N must be greater than zero"); @@ -5677,7 +5677,7 @@ if (! dims.all_ones ()) error ("inputname: N must be a scalar index"); - int n = args(0).yint_value ("inputname: N must be a scalar index"); + int n = args(0).strict_int_value ("inputname: N must be a scalar index"); if (n < 1) error ("inputname: N must be a scalar index"); @@ -5685,7 +5685,7 @@ bool ids_only = true; if (nargin == 2) - ids_only = args(1).ybool_value ("inputname: IDS_ONLY must be a logical value"); + ids_only = args(1).strict_bool_value ("inputname: IDS_ONLY must be a logical value"); // Use zero-based indexing internally. return ovl (interp.inputname (n-1, ids_only));