From: <and...@us...> - 2011-01-10 21:59:37
|
Revision: 11465 http://plplot.svn.sourceforge.net/plplot/?rev=11465&view=rev Author: andrewross Date: 2011-01-10 21:59:30 +0000 (Mon, 10 Jan 2011) Log Message: ----------- Various formatting changes for recent commits thanks to uncrustify. Modified Paths: -------------- trunk/bindings/ocaml/plplot_impl.c trunk/bindings/tcl/tclAPI.c trunk/bindings/tcl/tclMain.c trunk/bindings/tk/plr.c trunk/drivers/tkwin.c trunk/drivers/xwin.c trunk/examples/c/x27c.c trunk/examples/c/x33c.c trunk/include/plplot.h trunk/src/plbox.c trunk/src/plbuf.c trunk/src/plfill.c trunk/src/plgradient.c trunk/src/pllegend.c trunk/src/plot3d.c trunk/utils/plrender.c trunk/utils/pltcl.c Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/bindings/ocaml/plplot_impl.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -746,10 +746,10 @@ case 3: translated_option = PL_LEGEND_SYMBOL; break; case 4: translated_option = PL_LEGEND_TEXT_LEFT; break; case 5: translated_option = PL_LEGEND_BACKGROUND; break; - case 6: translated_option = PL_LEGEND_BOUNDING_BOX; break; - case 7: translated_option = PL_LEGEND_ROW_MAJOR; break; - case 8: translated_option = PL_LEGEND_LEFT; break; - case 9: translated_option = PL_LEGEND_RIGHT; break; + case 6: translated_option = PL_LEGEND_BOUNDING_BOX; break; + case 7: translated_option = PL_LEGEND_ROW_MAJOR; break; + case 8: translated_option = PL_LEGEND_LEFT; break; + case 9: translated_option = PL_LEGEND_RIGHT; break; case 10: translated_option = PL_LEGEND_UPPER; break; case 11: translated_option = PL_LEGEND_LOWER; break; case 12: translated_option = PL_LEGEND_INSIDE; break; @@ -775,10 +775,10 @@ CAMLparam5( opt, x, y, plot_width, bg_color ); CAMLxparam5( bb_color, bb_style, nrow, ncolumn, opt_array ); CAMLxparam5( text_offset, text_scale, text_spacing, text_justification, - text_colors ); + text_colors ); CAMLxparam5( text, box_colors, box_patterns, box_scales, box_line_widths ); CAMLxparam5( line_colors, line_styles, line_widths, symbol_colors, - symbol_scales ); + symbol_scales ); CAMLxparam2( symbol_numbers, symbols ); CAMLlocal1( result ); result = caml_alloc( 2, 0 ); @@ -822,19 +822,19 @@ PLFLT width, height; pllegend( &width, &height, c_opt, Double_val( x ), Double_val( y ), - Double_val( plot_width ), Int_val( bg_color ), - Int_val( bb_color ), Int_val( bb_style ), - Int_val( nrow ), Int_val( ncolumn ), - n_legend, c_opt_array, - Double_val( text_offset ), Double_val( text_scale ), - Double_val( text_spacing ), - Double_val( text_justification ), - c_text_colors, c_text, - c_box_colors, c_box_patterns, (double *) box_scales, - c_box_line_widths, - c_line_colors, c_line_styles, c_line_widths, - c_symbol_colors, (double *) symbol_scales, c_symbol_numbers, - c_symbols ); + Double_val( plot_width ), Int_val( bg_color ), + Int_val( bb_color ), Int_val( bb_style ), + Int_val( nrow ), Int_val( ncolumn ), + n_legend, c_opt_array, + Double_val( text_offset ), Double_val( text_scale ), + Double_val( text_spacing ), + Double_val( text_justification ), + c_text_colors, c_text, + c_box_colors, c_box_patterns, (double *) box_scales, + c_box_line_widths, + c_line_colors, c_line_styles, c_line_widths, + c_symbol_colors, (double *) symbol_scales, c_symbol_numbers, + c_symbols ); // Return a tuple with the legend's size Store_field( result, 0, caml_copy_double( width ) ); Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/bindings/tcl/tclAPI.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -626,7 +626,7 @@ if ( Tcl_ExprBoolean( interp, argv[1], &result ) ) { fprintf( stderr, "wait_until command \"%s\" failed:\n\t %s\n", - argv[1], Tcl_GetStringResult(interp) ); + argv[1], Tcl_GetStringResult( interp ) ); break; } if ( result ) @@ -788,7 +788,7 @@ if ( result != TCL_OK ) { fprintf( stderr, "TCL command \"%s\" failed:\n\t %s\n", - cmd, Tcl_GetStringResult(interp) ); + cmd, Tcl_GetStringResult( interp ) ); } return result; } Modified: trunk/bindings/tcl/tclMain.c =================================================================== --- trunk/bindings/tcl/tclMain.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/bindings/tcl/tclMain.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -312,7 +312,7 @@ code = Tcl_VarEval( interp, tclStartupScript, (char *) NULL ); if ( code != TCL_OK ) { - fprintf( stderr, "%s\n", Tcl_GetStringResult(interp) ); + fprintf( stderr, "%s\n", Tcl_GetStringResult( interp ) ); exitCode = 1; } } Modified: trunk/bindings/tk/plr.c =================================================================== --- trunk/bindings/tk/plr.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/bindings/tk/plr.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -329,8 +329,8 @@ if ( n > PL_MAXPOLY ) { - xs = (short *) malloc( sizeof(short) * n ); - ys = (short *) malloc( sizeof(short) * n ); + xs = (short *) malloc( sizeof ( short ) * n ); + ys = (short *) malloc( sizeof ( short ) * n ); } else { Modified: trunk/drivers/tkwin.c =================================================================== --- trunk/drivers/tkwin.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/drivers/tkwin.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -487,15 +487,15 @@ TkwDisplay *tkwd = (TkwDisplay *) dev->tkwd; PLINT i; - XPoint _pts[PL_MAXPOLY]; - XPoint *pts; + XPoint _pts[PL_MAXPOLY]; + XPoint *pts; if ( dev->flags & 1 ) return; if ( npts > PL_MAXPOLY ) { - pts = (XPoint *) malloc( sizeof(XPoint) * npts ); + pts = (XPoint *) malloc( sizeof ( XPoint ) * npts ); } else { @@ -850,13 +850,13 @@ { TkwDev *dev = (TkwDev *) pls->dev; TkwDisplay *tkwd = (TkwDisplay *) dev->tkwd; - XPoint _pts[PL_MAXPOLY]; - XPoint *pts; + XPoint _pts[PL_MAXPOLY]; + XPoint *pts; int i; if ( pls->dev_npts > PL_MAXPOLY ) { - pts = (XPoint *) malloc( sizeof(XPoint) * pls->dev_npts ); + pts = (XPoint *) malloc( sizeof ( XPoint ) * pls->dev_npts ); } else { Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/drivers/xwin.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -426,7 +426,7 @@ if ( npts > PL_MAXPOLY ) { - pts = (XPoint *) malloc( sizeof(XPoint) * npts ); + pts = (XPoint *) malloc( sizeof ( XPoint ) * npts ); } else { @@ -848,7 +848,7 @@ if ( pls->dev_npts > PL_MAXPOLY ) { - pts = (XPoint *) malloc( sizeof(XPoint) * pls->dev_npts ); + pts = (XPoint *) malloc( sizeof ( XPoint ) * pls->dev_npts ); } else { Modified: trunk/examples/c/x27c.c =================================================================== --- trunk/examples/c/x27c.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/examples/c/x27c.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -188,7 +188,9 @@ if ( fill ) { plfill( 1 + steps * windings, xcoord, ycoord ); - } else { + } + else + { plline( 1 + steps * windings, xcoord, ycoord ); } } Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/examples/c/x33c.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -68,12 +68,12 @@ plspal1( "cmap1_blue_red.pal", 1 ); PLFLT colors[n]; - int i; + int i; PLFLT color_step; - color_step = 1.0 / (PLFLT)(n - 1); + color_step = 1.0 / (PLFLT) ( n - 1 ); for ( i = 0; i < n; i++ ) { - colors[i] = 0.0 + color_step * (PLFLT)( i ); + colors[i] = 0.0 + color_step * (PLFLT) ( i ); } PLINT opt; @@ -101,33 +101,33 @@ } plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_1, "Test label - Left, High Cap", - n, colors, values ); + ticks, sub_ticks, + axis_opts_1, "Test label - Left, High Cap", + n, colors, values ); opt = PL_COLORBAR_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW; plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_1, "Test label - Right, Low Cap", - n, colors, values ); + ticks, sub_ticks, + axis_opts_1, "Test label - Right, Low Cap", + n, colors, values ); opt = PL_COLORBAR_UPPER | bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_HIGH; plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_2, "Test label - Upper, High Cap", - n, colors, values ); + ticks, sub_ticks, + axis_opts_2, "Test label - Upper, High Cap", + n, colors, values ); opt = PL_COLORBAR_LOWER | bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_LOW; plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_2, "Test label - Lower, Low Cap", - n, colors, values ); + ticks, sub_ticks, + axis_opts_2, "Test label - Lower, Low Cap", + n, colors, values ); plvpor( 0.0, 1.0, 0.0, 1.0 ); plwind( 0.0, 1.0, 0.0, 1.0 ); @@ -142,12 +142,12 @@ plspal1( "cmap1_blue_yellow.pal", 1 ); PLFLT colors[n]; - int i; + int i; PLFLT color_step; - color_step = 1.0 / (PLFLT)(n - 1); + color_step = 1.0 / (PLFLT) ( n - 1 ); for ( i = 0; i < n; i++ ) { - colors[i] = 0.0 + color_step * (PLFLT)( i ); + colors[i] = 0.0 + color_step * (PLFLT) ( i ); } PLINT opt; @@ -175,33 +175,33 @@ } plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_1, "Test label - Left, Low Cap", - n, colors, values ); + ticks, sub_ticks, + axis_opts_1, "Test label - Left, Low Cap", + n, colors, values ); opt = PL_COLORBAR_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH; plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_1, "Test label - Right, High Cap", - n, colors, values ); + ticks, sub_ticks, + axis_opts_1, "Test label - Right, High Cap", + n, colors, values ); opt = PL_COLORBAR_UPPER | bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_LOW; plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_2, "Test label - Upper, Low Cap", - n, colors, values ); + ticks, sub_ticks, + axis_opts_2, "Test label - Upper, Low Cap", + n, colors, values ); opt = PL_COLORBAR_LOWER | bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_HIGH; plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_2, "Test label - Lower, High Cap", - n, colors, values ); + ticks, sub_ticks, + axis_opts_2, "Test label - Lower, High Cap", + n, colors, values ); plvpor( 0.0, 1.0, 0.0, 1.0 ); plwind( 0.0, 1.0, 0.0, 1.0 ); @@ -751,19 +751,19 @@ max_height = MAX( max_height, legend_height ); // Color bar examples - PLFLT values_small[2] = { 0.0, 1.0 }; + PLFLT values_small[2] = { 0.0, 1.0 }; PLFLT values_uneven[9] = { 0.0, 2.0, 2.6, 3.4, 6.0, 7.0, 8.0, 9.0, 10.0 }; - PLFLT values_even[9] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; + PLFLT values_even[9] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; plcolorbar_example_1( PL_COLORBAR_IMAGE, 0.0, 0, 2, values_small, "Image Color Bars" ); plcolorbar_example_2( PL_COLORBAR_IMAGE, 0.0, 0, 2, values_small, "Image Color Bars" ); plcolorbar_example_1( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0.0, 0, 9, values_uneven, - "Shade Color Bars - Uneven Steps" ); + "Shade Color Bars - Uneven Steps" ); plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0, 3, 9, values_even, - "Shade Color Bars - Even Steps" ); + "Shade Color Bars - Even Steps" ); plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small, - "Gradient Color Bars" ); + "Gradient Color Bars" ); plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small, - "Gradient Color Bars" ); + "Gradient Color Bars" ); // Free space that contained legend text. for ( k = 0; k < MAX_NLEGEND; k++ ) Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/include/plplot.h 2011-01-10 21:59:30 UTC (rev 11465) @@ -1212,36 +1212,36 @@ // Routine for drawing line, symbol, or cmap0 legends // Flags for pllegend. -#define PL_LEGEND_NONE 1 -#define PL_LEGEND_COLOR_BOX 2 -#define PL_LEGEND_LINE 4 -#define PL_LEGEND_SYMBOL 8 -#define PL_LEGEND_TEXT_LEFT 16 -#define PL_LEGEND_BACKGROUND 32 -#define PL_LEGEND_BOUNDING_BOX 64 -#define PL_LEGEND_ROW_MAJOR 128 -#define PL_LEGEND_LEFT 256 -#define PL_LEGEND_RIGHT 512 -#define PL_LEGEND_UPPER 1024 -#define PL_LEGEND_LOWER 2048 -#define PL_LEGEND_INSIDE 4096 -#define PL_LEGEND_OUTSIDE 8192 +#define PL_LEGEND_NONE 1 +#define PL_LEGEND_COLOR_BOX 2 +#define PL_LEGEND_LINE 4 +#define PL_LEGEND_SYMBOL 8 +#define PL_LEGEND_TEXT_LEFT 16 +#define PL_LEGEND_BACKGROUND 32 +#define PL_LEGEND_BOUNDING_BOX 64 +#define PL_LEGEND_ROW_MAJOR 128 +#define PL_LEGEND_LEFT 256 +#define PL_LEGEND_RIGHT 512 +#define PL_LEGEND_UPPER 1024 +#define PL_LEGEND_LOWER 2048 +#define PL_LEGEND_INSIDE 4096 +#define PL_LEGEND_OUTSIDE 8192 // Flags for plcolorbar -#define PL_COLORBAR_LEFT 1 -#define PL_COLORBAR_RIGHT 2 -#define PL_COLORBAR_UPPER 4 -#define PL_COLORBAR_LOWER 8 -#define PL_COLORBAR_LABEL_LEFT 16 -#define PL_COLORBAR_LABEL_RIGHT 32 -#define PL_COLORBAR_LABEL_UPPER 64 -#define PL_COLORBAR_LABEL_LOWER 128 -#define PL_COLORBAR_IMAGE 256 -#define PL_COLORBAR_SHADE 512 -#define PL_COLORBAR_GRADIENT 1024 -#define PL_COLORBAR_CAP_LOW 2048 -#define PL_COLORBAR_CAP_HIGH 4096 -#define PL_COLORBAR_SHADE_LABEL 8192 +#define PL_COLORBAR_LEFT 1 +#define PL_COLORBAR_RIGHT 2 +#define PL_COLORBAR_UPPER 4 +#define PL_COLORBAR_LOWER 8 +#define PL_COLORBAR_LABEL_LEFT 16 +#define PL_COLORBAR_LABEL_RIGHT 32 +#define PL_COLORBAR_LABEL_UPPER 64 +#define PL_COLORBAR_LABEL_LOWER 128 +#define PL_COLORBAR_IMAGE 256 +#define PL_COLORBAR_SHADE 512 +#define PL_COLORBAR_GRADIENT 1024 +#define PL_COLORBAR_CAP_LOW 2048 +#define PL_COLORBAR_CAP_HIGH 4096 +#define PL_COLORBAR_SHADE_LABEL 8192 PLDLLIMPEXP void c_pllegend( PLFLT *p_legend_width, PLFLT *p_legend_height, Modified: trunk/src/plbox.c =================================================================== --- trunk/src/plbox.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/src/plbox.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -1525,11 +1525,11 @@ PLFLT pos, tn, offset, height, just; PLFLT factor, tstart; const char *timefmt; - PLINT i; - PLINT xdigmax, xdigits, xdigmax_old, xdigits_old; - PLINT ydigmax, ydigits, ydigmax_old, ydigits_old; - PLINT lxmin, lxmax, lymin, lymax; - PLINT pxmin, pxmax, pymin, pymax; + PLINT i; + PLINT xdigmax, xdigits, xdigmax_old, xdigits_old; + PLINT ydigmax, ydigits, ydigmax_old, ydigits_old; + PLINT lxmin, lxmax, lymin, lymax; + PLINT pxmin, pxmax, pymin, pymax; // Save some parameters plgxax( &xdigmax, &xdigits ); @@ -1590,7 +1590,7 @@ for ( i = 1; i < n_xticks; i++ ) { x_spacing_tmp = fabs( xticks[i] - xticks[i - 1] ); - x_spacing = MIN( x_spacing, x_spacing_tmp ); + x_spacing = MIN( x_spacing, x_spacing_tmp ); } } @@ -1669,7 +1669,7 @@ for ( i = 1; i < n_yticks; i++ ) { y_spacing_tmp = fabs( yticks[i] - yticks[i - 1] ); - y_spacing = MIN( y_spacing, y_spacing_tmp ); + y_spacing = MIN( y_spacing, y_spacing_tmp ); } } @@ -1807,13 +1807,13 @@ void plP_default_label( PLINT axis, PLFLT value, char *string, PLINT len, void *data ) { - PLINT scale, prec; + PLINT scale, prec; PLINT setpre, precis; char form[FORMAT_LEN], temp[TEMP_LEN]; double scale2; - scale = ((PLINT *)data)[0]; - prec = ((PLINT *)data)[1]; + scale = ( (PLINT *) data )[0]; + prec = ( (PLINT *) data )[1]; plP_gprec( &setpre, &precis ); @@ -1894,7 +1894,7 @@ { // Linear PLINT scale_prec[2] = { scale, prec }; - plP_default_label( axis, value, string, len, (void *)scale_prec ); + plP_default_label( axis, value, string, len, (void *) scale_prec ); } } } Modified: trunk/src/plbuf.c =================================================================== --- trunk/src/plbuf.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/src/plbuf.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -498,11 +498,12 @@ rd_data( pls, &npts, sizeof ( PLINT ) ); - if ( npts > PL_MAXPOLY ) { - xpl = (short *) malloc( ( npts + 1 ) * sizeof( PLINT ) ); - ypl = (short *) malloc( ( npts + 1 ) * sizeof( PLINT ) ); + if ( npts > PL_MAXPOLY ) + { + xpl = (short *) malloc( ( npts + 1 ) * sizeof ( PLINT ) ); + ypl = (short *) malloc( ( npts + 1 ) * sizeof ( PLINT ) ); - if (( xpl == NULL ) || ( ypl == NULL )) + if ( ( xpl == NULL ) || ( ypl == NULL ) ) { plexit( "rdbuf_polyline: Insufficient memory for large polyline" ); } @@ -521,8 +522,8 @@ if ( npts > PL_MAXPOLY ) { - free(xpl); - free(ypl); + free( xpl ); + free( ypl ); } } @@ -733,11 +734,12 @@ rd_data( pls, &npts, sizeof ( PLINT ) ); - if ( npts > PL_MAXPOLY ) { - xpl = (short *) malloc( ( npts + 1 ) * sizeof( PLINT ) ); - ypl = (short *) malloc( ( npts + 1 ) * sizeof( PLINT ) ); + if ( npts > PL_MAXPOLY ) + { + xpl = (short *) malloc( ( npts + 1 ) * sizeof ( PLINT ) ); + ypl = (short *) malloc( ( npts + 1 ) * sizeof ( PLINT ) ); - if (( xpl == NULL ) || ( ypl == NULL )) + if ( ( xpl == NULL ) || ( ypl == NULL ) ) { plexit( "rdbuf_polyline: Insufficient memory for large polyline" ); } @@ -755,8 +757,8 @@ if ( npts > PL_MAXPOLY ) { - free(xpl); - free(ypl); + free( xpl ); + free( ypl ); } } Modified: trunk/src/plfill.c =================================================================== --- trunk/src/plfill.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/src/plfill.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -149,10 +149,10 @@ } if ( n > PL_MAXPOLY - 1 ) { - xpoly = (PLINT *) malloc( ( n + 1 ) * sizeof( PLINT ) ); - ypoly = (PLINT *) malloc( ( n + 1 ) * sizeof( PLINT ) ); + xpoly = (PLINT *) malloc( ( n + 1 ) * sizeof ( PLINT ) ); + ypoly = (PLINT *) malloc( ( n + 1 ) * sizeof ( PLINT ) ); - if (( xpoly == NULL ) || ( ypoly == NULL )) + if ( ( xpoly == NULL ) || ( ypoly == NULL ) ) { plexit( "plfill: Insufficient memory for large polygon" ); } @@ -183,8 +183,8 @@ if ( n > PL_MAXPOLY - 1 ) { - free(xpoly); - free(ypoly); + free( xpoly ); + free( ypoly ); } } @@ -225,23 +225,23 @@ npts = n; if ( n > PL_MAXPOLY - 1 ) { - tx = (PLFLT *) malloc( ( n + 1 ) * sizeof( PLFLT ) ); - ty = (PLFLT *) malloc( ( n + 1 ) * sizeof( PLFLT ) ); - ty = (PLFLT *) malloc( ( n + 1 ) * sizeof( PLFLT ) ); - xpoly = (PLINT *) malloc( ( n + 1 ) * sizeof( PLINT ) ); - ypoly = (PLINT *) malloc( ( n + 1 ) * sizeof( PLINT ) ); + tx = (PLFLT *) malloc( ( n + 1 ) * sizeof ( PLFLT ) ); + ty = (PLFLT *) malloc( ( n + 1 ) * sizeof ( PLFLT ) ); + ty = (PLFLT *) malloc( ( n + 1 ) * sizeof ( PLFLT ) ); + xpoly = (PLINT *) malloc( ( n + 1 ) * sizeof ( PLINT ) ); + ypoly = (PLINT *) malloc( ( n + 1 ) * sizeof ( PLINT ) ); - if (( tx == NULL ) || ( ty == NULL ) || ( tz == NULL ) || - ( xpoly == NULL ) || ( ypoly == NULL )) + if ( ( tx == NULL ) || ( ty == NULL ) || ( tz == NULL ) || + ( xpoly == NULL ) || ( ypoly == NULL ) ) { plexit( "plfill3: Insufficient memory for large polygon" ); } } else { - tx = _tx; - ty = _ty; - tz = _tz; + tx = _tx; + ty = _ty; + tz = _tz; xpoly = _xpoly; ypoly = _ypoly; } @@ -290,11 +290,11 @@ // If the original number of points is large, then free the arrays if ( npts > PL_MAXPOLY - 1 ) { - free(tx); - free(ty); - free(tz); - free(xpoly); - free(ypoly); + free( tx ); + free( ty ); + free( tz ); + free( xpoly ); + free( ypoly ); } } Modified: trunk/src/plgradient.c =================================================================== --- trunk/src/plgradient.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/src/plgradient.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -131,10 +131,10 @@ npts = n; if ( n > PL_MAXPOLY - 1 ) { - xpoly = (PLINT *) malloc( ( n + 1 ) * sizeof( PLINT ) ); - ypoly = (PLINT *) malloc( ( n + 1 ) * sizeof( PLINT ) ); + xpoly = (PLINT *) malloc( ( n + 1 ) * sizeof ( PLINT ) ); + ypoly = (PLINT *) malloc( ( n + 1 ) * sizeof ( PLINT ) ); - if (( xpoly == NULL ) || ( ypoly == NULL )) + if ( ( xpoly == NULL ) || ( ypoly == NULL ) ) { plexit( "plgradient: Insufficient memory for large polygon" ); } @@ -165,8 +165,8 @@ // Check the original number of points if ( npts > PL_MAXPOLY - 1 ) { - free(xpoly); - free(ypoly); + free( xpoly ); + free( ypoly ); } } } @@ -251,7 +251,7 @@ // from 0. to 1. if ( ( edge = (PLFLT *) malloc( NEDGE * sizeof ( PLFLT ) ) ) == NULL ) plexit( "plgradient_soft: Insufficient memory for large polygon" -); + ); for ( i = 0; i < NEDGE; i++ ) edge[i] = (PLFLT) i / (PLFLT) ( NEDGE - 1 ); Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/src/pllegend.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -838,7 +838,7 @@ ys[0] = y; xs[2] = xs[0] + width; ys[2] = ys[0]; - xs[1] = (xs[0] + xs[2]) / 2.0; + xs[1] = ( xs[0] + xs[2] ) / 2.0; ys[1] = ys[0] - 0.05; plfill( 3, xs, ys ); @@ -854,7 +854,7 @@ xs[2] = xs[0]; ys[2] = ys[0] + width; xs[1] = xs[0] - 0.05; - ys[1] = (ys[0] + ys[2]) / 2.0; + ys[1] = ( ys[0] + ys[2] ) / 2.0; plfill( 3, xs, ys ); } @@ -871,7 +871,7 @@ ys[0] = y + length; xs[2] = xs[0] + width; ys[2] = ys[0]; - xs[1] = (xs[0] + xs[2]) / 2.0; + xs[1] = ( xs[0] + xs[2] ) / 2.0; ys[1] = ys[0] + 0.05; plfill( 3, xs, ys ); @@ -887,7 +887,7 @@ xs[2] = xs[0]; ys[2] = ys[0] + width; xs[1] = xs[0] + 0.05; - ys[1] = (ys[0] + ys[2]) / 2.0; + ys[1] = ( ys[0] + ys[2] ) / 2.0; plfill( 3, xs, ys ); } @@ -925,11 +925,11 @@ plgvpw( &xwmin_save, &xwmax_save, &ywmin_save, &ywmax_save ); // Active attributes to be saved and restored afterward. - PLINT col0_save = plsc->icol0; - PLFLT text_scale_save = plsc->chrht / plsc->chrdef; + PLINT col0_save = plsc->icol0; + PLFLT text_scale_save = plsc->chrht / plsc->chrdef; // Axis tick spacing - PLFLT maj_save = plsc->majht / plsc->majdef; - PLFLT min_save = plsc->minht / plsc->mindef; + PLFLT maj_save = plsc->majht / plsc->majdef; + PLFLT min_save = plsc->minht / plsc->mindef; // Position of the color bar in normalized viewport (= normalized subpage // coordinates). @@ -1006,8 +1006,8 @@ // Use the same number of steps as there are steps in // color palette 1. // TODO: Determine a better way to specify the steps here? - n_steps = plsc->ncol1; - step_size = ( max_value - min_value ) / (PLFLT)n_steps; + n_steps = plsc->ncol1; + step_size = ( max_value - min_value ) / (PLFLT) n_steps; if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) { ni = 2; @@ -1017,7 +1017,7 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = min_value + (PLFLT)j * step_size; + color_data[i][j] = min_value + (PLFLT) j * step_size; } } } @@ -1030,7 +1030,7 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = min_value + (PLFLT)i * step_size; + color_data[i][j] = min_value + (PLFLT) i * step_size; } } } @@ -1077,14 +1077,14 @@ } // Draw the color bar plimage( color_data, ni, nj, wx_min, wx_max, wy_min, wy_max, - min_value, max_value, wx_min, wx_max, wy_min, wy_max ); + min_value, max_value, wx_min, wx_max, wy_min, wy_max ); plFree2dGrid( color_data, ni, nj ); } else if ( opt & PL_COLORBAR_SHADE ) { // Transform grid PLcGrid grid; - PLFLT grid_axis[2] = { 0.0, 1.0 }; + PLFLT grid_axis[2] = { 0.0, 1.0 }; n_steps = n_colors; // Use the provided values. if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) @@ -1093,8 +1093,8 @@ grid.yg = values; grid.nx = 2; grid.ny = n_steps; - ni = 2; - nj = n_steps; + ni = 2; + nj = n_steps; plAlloc2dGrid( &color_data, ni, nj ); for ( i = 0; i < ni; i++ ) { @@ -1110,8 +1110,8 @@ grid.yg = grid_axis; grid.nx = n_steps; grid.ny = 2; - ni = n_steps; - nj = 2; + ni = n_steps; + nj = 2; plAlloc2dGrid( &color_data, ni, nj ); for ( i = 0; i < ni; i++ ) { @@ -1128,8 +1128,8 @@ // Draw the color bar plshades( color_data, ni, nj, NULL, wx_min, wx_max, wy_min, wy_max, - values, n_colors, 0, 0, 0, plfill, TRUE, - pltr1, (void *)(&grid) ); + values, n_colors, 0, 0, 0, plfill, TRUE, + pltr1, (void *) ( &grid ) ); plFree2dGrid( color_data, ni, nj ); } else if ( opt & PL_COLORBAR_GRADIENT ) @@ -1199,12 +1199,12 @@ // Smaller text plschr( 0.0, 0.75 ); // Small ticks on the vertical axis - plsmaj( 0.0, 0.5); - plsmin( 0.0, 0.5); + plsmaj( 0.0, 0.5 ); + plsmin( 0.0, 0.5 ); // For building axis option string - PLINT max_opts = 25; - char opt_string[max_opts]; + PLINT max_opts = 25; + char opt_string[max_opts]; const char *tick_string; tick_string = ""; @@ -1216,14 +1216,14 @@ if ( opt & PL_COLORBAR_RIGHT || opt & PL_COLORBAR_LEFT ) { label_offset += 4.0; - perp = '\0'; + perp = '\0'; } else { label_offset += 1.5; - perp = 'v'; + perp = 'v'; } - snprintf( opt_string, max_opts, "l%c", perp); + snprintf( opt_string, max_opts, "l%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); } else if ( opt & PL_COLORBAR_LABEL_RIGHT ) @@ -1231,14 +1231,14 @@ if ( opt & PL_COLORBAR_RIGHT || opt & PL_COLORBAR_LEFT ) { label_offset += 4.0; - perp = '\0'; + perp = '\0'; } else { label_offset += 1.5; - perp = 'v'; + perp = 'v'; } - snprintf( opt_string, max_opts, "r%c", perp); + snprintf( opt_string, max_opts, "r%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); } else if ( opt & PL_COLORBAR_LABEL_UPPER ) @@ -1246,14 +1246,14 @@ if ( opt & PL_COLORBAR_RIGHT || opt & PL_COLORBAR_LEFT ) { label_offset += 1.5; - perp = 'v'; + perp = 'v'; } else { label_offset += 4.0; - perp = '\0'; + perp = '\0'; } - snprintf( opt_string, max_opts, "t%c", perp); + snprintf( opt_string, max_opts, "t%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); } else if ( opt & PL_COLORBAR_LABEL_LOWER ) @@ -1261,17 +1261,17 @@ if ( opt & PL_COLORBAR_RIGHT || opt & PL_COLORBAR_LEFT ) { label_offset += 1.5; - perp = 'v'; + perp = 'v'; } else { label_offset += 4.0; - perp = '\0'; + perp = '\0'; } snprintf( opt_string, max_opts, "b%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); } - + // Draw labels and tick marks if this is a shade color bar // TODO: A better way to handle this would be to update the // internals of plbox to support custom tick and label positions Modified: trunk/src/plot3d.c =================================================================== --- trunk/src/plot3d.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/src/plot3d.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -173,16 +173,17 @@ if ( Ni > PL_MAXPOLY ) { - in = (PLFLT *) malloc( sizeof(PLFLT) * Ni ); - TT = (PLFLT *) malloc( 3 * sizeof(PLFLT) * Ni ); + in = (PLFLT *) malloc( sizeof ( PLFLT ) * Ni ); + TT = (PLFLT *) malloc( 3 * sizeof ( PLFLT ) * Ni ); - if ( in == NULL || TT == NULL ) { - plexit("plP_clip_poly: insufficient memory for large polygon"); + if ( in == NULL || TT == NULL ) + { + plexit( "plP_clip_poly: insufficient memory for large polygon" ); } T[0] = &TT[0]; T[1] = &TT[Ni]; - T[2] = &TT[2*Ni]; + T[2] = &TT[2 * Ni]; } else { @@ -249,8 +250,8 @@ if ( Ni > PL_MAXPOLY ) { - free(in); - free(TT); + free( in ); + free( TT ); } return No; Modified: trunk/utils/plrender.c =================================================================== --- trunk/utils/plrender.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/utils/plrender.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -839,8 +839,8 @@ if ( n > PL_MAXPOLY ) { - xs = (short *) malloc( sizeof(short) * n ); - ys = (short *) malloc( sizeof(short) * n ); + xs = (short *) malloc( sizeof ( short ) * n ); + ys = (short *) malloc( sizeof ( short ) * n ); } else { Modified: trunk/utils/pltcl.c =================================================================== --- trunk/utils/pltcl.c 2011-01-10 21:58:27 UTC (rev 11464) +++ trunk/utils/pltcl.c 2011-01-10 21:59:30 UTC (rev 11465) @@ -72,9 +72,9 @@ // Print error message if one given - tmp=Tcl_GetStringResult(interp); + tmp = Tcl_GetStringResult( interp ); if ( tmp != NULL && tmp != '\0' ) - fprintf( stderr, "%s\n", Tcl_GetStringResult(interp)); + fprintf( stderr, "%s\n", Tcl_GetStringResult( interp ) ); plspause( 0 ); plend(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |