Skip to content
Snippets Groups Projects
Commit 13a8d3e9 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Two more ranged loops.

Avoid 'auto' for simple types.
parent 6a687ad8
No related branches found
No related tags found
No related merge requests found
...@@ -336,16 +336,16 @@ void CPlot::writePostscript( string ps_outdir, string ps_head, string ps_dict ) ...@@ -336,16 +336,16 @@ void CPlot::writePostscript( string ps_outdir, string ps_head, string ps_dict )
// append specific output to output file: // append specific output to output file:
if ( !(pssav = fopen( outf.c_str(), "a+" )) ) if ( !(pssav = fopen( outf.c_str(), "a+" )) )
throw "cannot append contents to file " + outf; 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 "%" // 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 // additional output (do not append this to ps_accu to allow
// further incrementation of ps_accu): // further incrementation of ps_accu):
fprintf( pssav, "\n{ black 0 -4 13 1.65 NewList\n" ); fprintf( pssav, "\n{ black 0 -4 13 1.65 NewList\n" );
for ( int i=0; i<ps_Doc.size(); i++ ) for ( string lin: ps_Doc )
fprintf( pssav, "%s\n", ps_Doc[i].c_str() ); fprintf( pssav, "%s\n", lin.c_str() );
fprintf( pssav, "} oooinfo 1 eq { exec } { pop } ifelse\n" ); fprintf( pssav, "} oooinfo 1 eq { exec } { pop } ifelse\n" );
fprintf( pssav, fprintf( pssav,
......
...@@ -92,14 +92,14 @@ void NEdif::showSpectra() ...@@ -92,14 +92,14 @@ void NEdif::showSpectra()
POlc fc = P2C( f ); POlc fc = P2C( f );
POld fd = P2D( f ); POld fd = P2D( f );
printf( "%3s ", "j" ); printf( "%3s ", "j" );
for ( auto zco: f->ZCo ) for ( CCoord& zco: f->ZCo )
printf(" %12.12s", zco.str_compact().c_str()); printf(" %12.12s", zco.str_compact().c_str());
printf( " %12s (%4s) %12s\n", "x_inf", "#pts", "x_sup" ); printf( " %12s (%4s) %12s\n", "x_inf", "#pts", "x_sup" );
if( fd ) { if( fd ) {
for ( int j=0; j<f->nJ(); j++ ) { for ( int j=0; j<f->nJ(); j++ ) {
printf( "%3u%c", j, printf( "%3u%c", j,
f->V[j]->frozen ? '/' : ' ' ); 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", z );
printf( " %12.6g (%4u) %12.6g\n", printf( " %12.6g (%4u) %12.6g\n",
fd->VS(j)->x[0], fd->nPts(j), fd->VS(j)->x[0], fd->nPts(j),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment