From f80588640604a84df27f69c213bb8302ebfdf471 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (home)" <j.wuttke@fz-juelich.de> Date: Wed, 20 May 2009 20:27:06 +0200 Subject: [PATCH] corr --- pub/src/dualplot.cpp | 6 +++--- pub/src/edif.cpp | 22 +++++++++++----------- pub/src/frida2.cpp | 2 +- pub/src/scan.cpp | 14 +++++++------- pub/src/scan.h | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pub/src/dualplot.cpp b/pub/src/dualplot.cpp index 5f140ea8..f1bf0862 100644 --- a/pub/src/dualplot.cpp +++ b/pub/src/dualplot.cpp @@ -260,14 +260,14 @@ void NPlot::Open() string fn_fifo = string("/tmp/gnuplot-") + getenv( "LOGNAME" ); - (void) system( ("rm -f "+fn_fifo).c_str() ); + system( ("rm -f "+fn_fifo).c_str() ); if (mkfifo( fn_fifo.c_str(), 0666 )) { printf("SEVERE SYSTEM ERROR cannot make fifo %s" " - will not be able to print\n", fn_fifo.c_str() ); return; } - (void) system( ("gnuplot -noraise < " + fn_fifo + " &").c_str() ); + system( ("gnuplot -noraise < " + fn_fifo + " &").c_str() ); // we use open instead of fopen or ofstream, // because we need non-blocking mode. @@ -517,7 +517,7 @@ void NPlot::gp_write( string in ) { string out = in + "\n"; // printf( "DEBUG GNUPLOT '%s'\n", out.c_str() ); - (void) write( gp_fifo, out.c_str(), out.size() ); + write( gp_fifo, out.c_str(), out.size() ); } void NPlot::ps_ticktack(uint ntack, double *tack, int ntpt, double *ticklim, diff --git a/pub/src/edif.cpp b/pub/src/edif.cpp index 6cdc32df..495dd1e4 100644 --- a/pub/src/edif.cpp +++ b/pub/src/edif.cpp @@ -90,16 +90,16 @@ void NEdif::DirZ(void) for (size_t m=0; m<e->P()->ZCo.size(); m++) { printf(" %12s", e->P()->ZCo[m].str().c_str()); } - printf("%8s %38s\n", "#pts.", "x"); + printf( "%8s %38s\n", "#pts.", "x" ); for (size_t j=0; j<e->nScan(); j++) { printf("%3zu", j); for (size_t m=0; m<e->P()->ZCo.size(); m++) { printf(" %12.6g", (*(e->Z(j)))[m]); } if (d) - printf("%12.6g (%4zu) %12.6g\n", - d->VS[j].x[0], d->VS[j].size(), - d->VS[j].x[d->VS[j].size()-1] ); + printf( "%12.6g (%4zu) %12.6g\n", + d->VS[j].x[0], d->VS[j].size(), + d->VS[j].x[d->VS[j].size()-1] ); else printf("\n"); } @@ -124,7 +124,7 @@ void NEdif::ListZ(void) nz = ZCo.size(); if (nz) for (i=0; i<nz; ++i) - printf(" z%u: %s\n", i, ZCo[i].str().c_str()); + printf(" %zu: %s\n", i, ZCo[i].str().c_str()); else printf(" there are no z coordinates\n"); @@ -761,7 +761,7 @@ void NEdif::ReadTab( string qualif ) inFiles.push_back( "/ram/tab" ); cout << "Script must write to "<<inFiles[0]<<"\n"; script = wask("Script", script); - (void) system( script.c_str() ); + system( script.c_str() ); } else { string fnames = wask( "Read tab from file(s)" ); // PROVIS, sask sobald glob besser @@ -950,7 +950,7 @@ void NEdif::Plot( bool add ) static CList JSel; const CScan *J; CEle *e; - uint k, j; + size_t k, j; const COld *fd; const COlc *fc; CScan S; @@ -972,7 +972,7 @@ void NEdif::Plot( bool add ) bool first = true; while((fd=fiter())) { JSel.evaluate( 0, fd->nScan()-1 ); - for( int iv=0; iv<JSel.size(); ++iv ) { + for( size_t iv=0; iv<JSel.size(); ++iv ) { vx = &( fd->VS[JSel.V[iv]].x ); for( size_t i=0; i<vx->size(); ++i ){ if( NPlot::X.log && (*vx)[i]<=0 ) @@ -1068,7 +1068,7 @@ void NEdif::Plot( bool add ) fc = e->C(); fd = e->D(); JSel.evaluate( 0, e->nScan()-1 ); - for ( int iv=0; iv<JSel.size(); ++iv){ + for ( size_t iv=0; iv<JSel.size(); ++iv){ j = JSel.V[iv]; if ( fd ) { const CScan *s; @@ -1100,8 +1100,8 @@ void NEdif::Plot( bool add ) i += NPlot::maxpoints; } if ( np==0 ) { - printf( "file %i spec %i:" - " all %d points outside plot range:\n", + printf( "file %zu spec %zu:" + " all %zu points outside plot range:\n", k, j, n ); if( nxl ) printf( " %d points < xmin\n", nxl ); diff --git a/pub/src/frida2.cpp b/pub/src/frida2.cpp index 24114980..9bba2d05 100644 --- a/pub/src/frida2.cpp +++ b/pub/src/frida2.cpp @@ -526,7 +526,7 @@ int main() } else if (cmd == "x") { string sh_cmd; sh_cmd = sask("shell command"); - (void) system( sh_cmd.c_str() ); + system( sh_cmd.c_str() ); } else if (cmd == ".") { diff --git a/pub/src/scan.cpp b/pub/src/scan.cpp index ba7eabf9..dff56f10 100644 --- a/pub/src/scan.cpp +++ b/pub/src/scan.cpp @@ -126,7 +126,7 @@ int CScan::Load(FILE *fd, uint nz) //* Extract data *// //**************************************************************************// -uint CScan::size() const +size_t CScan::size() const { if (x.size()!=y.size()) throw "FATAL PROGRAM ERROR detected by scan::size: #x [" + @@ -146,18 +146,18 @@ void CScan::Info(void) const void CScan::intpol( const vector<double>& xx, vector<double>& yy ) const { - uint n = size(); - uint nn = xx.size(); + size_t n = size(); + size_t nn = xx.size(); yy.resize( nn ); - uint ii = 0; + size_t ii = 0; while( xx[ii]<x[0] ){ yy[ii] = 0; ++ii; if( ii>=nn ) return; } - uint i = 0; + size_t i = 0; while ( i<n-1 && xx[ii]<x[n-1] ) { while ( xx[ii]>x[i+1] && i<n-1 ) ++i; @@ -182,8 +182,8 @@ bool CompareZ( const CScan& S1, const CScan& S2 ) { if( S1.z.size()!=S2.z.size() ) return false; - int nz = S1.z.size(); - for( int iz=0; iz<nz; ++iz ){ + size_t nz = S1.z.size(); + for( size_t iz=0; iz<nz; ++iz ){ if ( S1.z[iz]>S2.z[iz] ) return false; if ( S1.z[iz]<S2.z[iz] ) diff --git a/pub/src/scan.h b/pub/src/scan.h index 98738a8b..d48dc2b7 100644 --- a/pub/src/scan.h +++ b/pub/src/scan.h @@ -17,7 +17,7 @@ class CScan { int Load( FILE *fd, uint nz ); // extract data: - uint size() const; + size_t size() const; void Info(void) const; void intpol( const vector<double>& in_x, vector<double>& out_y ) const; double intpol( double x ) const { -- GitLab