diff libinterp/corefcn/oct-stream.cc @ 25337:3ff9192b676e

use auto keyword to declare iterator variables where possible * dialog.cc, files-dock-widget.cc, history-dock-widget.cc, file-editor.cc, octave-qt-link.cc, call-stack.cc, debug.cc, dynamic-ld.cc, fcn-info.cc, fcn-info.h, genprops.awk, graphics.cc, gtk-manager.cc, gtk-manager.h, hook-fcn.h, load-path.cc, load-save.cc, ls-mat5.cc, mex.cc, oct-map.cc, oct-stream.cc, octave-link.cc, regexp.cc, symscope.h, symtab.h, txt-eng.h, url-handle-manager.cc, variables.cc, ov-base.cc, ov-class.cc, ov-classdef.cc, ov-fcn-handle.cc, ov-java.cc, ov-struct.cc, bp-table.cc, jit-ir.cc, jit-typeinfo.cc, pt-arg-list.cc, pt-arg-list.h, pt-array-list.cc, pt-check.cc, pt-classdef.cc, pt-decl.h, pt-eval.cc, pt-idx.cc, pt-jit.cc, pt-misc.cc, pt-pr-code.cc, pt-select.h, pt-stmt.h, caseless-str.h, lo-regexp.cc: Use auto keyword to declare iterator variables where possible. Style fixes.
author John W. Eaton <jwe@octave.org>
date Wed, 02 May 2018 01:36:20 -0400
parents 389757b7b6af
children 416856765a55
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc	Wed May 02 00:30:00 2018 -0400
+++ b/libinterp/corefcn/oct-stream.cc	Wed May 02 01:36:20 2018 -0400
@@ -3391,7 +3391,7 @@
                               Array<octave_idx_type> row, int& done_after)
   {
     const textscan_format_elt *elem = fmt_list.first ();
-    std::list<octave_value>::iterator out = retval.begin ();
+    auto out = retval.begin ();
     bool no_conversions = true;
     bool done = false;
     bool conversion_failed = false;       // Record for ReturnOnError
@@ -6312,8 +6312,7 @@
 
     octave_idx_type j = 0;
 
-    for (std::list<void *>::const_iterator it = input_buf_list.begin ();
-         it != input_buf_list.end (); it++)
+    for (auto it = input_buf_list.begin (); it != input_buf_list.end (); it++)
       {
         SRC_T *data = static_cast<SRC_T *> (*it);
 
@@ -7358,7 +7357,7 @@
       retval = lookup_cache->second;
     else
       {
-        ostrl_map::const_iterator iter = list.find (fid);
+        auto iter = list.find (fid);
 
         if (iter == list.end ())
           err_invalid_file_id (fid, who);
@@ -7384,7 +7383,7 @@
     if (fid < 3)
       err_invalid_file_id (fid, who);
 
-    ostrl_map::iterator iter = list.find (fid);
+    auto iter = list.find (fid);
 
     if (iter == list.end ())
       err_invalid_file_id (fid, who);
@@ -7431,7 +7430,7 @@
         list[2].flush ();
       }
 
-    for (ostrl_map::iterator iter = list.begin (); iter != list.end (); )
+    for (auto iter = list.begin (); iter != list.end (); )
       {
         int fid = iter->first;
         if (fid < 3)  // Don't delete stdin, stdout, stderr
@@ -7475,7 +7474,7 @@
       os = lookup_cache->second;
     else
       {
-        ostrl_map::const_iterator iter = list.find (fid);
+        auto iter = list.find (fid);
 
         if (iter == list.end ())
           return retval;