From: <ai...@us...> - 2012-07-06 20:54:47
|
Revision: 12197 http://plplot.svn.sourceforge.net/plplot/?rev=12197&view=rev Author: airwin Date: 2012-07-06 20:54:41 +0000 (Fri, 06 Jul 2012) Log Message: ----------- Style previous commits. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp trunk/drivers/wxwidgets_agg.cpp trunk/examples/c++/x00.cc trunk/examples/d/x21d.d trunk/examples/java/x00.java trunk/examples/java/x21.java Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/drivers/wxwidgets.cpp 2012-07-06 20:54:41 UTC (rev 12197) @@ -250,8 +250,8 @@ if ( ucs4[i] != (PLUNICODE) plplotEsc ) // a character to display { ucs4_to_utf8( ucs4[i], utf8 ); - strncat( utf8_string, utf8, - sizeof( utf8_string ) - strlen( utf8_string ) - 1 ); + strncat( utf8_string, utf8, + sizeof ( utf8_string ) - strlen( utf8_string ) - 1 ); i++; continue; } @@ -259,8 +259,8 @@ if ( ucs4[i] == (PLUNICODE) plplotEsc ) // a escape character to display { ucs4_to_utf8( ucs4[i], utf8 ); - strncat( utf8_string, utf8, - sizeof( utf8_string ) - strlen( utf8_string ) - 1 ); + strncat( utf8_string, utf8, + sizeof ( utf8_string ) - strlen( utf8_string ) - 1 ); i++; continue; } Modified: trunk/drivers/wxwidgets_agg.cpp =================================================================== --- trunk/drivers/wxwidgets_agg.cpp 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/drivers/wxwidgets_agg.cpp 2012-07-06 20:54:41 UTC (rev 12197) @@ -493,7 +493,7 @@ //size_t len=wxConvUTF8.ToWChar( str, 512, utf8_string ); size_t len = strlen( utf8_string ); char * str = utf8_string; - printf( "len=%lu\n", ( unsigned long ) len ); + printf( "len=%lu\n", (unsigned long) len ); const agg::glyph_cache* glyph; if ( !drawText ) Modified: trunk/examples/c++/x00.cc =================================================================== --- trunk/examples/c++/x00.cc 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/examples/c++/x00.cc 2012-07-06 20:54:41 UTC (rev 12197) @@ -31,17 +31,17 @@ class x00 { public: - x00( int, const char **); + x00( int, const char ** ); private: // Class data - plstream *pls; + plstream *pls; static const int NSIZE; }; const int x00::NSIZE = 101; - + x00::x00( int argc, const char **argv ) { PLFLT x[NSIZE], y[NSIZE]; @@ -54,9 +54,9 @@ x[i] = (PLFLT) ( i ) / (PLFLT) ( NSIZE - 1 ); y[i] = ymax * x[i] * x[i]; } - + pls = new plstream(); - + // Parse and process command line arguments pls->parseopts( &argc, argv, PL_PARSE_FULL ); Modified: trunk/examples/d/x21d.d =================================================================== --- trunk/examples/d/x21d.d 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/examples/d/x21d.d 2012-07-06 20:54:41 UTC (rev 12197) @@ -95,7 +95,7 @@ plenv( xm, xM, ym, yM, 2, 0 ); plcol0( 15 ); pllab( "X", "Y", "The original data sampling" ); - for ( int i = 0; i < pts ; i++ ) + for ( int i = 0; i < pts; i++ ) { plcol1( ( z[i] - zmin ) / ( zmax - zmin ) ); xx[0] = x[i]; Modified: trunk/examples/java/x00.java =================================================================== --- trunk/examples/java/x00.java 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/examples/java/x00.java 2012-07-06 20:54:41 UTC (rev 12197) @@ -28,11 +28,10 @@ import plplot.core.*; class x00 { + PLStream pls = new PLStream(); - PLStream pls = new PLStream(); - static int NSIZE = 101; - + public static void main( String[] args ) { new x00( args ); @@ -40,32 +39,32 @@ public x00( String[] args ) { - double x[] = new double[NSIZE]; - double y[] = new double[NSIZE]; - double xmin = 0., xmax = 1., ymin = 0., ymax = 100.; - int i; + double x[] = new double[NSIZE]; + double y[] = new double[NSIZE]; + double xmin = 0., xmax = 1., ymin = 0., ymax = 100.; + int i; - // Prepare data to be plotted. - for ( i = 0; i < NSIZE; i++ ) - { - x[i] = (double)( i ) / (double) ( NSIZE - 1 ); - y[i] = ymax * x[i] * x[i]; - } - - // Parse and process command line arguments - pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); - // Initialize plplot - pls.init(); - - // Create a labelled box to hold the plot. - pls.env( xmin, xmax, ymin, ymax, 0, 0 ); - pls.lab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + // Prepare data to be plotted. + for ( i = 0; i < NSIZE; i++ ) + { + x[i] = (double) ( i ) / (double) ( NSIZE - 1 ); + y[i] = ymax * x[i] * x[i]; + } - // Plot the data that was prepared above. - pls.line( x, y ); + // Parse and process command line arguments + pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); + // Initialize plplot + pls.init(); - // Close PLplot library - pls.end(); + // Create a labelled box to hold the plot. + pls.env( xmin, xmax, ymin, ymax, 0, 0 ); + pls.lab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + + // Plot the data that was prepared above. + pls.line( x, y ); + + // Close PLplot library + pls.end(); } } Modified: trunk/examples/java/x21.java =================================================================== --- trunk/examples/java/x21.java 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/examples/java/x21.java 2012-07-06 20:54:41 UTC (rev 12197) @@ -134,7 +134,7 @@ double x[], y[], z[], clev[]; double xg[], yg[], zg[][]; double xg0[][], yg0[][]; - double xx[], yy[]; + double xx[], yy[]; double zmin, zmax, lzm[], lzM[]; int i, j, k; int alg; @@ -167,11 +167,11 @@ pls.seed( 5489 ); - x = new double[pts]; - y = new double[pts]; - z = new double[pts]; - xx = new double[1]; - yy = new double[1]; + x = new double[pts]; + y = new double[pts]; + z = new double[pts]; + xx = new double[1]; + yy = new double[1]; create_data( x, y, z ); // the sampled data zmin = z[0]; @@ -208,23 +208,24 @@ pls.env( xm, xM, ym, yM, 2, 0 ); pls.col0( 15 ); pls.lab( "X", "Y", "The original data sampling" ); - for ( i = 0; i < pts ; i++ ) { - pls.col1( ( z[i] - zmin ) / ( zmax - zmin ) ); - // The following plstring call should be the the equivalent of - // plpoin( 1, &x[i], &y[i], 5 ); Use plstring because it is - // not deprecated like plpoin and has much more powerful - // capabilities. N.B. symbol 141 works for Hershey devices - // (e.g., -dev xwin) only if plfontld( 0 ) has been called - // while symbol 727 works only if plfontld( 1 ) has been - // called. The latter is the default which is why we use 727 - // here to represent a centred X (multiplication) symbol. - // This dependence on plfontld is one of the limitations of - // the Hershey escapes for PLplot, but the upside is you get - // reasonable results for both Hershey and Unicode devices. - xx[0] = x[i]; - yy[0] = y[i]; - pls.string( xx, yy, "#(727)" ); - } + for ( i = 0; i < pts; i++ ) + { + pls.col1( ( z[i] - zmin ) / ( zmax - zmin ) ); + // The following plstring call should be the the equivalent of + // plpoin( 1, &x[i], &y[i], 5 ); Use plstring because it is + // not deprecated like plpoin and has much more powerful + // capabilities. N.B. symbol 141 works for Hershey devices + // (e.g., -dev xwin) only if plfontld( 0 ) has been called + // while symbol 727 works only if plfontld( 1 ) has been + // called. The latter is the default which is why we use 727 + // here to represent a centred X (multiplication) symbol. + // This dependence on plfontld is one of the limitations of + // the Hershey escapes for PLplot, but the upside is you get + // reasonable results for both Hershey and Unicode devices. + xx[0] = x[i]; + yy[0] = y[i]; + pls.string( xx, yy, "#(727)" ); + } pls.adv( 0 ); pls.ssub( 3, 2 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |