diff -r 068b80d70ff6 libinterp/corefcn/debug.cc --- a/libinterp/corefcn/debug.cc Sat Mar 02 11:17:19 2024 -0500 +++ b/libinterp/corefcn/debug.cc Sat Mar 02 14:55:14 2024 -0500 @@ -640,11 +640,11 @@ numbers. std::string start_str = arg.substr (0, ind); std::string end_str = arg.substr (ind + 1); - start = atoi (start_str.c_str ()); + start = std::stoi (start_str); if (end_str == "end") end = std::numeric_limits::max (); else - end = atoi (end_str.c_str ()); + end = std::stoi (end_str); if (std::min (start, end) <= 0) error ("dbtype: start and end lines must be >= 1\n"); @@ -654,7 +654,7 @@ numbers. } else // (dbtype fcn) || (dbtype lineno) { - int line = atoi (arg.c_str ()); + int line = std::stoi (arg); if (line == 0) // (dbtype fcn) fcn_name = arg; @@ -682,15 +682,15 @@ numbers. std::string start_str = arg.substr (0, ind); std::string end_str = arg.substr (ind + 1); - start = atoi (start_str.c_str ()); + start = std::stoi (start_str); if (end_str == "end") end = std::numeric_limits::max (); else - end = atoi (end_str.c_str ()); + end = std::stoi (end_str); } else { - start = atoi (arg.c_str ()); + start = std::stoi (arg); end = start; } @@ -751,7 +751,7 @@ If unspecified @var{n} defaults to 10 (+ { std::string s_arg = arg.string_value (); - n = atoi (s_arg.c_str ()); + n = std::stoi (s_arg); } else n = args(0).int_value (); @@ -798,7 +798,7 @@ do_dbstack (octave::interpreter& interp, if (s_arg == "-completenames") continue; - n = atoi (s_arg.c_str ()); + n = std::stoi (s_arg); } else n = arg.int_value (); @@ -947,7 +947,7 @@ do_dbupdown (octave::interpreter& interp { std::string s_arg = arg.string_value (); - n = atoi (s_arg.c_str ()); + n = std::stoi (s_arg); } else n = args(0).int_value (); @@ -1038,7 +1038,7 @@ interchangeably. n = -2; else { - n = atoi (arg.c_str ()); + n = std::stoi (arg); if (n < 1) error ("dbstep: invalid argument"); diff -r 068b80d70ff6 libinterp/corefcn/event-manager.cc --- a/libinterp/corefcn/event-manager.cc Sat Mar 02 11:17:19 2024 -0500 +++ b/libinterp/corefcn/event-manager.cc Sat Mar 02 14:55:14 2024 -0500 @@ -28,6 +28,7 @@ #endif #include +#include #include "builtin-defun-decls.h" #include "cmd-edit.h" @@ -362,7 +363,7 @@ Undocumented internal function. if (idx != 2) retval(idx++) = str; else - retval(idx++) = atoi (str.c_str ()); + retval(idx++) = std::stoi (str); } } } @@ -377,7 +378,7 @@ Undocumented internal function. for (int idx = 0; idx < nel; idx++, it++) items.xelem (idx) = *it; - retval = ovl (items, *it++, atoi (it->c_str ())); + retval = ovl (items, *it++, std::stoi (*it)); } return retval; diff -r 068b80d70ff6 libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Sat Mar 02 11:17:19 2024 -0500 +++ b/libinterp/corefcn/graphics.cc Sat Mar 02 14:55:14 2024 -0500 @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff -r 068b80d70ff6 libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Sat Mar 02 11:17:19 2024 -0500 +++ b/libinterp/dldfcn/__init_fltk__.cc Sat Mar 02 14:55:14 2024 -0500 @@ -38,6 +38,8 @@ To initialize: # include "config.h" #endif +#include + #include "defun-dld.h" #include "error.h" #include "errwarn.h" @@ -603,7 +605,7 @@ public: { std::string valstr = fltk_label.substr (idx1 + 1, len - 1); fltk_label.erase (idx1, len + 1); - val = atoi (valstr.c_str ()); + val = std::stoi (valstr); if (val > 0 && val < 99) val++; } diff -r 068b80d70ff6 libinterp/parse-tree/bp-table.cc --- a/libinterp/parse-tree/bp-table.cc Sat Mar 02 11:17:19 2024 -0500 +++ b/libinterp/parse-tree/bp-table.cc Sat Mar 02 14:55:14 2024 -0500 @@ -386,7 +386,7 @@ bp_table::parse_dbfunction_params (const tok = dbstop_if; pos++; } - else if (atoi (args(pos).string_value ().c_str ()) > 0) + else if (std::stoi (args(pos).string_value ()) > 0) tok = dbstop_at; else tok = dbstop_in; @@ -431,7 +431,7 @@ bp_table::parse_dbfunction_params (const // FIXME: we really want to distinguish number // vs. method name here. - if (atoi (arg.c_str ()) == 0) + if (std::stoi (arg) == 0) { // We have class and function names but already // stored the class name in fcn_name. @@ -458,7 +458,7 @@ bp_table::parse_dbfunction_params (const { if (args(pos).is_string ()) { - int line = atoi (args(pos).string_value ().c_str ()); + int line = std::stoi (args(pos).string_value ()); if (line > 0) lines.insert (line); diff -r 068b80d70ff6 liboctave/util/data-conv.cc --- a/liboctave/util/data-conv.cc Sat Mar 02 11:17:19 2024 -0500 +++ b/liboctave/util/data-conv.cc Sat Mar 02 14:55:14 2024 -0500 @@ -28,11 +28,11 @@ #endif #include -#include #include #include #include +#include #include #include "byte-swap.h" @@ -391,7 +391,7 @@ oct_data_conv::string_to_data_type (cons { if (s[pos] == '*') { - block_size = atoi (s.c_str ()); + block_size = std::stoi (s); s = s.substr (pos+1); } else @@ -458,7 +458,7 @@ oct_data_conv::string_to_data_type (cons { if (s[pos] == '*') { - block_size = atoi (s.c_str ()); + block_size = std::stoi (s); s = s.substr (pos+1); } else diff -r 068b80d70ff6 liboctave/util/pathsearch.cc --- a/liboctave/util/pathsearch.cc Sat Mar 02 11:17:19 2024 -0500 +++ b/liboctave/util/pathsearch.cc Sat Mar 02 14:55:14 2024 -0500 @@ -27,8 +27,6 @@ # include "config.h" #endif -#include - #include #include "kpse.h" @@ -111,7 +109,7 @@ directory_path::init () std::string val = sys::env::getenv ("KPATHSEA_DEBUG"); if (! val.empty ()) - kpse_debug |= atoi (val.c_str ()); + kpse_debug |= std::stoi (val); octave_kpse_initialized = true; }