From 5ed34d10445e08b1e41588a153fa27002316889c Mon Sep 17 00:00:00 2001
From: JWu <j.wuttke@fz-juelich.de>
Date: Fri, 1 Mar 2013 10:40:51 +0100
Subject: [PATCH] clean up using cpplint

---
 pub/src/STYLE     | 5 ++++-
 pub/src/axis.cpp  | 4 ++--
 pub/src/curve.cpp | 2 +-
 pub/src/edif.cpp  | 2 +-
 pub/src/jsel.cpp  | 1 +
 pub/src/list.cpp  | 1 +
 pub/src/manip.cpp | 2 --
 pub/src/mem.cpp   | 4 ++--
 pub/src/node.cpp  | 1 +
 pub/src/olf.h     | 2 +-
 pub/src/opr.cpp   | 8 ++++----
 pub/src/plot.cpp  | 2 --
 pub/src/rssm.cpp  | 8 +++-----
 13 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/pub/src/STYLE b/pub/src/STYLE
index eb7f50bf..a57f8dfe 100644
--- a/pub/src/STYLE
+++ b/pub/src/STYLE
@@ -1,3 +1,7 @@
+== checks ==
+
+cpplint.py --counting=detailed [a-v,z]*.*[ph] 2> ~/h
+
 == include's ==
 
 - Block 1: Standard software
@@ -29,4 +33,3 @@
 
 - "const" with pointer arguments is poorly understood (even less so with
   shared_ptr)
-
diff --git a/pub/src/axis.cpp b/pub/src/axis.cpp
index 89ac4692..f247290a 100644
--- a/pub/src/axis.cpp
+++ b/pub/src/axis.cpp
@@ -76,7 +76,7 @@ void CAxis::ask_and_set( const string& quest )
         } else if ( resp1 == "\\EOL" ) {
             inf_in = inf;
         } else if( triv::any2dbl(resp1,&inf_in) ) {
-            ; // ok
+            // ok
         } else {
             cout << "required input: plot axis range\n"
                 "examples:\n"
@@ -99,7 +99,7 @@ void CAxis::ask_and_set( const string& quest )
         } else if ( resp2 == "" || resp2 == "\\EOL" ) {
             sup_in = sup;
         } else if( triv::any2dbl(resp2,&sup_in) ) {
-            ; // ok
+            // ok
         } else {
             cout << "invalid upper bound; use '?' for help\n";
             continue;
diff --git a/pub/src/curve.cpp b/pub/src/curve.cpp
index ad69b2cb..bc8fb030 100644
--- a/pub/src/curve.cpp
+++ b/pub/src/curve.cpp
@@ -103,7 +103,7 @@ void COlc::parseFunction( const string& _expr )
 
 void COlc::askCurve( const string& quest )
 {
-ask_again:
+ ask_again:
     string resp = sask( quest+" (or e(c|i)(r|w); h for help) ?" );
     if        ( resp=="h" ) {
         cout <<
diff --git a/pub/src/edif.cpp b/pub/src/edif.cpp
index a8a3ffcb..c9d308e5 100644
--- a/pub/src/edif.cpp
+++ b/pub/src/edif.cpp
@@ -175,7 +175,7 @@ void NEdif::ShowNumpar()
         cout << "# file " << fiter.k() << ":\n";
         for ( uint m=0; m<f->RPar.size(); m++ ) {
             cout << "  " << f->RPar[m].Co.str_compact() << ": " <<
-                f->RPar[m].val << "\n" ;
+                f->RPar[m].val << "\n";
         }
     }
 }
diff --git a/pub/src/jsel.cpp b/pub/src/jsel.cpp
index cd552c1c..d6942965 100644
--- a/pub/src/jsel.cpp
+++ b/pub/src/jsel.cpp
@@ -9,6 +9,7 @@
 
 #include <string>
 #include <vector>
+#include <algorithm>
 
 #include <read-plus/ask.hpp>
 
diff --git a/pub/src/list.cpp b/pub/src/list.cpp
index 0c3a668a..63e4f446 100644
--- a/pub/src/list.cpp
+++ b/pub/src/list.cpp
@@ -8,6 +8,7 @@
 //! \brief index collection CList
 
 #include <iostream>
+#include <string>
 #include <vector>
 #include <algorithm>
 
diff --git a/pub/src/manip.cpp b/pub/src/manip.cpp
index 5f4c6eaa..d71a75ef 100644
--- a/pub/src/manip.cpp
+++ b/pub/src/manip.cpp
@@ -382,7 +382,6 @@ void NManip::PtsSymmetrize()
                 else
                     sout->push_xy( ( -sin->x[il-i] + sin->x[ih+i] ) / 2,
                                    ( sin->y[il-i] + sin->y[ih+i] ) / 2 );
-
             }
             if( nl<nh ){
                 for (i=nl; i<nh; ++i)
@@ -640,7 +639,6 @@ void NManip::ScaExch()
         uint ji, jf;
 
         for ( ji=0; ji<fin->nJ(); ) {
-
             zcommon.clear();
             for ( uint i=0; i<izco; ++i)
                 zcommon.push_back(fin->V[ji]->z[i]);
diff --git a/pub/src/mem.cpp b/pub/src/mem.cpp
index fd22dc3e..98ea67a8 100644
--- a/pub/src/mem.cpp
+++ b/pub/src/mem.cpp
@@ -203,7 +203,7 @@ namespace NOlm {
     {
         IterateD iter2;
         uint ret = 0;
-        for( ; iter2(); ++ret );
+        for( ; iter2(); ++ret ) {};
         return ret;
     }
 
@@ -218,7 +218,7 @@ namespace NOlm {
     {
         IterateC iter2;
         uint ret = 0;
-        for( ; iter2(); ++ret );
+        for( ; iter2(); ++ret ) {};
         return ret;
     }
 }
diff --git a/pub/src/node.cpp b/pub/src/node.cpp
index 24ca2001..3656610d 100644
--- a/pub/src/node.cpp
+++ b/pub/src/node.cpp
@@ -11,6 +11,7 @@
 #include <iostream>
 #include <string>
 #include <vector>
+#include <algorithm>
 
 #include "defs.h"
 #include "olf.h"
diff --git a/pub/src/olf.h b/pub/src/olf.h
index 5b41c468..33f7b8ca 100644
--- a/pub/src/olf.h
+++ b/pub/src/olf.h
@@ -112,7 +112,7 @@ class COlc : public COlo {
     string infoScanHeader() const;
     string pInfoCat() const;
     CCoord coord( class CVar* var ) const;
-    void setCoord( class CVar* var, CCoord& co ) ;
+    void setCoord( class CVar* var, CCoord& co );
 
     // The following nontrivial function are implemented in curve.cpp:
     void curveDefaults();
diff --git a/pub/src/opr.cpp b/pub/src/opr.cpp
index 5001fce3..f1d7f1d9 100644
--- a/pub/src/opr.cpp
+++ b/pub/src/opr.cpp
@@ -11,6 +11,7 @@
 #include <iostream>
 #include <string>
 #include <vector>
+#include <algorithm>
 #include <boost/format.hpp>
 
 #include <read-plus/ask.hpp>
@@ -60,7 +61,6 @@ void NOperate::Show( const string& subcmd )
 
         // printout by i:
         for ( uint i=0; i<ni; i++) {
-
             outj = "";
             outp = "";
 
@@ -435,7 +435,7 @@ void NIntOld::Opr()
                 fout->yco.unit = fin->yco.unit;
             } else if (mod== 4) {
                 fout->yco.name = "sigma(" + fin->yco.name + ")";
-                fout->yco.unit = "" ;
+                fout->yco.unit = "";
             } else if (mod== 5) {
                 fout->yco.name = fin->xco.name + "_max";
                 fout->yco.unit = fin->xco.unit;
@@ -475,11 +475,11 @@ void NIntOld::Opr()
                 fout->yco.unit = fin->xco.unit;
             } else if (mod==16) {
                 fout->yco.name = "sigma(" + fin->xco.name + ")";
-                fout->yco.unit = "" ;
+                fout->yco.unit = "";
             } else if (mod==17) {
                 fout->yco.name = "rho(" + fin->xco.name +
                     "|" + fin->yco.name + ")";
-                fout->yco.unit = "" ;
+                fout->yco.unit = "";
             } else {
                 throw "invalid mode";
             }
diff --git a/pub/src/plot.cpp b/pub/src/plot.cpp
index c6d23349..de94c737 100644
--- a/pub/src/plot.cpp
+++ b/pub/src/plot.cpp
@@ -393,7 +393,6 @@ int plot_curve_refine( CPlot* plot, POlc fc, uint k, uint j, int cstyle )
                 if ( xc[i+1]<=xc[i] )
                     throw "BUG: new base points not sorted at " +
                         S(i) + ": " + S(xc[i]) + " " + S(xc[i+1]);
-
     }
 
     // divide into segments and plot:
@@ -464,7 +463,6 @@ void NPlot::Plot( class CPlot *plot, bool add, const string& mode )
         // draw new frame:
         plot->clearFrame();
         plot->plotFrame( xCo.str_ps(), yCo.str_ps() );
-
     }
 
     // plot:
diff --git a/pub/src/rssm.cpp b/pub/src/rssm.cpp
index 47e76ea2..c3885fc3 100644
--- a/pub/src/rssm.cpp
+++ b/pub/src/rssm.cpp
@@ -86,8 +86,7 @@ void CRawfileSpheres::RdRawYam( ifstream& F_in )
     try{ 
         if(!doc.FindValue("Shortpar"))
             throw "DATA BUG: no Shortpar";
-        for(YAML::Iterator it=doc["Shortpar"].begin();
-            it!=doc["Shortpar"].end();++it) {
+        for(auto it=doc["Shortpar"].begin(); it!=doc["Shortpar"].end(); ++it) {
             it.first() >> key;
             it.second() >> val;
             if      ( key=="incremental" ){
@@ -367,7 +366,6 @@ void NRSSM::ReadSpec( int flag )
     if( ! (flag & 8 ) ){
         NOlm::mem_store( olf[6] );
     }
-
 }
 
 //! Read a series of raw data files.
@@ -410,7 +408,8 @@ void NRSSM::ReadSeries( int flag )
         ( RR[nsub-1].measured_until - RR[0].measured_until ) / nsub;
     printf( "mean measuring time %g seconds per file\n", mean_time );
     t = (time_t) (RR[0].measured_until-mean_time);
-    strftime( tstrg, 30, "%F %b %H:%M:%S", localtime( &t ) );
+    struct tm tlocal;
+    strftime( tstrg, 30, "%F %b %H:%M:%S", localtime_r( &t, &tlocal ) );
     printf( "measurement times relative to start time %s\n", tstrg );
     for( isub=0; isub<nsub; ++isub )
         RR[isub].measured_at = RR[isub].measured_until - 
@@ -565,5 +564,4 @@ void NRSSM::ReadSeries( int flag )
     if( 1 ){
         NOlm::mem_store( olf[0] );
     }
-
 }
-- 
GitLab