From 13a8d3e9ee1479a4d5bf39be0e789271ebf5fd4c Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (home)" <j.wuttke@fz-juelich.de>
Date: Sun, 10 Nov 2013 14:39:54 +0100
Subject: [PATCH] Two more ranged loops. Avoid 'auto' for simple types.

---
 pub/src/dualplot.cpp | 8 ++++----
 pub/src/edif.cpp     | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/pub/src/dualplot.cpp b/pub/src/dualplot.cpp
index f1d25fe3..0e7510ec 100644
--- a/pub/src/dualplot.cpp
+++ b/pub/src/dualplot.cpp
@@ -336,16 +336,16 @@ void CPlot::writePostscript( string ps_outdir, string ps_head, string ps_dict )
     // append specific output to output file:
     if ( !(pssav = fopen( outf.c_str(), "a+" )) )
         throw "cannot append contents to file " + outf;
-    for( int i=0; i<ps_accu.size(); ++i ){
+    for( string lin: ps_accu ){
         // fprintf does not work here because output line may contain "%"
-        fwrite( ps_accu[i].c_str(), 1, ps_accu[i].size(), pssav );
+        fwrite( lin.c_str(), 1, lin.size(), pssav );
     }
 
     // additional output (do not append this to ps_accu to allow
     // further incrementation of ps_accu):
     fprintf( pssav, "\n{ black 0 -4 13 1.65 NewList\n" );
-    for ( int i=0; i<ps_Doc.size(); i++ ) 
-        fprintf( pssav, "%s\n", ps_Doc[i].c_str() );
+    for ( string lin: ps_Doc ) 
+        fprintf( pssav, "%s\n", lin.c_str() );
     fprintf( pssav, "} oooinfo 1 eq { exec } { pop } ifelse\n" );
 
     fprintf( pssav, 
diff --git a/pub/src/edif.cpp b/pub/src/edif.cpp
index 75241112..82ad0a74 100644
--- a/pub/src/edif.cpp
+++ b/pub/src/edif.cpp
@@ -92,14 +92,14 @@ void NEdif::showSpectra()
         POlc fc = P2C( f );
         POld fd = P2D( f );
         printf( "%3s ", "j" );
-        for ( auto zco: f->ZCo )
+        for ( CCoord& zco: f->ZCo )
             printf(" %12.12s", zco.str_compact().c_str());
         printf( " %12s (%4s) %12s\n", "x_inf", "#pts", "x_sup" );
         if( fd ) {
             for ( int j=0; j<f->nJ(); j++ ) {
                 printf( "%3u%c", j,
                         f->V[j]->frozen ? '/' : ' ' );
-                for ( auto z: f->V[j]->z )
+                for ( double z: f->V[j]->z )
                     printf( " %12.6g", z );
                 printf( " %12.6g (%4u) %12.6g\n", 
                         fd->VS(j)->x[0], fd->nPts(j),
-- 
GitLab