# HG changeset patch # User John W. Eaton # Date 1619665062 14400 # Node ID d13d090cb03a0923127d8121ec39f39ad4aa0cb8 # Parent 5068a97f0f392d8863ec9afb42d0b1b31a6da600 use std::size_t and std::ptrdiff_t in C++ code (bug #60471) Files affected: make_int.cc, file-editor-tab.cc, octave-qscintilla.cc, Cell.cc, Cell.h, call-stack.cc, call-stack.h, cellfun.cc, data.cc, debug.cc, dlmread.cc, error.cc, event-queue.h, fcn-info.cc, fcn-info.h, file-io.cc, ft-text-renderer.cc, gl2ps-print.cc, graphics.cc, graphics.in.h, help.cc, hex2num.cc, input.cc, latex-text-renderer.cc, load-path.cc, load-save.cc, load-save.h, ls-hdf5.cc, ls-mat-ascii.cc, ls-mat5.cc, ls-oct-text.cc, mex.cc, mexproto.h, mxarray.h, oct-map.cc, oct-stream.cc, oct-stream.h, pager.cc, pager.h, pr-output.cc, regexp.cc, settings.h, stack-frame.cc, stack-frame.h, strfns.cc, syminfo.cc, symrec.h, symscope.cc, symscope.h, symtab.cc, sysdep.cc, toplev.cc, utils.cc, utils.h, variables.cc, __fltk_uigetfile__.cc, __init_fltk__.cc, audioread.cc, gzip.cc, cdef-class.cc, cdef-manager.cc, cdef-method.cc, cdef-object.cc, cdef-object.h, ov-base-diag.cc, ov-base-diag.h, ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc, ov-base-scalar.h, ov-base-sparse.h, ov-base.cc, ov-base.h, ov-cell.cc, ov-cell.h, ov-ch-mat.cc, ov-class.cc, ov-class.h, ov-classdef.cc, ov-fcn-handle.cc, ov-java.cc, ov-lazy-idx.h, ov-perm.cc, ov-perm.h, ov-range.h, ov-str-mat.cc, ov-struct.cc, ov-struct.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc, ov.h, ovl.cc, octave.cc, bp-table.cc, jit-ir.cc, jit-ir.h, jit-typeinfo.cc, jit-typeinfo.h, jit-util.h, lex.h, lex.ll, oct-lvalue.cc, oct-parse.yy, parse.h, profiler.h, pt-eval.cc, pt-eval.h, pt-jit.cc, pt-jit.h, pt-pr-code.cc, pt-tm-const.cc, pt-tm-const.h, Array.h, CMatrix.cc, DiagArray2.h, PermMatrix.h, Sparse.h, dMatrix.cc, fCMatrix.cc, fMatrix.cc, bsxfun-defs.cc, oct-fftw.cc, oct-fftw.h, randpoisson.cc, sparse-chol.cc, mx-inlines.cc, file-ops.cc, lo-sysdep.cc, oct-env.cc, oct-time.cc, action-container.cc, action-container.h, base-list.h, caseless-str.h, cmd-edit.cc, cmd-hist.cc, data-conv.cc, data-conv.h, f77-fcn.h, file-info.cc, file-info.h, kpse.cc, kpse.h, lo-cutils.h, lo-hash.h, lo-regexp.cc, oct-base64.cc, oct-base64.h, oct-binmap.h, oct-glob.cc, oct-shlib.cc, oct-shlib.h, oct-sort.cc, oct-sparse.h, oct-string.cc, quit.cc, unwind-prot.h, url-transfer.cc, main.in.cc, mkoctfile.in.cc, and shared-fcns.h. (grafted from aef11bb4e6d1f303ad9de5688fcb7244ef48867e) diff -r 5068a97f0f39 -r d13d090cb03a examples/code/make_int.cc --- a/examples/code/make_int.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/examples/code/make_int.cc Wed Apr 28 22:57:42 2021 -0400 @@ -45,8 +45,8 @@ octave_base_value * clone (void) { return new octave_integer (*this); } #if 0 - void *operator new (size_t size); - void operator delete (void *p, size_t size); + void *operator new (std::size_t size); + void operator delete (void *p, std::size_t size); #endif idx_vector index_vector (bool) const { return idx_vector ((double) scalar); } diff -r 5068a97f0f39 -r d13d090cb03a libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libgui/src/m-editor/file-editor-tab.cc Wed Apr 28 22:57:42 2021 -0400 @@ -2460,7 +2460,7 @@ const uint32_t *src = reinterpret_cast (u32_str.data ()); - size_t length; + std::size_t length; char *res_str = octave_u32_conv_to_encoding_strict (m_encoding.toStdString ().c_str (), src, u32_str.size (), &length); diff -r 5068a97f0f39 -r d13d090cb03a libgui/src/m-editor/octave-qscintilla.cc --- a/libgui/src/m-editor/octave-qscintilla.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libgui/src/m-editor/octave-qscintilla.cc Wed Apr 28 22:57:42 2021 -0400 @@ -1203,7 +1203,7 @@ bool autofill_simple_end = (auto_endif == 2); - size_t start = line.toStdString ().find_first_not_of (" \t"); + std::size_t start = line.toStdString ().find_first_not_of (" \t"); // Check if following line has the same or less indentation // Check if the following line does not start with @@ -1212,7 +1212,7 @@ { int offset = 2; // linenr is the old line, thus, linnr+1 is the // new one and can not be taken into account - size_t next_start; + std::size_t next_start; QString next_line; do // find next non-blank line diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/Cell.cc --- a/libinterp/corefcn/Cell.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/Cell.cc Wed Apr 28 22:57:42 2021 -0400 @@ -53,7 +53,7 @@ if (trim) { - size_t pos = s.find_last_not_of (' '); + std::size_t pos = s.find_last_not_of (' '); s = (pos == std::string::npos) ? "" : s.substr (0, pos+1); } @@ -112,7 +112,7 @@ if (trim) { - size_t pos = s.find_last_not_of (' '); + std::size_t pos = s.find_last_not_of (' '); s = (pos == std::string::npos) ? "" : s.substr (0, pos+1); } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/Cell.h --- a/libinterp/corefcn/Cell.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/Cell.h Wed Apr 28 22:57:42 2021 -0400 @@ -78,7 +78,7 @@ Cell (const C& container) : Array () { - size_t n = container.size (); + std::size_t n = container.size (); if (n > 0) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/call-stack.cc --- a/libinterp/corefcn/call-stack.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/call-stack.cc Wed Apr 28 22:57:42 2021 -0400 @@ -70,7 +70,7 @@ octave_function *fcn = nullptr; - size_t idx = m_curr_frame; + std::size_t idx = m_curr_frame; if (idx > 0 && skip_first) --idx; @@ -118,7 +118,7 @@ { // Start at current frame. - size_t xframe = find_current_user_frame (); + std::size_t xframe = find_current_user_frame (); if (xframe > 0) { @@ -137,7 +137,7 @@ { // Start at current frame. - size_t xframe = find_current_user_frame (); + std::size_t xframe = find_current_user_frame (); if (xframe > 0) { @@ -161,7 +161,7 @@ { // Start at current frame. - size_t xframe = find_current_user_frame (); + std::size_t xframe = find_current_user_frame (); if (xframe > 0) { @@ -185,7 +185,7 @@ { // Start at current frame. - size_t xframe = find_current_user_frame (); + std::size_t xframe = find_current_user_frame (); if (xframe > 0) { @@ -208,7 +208,7 @@ if (m_curr_frame == 0) return retval; - size_t i = m_curr_frame; + std::size_t i = m_curr_frame; while (i != 0) { @@ -234,7 +234,7 @@ if (m_curr_frame == 0) return retval; - size_t i = m_curr_frame; + std::size_t i = m_curr_frame; while (i != 0) { @@ -264,7 +264,7 @@ return retval; // Start looking with the caller of the calling debug function. - size_t i = m_curr_frame; + std::size_t i = m_curr_frame; while (i != 0) { @@ -346,17 +346,17 @@ } void call_stack::get_new_frame_index_and_links - (size_t& new_frame_idx, std::shared_ptr& parent_link, + (std::size_t& new_frame_idx, std::shared_ptr& parent_link, std::shared_ptr& static_link) const { // FIXME: is there a better way? - size_t prev_frame_idx = m_curr_frame; + std::size_t prev_frame_idx = m_curr_frame; new_frame_idx = m_cs.size (); // m_max_stack_depth should never be less than zero. - if (new_frame_idx > static_cast (m_max_stack_depth)) + if (new_frame_idx > static_cast (m_max_stack_depth)) error ("max_stack_depth exceeded"); // There can't be any links to previous frames if this is the first @@ -377,7 +377,7 @@ void call_stack::push (const symbol_scope& scope) { - size_t new_frame_idx; + std::size_t new_frame_idx; std::shared_ptr parent_link; std::shared_ptr static_link; @@ -395,7 +395,7 @@ void call_stack::push (octave_user_function *fcn, const std::shared_ptr& closure_frames) { - size_t new_frame_idx; + std::size_t new_frame_idx; std::shared_ptr parent_link; std::shared_ptr static_link; @@ -415,7 +415,7 @@ const stack_frame::local_vars_map& local_vars, const std::shared_ptr& closure_frames) { - size_t new_frame_idx; + std::size_t new_frame_idx; std::shared_ptr parent_link; std::shared_ptr static_link; @@ -433,7 +433,7 @@ void call_stack::push (octave_user_script *script) { - size_t new_frame_idx; + std::size_t new_frame_idx; std::shared_ptr parent_link; std::shared_ptr static_link; @@ -450,7 +450,7 @@ void call_stack::push (octave_function *fcn) { - size_t new_frame_idx; + std::size_t new_frame_idx; std::shared_ptr parent_link; std::shared_ptr static_link; @@ -465,7 +465,7 @@ m_curr_frame = new_frame_idx; } - bool call_stack::goto_frame (size_t n, bool verbose) + bool call_stack::goto_frame (std::size_t n, bool verbose) { bool retval = false; @@ -486,9 +486,9 @@ return retval; } - size_t call_stack::find_current_user_frame (void) const + std::size_t call_stack::find_current_user_frame (void) const { - size_t user_frame = m_curr_frame; + std::size_t user_frame = m_curr_frame; std::shared_ptr frm = m_cs[user_frame]; @@ -505,7 +505,7 @@ std::shared_ptr call_stack::current_user_frame (void) const { - size_t frame = find_current_user_frame (); + std::size_t frame = find_current_user_frame (); return m_cs[frame]; } @@ -514,7 +514,7 @@ // the call stack that corresponds to a script, function, or scope // beginning with the frame indexed by START. - size_t call_stack::dbupdown (size_t start, int n, bool verbose) + std::size_t call_stack::dbupdown (std::size_t start, int n, bool verbose) { if (start >= m_cs.size ()) error ("invalid stack frame"); @@ -542,7 +542,7 @@ // explanation. May be easiest with some pictures of the call stack // for an example or two. - size_t xframe = frm->index (); + std::size_t xframe = frm->index (); if (n == 0) { @@ -562,7 +562,7 @@ else if (n > 0) incr = 1; - size_t last_good_frame = 0; + std::size_t last_good_frame = 0; while (true) { @@ -604,9 +604,9 @@ // function, script or scope frame then there is an error in the // implementation. - size_t call_stack::dbupdown (int n, bool verbose) + std::size_t call_stack::dbupdown (int n, bool verbose) { - size_t start = find_current_user_frame (); + std::size_t start = find_current_user_frame (); return dbupdown (start, n, verbose); } @@ -618,7 +618,7 @@ void call_stack::goto_caller_frame (void) { - size_t start = find_current_user_frame (); + std::size_t start = find_current_user_frame (); std::shared_ptr caller_frame = m_cs[start]->static_link (); @@ -644,11 +644,11 @@ // frames. The curr_user_frame value we set is the index into the // subset of frames returned in the octave_map object. - size_t curr_frame = find_current_user_frame (); + std::size_t curr_frame = find_current_user_frame (); // Don't include top-level stack frame in the list. - for (size_t n = m_cs.size () - 1; n > 0; n--) + for (std::size_t n = m_cs.size () - 1; n > 0; n--) { std::shared_ptr frm = m_cs[n]; @@ -712,7 +712,7 @@ std::list> frames = backtrace_frames (curr_user_frame); - size_t nframes = frames.size (); + std::size_t nframes = frames.size (); octave_map retval (dim_vector (nframes, 1), bt_fields); @@ -1114,9 +1114,9 @@ { std::ostream& os = octave_stdout; - size_t nframes = size (); + std::size_t nframes = size (); - for (size_t i = 0; i < nframes; i++) + for (std::size_t i = 0; i < nframes; i++) { m_cs[i]->display (false); if (i < nframes - 1) diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/call-stack.h --- a/libinterp/corefcn/call-stack.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/call-stack.h Wed Apr 28 22:57:42 2021 -0400 @@ -84,9 +84,9 @@ // Current column in current function. int current_column (void) const; - size_t current_frame (void) const { return m_curr_frame; } + std::size_t current_frame (void) const { return m_curr_frame; } - size_t size (void) const { return m_cs.size (); } + std::size_t size (void) const { return m_cs.size (); } std::shared_ptr get_current_stack_frame (void) const { @@ -112,7 +112,7 @@ // Function at location N on the call stack (N == 0 is current), may // be built-in. - octave_function * element (size_t n) + octave_function * element (std::size_t n) { octave_function *retval = nullptr; @@ -197,19 +197,19 @@ } } - bool goto_frame (size_t n = 0, bool verbose = false); + bool goto_frame (std::size_t n = 0, bool verbose = false); - void restore_frame (size_t n) + void restore_frame (std::size_t n) { goto_frame (n); } - size_t find_current_user_frame (void) const; + std::size_t find_current_user_frame (void) const; std::shared_ptr current_user_frame (void) const; - size_t dbupdown (size_t start, int n, bool verbose); - size_t dbupdown (int n = -1, bool verbose = false); + std::size_t dbupdown (std::size_t start, int n, bool verbose); + std::size_t dbupdown (int n = -1, bool verbose = false); void goto_caller_frame (void); @@ -304,7 +304,7 @@ private: void get_new_frame_index_and_links - (size_t& new_frame_idx, std::shared_ptr& parent_link, + (std::size_t& new_frame_idx, std::shared_ptr& parent_link, std::shared_ptr& static_link) const; tree_evaluator& m_evaluator; @@ -319,7 +319,7 @@ // FIXME: should the current frame be managed by the evaluator // instead? - size_t m_curr_frame; + std::size_t m_curr_frame; int m_max_stack_depth; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/cellfun.cc Wed Apr 28 22:57:42 2021 -0400 @@ -232,7 +232,8 @@ { std::string arg = args(nargin-2).string_value (); - size_t compare_len = std::max (arg.length (), static_cast (2)); + std::size_t compare_len + = std::max (arg.length (), static_cast (2)); if (octave::string::strncmpi (arg, "uniformoutput", compare_len)) uniform_output = args(nargin-1).bool_value (); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/data.cc Wed Apr 28 22:57:42 2021 -0400 @@ -7961,7 +7961,7 @@ if (args(0).is_ ## X ## _type ()) \ { \ const X##NDArray in = args(0). X## _array_value (); \ - size_t inlen = in.numel () * sizeof (X## _t) / sizeof (char); \ + std::size_t inlen = in.numel () * sizeof (X## _t) / sizeof (char); \ const char *inc = reinterpret_cast (in.data ()); \ char *out; \ if (octave::base64_encode (inc, inlen, &out)) \ @@ -7988,7 +7988,7 @@ else if (args(0).is_single_type ()) { const Array in = args(0).float_array_value (); - size_t inlen; + std::size_t inlen; inlen = in.numel () * sizeof (float) / sizeof (char); const char* inc; inc = reinterpret_cast (in.data ()); @@ -8002,7 +8002,7 @@ else // double_type { const Array in = args(0).array_value (); - size_t inlen; + std::size_t inlen; inlen = in.numel () * sizeof (double) / sizeof (char); const char* inc; inc = reinterpret_cast (in.data ()); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/debug.cc --- a/libinterp/corefcn/debug.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/debug.cc Wed Apr 28 22:57:42 2021 -0400 @@ -651,7 +651,7 @@ { std::string arg = argv[1]; - size_t ind = arg.find (':'); + std::size_t ind = arg.find (':'); if (ind != std::string::npos) // (dbtype start:end) { @@ -717,7 +717,7 @@ std::string arg = argv[2]; int start, end; - size_t ind = arg.find (':'); + std::size_t ind = arg.find (':'); if (ind != std::string::npos) { @@ -842,7 +842,7 @@ octave_idx_type curr_frame = -1; - size_t nskip = 0; + std::size_t nskip = 0; if (nargin == 1 || nargin == 2) { @@ -892,7 +892,7 @@ bool show_top_level = true; - size_t max_name_len = 0; + std::size_t max_name_len = 0; for (octave_idx_type i = nskip; i < nframes; i++) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/dlmread.cc --- a/libinterp/corefcn/dlmread.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/dlmread.cc Wed Apr 28 22:57:42 2021 -0400 @@ -331,11 +331,11 @@ if (sep.empty ()) { // Skip leading whitespace. - size_t pos1 = line.find_first_not_of (" \t"); + std::size_t pos1 = line.find_first_not_of (" \t"); // For Matlab compatibility, blank delimiter should // correspond to whitespace (space and tab). - size_t n = line.find_first_of (",:; \t", pos1); + std::size_t n = line.find_first_of (",:; \t", pos1); if (n == std::string::npos) { sep = " \t"; @@ -363,7 +363,7 @@ // Estimate the number of columns from first line of data. if (cmax == 0) { - size_t pos1, pos2; + std::size_t pos1, pos2; if (auto_sep_is_wspace) pos1 = line.find_first_not_of (" \t"); else @@ -400,7 +400,7 @@ r = (r > i + 1 ? r : i + 1); j = 0; - size_t pos1, pos2; + std::size_t pos1, pos2; if (auto_sep_is_wspace) pos1 = line.find_first_not_of (" \t"); // Skip leading whitespace. else diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/error.cc Wed Apr 28 22:57:42 2021 -0400 @@ -161,7 +161,7 @@ // Ugh. - size_t len = strlen (msg); + std::size_t len = strlen (msg); if (len > 0) { @@ -370,7 +370,7 @@ octave_map error_system::make_stack_map (const std::list& frames) { - size_t nframes = frames.size (); + std::size_t nframes = frames.size (); octave_map retval (dim_vector (nframes, 1), bt_fields); @@ -530,7 +530,7 @@ msg_string += base_msg; bool fmt_suppresses_backtrace = false; - size_t fmt_len = (fmt ? strlen (fmt) : 0); + std::size_t fmt_len = (fmt ? strlen (fmt) : 0); fmt_suppresses_backtrace = (fmt_len > 0 && fmt[fmt_len-1] == '\n'); if (! fmt_suppresses_backtrace) diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/event-queue.h --- a/libinterp/corefcn/event-queue.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/event-queue.h Wed Apr 28 22:57:42 2021 -0400 @@ -75,7 +75,7 @@ } } - size_t size (void) const { return fifo.size (); } + std::size_t size (void) const { return fifo.size (); } protected: diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/fcn-info.cc --- a/libinterp/corefcn/fcn-info.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/fcn-info.cc Wed Apr 28 22:57:42 2021 -0400 @@ -74,7 +74,7 @@ std::string class_name; - size_t pos = dir_name.find_last_of (sys::file_ops::dir_sep_chars ()); + std::size_t pos = dir_name.find_last_of (sys::file_ops::dir_sep_chars ()); if (pos != std::string::npos) { @@ -381,7 +381,7 @@ split_name_with_package (const std::string& name, std::string& fname, std::string& pname) { - size_t pos = name.rfind ('.'); + std::size_t pos = name.rfind ('.'); fname.clear (); pname.clear (); @@ -986,7 +986,7 @@ if (! file_name.empty ()) { - size_t pos = file_name.find_last_of (sys::file_ops::dir_sep_chars ()); + std::size_t pos = file_name.find_last_of (sys::file_ops::dir_sep_chars ()); std::string dir_name = file_name.substr (0, pos); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/fcn-info.h --- a/libinterp/corefcn/fcn-info.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/fcn-info.h Wed Apr 28 22:57:42 2021 -0400 @@ -59,7 +59,7 @@ cmdline_function (), autoload_function (), function_on_path (), built_in_function () { - size_t pos = name.rfind ('.'); + std::size_t pos = name.rfind ('.'); if (pos != std::string::npos) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/file-io.cc --- a/libinterp/corefcn/file-io.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/file-io.cc Wed Apr 28 22:57:42 2021 -0400 @@ -98,7 +98,7 @@ // when using automatic flushing and seems completely unnecessary. // See bug #52644. - size_t pos = mode.find ('W'); + std::size_t pos = mode.find ('W'); if (pos != std::string::npos) mode[pos] = 'w'; @@ -128,8 +128,8 @@ // Use binary mode if 't' is not specified, but don't add // 'b' if it is already present. - size_t bpos = mode.find ('b'); - size_t tpos = mode.find ('t'); + std::size_t bpos = mode.find ('b'); + std::size_t tpos = mode.find ('t'); if (bpos == std::string::npos && tpos == std::string::npos) mode += 'b'; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/ft-text-renderer.cc --- a/libinterp/corefcn/ft-text-renderer.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/ft-text-renderer.cc Wed Apr 28 22:57:42 2021 -0400 @@ -1002,9 +1002,9 @@ const uint8_t *c = reinterpret_cast (str.c_str ()); uint32_t u32_c; - size_t n = str.size (); - size_t icurr = 0; - size_t ibegin = 0; + std::size_t n = str.size (); + std::size_t icurr = 0; + std::size_t ibegin = 0; // Initialize a new string std::string fname = font.get_face ()->family_name; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/gl2ps-print.cc --- a/libinterp/corefcn/gl2ps-print.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/gl2ps-print.cc Wed Apr 28 22:57:42 2021 -0400 @@ -399,18 +399,18 @@ std::string include_graph; - size_t found_redirect = old_print_cmd.find ('>'); + std::size_t found_redirect = old_print_cmd.find ('>'); if (found_redirect != std::string::npos) include_graph = old_print_cmd.substr (found_redirect + 1); else include_graph = old_print_cmd; - size_t n_begin = include_graph.find_first_not_of (" \"'"); + std::size_t n_begin = include_graph.find_first_not_of (" \"'"); if (n_begin != std::string::npos) { - size_t n_end = include_graph.find_last_not_of (" \"'"); + std::size_t n_end = include_graph.find_last_not_of (" \"'"); include_graph = include_graph.substr (n_begin, n_end - n_begin + 1); } @@ -460,7 +460,7 @@ // Copy temporary file to pipe std::fseek (tmpf, 0, SEEK_SET); char str[8192]; // 8 kB is a common kernel buffersize - size_t nread, nwrite; + std::size_t nread, nwrite; nread = 1; // In EPS terminal read the header line by line and insert a @@ -497,7 +497,7 @@ // Remove this "else if" block, and // make header_found true for SVG if gl2ps is fixed. std::string srchstr (str); - size_t pos = srchstr.find ("px"); + std::size_t pos = srchstr.find ("px"); if (pos != std::string::npos) { header_found = true; @@ -935,7 +935,7 @@ const uint8_t *c = reinterpret_cast (tmpstr.c_str ()); - for (size_t i = 0; i < tmpstr.size ();) + for (std::size_t i = 0; i < tmpstr.size ();) { int mblen = octave_u8_strmblen_wrapper (c + i); @@ -979,7 +979,7 @@ ss << "(" << str << ") ["; std::vector xdata = txtobj.get_xdata (); - for (size_t i = 1; i < xdata.size (); i++) + for (std::size_t i = 1; i < xdata.size (); i++) ss << xdata[i] - xdata[i-1] << " "; ss << "10] " << rotation << " " << txtobj.get_x () diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/graphics.cc Wed Apr 28 22:57:42 2021 -0400 @@ -86,7 +86,7 @@ const std::set& pnames, const caseless_str& pname) { - size_t len = pname.length (); + std::size_t len = pname.length (); std::set matches; // Find exact or partial matches to property name @@ -101,7 +101,7 @@ } } - size_t num_matches = matches.size (); + std::size_t num_matches = matches.size (); if (num_matches == 0) error ("%s: unknown %s property %s", @@ -1294,13 +1294,13 @@ radio_values::radio_values (const std::string& opt_string) : default_val (), possible_vals () { - size_t beg = 0; - size_t len = opt_string.length (); + std::size_t beg = 0; + std::size_t len = opt_string.length (); bool done = len == 0; while (! done) { - size_t end = opt_string.find ('|', beg); + std::size_t end = opt_string.find ('|', beg); if (end == std::string::npos) { @@ -2270,9 +2270,9 @@ void property_list::set (const caseless_str& name, const octave_value& val) { - size_t offset = 0; - - size_t len = name.length (); + std::size_t offset = 0; + + std::size_t len = name.length (); if (len > 4) { @@ -2412,9 +2412,9 @@ { octave_value retval; - size_t offset = 0; - - size_t len = name.length (); + std::size_t offset = 0; + + std::size_t len = name.length (); if (len > 4) { @@ -9254,7 +9254,7 @@ void axes::properties::clear_zoom_stack (bool do_unzoom) { - size_t items_to_leave_on_stack = (do_unzoom ? 7 : 0); + std::size_t items_to_leave_on_stack = (do_unzoom ? 7 : 0); while (zoom_stack.size () > items_to_leave_on_stack) zoom_stack.pop_front (); @@ -13781,7 +13781,7 @@ error ("drawnow: empty pipe '|'"); else if (file[0] != '|') { - size_t pos = file.find_last_of (octave::sys::file_ops::dir_sep_chars ()); + std::size_t pos = file.find_last_of (octave::sys::file_ops::dir_sep_chars ()); if (pos != std::string::npos) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/graphics.in.h Wed Apr 28 22:57:42 2021 -0400 @@ -486,11 +486,11 @@ const desired_enum& typ = string_t) : base_property (s, h), desired_type (typ), separator (sep), str () { - size_t pos = 0; + std::size_t pos = 0; while (true) { - size_t new_pos = val.find_first_of (separator, pos); + std::size_t new_pos = val.find_first_of (separator, pos); if (new_pos == std::string::npos) { @@ -568,12 +568,12 @@ bool replace = false; std::string new_str = val.string_value (); string_vector strings; - size_t pos = 0; + std::size_t pos = 0; // Split single string on delimiter (usually '|') while (pos != std::string::npos) { - size_t new_pos = new_str.find_first_of (separator, pos); + std::size_t new_pos = new_str.find_first_of (separator, pos); if (new_pos == std::string::npos) { @@ -871,9 +871,9 @@ bool contains (const std::string& val, std::string& match) { - size_t k = 0; - - size_t len = val.length (); + std::size_t k = 0; + + std::size_t len = val.length (); std::string first_match; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/help.cc Wed Apr 28 22:57:42 2021 -0400 @@ -130,16 +130,16 @@ static bool looks_like_html (const std::string& msg) { - const size_t p1 = msg.find ('\n'); + const std::size_t p1 = msg.find ('\n'); std::string t = msg.substr (0, p1); // FIXME: this comparison should be case-insensitive - const size_t p2 = t.find (" names = curr_fcn->subfunction_names (); - size_t sz = names.size (); + std::size_t sz = names.size (); retval.resize (sz); // Loop over them. - size_t i = 0; + std::size_t i = 0; for (const auto& nm : names) retval(i++) = nm; @@ -531,7 +531,7 @@ if (! val.is_defined ()) { - size_t pos = nm.rfind ('.'); + std::size_t pos = nm.rfind ('.'); if (pos != std::string::npos) { @@ -614,7 +614,7 @@ error ("invalid built-in-docstrings file!"); // FIXME: eliminate fixed buffer size. - size_t bufsize = 1000; + std::size_t bufsize = 1000; OCTAVE_LOCAL_BUFFER (char, buf, bufsize); while (! file.eof ()) @@ -692,7 +692,7 @@ file.seekg (beg); - size_t txt_len = len; + std::size_t txt_len = len; OCTAVE_LOCAL_BUFFER (char, buf, txt_len + 1); file.read (buf, txt_len); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/hex2num.cc --- a/libinterp/corefcn/hex2num.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/hex2num.cc Wed Apr 28 22:57:42 2021 -0400 @@ -62,21 +62,21 @@ } static void -hex2num (const std::string& hex, void *num, size_t nbytes, bool swap_bytes) +hex2num (const std::string& hex, void *num, std::size_t nbytes, bool swap_bytes) { unsigned char *cp = reinterpret_cast (num); - const size_t nc = hex.length (); - const size_t nchars = 2 * nbytes; + const std::size_t nc = hex.length (); + const std::size_t nchars = 2 * nbytes; if (nc > nchars) error ("hex2num: S must be no more than %zd characters", nchars); - size_t j = 0; + std::size_t j = 0; - for (size_t i = 0; i < nbytes; i++) + for (std::size_t i = 0; i < nbytes; i++) { - size_t k = (swap_bytes ? nbytes - i - 1 : i); + std::size_t k = (swap_bytes ? nbytes - i - 1 : i); unsigned char ch1 = (j < nc) ? hex[j++] : '0'; unsigned char ch2 = (j < nc) ? hex[j++] : '0'; @@ -93,7 +93,7 @@ Array m (val.dims ()); - size_t nbytes = sizeof (T); + std::size_t nbytes = sizeof (T); for (octave_idx_type i = 0; i < nel; i++) { @@ -223,15 +223,15 @@ } static inline void -num2hex (const void *p, size_t n, char *hex, bool swap_bytes) +num2hex (const void *p, std::size_t n, char *hex, bool swap_bytes) { const unsigned char *cp = reinterpret_cast (p); - size_t k = 0; + std::size_t k = 0; - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) { - size_t j = (swap_bytes ? n - i - 1 : i); + std::size_t j = (swap_bytes ? n - i - 1 : i); unsigned char ch = cp[j]; @@ -244,8 +244,8 @@ Cell num2hex (const Array& v, bool swap_bytes) { - const size_t nbytes = sizeof (T); - const size_t nchars = 2 * nbytes; + const std::size_t nbytes = sizeof (T); + const std::size_t nchars = 2 * nbytes; octave_idx_type nel = v.numel (); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/input.cc --- a/libinterp/corefcn/input.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/input.cc Wed Apr 28 22:57:42 2021 -0400 @@ -158,7 +158,7 @@ { string_vector names; - size_t pos = text.rfind ('.'); + std::size_t pos = text.rfind ('.'); bool array = false; if (pos != std::string::npos) @@ -267,13 +267,13 @@ is_completing_dirfns (void) { static std::string dirfns_commands[] = {"cd", "isfile", "isfolder", "ls"}; - static const size_t dirfns_commands_length = 4; + static const std::size_t dirfns_commands_length = 4; bool retval = false; std::string line = command_editor::get_line_buffer (); - for (size_t i = 0; i < dirfns_commands_length; i++) + for (std::size_t i = 0; i < dirfns_commands_length; i++) { int index = line.find (dirfns_commands[i] + ' '); @@ -295,7 +295,7 @@ static std::string prefix; static std::string hint; - static size_t hint_len = 0; + static std::size_t hint_len = 0; static int list_index = 0; static int name_list_len = 0; @@ -629,7 +629,7 @@ if (input_buf.empty ()) error ("input: reading user-input failed!"); - size_t len = input_buf.length (); + std::size_t len = input_buf.length (); octave_diary << input_buf; @@ -891,7 +891,7 @@ { std::string input = octave_gets (prompt, m_eof); - size_t len = input.size (); + std::size_t len = input.size (); if (len == 0) { @@ -910,10 +910,10 @@ } } - size_t beg = 0; + std::size_t beg = 0; while (beg < len) { - size_t end = input.find ('\n', beg); + std::size_t end = input.find ('\n', beg); if (end == std::string::npos) { @@ -979,9 +979,9 @@ { // convert encoding to UTF-8 before returning string const char *src = src_str.c_str (); - size_t srclen = src_str.length (); + std::size_t srclen = src_str.length (); - size_t length; + std::size_t length; uint8_t *utf8_str; utf8_str = octave_u8_conv_from_encoding (encoding.c_str (), src, srclen, diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/load-path.cc Wed Apr 28 22:57:42 2021 -0400 @@ -100,10 +100,10 @@ { std::list retval; - size_t beg = 0; - size_t end = p.find (directory_path::path_sep_char ()); - - size_t len = p.length (); + std::size_t beg = 0; + std::size_t end = p.find (directory_path::path_sep_char ()); + + std::size_t len = p.length (); while (end != std::string::npos) { @@ -135,7 +135,7 @@ { std::string dir = dir_arg; - size_t k = dir.length (); + std::size_t k = dir.length (); while (k > 1 && sys::file_ops::is_dir_sep (dir[k-1])) k--; @@ -190,9 +190,9 @@ static bool in_path_list (const std::string& path_list, const std::string& path) { - size_t ps = path.size (); - size_t pls = path_list.size (); - size_t pos = path_list.find (path); + std::size_t ps = path.size (); + std::size_t pls = path_list.size (); + std::size_t pos = path_list.find (path); char psc = directory_path::path_sep_char (); while (pos != std::string::npos) { @@ -610,7 +610,7 @@ { std::string dname = di.abs_dir_name; - size_t dname_len = dname.length (); + std::size_t dname_len = dname.length (); if (dname.substr (dname_len - 1) == sys::file_ops::dir_sep_str ()) @@ -619,7 +619,7 @@ dname_len--; } - size_t dir_len = canon_dir.length (); + std::size_t dir_len = canon_dir.length (); if (dname_len > dir_len && sys::file_ops::is_dir_sep (dname[dname_len - dir_len - 1]) @@ -657,7 +657,7 @@ { std::string dname = di.abs_dir_name; - size_t dname_len = dname.length (); + std::size_t dname_len = dname.length (); if (dname.substr (dname_len - 1) == sys::file_ops::dir_sep_str ()) @@ -666,7 +666,7 @@ dname_len--; } - size_t dir_len = canon_dir.length (); + std::size_t dir_len = canon_dir.length (); if (dname_len > dir_len && sys::file_ops::is_dir_sep (dname[dname_len - dir_len - 1]) @@ -831,7 +831,7 @@ string_vector load_path::dirs (void) const { - size_t len = dir_info_list.size (); + std::size_t len = dir_info_list.size (); string_vector retval (len); @@ -872,7 +872,7 @@ { std::string fname = retval[i]; - size_t pos = fname.rfind ('.'); + std::size_t pos = fname.rfind ('.'); if (pos != std::string::npos) retval[i] = fname.substr (0, pos); @@ -1062,7 +1062,7 @@ void load_path::add (const std::string& dir_arg, bool at_end, bool warn) { - size_t len = dir_arg.length (); + std::size_t len = dir_arg.length (); if (len > 1 && dir_arg.substr (len-2) == "//") warning_with_id ("Octave:recursive-path-search", @@ -1215,7 +1215,7 @@ { std::string fname = flist[i]; - size_t pos = fname.rfind ('.'); + std::size_t pos = fname.rfind ('.'); if (pos != std::string::npos) { @@ -1333,7 +1333,7 @@ bool load_path::dir_info::is_package (const std::string& name) const { - size_t pos = name.find ('.'); + std::size_t pos = name.find ('.'); if (pos == std::string::npos) return package_dir_map.find (name) != package_dir_map.end (); @@ -1441,7 +1441,7 @@ { all_files[all_files_count++] = fname; - size_t pos = fname.rfind ('.'); + std::size_t pos = fname.rfind ('.'); if (pos != std::string::npos) { @@ -1607,7 +1607,7 @@ if (fcn.length () > 0 && fcn[0] == '@') { - size_t pos = fcn.find ('/'); + std::size_t pos = fcn.find ('/'); if (pos != std::string::npos) { @@ -1768,7 +1768,7 @@ string_vector load_path::package_info::fcn_names (void) const { - size_t len = fcn_map.size (); + std::size_t len = fcn_map.size (); string_vector retval (len); @@ -1797,7 +1797,7 @@ std::string ext; std::string base = fname; - size_t pos = fname.rfind ('.'); + std::size_t pos = fname.rfind ('.'); if (pos != std::string::npos) { @@ -1972,7 +1972,7 @@ std::string ext; std::string base = fname; - size_t pos = fname.rfind ('.'); + std::size_t pos = fname.rfind ('.'); if (pos != std::string::npos) { @@ -2064,7 +2064,7 @@ std::string ext; std::string base = fname; - size_t pos = fname.rfind ('.'); + std::size_t pos = fname.rfind ('.'); if (pos != std::string::npos) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/load-save.cc --- a/libinterp/corefcn/load-save.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/load-save.cc Wed Apr 28 22:57:42 2021 -0400 @@ -186,8 +186,8 @@ { std::string fname = find_data_file_in_load_path ("load", name, true); - size_t dot_pos = fname.rfind ('.'); - size_t sep_pos = fname.find_last_of (sys::file_ops::dir_sep_chars ()); + std::size_t dot_pos = fname.rfind ('.'); + std::size_t sep_pos = fname.find_last_of (sys::file_ops::dir_sep_chars ()); if (dot_pos == std::string::npos || (sep_pos != std::string::npos && dot_pos < sep_pos)) @@ -849,7 +849,7 @@ OCTAVE_VERSION ", %Y-%m-%d %T UTC"; std::string comment_string = now.strftime (matlab_format); - size_t len = std::min (comment_string.length (), static_cast (124)); + std::size_t len = std::min (comment_string.length (), static_cast (124)); memset (headertext, ' ', 124); memcpy (headertext, comment_string.data (), len); @@ -903,16 +903,16 @@ // Save variables with names matching PATTERN on stream OS in the // format specified by FMT. - size_t load_save_system::save_vars (std::ostream& os, - const std::string& pattern, - const load_save_format& fmt, - bool save_as_floats) + std::size_t load_save_system::save_vars (std::ostream& os, + const std::string& pattern, + const load_save_format& fmt, + bool save_as_floats) { tree_evaluator& tw = m_interpreter.get_evaluator (); symbol_info_list syminfo_list = tw.glob_symbol_info (pattern); - size_t saved = 0; + std::size_t saved = 0; for (const auto& syminfo : syminfo_list) { @@ -993,15 +993,15 @@ // save fields of a scalar structure STR matching PATTERN on stream OS // in the format specified by FMT. - size_t load_save_system::save_fields (std::ostream& os, - const octave_scalar_map& m, - const std::string& pattern, - const load_save_format& fmt, - bool save_as_floats) + std::size_t load_save_system::save_fields (std::ostream& os, + const octave_scalar_map& m, + const std::string& pattern, + const load_save_format& fmt, + bool save_as_floats) { glob_match pat (pattern); - size_t saved = 0; + std::size_t saved = 0; for (auto it = m.begin (); it != m.end (); it++) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/load-save.h --- a/libinterp/corefcn/load-save.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/load-save.h Wed Apr 28 22:57:42 2021 -0400 @@ -227,8 +227,8 @@ void write_header (std::ostream& os, const load_save_format& fmt); - size_t save_vars (std::ostream& os, const std::string& pattern, - const load_save_format& fmt, bool save_as_floats); + std::size_t save_vars (std::ostream& os, const std::string& pattern, + const load_save_format& fmt, bool save_as_floats); void do_save (std::ostream& os, const octave_value& tc, const std::string& name, const std::string& help, @@ -238,9 +238,9 @@ void do_save (std::ostream& os, const symbol_info& syminfo, const load_save_format& fmt, bool save_as_floats); - size_t save_fields (std::ostream& os, const octave_scalar_map& m, - const std::string& pattern, - const load_save_format& fmt, bool save_as_floats); + std::size_t save_fields (std::ostream& os, const octave_scalar_map& m, + const std::string& pattern, + const load_save_format& fmt, bool save_as_floats); void dump_octave_core (std::ostream& os, const char *fname, const load_save_format& fmt, bool save_as_floats); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/ls-hdf5.cc --- a/libinterp/corefcn/ls-hdf5.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/ls-hdf5.cc Wed Apr 28 22:57:42 2021 -0400 @@ -239,14 +239,14 @@ { std::string retval; - size_t nm_len = nm.length (); + std::size_t nm_len = nm.length (); if (nm_len > 0) { if (! isalpha (nm[0])) retval += '_'; - for (size_t i = 0; i < nm_len; i++) + for (std::size_t i = 0; i < nm_len; i++) { char c = nm[i]; retval += (isalnum (c) || c == '_') ? c : '_'; @@ -487,7 +487,7 @@ H5Dclose (data_hid); H5Sclose (space_hid); - for (size_t i = 0; i < hdims[1]; i++) + for (std::size_t i = 0; i < hdims[1]; i++) args(i+1) = std::string (s1 + i*hdims[0]); #if defined (HAVE_HDF5_18) @@ -1107,7 +1107,7 @@ { std::vector var_name; bool found = false; - size_t len = 0; + std::size_t len = 0; len = H5Gget_objname_by_idx (hs.file_id, hs.current_item, nullptr, 0); var_name.resize (len+1); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/ls-mat-ascii.cc --- a/libinterp/corefcn/ls-mat-ascii.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/ls-mat-ascii.cc Wed Apr 28 22:57:42 2021 -0400 @@ -126,7 +126,7 @@ file_line_number++; - size_t beg = buf.find_first_not_of (", \t"); + std::size_t beg = buf.find_first_not_of (", \t"); // If we see a CR as the last character in the buffer, we had a // CRLF pair as the line separator. Any other CR in the text @@ -146,7 +146,7 @@ { tmp_nc++; - size_t end = buf.find_first_of (", \t", beg); + std::size_t end = buf.find_first_of (", \t", beg); if (end != std::string::npos) { @@ -232,7 +232,7 @@ { std::string varname; - size_t pos = filename.rfind ('/'); + std::size_t pos = filename.rfind ('/'); if (pos != std::string::npos) varname = filename.substr (pos+1); @@ -244,8 +244,8 @@ if (pos != std::string::npos) varname = varname.substr (0, pos); - size_t len = varname.length (); - for (size_t i = 0; i < len; i++) + std::size_t len = varname.length (); + for (std::size_t i = 0; i < len; i++) { char c = varname[i]; if (! (isalnum (c) || c == '_')) diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/ls-mat5.cc --- a/libinterp/corefcn/ls-mat5.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/ls-mat5.cc Wed Apr 28 22:57:42 2021 -0400 @@ -891,7 +891,7 @@ if (fs.exists ()) { - size_t xpos + std::size_t xpos = str.find_last_of (octave::sys::file_ops::dir_sep_chars ()); std::string dir_name = str.substr (0, xpos); @@ -918,7 +918,7 @@ str = octave::sys::env::make_absolute (p.find_first_of (names)); - size_t xpos + std::size_t xpos = str.find_last_of (octave::sys::file_ops::dir_sep_chars ()); std::string dir_name = str.substr (0, xpos); @@ -941,7 +941,7 @@ } else { - size_t xpos + std::size_t xpos = fpath.find_last_of (octave::sys::file_ops::dir_sep_chars ()); std::string dir_name = fpath.substr (0, xpos); @@ -2074,8 +2074,8 @@ save_mat5_element_length (const octave_value& tc, const std::string& name, bool save_as_floats, bool mat7_format) { - size_t max_namelen = 63; - size_t len = name.length (); + std::size_t max_namelen = 63; + std::size_t len = name.length (); std::string cname = tc.class_name (); int ret = 32; @@ -2194,7 +2194,7 @@ ret += 8 + PAD (6); // length of "inline" is 6 else if (tc.isobject ()) { - size_t classlen = tc.class_name ().length (); + std::size_t classlen = tc.class_name ().length (); ret += 8 + PAD (classlen > max_namelen ? max_namelen : classlen); } @@ -2257,7 +2257,7 @@ int32_t flags = 0; int32_t nnz_32 = 0; std::string cname = tc.class_name (); - size_t max_namelen = 63; + std::size_t max_namelen = 63; dim_vector dv = tc.dims (); int nd = tc.ndims (); @@ -2428,7 +2428,7 @@ // array name subelement { - size_t namelen = name.length (); + std::size_t namelen = name.length (); if (namelen > max_namelen) namelen = max_namelen; // Truncate names if necessary @@ -2606,7 +2606,7 @@ if (tc.is_inline_function () || tc.isobject ()) { std::string classname = (tc.isobject () ? tc.class_name () : "inline"); - size_t namelen = classname.length (); + std::size_t namelen = classname.length (); if (namelen > max_namelen) namelen = max_namelen; // Truncate names if necessary diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/ls-oct-text.cc --- a/libinterp/corefcn/ls-oct-text.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/ls-oct-text.cc Wed Apr 28 22:57:42 2021 -0400 @@ -314,7 +314,7 @@ error ("load: failed to extract keyword specifying value type"); std::string typ; - size_t pos = tag.rfind (' '); + std::size_t pos = tag.rfind (' '); if (pos != std::string::npos) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/mex.cc --- a/libinterp/corefcn/mex.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/mex.cc Wed Apr 28 22:57:42 2021 -0400 @@ -589,7 +589,7 @@ return calc_single_subscript_internal (ndims, dims, nsubs, subs); } - size_t get_element_size (void) const + std::size_t get_element_size (void) const { // Force id to be cached. get_class_id (); @@ -1014,7 +1014,7 @@ return calc_single_subscript_internal (ndims, dims, nsubs, subs); } - size_t get_element_size (void) const + std::size_t get_element_size (void) const { switch (id) { @@ -1163,12 +1163,12 @@ { const char *ptr = str[j]; - size_t tmp_len = strlen (ptr); - - for (size_t i = 0; i < tmp_len; i++) + std::size_t tmp_len = strlen (ptr); + + for (std::size_t i = 0; i < tmp_len; i++) cpr[m*i+j] = static_cast (ptr[i]); - for (size_t i = tmp_len; i < static_cast (nc); i++) + for (std::size_t i = tmp_len; i < static_cast (nc); i++) cpr[m*i+j] = static_cast (' '); } } @@ -1182,7 +1182,7 @@ * get_element_size ()) : nullptr) { - size_t nbytes = get_number_of_elements () * get_element_size (); + std::size_t nbytes = get_number_of_elements () * get_element_size (); if (pr) memcpy (pr, val.pr, nbytes); @@ -1514,7 +1514,7 @@ ir (static_cast (mxArray::malloc (nzmax * sizeof (mwIndex)))), jc (static_cast (mxArray::malloc (nzmax * sizeof (mwIndex)))) { - size_t nbytes = nzmax * get_element_size (); + std::size_t nbytes = nzmax * get_element_size (); if (pr) memcpy (pr, val.pr, nbytes); @@ -2185,7 +2185,7 @@ } // Allocate memory. - void * malloc_unmarked (size_t n) + void * malloc_unmarked (std::size_t n) { void *ptr = std::malloc (n); @@ -2202,7 +2202,7 @@ } // Allocate memory to be freed on exit. - void * malloc (size_t n) + void * malloc (std::size_t n) { void *ptr = malloc_unmarked (n); @@ -2212,7 +2212,7 @@ } // Allocate memory and initialize to 0. - void * calloc_unmarked (size_t n, size_t t) + void * calloc_unmarked (std::size_t n, std::size_t t) { void *ptr = malloc_unmarked (n*t); @@ -2222,7 +2222,7 @@ } // Allocate memory to be freed on exit and initialize to 0. - void * calloc (size_t n, size_t t) + void * calloc (std::size_t n, std::size_t t) { void *ptr = calloc_unmarked (n, t); @@ -2234,7 +2234,7 @@ // Reallocate a pointer obtained from malloc or calloc. // If the pointer is NULL, allocate using malloc. // We don't need an "unmarked" version of this. - void * realloc (void *ptr, size_t n) + void * realloc (void *ptr, std::size_t n) { void *v; @@ -2449,13 +2449,13 @@ mex *mex_context = nullptr; void * -mxArray::malloc (size_t n) +mxArray::malloc (std::size_t n) { return mex_context ? mex_context->malloc_unmarked (n) : std::malloc (n); } void * -mxArray::calloc (size_t n, size_t t) +mxArray::calloc (std::size_t n, std::size_t t) { return mex_context ? mex_context->calloc_unmarked (n, t) : ::calloc (n, t); } @@ -2545,19 +2545,19 @@ // Memory management. void * -mxCalloc (size_t n, size_t size) +mxCalloc (std::size_t n, std::size_t size) { return mex_context ? mex_context->calloc (n, size) : ::calloc (n, size); } void * -mxMalloc (size_t n) +mxMalloc (std::size_t n) { return mex_context ? mex_context->malloc (n) : std::malloc (n); } void * -mxRealloc (void *ptr, size_t size) +mxRealloc (void *ptr, std::size_t size) { return mex_context ? mex_context->realloc (ptr, size) : std::realloc (ptr, size); @@ -2860,13 +2860,13 @@ } // Dimension extractors. -size_t +std::size_t mxGetM (const mxArray *ptr) { return ptr->get_m (); } -size_t +std::size_t mxGetN (const mxArray *ptr) { return ptr->get_n (); @@ -2884,7 +2884,7 @@ return ptr->get_number_of_dimensions (); } -size_t +std::size_t mxGetNumberOfElements (const mxArray *ptr) { return ptr->get_number_of_elements (); @@ -3139,7 +3139,7 @@ return ptr->calc_single_subscript (nsubs, subs); } -size_t +std::size_t mxGetElementSize (const mxArray *ptr) { return ptr->get_element_size (); @@ -3408,7 +3408,7 @@ void mexErrMsgTxt (const char *s) { - size_t len; + std::size_t len; if (s && (len = strlen (s)) > 0) { @@ -3434,7 +3434,7 @@ if (fmt && strlen (fmt) > 0) { const char *fname = mexFunctionName (); - size_t len = strlen (fname) + 2 + strlen (fmt) + 1; + std::size_t len = strlen (fname) + 2 + strlen (fmt) + 1; OCTAVE_LOCAL_BUFFER (char, tmpfmt, len); sprintf (tmpfmt, "%s: %s", fname, fmt); va_list args; @@ -3453,7 +3453,7 @@ void mexWarnMsgTxt (const char *s) { - size_t len; + std::size_t len; if (s && (len = strlen (s)) > 0) { @@ -3482,7 +3482,7 @@ if (fmt && strlen (fmt) > 0) { const char *fname = mexFunctionName (); - size_t len = strlen (fname) + 2 + strlen (fmt) + 1; + std::size_t len = strlen (fname) + 2 + strlen (fmt) + 1; OCTAVE_LOCAL_BUFFER (char, tmpfmt, len); sprintf (tmpfmt, "%s: %s", fname, fmt); va_list args; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/mexproto.h --- a/libinterp/corefcn/mexproto.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/mexproto.h Wed Apr 28 22:57:42 2021 -0400 @@ -55,6 +55,7 @@ #if defined (__cplusplus) # include +using std::size_t; extern "C" { #else # include diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/mxarray.in.h --- a/libinterp/corefcn/mxarray.in.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/mxarray.in.h Wed Apr 28 22:57:42 2021 -0400 @@ -295,7 +295,7 @@ virtual mwIndex calc_single_subscript (mwSize nsubs, mwIndex *subs) const = 0; - virtual size_t get_element_size (void) const = 0; + virtual std::size_t get_element_size (void) const = 0; virtual bool mutation_needed (void) const { return false; } @@ -519,15 +519,15 @@ mwIndex calc_single_subscript (mwSize nsubs, mwIndex *subs) const { return rep->calc_single_subscript (nsubs, subs); } - size_t get_element_size (void) const { return rep->get_element_size (); } + std::size_t get_element_size (void) const { return rep->get_element_size (); } bool mutation_needed (void) const { return rep->mutation_needed (); } mxArray * mutate (void) const { return rep->mutate (); } - static void * malloc (size_t n); + static void * malloc (std::size_t n); - static void * calloc (size_t n, size_t t); + static void * calloc (std::size_t n, std::size_t t); static char * strsave (const char *str) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/oct-map.cc --- a/libinterp/corefcn/oct-map.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/oct-map.cc Wed Apr 28 22:57:42 2021 -0400 @@ -169,9 +169,9 @@ octave_scalar_map::octave_scalar_map (const std::map& m) { - size_t sz = m.size (); + std::size_t sz = m.size (); xvals.resize (sz); - size_t i = 0; + std::size_t i = 0; for (const auto& k_v : m) { xkeys.getfield (k_v.first); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/oct-stream.cc Wed Apr 28 22:57:42 2021 -0400 @@ -203,9 +203,9 @@ { std::string retval; - size_t len = s.length (); - - size_t i = 0; + std::size_t len = s.length (); + + std::size_t i = 0; while (i < len) { @@ -301,7 +301,7 @@ // the list is 3 because of the characters that appear after the // last conversion. - size_t length (void) const { return fmt_elts.size (); } + std::size_t length (void) const { return fmt_elts.size (); } const scanf_format_elt * first (void) { @@ -349,7 +349,7 @@ octave_idx_type nconv; // Index to current element; - size_t curr_idx; + std::size_t curr_idx; // List of format elements. std::deque fmt_elts; @@ -360,11 +360,11 @@ void add_elt_to_list (int width, bool discard, char type, char modifier, const std::string& char_class = ""); - void process_conversion (const std::string& s, size_t& i, size_t n, + void process_conversion (const std::string& s, std::size_t& i, std::size_t n, int& width, bool& discard, char& type, char& modifier); - int finish_conversion (const std::string& s, size_t& i, size_t n, + int finish_conversion (const std::string& s, std::size_t& i, std::size_t n, int width, bool discard, char& type, char modifier); }; @@ -372,9 +372,9 @@ scanf_format_list::scanf_format_list (const std::string& s) : nconv (0), curr_idx (0), fmt_elts (), buf () { - size_t n = s.length (); - - size_t i = 0; + std::size_t n = s.length (); + + std::size_t i = 0; int width = 0; bool discard = false; @@ -443,9 +443,9 @@ scanf_format_list::~scanf_format_list (void) { - size_t n = fmt_elts.size (); - - for (size_t i = 0; i < n; i++) + std::size_t n = fmt_elts.size (); + + for (std::size_t i = 0; i < n; i++) { scanf_format_elt *elt = fmt_elts[i]; delete elt; @@ -473,8 +473,8 @@ } void - scanf_format_list::process_conversion (const std::string& s, size_t& i, - size_t n, int& width, bool& discard, + scanf_format_list::process_conversion (const std::string& s, std::size_t& i, + std::size_t n, int& width, bool& discard, char& type, char& modifier) { width = 0; @@ -580,16 +580,16 @@ } int - scanf_format_list::finish_conversion (const std::string& s, size_t& i, - size_t n, int width, bool discard, + scanf_format_list::finish_conversion (const std::string& s, std::size_t& i, + std::size_t n, int width, bool discard, char& type, char modifier) { int retval = 0; std::string char_class; - size_t beg_idx = std::string::npos; - size_t end_idx = std::string::npos; + std::size_t beg_idx = std::string::npos; + std::size_t end_idx = std::string::npos; if (s[i] == '%') { @@ -658,9 +658,9 @@ void scanf_format_list::printme (void) const { - size_t n = fmt_elts.size (); - - for (size_t i = 0; i < n; i++) + std::size_t n = fmt_elts.size (); + + for (std::size_t i = 0; i < n; i++) { scanf_format_elt *elt = fmt_elts[i]; @@ -686,11 +686,11 @@ bool scanf_format_list::all_character_conversions (void) { - size_t n = fmt_elts.size (); + std::size_t n = fmt_elts.size (); if (n > 0) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) { scanf_format_elt *elt = fmt_elts[i]; @@ -716,11 +716,11 @@ bool scanf_format_list::all_numeric_conversions (void) { - size_t n = fmt_elts.size (); + std::size_t n = fmt_elts.size (); if (n > 0) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) { scanf_format_elt *elt = fmt_elts[i]; @@ -811,7 +811,7 @@ return length () > 0 ? fmt_elts[curr_idx] : nullptr; } - size_t length (void) const { return fmt_elts.size (); } + std::size_t length (void) const { return fmt_elts.size (); } const printf_format_elt * next (bool cycle = true) { @@ -843,7 +843,7 @@ octave_idx_type nconv; // Index to current element; - size_t curr_idx; + std::size_t curr_idx; // List of format elements. std::deque fmt_elts; @@ -854,11 +854,11 @@ void add_elt_to_list (int args, const std::string& flags, int fw, int prec, char type, char modifier); - void process_conversion (const std::string& s, size_t& i, size_t n, + void process_conversion (const std::string& s, std::size_t& i, std::size_t n, int& args, std::string& flags, int& fw, int& prec, char& modifier, char& type); - void finish_conversion (const std::string& s, size_t& i, int args, + void finish_conversion (const std::string& s, std::size_t& i, int args, const std::string& flags, int fw, int prec, char modifier, char& type); }; @@ -866,9 +866,9 @@ printf_format_list::printf_format_list (const std::string& s) : nconv (0), curr_idx (0), fmt_elts (), buf () { - size_t n = s.length (); - - size_t i = 0; + std::size_t n = s.length (); + + std::size_t i = 0; int args = 0; std::string flags; @@ -947,9 +947,9 @@ printf_format_list::~printf_format_list (void) { - size_t n = fmt_elts.size (); - - for (size_t i = 0; i < n; i++) + std::size_t n = fmt_elts.size (); + + for (std::size_t i = 0; i < n; i++) { printf_format_elt *elt = fmt_elts[i]; delete elt; @@ -977,8 +977,8 @@ } void - printf_format_list::process_conversion (const std::string& s, size_t& i, - size_t n, int& args, + printf_format_list::process_conversion (const std::string& s, std::size_t& i, + std::size_t n, int& args, std::string& flags, int& fw, int& prec, char& modifier, char& type) @@ -1092,7 +1092,7 @@ } void - printf_format_list::finish_conversion (const std::string& s, size_t& i, + printf_format_list::finish_conversion (const std::string& s, std::size_t& i, int args, const std::string& flags, int fw, int prec, char modifier, char& type) @@ -1149,9 +1149,9 @@ void printf_format_list::printme (void) const { - size_t n = fmt_elts.size (); - - for (size_t i = 0; i < n; i++) + std::size_t n = fmt_elts.size (); + + for (std::size_t i = 0; i < n; i++) { printf_format_elt *elt = fmt_elts[i]; @@ -1443,7 +1443,7 @@ if (eob < idx) idx = eob; - size_t old_remaining = eob - idx; + std::size_t old_remaining = eob - idx; octave_quit (); // allow ctrl-C @@ -1695,7 +1695,7 @@ // the list is 3 because of the characters that appear after the // last conversion. - size_t numel (void) const { return fmt_elts.size (); } + std::size_t numel (void) const { return fmt_elts.size (); } const textscan_format_elt * first (void) { @@ -1749,7 +1749,7 @@ octave_idx_type nconv; // Index to current element; - size_t curr_idx; + std::size_t curr_idx; // List of format elements. std::deque fmt_elts; @@ -1765,11 +1765,11 @@ char type, const std::string& char_class = std::string ()); - void process_conversion (const std::string& s, size_t& i, size_t n); + void process_conversion (const std::string& s, std::size_t& i, std::size_t n); std::string parse_char_class (const std::string& pattern) const; - int finish_conversion (const std::string& s, size_t& i, size_t n, + int finish_conversion (const std::string& s, std::size_t& i, std::size_t n, unsigned int width, int prec, int bitwidth, octave_value& val_type, bool discard, char& type); @@ -1935,9 +1935,9 @@ : who (who_arg), set_from_first (false), has_string (false), nconv (0), curr_idx (0), fmt_elts (), buf () { - size_t n = s.length (); - - size_t i = 0; + std::size_t n = s.length (); + + std::size_t i = 0; unsigned int width = -1; // Unspecified width = max (except %c) int prec = -1; @@ -2032,9 +2032,9 @@ textscan_format_list::~textscan_format_list (void) { - size_t n = numel (); - - for (size_t i = 0; i < n; i++) + std::size_t n = numel (); + + for (std::size_t i = 0; i < n; i++) { textscan_format_elt *elt = fmt_elts[i]; delete elt; @@ -2066,8 +2066,8 @@ } void - textscan_format_list::process_conversion (const std::string& s, size_t& i, - size_t n) + textscan_format_list::process_conversion (const std::string& s, std::size_t& i, + std::size_t n) { unsigned width = 0; int prec = -1; @@ -2349,8 +2349,8 @@ } int - textscan_format_list::finish_conversion (const std::string& s, size_t& i, - size_t n, unsigned int width, + textscan_format_list::finish_conversion (const std::string& s, std::size_t& i, + std::size_t n, unsigned int width, int prec, int bitwidth, octave_value& val_type, bool discard, char& type) @@ -2359,8 +2359,8 @@ std::string char_class; - size_t beg_idx = std::string::npos; - size_t end_idx = std::string::npos; + std::size_t beg_idx = std::string::npos; + std::size_t end_idx = std::string::npos; if (type != '%') { @@ -2418,9 +2418,9 @@ void textscan_format_list::printme (void) const { - size_t n = numel (); - - for (size_t i = 0; i < n; i++) + std::size_t n = numel (); + + for (std::size_t i = 0; i < n; i++) { textscan_format_elt *elt = fmt_elts[i]; @@ -3101,7 +3101,7 @@ for (int i = 0; i < delimiters.numel (); i++) { std::string delim = delimiters(i).string_value (); - size_t start = (retval.length () > delim.length () + std::size_t start = (retval.length () > delim.length () ? retval.length () - delim.length () : 0); std::string may_match = retval.substr (start); @@ -3139,7 +3139,7 @@ // Grow string in an exponential fashion if necessary. if (i >= val.length ()) val.append (std::max (val.length (), - static_cast (16)), '\0'); + static_cast (16)), '\0'); int ch = is.get (); if (is_delim (ch) || ch == std::istream::traits_type::eof ()) @@ -3432,7 +3432,7 @@ octave_quit (); - for (size_t i = 0; i < fmt_list.numel (); i++) + for (std::size_t i = 0; i < fmt_list.numel (); i++) { bool this_conversion_failed = false; @@ -3825,7 +3825,7 @@ may_match = may_match + dummy + last; if (may_match.length () > end_c.length ()) { - size_t start = may_match.length () - end_c.length (); + std::size_t start = may_match.length () - end_c.length (); may_match = may_match.substr (start); } } @@ -3869,7 +3869,7 @@ // FIXME: pos may be corrupted by is.read int i; - int (*compare)(const char *, const char *, size_t); + int (*compare)(const char *, const char *, std::size_t); compare = (case_sensitive ? strncmp : strncasecmp); for (i = 0; i < targets.numel (); i++) @@ -5635,7 +5635,7 @@ return retval; } - static size_t + static std::size_t do_printf_string (std::ostream& os, const printf_format_elt *elt, int nsa, int sa_1, int sa_2, const std::string& arg, const std::string& encoding, const std::string& who) @@ -5647,19 +5647,19 @@ bool left = flags.find ('-') != std::string::npos; - size_t len = arg.length (); - - size_t prec = (nsa > 1 ? sa_2 : (elt->prec == -1 ? len : elt->prec)); + std::size_t len = arg.length (); + + std::size_t prec = (nsa > 1 ? sa_2 : (elt->prec == -1 ? len : elt->prec)); std::string print_str = prec < arg.length () ? arg.substr (0, prec) : arg; if (encoding.compare ("utf-8")) { - size_t src_len = print_str.length (); + std::size_t src_len = print_str.length (); print_str = string::u8_to_encoding (who, print_str, encoding); len -= src_len - print_str.length (); } - size_t fw = (nsa > 0 ? sa_1 : (elt->fw == -1 ? len : elt->fw)); + std::size_t fw = (nsa > 0 ? sa_1 : (elt->fw == -1 ? len : elt->fw)); os << std::setw (fw) << (left ? std::left : std::right) << print_str; @@ -6600,9 +6600,9 @@ // oct_data_conv class. // Expose this in a future version? - size_t char_count = 0; - - ptrdiff_t tmp_count = 0; + std::size_t char_count = 0; + + std::ptrdiff_t tmp_count = 0; try { @@ -6661,8 +6661,8 @@ octave_idx_type input_elt_size = oct_data_conv::data_type_size (input_type); - ptrdiff_t input_buf_size - = static_cast (input_buf_elts) * input_elt_size; + std::ptrdiff_t input_buf_size + = static_cast (input_buf_elts) * input_elt_size; assert (input_buf_size >= 0); @@ -6703,7 +6703,7 @@ is.read (input_buf, input_buf_size); - size_t gcount = is.gcount (); + std::size_t gcount = is.gcount (); char_count += gcount; cur_pos += gcount; @@ -6947,7 +6947,7 @@ } bool - stream::write_bytes (const void *data, size_t nbytes) + stream::write_bytes (const void *data, std::size_t nbytes) { bool status = false; @@ -6970,7 +6970,7 @@ } bool - stream::skip_bytes (size_t skip) + stream::skip_bytes (std::size_t skip) { bool status = false; @@ -6992,7 +6992,7 @@ // Is it possible for this to fail to return us to the original position? seek (orig_pos, SEEK_SET); - size_t remaining = eof_pos - orig_pos; + std::size_t remaining = eof_pos - orig_pos; if (remaining < skip) { @@ -7000,7 +7000,7 @@ // FIXME: probably should try to write larger blocks... unsigned char zero = 0; - for (size_t j = 0; j < skip - remaining; j++) + for (std::size_t j = 0; j < skip - remaining; j++) os.write (reinterpret_cast (&zero), 1); } else @@ -7061,7 +7061,7 @@ if (do_data_conversion) { - size_t output_size + std::size_t output_size = chunk_size * oct_data_conv::data_type_size (output_type); OCTAVE_LOCAL_BUFFER (unsigned char, conv_data, output_size); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/oct-stream.h --- a/libinterp/corefcn/oct-stream.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/oct-stream.h Wed Apr 28 22:57:42 2021 -0400 @@ -301,9 +301,9 @@ octave_idx_type skip, mach_info::float_format flt_fmt); - bool write_bytes (const void *data, size_t n_elts); + bool write_bytes (const void *data, std::size_t n_elts); - bool skip_bytes (size_t n_elts); + bool skip_bytes (std::size_t n_elts); template octave_idx_type write (const Array& data, octave_idx_type block_size, diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/pager.cc --- a/libinterp/corefcn/pager.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/pager.cc Wed Apr 28 22:57:42 2021 -0400 @@ -148,7 +148,7 @@ { char *buf = pbase () + diary_skip; - size_t len = pptr () - buf; + std::size_t len = pptr () - buf; octave_diary.write (buf, len); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/pager.h --- a/libinterp/corefcn/pager.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/pager.h Wed Apr 28 22:57:42 2021 -0400 @@ -59,7 +59,7 @@ private: - size_t diary_skip; + std::size_t diary_skip; }; class diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/pr-output.cc --- a/libinterp/corefcn/pr-output.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/pr-output.cc Wed Apr 28 22:57:42 2021 -0400 @@ -1425,7 +1425,7 @@ if (hex_format > 1 || flt_fmt == octave::mach_info::flt_fmt_ieee_big_endian) { - for (size_t i = 0; i < sizeof (T); i++) + for (std::size_t i = 0; i < sizeof (T); i++) os << std::setw (2) << static_cast (tmp.i[i]); } else @@ -1444,14 +1444,14 @@ if (flt_fmt == octave::mach_info::flt_fmt_ieee_big_endian) { - for (size_t i = 0; i < sizeof (T); i++) + for (std::size_t i = 0; i < sizeof (T); i++) PRINT_CHAR_BITS (os, tmp.i[i]); } else { if (bit_format > 1) { - for (size_t i = 0; i < sizeof (T); i++) + for (std::size_t i = 0; i < sizeof (T); i++) PRINT_CHAR_BITS_SWAPPED (os, tmp.i[i]); } else @@ -2812,7 +2812,7 @@ static inline void pr_int (std::ostream& os, const T& d, int fw = 0) { - size_t sz = d.byte_size (); + std::size_t sz = d.byte_size (); const unsigned char *tmpi = d.iptr (); // Unless explicitly asked for, always print in big-endian @@ -2833,7 +2833,7 @@ if (hex_format > 1 || octave::mach_info::words_big_endian ()) { - for (size_t i = 0; i < sz; i++) + for (std::size_t i = 0; i < sz; i++) os << std::setw (2) << static_cast (tmpi[i]); } else @@ -2846,14 +2846,14 @@ { if (octave::mach_info::words_big_endian ()) { - for (size_t i = 0; i < sz; i++) + for (std::size_t i = 0; i < sz; i++) PRINT_CHAR_BITS (os, tmpi[i]); } else { if (bit_format > 1) { - for (size_t i = 0; i < sz; i++) + for (std::size_t i = 0; i < sz; i++) PRINT_CHAR_BITS_SWAPPED (os, tmpi[i]); } else @@ -3264,12 +3264,12 @@ std::list lst; - size_t n = 0; - size_t s_len = s.length (); + std::size_t n = 0; + std::size_t s_len = s.length (); while (n < s_len) { - size_t m = s.find ('\n', n); + std::size_t m = s.find ('\n', n); if (m == std::string::npos) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/regexp.cc --- a/libinterp/corefcn/regexp.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/regexp.cc Wed Apr 28 22:57:42 2021 -0400 @@ -56,9 +56,9 @@ { std::string retval; - size_t i = 0; - size_t j = 0; - size_t len = s.length (); + std::size_t i = 0; + std::size_t j = 0; + std::size_t len = s.length (); retval.resize (len+i); @@ -98,7 +98,7 @@ } int tmpi = 0; - size_t k; + std::size_t k; for (k = j; k < std::min (j+3+brace, len); k++) { int digit = s[k] - '0'; @@ -142,9 +142,9 @@ { std::string retval; - size_t i = 0; - size_t j = 0; - size_t len = s.length (); + std::size_t i = 0; + std::size_t j = 0; + std::size_t len = s.length (); retval.resize (len); @@ -191,7 +191,7 @@ case '6': case '7': // octal input { - size_t k; + std::size_t k; int tmpi = s[j] - '0'; for (k = j+1; k < std::min (j+3, len); k++) { @@ -218,7 +218,7 @@ } int tmpi = 0; - size_t k; + std::size_t k; for (k = j; k < std::min (j+3+brace, len); k++) { int digit = s[k] - '0'; @@ -249,7 +249,7 @@ } int tmpi = 0; - size_t k; + std::size_t k; for (k = j; k < std::min (j+2+brace, len); k++) { if (! isxdigit (s[k])) @@ -380,7 +380,7 @@ string_vector named_pats = rx_lst.named_patterns (); - size_t sz = rx_lst.size (); + std::size_t sz = rx_lst.size (); // Converted the linked list in the correct form for the return values @@ -443,7 +443,7 @@ NDArray end (dim_vector (1, sz)); NDArray start (dim_vector (1, sz)); Cell split (dim_vector (1, sz+1)); - size_t sp_start = 0; + std::size_t sp_start = 0; octave_idx_type i = 0; for (const auto& match_data : rx_lst) diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/settings.h --- a/libinterp/corefcn/settings.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/settings.h Wed Apr 28 22:57:42 2021 -0400 @@ -65,7 +65,7 @@ } // Read only. - size_t token_count (void) const { return m_token_count; } + std::size_t token_count (void) const { return m_token_count; } void increment_token_count (void) { ++m_token_count; } @@ -86,7 +86,7 @@ bool m_display_tokens = false; // Number of tokens processed since interpreter startup. - size_t m_token_count = 0; + std::size_t m_token_count = 0; // Internal variable for lexer debugging state. bool m_lexer_debug_flag = false; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/stack-frame.cc --- a/libinterp/corefcn/stack-frame.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/stack-frame.cc Wed Apr 28 22:57:42 2021 -0400 @@ -56,7 +56,7 @@ compiled_fcn_stack_frame (void) = delete; compiled_fcn_stack_frame (tree_evaluator& tw, octave_function *fcn, - size_t index, + std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link) : stack_frame (tw, index, parent_link, static_link, @@ -177,7 +177,7 @@ script_stack_frame (void) = delete; script_stack_frame (tree_evaluator& tw, octave_user_script *script, - size_t index, + std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link); @@ -195,7 +195,7 @@ static std::shared_ptr get_access_link (const std::shared_ptr& static_link); - static size_t get_num_symbols (octave_user_script *script); + static std::size_t get_num_symbols (octave_user_script *script); void set_script_offsets (void); @@ -214,24 +214,24 @@ symbol_record insert_symbol (const std::string&); - size_t size (void) const { return m_lexical_frame_offsets.size (); } - - void resize (size_t size) + std::size_t size (void) const { return m_lexical_frame_offsets.size (); } + + void resize (std::size_t size) { m_lexical_frame_offsets.resize (size, 0); m_value_offsets.resize (size, 0); } void get_val_offsets_with_insert (const symbol_record& sym, - size_t& frame_offset, - size_t& data_offset); + std::size_t& frame_offset, + std::size_t& data_offset); bool get_val_offsets_internal (const symbol_record& sym, - size_t& frame_offset, - size_t& data_offset) const; - - bool get_val_offsets (const symbol_record& sym, size_t& frame_offset, - size_t& data_offset) const; + std::size_t& frame_offset, + std::size_t& data_offset) const; + + bool get_val_offsets (const symbol_record& sym, std::size_t& frame_offset, + std::size_t& data_offset) const; scope_flags scope_flag (const symbol_record& sym) const; @@ -276,8 +276,8 @@ // frame offsets may be greater than one if the script is executed // in a nested function context. - std::vector m_lexical_frame_offsets; - std::vector m_value_offsets; + std::vector m_lexical_frame_offsets; + std::vector m_value_offsets; }; // Base class for values and offsets shared by user_fcn and scope @@ -289,8 +289,8 @@ base_value_stack_frame (void) = delete; - base_value_stack_frame (tree_evaluator& tw, size_t num_symbols, - size_t index, + base_value_stack_frame (tree_evaluator& tw, std::size_t num_symbols, + std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link, const std::shared_ptr& access_link) @@ -307,23 +307,23 @@ ~base_value_stack_frame (void) = default; - size_t size (void) const + std::size_t size (void) const { return m_values.size (); } - void resize (size_t size) + void resize (std::size_t size) { m_values.resize (size, octave_value ()); m_flags.resize (size, LOCAL); } - stack_frame::scope_flags get_scope_flag (size_t data_offset) const + stack_frame::scope_flags get_scope_flag (std::size_t data_offset) const { return m_flags.at (data_offset); } - void set_scope_flag (size_t data_offset, scope_flags flag) + void set_scope_flag (std::size_t data_offset, scope_flags flag) { m_flags.at (data_offset) = flag; } @@ -344,12 +344,12 @@ using stack_frame::varval; using stack_frame::varref; - octave_value varval (size_t data_offset) const + octave_value varval (std::size_t data_offset) const { return m_values.at (data_offset); } - octave_value& varref (size_t data_offset) + octave_value& varref (std::size_t data_offset) { return m_values.at (data_offset); } @@ -396,7 +396,7 @@ user_fcn_stack_frame (void) = delete; user_fcn_stack_frame (tree_evaluator& tw, octave_user_function *fcn, - size_t index, + std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link, const std::shared_ptr& access_link = std::shared_ptr ()) @@ -409,7 +409,7 @@ { } user_fcn_stack_frame (tree_evaluator& tw, octave_user_function *fcn, - size_t index, + std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link, const local_vars_map& local_vars, @@ -443,7 +443,7 @@ get_access_link (octave_user_function *fcn, const std::shared_ptr& static_link); - static size_t get_num_symbols (octave_user_function *fcn) + static std::size_t get_num_symbols (octave_user_function *fcn) { symbol_scope fcn_scope = fcn->scope (); @@ -507,7 +507,7 @@ scope_stack_frame (void) = delete; scope_stack_frame (tree_evaluator& tw, const symbol_scope& scope, - size_t index, + std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link) : base_value_stack_frame (tw, scope.num_symbols (), index, @@ -852,11 +852,11 @@ // FIXME: is there a better way to concatenate structures? - size_t n_frames = m_sym_inf_list.size (); + std::size_t n_frames = m_sym_inf_list.size (); OCTAVE_LOCAL_BUFFER (octave_map, map_list, n_frames); - size_t j = 0; + std::size_t j = 0; for (const auto& nm_sil : m_sym_inf_list) { std::string scope_name = nm_sil.first; @@ -1037,7 +1037,7 @@ }; stack_frame * stack_frame::create (tree_evaluator& tw, octave_function *fcn, - size_t index, + std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link) { @@ -1046,7 +1046,7 @@ stack_frame * stack_frame::create (tree_evaluator& tw, octave_user_script *script, - size_t index, + std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link) { @@ -1054,7 +1054,7 @@ } stack_frame * stack_frame::create (tree_evaluator& tw, - octave_user_function *fcn, size_t index, + octave_user_function *fcn, std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link, const std::shared_ptr& access_link) @@ -1063,7 +1063,7 @@ } stack_frame * stack_frame::create (tree_evaluator& tw, - octave_user_function *fcn, size_t index, + octave_user_function *fcn, std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link, const local_vars_map& local_vars, @@ -1073,7 +1073,7 @@ } stack_frame * stack_frame::create (tree_evaluator& tw, - const symbol_scope& scope, size_t index, + const symbol_scope& scope, std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link) { @@ -1236,7 +1236,7 @@ return sia.symbol_info (); } - size_t stack_frame::size (void) const + std::size_t stack_frame::size (void) const { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1245,7 +1245,7 @@ panic_impossible (); } - void stack_frame::resize (size_t) + void stack_frame::resize (std::size_t) { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1254,7 +1254,7 @@ panic_impossible (); } - stack_frame::scope_flags stack_frame::get_scope_flag (size_t) const + stack_frame::scope_flags stack_frame::get_scope_flag (std::size_t) const { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1263,7 +1263,7 @@ panic_impossible (); } - void stack_frame::set_scope_flag (size_t, scope_flags) + void stack_frame::set_scope_flag (std::size_t, scope_flags) { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1318,7 +1318,7 @@ assign (sym, value); } - octave_value stack_frame::varval (size_t) const + octave_value stack_frame::varval (std::size_t) const { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1327,7 +1327,7 @@ panic_impossible (); } - octave_value& stack_frame::varref (size_t) + octave_value& stack_frame::varref (std::size_t) { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1466,7 +1466,7 @@ script_stack_frame::script_stack_frame (tree_evaluator& tw, octave_user_script *script, - size_t index, + std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link) : stack_frame (tw, index, parent_link, static_link, @@ -1478,7 +1478,7 @@ set_script_offsets (); } - size_t script_stack_frame::get_num_symbols (octave_user_script *script) + std::size_t script_stack_frame::get_num_symbols (octave_user_script *script) { symbol_scope script_scope = script->scope (); @@ -1492,7 +1492,7 @@ symbol_scope script_scope = m_script->scope (); - size_t num_script_symbols = script_scope.num_symbols (); + std::size_t num_script_symbols = script_scope.num_symbols (); resize (num_script_symbols); @@ -1521,7 +1521,7 @@ symbol_scope parent_scope = eval_scope; - size_t count = 1; + std::size_t count = 1; while (parent_scope) { @@ -1535,7 +1535,7 @@ found = true; symbol_record parent_scope_sr = p->second; - size_t script_sr_data_offset = script_sr.data_offset (); + std::size_t script_sr_data_offset = script_sr.data_offset (); m_lexical_frame_offsets.at (script_sr_data_offset) = parent_scope_sr.frame_offset () + count; @@ -1576,7 +1576,7 @@ else eval_scope_sr = p->second; - size_t script_sr_data_offset = script_sr.data_offset (); + std::size_t script_sr_data_offset = script_sr.data_offset (); // The +1 is for going from the script frame to the eval // frame. Only one access_link should need to be followed. @@ -1592,7 +1592,7 @@ void script_stack_frame::resize_and_update_script_offsets (const symbol_record& sym) { - size_t data_offset = sym.data_offset (); + std::size_t data_offset = sym.data_offset (); // This function is called when adding new symbols to a script // scope. If the symbol wasn't present before, it should be outside @@ -1701,8 +1701,8 @@ bool script_stack_frame::get_val_offsets_internal (const symbol_record& script_sr, - size_t& frame_offset, - size_t& data_offset) const + std::size_t& frame_offset, + std::size_t& data_offset) const { bool found = false; @@ -1717,7 +1717,7 @@ symbol_scope parent_scope = eval_scope; - size_t count = 1; + std::size_t count = 1; while (parent_scope) { @@ -1773,8 +1773,8 @@ } bool script_stack_frame::get_val_offsets (const symbol_record& sym, - size_t& frame_offset, - size_t& data_offset) const + std::size_t& frame_offset, + std::size_t& data_offset) const { data_offset = sym.data_offset (); frame_offset = sym.frame_offset (); @@ -1822,8 +1822,8 @@ } void script_stack_frame::get_val_offsets_with_insert (const symbol_record& sym, - size_t& frame_offset, - size_t& data_offset) + std::size_t& frame_offset, + std::size_t& data_offset) { data_offset = sym.data_offset (); frame_offset = sym.frame_offset (); @@ -1880,8 +1880,8 @@ stack_frame::scope_flags script_stack_frame::scope_flag (const symbol_record& sym) const { - size_t frame_offset; - size_t data_offset; + std::size_t frame_offset; + std::size_t data_offset; bool found = get_val_offsets (sym, frame_offset, data_offset); @@ -1894,7 +1894,7 @@ const stack_frame *frame = this; - for (size_t i = 0; i < frame_offset; i++) + for (std::size_t i = 0; i < frame_offset; i++) { std::shared_ptr nxt = frame->access_link (); frame = nxt.get (); @@ -1911,8 +1911,8 @@ octave_value script_stack_frame::varval (const symbol_record& sym) const { - size_t frame_offset; - size_t data_offset; + std::size_t frame_offset; + std::size_t data_offset; bool found = get_val_offsets (sym, frame_offset, data_offset); @@ -1924,7 +1924,7 @@ const stack_frame *frame = this; - for (size_t i = 0; i < frame_offset; i++) + for (std::size_t i = 0; i < frame_offset; i++) { std::shared_ptr nxt = frame->access_link (); frame = nxt.get (); @@ -1957,8 +1957,8 @@ octave_value& script_stack_frame::varref (const symbol_record& sym) { - size_t frame_offset; - size_t data_offset; + std::size_t frame_offset; + std::size_t data_offset; get_val_offsets_with_insert (sym, frame_offset, data_offset); // Follow frame_offset access links to stack frame that holds @@ -1966,7 +1966,7 @@ stack_frame *frame = this; - for (size_t i = 0; i < frame_offset; i++) + for (std::size_t i = 0; i < frame_offset; i++) { std::shared_ptr nxt = frame->access_link (); frame = nxt.get (); @@ -1997,14 +1997,14 @@ void script_stack_frame::mark_scope (const symbol_record& sym, scope_flags flag) { - size_t data_offset = sym.data_offset (); + std::size_t data_offset = sym.data_offset (); if (data_offset >= size ()) resize_and_update_script_offsets (sym); // Redirection to evaluation context for the script. - size_t frame_offset = m_lexical_frame_offsets.at (data_offset); + std::size_t frame_offset = m_lexical_frame_offsets.at (data_offset); data_offset = m_value_offsets.at (data_offset); if (frame_offset > 1) @@ -2031,12 +2031,12 @@ os << "lexical_offsets: " << m_lexical_frame_offsets.size () << " elements:"; - for (size_t i = 0; i < m_lexical_frame_offsets.size (); i++) + for (std::size_t i = 0; i < m_lexical_frame_offsets.size (); i++) os << " " << m_lexical_frame_offsets.at (i); os << std::endl; os << "value_offsets: " << m_value_offsets.size () << " elements:"; - for (size_t i = 0; i < m_value_offsets.size (); i++) + for (std::size_t i = 0; i < m_value_offsets.size (); i++) os << " " << m_value_offsets.at (i); os << std::endl; @@ -2058,7 +2058,7 @@ os << "values: " << m_values.size () << " elements (idx, scope flag, type):" << std::endl; - for (size_t i = 0; i < m_values.size (); i++) + for (std::size_t i = 0; i < m_values.size (); i++) { os << " (" << i << ", " << m_flags.at (i) << ", "; @@ -2131,12 +2131,12 @@ for (const auto& sym : symbols) { - size_t frame_offset = sym.frame_offset (); + std::size_t frame_offset = sym.frame_offset (); if (frame_offset > 0) continue; - size_t data_offset = sym.data_offset (); + std::size_t data_offset = sym.data_offset (); if (data_offset >= size ()) continue; @@ -2223,15 +2223,15 @@ stack_frame::scope_flags user_fcn_stack_frame::scope_flag (const symbol_record& sym) const { - size_t frame_offset = sym.frame_offset (); - size_t data_offset = sym.data_offset (); + std::size_t frame_offset = sym.frame_offset (); + std::size_t data_offset = sym.data_offset (); // Follow frame_offset access links to stack frame that holds // the value. const stack_frame *frame = this; - for (size_t i = 0; i < frame_offset; i++) + for (std::size_t i = 0; i < frame_offset; i++) { std::shared_ptr nxt = frame->access_link (); frame = nxt.get (); @@ -2248,15 +2248,15 @@ octave_value user_fcn_stack_frame::varval (const symbol_record& sym) const { - size_t frame_offset = sym.frame_offset (); - size_t data_offset = sym.data_offset (); + std::size_t frame_offset = sym.frame_offset (); + std::size_t data_offset = sym.data_offset (); // Follow frame_offset access links to stack frame that holds // the value. const stack_frame *frame = this; - for (size_t i = 0; i < frame_offset; i++) + for (std::size_t i = 0; i < frame_offset; i++) { std::shared_ptr nxt = frame->access_link (); frame = nxt.get (); @@ -2289,15 +2289,15 @@ octave_value& user_fcn_stack_frame::varref (const symbol_record& sym) { - size_t frame_offset = sym.frame_offset (); - size_t data_offset = sym.data_offset (); + std::size_t frame_offset = sym.frame_offset (); + std::size_t data_offset = sym.data_offset (); // Follow frame_offset access links to stack frame that holds // the value. stack_frame *frame = this; - for (size_t i = 0; i < frame_offset; i++) + for (std::size_t i = 0; i < frame_offset; i++) { std::shared_ptr nxt = frame->access_link (); frame = nxt.get (); @@ -2327,12 +2327,12 @@ void user_fcn_stack_frame::mark_scope (const symbol_record& sym, scope_flags flag) { - size_t frame_offset = sym.frame_offset (); + std::size_t frame_offset = sym.frame_offset (); if (frame_offset > 0 && (flag == PERSISTENT || flag == GLOBAL)) error ("variables must be made PERSISTENT or GLOBAL in the first scope in which they are used"); - size_t data_offset = sym.data_offset (); + std::size_t data_offset = sym.data_offset (); if (data_offset >= size ()) resize (data_offset+1); @@ -2393,7 +2393,7 @@ // There is no access link for scope frames, so the frame // offset must be zero. - size_t data_offset = sym.data_offset (); + std::size_t data_offset = sym.data_offset (); if (data_offset >= size ()) return LOCAL; @@ -2406,7 +2406,7 @@ // There is no access link for scope frames, so the frame // offset must be zero. - size_t data_offset = sym.data_offset (); + std::size_t data_offset = sym.data_offset (); if (data_offset >= size ()) return octave_value (); @@ -2431,7 +2431,7 @@ // There is no access link for scope frames, so the frame // offset must be zero. - size_t data_offset = sym.data_offset (); + std::size_t data_offset = sym.data_offset (); if (data_offset >= size ()) resize (data_offset+1); @@ -2457,7 +2457,7 @@ // There is no access link for scope frames, so the frame // offset must be zero. - size_t data_offset = sym.data_offset (); + std::size_t data_offset = sym.data_offset (); if (data_offset >= size ()) resize (data_offset+1); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/stack-frame.h --- a/libinterp/corefcn/stack-frame.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/stack-frame.h Wed Apr 28 22:57:42 2021 -0400 @@ -139,7 +139,7 @@ stack_frame (void) = delete; - stack_frame (tree_evaluator& tw, size_t index, + stack_frame (tree_evaluator& tw, std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link, const std::shared_ptr& access_link) @@ -151,26 +151,26 @@ // Compiled function. static stack_frame * - create (tree_evaluator& tw, octave_function *fcn, size_t index, + create (tree_evaluator& tw, octave_function *fcn, std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link); // Script. static stack_frame * - create (tree_evaluator& tw, octave_user_script *script, size_t index, + create (tree_evaluator& tw, octave_user_script *script, std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link); // User-defined function. static stack_frame * - create (tree_evaluator& tw, octave_user_function *fcn, size_t index, + create (tree_evaluator& tw, octave_user_function *fcn, std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link, const std::shared_ptr& access_link = std::shared_ptr ()); // Anonymous user-defined function with init vars. static stack_frame * - create (tree_evaluator& tw, octave_user_function *fcn, size_t index, + create (tree_evaluator& tw, octave_user_function *fcn, std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link, const local_vars_map& local_vars, @@ -178,7 +178,7 @@ // Scope. static stack_frame * - create (tree_evaluator& tw, const symbol_scope& scope, size_t index, + create (tree_evaluator& tw, const symbol_scope& scope, std::size_t index, const std::shared_ptr& parent_link, const std::shared_ptr& static_link); @@ -199,7 +199,7 @@ virtual void clear_values (void); - size_t index (void) const { return m_index; } + std::size_t index (void) const { return m_index; } void line (int l) { m_line = l; } int line (void) const { return m_line; } @@ -316,9 +316,9 @@ std::shared_ptr access_link (void) const {return m_access_link; } - virtual size_t size (void) const; + virtual std::size_t size (void) const; - virtual void resize (size_t); + virtual void resize (std::size_t); void mark_global (const symbol_record& sym) { @@ -384,9 +384,9 @@ virtual scope_flags scope_flag (const symbol_record&) const = 0; - virtual scope_flags get_scope_flag (size_t) const; + virtual scope_flags get_scope_flag (std::size_t) const; - virtual void set_scope_flag (size_t, scope_flags); + virtual void set_scope_flag (std::size_t, scope_flags); bool is_global (const symbol_record& sym) const { @@ -429,7 +429,7 @@ virtual octave_value varval (const symbol_record& sym) const = 0;; - virtual octave_value varval (size_t data_offset) const; + virtual octave_value varval (std::size_t data_offset) const; octave_value varval (const std::string& name) const { @@ -440,7 +440,7 @@ virtual octave_value& varref (const symbol_record& sym) = 0; - virtual octave_value& varref (size_t data_offset); + virtual octave_value& varref (std::size_t data_offset); void assign (const symbol_record& sym, const octave_value& val) { @@ -574,7 +574,7 @@ int m_column; // Index in call stack. - size_t m_index; + std::size_t m_index; // Pointer to the nearest parent frame. May include compiled // functions. diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/strfns.cc --- a/libinterp/corefcn/strfns.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/strfns.cc Wed Apr 28 22:57:42 2021 -0400 @@ -211,26 +211,26 @@ { int nargin = args.length (); int n_elts = 0; - size_t max_len = 0; + std::size_t max_len = 0; std::queue args_as_strings; for (int i = 0; i < nargin; i++) { string_vector s = args(i).xstring_vector_value ("strvcat: unable to convert some args to strings"); - size_t n = s.numel (); + std::size_t n = s.numel (); // do not count empty strings in calculation of number of elements if (n > 0) { - for (size_t j = 0; j < n; j++) + for (std::size_t j = 0; j < n; j++) { if (! s[j].empty ()) n_elts++; } } - size_t s_max_len = s.max_length (); + std::size_t s_max_len = s.max_length (); if (s_max_len > max_len) max_len = s_max_len; @@ -247,16 +247,16 @@ string_vector s = args_as_strings.front (); args_as_strings.pop (); - size_t n = s.numel (); + std::size_t n = s.numel (); if (n > 0) { - for (size_t j = 0; j < n; j++) + for (std::size_t j = 0; j < n; j++) { std::string t = s[j]; if (t.length () > 0) { - size_t t_len = t.length (); + std::size_t t_len = t.length (); if (max_len > t_len) t += std::string (max_len - t_len, ' '); @@ -896,9 +896,9 @@ charNDArray native_bytes = args(0).char_array_value (); const char *src = native_bytes.data (); - size_t srclen = native_bytes.numel (); + std::size_t srclen = native_bytes.numel (); - size_t length; + std::size_t length; uint8_t *utf8_str = nullptr; octave::unwind_protect frame; @@ -948,9 +948,9 @@ charNDArray utf8_str = args(0).char_array_value (); const uint8_t *src = reinterpret_cast (utf8_str.data ()); - size_t srclen = utf8_str.numel (); + std::size_t srclen = utf8_str.numel (); - size_t length; + std::size_t length; char *native_bytes = nullptr; octave::unwind_protect frame; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/syminfo.cc --- a/libinterp/corefcn/syminfo.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/syminfo.cc Wed Apr 28 22:57:42 2021 -0400 @@ -190,7 +190,7 @@ symbol_info_list::map_value (const std::string& caller_function_name, int nesting_level) const { - size_t len = m_lst.size (); + std::size_t len = m_lst.size (); Cell name_info (len, 1); Cell size_info (len, 1); @@ -202,7 +202,7 @@ Cell nesting_info (len, 1); Cell persistent_info (len, 1); - size_t j = 0; + std::size_t j = 0; for (const auto& syminfo : m_lst) { @@ -332,8 +332,8 @@ { if (! m_lst.empty ()) { - size_t bytes = 0; - size_t elements = 0; + std::size_t bytes = 0; + std::size_t elements = 0; std::list params = parse_whos_line_format (format); @@ -362,17 +362,17 @@ symbol_info_list::parse_whos_line_format (const std::string& format) const { int idx; - size_t format_len = format.length (); + std::size_t format_len = format.length (); char garbage; std::list params; - size_t bytes1; + std::size_t bytes1; int elements1; std::string param_string = "abcenst"; Array param_length (dim_vector (param_string.length (), 1)); Array param_names (dim_vector (param_string.length (), 1)); - size_t pos_a, pos_b, pos_c, pos_e, pos_n, pos_s, pos_t; + std::size_t pos_a, pos_b, pos_c, pos_e, pos_n, pos_s, pos_t; pos_a = param_string.find ('a'); // Attributes pos_b = param_string.find ('b'); // Bytes @@ -390,7 +390,7 @@ param_names(pos_s) = "Size"; param_names(pos_t) = "Type"; - for (size_t i = 0; i < param_string.length (); i++) + for (std::size_t i = 0; i < param_string.length (); i++) param_length(i) = param_names(i).length (); // The attribute column needs size 5. @@ -406,33 +406,33 @@ str = syminfo.name (); param_length(pos_n) = ((str.length () - > static_cast (param_length(pos_n))) + > static_cast (param_length(pos_n))) ? str.length () : param_length(pos_n)); octave_value val = syminfo.value (); str = val.type_name (); param_length(pos_t) = ((str.length () - > static_cast (param_length(pos_t))) + > static_cast (param_length(pos_t))) ? str.length () : param_length(pos_t)); elements1 = val.numel (); ss1 << elements1; str = ss1.str (); param_length(pos_e) = ((str.length () - > static_cast (param_length(pos_e))) + > static_cast (param_length(pos_e))) ? str.length () : param_length(pos_e)); bytes1 = val.byte_size (); ss2 << bytes1; str = ss2.str (); param_length(pos_b) = ((str.length () - > static_cast (param_length(pos_b))) + > static_cast (param_length(pos_b))) ? str.length () : param_length (pos_b)); } idx = 0; - while (static_cast (idx) < format_len) + while (static_cast (idx) < format_len) { whos_parameter param; param.command = '\0'; @@ -446,7 +446,7 @@ int b = -1; int balance = 1; unsigned int items; - size_t pos; + std::size_t pos; std::string cmd; // Parse one command from format @@ -559,7 +559,7 @@ { // Text string, to be printed as it is ... std::string text; - size_t pos; + std::size_t pos; text = format.substr (idx, format.length ()); pos = text.find ('%'); if (pos != std::string::npos) diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/symrec.h --- a/libinterp/corefcn/symrec.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/symrec.h Wed Apr 28 22:57:42 2021 -0400 @@ -46,7 +46,7 @@ { public: - typedef size_t context_id; + typedef std::size_t context_id; // generic variable static const unsigned int local = 1; @@ -78,13 +78,13 @@ // FIXME: use special storage class instead? bool is_valid (void) const { return ! m_name.empty (); } - void set_frame_offset (size_t offset) { m_frame_offset = offset; } + void set_frame_offset (std::size_t offset) { m_frame_offset = offset; } - size_t frame_offset (void) const { return m_frame_offset; } + std::size_t frame_offset (void) const { return m_frame_offset; } - void set_data_offset (size_t offset) { m_data_offset = offset; } + void set_data_offset (std::size_t offset) { m_data_offset = offset; } - size_t data_offset (void) const { return m_data_offset; } + std::size_t data_offset (void) const { return m_data_offset; } bool is_local (void) const { @@ -143,8 +143,8 @@ private: - size_t m_frame_offset; - size_t m_data_offset; + std::size_t m_frame_offset; + std::size_t m_data_offset; unsigned int m_storage_class; @@ -172,13 +172,13 @@ explicit operator bool () const { return is_valid (); } - void set_frame_offset (size_t offset) { m_rep->set_frame_offset (offset); } + void set_frame_offset (std::size_t offset) { m_rep->set_frame_offset (offset); } - size_t frame_offset (void) const { return m_rep->frame_offset (); } + std::size_t frame_offset (void) const { return m_rep->frame_offset (); } - void set_data_offset (size_t offset) { m_rep->set_data_offset (offset); } + void set_data_offset (std::size_t offset) { m_rep->set_data_offset (offset); } - size_t data_offset (void) const { return m_rep->data_offset (); } + std::size_t data_offset (void) const { return m_rep->data_offset (); } symbol_record dup (void) const { return symbol_record (m_rep->dup ()); } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/symscope.cc --- a/libinterp/corefcn/symscope.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/symscope.cc Wed Apr 28 22:57:42 2021 -0400 @@ -53,7 +53,7 @@ void symbol_scope_rep::insert_symbol_record (symbol_record& sr) { - size_t data_offset = num_symbols (); + std::size_t data_offset = num_symbols (); std::string name = sr.name (); sr.set_data_offset (data_offset); @@ -69,13 +69,13 @@ { symbol_record ret (name); - size_t data_offset = num_symbols (); + std::size_t data_offset = num_symbols (); ret.set_data_offset (data_offset); auto t_parent = m_parent.lock (); - size_t offset = 0; + std::size_t offset = 0; if (is_nested () && t_parent && t_parent->look_nonlocal (name, offset, ret)) @@ -264,7 +264,7 @@ { symbol_record& ours = nm_sr.second; - size_t offset = 0; + std::size_t offset = 0; if (! ours.is_formal () && is_nested ()) t_parent->look_nonlocal (nm_sr.first, offset, ours); @@ -291,7 +291,7 @@ } bool symbol_scope_rep::look_nonlocal (const std::string& name, - size_t offset, symbol_record& result) + std::size_t offset, symbol_record& result) { offset++; @@ -312,8 +312,8 @@ // occurrence because we do the overall nesting update from the // parent function down through the lists of all children. - size_t t_frame_offset = offset + p->second.frame_offset (); - size_t t_data_offset = p->second.data_offset (); + std::size_t t_frame_offset = offset + p->second.frame_offset (); + std::size_t t_data_offset = p->second.data_offset (); result.set_frame_offset (t_frame_offset); result.set_data_offset (t_data_offset); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/symscope.h --- a/libinterp/corefcn/symscope.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/symscope.h Wed Apr 28 22:57:42 2021 -0400 @@ -85,7 +85,7 @@ ~symbol_scope_rep (void) = default; - size_t num_symbols (void) const { return m_symbols.size (); } + std::size_t num_symbols (void) const { return m_symbols.size (); } // Simply inserts symbol. No non-local searching. @@ -95,9 +95,9 @@ bool is_nested (void) const { return m_nesting_depth > 0; } - size_t nesting_depth (void) const { return m_nesting_depth; } + std::size_t nesting_depth (void) const { return m_nesting_depth; } - void set_nesting_depth (size_t depth) { m_nesting_depth = depth; } + void set_nesting_depth (std::size_t depth) { m_nesting_depth = depth; } bool is_parent (void) const { return ! m_children.empty (); } @@ -141,12 +141,12 @@ return new_sid; } - octave_value& persistent_varref (size_t data_offset) + octave_value& persistent_varref (std::size_t data_offset) { return m_persistent_values[data_offset]; } - octave_value persistent_varval (size_t data_offset) const + octave_value persistent_varval (std::size_t data_offset) const { auto p = m_persistent_values.find (data_offset); @@ -294,7 +294,7 @@ void update_nest (void); - bool look_nonlocal (const std::string& name, size_t offset, + bool look_nonlocal (const std::string& name, std::size_t offset, symbol_record& result); octave_value dump_symbols_map (void) const; @@ -327,7 +327,7 @@ std::map m_subfunctions; //! Map from data offset to persistent values in this scope. - std::map m_persistent_values; + std::map m_persistent_values; //! The list of subfunctions (if any) in the order they appear in //! the function file. @@ -369,7 +369,7 @@ //! If true, then this scope belongs to a nested function. - size_t m_nesting_depth; + std::size_t m_nesting_depth; //! If true then no variables can be added. @@ -404,7 +404,7 @@ explicit operator bool () const { return bool (m_rep); } - size_t num_symbols (void) const + std::size_t num_symbols (void) const { return m_rep ? m_rep->num_symbols () : 0; } @@ -430,13 +430,13 @@ return m_rep ? m_rep->is_parent () : false; } - void set_nesting_depth (size_t depth) + void set_nesting_depth (std::size_t depth) { if (m_rep) m_rep->set_nesting_depth (depth); } - size_t nesting_depth (void) const + std::size_t nesting_depth (void) const { return m_rep ? m_rep->nesting_depth () : 0; } @@ -467,14 +467,14 @@ return symbol_scope (m_rep ? m_rep->dup () : nullptr); } - octave_value& persistent_varref (size_t data_offset) + octave_value& persistent_varref (std::size_t data_offset) { static octave_value dummy_value; return m_rep ? m_rep->persistent_varref (data_offset) : dummy_value; } - octave_value persistent_varval (size_t data_offset) const + octave_value persistent_varval (std::size_t data_offset) const { return m_rep ? m_rep->persistent_varval (data_offset) : octave_value (); } @@ -676,7 +676,7 @@ m_rep->update_nest (); } - bool look_nonlocal (const std::string& name, size_t offset, + bool look_nonlocal (const std::string& name, std::size_t offset, symbol_record& result) { return m_rep ? m_rep->look_nonlocal (name, offset, result) : false; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/symtab.cc --- a/libinterp/corefcn/symtab.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/symtab.cc Wed Apr 28 22:57:42 2021 -0400 @@ -254,7 +254,7 @@ if (name[0] == '@') { - size_t pos = name.find_first_of ('/'); + std::size_t pos = name.find_first_of ('/'); if (pos == std::string::npos) return octave_value (); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/sysdep.cc --- a/libinterp/corefcn/sysdep.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/sysdep.cc Wed Apr 28 22:57:42 2021 -0400 @@ -161,7 +161,7 @@ if (! bin_dir.empty ()) { - size_t pos = bin_dir.rfind (R"(\bin\)"); + std::size_t pos = bin_dir.rfind (R"(\bin\)"); if (pos != std::string::npos) sys::env::putenv ("OCTAVE_HOME", bin_dir.substr (0, pos)); @@ -222,7 +222,7 @@ HINSTANCE status = ShellExecuteW (0, 0, wfile.c_str (), 0, 0, SW_SHOWNORMAL); // ShellExecute returns a value greater than 32 if successful. - return octave_value (reinterpret_cast (status) > 32); + return octave_value (reinterpret_cast (status) > 32); #else // Quote file path file = "\"" + file + "\""; @@ -384,7 +384,7 @@ bool drive_or_unc_share (const std::string& name) { #if defined (OCTAVE_USE_WINDOWS_API) - size_t len = name.length (); + std::size_t len = name.length (); bool candidate = false; if (len > 1 && isalpha(name[0]) && name[1]==':' && (len == 2 || (len == 3 && name[2] == '\\'))) @@ -392,11 +392,11 @@ if (len > 4 && name[0] == '\\' && name[1] == '\\') { // It starts with two slashes. Find the next slash. - size_t next_slash = name.find ("\\", 3); + std::size_t next_slash = name.find ("\\", 3); if (next_slash != std::string::npos && len > next_slash+1) { // Check if it ends with the share - size_t last_slash = name.find ("\\", next_slash+1); + std::size_t last_slash = name.find ("\\", next_slash+1); if (last_slash == std::string::npos || (len > next_slash+2 && last_slash == len-1)) candidate = true; @@ -1061,7 +1061,7 @@ error ("winqueryreg: error %ld reading names from registry", retval); Cell fieldnames (dim_vector (1, fields.size ())); - size_t i; + std::size_t i; std::list::const_iterator it; for (i = 0, it = fields.begin (); it != fields.end (); ++it, ++i) fieldnames(i) = *it; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/toplev.cc --- a/libinterp/corefcn/toplev.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/toplev.cc Wed Apr 28 22:57:42 2021 -0400 @@ -658,7 +658,7 @@ extern vfp __new_handler; void * -__builtin_new (size_t sz) +__builtin_new (std::size_t sz) { void *p; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/utils.cc Wed Apr 28 22:57:42 2021 -0400 @@ -613,7 +613,7 @@ else { std::string fname = name; - size_t pos = name.find_first_of ('>'); + std::size_t pos = name.find_first_of ('>'); if (pos != std::string::npos) fname = name.substr (0, pos); @@ -655,9 +655,9 @@ { std::string retval; - size_t i = 0; - size_t j = 0; - size_t len = s.length (); + std::size_t i = 0; + std::size_t j = 0; + std::size_t len = s.length (); retval.resize (len); @@ -716,7 +716,7 @@ case '6': case '7': // octal input { - size_t k; + std::size_t k; int tmpi = s[j] - '0'; for (k = j+1; k < std::min (j+3, len); k++) { @@ -733,7 +733,7 @@ case 'x': // hex input { - size_t k; + std::size_t k; int tmpi = 0; for (k = j+1; k < std::min (j+3, len); k++) { @@ -886,7 +886,7 @@ { std::string retval; - for (size_t i = 0; i < s.length (); i++) + for (std::size_t i = 0; i < s.length (); i++) retval.append (undo_string_escape (s[i])); return retval; @@ -1326,9 +1326,9 @@ return m; } - size_t format (std::ostream& os, const char *fmt, ...) + std::size_t format (std::ostream& os, const char *fmt, ...) { - size_t retval; + std::size_t retval; va_list args; va_start (args, fmt); @@ -1340,7 +1340,7 @@ return retval; } - size_t vformat (std::ostream& os, const char *fmt, va_list args) + std::size_t vformat (std::ostream& os, const char *fmt, va_list args) { std::string s = vasprintf (fmt, args); @@ -1349,9 +1349,9 @@ return s.length (); } - size_t format (std::ostream& os, const std::string& enc, const char *fmt, ...) + std::size_t format (std::ostream& os, const std::string& enc, const char *fmt, ...) { - size_t retval; + std::size_t retval; va_list args; va_start (args, fmt); @@ -1363,7 +1363,7 @@ return retval; } - size_t vformat (std::ostream& os, const std::string& enc, const char *fmt, + std::size_t vformat (std::ostream& os, const std::string& enc, const char *fmt, va_list args) { std::string s = vasprintf (fmt, args); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/utils.h --- a/libinterp/corefcn/utils.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/utils.h Wed Apr 28 22:57:42 2021 -0400 @@ -108,16 +108,16 @@ extern OCTINTERP_API FloatMatrix float_identity_matrix (octave_idx_type nr, octave_idx_type nc); - extern OCTINTERP_API size_t + extern OCTINTERP_API std::size_t format (std::ostream& os, const char *fmt, ...); - extern OCTINTERP_API size_t + extern OCTINTERP_API std::size_t format (std::ostream& os, const std::string& enc, const char *fmt, ...); - extern OCTINTERP_API size_t + extern OCTINTERP_API std::size_t vformat (std::ostream& os, const char *fmt, va_list args); - extern OCTINTERP_API size_t + extern OCTINTERP_API std::size_t vformat (std::ostream& os, const std::string& enc, const char *fmt, va_list args); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/corefcn/variables.cc Wed Apr 28 22:57:42 2021 -0400 @@ -240,7 +240,7 @@ std::string xname = name; std::string ext; - size_t pos = name.rfind ('.'); + std::size_t pos = name.rfind ('.'); if (pos != std::string::npos) { @@ -299,7 +299,7 @@ file_name = lp.find_fcn (name); } - size_t len = file_name.length (); + std::size_t len = file_name.length (); if (len > 0) { @@ -372,11 +372,11 @@ static const std::string alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - static size_t len = alpha.length (); + static std::size_t len = alpha.length (); std::string nm = basename + alpha[GET_IDX (len)]; - size_t pos = nm.length (); + std::size_t pos = nm.length (); if (nm.substr (0, 2) == "__") nm.append ("__"); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/dldfcn/__fltk_uigetfile__.cc --- a/libinterp/dldfcn/__fltk_uigetfile__.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/dldfcn/__fltk_uigetfile__.cc Wed Apr 28 22:57:42 2021 -0400 @@ -113,7 +113,7 @@ // FLTK uses forward slash even for Windows std::string sep = "/"; - size_t idx; + std::size_t idx; if (file_count == 1 && multi_type != Fl_File_Chooser::DIRECTORY) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/dldfcn/__init_fltk__.cc Wed Apr 28 22:57:42 2021 -0400 @@ -365,7 +365,7 @@ // End of submenu? Pop back one level. if (! m->label ()) { - size_t idx = menupath.find_last_of ('/'); + std::size_t idx = menupath.find_last_of ('/'); if (idx != std::string::npos) menupath.erase (idx); else @@ -586,8 +586,8 @@ if (item) { //avoid duplicate menulabels - size_t idx1 = fltk_label.find_last_of ('('); - size_t idx2 = fltk_label.find_last_of (')'); + std::size_t idx1 = fltk_label.find_last_of ('('); + std::size_t idx2 = fltk_label.find_last_of (')'); int len = idx2 - idx1; int val = 1; if (len > 0) @@ -660,7 +660,7 @@ } // create any delayed menus - for (size_t ii = 0; ii < delayed_menus.size (); ii++) + for (std::size_t ii = 0; ii < delayed_menus.size (); ii++) { graphics_object kgo = gh_mgr.get_object (kids (delayed_menus[ii])); @@ -707,7 +707,7 @@ } // create any delayed menus - for (size_t ii = 0; ii < delayed_menus.size (); ii++) + for (std::size_t ii = 0; ii < delayed_menus.size (); ii++) { graphics_object kgo = gh_mgr.get_object (kids (delayed_menus[ii])); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/dldfcn/audioread.cc --- a/libinterp/dldfcn/audioread.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/dldfcn/audioread.cc Wed Apr 28 22:57:42 2021 -0400 @@ -307,7 +307,7 @@ error ("audiowrite: sample rate FS must be a positive scalar integer"); std::string ext; - size_t dotpos = filename.find_last_of ('.'); + std::size_t dotpos = filename.find_last_of ('.'); if (dotpos != std::string::npos) ext = filename.substr (dotpos + 1); std::transform (ext.begin (), ext.end (), ext.begin (), ::tolower); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/dldfcn/gzip.cc --- a/libinterp/dldfcn/gzip.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/dldfcn/gzip.cc Wed Apr 28 22:57:42 2021 -0400 @@ -557,7 +557,7 @@ = [&out_dir, &ext] (const std::string& source_path) -> std::string { // Strip any relative path (bug #58547) - size_t pos = source_path.find_last_of (sys::file_ops::dir_sep_str ()); + std::size_t pos = source_path.find_last_of (sys::file_ops::dir_sep_str ()); const std::string basename = (pos == std::string::npos ? source_path : source_path.substr (pos+1)); return sys::file_ops::concat (out_dir, basename + ext); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/cdef-class.cc --- a/libinterp/octave-value/cdef-class.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/cdef-class.cc Wed Apr 28 22:57:42 2021 -0400 @@ -556,7 +556,7 @@ const std::list& idx, int nargout) { - size_t skip = 1; + std::size_t skip = 1; octave_value_list retval; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/cdef-manager.cc --- a/libinterp/octave-value/cdef-manager.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/cdef-manager.cc Wed Apr 28 22:57:42 2021 -0400 @@ -642,7 +642,7 @@ { octave_value ov_cls; - size_t pos = name.rfind ('.'); + std::size_t pos = name.rfind ('.'); if (pos == std::string::npos) ov_cls = m_interpreter.find (name); @@ -721,7 +721,7 @@ if (load_if_not_found && lp.find_package (name)) { - size_t pos = name.rfind ('.'); + std::size_t pos = name.rfind ('.'); if (pos == std::string::npos) retval = make_package (name, ""); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/cdef-method.cc --- a/libinterp/octave-value/cdef-method.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/cdef-method.cc Wed Apr 28 22:57:42 2021 -0400 @@ -81,7 +81,7 @@ std::string cls_name = dispatch_type; std::string pack_name; - size_t pos = cls_name.rfind ('.'); + std::size_t pos = cls_name.rfind ('.'); if (pos != std::string::npos) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/cdef-object.cc --- a/libinterp/octave-value/cdef-object.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/cdef-object.cc Wed Apr 28 22:57:42 2021 -0400 @@ -215,7 +215,7 @@ octave_value_list cdef_object_array::subsref (const std::string& type, const std::list& idx, - int /* nargout */, size_t& skip, + int /* nargout */, std::size_t& skip, const cdef_class& /* context */, bool auto_add) { octave_value_list retval; @@ -284,7 +284,7 @@ octave_idx_type n = array.numel (); // dummy variables - size_t dummy_skip; + std::size_t dummy_skip; cdef_class dummy_cls; for (octave_idx_type i = 0; i < n; i++) @@ -509,7 +509,7 @@ octave_value_list cdef_object_scalar::subsref (const std::string& type, const std::list& idx, - int nargout, size_t& skip, + int nargout, std::size_t& skip, const cdef_class& context, bool auto_add) { skip = 0; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/cdef-object.h --- a/libinterp/octave-value/cdef-object.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/cdef-object.h Wed Apr 28 22:57:42 2021 -0400 @@ -126,7 +126,7 @@ virtual octave_value_list subsref (const std::string&, const std::list&, - int, size_t&, const cdef_class&, bool) + int, std::size_t&, const cdef_class&, bool) { err_invalid_object ("subsref"); } @@ -287,7 +287,7 @@ octave_value_list subsref (const std::string& type, const std::list& idx, - int nargout, size_t& skip, const cdef_class& context, + int nargout, std::size_t& skip, const cdef_class& context, bool auto_add = false) { return rep->subsref (type, idx, nargout, skip, context, auto_add); @@ -415,7 +415,7 @@ octave_value_list subsref (const std::string& type, const std::list& idx, - int nargout, size_t& skip, const cdef_class& context, + int nargout, std::size_t& skip, const cdef_class& context, bool auto_add); octave_value @@ -502,7 +502,7 @@ octave_value_list subsref (const std::string& type, const std::list& idx, - int nargout, size_t& skip, const cdef_class& context, + int nargout, std::size_t& skip, const cdef_class& context, bool auto_add); octave_value diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-base-diag.cc --- a/libinterp/octave-value/ov-base-diag.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-base-diag.cc Wed Apr 28 22:57:42 2021 -0400 @@ -611,7 +611,7 @@ std::ostringstream buf; octave_print_internal (buf, matrix(i,j)); std::string tmp = buf.str (); - size_t pos = tmp.find_first_not_of (' '); + std::size_t pos = tmp.find_first_not_of (' '); if (pos != std::string::npos) os << tmp.substr (pos); else if (! tmp.empty ()) diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-base-diag.h --- a/libinterp/octave-value/ov-base-diag.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-base-diag.h Wed Apr 28 22:57:42 2021 -0400 @@ -61,7 +61,7 @@ ~octave_base_diag (void) = default; - size_t byte_size (void) const { return matrix.byte_size (); } + std::size_t byte_size (void) const { return matrix.byte_size (); } octave_value squeeze (void) const { return matrix; } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-base-mat.cc --- a/libinterp/octave-value/ov-base-mat.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-base-mat.cc Wed Apr 28 22:57:42 2021 -0400 @@ -495,7 +495,7 @@ std::ostringstream buf; octave_print_internal (buf, matrix(j*nr+i)); std::string tmp = buf.str (); - size_t pos = tmp.find_first_not_of (' '); + std::size_t pos = tmp.find_first_not_of (' '); if (pos != std::string::npos) os << tmp.substr (pos); else if (! tmp.empty ()) diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-base-mat.h --- a/libinterp/octave-value/ov-base-mat.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-base-mat.h Wed Apr 28 22:57:42 2021 -0400 @@ -69,7 +69,7 @@ ~octave_base_matrix (void) { clear_cached_info (); } - size_t byte_size (void) const { return matrix.byte_size (); } + std::size_t byte_size (void) const { return matrix.byte_size (); } octave_value squeeze (void) const { return MT (matrix.squeeze ()); } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-base-scalar.cc --- a/libinterp/octave-value/ov-base-scalar.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-base-scalar.cc Wed Apr 28 22:57:42 2021 -0400 @@ -185,7 +185,7 @@ std::ostringstream buf; octave_print_internal (buf, scalar); std::string tmp = buf.str (); - size_t pos = tmp.find_first_not_of (' '); + std::size_t pos = tmp.find_first_not_of (' '); if (pos != std::string::npos) os << tmp.substr (pos); else if (! tmp.empty ()) diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-base-scalar.h --- a/libinterp/octave-value/ov-base-scalar.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-base-scalar.h Wed Apr 28 22:57:42 2021 -0400 @@ -96,7 +96,7 @@ octave_value reshape (const dim_vector& new_dims) const; - size_t byte_size (void) const { return sizeof (ST); } + std::size_t byte_size (void) const { return sizeof (ST); } octave_value all (int = 0) const { return (scalar != ST ()); } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-base-sparse.h --- a/libinterp/octave-value/ov-base-sparse.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-base-sparse.h Wed Apr 28 22:57:42 2021 -0400 @@ -80,7 +80,7 @@ octave_idx_type nzmax (void) const { return matrix.nzmax (); } - size_t byte_size (void) const { return matrix.byte_size (); } + std::size_t byte_size (void) const { return matrix.byte_size (); } octave_value squeeze (void) const { return matrix.squeeze (); } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-base.cc --- a/libinterp/octave-value/ov-base.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-base.cc Wed Apr 28 22:57:42 2021 -0400 @@ -840,7 +840,7 @@ err_wrong_type_arg ("octave_base_value::map_keys()", type_name ()); } -size_t +std::size_t octave_base_value::nparents (void) const { err_wrong_type_arg ("octave_base_value::nparents()", type_name ()); @@ -1395,7 +1395,7 @@ const std::list& idx, const std::string& who) { - size_t len = type.length (); + std::size_t len = type.length (); if (len != idx.size ()) error ("invalid index for %s", who.c_str ()); @@ -1405,7 +1405,7 @@ auto p = idx.begin (); - for (size_t i = 0; i < len; i++) + for (std::size_t i = 0; i < len; i++) { char t = type[i]; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-base.h --- a/libinterp/octave-value/ov-base.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-base.h Wed Apr 28 22:57:42 2021 -0400 @@ -338,7 +338,7 @@ virtual octave_idx_type numel (void) const { return dims ().numel (); } - virtual size_t byte_size (void) const { return 0; } + virtual std::size_t byte_size (void) const { return 0; } virtual octave_idx_type nnz (void) const; @@ -607,7 +607,7 @@ virtual string_vector map_keys (void) const; - virtual size_t nparents (void) const; + virtual std::size_t nparents (void) const; virtual std::list parent_class_name_list (void) const; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-cell.cc --- a/libinterp/octave-value/ov-cell.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-cell.cc Wed Apr 28 22:57:42 2021 -0400 @@ -465,10 +465,10 @@ octave_base_matrix::delete_elements (idx); } -size_t +std::size_t octave_cell::byte_size (void) const { - size_t retval = 0; + std::size_t retval = 0; for (octave_idx_type i = 0; i < numel (); i++) retval += matrix(i).byte_size (); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-cell.h --- a/libinterp/octave-value/ov-cell.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-cell.h Wed Apr 28 22:57:42 2021 -0400 @@ -107,7 +107,7 @@ void delete_elements (const octave_value_list& idx); - size_t byte_size (void) const; + std::size_t byte_size (void) const; octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-ch-mat.cc --- a/libinterp/octave-value/ov-ch-mat.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-ch-mat.cc Wed Apr 28 22:57:42 2021 -0400 @@ -320,12 +320,12 @@ p(1) = 0; \ in_m = matrix.permute (p); \ } \ - size_t output_length = in_m.numel (); \ + std::size_t output_length = in_m.numel (); \ charNDArray ch_array = charNDArray (in_m.dims ()); \ const uint8_t *in = reinterpret_cast (in_m.data ()); \ uint8_t *buf = reinterpret_cast (ch_array.fortran_vec ()); \ U8_FCN (in, matrix.numel (), nullptr, buf, &output_length); \ - if (output_length != static_cast (matrix.numel ())) \ + if (output_length != static_cast (matrix.numel ())) \ { \ warning_with_id ("Octave:multi_byte_char_length", \ "UMAP: Possible multi-byte error."); \ diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-class.cc --- a/libinterp/octave-value/ov-class.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-class.cc Wed Apr 28 22:57:42 2021 -0400 @@ -854,12 +854,12 @@ octave_value (1.0)).index_vector (require_integers); } -size_t +std::size_t octave_class::byte_size (void) const { // Neglect the size of the fieldnames. - size_t retval = 0; + std::size_t retval = 0; for (auto it = map.cbegin (); it != map.cend (); it++) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-class.h --- a/libinterp/octave-value/ov-class.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-class.h Wed Apr 28 22:57:42 2021 -0400 @@ -130,7 +130,7 @@ dim_vector dims (void) const { return map.dims (); } - size_t byte_size (void) const; + std::size_t byte_size (void) const; // This is the number of elements in each field. The total number // of elements is numel () * nfields (). @@ -142,7 +142,7 @@ octave_idx_type nfields (void) const { return map.nfields (); } - size_t nparents (void) const { return parent_list.size (); } + std::size_t nparents (void) const { return parent_list.size (); } octave_value reshape (const dim_vector& new_dims) const { @@ -266,7 +266,7 @@ octave_idx_type nfields (void) const { return field_names.numel (); } - size_t nparents (void) const { return parent_class_names.size (); } + std::size_t nparents (void) const { return parent_class_names.size (); } string_vector fields (void) const { return field_names; } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-classdef.cc Wed Apr 28 22:57:42 2021 -0400 @@ -73,7 +73,7 @@ const std::list& idx, int nargout) { - size_t skip = 0; + std::size_t skip = 0; octave_value_list retval; octave::cdef_class cls = object.get_class (); @@ -112,7 +112,7 @@ const std::list& idx, bool auto_add) { - size_t skip = 0; + std::size_t skip = 0; octave_value_list retval; // This variant of subsref is used to create temporary values when doing @@ -309,7 +309,7 @@ std::map property_map = cls.get_property_map (); - size_t max_len = 0; + std::size_t max_len = 0; for (const auto& pname_prop : property_map) { // FIXME: this loop duplicates a significant portion of the @@ -329,7 +329,7 @@ if (hid.bool_value ()) continue; - size_t sz = nm.size (); + std::size_t sz = nm.size (); if (sz > max_len) max_len = sz; @@ -500,7 +500,7 @@ } else { - size_t pos = mname.find ('.'); + std::size_t pos = mname.find ('.'); octave::cdef_object obj; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-fcn-handle.cc --- a/libinterp/octave-value/ov-fcn-handle.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-fcn-handle.cc Wed Apr 28 22:57:42 2021 -0400 @@ -929,7 +929,7 @@ symbol_table& symtab = interp.get_symbol_table (); - size_t pos = m_name.find ('.'); + std::size_t pos = m_name.find ('.'); if (pos != std::string::npos) { @@ -951,8 +951,8 @@ // package. An object may only appear as the first element, // then it must be followed directly by a function name. - size_t beg = 0; - size_t end = pos; + std::size_t beg = 0; + std::size_t end = pos; std::vector idx_elts; @@ -968,7 +968,7 @@ beg = end+1; } - size_t n_elts = idx_elts.size (); + std::size_t n_elts = idx_elts.size (); bool have_object = false; octave_value partial_expr_val; @@ -992,7 +992,7 @@ std::string type; std::list arg_list; - for (size_t i = 1; i < n_elts; i++) + for (std::size_t i = 1; i < n_elts; i++) { if (partial_expr_val.is_package ()) { @@ -1617,7 +1617,7 @@ { std::string dir_name = sys::file_ops::dirname (m_file); - size_t pos = dir_name.find_last_of (sys::file_ops::dir_sep_chars ()); + std::size_t pos = dir_name.find_last_of (sys::file_ops::dir_sep_chars ()); if (pos != std::string::npos) dir_name = dir_name.substr (0, pos); @@ -2055,7 +2055,7 @@ print_raw (os, true, 0); os << "\n"; - size_t varlen = m_local_vars.size (); + std::size_t varlen = m_local_vars.size (); if (varlen > 0) { @@ -2142,7 +2142,7 @@ std::ostringstream nmbuf; - size_t varlen = m_local_vars.size (); + std::size_t varlen = m_local_vars.size (); nmbuf << anonymous; if (varlen > 0) @@ -2180,7 +2180,7 @@ // values in this anonymous function. octave_idx_type len = 0; - size_t anl = anonymous.length (); + std::size_t anl = anonymous.length (); if (m_name.length () > anl) { std::istringstream nm_is (m_name.substr (anl)); @@ -2335,7 +2335,7 @@ H5Dclose (data_hid); - size_t varlen = m_local_vars.size (); + std::size_t varlen = m_local_vars.size (); if (varlen > 0) { @@ -2901,7 +2901,7 @@ if (! (octaveroot.empty () || fpath.empty ())) { - size_t len = octaveroot.size (); + std::size_t len = octaveroot.size (); if (octaveroot == fpath.substr (0, len)) fpath = octave::config::octave_exec_home () + fpath.substr (len); } @@ -3003,7 +3003,7 @@ std::shared_ptr new_rep; - size_t anl = anonymous.length (); + std::size_t anl = anonymous.length (); if (name.length () >= anl && name.substr (0, anl) == anonymous) { @@ -3026,19 +3026,19 @@ if (name.find_first_of ('\n') != std::string::npos) { - size_t pos1 = name.find_first_of ('\n'); - size_t pos2 = name.find_first_of ('\n', pos1 + 1); + std::size_t pos1 = name.find_first_of ('\n'); + std::size_t pos2 = name.find_first_of ('\n', pos1 + 1); octaveroot = name.substr (pos1 + 1, pos2 - pos1 - 1); fpath = name.substr (pos2 + 1); name = name.substr (0, pos1); } - size_t pos1 = name.find ('@'); + std::size_t pos1 = name.find ('@'); if (pos1 != std::string::npos) { if (name[pos1+1] == '<') { - size_t pos2 = name.find ('>', pos1 + 2); + std::size_t pos2 = name.find ('>', pos1 + 2); if (pos2 != std::string::npos) subtype = name.substr (pos1 + 2, pos2 - pos1 - 2); @@ -3179,19 +3179,19 @@ if (name.find_first_of ('\n') != std::string::npos) { - size_t pos1 = name.find_first_of ('\n'); - size_t pos2 = name.find_first_of ('\n', pos1 + 1); + std::size_t pos1 = name.find_first_of ('\n'); + std::size_t pos2 = name.find_first_of ('\n', pos1 + 1); octaveroot = name.substr (pos1 + 1, pos2 - pos1 - 1); fpath = name.substr (pos2 + 1); name = name.substr (0, pos1); } - size_t pos1 = name.find ('@'); + std::size_t pos1 = name.find ('@'); if (pos1 != std::string::npos) { if (name[pos1+1] == '<') { - size_t pos2 = name.find ('>', pos1 + 2); + std::size_t pos2 = name.find ('>', pos1 + 2); if (pos2 != std::string::npos) subtype = name.substr (pos1 + 2, pos2 - pos1 - 2); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-java.cc --- a/libinterp/octave-value/ov-java.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-java.cc Wed Apr 28 22:57:42 2021 -0400 @@ -522,7 +522,7 @@ }; #endif - for (size_t i = 0; i < sizeof (subdirs) / sizeof (subdirs[0]); i++) + for (std::size_t i = 0; i < sizeof (subdirs) / sizeof (subdirs[0]); i++) { std::string candidate = java_home_path + "/" + subdirs[i] + "/" LIBJVM_FILE_NAME; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-lazy-idx.h --- a/libinterp/octave-value/ov-lazy-idx.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-lazy-idx.h Wed Apr 28 22:57:42 2021 -0400 @@ -60,7 +60,7 @@ octave_value fast_elem_extract (octave_idx_type n) const; - size_t byte_size (void) const { return numel () * sizeof (octave_idx_type); } + std::size_t byte_size (void) const { return numel () * sizeof (octave_idx_type); } octave_value squeeze (void) const; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-perm.cc --- a/libinterp/octave-value/ov-perm.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-perm.cc Wed Apr 28 22:57:42 2021 -0400 @@ -525,7 +525,7 @@ octave_int tval (matrix(i,j)); octave_print_internal (buf, tval); std::string tmp = buf.str (); - size_t pos = tmp.find_first_not_of (' '); + std::size_t pos = tmp.find_first_not_of (' '); if (pos != std::string::npos) os << tmp.substr (pos); else if (! tmp.empty ()) diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-perm.h --- a/libinterp/octave-value/ov-perm.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-perm.h Wed Apr 28 22:57:42 2021 -0400 @@ -53,7 +53,7 @@ octave_base_value * try_narrowing_conversion (void); - size_t byte_size (void) const { return matrix.byte_size (); } + std::size_t byte_size (void) const { return matrix.byte_size (); } octave_value squeeze (void) const { return matrix; } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-range.h --- a/libinterp/octave-value/ov-range.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-range.h Wed Apr 28 22:57:42 2021 -0400 @@ -123,7 +123,7 @@ octave_value resize (const dim_vector& dv, bool fill = false) const; - size_t byte_size (void) const { return 3 * sizeof (double); } + std::size_t byte_size (void) const { return 3 * sizeof (double); } octave_value reshape (const dim_vector& new_dims) const { return NDArray (array_value ().reshape (new_dims)); } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-str-mat.cc --- a/libinterp/octave-value/ov-str-mat.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-str-mat.cc Wed Apr 28 22:57:42 2021 -0400 @@ -271,7 +271,7 @@ std::string tmp = string_value (); // FIXME: should this be configurable? - size_t max_len = 100; + std::size_t max_len = 100; os << (tmp.length () > max_len ? tmp.substr (0, 100) : tmp); } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-struct.cc --- a/libinterp/octave-value/ov-struct.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-struct.cc Wed Apr 28 22:57:42 2021 -0400 @@ -570,12 +570,12 @@ return map.index (idx, resize_ok); } -size_t +std::size_t octave_struct::byte_size (void) const { // Neglect the size of the fieldnames. - size_t retval = 0; + std::size_t retval = 0; for (auto p = map.cbegin (); p != map.cend (); p++) { @@ -1290,12 +1290,12 @@ return octave_map (map).index (idx, resize_ok); } -size_t +std::size_t octave_scalar_struct::byte_size (void) const { // Neglect the size of the fieldnames. - size_t retval = 0; + std::size_t retval = 0; for (auto p = map.cbegin (); p != map.cend (); p++) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-struct.h --- a/libinterp/octave-value/ov-struct.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-struct.h Wed Apr 28 22:57:42 2021 -0400 @@ -101,7 +101,7 @@ dim_vector dims (void) const { return map.dims (); } - size_t byte_size (void) const; + std::size_t byte_size (void) const; // This is the number of elements in each field. The total number // of elements is numel () * nfields (). @@ -225,7 +225,7 @@ dim_vector dims (void) const { static dim_vector dv (1, 1); return dv; } - size_t byte_size (void) const; + std::size_t byte_size (void) const; // This is the number of elements in each field. The total number // of elements is numel () * nfields (). diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-usr-fcn.cc --- a/libinterp/octave-value/ov-usr-fcn.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-usr-fcn.cc Wed Apr 28 22:57:42 2021 -0400 @@ -99,7 +99,7 @@ } std::string -octave_user_code::get_code_line (size_t line) +octave_user_code::get_code_line (std::size_t line) { if (! m_file_info) get_file_info (); @@ -108,7 +108,7 @@ } std::deque -octave_user_code::get_code_lines (size_t line, size_t num_lines) +octave_user_code::get_code_lines (std::size_t line, std::size_t num_lines) { if (! m_file_info) get_file_info (); @@ -429,7 +429,7 @@ std::string first_fun = subfuns; - size_t pos = subfuns.find ('>'); + std::size_t pos = subfuns.find ('>'); if (pos == std::string::npos) subfuns = ""; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov-usr-fcn.h --- a/libinterp/octave-value/ov-usr-fcn.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov-usr-fcn.h Wed Apr 28 22:57:42 2021 -0400 @@ -88,9 +88,9 @@ bool is_user_code (void) const { return true; } - std::string get_code_line (size_t line); + std::string get_code_line (std::size_t line); - std::deque get_code_lines (size_t line, size_t num_lines); + std::deque get_code_lines (std::size_t line, std::size_t num_lines); void cache_function_text (const std::string& text, const octave::sys::time& timestamp); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov.cc Wed Apr 28 22:57:42 2021 -0400 @@ -1451,12 +1451,12 @@ octave_value octave_value::next_subsref (const std::string& type, const std::list& idx, - size_t skip) + std::size_t skip) { if (idx.size () > skip) { std::list new_idx (idx); - for (size_t i = 0; i < skip; i++) + for (std::size_t i = 0; i < skip; i++) new_idx.erase (new_idx.begin ()); return subsref (type.substr (skip), new_idx); } @@ -1467,12 +1467,12 @@ octave_value_list octave_value::next_subsref (int nargout, const std::string& type, const std::list& idx, - size_t skip) + std::size_t skip) { if (idx.size () > skip) { std::list new_idx (idx); - for (size_t i = 0; i < skip; i++) + for (std::size_t i = 0; i < skip; i++) new_idx.erase (new_idx.begin ()); return subsref (type.substr (skip), new_idx, nargout); } @@ -1483,12 +1483,12 @@ octave_value octave_value::next_subsref (bool auto_add, const std::string& type, const std::list& idx, - size_t skip) + std::size_t skip) { if (idx.size () > skip) { std::list new_idx (idx); - for (size_t i = 0; i < skip; i++) + for (std::size_t i = 0; i < skip; i++) new_idx.erase (new_idx.begin ()); return subsref (type.substr (skip), new_idx, auto_add); } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ov.h Wed Apr 28 22:57:42 2021 -0400 @@ -469,16 +469,16 @@ octave_value next_subsref (const std::string& type, const std::list& idx, - size_t skip = 1); + std::size_t skip = 1); octave_value_list next_subsref (int nargout, const std::string& type, const std::list& idx, - size_t skip = 1); + std::size_t skip = 1); octave_value next_subsref (bool auto_add, const std::string& type, const std::list& idx, - size_t skip = 1); + std::size_t skip = 1); octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false) @@ -526,7 +526,7 @@ octave_idx_type numel (void) const { return rep->numel (); } - size_t byte_size (void) const + std::size_t byte_size (void) const { return rep->byte_size (); } octave_idx_type nnz (void) const { return rep->nnz (); } @@ -953,7 +953,7 @@ string_vector map_keys (void) const { return rep->map_keys (); } - size_t nparents (void) const + std::size_t nparents (void) const { return rep->nparents (); } std::list parent_class_name_list (void) const diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave-value/ovl.cc --- a/libinterp/octave-value/ovl.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave-value/ovl.cc Wed Apr 28 22:57:42 2021 -0400 @@ -35,7 +35,7 @@ octave_value_list::octave_value_list (const std::list& lst) { - size_t nel = lst.size (); + std::size_t nel = lst.size (); if (nel > 0) { diff -r 5068a97f0f39 -r d13d090cb03a libinterp/octave.cc --- a/libinterp/octave.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/octave.cc Wed Apr 28 22:57:42 2021 -0400 @@ -255,7 +255,7 @@ { m_program_invocation_name = pname; - size_t pos = pname.find_last_of (sys::file_ops::dir_sep_chars ()); + std::size_t pos = pname.find_last_of (sys::file_ops::dir_sep_chars ()); m_program_name = (pos != std::string::npos) ? pname.substr (pos+1) : pname; } diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/jit-ir.cc --- a/libinterp/parse-tree/jit-ir.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/jit-ir.cc Wed Apr 28 22:57:42 2021 -0400 @@ -173,7 +173,7 @@ while (first_use ()) { jit_instruction *user = first_use ()->user (); - size_t idx = first_use ()->index (); + std::size_t idx = first_use ()->index (); user->stash_argument (idx, value); } } @@ -226,9 +226,9 @@ } void - jit_instruction::do_construct_ssa (size_t start, size_t end) + jit_instruction::do_construct_ssa (std::size_t start, std::size_t end) { - for (size_t i = start; i < end; ++i) + for (std::size_t i = start; i < end; ++i) { jit_value *arg = argument (i); jit_variable *var = dynamic_cast (arg); @@ -377,13 +377,13 @@ } jit_block * - jit_block::successor (size_t i) const + jit_block::successor (std::size_t i) const { jit_terminator *term = terminator (); return term->successor (i); } - size_t + std::size_t jit_block::successor_count (void) const { jit_terminator *term = terminator (); @@ -408,7 +408,7 @@ os << std::endl; os << " successors: "; - for (size_t i = 0; i < successor_count (); ++i) + for (std::size_t i = 0; i < successor_count (); ++i) os << *successor (i) << ' '; os << std::endl; @@ -424,14 +424,14 @@ os << std::endl; os << " m_dom_succ: "; - for (size_t i = 0; i < m_dom_succ.size (); ++i) + for (std::size_t i = 0; i < m_dom_succ.size (); ++i) os << *m_dom_succ[i] << ' '; return os << std::endl; } void - jit_block::compute_df (size_t avisit_count) + jit_block::compute_df (std::size_t avisit_count) { if (visited (avisit_count)) return; @@ -449,12 +449,12 @@ } } - for (size_t i = 0; i < successor_count (); ++i) + for (std::size_t i = 0; i < successor_count (); ++i) successor (i)->compute_df (avisit_count); } bool - jit_block::update_idom (size_t avisit_count) + jit_block::update_idom (std::size_t avisit_count) { if (visited (avisit_count) || ! use_count ()) return false; @@ -488,7 +488,7 @@ } void - jit_block::label (size_t avisit_count, size_t& number) + jit_block::label (std::size_t avisit_count, std::size_t& number) { if (visited (avisit_count)) return; @@ -513,7 +513,7 @@ } std::ostream& - jit_block::print (std::ostream& os, size_t indent) const + jit_block::print (std::ostream& os, std::size_t indent) const { print_indent (os, indent); short_print (os) << ": %pred = "; @@ -541,7 +541,7 @@ if (successor_count () > 1) { jit_terminator *term = terminator (); - size_t idx = term->successor_index (asuccessor); + std::size_t idx = term->successor_index (asuccessor); jit_block *split = factory.create ("phi_split", m_visit_count); // place after this to ensure define before use in the blocks list @@ -564,7 +564,7 @@ } void - jit_block::create_dom_tree (size_t avisit_count) + jit_block::create_dom_tree (std::size_t avisit_count) { if (visited (avisit_count)) return; @@ -572,7 +572,7 @@ if (m_idom != this) m_idom->m_dom_succ.push_back (this); - for (size_t i = 0; i < successor_count (); ++i) + for (std::size_t i = 0; i < successor_count (); ++i) successor (i)->create_dom_tree (avisit_count); } @@ -602,10 +602,10 @@ jit_phi::prune (void) { jit_block *p = parent (); - size_t new_idx = 0; + std::size_t new_idx = 0; jit_value *unique = argument (1); - for (size_t i = 0; i < argument_count (); ++i) + for (std::size_t i = 0; i < argument_count (); ++i) { jit_block *inc = incoming (i); if (inc->branch_alive (p)) @@ -647,7 +647,7 @@ return false; jit_type *infered = nullptr; - for (size_t i = 0; i < argument_count (); ++i) + for (std::size_t i = 0; i < argument_count (); ++i) { jit_block *inc = incoming (i); if (inc->branch_alive (p)) @@ -670,11 +670,11 @@ } // -------------------- jit_terminator -------------------- - size_t + std::size_t jit_terminator::successor_index (const jit_block *asuccessor) const { - size_t scount = successor_count (); - for (size_t i = 0; i < scount; ++i) + std::size_t scount = successor_count (); + for (std::size_t i = 0; i < scount; ++i) if (successor (i) == asuccessor) return i; @@ -688,7 +688,7 @@ return false; bool changed = false; - for (size_t i = 0; i < m_alive.size (); ++i) + for (std::size_t i = 0; i < m_alive.size (); ++i) if (! m_alive[i] && check_alive (i)) { changed = true; @@ -727,7 +727,7 @@ jit_call::infer (void) { // FIXME: explain algorithm - for (size_t i = 0; i < argument_count (); ++i) + for (std::size_t i = 0; i < argument_count (); ++i) { m_already_infered[i] = argument_type (i); if (! m_already_infered[i]) @@ -768,7 +768,7 @@ } std::ostream& - jit_error_check::print (std::ostream& os, size_t indent) const + jit_error_check::print (std::ostream& os, std::size_t indent) const { print_indent (os, indent) << "error_check " << variable_to_string (m_variable) << ", "; @@ -781,7 +781,7 @@ // -------------------- jit_magic_end -------------------- jit_magic_end::context::context (jit_factory& factory, jit_value *avalue, - size_t aindex, size_t acount) + std::size_t aindex, std::size_t acount) : m_value (avalue), m_index (factory.create (aindex)), m_count (factory.create (acount)) { } @@ -791,7 +791,7 @@ { resize_arguments (m_contexts.size ()); - size_t i; + std::size_t i; std::vector::const_iterator iter; for (iter = m_contexts.begin (), i = 0; iter != m_contexts.end (); ++iter, ++i) stash_argument (i, iter->m_value); @@ -800,7 +800,7 @@ jit_magic_end::context jit_magic_end::resolve_context (void) const { - size_t idx; + std::size_t idx; for (idx = 0; idx < m_contexts.size (); ++idx) { jit_type *ctx_type = m_contexts[idx].m_value->type (); @@ -830,7 +830,7 @@ } std::ostream& - jit_magic_end::print (std::ostream& os, size_t indent) const + jit_magic_end::print (std::ostream& os, std::size_t indent) const { context ctx = resolve_context (); short_print (print_indent (os, indent)) << " (" << *ctx.m_value << ", "; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/jit-ir.h --- a/libinterp/parse-tree/jit-ir.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/jit-ir.h Wed Apr 28 22:57:42 2021 -0400 @@ -238,7 +238,7 @@ virtual bool needs_release (void) const { return false; } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const = 0; + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const = 0; virtual std::ostream& short_print (std::ostream& os) const { return print (os); } @@ -263,9 +263,9 @@ protected: - std::ostream& print_indent (std::ostream& os, size_t indent = 0) const + std::ostream& print_indent (std::ostream& os, std::size_t indent = 0) const { - for (size_t i = 0; i < indent * 8; ++i) + for (std::size_t i = 0; i < indent * 8; ++i) os << ' '; return os; } @@ -305,7 +305,7 @@ return *this; } - size_t index (void) const { return m_index; } + std::size_t index (void) const { return m_index; } jit_instruction * user (void) const { return m_user; } @@ -314,7 +314,7 @@ std::list user_parent_location (void) const; void stash_value (jit_value *avalue, jit_instruction *auser = nullptr, - size_t aindex = -1) + std::size_t aindex = -1) { PARENT_T::stash_value (avalue); m_index = aindex; @@ -324,7 +324,7 @@ private: jit_instruction *m_user; - size_t m_index; + std::size_t m_index; }; class @@ -337,7 +337,7 @@ : m_id (next_id ()), m_parent (0) { } - jit_instruction (size_t nargs) + jit_instruction (std::size_t nargs) : m_id (next_id ()), m_parent (0) { m_already_infered.reserve (nargs); @@ -357,7 +357,7 @@ : m_already_infered (aarguments.size ()), m_arguments (aarguments.size ()), m_id (next_id ()), m_parent (0) { - for (size_t i = 0; i < aarguments.size (); ++i) + for (std::size_t i = 0; i < aarguments.size (); ++i) stash_argument (i, aarguments[i]); } @@ -366,29 +366,29 @@ next_id (true); } - jit_value * argument (size_t i) const + jit_value * argument (std::size_t i) const { return m_arguments[i].value (); } - llvm::Value * argument_llvm (size_t i) const + llvm::Value * argument_llvm (std::size_t i) const { assert (argument (i)); return argument (i)->to_llvm (); } - jit_type * argument_type (size_t i) const + jit_type * argument_type (std::size_t i) const { return argument (i)->type (); } - llvm::Type * argument_type_llvm (size_t i) const + llvm::Type * argument_type_llvm (std::size_t i) const { assert (argument (i)); return argument_type (i)->to_llvm (); } - std::ostream& print_argument (std::ostream& os, size_t i) const + std::ostream& print_argument (std::ostream& os, std::size_t i) const { if (argument (i)) return argument (i)->short_print (os); @@ -396,13 +396,13 @@ return os << "NULL"; } - void stash_argument (size_t i, jit_value * arg) + void stash_argument (std::size_t i, jit_value * arg) { m_arguments[i].stash_value (arg, this, i); } template - void stash_argument (size_t i, jit_value * arg1, Args... aargs) + void stash_argument (std::size_t i, jit_value * arg1, Args... aargs) { m_arguments[i].stash_value (arg1, this, i); stash_argument (++i, aargs...); @@ -415,19 +415,19 @@ m_already_infered.push_back (0); } - size_t argument_count (void) const + std::size_t argument_count (void) const { return m_arguments.size (); } - void resize_arguments (size_t acount, jit_value *adefault = nullptr) + void resize_arguments (std::size_t acount, jit_value *adefault = nullptr) { - size_t old = m_arguments.size (); + std::size_t old = m_arguments.size (); m_arguments.resize (acount); m_already_infered.resize (acount); if (adefault) - for (size_t i = old; i < acount; ++i) + for (std::size_t i = old; i < acount; ++i) stash_argument (i, adefault); } @@ -468,20 +468,20 @@ m_location = alocation; } - size_t id (void) const { return m_id; } + std::size_t id (void) const { return m_id; } protected: // Do SSA replacement on arguments in [start, end) - void do_construct_ssa (size_t start, size_t end); + void do_construct_ssa (std::size_t start, std::size_t end); std::vector m_already_infered; private: - static size_t next_id (bool reset = false) + static std::size_t next_id (bool reset = false) { - static size_t ret = 0; + static std::size_t ret = 0; if (reset) return ret = 0; @@ -490,7 +490,7 @@ std::vector m_arguments; - size_t m_id; + std::size_t m_id; jit_block *m_parent; std::list::iterator m_location; }; @@ -511,7 +511,7 @@ stash_llvm (avalue); } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { print_indent (os, indent); return jit_print (os, type ()) << ": DUMMY"; @@ -535,7 +535,7 @@ PASS_T value (void) const { return m_value; } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { print_indent (os, indent); jit_print (os, type ()) << ": "; @@ -571,9 +571,9 @@ typedef std::set df_set; typedef df_set::const_iterator df_iterator; - static const size_t NO_ID = static_cast (-1); + static const std::size_t NO_ID = static_cast (-1); - jit_block (const std::string& aname, size_t avisit_count = 0) + jit_block (const std::string& aname, std::size_t avisit_count = 0) : m_visit_count (avisit_count), m_id (NO_ID), m_idom (0), m_name (aname), m_alive (false) { } @@ -585,7 +585,7 @@ // we have a new internal list, but we want to stay compatible with jit_value jit_use * first_use (void) const { return jit_value::first_use (); } - size_t use_count (void) const { return jit_value::use_count (); } + std::size_t use_count (void) const { return jit_value::use_count (); } // if a block is alive, then it might be visited during execution bool alive (void) const { return m_alive; } @@ -638,9 +638,9 @@ // is the jump from pred alive? bool branch_alive (jit_block *asucc) const; - jit_block * successor (size_t i) const; + jit_block * successor (std::size_t i) const; - size_t successor_count (void) const; + std::size_t successor_count (void) const; iterator begin (void) { return m_instructions.begin (); } @@ -657,7 +657,7 @@ iterator nonphi_begin (void); // must label before id is valid - size_t id (void) const { return m_id; } + std::size_t id (void) const { return m_id; } // dominance frontier const df_set& df (void) const { return m_df; } @@ -669,11 +669,11 @@ // label with a RPO walk void label (void) { - size_t number = 0; + std::size_t number = 0; label (m_visit_count, number); } - void label (size_t avisit_count, size_t& number); + void label (std::size_t avisit_count, std::size_t& number); // See for idom computation algorithm // Cooper, Keith D.; Harvey, Timothy J; and Kennedy, Ken (2001). @@ -698,12 +698,12 @@ create_dom_tree (m_visit_count); } - jit_block * dom_successor (size_t idx) const + jit_block * dom_successor (std::size_t idx) const { return m_dom_succ[idx]; } - size_t dom_successor_count (void) const + std::size_t dom_successor_count (void) const { return m_dom_succ.size (); } @@ -711,7 +711,7 @@ // call pop_variable on all instructions void pop_all (void); - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const; + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const; jit_block * maybe_split (jit_factory& factory, jit_block_list& blocks, jit_block *asuccessor); @@ -744,11 +744,11 @@ { m_location = alocation; } // used to prevent visiting the same node twice in the graph - size_t visit_count (void) const { return m_visit_count; } + std::size_t visit_count (void) const { return m_visit_count; } // check if this node has been visited yet at the given visit count. // If we have not been visited yet, mark us as visited. - bool visited (size_t avisit_count) + bool visited (std::size_t avisit_count) { if (m_visit_count <= avisit_count) { @@ -769,16 +769,16 @@ void internal_append (jit_instruction *instr); - void compute_df (size_t avisit_count); + void compute_df (std::size_t avisit_count); - bool update_idom (size_t avisit_count); + bool update_idom (std::size_t avisit_count); - void create_dom_tree (size_t avisit_count); + void create_dom_tree (std::size_t avisit_count); static jit_block * idom_intersect (jit_block *i, jit_block *j); - size_t m_visit_count; - size_t m_id; + std::size_t m_visit_count; + std::size_t m_id; jit_block *m_idom; df_set m_df; std::vector m_dom_succ; @@ -873,7 +873,7 @@ } } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { return print_indent (os, indent) << m_name; } @@ -896,7 +896,7 @@ : jit_instruction (), m_dest (adest) { } - jit_assign_base (jit_variable *adest, size_t npred) + jit_assign_base (jit_variable *adest, std::size_t npred) : jit_instruction (npred), m_dest (adest) { } @@ -970,7 +970,7 @@ return false; } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { print_indent (os, indent) << *this << " = " << *src (); @@ -992,7 +992,7 @@ { public: - jit_phi (jit_variable *adest, size_t npred) + jit_phi (jit_variable *adest, std::size_t npred) : jit_assign_base (adest, npred) { m_incoming.reserve (npred); @@ -1008,12 +1008,12 @@ m_incoming[m_incoming.size () - 1].stash_value (from); } - jit_block * incoming (size_t i) const + jit_block * incoming (std::size_t i) const { return m_incoming[i].value (); } - llvm::BasicBlock * incoming_llvm (size_t i) const + llvm::BasicBlock * incoming_llvm (std::size_t i) const { return incoming (i)->to_llvm (); } @@ -1022,7 +1022,7 @@ virtual bool infer (void); - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { std::stringstream ss; print_indent (ss, indent); @@ -1031,7 +1031,7 @@ std::string indent_str (ss_str.size (), ' '); os << ss_str; - for (size_t i = 0; i < argument_count (); ++i) + for (std::size_t i = 0; i < argument_count (); ++i) { if (i > 0) os << indent_str; @@ -1062,23 +1062,23 @@ public: template - jit_terminator (size_t asuccessor_count, Args... args) + jit_terminator (std::size_t asuccessor_count, Args... args) : jit_instruction (args...), m_alive (asuccessor_count, false) { } - jit_block * successor (size_t idx = 0) const + jit_block * successor (std::size_t idx = 0) const { return static_cast (argument (idx)); } - llvm::BasicBlock * successor_llvm (size_t idx = 0) const + llvm::BasicBlock * successor_llvm (std::size_t idx = 0) const { return successor (idx)->to_llvm (); } - size_t successor_index (const jit_block *asuccessor) const; + std::size_t successor_index (const jit_block *asuccessor) const; - std::ostream& print_successor (std::ostream& os, size_t idx = 0) const + std::ostream& print_successor (std::ostream& os, std::size_t idx = 0) const { if (alive (idx)) os << "[live] "; @@ -1094,11 +1094,11 @@ return alive (successor_index (asuccessor)); } - bool alive (size_t idx) const { return m_alive[idx]; } + bool alive (std::size_t idx) const { return m_alive[idx]; } bool alive (int idx) const { return m_alive[idx]; } - size_t successor_count (void) const { return m_alive.size (); } + std::size_t successor_count (void) const { return m_alive.size (); } virtual bool infer (void); @@ -1106,7 +1106,7 @@ protected: - virtual bool check_alive (size_t) const { return true; } + virtual bool check_alive (std::size_t) const { return true; } private: @@ -1120,9 +1120,9 @@ jit_branch (jit_block *succ) : jit_terminator (1, succ) { } - virtual size_t successor_count (void) const { return 1; } + virtual std::size_t successor_count (void) const { return 1; } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { print_indent (os, indent) << "branch: "; return print_successor (os); @@ -1151,9 +1151,9 @@ return cond ()->to_llvm (); } - virtual size_t successor_count (void) const { return 2; } + virtual std::size_t successor_count (void) const { return 2; } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { print_indent (os, indent) << "cond_branch: "; print_cond (os) << ", "; @@ -1215,7 +1215,7 @@ virtual bool needs_release (void) const; - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { print_indent (os, indent); @@ -1223,7 +1223,7 @@ short_print (os) << " = "; os << "call " << m_operation.name () << " ("; - for (size_t i = 0; i < argument_count (); ++i) + for (std::size_t i = 0; i < argument_count (); ++i) { print_argument (os, i); if (i + 1 < argument_count ()) @@ -1278,13 +1278,13 @@ return static_cast (argument (2)); } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const; + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const; JIT_VALUE_ACCEPT; protected: - virtual bool check_alive (size_t idx) const + virtual bool check_alive (std::size_t idx) const { if (! has_check_for ()) return true; @@ -1309,8 +1309,8 @@ context (void) : m_value (0), m_index (0), m_count (0) { } - context (jit_factory& factory, jit_value *avalue, size_t aindex, - size_t acount); + context (jit_factory& factory, jit_value *avalue, std::size_t aindex, + std::size_t acount); jit_value *m_value; jit_const_index *m_index; @@ -1323,7 +1323,7 @@ const jit_function& overload () const; - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const; + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const; context resolve_context (void) const; @@ -1360,7 +1360,7 @@ return jit_typeinfo::cast (type (), jit_typeinfo::get_any ()); } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { print_indent (os, indent); @@ -1404,7 +1404,7 @@ return result ()->to_llvm (); } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { jit_value *res = result (); print_indent (os, indent) << "store "; @@ -1446,7 +1446,7 @@ return res ? res->type () : nullptr; } - virtual std::ostream& print (std::ostream& os, size_t indent = 0) const + virtual std::ostream& print (std::ostream& os, std::size_t indent = 0) const { print_indent (os, indent) << "return"; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/jit-typeinfo.cc --- a/libinterp/parse-tree/jit-typeinfo.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/jit-typeinfo.cc Wed Apr 28 22:57:42 2021 -0400 @@ -447,11 +447,11 @@ // FIXME: Add support for multiple outputs extern "C" octave_base_value * - octave_jit_call (octave_builtin::fcn fn, size_t nargin, + octave_jit_call (octave_builtin::fcn fn, std::size_t nargin, octave_base_value **argin, jit_type *result_type) { octave_value_list ovl (nargin); - for (size_t i = 0; i < nargin; ++i) + for (std::size_t i = 0; i < nargin; ++i) ovl.xelem (i) = octave_value (argin[i]); ovl = fn (ovl, 1); @@ -515,7 +515,7 @@ std::memset (m_pack, 0, sizeof (m_pack)); std::memset (m_unpack, 0, sizeof (m_unpack)); - for (size_t i = 0; i < jit_convention::length; ++i) + for (std::size_t i = 0; i < jit_convention::length; ++i) m_packed_type[i] = m_llvm_type; } @@ -663,7 +663,7 @@ assert (in_args.size () == m_args.size ()); std::vector llvm_args (m_args.size ()); - for (size_t i = 0; i < in_args.size (); ++i) + for (std::size_t i = 0; i < in_args.size (); ++i) llvm_args[i] = in_args[i]->to_llvm (); return call (builder, llvm_args); @@ -695,7 +695,7 @@ llvm_args.push_back (sret_mem); } - for (size_t i = 0; i < in_args.size (); ++i) + for (std::size_t i = 0; i < in_args.size (); ++i) { llvm::Value *arg = in_args[i]; jit_type::convert_fn convert = m_args[i]->pack (m_call_conv); @@ -740,7 +740,7 @@ } llvm::Value * - jit_function::argument (llvm::IRBuilderD& builder, size_t idx) const + jit_function::argument (llvm::IRBuilderD& builder, std::size_t idx) const { assert (idx < m_args.size ()); @@ -751,7 +751,7 @@ if (sret ()) ++iter; - for (size_t i = 0; i < idx; ++i, ++iter); + for (std::size_t i = 0; i < idx; ++i, ++iter); if (m_args[idx]->pointer_arg (m_call_conv)) return builder.CreateLoad (&*iter); @@ -812,7 +812,7 @@ const std::vector& args) { // Number of input arguments of the overload that is being registered - size_t nargs = args.size (); + std::size_t nargs = args.size (); if (nargs >= m_overloads.size ()) m_overloads.resize (nargs + 1); @@ -845,10 +845,10 @@ jit_operation::overload (const std::vector& types) const { // Number of input arguments of the overload that is being looked for - size_t nargs = types.size (); + std::size_t nargs = types.size (); static jit_function null_overload; - for (size_t i = 0; i < nargs; ++i) + for (std::size_t i = 0; i < nargs; ++i) if (! types[i]) return null_overload; @@ -928,7 +928,7 @@ else if (l.size () > r.size ()) return false; - for (size_t i = 0; i < l.size (); ++i) + for (std::size_t i = 0; i < l.size (); ++i) { if (l[i]->type_id () < r[i]->type_id ()) return true; @@ -947,7 +947,7 @@ { // indexing a matrix with scalars jit_type *scalar = jit_typeinfo::get_scalar (); - for (size_t i = 1; i < types.size (); ++i) + for (std::size_t i = 1; i < types.size (); ++i) if (types[i] != scalar) return 0; @@ -960,14 +960,14 @@ llvm::Value * jit_index_operation::create_arg_array (llvm::IRBuilderD& builder, const jit_function& fn, - size_t start_idx, - size_t end_idx) const + std::size_t start_idx, + std::size_t end_idx) const { - size_t n = end_idx - start_idx; + std::size_t n = end_idx - start_idx; llvm::Type *scalar_t = jit_typeinfo::get_scalar_llvm (); llvm::ArrayType *array_t = llvm::ArrayType::get (scalar_t, n); llvm::Value *array = llvm::UndefValue::get (array_t); - for (size_t i = start_idx; i < end_idx; ++i) + for (std::size_t i = start_idx; i < end_idx; ++i) { llvm::Value *idx = fn.argument (builder, i); array = builder.CreateInsertValue (array, idx, i - start_idx); @@ -1278,14 +1278,14 @@ m_any, m_any); any_binary.mark_can_error (); - for (size_t i = 0; i < octave_value::num_binary_ops; ++i) + for (std::size_t i = 0; i < octave_value::num_binary_ops; ++i) { octave_value::binary_op op = static_cast (i); std::string op_name = octave_value::binary_op_as_string (op); m_binary_ops.push_back (jit_operation ("binary" + op_name)); } - for (size_t i = 0; i < octave_value::num_unary_ops; ++i) + for (std::size_t i = 0; i < octave_value::num_unary_ops; ++i) { octave_value::unary_op op = static_cast (i); std::string op_name = octave_value::unary_op_as_string (op); @@ -2023,9 +2023,9 @@ } jit_type* - jit_typeinfo::do_get_intN (size_t nbits) const + jit_typeinfo::do_get_intN (std::size_t nbits) const { - std::map::const_iterator iter = m_ints.find (nbits); + std::map::const_iterator iter = m_ints.find (nbits); if (iter != m_ints.end ()) return iter->second; @@ -2116,7 +2116,7 @@ jit_function jit_typeinfo::create_identity (jit_type *type) { - size_t id = type->type_id (); + std::size_t id = type->type_id (); if (id >= m_identities.size ()) m_identities.resize (id + 1); @@ -2161,14 +2161,14 @@ } void - jit_typeinfo::register_intrinsic (const std::string& name, size_t iid, + jit_typeinfo::register_intrinsic (const std::string& name, std::size_t iid, jit_type *result, const std::vector& args) { jit_type *builtin_type = m_builtins[name]; - size_t nargs = args.size (); + std::size_t nargs = args.size (); std::vector llvm_args (nargs); - for (size_t i = 0; i < nargs; ++i) + for (std::size_t i = 0; i < nargs; ++i) llvm_args[i] = args[i]->to_llvm (); llvm::Function *ifun = m_base_jit_module-> @@ -2189,7 +2189,7 @@ m_builder.SetInsertPoint (body); llvm::SmallVector fargs (nargs); - for (size_t i = 0; i < nargs; ++i) + for (std::size_t i = 0; i < nargs; ++i) fargs[i] = fn.argument (m_builder, i + 1); llvm::Value *ret = m_builder.CreateCall (ifun, fargs); @@ -2225,7 +2225,7 @@ m_builder.SetInsertPoint (block); llvm::ArrayType *array_t = llvm::ArrayType::get (m_any_t, args.size ()); llvm::Value *array = llvm::UndefValue::get (array_t); - for (size_t i = 0; i < args.size (); ++i) + for (std::size_t i = 0; i < args.size (); ++i) { llvm::Value *arg = fn.argument (m_builder, i + 1); jit_function agrab = m_grab_fn.overload (args[i]); @@ -2242,10 +2242,10 @@ jit_type *jintTy = do_get_intN (sizeof (octave_builtin::fcn) * 8); llvm::Type *intTy = jintTy->to_llvm (); - size_t fcn_int = reinterpret_cast (builtin->function ()); + std::size_t fcn_int = reinterpret_cast (builtin->function ()); llvm::Value *fcn = llvm::ConstantInt::get (intTy, fcn_int); llvm::Value *nargin = llvm::ConstantInt::get (intTy, args.size ()); - size_t result_int = reinterpret_cast (result); + std::size_t result_int = reinterpret_cast (result); llvm::Value *res_llvm = llvm::ConstantInt::get (intTy, result_int); llvm::Value *ret = m_any_call.call (m_builder, fcn, nargin, array, res_llvm); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/jit-typeinfo.h --- a/libinterp/parse-tree/jit-typeinfo.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/jit-typeinfo.h Wed Apr 28 22:57:42 2021 -0400 @@ -162,7 +162,7 @@ // how this type gets passed as a function argument llvm::Type * to_llvm_arg (void) const; - size_t depth (void) const { return m_depth; } + std::size_t depth (void) const { return m_depth; } bool skip_paren (void) const { return m_skip_paren; } @@ -211,7 +211,7 @@ jit_type *m_parent; llvm::Type *m_llvm_type; int m_id; - size_t m_depth; + std::size_t m_depth; bool m_skip_paren; bool m_sret[jit_convention::length]; @@ -310,7 +310,7 @@ return call (builder, in_args, other_args...); } - llvm::Value * argument (llvm::IRBuilderD& builder, size_t idx) const; + llvm::Value * argument (llvm::IRBuilderD& builder, std::size_t idx) const; void do_return (llvm::IRBuilderD& builder, llvm::Value *rval = nullptr, bool verify = true); @@ -326,7 +326,7 @@ jit_type * result (void) const { return m_result; } - jit_type * argument_type (size_t idx) const + jit_type * argument_type (std::size_t idx) const { assert (idx < m_args.size ()); return m_args[idx]; @@ -457,8 +457,8 @@ // helper functions // [start_idx, end_idx). llvm::Value * create_arg_array (llvm::IRBuilderD& builder, - const jit_function& fn, size_t start_idx, - size_t end_idx) const; + const jit_function& fn, std::size_t start_idx, + std::size_t end_idx) const; const jit_typeinfo& m_typeinfo; }; @@ -561,7 +561,7 @@ static jit_type *get_complex (void) { return instance ().m_complex; } - static jit_type *intN (size_t nbits) { return instance ().do_get_intN (nbits); } + static jit_type *intN (std::size_t nbits) { return instance ().do_get_intN (nbits); } // FIXME: do we really need these two ? static llvm::Type *get_scalar_llvm (void) { return instance ().m_scalar->to_llvm (); } // this one is weird @@ -603,11 +603,11 @@ llvm::StructType *m_complex_ret; // Get integer type from number of bits - jit_type *do_get_intN (size_t nbits) const; + jit_type *do_get_intN (std::size_t nbits) const; // map container for integer types: int8, int16, etc. // (note that they are also stored in id_to_types) - std::map m_ints; + std::map m_ints; // ----- parenthesis subsref/subsasgn ----- @@ -755,13 +755,13 @@ const jit_operation& do_binary_op (int op) const { - assert (static_cast (op) < m_binary_ops.size ()); + assert (static_cast (op) < m_binary_ops.size ()); return m_binary_ops[op]; } const jit_operation& do_unary_op (int op) const { - assert (static_cast (op) < m_unary_ops.size ()); + assert (static_cast (op) < m_unary_ops.size ()); return m_unary_ops[op]; } @@ -771,7 +771,7 @@ if (! to) return null_function; - size_t id = to->type_id (); + std::size_t id = to->type_id (); if (id >= m_casts.size ()) return null_function; return m_casts[id]; @@ -858,14 +858,14 @@ void add_builtin (const std::string& name); - void register_intrinsic (const std::string& name, size_t id, + void register_intrinsic (const std::string& name, std::size_t id, jit_type *result, jit_type *arg0) { std::vector args (1, arg0); register_intrinsic (name, id, result, args); } - void register_intrinsic (const std::string& name, size_t id, jit_type *result, + void register_intrinsic (const std::string& name, std::size_t id, jit_type *result, const std::vector& args); void register_generic (const std::string& name, jit_type *result, diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/jit-util.h --- a/libinterp/parse-tree/jit-util.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/jit-util.h Wed Apr 28 22:57:42 2021 -0400 @@ -144,13 +144,13 @@ NODE_T * first_use (void) const { return m_use_head; } - size_t use_count (void) const { return m_use_count; } + std::size_t use_count (void) const { return m_use_count; } private: NODE_T *m_use_head; NODE_T *m_use_tail; - size_t m_use_count; + std::size_t m_use_count; }; // a node for internal linked lists diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/lex.h --- a/libinterp/parse-tree/lex.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/lex.h Wed Apr 28 22:57:42 2021 -0400 @@ -68,7 +68,7 @@ bool empty (void) const { return m_frame_stack.empty (); } - size_t size (void) const { return m_frame_stack.size (); } + std::size_t size (void) const { return m_frame_stack.size (); } void pop (void); @@ -216,12 +216,12 @@ } // Direct access. - token * at (size_t n) + token * at (std::size_t n) { return empty () ? nullptr : m_buffer.at (n); } - const token * at (size_t n) const + const token * at (std::size_t n) const { return empty () ? nullptr : m_buffer.at (n); } @@ -248,7 +248,7 @@ } // Number of elements currently in the buffer. - size_t size (void) const { return m_buffer.size (); } + std::size_t size (void) const { return m_buffer.size (); } bool empty (void) const { return m_buffer.empty (); } @@ -463,7 +463,7 @@ // Count of tokens recognized by this lexer since initialized or // since the last reset. - size_t m_token_count; + std::size_t m_token_count; // The current position in the file (line and column). filepos m_filepos; @@ -548,7 +548,7 @@ void fill (const std::string& input, bool eof_arg); // Copy at most max_size characters to buf. - int copy_chunk (char *buf, size_t max_size, bool by_lines = false); + int copy_chunk (char *buf, std::size_t max_size, bool by_lines = false); bool empty (void) const { return m_chars_left == 0; } @@ -557,8 +557,8 @@ private: std::string m_buffer; - size_t m_offset; - size_t m_chars_left; + std::size_t m_offset; + std::size_t m_chars_left; bool m_eof; }; @@ -697,7 +697,7 @@ token * current_token (void); - size_t pending_token_count (void) const; + std::size_t pending_token_count (void) const; void display_token (int tok); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/lex.ll Wed Apr 28 22:57:42 2021 -0400 @@ -795,7 +795,7 @@ // Grab text of comment without leading space or comment // characters. - size_t i = 0; + std::size_t i = 0; while (i < yyleng && is_space_or_tab (yytext[i])) i++; @@ -1357,11 +1357,11 @@ { std::string txt = yytext; - size_t at_or_dot_pos = txt.find_first_of ("@."); + std::size_t at_or_dot_pos = txt.find_first_of ("@."); if (at_or_dot_pos != std::string::npos) { - size_t spc_pos = txt.find_first_of (" \t"); + std::size_t spc_pos = txt.find_first_of (" \t"); if (spc_pos != std::string::npos && spc_pos < at_or_dot_pos) { @@ -2192,7 +2192,7 @@ symbol_scope lexical_feedback::symbol_table_context::parent_scope (void) const { - size_t sz = size (); + std::size_t sz = size (); return (sz > 1 ? m_frame_stack[1] @@ -2364,7 +2364,7 @@ // Comment characters have been stripped but whitespace // (including newlines) remains. - size_t offset = s.find_first_not_of (" \t\n\r"); + std::size_t offset = s.find_first_not_of (" \t\n\r"); return (offset != std::string::npos && (s.substr (offset, 9) == "Copyright" @@ -2391,15 +2391,15 @@ // If BY_LINES is true, return chunks to the lexer line by line. int - base_lexer::input_buffer::copy_chunk (char *buf, size_t max_size, + base_lexer::input_buffer::copy_chunk (char *buf, std::size_t max_size, bool by_lines) { static const char * const eol = "\n"; - size_t len = 0; + std::size_t len = 0; if (by_lines) { - size_t newline_pos = m_buffer.find ('\n', m_offset); + std::size_t newline_pos = m_buffer.find ('\n', m_offset); len = (newline_pos != std::string::npos ? newline_pos - m_offset + 1 : (max_size > m_chars_left ? m_chars_left : max_size)); @@ -2900,8 +2900,8 @@ bool base_lexer::fq_identifier_contains_keyword (const std::string& s) { - size_t p1 = 0; - size_t p2; + std::size_t p1 = 0; + std::size_t p2; std::string s_part; @@ -3144,7 +3144,7 @@ txt.erase (std::remove_if (txt.begin (), txt.end (), is_space_or_tab), txt.end ()); - size_t pos = txt.find ("@"); + std::size_t pos = txt.find ("@"); std::string meth = txt.substr (0, pos); std::string cls = txt.substr (pos + 1); @@ -3391,7 +3391,7 @@ return lval->tok_val; } - size_t + std::size_t base_lexer::pending_token_count (void) const { return m_tokens.size (); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/oct-lvalue.cc --- a/libinterp/parse-tree/oct-lvalue.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/oct-lvalue.cc Wed Apr 28 22:57:42 2021 -0400 @@ -66,7 +66,7 @@ // around internally but they are not supposed to be stored as // single symbols in a stack frame. - size_t num_indices = m_idx.size (); + std::size_t num_indices = m_idx.size (); if (num_indices == 0) return 1; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/oct-parse.yy --- a/libinterp/parse-tree/oct-parse.yy Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/oct-parse.yy Wed Apr 28 22:57:42 2021 -0400 @@ -2284,7 +2284,7 @@ namespace octave { - size_t + std::size_t base_parser::parent_scope_info::size (void) const { return m_info.size (); @@ -2318,7 +2318,7 @@ std::string full_name; - for (size_t i = 0; i < size()-1; i++) + for (std::size_t i = 0; i < size()-1; i++) { const value_type& elt = m_info[i]; @@ -3638,7 +3638,7 @@ std::string nm = m_lexer.m_fcn_file_name; - size_t pos = nm.find_last_of (sys::file_ops::dir_sep_chars ()); + std::size_t pos = nm.find_last_of (sys::file_ops::dir_sep_chars ()); if (pos != std::string::npos) nm = m_lexer.m_fcn_file_name.substr (pos+1); @@ -3879,7 +3879,7 @@ std::string nm = m_lexer.m_fcn_file_name; - size_t pos = nm.find_last_of (sys::file_ops::dir_sep_chars ()); + std::size_t pos = nm.find_last_of (sys::file_ops::dir_sep_chars ()); if (pos != std::string::npos) nm = m_lexer.m_fcn_file_name.substr (pos+1); @@ -4400,7 +4400,7 @@ std::string va_type = (type == tree_parameter_list::in ? "varargin" : "varargout"); - size_t len = lst->length (); + std::size_t len = lst->length (); if (len > 0) { @@ -4743,7 +4743,7 @@ // input file in a list. See also functions for managing input // buffers in lex.ll. - size_t len = curr_line.length (); + std::size_t len = curr_line.length (); if (curr_line[len-1] == '\n') curr_line.resize (len-1); @@ -5074,7 +5074,7 @@ std::string file = full_file; - size_t file_len = file.length (); + std::size_t file_len = file.length (); if ((file_len > 4 && file.substr (file_len-4) == ".oct") || (file_len > 4 && file.substr (file_len-4) == ".mex") @@ -5083,7 +5083,7 @@ file = sys::env::base_pathname (file); file = file.substr (0, file.find_last_of ('.')); - size_t pos = file.find_last_of (sys::file_ops::dir_sep_str ()); + std::size_t pos = file.find_last_of (sys::file_ops::dir_sep_str ()); if (pos != std::string::npos) file = file.substr (pos+1); } @@ -5130,7 +5130,7 @@ std::string nm = file_name; - size_t nm_len = nm.length (); + std::size_t nm_len = nm.length (); std::string file; @@ -5145,7 +5145,7 @@ nm = sys::env::base_pathname (file); nm = nm.substr (0, nm.find_last_of ('.')); - size_t pos = nm.find_last_of (sys::file_ops::dir_sep_str ()); + std::size_t pos = nm.find_last_of (sys::file_ops::dir_sep_str ()); if (pos != std::string::npos) nm = nm.substr (pos+1); } @@ -5913,7 +5913,7 @@ std::string dir_name; - size_t file_len = file.length (); + std::size_t file_len = file.length (); if ((file_len > 4 && file.substr (file_len-4) == ".oct") || (file_len > 4 && file.substr (file_len-4) == ".mex") @@ -5922,7 +5922,7 @@ file = octave::sys::env::base_pathname (file); file = file.substr (0, file.find_last_of ('.')); - size_t pos = file.find_last_of (octave::sys::file_ops::dir_sep_str ()); + std::size_t pos = file.find_last_of (octave::sys::file_ops::dir_sep_str ()); if (pos != std::string::npos) { dir_name = file.substr (0, pos); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/parse.h --- a/libinterp/parse-tree/parse.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/parse.h Wed Apr 28 22:57:42 2021 -0400 @@ -126,7 +126,7 @@ ~parent_scope_info (void) = default; - size_t size (void) const; + std::size_t size (void) const; void push (const value_type& elt); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/profiler.h --- a/libinterp/parse-tree/profiler.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/profiler.h Wed Apr 28 22:57:42 2021 -0400 @@ -117,7 +117,7 @@ stats (void); double m_time; - size_t m_calls; + std::size_t m_calls; bool m_recursive; @@ -176,7 +176,7 @@ // This is only time spent *directly* on this level, excluding children! double m_time; - size_t m_calls; + std::size_t m_calls; }; // Each function we see in the profiler is given a unique index (which diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/pt-eval.cc Wed Apr 28 22:57:42 2021 -0400 @@ -106,7 +106,7 @@ EX_QUIT_ALL = 3 }; - debugger (interpreter& interp, size_t level) + debugger (interpreter& interp, std::size_t level) : m_interpreter (interp), m_level (level), m_debug_frame (0), m_execution_mode (EX_NORMAL), m_in_debug_repl (false) { } @@ -134,8 +134,8 @@ interpreter& m_interpreter; - size_t m_level; - size_t m_debug_frame; + std::size_t m_level; + std::size_t m_debug_frame; execution_mode m_execution_mode; bool m_in_debug_repl; }; @@ -446,8 +446,8 @@ if (opt == "fullpathext") return fname; - size_t dpos = fname.rfind (sys::file_ops::dir_sep_char ()); - size_t epos = fname.rfind ('.'); + std::size_t dpos = fname.rfind (sys::file_ops::dir_sep_char ()); + std::size_t epos = fname.rfind ('.'); if (epos <= dpos+1) epos = std::string::npos; @@ -618,7 +618,7 @@ const std::string& try_code, int nargout) { - unwind_action act ([this] (size_t frm) + unwind_action act ([this] (std::size_t frm) { m_call_stack.restore_frame (frm); }, m_call_stack.current_frame ()); @@ -642,7 +642,7 @@ { octave_value_list retval; - unwind_action act1 ([this] (size_t frm) + unwind_action act1 ([this] (std::size_t frm) { m_call_stack.restore_frame (frm); }, m_call_stack.current_frame ()); @@ -896,7 +896,7 @@ // the corresponding function name. At least try to do it without N // string compares. - size_t len = name.length (); + std::size_t len = name.length (); if (len == 3 && name == ".**") return "power"; @@ -1026,7 +1026,7 @@ bool name_is_operator = fcn_name != name; - size_t pos = fcn_name.find ('.'); + std::size_t pos = fcn_name.find ('.'); if (pos != std::string::npos) { @@ -1414,7 +1414,7 @@ // by getting a reference to the caller or base stack frame and // calling assign on that? - unwind_action act ([this] (size_t frm) + unwind_action act ([this] (std::size_t frm) { m_call_stack.restore_frame (frm); }, m_call_stack.current_frame ()); @@ -1485,7 +1485,7 @@ std::string file_full_name = sys::file_ops::tilde_expand (file_name); - size_t pos + std::size_t pos = file_full_name.find_last_of (sys::file_ops::dir_sep_str ()); std::string dir_name = file_full_name.substr (0, pos); @@ -1518,11 +1518,11 @@ } // Find symbol name that would be in symbol_table, if it were loaded. - size_t dir_end + std::size_t dir_end = file_name.find_last_of (sys::file_ops::dir_sep_chars ()); dir_end = (dir_end == std::string::npos) ? 0 : dir_end + 1; - size_t extension = file_name.find_last_of ('.'); + std::size_t extension = file_name.find_last_of ('.'); if (extension == std::string::npos) extension = file_name.length (); @@ -1926,7 +1926,7 @@ return m_call_stack.current_function (true); } - bool tree_evaluator::goto_frame (size_t n, bool verbose) + bool tree_evaluator::goto_frame (std::size_t n, bool verbose) { return m_call_stack.goto_frame (n, verbose); } @@ -1941,7 +1941,7 @@ m_call_stack.goto_base_frame (); } - void tree_evaluator::restore_frame (size_t n) + void tree_evaluator::restore_frame (std::size_t n) { return m_call_stack.restore_frame (n); } @@ -2280,7 +2280,7 @@ std::replace (beg, end, '/', sys::file_ops::dir_sep_char ()); } - size_t name_len = name.length (); + std::size_t name_len = name.length (); if (name_len > 2 && name.substr (name_len-2) == ".m") name = name.substr (0, name_len-2); @@ -2291,11 +2291,11 @@ symbol_table& symtab = m_interpreter.get_symbol_table (); octave_value fcn; - size_t p2 = std::string::npos; + std::size_t p2 = std::string::npos; if (name[0] == '@') { - size_t p1 = name.find (sys::file_ops::dir_sep_char (), 1); + std::size_t p1 = name.find (sys::file_ops::dir_sep_char (), 1); if (p1 == std::string::npos) return nullptr; @@ -2653,7 +2653,7 @@ if (! cmd_list) return retval; - if (m_call_stack.size () >= static_cast (m_max_recursion_depth)) + if (m_call_stack.size () >= static_cast (m_max_recursion_depth)) error ("max_recursion_depth exceeded"); unwind_protect_var upv (m_statement_context, SC_SCRIPT); @@ -4176,12 +4176,12 @@ // evaluate the partial expression that the special "end" // token applies to in the calling stack frame. - unwind_action act ([this] (size_t frm) + unwind_action act ([this] (std::size_t frm) { m_call_stack.restore_frame (frm); }, m_call_stack.current_frame ()); - size_t n = m_call_stack.find_current_user_frame (); + std::size_t n = m_call_stack.find_current_user_frame (); m_call_stack.goto_frame (n); // End is only valid inside argument lists used for diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/pt-eval.h --- a/libinterp/parse-tree/pt-eval.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/pt-eval.h Wed Apr 28 22:57:42 2021 -0400 @@ -103,7 +103,7 @@ return m_stack.top (); } - size_t size (void) const + std::size_t size (void) const { return m_stack.size (); } @@ -425,13 +425,13 @@ octave_function * caller_function (void) const; - bool goto_frame (size_t n = 0, bool verbose = false); + bool goto_frame (std::size_t n = 0, bool verbose = false); void goto_caller_frame (void); void goto_base_frame (void); - void restore_frame (size_t n); + void restore_frame (std::size_t n); std::string get_dispatch_class (void) const; @@ -573,16 +573,16 @@ octave_value silent_functions (const octave_value_list& args, int nargout); - size_t debug_frame (void) const { return m_debug_frame; } + std::size_t debug_frame (void) const { return m_debug_frame; } - size_t debug_frame (size_t n) + std::size_t debug_frame (std::size_t n) { - size_t val = m_debug_frame; + std::size_t val = m_debug_frame; m_debug_frame = n; return val; } - size_t current_call_stack_frame_number (void) const + std::size_t current_call_stack_frame_number (void) const { return m_call_stack.current_frame (); } @@ -797,7 +797,7 @@ profiler m_profiler; // The number of the stack frame we are currently debugging. - size_t m_debug_frame; + std::size_t m_debug_frame; bool m_debug_mode; diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/pt-jit.cc --- a/libinterp/parse-tree/pt-jit.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/pt-jit.cc Wed Apr 28 22:57:42 2021 -0400 @@ -211,7 +211,7 @@ if (plist) { auto piter = plist->begin (); - for (size_t i = 0; i < args.size (); ++i, ++piter) + for (std::size_t i = 0; i < args.size (); ++i, ++piter) { if (piter == plist->end ()) throw jit_fail_exception ("Too many parameter to function"); @@ -584,7 +584,7 @@ jit_convert::visit_if_command_list (tree_if_command_list& lst) { tree_if_clause *last = lst.back (); - size_t last_else = static_cast (last->is_else_clause ()); + std::size_t last_else = static_cast (last->is_else_clause ()); // entry_blocks represents the block you need to enter in order to execute // the condition check for the ith clause. For the else, it is simple the @@ -595,7 +595,7 @@ // Need to construct blocks first, because they have jumps to each other. auto iter = lst.begin (); ++iter; - for (size_t i = 1; iter != lst.end (); ++iter, ++i) + for (std::size_t i = 1; iter != lst.end (); ++iter, ++i) { tree_if_clause *tic = *iter; if (tic->is_else_clause ()) @@ -614,9 +614,9 @@ m_breaks.clear (); m_continues.clear (); - size_t num_incoming = 0; // number of incoming blocks to our tail + std::size_t num_incoming = 0; // number of incoming blocks to our tail iter = lst.begin (); - for (size_t i = 0; iter != lst.end (); ++iter, ++i) + for (std::size_t i = 0; iter != lst.end (); ++iter, ++i) { tree_if_clause *tic = *iter; m_block = entry_blocks[i]; @@ -858,13 +858,13 @@ jit_value *value = visit (expr); assert (value); - size_t case_blocks_num = lst->size (); + std::size_t case_blocks_num = lst->size (); if (! case_blocks_num) // there's nothing to do return; // check for otherwise, it's interpreted as last 'else' condition - size_t has_otherwise = 0; + std::size_t has_otherwise = 0; tree_switch_case *last = lst->back (); if (last->is_default_case ()) has_otherwise = 1; @@ -874,7 +874,7 @@ // the first entry point is always the actual block. Afterward, new blocks // are created for every case and the otherwise branch entry_blocks[0] = m_block; - for (size_t i = 1; i < case_blocks_num; ++i) + for (std::size_t i = 1; i < case_blocks_num; ++i) entry_blocks[i] = m_factory.create ("case_cond"); jit_block *tail = m_factory.create ("switch_tail"); @@ -890,10 +890,10 @@ m_breaks.clear (); m_continues.clear (); - size_t num_incoming = 0; // number of incoming blocks to our tail + std::size_t num_incoming = 0; // number of incoming blocks to our tail auto iter = lst->begin (); - for (size_t i = 0; i < case_blocks_num; ++iter, ++i) + for (std::size_t i = 0; i < case_blocks_num; ++iter, ++i) { tree_switch_case *twc = *iter; m_block = entry_blocks[i]; // case_cond @@ -1185,7 +1185,7 @@ } std::string - jit_convert::next_name (const char *prefix, size_t& count, bool inc) + jit_convert::next_name (const char *prefix, std::size_t& count, bool inc) { std::stringstream ss; ss << prefix << count; @@ -1226,13 +1226,13 @@ else object = visit (tree_object); - size_t narg = arg_list->size (); + std::size_t narg = arg_list->size (); auto iter = arg_list->begin (); bool have_extra = extra_arg; std::vector call_args (narg + 1 + have_extra); call_args[0] = object; - for (size_t idx = 0; iter != arg_list->end (); ++idx, ++iter) + for (std::size_t idx = 0; iter != arg_list->end (); ++idx, ++iter) { unwind_protect frame; frame.add_method (&m_end_context, @@ -1351,7 +1351,7 @@ // octave_base_value** type llvm::Value *arg = &*(m_function->arg_begin ()); - for (size_t i = 0; i < m_argument_vec.size (); ++i) + for (std::size_t i = 0; i < m_argument_vec.size (); ++i) { #if defined (LLVM_IRBUILDER_CREATECONSTINBOUNDSGEP1_32_REQUIRES_TYPE) // LLVM >= 3.7 @@ -1401,7 +1401,7 @@ { auto piter = plist->begin (); auto pend = plist->end (); - for (size_t i = 0; i < args.size () && piter != pend; ++i, ++piter) + for (std::size_t i = 0; i < args.size () && piter != pend; ++i, ++piter) { tree_decl_elt *elt = *piter; std::string arg_name = elt->name (); @@ -1463,7 +1463,7 @@ jit_convert_llvm::finish_phi (jit_phi *phi) { llvm::PHINode *llvm_phi = phi->to_llvm (); - for (size_t i = 0; i < phi->argument_count (); ++i) + for (std::size_t i = 0; i < phi->argument_count (); ++i) { llvm::BasicBlock *pred = phi->incoming_llvm (i); llvm_phi->addIncoming (phi->argument_llvm (i), pred); @@ -1554,7 +1554,7 @@ const jit_function& ol = call.overload (); std::vector args (call.arguments ().size ()); - for (size_t i = 0; i < args.size (); ++i) + for (std::size_t i = 0; i < args.size (); ++i) args[i] = call.argument (i); llvm::Value *ret = ol.call (builder, args); @@ -1727,7 +1727,7 @@ void jit_infer::append_users_term (jit_terminator *term) { - for (size_t i = 0; i < term->successor_count (); ++i) + for (std::size_t i = 0; i < term->successor_count (); ++i) { if (term->alive (i)) { @@ -1789,7 +1789,7 @@ } void - jit_infer::do_construct_ssa (jit_block& ablock, size_t avisit_count) + jit_infer::do_construct_ssa (jit_block& ablock, std::size_t avisit_count) { if (ablock.visited (avisit_count)) return; @@ -1803,7 +1803,7 @@ } // finish phi nodes of successors - for (size_t i = 0; i < ablock.successor_count (); ++i) + for (std::size_t i = 0; i < ablock.successor_count (); ++i) { jit_block *finish = ablock.successor (i); @@ -1827,7 +1827,7 @@ } } - for (size_t i = 0; i < ablock.dom_successor_count (); ++i) + for (std::size_t i = 0; i < ablock.dom_successor_count (); ++i) do_construct_ssa (*ablock.dom_successor (i), avisit_count); ablock.pop_all (); @@ -1922,7 +1922,7 @@ { // instead of releasing on assign, release on all incoming // branches, this can get rid of casts inside loops - for (size_t i = 0; i < phi->argument_count (); ++i) + for (std::size_t i = 0; i < phi->argument_count (); ++i) { jit_value *arg = phi->argument (i); if (! arg->needs_release ()) @@ -1963,7 +1963,7 @@ if (isa (instr)) { // place releases for temporary arguments - for (size_t i = 0; i < instr->argument_count (); ++i) + for (std::size_t i = 0; i < instr->argument_count (); ++i) { jit_value *arg = instr->argument (i); if (! arg->needs_release ()) @@ -2015,7 +2015,7 @@ jit_block& pblock = *phi.parent (); const jit_operation& cast_fn = jit_typeinfo::cast (phi.type ()); jit_variable *dest = phi.dest (); - for (size_t i = 0; i < phi.argument_count (); ++i) + for (std::size_t i = 0; i < phi.argument_count (); ++i) { jit_value *arg = phi.argument (i); if (arg->type () != phi.type ()) @@ -2237,7 +2237,7 @@ tree_jit::do_execute (tree_simple_for_command& cmd, const octave_value& bounds) { - size_t tc = trip_count (bounds); + std::size_t tc = trip_count (bounds); if (! tc || ! initialized || ! enabled ()) return false; @@ -2248,7 +2248,7 @@ if (! info || ! info->match (extra_vars)) { - if (tc < static_cast (Vjit_startcnt)) + if (tc < static_cast (Vjit_startcnt)) return false; delete info; @@ -2309,7 +2309,7 @@ && ! Vdebug_on_interrupt && ! Vdebug_on_error); } - size_t + std::size_t tree_jit::trip_count (const octave_value& bounds) const { if (bounds.is_range ()) @@ -2369,7 +2369,7 @@ // Create or insert an LLVM Function declaration for an intrinsic and return // it llvm::Function* - jit_module::get_intrinsic_declaration (size_t id, + jit_module::get_intrinsic_declaration (std::size_t id, std::vector types) const { return llvm::Intrinsic::getDeclaration @@ -2485,8 +2485,8 @@ m_function (nullptr), m_argument_types (ov_args.length ()) { - size_t nargs = ov_args.length (); - for (size_t i = 0; i < nargs; ++i) + std::size_t nargs = ov_args.length (); + for (std::size_t i = 0; i < nargs; ++i) m_argument_types[i] = jit_typeinfo::type_of (ov_args(i)); jit_function raw_fn; @@ -2538,7 +2538,7 @@ llvm::Value *wrapper_arg = wrapper.argument (builder, 0); std::vector raw_args (nargs); - for (size_t i = 0; i < nargs; ++i) + for (std::size_t i = 0; i < nargs; ++i) { llvm::Value *arg; // LLVM <= 3.6 @@ -2622,9 +2622,9 @@ // FIXME: figure out a way to delete ov_args so we avoid duplicating // refcount - size_t nargs = ov_args.length (); + std::size_t nargs = ov_args.length (); std::vector args (nargs); - for (size_t i = 0; i < nargs; ++i) + for (std::size_t i = 0; i < nargs; ++i) { octave_base_value *obv = ov_args(i).internal_rep (); obv->grab (); @@ -2646,11 +2646,11 @@ if (! m_function) return true; - size_t nargs = ov_args.length (); + std::size_t nargs = ov_args.length (); if (nargs != m_argument_types.size ()) return false; - for (size_t i = 0; i < nargs; ++i) + for (std::size_t i = 0; i < nargs; ++i) if (jit_typeinfo::type_of (ov_args(i)) != m_argument_types[i]) return false; @@ -2688,7 +2688,7 @@ return false; std::vector real_arguments (m_arguments.size ()); - for (size_t i = 0; i < m_arguments.size (); ++i) + for (std::size_t i = 0; i < m_arguments.size (); ++i) { if (m_arguments[i].second) { @@ -2705,7 +2705,7 @@ symbol_scope scope = __require_current_scope__ ("jit_info::execute"); - for (size_t i = 0; i < m_arguments.size (); ++i) + for (std::size_t i = 0; i < m_arguments.size (); ++i) { const std::string& name = m_arguments[i].first; @@ -2725,7 +2725,7 @@ if (! m_function) return true; - for (size_t i = 0; i < m_bounds.size (); ++i) + for (std::size_t i = 0; i < m_bounds.size (); ++i) { const std::string& arg_name = m_bounds[i].second; octave_value value = find (extra_vars, arg_name); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/pt-jit.h --- a/libinterp/parse-tree/pt-jit.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/pt-jit.h Wed Apr 28 22:57:42 2021 -0400 @@ -189,9 +189,9 @@ std::vector m_end_context; - size_t m_iterator_count; - size_t m_for_bounds_count; - size_t m_short_count; + std::size_t m_iterator_count; + std::size_t m_for_bounds_count; + std::size_t m_short_count; variable_map m_vmap; @@ -223,7 +223,7 @@ std::string next_shortcircut_result (bool inc = true) { return next_name ("#shortcircut_result", m_short_count, inc); } - std::string next_name (const char *prefix, size_t& count, bool inc); + std::string next_name (const char *prefix, std::size_t& count, bool inc); jit_instruction * resolve (tree_index_expression& exp, jit_value *extra_arg = nullptr, bool lhs = false); @@ -337,7 +337,7 @@ void construct_ssa (void); - void do_construct_ssa (jit_block& block, size_t avisit_count); + void do_construct_ssa (jit_block& block, std::size_t avisit_count); jit_block& entry_block (void) { return *m_blocks.front (); } @@ -510,7 +510,7 @@ bool enabled (void); - size_t trip_count (const octave_value& bounds) const; + std::size_t trip_count (const octave_value& bounds) const; }; @@ -545,7 +545,7 @@ // Create or insert an LLVM Function declaration for an intrinsic, // and return it llvm::Function* - get_intrinsic_declaration (size_t id, + get_intrinsic_declaration (std::size_t id, std::vector types) const; // Underlying type of enums defined in yet-inconplete types diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/pt-pr-code.cc --- a/libinterp/parse-tree/pt-pr-code.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/pt-pr-code.cc Wed Apr 28 22:57:42 2021 -0400 @@ -1194,9 +1194,9 @@ std::string comment = elt.text (); - size_t len = comment.length (); + std::size_t len = comment.length (); - size_t i = 0; + std::size_t i = 0; while (i < len && comment[i++] == '\n') ; // Skip leading new lines. diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/pt-tm-const.cc --- a/libinterp/parse-tree/pt-tm-const.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/pt-tm-const.cc Wed Apr 28 22:57:42 2021 -0400 @@ -608,7 +608,7 @@ { // Optimize all scalars case. TYPE result (m_dv); - assert (static_cast (result.numel ()) == row.length ()); + assert (static_cast (result.numel ()) == row.length ()); octave_idx_type i = 0; for (const auto& elt : row) result(i++) = octave_value_extract (elt); diff -r 5068a97f0f39 -r d13d090cb03a libinterp/parse-tree/pt-tm-const.h --- a/libinterp/parse-tree/pt-tm-const.h Wed Apr 28 22:23:39 2021 -0400 +++ b/libinterp/parse-tree/pt-tm-const.h Wed Apr 28 22:57:42 2021 -0400 @@ -171,7 +171,7 @@ bool empty (void) const { return m_values.empty (); } - size_t length (void) const { return m_values.size (); } + std::size_t length (void) const { return m_values.size (); } void cellify (void); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/array/Array.h --- a/liboctave/array/Array.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/array/Array.h Wed Apr 28 22:57:42 2021 -0400 @@ -446,8 +446,8 @@ return d >= ndims () ? 1 : dimensions(d); } - size_t byte_size (void) const - { return static_cast (numel ()) * sizeof (T); } + std::size_t byte_size (void) const + { return static_cast (numel ()) * sizeof (T); } //! Return a const-reference so that dims ()(i) works efficiently. const dim_vector& dims (void) const { return dimensions; } diff -r 5068a97f0f39 -r d13d090cb03a liboctave/array/CMatrix.cc --- a/liboctave/array/CMatrix.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/array/CMatrix.cc Wed Apr 28 22:57:42 2021 -0400 @@ -1018,12 +1018,12 @@ ComplexMatrix ComplexMatrix::fourier (void) const { - size_t nr = rows (); - size_t nc = cols (); + std::size_t nr = rows (); + std::size_t nc = cols (); ComplexMatrix retval (nr, nc); - size_t npts, nsamples; + std::size_t npts, nsamples; if (nr == 1 || nc == 1) { @@ -1047,12 +1047,12 @@ ComplexMatrix ComplexMatrix::ifourier (void) const { - size_t nr = rows (); - size_t nc = cols (); + std::size_t nr = rows (); + std::size_t nc = cols (); ComplexMatrix retval (nr, nc); - size_t npts, nsamples; + std::size_t npts, nsamples; if (nr == 1 || nc == 1) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/array/DiagArray2.h --- a/liboctave/array/DiagArray2.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/array/DiagArray2.h Wed Apr 28 22:57:42 2021 -0400 @@ -95,7 +95,7 @@ octave_idx_type nelem (void) const { return dim1 () * dim2 (); } octave_idx_type numel (void) const { return nelem (); } - size_t byte_size (void) const { return Array::byte_size (); } + std::size_t byte_size (void) const { return Array::byte_size (); } dim_vector dims (void) const { return dim_vector (d1, d2); } diff -r 5068a97f0f39 -r d13d090cb03a liboctave/array/PermMatrix.h --- a/liboctave/array/PermMatrix.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/array/PermMatrix.h Wed Apr 28 22:57:42 2021 -0400 @@ -69,7 +69,7 @@ octave_idx_type numel (void) const { return dim1 () * dim2 (); } - size_t byte_size (void) const + std::size_t byte_size (void) const { return Array::byte_size (); } dim_vector dims (void) const { return dim_vector (dim1 (), dim2 ()); } diff -r 5068a97f0f39 -r d13d090cb03a liboctave/array/Sparse.h --- a/liboctave/array/Sparse.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/array/Sparse.h Wed Apr 28 22:57:42 2021 -0400 @@ -260,10 +260,10 @@ return ret; } - size_t byte_size (void) const + std::size_t byte_size (void) const { - return (static_cast (cols () + 1) * sizeof (octave_idx_type) - + static_cast (nzmax ()) + return (static_cast (cols () + 1) * sizeof (octave_idx_type) + + static_cast (nzmax ()) * (sizeof (T) + sizeof (octave_idx_type))); } diff -r 5068a97f0f39 -r d13d090cb03a liboctave/array/dMatrix.cc --- a/liboctave/array/dMatrix.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/array/dMatrix.cc Wed Apr 28 22:57:42 2021 -0400 @@ -715,12 +715,12 @@ ComplexMatrix Matrix::fourier (void) const { - size_t nr = rows (); - size_t nc = cols (); + std::size_t nr = rows (); + std::size_t nc = cols (); ComplexMatrix retval (nr, nc); - size_t npts, nsamples; + std::size_t npts, nsamples; if (nr == 1 || nc == 1) { @@ -744,12 +744,12 @@ ComplexMatrix Matrix::ifourier (void) const { - size_t nr = rows (); - size_t nc = cols (); + std::size_t nr = rows (); + std::size_t nc = cols (); ComplexMatrix retval (nr, nc); - size_t npts, nsamples; + std::size_t npts, nsamples; if (nr == 1 || nc == 1) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/array/fCMatrix.cc --- a/liboctave/array/fCMatrix.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/array/fCMatrix.cc Wed Apr 28 22:57:42 2021 -0400 @@ -1021,12 +1021,12 @@ FloatComplexMatrix FloatComplexMatrix::fourier (void) const { - size_t nr = rows (); - size_t nc = cols (); + std::size_t nr = rows (); + std::size_t nc = cols (); FloatComplexMatrix retval (nr, nc); - size_t npts, nsamples; + std::size_t npts, nsamples; if (nr == 1 || nc == 1) { @@ -1050,12 +1050,12 @@ FloatComplexMatrix FloatComplexMatrix::ifourier (void) const { - size_t nr = rows (); - size_t nc = cols (); + std::size_t nr = rows (); + std::size_t nc = cols (); FloatComplexMatrix retval (nr, nc); - size_t npts, nsamples; + std::size_t npts, nsamples; if (nr == 1 || nc == 1) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/array/fMatrix.cc --- a/liboctave/array/fMatrix.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/array/fMatrix.cc Wed Apr 28 22:57:42 2021 -0400 @@ -721,12 +721,12 @@ FloatComplexMatrix FloatMatrix::fourier (void) const { - size_t nr = rows (); - size_t nc = cols (); + std::size_t nr = rows (); + std::size_t nc = cols (); FloatComplexMatrix retval (nr, nc); - size_t npts, nsamples; + std::size_t npts, nsamples; if (nr == 1 || nc == 1) { @@ -750,12 +750,12 @@ FloatComplexMatrix FloatMatrix::ifourier (void) const { - size_t nr = rows (); - size_t nc = cols (); + std::size_t nr = rows (); + std::size_t nc = cols (); FloatComplexMatrix retval (nr, nc); - size_t npts, nsamples; + std::size_t npts, nsamples; if (nr == 1 || nc == 1) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/numeric/bsxfun-defs.cc --- a/liboctave/numeric/bsxfun-defs.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/numeric/bsxfun-defs.cc Wed Apr 28 22:57:42 2021 -0400 @@ -39,9 +39,9 @@ template Array do_bsxfun_op (const Array& x, const Array& y, - void (*op_vv) (size_t, R *, const X *, const Y *), - void (*op_sv) (size_t, R *, X, const Y *), - void (*op_vs) (size_t, R *, const X *, Y)) + void (*op_vv) (std::size_t, R *, const X *, const Y *), + void (*op_sv) (std::size_t, R *, X, const Y *), + void (*op_vs) (std::size_t, R *, const X *, Y)) { int nd = std::max (x.ndims (), y.ndims ()); dim_vector dvx = x.dims ().redim (nd); @@ -140,8 +140,8 @@ template void do_inplace_bsxfun_op (Array& r, const Array& x, - void (*op_vv) (size_t, R *, const X *), - void (*op_vs) (size_t, R *, X)) + void (*op_vv) (std::size_t, R *, const X *), + void (*op_vs) (std::size_t, R *, X)) { dim_vector dvr = r.dims (); dim_vector dvx = x.dims (); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/numeric/oct-fftw.cc --- a/liboctave/numeric/oct-fftw.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/numeric/oct-fftw.cc Wed Apr 28 22:57:42 2021 -0400 @@ -141,7 +141,7 @@ } #define CHECK_SIMD_ALIGNMENT(x) \ - (((reinterpret_cast (x)) & 0xF) == 0) + (((reinterpret_cast (x)) & 0xF) == 0) void * fftw_planner::do_create_plan (int dir, const int rank, @@ -241,8 +241,8 @@ // Create matrix with the same size and 16-byte alignment as input OCTAVE_LOCAL_BUFFER (Complex, itmp, nn * howmany + 32); itmp = reinterpret_cast - (((reinterpret_cast (itmp) + 15) & ~ 0xF) + - ((reinterpret_cast (in)) & 0xF)); + (((reinterpret_cast (itmp) + 15) & ~ 0xF) + + ((reinterpret_cast (in)) & 0xF)); *cur_plan_p = fftw_plan_many_dft (rank, tmp, howmany, @@ -360,8 +360,8 @@ // Create matrix with the same size and 16-byte alignment as input OCTAVE_LOCAL_BUFFER (double, itmp, nn + 32); itmp = reinterpret_cast - (((reinterpret_cast (itmp) + 15) & ~ 0xF) + - ((reinterpret_cast (in)) & 0xF)); + (((reinterpret_cast (itmp) + 15) & ~ 0xF) + + ((reinterpret_cast (in)) & 0xF)); *cur_plan_p = fftw_plan_many_dft_r2c (rank, tmp, howmany, itmp, @@ -593,8 +593,8 @@ // Create matrix with the same size and 16-byte alignment as input OCTAVE_LOCAL_BUFFER (FloatComplex, itmp, nn * howmany + 32); itmp = reinterpret_cast - (((reinterpret_cast (itmp) + 15) & ~ 0xF) + - ((reinterpret_cast (in)) & 0xF)); + (((reinterpret_cast (itmp) + 15) & ~ 0xF) + + ((reinterpret_cast (in)) & 0xF)); *cur_plan_p = fftwf_plan_many_dft (rank, tmp, howmany, @@ -712,8 +712,8 @@ // Create matrix with the same size and 16-byte alignment as input OCTAVE_LOCAL_BUFFER (float, itmp, nn + 32); itmp = reinterpret_cast - (((reinterpret_cast (itmp) + 15) & ~ 0xF) + - ((reinterpret_cast (in)) & 0xF)); + (((reinterpret_cast (itmp) + 15) & ~ 0xF) + + ((reinterpret_cast (in)) & 0xF)); *cur_plan_p = fftwf_plan_many_dft_r2c (rank, tmp, howmany, itmp, @@ -771,15 +771,15 @@ template static inline void - convert_packcomplex_1d (T *out, size_t nr, size_t nc, + convert_packcomplex_1d (T *out, std::size_t nr, std::size_t nc, octave_idx_type stride, octave_idx_type dist) { octave_quit (); // Fill in the missing data. - for (size_t i = 0; i < nr; i++) - for (size_t j = nc/2+1; j < nc; j++) + for (std::size_t i = 0; i < nr; i++) + for (std::size_t j = nc/2+1; j < nc; j++) out[j*stride + i*dist] = conj (out[(nc - j)*stride + i*dist]); octave_quit (); @@ -789,21 +789,21 @@ static inline void convert_packcomplex_Nd (T *out, const dim_vector& dv) { - size_t nc = dv(0); - size_t nr = dv(1); - size_t np = (dv.ndims () > 2 ? dv.numel () / nc / nr : 1); - size_t nrp = nr * np; + std::size_t nc = dv(0); + std::size_t nr = dv(1); + std::size_t np = (dv.ndims () > 2 ? dv.numel () / nc / nr : 1); + std::size_t nrp = nr * np; T *ptr1, *ptr2; octave_quit (); // Create space for the missing elements. - for (size_t i = 0; i < nrp; i++) + for (std::size_t i = 0; i < nrp; i++) { ptr1 = out + i * (nc/2 + 1) + nrp*((nc-1)/2); ptr2 = out + i * nc; - for (size_t j = 0; j < nc/2+1; j++) + for (std::size_t j = 0; j < nc/2+1; j++) *ptr2++ = *ptr1++; } @@ -811,13 +811,13 @@ // Fill in the missing data for the rank = 2 case directly for speed. - for (size_t i = 0; i < np; i++) + for (std::size_t i = 0; i < np; i++) { - for (size_t j = 1; j < nr; j++) - for (size_t k = nc/2+1; k < nc; k++) + for (std::size_t j = 1; j < nr; j++) + for (std::size_t k = nc/2+1; k < nc; k++) out[k + (j + i*nr)*nc] = conj (out[nc - k + ((i+1)*nr - j)*nc]); - for (size_t j = nc/2+1; j < nc; j++) + for (std::size_t j = nc/2+1; j < nc; j++) out[j + i*nr*nc] = conj (out[(i*nr+1)*nc - j]); } @@ -825,18 +825,18 @@ // Now do the permutations needed for rank > 2 cases. - size_t jstart = dv(0) * dv(1); - size_t kstep = dv(0); - size_t nel = dv.numel (); + std::size_t jstart = dv(0) * dv(1); + std::size_t kstep = dv(0); + std::size_t nel = dv.numel (); for (int inner = 2; inner < dv.ndims (); inner++) { - size_t jmax = jstart * dv(inner); - for (size_t i = 0; i < nel; i+=jmax) - for (size_t j = jstart, jj = jmax-jstart; j < jj; + std::size_t jmax = jstart * dv(inner); + for (std::size_t i = 0; i < nel; i+=jmax) + for (std::size_t j = jstart, jj = jmax-jstart; j < jj; j+=jstart, jj-=jstart) - for (size_t k = 0; k < jstart; k+= kstep) - for (size_t l = nc/2+1; l < nc; l++) + for (std::size_t k = 0; k < jstart; k+= kstep) + for (std::size_t l = nc/2+1; l < nc; l++) { T tmp = out[i+ j + k + l]; out[i + j + k + l] = out[i + jj + k + l]; @@ -849,8 +849,8 @@ } int - fftw::fft (const double *in, Complex *out, size_t npts, - size_t nsamples, octave_idx_type stride, octave_idx_type dist) + fftw::fft (const double *in, Complex *out, std::size_t npts, + std::size_t nsamples, octave_idx_type stride, octave_idx_type dist) { dist = (dist < 0 ? npts : dist); @@ -870,8 +870,8 @@ } int - fftw::fft (const Complex *in, Complex *out, size_t npts, - size_t nsamples, octave_idx_type stride, octave_idx_type dist) + fftw::fft (const Complex *in, Complex *out, std::size_t npts, + std::size_t nsamples, octave_idx_type stride, octave_idx_type dist) { dist = (dist < 0 ? npts : dist); @@ -889,8 +889,8 @@ } int - fftw::ifft (const Complex *in, Complex *out, size_t npts, - size_t nsamples, octave_idx_type stride, + fftw::ifft (const Complex *in, Complex *out, std::size_t npts, + std::size_t nsamples, octave_idx_type stride, octave_idx_type dist) { dist = (dist < 0 ? npts : dist); @@ -905,8 +905,8 @@ reinterpret_cast (out)); const Complex scale = npts; - for (size_t j = 0; j < nsamples; j++) - for (size_t i = 0; i < npts; i++) + for (std::size_t j = 0; j < nsamples; j++) + for (std::size_t i = 0; i < npts; i++) out[i*stride + j*dist] /= scale; return 0; @@ -974,17 +974,17 @@ reinterpret_cast (const_cast(in)), reinterpret_cast (out)); - const size_t npts = dv.numel (); + const std::size_t npts = dv.numel (); const Complex scale = npts; - for (size_t i = 0; i < npts; i++) + for (std::size_t i = 0; i < npts; i++) out[i] /= scale; return 0; } int - fftw::fft (const float *in, FloatComplex *out, size_t npts, - size_t nsamples, octave_idx_type stride, octave_idx_type dist) + fftw::fft (const float *in, FloatComplex *out, std::size_t npts, + std::size_t nsamples, octave_idx_type stride, octave_idx_type dist) { dist = (dist < 0 ? npts : dist); @@ -1004,8 +1004,8 @@ } int - fftw::fft (const FloatComplex *in, FloatComplex *out, size_t npts, - size_t nsamples, octave_idx_type stride, octave_idx_type dist) + fftw::fft (const FloatComplex *in, FloatComplex *out, std::size_t npts, + std::size_t nsamples, octave_idx_type stride, octave_idx_type dist) { dist = (dist < 0 ? npts : dist); @@ -1023,8 +1023,8 @@ } int - fftw::ifft (const FloatComplex *in, FloatComplex *out, size_t npts, - size_t nsamples, octave_idx_type stride, + fftw::ifft (const FloatComplex *in, FloatComplex *out, std::size_t npts, + std::size_t nsamples, octave_idx_type stride, octave_idx_type dist) { dist = (dist < 0 ? npts : dist); @@ -1040,8 +1040,8 @@ reinterpret_cast (out)); const FloatComplex scale = npts; - for (size_t j = 0; j < nsamples; j++) - for (size_t i = 0; i < npts; i++) + for (std::size_t j = 0; j < nsamples; j++) + for (std::size_t i = 0; i < npts; i++) out[i*stride + j*dist] /= scale; return 0; @@ -1109,9 +1109,9 @@ reinterpret_cast (const_cast(in)), reinterpret_cast (out)); - const size_t npts = dv.numel (); + const std::size_t npts = dv.numel (); const FloatComplex scale = npts; - for (size_t i = 0; i < npts; i++) + for (std::size_t i = 0; i < npts; i++) out[i] /= scale; return 0; diff -r 5068a97f0f39 -r d13d090cb03a liboctave/numeric/oct-fftw.h --- a/liboctave/numeric/oct-fftw.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/numeric/oct-fftw.h Wed Apr 28 22:57:42 2021 -0400 @@ -342,14 +342,14 @@ fftw& operator = (const fftw&) = delete; - static int fft (const double *in, Complex *out, size_t npts, - size_t nsamples = 1, octave_idx_type stride = 1, + static int fft (const double *in, Complex *out, std::size_t npts, + std::size_t nsamples = 1, octave_idx_type stride = 1, octave_idx_type dist = -1); - static int fft (const Complex *in, Complex *out, size_t npts, - size_t nsamples = 1, octave_idx_type stride = 1, + static int fft (const Complex *in, Complex *out, std::size_t npts, + std::size_t nsamples = 1, octave_idx_type stride = 1, octave_idx_type dist = -1); - static int ifft (const Complex *in, Complex *out, size_t npts, - size_t nsamples = 1, octave_idx_type stride = 1, + static int ifft (const Complex *in, Complex *out, std::size_t npts, + std::size_t nsamples = 1, octave_idx_type stride = 1, octave_idx_type dist = -1); static int fftNd (const double*, Complex*, const int, const dim_vector&); @@ -358,14 +358,14 @@ static int ifftNd (const Complex*, Complex*, const int, const dim_vector&); - static int fft (const float *in, FloatComplex *out, size_t npts, - size_t nsamples = 1, octave_idx_type stride = 1, + static int fft (const float *in, FloatComplex *out, std::size_t npts, + std::size_t nsamples = 1, octave_idx_type stride = 1, octave_idx_type dist = -1); - static int fft (const FloatComplex *in, FloatComplex *out, size_t npts, - size_t nsamples = 1, octave_idx_type stride = 1, + static int fft (const FloatComplex *in, FloatComplex *out, std::size_t npts, + std::size_t nsamples = 1, octave_idx_type stride = 1, octave_idx_type dist = -1); - static int ifft (const FloatComplex *in, FloatComplex *out, size_t npts, - size_t nsamples = 1, octave_idx_type stride = 1, + static int ifft (const FloatComplex *in, FloatComplex *out, std::size_t npts, + std::size_t nsamples = 1, octave_idx_type stride = 1, octave_idx_type dist = -1); static int fftNd (const float*, FloatComplex*, const int, const dim_vector&); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/numeric/randpoisson.cc --- a/liboctave/numeric/randpoisson.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/numeric/randpoisson.cc Wed Apr 28 22:57:42 2021 -0400 @@ -282,7 +282,7 @@ template static void - poisson_cdf_lookup (double lambda, T *p, size_t n) + poisson_cdf_lookup (double lambda, T *p, std::size_t n) { double t[TABLESIZE]; @@ -291,7 +291,7 @@ int intlambda = static_cast (std::floor (lambda)); double P; int tableidx; - size_t i = n; + std::size_t i = n; t[0] = P = exp (-lambda); for (tableidx = 1; tableidx <= intlambda; tableidx++) @@ -347,12 +347,12 @@ /* From Press, et al., Numerical Recipes */ template static void - poisson_rejection (double lambda, T *p, size_t n) + poisson_rejection (double lambda, T *p, std::size_t n) { double sq = std::sqrt (2.0*lambda); double alxm = std::log (lambda); double g = lambda*alxm - xlgamma (lambda+1.0); - size_t i; + std::size_t i; for (i = 0; i < n; i++) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/numeric/sparse-chol.cc --- a/liboctave/numeric/sparse-chol.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/numeric/sparse-chol.cc Wed Apr 28 22:57:42 2021 -0400 @@ -316,7 +316,7 @@ if (minor_p > 0 && minor_p < a_nr) { - size_t n1 = a_nr + 1; + std::size_t n1 = a_nr + 1; Lsparse->p = CHOLMOD_NAME(realloc) (minor_p+1, sizeof(octave_idx_type), Lsparse->p, &n1, cm); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/operators/mx-inlines.cc --- a/liboctave/operators/mx-inlines.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/operators/mx-inlines.cc Wed Apr 28 22:57:42 2021 -0400 @@ -44,64 +44,64 @@ // Provides some commonly repeated, basic loop templates. template -inline void mx_inline_fill (size_t n, R *r, S s) +inline void mx_inline_fill (std::size_t n, R *r, S s) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = s; } template inline void -mx_inline_uminus (size_t n, R *r, const X *x) +mx_inline_uminus (std::size_t n, R *r, const X *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = -x[i]; } template inline void -mx_inline_uminus2 (size_t n, R *r) +mx_inline_uminus2 (std::size_t n, R *r) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = -r[i]; } template inline void -mx_inline_iszero (size_t n, bool *r, const X *x) +mx_inline_iszero (std::size_t n, bool *r, const X *x) { const X zero = X (); - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = x[i] == zero; } template inline void -mx_inline_notzero (size_t n, bool *r, const X *x) +mx_inline_notzero (std::size_t n, bool *r, const X *x) { const X zero = X (); - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = x[i] != zero; } -#define DEFMXBINOP(F, OP) \ - template \ - inline void F (size_t n, R *r, const X *x, const Y *y) \ - { \ - for (size_t i = 0; i < n; i++) \ - r[i] = x[i] OP y[i]; \ - } \ - template \ - inline void F (size_t n, R *r, const X *x, Y y) \ - { \ - for (size_t i = 0; i < n; i++) \ - r[i] = x[i] OP y; \ - } \ - template \ - inline void F (size_t n, R *r, X x, const Y *y) \ - { \ - for (size_t i = 0; i < n; i++) \ - r[i] = x OP y[i]; \ +#define DEFMXBINOP(F, OP) \ + template \ + inline void F (std::size_t n, R *r, const X *x, const Y *y) \ + { \ + for (std::size_t i = 0; i < n; i++) \ + r[i] = x[i] OP y[i]; \ + } \ + template \ + inline void F (std::size_t n, R *r, const X *x, Y y) \ + { \ + for (std::size_t i = 0; i < n; i++) \ + r[i] = x[i] OP y; \ + } \ + template \ + inline void F (std::size_t n, R *r, X x, const Y *y) \ + { \ + for (std::size_t i = 0; i < n; i++) \ + r[i] = x OP y[i]; \ } DEFMXBINOP (mx_inline_add, +) @@ -111,15 +111,15 @@ #define DEFMXBINOPEQ(F, OP) \ template \ - inline void F (size_t n, R *r, const X *x) \ + inline void F (std::size_t n, R *r, const X *x) \ { \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] OP x[i]; \ } \ template \ - inline void F (size_t n, R *r, X x) \ + inline void F (std::size_t n, R *r, X x) \ { \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] OP x; \ } @@ -130,21 +130,21 @@ #define DEFMXCMPOP(F, OP) \ template \ - inline void F (size_t n, bool *r, const X *x, const Y *y) \ + inline void F (std::size_t n, bool *r, const X *x, const Y *y) \ { \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] = x[i] OP y[i]; \ } \ template \ - inline void F (size_t n, bool *r, const X *x, Y y) \ + inline void F (std::size_t n, bool *r, const X *x, Y y) \ { \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] = x[i] OP y; \ } \ template \ - inline void F (size_t n, bool *r, X x, const Y *y) \ + inline void F (std::size_t n, bool *r, X x, const Y *y) \ { \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] = x OP y[i]; \ } @@ -178,38 +178,38 @@ } template -void mx_inline_not (size_t n, bool *r, const X *x) +void mx_inline_not (std::size_t n, bool *r, const X *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = ! logical_value (x[i]); } -inline void mx_inline_not2 (size_t n, bool *r) +inline void mx_inline_not2 (std::size_t n, bool *r) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = ! r[i]; } #define DEFMXBOOLOP(F, NOT1, OP, NOT2) \ template \ - inline void F (size_t n, bool *r, const X *x, const Y *y) \ + inline void F (std::size_t n, bool *r, const X *x, const Y *y) \ { \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] = ((NOT1 logical_value (x[i])) \ OP (NOT2 logical_value (y[i]))); \ } \ template \ - inline void F (size_t n, bool *r, const X *x, Y y) \ + inline void F (std::size_t n, bool *r, const X *x, Y y) \ { \ const bool yy = (NOT2 logical_value (y)); \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] = (NOT1 logical_value (x[i])) OP yy; \ } \ template \ - inline void F (size_t n, bool *r, X x, const Y *y) \ + inline void F (std::size_t n, bool *r, X x, const Y *y) \ { \ const bool xx = (NOT1 logical_value (x)); \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] = xx OP (NOT2 logical_value (y[i])); \ } @@ -222,41 +222,41 @@ template inline void -mx_inline_and2 (size_t n, bool *r, const X *x) +mx_inline_and2 (std::size_t n, bool *r, const X *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] &= logical_value (x[i]); } template inline void -mx_inline_and2 (size_t n, bool *r, X x) +mx_inline_and2 (std::size_t n, bool *r, X x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] &= x; } template inline void -mx_inline_or2 (size_t n, bool *r, const X *x) +mx_inline_or2 (std::size_t n, bool *r, const X *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] |= logical_value (x[i]); } template inline void -mx_inline_or2 (size_t n, bool *r, X x) +mx_inline_or2 (std::size_t n, bool *r, X x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] |= x; } template inline bool -mx_inline_any_nan (size_t n, const T *x) +mx_inline_any_nan (std::size_t n, const T *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) { if (octave::math::isnan (x[i])) return true; @@ -267,9 +267,9 @@ template inline bool -mx_inline_all_finite (size_t n, const T *x) +mx_inline_all_finite (std::size_t n, const T *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) { if (! octave::math::isfinite (x[i])) return false; @@ -280,9 +280,9 @@ template inline bool -mx_inline_any_negative (size_t n, const T *x) +mx_inline_any_negative (std::size_t n, const T *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) { if (x[i] < 0) return true; @@ -293,9 +293,9 @@ template inline bool -mx_inline_any_positive (size_t n, const T *x) +mx_inline_any_positive (std::size_t n, const T *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) { if (x[i] > 0) return true; @@ -306,9 +306,9 @@ template inline bool -mx_inline_all_real (size_t n, const std::complex* x) +mx_inline_all_real (std::size_t n, const std::complex* x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) { if (x[i].imag () != 0) return false; @@ -318,85 +318,85 @@ } template -inline void mx_inline_real (size_t n, T *r, const std::complex* x) +inline void mx_inline_real (std::size_t n, T *r, const std::complex* x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = x[i].real (); } template -inline void mx_inline_imag (size_t n, T *r, const std::complex* x) +inline void mx_inline_imag (std::size_t n, T *r, const std::complex* x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = x[i].imag (); } template inline void -mx_inline_xmin (size_t n, T *r, const T *x, const T *y) +mx_inline_xmin (std::size_t n, T *r, const T *x, const T *y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = octave::math::min (x[i], y[i]); } template inline void -mx_inline_xmin (size_t n, T *r, const T *x, T y) +mx_inline_xmin (std::size_t n, T *r, const T *x, T y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = octave::math::min (x[i], y); } template inline void -mx_inline_xmin (size_t n, T *r, T x, const T *y) +mx_inline_xmin (std::size_t n, T *r, T x, const T *y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = octave::math::min (x, y[i]); } template inline void -mx_inline_xmax (size_t n, T *r, const T *x, const T *y) +mx_inline_xmax (std::size_t n, T *r, const T *x, const T *y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = octave::math::max (x[i], y[i]); } template inline void -mx_inline_xmax (size_t n, T *r, const T *x, T y) +mx_inline_xmax (std::size_t n, T *r, const T *x, T y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = octave::math::max (x[i], y); } template inline void -mx_inline_xmax (size_t n, T *r, T x, const T *y) +mx_inline_xmax (std::size_t n, T *r, T x, const T *y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = octave::math::max (x, y[i]); } // Specialize array-scalar max/min #define DEFMINMAXSPEC(T, F, OP) \ template <> \ - inline void F (size_t n, T *r, const T *x, T y) \ + inline void F (std::size_t n, T *r, const T *x, T y) \ { \ if (octave::math::isnan (y)) \ std::memcpy (r, x, n * sizeof (T)); \ else \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] = (x[i] OP y ? x[i] : y); \ } \ template <> \ - inline void F (size_t n, T *r, T x, const T *y) \ + inline void F (std::size_t n, T *r, T x, const T *y) \ { \ if (octave::math::isnan (x)) \ std::memcpy (r, y, n * sizeof (T)); \ else \ - for (size_t i = 0; i < n; i++) \ + for (std::size_t i = 0; i < n; i++) \ r[i] = (y[i] OP x ? y[i] : x); \ } @@ -411,47 +411,47 @@ template inline void -mx_inline_pow (size_t n, R *r, const X *x, const Y *y) +mx_inline_pow (std::size_t n, R *r, const X *x, const Y *y) { using std::pow; - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = pow (x[i], y[i]); } template inline void -mx_inline_pow (size_t n, R *r, const X *x, Y y) +mx_inline_pow (std::size_t n, R *r, const X *x, Y y) { using std::pow; - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = pow (x[i], y); } template inline void -mx_inline_pow (size_t n, R *r, X x, const Y *y) +mx_inline_pow (std::size_t n, R *r, X x, const Y *y) { using std::pow; - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = pow (x, y[i]); } // Arbitrary function appliers. // The function is a template parameter to enable inlining. template -inline void mx_inline_map (size_t n, R *r, const X *x) +inline void mx_inline_map (std::size_t n, R *r, const X *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = fun (x[i]); } template -inline void mx_inline_map (size_t n, R *r, const X *x) +inline void mx_inline_map (std::size_t n, R *r, const X *x) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = fun (x[i]); } @@ -461,7 +461,7 @@ template inline Array do_mx_unary_op (const Array& x, - void (*op) (size_t, R *, const X *)) + void (*op) (std::size_t, R *, const X *)) { Array r (x.dims ()); op (r.numel (), r.fortran_vec (), x.data ()); @@ -487,7 +487,7 @@ template inline Array& do_mx_inplace_op (Array& r, - void (*op) (size_t, R *)) + void (*op) (std::size_t, R *)) { op (r.numel (), r.fortran_vec ()); return r; @@ -496,9 +496,9 @@ template inline Array do_mm_binary_op (const Array& x, const Array& y, - void (*op) (size_t, R *, const X *, const Y *), - void (*op1) (size_t, R *, X, const Y *), - void (*op2) (size_t, R *, const X *, Y), + void (*op) (std::size_t, R *, const X *, const Y *), + void (*op1) (std::size_t, R *, X, const Y *), + void (*op2) (std::size_t, R *, const X *, Y), const char *opname) { dim_vector dx = x.dims (); @@ -520,7 +520,7 @@ template inline Array do_ms_binary_op (const Array& x, const Y& y, - void (*op) (size_t, R *, const X *, Y)) + void (*op) (std::size_t, R *, const X *, Y)) { Array r (x.dims ()); op (r.numel (), r.fortran_vec (), x.data (), y); @@ -530,7 +530,7 @@ template inline Array do_sm_binary_op (const X& x, const Array& y, - void (*op) (size_t, R *, X, const Y *)) + void (*op) (std::size_t, R *, X, const Y *)) { Array r (y.dims ()); op (r.numel (), r.fortran_vec (), x, y.data ()); @@ -540,8 +540,8 @@ template inline Array& do_mm_inplace_op (Array& r, const Array& x, - void (*op) (size_t, R *, const X *), - void (*op1) (size_t, R *, X), + void (*op) (std::size_t, R *, const X *), + void (*op1) (std::size_t, R *, X), const char *opname) { dim_vector dr = r.dims (); @@ -559,7 +559,7 @@ template inline Array& do_ms_inplace_op (Array& r, const X& x, - void (*op) (size_t, R *, X)) + void (*op) (std::size_t, R *, X)) { op (r.numel (), r.fortran_vec (), x); return r; @@ -567,9 +567,9 @@ template inline bool -mx_inline_equal (size_t n, const T1 *x, const T2 *y) +mx_inline_equal (std::size_t n, const T1 *x, const T2 *y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) if (x[i] != y[i]) return false; return true; @@ -578,7 +578,7 @@ template inline bool do_mx_check (const Array& a, - bool (*op) (size_t, const T *)) + bool (*op) (std::size_t, const T *)) { return op (a.numel (), a.data ()); } diff -r 5068a97f0f39 -r d13d090cb03a liboctave/system/file-ops.cc --- a/liboctave/system/file-ops.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/system/file-ops.cc Wed Apr 28 22:57:42 2021 -0400 @@ -75,12 +75,12 @@ // any word separation get desired behavior. static const char *default_suffixes[] = { " ", "\n", ":", nullptr }; - static size_t - tilde_find_prefix (const std::string& s, size_t& len) + static std::size_t + tilde_find_prefix (const std::string& s, std::size_t& len) { len = 0; - size_t s_len = s.length (); + std::size_t s_len = s.length (); if (s_len == 0 || s[0] == '~') return 0; @@ -89,11 +89,11 @@ if (! prefixes.empty ()) { - for (size_t i = 0; i < s_len; i++) + for (std::size_t i = 0; i < s_len; i++) { for (int j = 0; j < prefixes.numel (); j++) { - size_t pfx_len = prefixes[j].length (); + std::size_t pfx_len = prefixes[j].length (); if (prefixes[j] == s.substr (i, pfx_len)) { @@ -110,14 +110,14 @@ // Find the end of a tilde expansion in S, and return the index // of the character which ends the tilde definition. - static size_t + static std::size_t tilde_find_suffix (const std::string& s) { - size_t s_len = s.length (); + std::size_t s_len = s.length (); string_vector suffixes = sys::file_ops::tilde_additional_suffixes; - size_t i = 0; + std::size_t i = 0; for ( ; i < s_len; i++) { @@ -128,7 +128,7 @@ { for (int j = 0; j < suffixes.numel (); j++) { - size_t sfx_len = suffixes[j].length (); + std::size_t sfx_len = suffixes[j].length (); if (suffixes[j] == s.substr (i, sfx_len)) return i; @@ -144,9 +144,9 @@ static std::string isolate_tilde_prefix (const std::string& fname) { - size_t f_len = fname.length (); + std::size_t f_len = fname.length (); - size_t len = 1; + std::size_t len = 1; while (len < f_len && ! sys::file_ops::is_dir_sep (fname[len])) len++; @@ -160,7 +160,7 @@ static std::string tilde_expand_word (const std::string& filename) { - size_t f_len = filename.length (); + std::size_t f_len = filename.length (); if (f_len == 0 || filename[0] != '~') return std::string (filename); @@ -174,7 +174,7 @@ std::string username = isolate_tilde_prefix (filename); - size_t user_len = username.length (); + std::size_t user_len = username.length (); std::string dirname; @@ -291,22 +291,22 @@ { std::string result; - size_t name_len = name.length (); + std::size_t name_len = name.length (); // Scan through S expanding tildes as we come to them. - size_t pos = 0; + std::size_t pos = 0; while (1) { if (pos > name_len) break; - size_t len; + std::size_t len; // Make START point to the tilde which starts the expansion. - size_t start = tilde_find_prefix (name.substr (pos), len); + std::size_t start = tilde_find_prefix (name.substr (pos), len); result.append (name.substr (pos, start)); @@ -317,7 +317,7 @@ // Make FINI be the index of one after the last character of the // username. - size_t fini = tilde_find_suffix (name.substr (pos)); + std::size_t fini = tilde_find_suffix (name.substr (pos)); // If both START and FINI are zero, we are all done. @@ -362,14 +362,14 @@ std::string dirname (const std::string& path) { - size_t ipos = path.find_last_of (dir_sep_chars ()); + std::size_t ipos = path.find_last_of (dir_sep_chars ()); return (ipos != std::string::npos) ? path.substr (0, ipos) : ""; } std::string tail (const std::string& path) { - size_t ipos = path.find_last_of (dir_sep_chars ()); + std::size_t ipos = path.find_last_of (dir_sep_chars ()); if (ipos != std::string::npos) ipos++; @@ -387,8 +387,8 @@ retval = path; else { - size_t n = path.length (); - for (size_t i = 0; i < n; i++) + std::size_t n = path.length (); + for (std::size_t i = 0; i < n; i++) { if (path[i] == '/') retval += dir_sep_char(); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/system/lo-sysdep.cc --- a/liboctave/system/lo-sysdep.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/system/lo-sysdep.cc Wed Apr 28 22:57:42 2021 -0400 @@ -609,7 +609,7 @@ std::wstring tmp_substr = std::wstring (w_full_file_name_str.begin (), w_first_non_ASCII); - size_t pos + std::size_t pos = tmp_substr.find_last_of (u8_to_wstring (file_ops::dir_sep_chars ())); std::string par_dir @@ -645,7 +645,7 @@ wchar_t w_filename_hash[filename_hash.length ()+1] = {0}; - for (size_t i=0; i < filename_hash.length (); i++) + for (std::size_t i=0; i < filename_hash.length (); i++) w_filename_hash[i] = filename_hash.at (i); if (CreateHardLinkW (w_filename_hash, w_orig_file_name, nullptr)) diff -r 5068a97f0f39 -r d13d090cb03a liboctave/system/oct-env.cc --- a/liboctave/system/oct-env.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/system/oct-env.cc Wed Apr 28 22:57:42 2021 -0400 @@ -314,7 +314,7 @@ prog_invocation_name = octave_set_program_name_wrapper (strsave (s.c_str ())); - size_t pos + std::size_t pos = prog_invocation_name.find_last_of (sys::file_ops::dir_sep_chars ()); // Also keep a shortened version of the program name. @@ -336,7 +336,7 @@ std::string home_dir = do_get_home_directory (); - size_t len = home_dir.length (); + std::size_t len = home_dir.length (); if (len > 1 && home_dir == name.substr (0, len) && (name.length () == len || sys::file_ops::is_dir_sep (name[len]))) @@ -353,7 +353,7 @@ bool env::do_absolute_pathname (const std::string& s) const { - size_t len = s.length (); + std::size_t len = s.length (); if (len == 0) return false; @@ -374,7 +374,7 @@ bool env::do_rooted_relative_pathname (const std::string& s) const { - size_t len = s.length (); + std::size_t len = s.length (); if (len == 0) return false; @@ -405,7 +405,7 @@ if (! (do_absolute_pathname (s) || do_rooted_relative_pathname (s))) return s; - size_t pos = s.find_last_of (sys::file_ops::dir_sep_chars ()); + std::size_t pos = s.find_last_of (sys::file_ops::dir_sep_chars ()); if (pos == std::string::npos) return s; @@ -433,8 +433,8 @@ if (! sys::file_ops::is_dir_sep (current_dir.back ())) current_dir.append (sys::file_ops::dir_sep_str ()); - size_t i = 0; - size_t slen = s.length (); + std::size_t i = 0; + std::size_t slen = s.length (); while (i < slen) { @@ -463,7 +463,7 @@ } } - size_t sep_pos; + std::size_t sep_pos; sep_pos = s.find_first_of (sys::file_ops::dir_sep_chars (), i); if (sep_pos == std::string::npos) @@ -612,7 +612,7 @@ if (path.empty ()) return; - size_t i = path.length () - 1; + std::size_t i = path.length () - 1; while (n--) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/system/oct-time.cc --- a/liboctave/system/oct-time.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/system/oct-time.cc Wed Apr 28 22:57:42 2021 -0400 @@ -191,8 +191,8 @@ const char *fmt_str = fmt.c_str (); char *buf = nullptr; - size_t bufsize = STRFTIME_BUF_INITIAL_SIZE; - size_t chars_written = 0; + std::size_t bufsize = STRFTIME_BUF_INITIAL_SIZE; + std::size_t chars_written = 0; while (chars_written == 0) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/action-container.cc --- a/liboctave/util/action-container.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/action-container.cc Wed Apr 28 22:57:42 2021 -0400 @@ -28,12 +28,12 @@ namespace octave { - void action_container::run (size_t num) + void action_container::run (std::size_t num) { if (num > size ()) num = size (); - for (size_t i = 0; i < num; i++) + for (std::size_t i = 0; i < num; i++) { run_first (); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/action-container.h --- a/liboctave/util/action-container.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/action-container.h Wed Apr 28 22:57:42 2021 -0400 @@ -193,24 +193,24 @@ virtual void run_first (void) = 0; - void run (size_t num); + void run (std::size_t num); void run (void) { run (size ()); } virtual void discard_first (void) = 0; - void discard (size_t num) + void discard (std::size_t num) { if (num > size ()) num = size (); - for (size_t i = 0; i < num; i++) + for (std::size_t i = 0; i < num; i++) discard_first (); } void discard (void) { discard (size ()); } - virtual size_t size (void) const = 0; + virtual std::size_t size (void) const = 0; bool empty (void) const { return size () == 0; } diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/base-list.h --- a/liboctave/util/base-list.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/base-list.h Wed Apr 28 22:57:42 2021 -0400 @@ -49,8 +49,8 @@ bool empty (void) const { return m_lst.empty (); } - size_t size (void) const { return m_lst.size (); } - size_t length (void) const { return size (); } + std::size_t size (void) const { return m_lst.size (); } + std::size_t length (void) const { return size (); } iterator erase (iterator pos) { return m_lst.erase (pos); } diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/caseless-str.h --- a/liboctave/util/caseless-str.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/caseless-str.h Wed Apr 28 22:57:42 2021 -0400 @@ -75,12 +75,12 @@ } // Case-insensitive comparison. - bool compare (const std::string& s, size_t limit = std::string::npos) const + bool compare (const std::string& s, std::size_t limit = std::string::npos) const { auto p1 = begin (); auto p2 = s.begin (); - size_t k = 0; + std::size_t k = 0; while (p1 != end () && p2 != s.end () && k++ < limit) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/cmd-edit.cc --- a/liboctave/util/cmd-edit.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/cmd-edit.cc Wed Apr 28 22:57:42 2021 -0400 @@ -830,7 +830,7 @@ std::string tmp = f (text, state); - size_t len = tmp.length (); + std::size_t len = tmp.length (); if (len > 0) { @@ -852,7 +852,7 @@ std::string tmp = f (text, matches, *qcp); - size_t len = tmp.length (); + std::size_t len = tmp.length (); if (len > 0) { @@ -874,7 +874,7 @@ std::string tmp = f (text, quote); - size_t len = tmp.length (); + std::size_t len = tmp.length (); if (len > 0) { @@ -1683,8 +1683,8 @@ { std::string retval; std::string tmpstr; - size_t i = 0; - size_t slen = s.length (); + std::size_t i = 0; + std::size_t slen = s.length (); int c; while (i < slen) @@ -1763,7 +1763,7 @@ { tmpstr = sys::env::get_host_name (); - size_t pos = tmpstr.find ('.'); + std::size_t pos = tmpstr.find ('.'); if (pos != std::string::npos) tmpstr.resize (pos); @@ -1825,7 +1825,7 @@ { if (tmpstr != "/" && tmpstr != "//") { - size_t pos = tmpstr.rfind ('/'); + std::size_t pos = tmpstr.rfind ('/'); if (pos != std::string::npos && pos != 0) tmpstr = tmpstr.substr (pos + 1); @@ -1929,8 +1929,8 @@ int result = 0; int digits = 0; - size_t i = 0; - size_t slen = s.length (); + std::size_t i = 0; + std::size_t slen = s.length (); while (i < slen && s[i] >= '0' && s[i] < '8') { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/cmd-hist.cc --- a/liboctave/util/cmd-hist.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/cmd-hist.cc Wed Apr 28 22:57:42 2021 -0400 @@ -123,8 +123,8 @@ { m_history_control = 0; - size_t len = control_arg.length (); - size_t beg = 0; + std::size_t len = control_arg.length (); + std::size_t beg = 0; while (beg < len) { @@ -132,7 +132,7 @@ beg++; else { - size_t end = control_arg.find (':', beg); + std::size_t end = control_arg.find (':', beg); if (end == std::string::npos) end = len; diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/data-conv.cc --- a/liboctave/util/data-conv.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/data-conv.cc Wed Apr 28 22:57:42 2021 -0400 @@ -140,13 +140,13 @@ static std::string strip_spaces (const std::string& str) { - size_t n = str.length (); + std::size_t n = str.length (); - size_t k = 0; + std::size_t k = 0; std::string s (n, '\0'); - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) if (! isspace (str[i])) s[k++] = tolower (str[i]); @@ -183,10 +183,10 @@ } \ while (0) -size_t +std::size_t oct_data_conv::data_type_size (data_type dt) { - size_t retval = -1; + std::size_t retval = -1; switch (dt) { @@ -376,13 +376,13 @@ std::string s = strip_spaces (str); - size_t pos = 0; + std::size_t pos = 0; if (s[0] == '*') input_is_output = true; else { - size_t len = s.length (); + std::size_t len = s.length (); while (pos < len && isdigit (s[pos])) pos++; @@ -447,9 +447,9 @@ std::string s = strip_spaces (str); - size_t pos = 0; + std::size_t pos = 0; - size_t len = s.length (); + std::size_t len = s.length (); while (pos < len && isdigit (s[pos])) pos++; @@ -750,7 +750,7 @@ } void -do_float_format_conversion (void *data, size_t sz, octave_idx_type len, +do_float_format_conversion (void *data, std::size_t sz, octave_idx_type len, octave::mach_info::float_format from_fmt, octave::mach_info::float_format to_fmt) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/data-conv.h --- a/liboctave/util/data-conv.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/data-conv.h Wed Apr 28 22:57:42 2021 -0400 @@ -65,7 +65,7 @@ dt_unknown = 23 // Must be last, have largest value! }; - static size_t data_type_size (data_type dt); + static std::size_t data_type_size (data_type dt); static data_type string_to_data_type (const std::string& s); @@ -110,7 +110,7 @@ = octave::mach_info::native_float_format ()); extern OCTAVE_API void -do_float_format_conversion (void *data, size_t sz, octave_idx_type len, +do_float_format_conversion (void *data, std::size_t sz, octave_idx_type len, octave::mach_info::float_format from_fmt, octave::mach_info::float_format to_fmt = octave::mach_info::native_float_format ()); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/f77-fcn.h --- a/liboctave/util/f77-fcn.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/f77-fcn.h Wed Apr 28 22:57:42 2021 -0400 @@ -32,11 +32,12 @@ #include "quit.h" #if defined (__cplusplus) +# include # include -#endif - -#if defined (__cplusplus) +using std::size_t; extern "C" { +#else +# include #endif /* This macro is obsolete. */ diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/file-info.cc --- a/liboctave/util/file-info.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/file-info.cc Wed Apr 28 22:57:42 2021 -0400 @@ -37,7 +37,7 @@ namespace octave { - std::string file_info::get_line (size_t line) const + std::string file_info::get_line (std::size_t line) const { std::string retval; @@ -46,8 +46,8 @@ if (line < m_offsets.size ()) { - size_t bol = m_offsets[line-1]; - size_t eol = m_offsets[line]; + std::size_t bol = m_offsets[line-1]; + std::size_t eol = m_offsets[line]; while (eol > 0 && eol > bol && (m_file_buf[eol-1] == '\n' || m_file_buf[eol-1] == '\r')) @@ -60,11 +60,11 @@ } std::deque - file_info::get_lines (size_t line, size_t num_lines) const + file_info::get_lines (std::size_t line, std::size_t num_lines) const { std::deque retval; - for (size_t i = line; i < line+num_lines; i++) + for (std::size_t i = line; i < line+num_lines; i++) retval.push_back (get_line (i)); return retval; @@ -81,7 +81,7 @@ if (! fs) (*current_liboctave_error_handler) ("no such file, '%s'", fname.c_str ()); - size_t sz = fs.size (); + std::size_t sz = fs.size (); std::ifstream file = sys::ifstream (fname.c_str (), std::ios::in | std::ios::binary); @@ -103,15 +103,15 @@ return retval; } - std::vector file_info::get_line_offsets (const std::string& buf) + std::vector file_info::get_line_offsets (const std::string& buf) { - std::deque tmp_offsets; + std::deque tmp_offsets; tmp_offsets.push_back (0); - size_t len = buf.length (); + std::size_t len = buf.length (); - for (size_t i = 0; i < len; i++) + for (std::size_t i = 0; i < len; i++) { char c = buf[i]; @@ -130,10 +130,10 @@ tmp_offsets.push_back (len-1); - size_t n = tmp_offsets.size (); + std::size_t n = tmp_offsets.size (); - std::vector retval (n); - size_t i = 0; + std::vector retval (n); + std::size_t i = 0; for (auto& elt : tmp_offsets) retval[i++] = elt; diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/file-info.h --- a/liboctave/util/file-info.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/file-info.h Wed Apr 28 22:57:42 2021 -0400 @@ -62,19 +62,19 @@ ~file_info (void) = default; - std::string get_line (size_t line) const; + std::string get_line (std::size_t line) const; std::deque get_lines (size_t line, size_t num_lines) const; - size_t num_lines (void) const { return m_offsets.size (); } + std::size_t num_lines (void) const { return m_offsets.size (); } std::string text (void) const { return m_file_buf; } - std::vector line_offsets (void) const { return m_offsets; } + std::vector line_offsets (void) const { return m_offsets; } sys::time timestamp (void) const { return m_timestamp; } - size_t size (void) const { return m_file_buf.length (); } + std::size_t size (void) const { return m_file_buf.length (); } private: @@ -82,14 +82,14 @@ std::string m_file_buf; // Offsets to line beginnings. - std::vector m_offsets; + std::vector m_offsets; sys::time m_timestamp; // Read entire file called fname and return the contents as a string static std::string snarf_file (const std::string& fname); - static std::vector get_line_offsets (const std::string& buf); + static std::vector get_line_offsets (const std::string& buf); }; } diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/kpse.cc --- a/liboctave/util/kpse.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/kpse.cc Wed Apr 28 22:57:42 2021 -0400 @@ -136,9 +136,9 @@ std::string ret = name; - size_t m_len = name.length (); + std::size_t m_len = name.length (); - for (size_t i = 0; i < m_len; i++) + for (std::size_t i = 0; i < m_len; i++) { if (IS_DIR_SEP (name[i]) || IS_DEVICE_SEP (name[i])) { @@ -421,7 +421,7 @@ if (home.empty ()) home = "."; - size_t home_len = home.length (); + std::size_t home_len = home.length (); /* handle leading // */ if (home_len > 1 && IS_DIR_SEP (home[0]) && IS_DIR_SEP (home[1])) @@ -778,7 +778,7 @@ Be faster to check the database, but this is more reliable. */ dir = kpse_element_dir (elt); - size_t dirlen = dir.length (); + std::size_t dirlen = dir.length (); if (dirlen > 0) { @@ -900,8 +900,8 @@ { std::list result; - size_t text_len = text.length (); - size_t start; + std::size_t text_len = text.length (); + std::size_t start; int i, c; for (start = 0, i = 0, c = 1; c && start < text_len; start = ++i) @@ -938,9 +938,9 @@ int quoted = 0; int pass_next = 0; - size_t text_len = text.length (); + std::size_t text_len = text.length (); - size_t i = indx; + std::size_t i = indx; for (; i < text_len; i++) { diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/kpse.h --- a/liboctave/util/kpse.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/kpse.h Wed Apr 28 22:57:42 2021 -0400 @@ -61,14 +61,14 @@ std::string operator * (void) { return m_path.substr (m_b, m_e-m_b); } - bool operator != (const size_t sz) { return m_b != sz; } + bool operator != (const std::size_t sz) { return m_b != sz; } private: const std::string& m_path; - size_t m_b; - size_t m_e; - size_t m_len; + std::size_t m_b; + std::size_t m_e; + std::size_t m_len; void set_end (void); void next (void); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/lo-cutils.h --- a/liboctave/util/lo-cutils.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/lo-cutils.h Wed Apr 28 22:57:42 2021 -0400 @@ -28,10 +28,12 @@ #include "octave-config.h" -#include - #if defined (__cplusplus) +#include +using std::size_t; extern "C" { +#else +#include #endif OCTAVE_API void diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/lo-hash.h --- a/liboctave/util/lo-hash.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/lo-hash.h Wed Apr 28 22:57:42 2021 -0400 @@ -34,7 +34,7 @@ { namespace crypto { - typedef void * (hash_fptr) (const char *buffer, size_t len, void *res); + typedef void * (hash_fptr) (const char *buffer, std::size_t len, void *res); std::string hash (hash_fptr hash_fcn, const std::string& str, int result_buf_len); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/lo-regexp.cc --- a/liboctave/util/lo-regexp.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/lo-regexp.cc Wed Apr 28 22:57:42 2021 -0400 @@ -74,10 +74,10 @@ // If we had a previously compiled pattern, release it. free (); - size_t max_length = MAXLOOKBEHIND; + std::size_t max_length = MAXLOOKBEHIND; - size_t pos = 0; - size_t new_pos; + std::size_t pos = 0; + std::size_t new_pos; int inames = 0; std::ostringstream buf; @@ -96,7 +96,7 @@ // that here by replacing name tokens by dummy names, and dealing // with the dummy names later. - size_t tmp_pos = m_pattern.find_first_of ('>', new_pos); + std::size_t tmp_pos = m_pattern.find_first_of ('>', new_pos); if (tmp_pos == std::string::npos) (*current_liboctave_error_handler) @@ -146,8 +146,8 @@ // avoid issues. int brackets = 1; - size_t tmp_pos1 = new_pos + 2; - size_t tmp_pos2 = tmp_pos1; + std::size_t tmp_pos1 = new_pos + 2; + std::size_t tmp_pos2 = tmp_pos1; while (tmp_pos1 < m_pattern.length () && brackets > 0) { @@ -173,7 +173,7 @@ } else { - size_t tmp_pos3 = m_pattern.find_first_of ("*+", tmp_pos2); + std::size_t tmp_pos3 = m_pattern.find_first_of ("*+", tmp_pos2); if (tmp_pos3 != std::string::npos && tmp_pos3 < tmp_pos1) { @@ -188,7 +188,7 @@ buf << m_pattern.substr (pos, new_pos - pos) << '('; - size_t i; + std::size_t i; if (m_pattern.at (tmp_pos3) == '*') i = 0; @@ -263,7 +263,7 @@ int namecount; int nameentrysize; char *nametable; - size_t idx = 0; + std::size_t idx = 0; pcre *re = static_cast (m_data); @@ -393,7 +393,7 @@ { if (nidx[j] == i) { - size_t len = ovector[2*i+1] - ovector[2*i]; + std::size_t len = ovector[2*i+1] - ovector[2*i]; named_tokens(m_named_idx(j)) = std::string (*(listptr+i-pos_offset), len); @@ -402,7 +402,7 @@ } } - size_t len = ovector[2*i+1] - ovector[2*i]; + std::size_t len = ovector[2*i+1] - ovector[2*i]; tokens(pos_match++) = std::string (*(listptr+i), len); } else @@ -460,7 +460,7 @@ // Declare rep_token_t used in processing replacement string typedef struct { - size_t pos; + std::size_t pos; int num; } rep_token_t; @@ -471,7 +471,7 @@ const regexp::match_data rx_lst = match (buffer); - size_t num_matches = rx_lst.size (); + std::size_t num_matches = rx_lst.size (); if (num_matches == 0) { @@ -491,7 +491,7 @@ std::vector tokens; tokens.reserve (5); // Reserve memory for 5 pattern replacements - for (size_t i=0; i < repstr.size (); i++) + for (std::size_t i=0; i < repstr.size (); i++) { if (repstr[i] == '\\') { @@ -526,10 +526,10 @@ if (num_tokens > 0) { // Determine replacement length - const size_t replen = repstr.size () - 2*num_tokens; + const std::size_t replen = repstr.size () - 2*num_tokens; int delta = 0; auto p = rx_lst.begin (); - for (size_t i = 0; i < num_matches; i++) + for (std::size_t i = 0; i < num_matches; i++) { octave_quit (); @@ -537,13 +537,13 @@ double end = p->end (); const Matrix pairs (p->token_extents ()); - size_t pairlen = 0; + std::size_t pairlen = 0; for (int j = 0; j < num_tokens; j++) { if (tokens[j].num == 0) - pairlen += static_cast (end - start + 1); + pairlen += static_cast (end - start + 1); else if (tokens[j].num <= pairs.rows ()) - pairlen += static_cast (pairs(tokens[j].num-1,1) + pairlen += static_cast (pairs(tokens[j].num-1,1) - pairs(tokens[j].num-1,0) + 1); } @@ -554,9 +554,9 @@ // Build replacement string rep.reserve (buffer.size () + delta); - size_t from = 0; + std::size_t from = 0; p = rx_lst.begin (); - for (size_t i = 0; i < num_matches; i++) + for (std::size_t i = 0; i < num_matches; i++) { octave_quit (); @@ -564,10 +564,10 @@ double end = p->end (); const Matrix pairs (p->token_extents ()); - rep.append (&buffer[from], static_cast (start - 1 - from)); - from = static_cast (end); + rep.append (&buffer[from], static_cast (start - 1 - from)); + from = static_cast (end); - size_t cur_pos = 0; + std::size_t cur_pos = 0; for (int j = 0; j < num_tokens; j++) { @@ -578,14 +578,14 @@ if (k == 0) { // replace with entire match - rep.append (&buffer[static_cast (end - 1)], - static_cast (end - start + 1)); + rep.append (&buffer[static_cast (end - 1)], + static_cast (end - start + 1)); } else if (k <= pairs.rows ()) { // replace with group capture - rep.append (&buffer[static_cast (pairs(k-1,0)-1)], - static_cast (pairs(k-1,1) + rep.append (&buffer[static_cast (pairs(k-1,0)-1)], + static_cast (pairs(k-1,1) - pairs(k-1,0) + 1)); } else @@ -603,10 +603,10 @@ else { // Determine repstr length - const size_t replen = repstr.size (); + const std::size_t replen = repstr.size (); int delta = 0; auto p = rx_lst.begin (); - for (size_t i = 0; i < num_matches; i++) + for (std::size_t i = 0; i < num_matches; i++) { octave_quit (); @@ -617,15 +617,15 @@ // Build replacement string rep.reserve (buffer.size () + delta); - size_t from = 0; + std::size_t from = 0; p = rx_lst.begin (); - for (size_t i = 0; i < num_matches; i++) + for (std::size_t i = 0; i < num_matches; i++) { octave_quit (); rep.append (&buffer[from], - static_cast (p->start () - 1 - from)); - from = static_cast (p->end ()); + static_cast (p->start () - 1 - from)); + from = static_cast (p->end ()); rep.append (repstr); p++; } diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/oct-base64.cc --- a/liboctave/util/oct-base64.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/oct-base64.cc Wed Apr 28 22:57:42 2021 -0400 @@ -36,11 +36,11 @@ namespace octave { bool - base64_encode (const char *inc, const size_t inlen, char **out) + base64_encode (const char *inc, const std::size_t inlen, char **out) { bool ret = false; - size_t outlen = octave_base64_encode_alloc_wrapper (inc, inlen, out); + std::size_t outlen = octave_base64_encode_alloc_wrapper (inc, inlen, out); if (! out) { @@ -63,7 +63,7 @@ Array retval; double *out; - size_t outlen; + std::size_t outlen; bool ok = octave_base64_decode_alloc_wrapper (str.data (), str.length (), diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/oct-base64.h --- a/liboctave/util/oct-base64.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/oct-base64.h Wed Apr 28 22:57:42 2021 -0400 @@ -35,7 +35,7 @@ namespace octave { extern OCTAVE_API bool - base64_encode (const char *inc, const size_t inlen, char **out); + base64_encode (const char *inc, const std::size_t inlen, char **out); extern OCTAVE_API Array base64_decode (const std::string& str); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/oct-binmap.h --- a/liboctave/util/oct-binmap.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/oct-binmap.h Wed Apr 28 22:57:42 2021 -0400 @@ -81,23 +81,23 @@ } static void - op_mm (size_t n, R *r, const X *x, const Y *y) + op_mm (std::size_t n, R *r, const X *x, const Y *y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = s_fcn (x[i], y[i]); } static void - op_sm (size_t n, R *r, X x, const Y *y) + op_sm (std::size_t n, R *r, X x, const Y *y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = s_fcn (x, y[i]); } static void - op_ms (size_t n, R *r, const X *x, Y y) + op_ms (std::size_t n, R *r, const X *x, Y y) { - for (size_t i = 0; i < n; i++) + for (std::size_t i = 0; i < n; i++) r[i] = s_fcn (x[i], y); } }; diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/oct-glob.cc --- a/liboctave/util/oct-glob.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/oct-glob.cc Wed Apr 28 22:57:42 2021 -0400 @@ -169,7 +169,7 @@ std::string escaped; escaped.reserve (xpat.length ()); - for (size_t j = 0; j < xpat.length (); j++) + for (std::size_t j = 0; j < xpat.length (); j++) { #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)) @@ -219,7 +219,7 @@ std::string unescaped; unescaped.reserve (tmp.length ()); - for (size_t m = 0; m < tmp.length (); m++) + for (std::size_t m = 0; m < tmp.length (); m++) { #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)) diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/oct-shlib.cc --- a/liboctave/util/oct-shlib.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/oct-shlib.cc Wed Apr 28 22:57:42 2021 -0400 @@ -354,8 +354,8 @@ (*current_liboctave_error_handler) ("Unable to get handle to own process."); - size_t lib_num = 64; - size_t size_lib = sizeof (HMODULE); + std::size_t lib_num = 64; + std::size_t size_lib = sizeof (HMODULE); HMODULE *h_libs; DWORD bytes_all_libs; bool got_libs; @@ -375,7 +375,7 @@ if (got_libs) { - for (size_t i = 0; i < (bytes_all_libs / size_lib); i++) + for (std::size_t i = 0; i < (bytes_all_libs / size_lib); i++) { // Check for function in library. function = reinterpret_cast diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/oct-shlib.h --- a/liboctave/util/oct-shlib.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/oct-shlib.h Wed Apr 28 22:57:42 2021 -0400 @@ -86,7 +86,7 @@ std::string file_name (void) const { return m_file; } - size_t num_fcn_names (void) const { return m_fcn_names.size (); } + std::size_t num_fcn_names (void) const { return m_fcn_names.size (); } std::list function_names (void) const; @@ -107,10 +107,10 @@ static std::map s_instances; // Set of hooked function names. - typedef std::map::iterator fcn_names_iterator; - typedef std::map::const_iterator fcn_names_const_iterator; + typedef std::map::iterator fcn_names_iterator; + typedef std::map::const_iterator fcn_names_const_iterator; - std::map m_fcn_names; + std::map m_fcn_names; std::string m_file; sys::time m_time_loaded; bool m_search_all_loaded; @@ -188,7 +188,7 @@ bool remove (const std::string& name) { return m_rep->remove_fcn_name (name); } - size_t number_of_functions_loaded (void) const + std::size_t number_of_functions_loaded (void) const { return m_rep->num_fcn_names (); } bool is_out_of_date (void) const diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/oct-sort.cc --- a/liboctave/util/oct-sort.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/oct-sort.cc Wed Apr 28 22:57:42 2021 -0400 @@ -496,10 +496,10 @@ } static inline octave_idx_type -roundupsize (size_t n) +roundupsize (std::size_t n) { unsigned int nbits = 3; - size_t n2 = n >> 8; + std::size_t n2 = n >> 8; /* Round up: * If n < 256, to a multiple of 8. @@ -529,11 +529,11 @@ nbits += 3; } - size_t new_size = ((n >> nbits) + 1) << nbits; + std::size_t new_size = ((n >> nbits) + 1) << nbits; if (new_size == 0 || new_size - > static_cast (std::numeric_limits::max ())) + > static_cast (std::numeric_limits::max ())) (*current_liboctave_error_handler) ("unable to allocate sufficient memory for sort"); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/oct-string.cc --- a/liboctave/util/oct-string.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/oct-string.cc Wed Apr 28 22:57:42 2021 -0400 @@ -498,9 +498,9 @@ { const uint8_t *src = reinterpret_cast (u8_string.c_str ()); - size_t srclen = u8_string.length (); + std::size_t srclen = u8_string.length (); - size_t length; + std::size_t length; char *native_str = octave_u8_conv_to_encoding (encoding.c_str (), src, srclen, &length); @@ -530,9 +530,9 @@ const std::string& encoding) { const char *src = native_string.c_str (); - size_t srclen = native_string.length (); + std::size_t srclen = native_string.length (); - size_t length; + std::size_t length; uint8_t *utf8_str = octave_u8_conv_from_encoding (encoding.c_str (), src, srclen, &length); if (! utf8_str) @@ -585,7 +585,7 @@ else if (type == U8_ISO_8859_1) { std::string fallback = "iso-8859-1"; - size_t lengthp; + std::size_t lengthp; uint8_t *val_utf8 = octave_u8_conv_from_encoding (fallback.c_str (), inv_utf8, 1, &lengthp); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/quit.cc --- a/liboctave/util/quit.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/quit.cc Wed Apr 28 22:57:42 2021 -0400 @@ -67,7 +67,7 @@ { std::string execution_exception::stack_trace (void) const { - size_t nframes = m_stack_info.size (); + std::size_t nframes = m_stack_info.size (); if (nframes == 0) return std::string (); diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/unwind-prot.h --- a/liboctave/util/unwind-prot.h Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/unwind-prot.h Wed Apr 28 22:57:42 2021 -0400 @@ -80,7 +80,7 @@ } } - size_t size (void) const { return m_lifo.size (); } + std::size_t size (void) const { return m_lifo.size (); } protected: diff -r 5068a97f0f39 -r d13d090cb03a liboctave/util/url-transfer.cc --- a/liboctave/util/url-transfer.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/liboctave/util/url-transfer.cc Wed Apr 28 22:57:42 2021 -0400 @@ -243,7 +243,7 @@ #if defined (HAVE_CURL) static int - write_data (void *buffer, size_t size, size_t nmemb, void *streamp) + write_data (void *buffer, std::size_t size, std::size_t nmemb, void *streamp) { std::ostream& stream = *(static_cast (streamp)); stream.write (static_cast (buffer), size*nmemb); @@ -251,7 +251,7 @@ } static int - read_data (void *buffer, size_t size, size_t nmemb, void *streamp) + read_data (void *buffer, std::size_t size, std::size_t nmemb, void *streamp) { std::istream& stream = *(static_cast (streamp)); stream.read (static_cast (buffer), size*nmemb); @@ -261,10 +261,10 @@ return (stream.fail () ? 0 : size * nmemb); } - static size_t - throw_away (void *, size_t size, size_t nmemb, void *) + static std::size_t + throw_away (void *, std::size_t size, std::size_t nmemb, void *) { - return static_cast (size * nmemb); + return static_cast (size * nmemb); } // I'd love to rewrite this as a private method of the url_transfer @@ -539,7 +539,7 @@ // Count number of directory entries std::string str = buf.str (); octave_idx_type n = 0; - size_t pos = 0; + std::size_t pos = 0; while (true) { pos = str.find_first_of ('\n', pos); @@ -552,7 +552,7 @@ pos = 0; for (octave_idx_type i = 0; i < n; i++) { - size_t newpos = str.find_first_of ('\n', pos); + std::size_t newpos = str.find_first_of ('\n', pos); if (newpos == std::string::npos) break; @@ -633,8 +633,8 @@ retval = buf.str (); // Can I assume that the path is always in "" on the last line - size_t pos2 = retval.rfind ('"'); - size_t pos1 = retval.rfind ('"', pos2 - 1); + std::size_t pos2 = retval.rfind ('"'); + std::size_t pos1 = retval.rfind ('"', pos2 - 1); retval = retval.substr (pos1 + 1, pos2 - pos1 - 1); SETOPTR (CURLOPT_HEADERFUNCTION, 0); diff -r 5068a97f0f39 -r d13d090cb03a src/main.in.cc --- a/src/main.in.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/src/main.in.cc Wed Apr 28 22:57:42 2021 -0400 @@ -308,9 +308,9 @@ // Handle all single-letter command line options here; they may // occur alone or may be aggregated into a single argument. - size_t len = strlen (argv[i]); + std::size_t len = strlen (argv[i]); - for (size_t j = 1; j < len; j++) + for (std::size_t j = 1; j < len; j++) switch (argv[i][j]) { case 'W': diff -r 5068a97f0f39 -r d13d090cb03a src/mkoctfile.in.cc --- a/src/mkoctfile.in.cc Wed Apr 28 22:23:39 2021 -0400 +++ b/src/mkoctfile.in.cc Wed Apr 28 22:57:42 2021 -0400 @@ -161,7 +161,7 @@ { #if defined (OCTAVE_REPLACE_PREFIX) const std::string match = "${prefix}"; - size_t pos = s.find (match); + std::size_t pos = s.find (match); while (pos != std::string::npos ) { s.replace(pos, match.length (), prepend_octave_exec_home ("")); @@ -531,7 +531,7 @@ { std::string retval; - size_t pos = s.rfind ('.'); + std::size_t pos = s.rfind ('.'); if (pos == std::string::npos) retval = s; @@ -540,7 +540,7 @@ if (strip_path) { - size_t p1 = retval.rfind ('/'), p2 = retval.rfind ('\\'); + std::size_t p1 = retval.rfind ('/'), p2 = retval.rfind ('\\'); pos = (p1 != std::string::npos && p2 != std::string::npos ? std::max (p1, p2) : (p2 != std::string::npos ? p2 : p1)); @@ -908,8 +908,8 @@ // length. octfile = outputfile; - size_t len = octfile.length (); - size_t len_ext = output_ext.length (); + std::size_t len = octfile.length (); + std::size_t len_ext = output_ext.length (); if (len <= len_ext || octfile.substr (len-len_ext) != output_ext) octfile += output_ext; } @@ -957,13 +957,13 @@ #else std::ofstream fo (dfile.c_str ()); #endif - size_t pos; + std::size_t pos; while (! feof (fd)) { line = get_line (fd); if ((pos = line.rfind (".o:")) != std::string::npos) { - size_t spos = line.rfind ('/', pos); + std::size_t spos = line.rfind ('/', pos); std::string ofile = (spos == std::string::npos ? line.substr (0, pos+2) @@ -1016,13 +1016,13 @@ #else std::ofstream fo (dfile.c_str ()); #endif - size_t pos; + std::size_t pos; while (! feof (fd)) { line = get_line (fd); if ((pos = line.rfind (".o:")) != std::string::npos) { - size_t spos = line.rfind ('/', pos); + std::size_t spos = line.rfind ('/', pos); std::string ofile = (spos == std::string::npos ? line.substr (0, pos+2) diff -r 5068a97f0f39 -r d13d090cb03a src/shared-fcns.h --- a/src/shared-fcns.h Wed Apr 28 22:23:39 2021 -0400 +++ b/src/shared-fcns.h Wed Apr 28 22:57:42 2021 -0400 @@ -55,7 +55,7 @@ namebuf[MAX_PATH] = '\0'; std::string exe_name = namebuf; - size_t pos = exe_name.rfind ('\\'); + std::size_t pos = exe_name.rfind ('\\'); if (pos != std::string::npos) bin_dir = exe_name.substr (0, pos + 1); @@ -63,7 +63,7 @@ if (! bin_dir.empty ()) { - size_t pos = bin_dir.rfind (R"(\bin\)"); + std::size_t pos = bin_dir.rfind (R"(\bin\)"); if (pos != std::string::npos) retval = bin_dir.substr (0, pos); @@ -141,7 +141,7 @@ static bool absolute_pathname (const std::string& s) { - size_t len = s.length (); + std::size_t len = s.length (); if (len == 0) return false;