From: <and...@us...> - 2009-11-16 12:23:12
|
Revision: 10598 http://plplot.svn.sourceforge.net/plplot/?rev=10598&view=rev Author: andrewross Date: 2009-11-16 12:22:49 +0000 (Mon, 16 Nov 2009) Log Message: ----------- Run uncrustify to correct style for recently changed files. Modified Paths: -------------- trunk/bindings/f77/scstubs.c trunk/bindings/tk/plframe.c trunk/bindings/tk-x-plat/plplotter.c trunk/drivers/cairo.c trunk/drivers/qt.cpp trunk/drivers/tk.c trunk/include/plplotP.h trunk/src/plcore.c trunk/src/plstdio.c Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/bindings/f77/scstubs.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -483,8 +483,8 @@ int i; /* (AM) Note the hidden argument "length" - it ensures that the string "label" - is recognised to have that length - */ + * is recognised to have that length + */ ( *pllabelfunc )( &axis, &value, label, &length, length ); /* Ensure string is null terminated */ Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/bindings/tk/plframe.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -2816,14 +2816,14 @@ /* Create and open temporary file */ /* NB use fdopen to get a file stream from the existing file handle */ - if (( sfile = fdopen( pl_create_tempfile( &sfnam ) , "wb+" )) == NULL ) + if (( sfile = fdopen( pl_create_tempfile( &sfnam ), "wb+" )) == NULL ) { Tcl_AppendResult( interp, "Error -- cannot open plot file for writing", (char *) NULL ); plend1(); - if (sfnam != NULL) - free(sfnam); + if ( sfnam != NULL ) + free( sfnam ); return TCL_ERROR; } @@ -2860,12 +2860,12 @@ (char *) 0 )) { fprintf( stderr, "Unable to exec print command.\n" ); - free(sfnam); + free( sfnam ); _exit( 1 ); } } - free(sfnam); + free( sfnam ); return result; } Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/bindings/tk-x-plat/plplotter.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -2638,16 +2638,16 @@ /* Open file for writes */ - /* Create and open temporary file */ - /* NB use fdopen to get a file stream from the existing file handle */ - if (( sfile = fdopen( pl_create_tempfile(&sfnam), "wb+" )) == NULL ) + /* Create and open temporary file */ + /* NB use fdopen to get a file stream from the existing file handle */ + if (( sfile = fdopen( pl_create_tempfile( &sfnam ), "wb+" )) == NULL ) { Tcl_AppendResult( interp, "Error -- cannot open plot file for writing", (char *) NULL ); plend1(); - if (sfnam != NULL) - free(sfnam); + if ( sfnam != NULL ) + free( sfnam ); return TCL_ERROR; } @@ -2683,12 +2683,12 @@ (char *) 0 )) { fprintf( stderr, "Unable to exec print command.\n" ); - free(sfnam); + free( sfnam ); _exit( 1 ); } } #endif - free(sfnam); + free( sfnam ); return result; } Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/drivers/cairo.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -82,7 +82,7 @@ { "graphics_anti_aliasing", DRV_INT, &graphics_anti_aliasing, "Set desired graphics anti-aliasing (graphics_anti_aliasing=0|1|2|3). The numbers are in the same order as the cairo_antialias_t enumeration documented at http://cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t" }, { "external_drawable", DRV_INT, &external_drawable, "Plot to external X drawable" }, { "rasterize_image", DRV_INT, &rasterize_image, "Raster or vector image rendering (rasterize_image=0|1)" }, - { "set_background", DRV_INT, &set_background, "Set the background for the extcairo device (set_background=0|1). If 1 then the plot background will set by PLplot" }, + { "set_background", DRV_INT, &set_background, "Set the background for the extcairo device (set_background=0|1). If 1 then the plot background will set by PLplot" }, { NULL, DRV_INT, NULL, NULL } }; typedef struct @@ -479,7 +479,8 @@ filled_polygon( pls, pls->dev_x, pls->dev_y, pls->dev_npts ); break; case PLESC_HAS_TEXT: - if(!pls->alt_unicode){ + if ( !pls->alt_unicode ) + { proc_str( pls, (EscText *) ptr ); } break; @@ -2375,13 +2376,14 @@ aStream = (PLCairo *) pls->dev; /* Fill the context with the background color if the user so desires. */ - if ( aStream->cairoContext != NULL) { + if ( aStream->cairoContext != NULL ) + { cairo_rectangle( aStream->cairoContext, 0.0, 0.0, pls->xlength, pls->ylength ); cairo_set_source_rgba( aStream->cairoContext, (double) pls->cmap0[0].r / 255.0, - (double) pls->cmap0[0].g / 255.0, - (double) pls->cmap0[0].b / 255.0, - (double) pls->cmap0[0].a ); + (double) pls->cmap0[0].g / 255.0, + (double) pls->cmap0[0].b / 255.0, + (double) pls->cmap0[0].a ); cairo_fill( aStream->cairoContext ); } } @@ -2441,9 +2443,10 @@ aStream = (PLCairo *) pls->dev; /* Set background if desired */ - if ( aStream->set_background ){ - extcairo_setbackground(pls); - } + if ( aStream->set_background ) + { + extcairo_setbackground( pls ); + } } /*---------------------------------------------------------------------- @@ -2485,8 +2488,9 @@ * Cairo does not provide a way to query the dimensions of a context? */ /* Set background if desired */ - if ( aStream->set_background ){ - extcairo_setbackground(pls); + if ( aStream->set_background ) + { + extcairo_setbackground( pls ); } break; default: /* Fall back on default Cairo actions */ Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/drivers/qt.cpp 2009-11-16 12:22:49 UTC (rev 10598) @@ -42,7 +42,7 @@ // Drivers declaration extern "C" { -PLDLLIMPEXP_DRIVER_DATA(const char*) plD_DEVICE_INFO_qt = +PLDLLIMPEXP_DRIVER_DATA( const char* ) plD_DEVICE_INFO_qt = #if defined ( PLD_bmpqt ) "bmpqt:Qt Windows bitmap driver:0:qt:66:bmpqt\n" #endif Modified: trunk/drivers/tk.c =================================================================== --- trunk/drivers/tk.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/drivers/tk.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -1505,7 +1505,7 @@ if ( !pls->dp ) { /* This of tmpnam should (?) be safe since mkfifo - will fail if the filename already exists */ + * will fail if the filename already exists */ iodev->fileName = (char *) tmpnam( NULL ); if ( mkfifo( iodev->fileName, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ) < 0 ) Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/include/plplotP.h 2009-11-16 12:22:49 UTC (rev 10598) @@ -646,8 +646,8 @@ typedef struct cont_level { - PLFLT level; - struct cont_line *line; /* contour line */ + PLFLT level; + struct cont_line *line; /* contour line */ struct cont_level *next; /* contour level */ } CONT_LEVEL; @@ -1135,7 +1135,7 @@ /* Create a temporary file securely */ PLDLLIMPEXP int -pl_create_tempfile(char **fname); +pl_create_tempfile( char **fname ); #ifdef __cplusplus } Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/src/plcore.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -946,10 +946,10 @@ args.string = string; } - // if ( !plsc->alt_unicode ) - // { - plP_esc( PLESC_HAS_TEXT, &args ); - // } + // if ( !plsc->alt_unicode ) + // { + plP_esc( PLESC_HAS_TEXT, &args ); + // } #ifndef DEBUG_TEXT } else Modified: trunk/src/plstdio.c =================================================================== --- trunk/src/plstdio.c 2009-11-16 12:21:25 UTC (rev 10597) +++ trunk/src/plstdio.c 2009-11-16 12:22:49 UTC (rev 10598) @@ -40,8 +40,8 @@ */ #if defined ( _MSC_VER ) && _MSC_VER >= 1400 #include <io.h> -#define mktemp _mktemp -#define open _open +#define mktemp _mktemp +#define open _open #endif /* * plio_write() @@ -155,40 +155,41 @@ * pl_create_tempfile() * * Securely create a temporary file and return a file handle to it. - * This provides cross-platform compatibility and also adds some - * additional functionality over mkstemp in that it honours the TMP / + * This provides cross-platform compatibility and also adds some + * additional functionality over mkstemp in that it honours the TMP / * TMPDIR / TEMP environment variables. - * + * * The function returns the file handle. * * If the fname variable is not NULL, then on return it will contain * a pointer to the full temporary file name. This will be allocated - * with malloc. It is the caller's responsibility to ensure this + * with malloc. It is the caller's responsibility to ensure this * memory is free'd and to ensure the file is deleted after use. - * If fname is NULL then the file will be automatically deleted + * If fname is NULL then the file will be automatically deleted * when it is closed. */ int -pl_create_tempfile(char **fname) +pl_create_tempfile( char **fname ) { - int fd, flags; - char *tmpdir; - char *template; + int fd, flags; + char *tmpdir; + char *template; const char *tmpfile = "plplot_XXXXXX"; #if defined ( MSDOS ) || defined ( WIN32 ) - tmpdir = getenv("TEMP"); + tmpdir = getenv( "TEMP" ); #else - tmpdir = getenv("TMPDIR"); + tmpdir = getenv( "TMPDIR" ); #endif /* The P_TMPDIR macro is defined in stdio.h on many UNIX systems - try that */ #ifdef P_TMPDIR - if (tmpdir == NULL) + if ( tmpdir == NULL ) tmpdir = P_TMPDIR; #endif - if (tmpdir == NULL) { + if ( tmpdir == NULL ) + { #if defined ( MSDOS ) || defined ( WIN32 ) tmpdir = "c:\\windows\\Temp"; #else @@ -197,43 +198,45 @@ } /* N.B. Malloc ensures template is long enough so strcpy and strcat are safe here */ - template = (char *) malloc( sizeof(char)*(strlen(tmpdir) + strlen(tmpfile) + 2)); - strcpy(template,tmpdir); + template = (char *) malloc( sizeof ( char ) * ( strlen( tmpdir ) + strlen( tmpfile ) + 2 )); + strcpy( template, tmpdir ); #if defined ( MSDOS ) || defined ( WIN32 ) - strcat(template,"\\"); + strcat( template, "\\" ); #else - strcat(template,"/"); + strcat( template, "/" ); #endif - strcat(template,tmpfile); + strcat( template, tmpfile ); #ifdef PL_HAVE_MKSTEMP - fd = mkstemp(template); + fd = mkstemp( template ); /* If we are not returning the file name then unlink the file so it is * automatically deleted. */ if ( fd != -1 && fname == NULL ) - unlink(template); + unlink( template ); #else -#if !defined(_S_IREAD) -#define _S_IREAD 256 +#if !defined ( _S_IREAD ) +#define _S_IREAD 256 #endif -#if !defined(_S_IWRITE) -#define _S_IWRITE 128 +#if !defined ( _S_IWRITE ) +#define _S_IWRITE 128 #endif - fd = -1; - flags = O_RDWR|O_BINARY|O_CREAT|O_EXCL|_O_SHORT_LIVED; + fd = -1; + flags = O_RDWR | O_BINARY | O_CREAT | O_EXCL | _O_SHORT_LIVED; /* If we are not returning the file name then add flag to automatically * delete file once all file handles are closed. */ - if (fname == NULL) + if ( fname == NULL ) flags = flags | _O_TEMPORARY; - mktemp(template); - fd = open(template,flags, _S_IREAD|_S_IWRITE); + mktemp( template ); + fd = open( template, flags, _S_IREAD | _S_IWRITE ); #endif - if (fname != NULL) { + if ( fname != NULL ) + { *fname = template; } - else { - free(template); + else + { + free( template ); } return fd; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |