diff --git a/pub/src/STYLE b/pub/src/STYLE index eb7f50bfada7c52d84830a58478adbe27a8d7f20..a57f8dfe0e4c8ad4e12414736808542d6952205c 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 89ac46921504037cdd222921898b183346dd1d01..f247290a914c89f8d412271c22d67af5a134a60e 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 ad69b2cb23e7edcd2f7e7f1e6afd6aedd38d22fd..bc8fb03032ad560abf1bdcc246f38a6507dd2ed2 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 a8a3ffcb57800e0a613d576bfe262adfaabbe9bf..c9d308e56405b8ae16d8abf3d8cec5d819050a42 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 cd552c1c5c5d9b251cf9be6e0069a2733c5b84ee..d6942965dfa372ab08b33e6d84c776a325fc330d 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 0c3a668aa5fd807a1cf3d2fd158a83bc723e3131..63e4f4466cdf4bb94c82be2d596821cc956c20b0 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 5f4c6eaa90b85a085b1c57260a74131d7cda6e1e..d71a75ef69a481af318da7cb07ab2fef06ab6b74 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 fd22dc3eab2c7ac32617f8481e916533e490fdbb..98ea67a8f622b7a27dc7b0a8d2aaaf9be414be39 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 24ca20019e8f3d276ead9ab305ecd97c3bd2799a..3656610dc07a91a81585f5c4bd2ca8733c2cd58a 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 45a06976f0eb98cbc9993d3faebc38d0ff08c5d4..cf495272a514fd526a2f9c967de53d28102e8d92 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 5001fce346493abe584ebfee9c855ff43d21abbe..f1d7f1d93aae077ece3d02805508c40ee1064a54 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 c6d23349dcf6702844d3796f3b32e5fd612998f3..de94c737aaa8b1979a90c71f2690d704f56672bc 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 47e76ea2b0aef1600b2c22a62ab654fe1960ba05..c3885fc3f8d5b9e6471be24726ce17df7a78322b 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] ); } - }