comparison libinterp/corefcn/graphics.cc @ 29572:aef11bb4e6d1

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.
author John W. Eaton <jwe@octave.org>
date Wed, 28 Apr 2021 22:57:42 -0400
parents 8811d8274118
children f72796c1ccbc
comparison
equal deleted inserted replaced
29571:76deb8194590 29572:aef11bb4e6d1
84 static caseless_str 84 static caseless_str
85 validate_property_name (const std::string& who, const std::string& what, 85 validate_property_name (const std::string& who, const std::string& what,
86 const std::set<std::string>& pnames, 86 const std::set<std::string>& pnames,
87 const caseless_str& pname) 87 const caseless_str& pname)
88 { 88 {
89 size_t len = pname.length (); 89 std::size_t len = pname.length ();
90 std::set<std::string> matches; 90 std::set<std::string> matches;
91 91
92 // Find exact or partial matches to property name 92 // Find exact or partial matches to property name
93 for (const auto& propnm : pnames) 93 for (const auto& propnm : pnames)
94 { 94 {
99 99
100 matches.insert (propnm); 100 matches.insert (propnm);
101 } 101 }
102 } 102 }
103 103
104 size_t num_matches = matches.size (); 104 std::size_t num_matches = matches.size ();
105 105
106 if (num_matches == 0) 106 if (num_matches == 0)
107 error ("%s: unknown %s property %s", 107 error ("%s: unknown %s property %s",
108 who.c_str (), what.c_str (), pname.c_str ()); 108 who.c_str (), what.c_str (), pname.c_str ());
109 else if (num_matches > 1) 109 else if (num_matches > 1)
1295 } 1295 }
1296 1296
1297 radio_values::radio_values (const std::string& opt_string) 1297 radio_values::radio_values (const std::string& opt_string)
1298 : default_val (), possible_vals () 1298 : default_val (), possible_vals ()
1299 { 1299 {
1300 size_t beg = 0; 1300 std::size_t beg = 0;
1301 size_t len = opt_string.length (); 1301 std::size_t len = opt_string.length ();
1302 bool done = len == 0; 1302 bool done = len == 0;
1303 1303
1304 while (! done) 1304 while (! done)
1305 { 1305 {
1306 size_t end = opt_string.find ('|', beg); 1306 std::size_t end = opt_string.find ('|', beg);
1307 1307
1308 if (end == std::string::npos) 1308 if (end == std::string::npos)
1309 { 1309 {
1310 end = len; 1310 end = len;
1311 done = true; 1311 done = true;
2303 // --------------------------------------------------------------------- 2303 // ---------------------------------------------------------------------
2304 2304
2305 void 2305 void
2306 property_list::set (const caseless_str& name, const octave_value& val) 2306 property_list::set (const caseless_str& name, const octave_value& val)
2307 { 2307 {
2308 size_t offset = 0; 2308 std::size_t offset = 0;
2309 2309
2310 size_t len = name.length (); 2310 std::size_t len = name.length ();
2311 2311
2312 if (len > 4) 2312 if (len > 4)
2313 { 2313 {
2314 caseless_str pfx = name.substr (0, 4); 2314 caseless_str pfx = name.substr (0, 4);
2315 2315
2448 octave_value 2448 octave_value
2449 property_list::lookup (const caseless_str& name) const 2449 property_list::lookup (const caseless_str& name) const
2450 { 2450 {
2451 octave_value retval; 2451 octave_value retval;
2452 2452
2453 size_t offset = 0; 2453 std::size_t offset = 0;
2454 2454
2455 size_t len = name.length (); 2455 std::size_t len = name.length ();
2456 2456
2457 if (len > 4) 2457 if (len > 4)
2458 { 2458 {
2459 caseless_str pfx = name.substr (0, 4); 2459 caseless_str pfx = name.substr (0, 4);
2460 2460
9293 } 9293 }
9294 9294
9295 void 9295 void
9296 axes::properties::clear_zoom_stack (bool do_unzoom) 9296 axes::properties::clear_zoom_stack (bool do_unzoom)
9297 { 9297 {
9298 size_t items_to_leave_on_stack = (do_unzoom ? 7 : 0); 9298 std::size_t items_to_leave_on_stack = (do_unzoom ? 7 : 0);
9299 9299
9300 while (zoom_stack.size () > items_to_leave_on_stack) 9300 while (zoom_stack.size () > items_to_leave_on_stack)
9301 zoom_stack.pop_front (); 9301 zoom_stack.pop_front ();
9302 9302
9303 if (do_unzoom) 9303 if (do_unzoom)
13968 error ("drawnow: empty output ''"); 13968 error ("drawnow: empty output ''");
13969 else if (file.length () == 1 && file[0] == '|') 13969 else if (file.length () == 1 && file[0] == '|')
13970 error ("drawnow: empty pipe '|'"); 13970 error ("drawnow: empty pipe '|'");
13971 else if (file[0] != '|') 13971 else if (file[0] != '|')
13972 { 13972 {
13973 size_t pos = file.find_last_of (octave::sys::file_ops::dir_sep_chars ()); 13973 std::size_t pos = file.find_last_of (octave::sys::file_ops::dir_sep_chars ());
13974 13974
13975 if (pos != std::string::npos) 13975 if (pos != std::string::npos)
13976 { 13976 {
13977 std::string dirname = file.substr (0, pos+1); 13977 std::string dirname = file.substr (0, pos+1);
13978 13978