From: <ai...@us...> - 2009-09-24 03:50:56
|
Revision: 10470 http://plplot.svn.sourceforge.net/plplot/?rev=10470&view=rev Author: airwin Date: 2009-09-24 03:50:46 +0000 (Thu, 24 Sep 2009) Log Message: ----------- Locally reverted all src changes back to 10456 (using "svn merge --ignore-ancestor -r 10468:10456 .") then reapplied uncrustify with revised uncrustify.cfg where long line splitting had been turned off. The result has a substantially more satisfactory style than revision 10468. The reason is uncrustify is not that reliable in splitting overlong lines so it is better to be conservative here and do that by hand. I have committed these newly styled src results (after a quick check that the PLplot library and C examples still built and the PostScript results of examples showed no visible regressions). Revision Links: -------------- http://plplot.svn.sourceforge.net/plplot/?rev=10468&view=rev Modified Paths: -------------- trunk/src/pdfutils.c trunk/src/plarc.c trunk/src/plargs.c trunk/src/plbox.c trunk/src/plbuf.c trunk/src/plcont.c trunk/src/plcore.c trunk/src/plctrl.c trunk/src/pldtik.c trunk/src/plfreetype.c trunk/src/plgridd.c trunk/src/plimage.c trunk/src/plline.c trunk/src/plmap.c trunk/src/plot3d.c trunk/src/plshade.c trunk/src/plstripc.c trunk/src/plsym.c trunk/src/pltime.c trunk/src/plvect.c trunk/uncrustify.cfg Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2009-09-24 03:26:53 UTC (rev 10469) +++ trunk/src/pdfutils.c 2009-09-24 03:50:46 UTC (rev 10470) @@ -265,9 +265,7 @@ pldebug( "pdf_putc", "Increasing buffer to %d bytes\n", pdfs->bufmax ); pdfs->bufmax += 512; - if (( pdfs->buffer = - (U_CHAR *) realloc((void *) pdfs->buffer, - pdfs->bufmax )) == NULL ) + if (( pdfs->buffer = (U_CHAR *) realloc((void *) pdfs->buffer, pdfs->bufmax )) == NULL ) { plexit( "pdf_putc: Insufficient memory" ); } @@ -387,8 +385,7 @@ "Increasing buffer to %d bytes\n", pdfs->bufmax ); pdfs->bufmax += 512; if (( pdfs->buffer = (U_CHAR *) - realloc((void *) ( pdfs->buffer ), - pdfs->bufmax )) == NULL ) + realloc((void *) ( pdfs->buffer ), pdfs->bufmax )) == NULL ) { plexit( "pdf_wrx: Insufficient memory" ); } Modified: trunk/src/plarc.c =================================================================== --- trunk/src/plarc.c 2009-09-24 03:26:53 UTC (rev 10469) +++ trunk/src/plarc.c 2009-09-24 03:50:46 UTC (rev 10470) @@ -34,13 +34,7 @@ * *-------------------------------------------------------------------------*/ void -plarc_approx( PLFLT x, - PLFLT y, - PLFLT a, - PLFLT b, - PLFLT angle1, - PLFLT angle2, - PLBOOL fill ) +plarc_approx( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, PLBOOL fill ) { PLINT i; PLFLT theta0, theta_step, theta, d_angle; @@ -111,13 +105,7 @@ * *-------------------------------------------------------------------------*/ void -c_plarc( PLFLT x, - PLFLT y, - PLFLT a, - PLFLT b, - PLFLT angle1, - PLFLT angle2, - PLBOOL fill ) +c_plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, PLBOOL fill ) { PLINT xscl[2], yscl[2]; PLINT clpxmi, clpxma, clpymi, clpyma; Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2009-09-24 03:26:53 UTC (rev 10469) +++ trunk/src/plargs.c 2009-09-24 03:50:46 UTC (rev 10470) @@ -100,16 +100,8 @@ /* Support functions */ -static int ParseOpt( int *, - const char ***, - int *, - const char ***, - PLOptionTable * ); -static int ProcessOpt( const char *, - PLOptionTable *, - int *, - const char ***, - int * ); +static int ParseOpt( int *, const char ***, int *, const char ***, PLOptionTable * ); +static int ProcessOpt( const char *, PLOptionTable *, int *, const char ***, int * ); static int GetOptarg( const char **, int *, const char ***, int * ); static void Help( void ); static void Syntax( void ); @@ -947,10 +939,7 @@ \*--------------------------------------------------------------------------*/ static int -ParseOpt( int *p_myargc, - const char ***p_argv, - int *p_argc, - const char ***p_argsave, +ParseOpt( int *p_myargc, const char ***p_argv, int *p_argc, const char ***p_argsave, PLOptionTable *option_table ) { PLOptionTable *tab; @@ -1002,10 +991,7 @@ \*--------------------------------------------------------------------------*/ static int -ProcessOpt( const char *opt, - PLOptionTable *tab, - int *p_myargc, - const char ***p_argv, +ProcessOpt( const char *opt, PLOptionTable *tab, int *p_myargc, const char ***p_argv, int *p_argc ) { int need_arg, res; @@ -1041,8 +1027,7 @@ { /* Make a copy, since handler may mung optarg with strtok() */ char *copy = - (char *) malloc((size_t) ( 1 + - strlen( optarg )) * sizeof ( char )); + (char *) malloc((size_t) ( 1 + strlen( optarg )) * sizeof ( char )); if ( copy == NULL ) { plabort( "ProcessOpt: out of memory" ); @@ -1127,10 +1112,7 @@ \*--------------------------------------------------------------------------*/ static int -GetOptarg( const char **poptarg, - int *p_myargc, - const char ***p_argv, - int *p_argc ) +GetOptarg( const char **poptarg, int *p_myargc, const char ***p_argv, int *p_argc ) { int result = 0; @@ -1158,9 +1140,7 @@ { if ( !mode_quiet ) { - fprintf( stderr, - "Argument missing for %s option.\n", - ( *p_argv )[0] ); + fprintf( stderr, "Argument missing for %s option.\n", ( *p_argv )[0] ); plOptUsage(); } } @@ -1365,40 +1345,29 @@ case DRV_STR: *(char **) ( t->var_ptr ) = ( drvp->value ); #ifdef DEBUG - fprintf( stderr, "plParseDrvOpts: %s %s\n", t->opt, - *(char**) t->var_ptr ); + fprintf( stderr, "plParseDrvOpts: %s %s\n", t->opt, *(char**) t->var_ptr ); #endif break; case DRV_INT: if ( sscanf( drvp->value, "%d", (int *) t->var_ptr ) != 1 ) { - snprintf( msg, - sizeof ( msg ) - 1, - "Incorrect argument to '%s' option", - drvp->option ); + snprintf( msg, sizeof ( msg ) - 1, "Incorrect argument to '%s' option", drvp->option ); plexit( msg ); } #ifdef DEBUG - fprintf( stderr, - "plParseDrvOpts: %s %d\n", - t->opt, - *(int *) t->var_ptr ); + fprintf( stderr, "plParseDrvOpts: %s %d\n", t->opt, *(int *) t->var_ptr ); #endif break; case DRV_FLT: if ( sscanf( drvp->value, "%f", (float *) t->var_ptr ) != 1 ) { - snprintf( msg, - sizeof ( msg ) - 1, - "Incorrect argument to '%s' option", - drvp->option ); + snprintf( msg, sizeof ( msg ) - 1, "Incorrect argument to '%s' option", drvp->option ); plexit( msg ); } #ifdef DEBUG - fprintf( stderr, "plParseDrvOpts: %s %f\n", t->opt, - *(float *) t->var_ptr ); + fprintf( stderr, "plParseDrvOpts: %s %f\n", t->opt, *(float *) t->var_ptr ); #endif break; } @@ -1408,11 +1377,7 @@ if ( !fl ) { - snprintf( - msg, - sizeof ( msg ) - 1, - "Option '%s' not recognized.\n\nRecognized options for this driver are:\n", - drvp->option ); + snprintf( msg, sizeof ( msg ) - 1, "Option '%s' not recognized.\n\nRecognized options for this driver are:\n", drvp->option ); plwarn( msg ); plHelpDrvOpts( acc_opt ); plexit( "" ); @@ -1785,9 +1750,7 @@ break; default: - fprintf( stderr, - "Unrecognized background color value %s\n", - color_field ); + fprintf( stderr, "Unrecognized background color value %s\n", color_field ); return 1; } @@ -2017,9 +1980,7 @@ bytemax = (PLINT) ( multiplier * atof( spec )); if ( bytemax <= 0 ) { - fprintf( stderr, - "?invalid file size %d. 2.14G is the maximum.\n", - bytemax ); + fprintf( stderr, "?invalid file size %d. 2.14G is the maximum.\n", bytemax ); return 1; } plsfam( 1, -1, bytemax ); @@ -2167,10 +2128,7 @@ static int opt_plwindow( const char *opt, const char *optarg, void *client_data ) { - if (( plsc->plwindow = - (char *) malloc((size_t) ( 1 + - strlen( optarg )) * - sizeof ( char ))) == NULL ) + if (( plsc->plwindow = (char *) malloc((size_t) ( 1 + strlen( optarg )) * sizeof ( char ))) == NULL ) { plexit( "opt_plwindow: Insufficient memory" ); } @@ -2191,10 +2149,7 @@ { char *newcmd; - if (( newcmd = - (char *) malloc((size_t) ( strlen( optarg ) + - 9 ) * sizeof ( char ))) == - NULL ) + if (( newcmd = (char *) malloc((size_t) ( strlen( optarg ) + 9 ) * sizeof ( char ))) == NULL ) { plexit( "opt_tcl_cmd: Insufficient memory" ); } @@ -2202,9 +2157,7 @@ strcpy( newcmd, "tcl_cmd=" ); strcat( newcmd, optarg ); - fprintf( - stderr, - "-tcl_cmd <cmd> is obsolete. Please use -drvopt tcl_cmd=<cmd> instead\n" ); + fprintf( stderr, "-tcl_cmd <cmd> is obsolete. Please use -drvopt tcl_cmd=<cmd> instead\n" ); opt_drvopt( "drvopt", newcmd, NULL ); free( newcmd ); @@ -2273,10 +2226,7 @@ /* The TK driver uses the geometry string directly */ - if (( plsc->geometry = - (char *) malloc((size_t) ( 1 + - strlen( optarg )) * - sizeof ( char ))) == NULL ) + if (( plsc->geometry = (char *) malloc((size_t) ( 1 + strlen( optarg )) * sizeof ( char ))) == NULL ) { plexit( "opt_geo: Insufficient memory" ); } @@ -2332,10 +2282,7 @@ static int opt_tk_file( const char *opt, const char *optarg, void *client_data ) { - if (( plsc->tk_file = - (char *) malloc((size_t) ( 1 + - strlen( optarg )) * - sizeof ( char ))) == NULL ) + if (( plsc->tk_file = (char *) malloc((size_t) ( 1 + strlen( optarg )) * sizeof ( char ))) == NULL ) { plexit( "opt_tk_file: Insufficient memory" ); } @@ -2453,12 +2400,10 @@ } else { - plwarn( - "Could not use invalid environment (e.g., LC_ALL, LC_NUMERIC, or LANG) to set LC_NUMERIC locale. Falling back to LC_NUMERIC \"C\" locale instead.\n" ); + plwarn( "Could not use invalid environment (e.g., LC_ALL, LC_NUMERIC, or LANG) to set LC_NUMERIC locale. Falling back to LC_NUMERIC \"C\" locale instead.\n" ); if ( !( locale = setlocale( LC_NUMERIC, "C" ))) { - plexit( - "Your platform is seriously broken. Not even a \"C\" locale could be set." ); + plexit( "Your platform is seriously broken. Not even a \"C\" locale could be set." ); } } return 0; Modified: trunk/src/plbox.c =================================================================== --- trunk/src/plbox.c 2009-09-24 03:26:53 UTC (rev 10469) +++ trunk/src/plbox.c 2009-09-24 03:50:46 UTC (rev 10470) @@ -55,15 +55,7 @@ PLFLT wy2, PLFLT disp, PLFLT pos, PLFLT just, const char *text ); static void -plform( PLINT axis, - PLFLT value, - PLINT scale, - PLINT prec, - char *result, - PLINT len, - PLBOOL ll, - PLBOOL lf, - PLBOOL lo ); +plform( PLINT axis, PLFLT value, PLINT scale, PLINT prec, char *result, PLINT len, PLBOOL ll, PLBOOL lf, PLBOOL lo ); static void grid_box( const char *xopt, PLFLT xtick1, PLINT nxsub1, @@ -353,8 +345,7 @@ if ( ldx ) { pldtfac( vpwxmi, vpwxma, &factor, &tstart ); - tp = xtick1 * - ( floor(( vpwxma - tstart ) / xtick1 ) + 1 ) + tstart; + tp = xtick1 * ( floor(( vpwxma - tstart ) / xtick1 ) + 1 ) + tstart; } else tp = xtick1 * ( floor( vpwxma / xtick1 ) + 1 ); @@ -401,8 +392,7 @@ if ( ldy ) { pldtfac( vpwymi, vpwyma, &factor, &tstart ); - tp = ytick1 * - ( floor(( vpwymi - tstart ) / ytick1 ) + 1 ) + tstart; + tp = ytick1 * ( floor(( vpwymi - tstart ) / ytick1 ) + 1 ) + tstart; } else tp = ytick1 * ( floor( vpwyma / ytick1 ) + 1 ); @@ -458,8 +448,7 @@ { temp = tp + xlog[i]; if ( BETW( temp, vpwxmi, vpwxma )) - plxtik( plP_wcpcx( - temp ), (PLINT) yp0, xminor, xminor ); + plxtik( plP_wcpcx( temp ), (PLINT) yp0, xminor, xminor ); } } else @@ -468,8 +457,7 @@ { temp = tp + i * xtick1 / nxsub1; if ( BETW( temp, vpwxmi, vpwxma )) - plxtik( plP_wcpcx( - temp ), (PLINT) yp0, xminor, xminor ); + plxtik( plP_wcpcx( temp ), (PLINT) yp0, xminor, xminor ); } } } @@ -501,8 +489,7 @@ { temp = tp + xlog[i]; if ( BETW( temp, vpwymi, vpwyma )) - plytik((PLINT) xp0, plP_wcpcy( - temp ), yminor, yminor ); + plytik((PLINT) xp0, plP_wcpcy( temp ), yminor, yminor ); } } else @@ -511,8 +498,7 @@ { temp = tp + i * ytick1 / nysub1; if ( BETW( temp, vpwymi, vpwyma )) - plytik((PLINT) xp0, plP_wcpcy( - temp ), yminor, yminor ); + plytik((PLINT) xp0, plP_wcpcy( temp ), yminor, yminor ); } } } @@ -601,9 +587,7 @@ dx = ux - tx; dy = uy - ty; plzbx( zopt, zlabel, 1, dx, dy, ux, uy, - plP_w3wcy( xmax, - ymin, - zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmax, ymin, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); tx = plP_w3wcx( xmin, ymax, zmin ); ty = plP_w3wcy( xmin, ymax, zmin ); @@ -617,9 +601,7 @@ /* restore zdigits to initial value for second call */ zdigits = zdigmax; plzbx( zopt, zlabel, 0, dx, dy, tx, ty, - plP_w3wcy( xmin, - ymax, - zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmin, ymax, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); } else if ( cxx <= 0.0 && cxy <= 0.0 ) { @@ -634,9 +616,7 @@ dx = ux - tx; dy = uy - ty; plzbx( zopt, zlabel, 1, dx, dy, ux, uy, - plP_w3wcy( xmin, - ymin, - zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmin, ymin, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); tx = plP_w3wcx( xmax, ymax, zmin ); ty = plP_w3wcy( xmax, ymax, zmin ); @@ -650,9 +630,7 @@ /* restore zdigits to initial value for second call */ zdigits = zdigmax; plzbx( zopt, zlabel, 0, dx, dy, tx, ty, - plP_w3wcy( xmax, - ymax, - zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmax, ymax, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); } else if ( cxx <= 0.0 && cxy >= 0.0 ) { @@ -667,9 +645,7 @@ dx = ux - tx; dy = uy - ty; plzbx( zopt, zlabel, 1, dx, dy, ux, uy, - plP_w3wcy( xmin, - ymax, - zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmin, ymax, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); tx = plP_w3wcx( xmax, ymin, zmin ); ty = plP_w3wcy( xmax, ymin, zmin ); @@ -683,9 +659,7 @@ /* restore zdigits to initial value for second call */ zdigits = zdigmax; plzbx( zopt, zlabel, 0, dx, dy, tx, ty, - plP_w3wcy( xmax, - ymin, - zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmax, ymin, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); } else if ( cxx >= 0.0 && cxy >= 0.0 ) { @@ -700,9 +674,7 @@ dx = ux - tx; dy = uy - ty; plzbx( zopt, zlabel, 1, dx, dy, ux, uy, - plP_w3wcy( xmax, - ymax, - zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmax, ymax, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); tx = plP_w3wcx( xmin, ymin, zmin ); ty = plP_w3wcy( xmin, ymin, zmin ); @@ -716,9 +688,7 @@ /* restore zdigits to initial value for second call */ zdigits = zdigmax; plzbx( zopt, zlabel, 0, dx, dy, tx, ty, - plP_w3wcy( xmin, - ymin, - zmax ), zmin, zmax, ztick, nsubz, &zdigits ); + plP_w3wcy( xmin, ymin, zmax ), zmin, zmax, ztick, nsubz, &zdigits ); } plsxax( xdigmax, xdigits ); plsyax( ydigmax, ydigits ); @@ -1399,23 +1369,11 @@ { if ( ldx ) { - strfqsas( string, - STRING_LEN, - timefmt, - (double) tn, - plsc->qsasconfig ); + strfqsas( string, STRING_LEN, timefmt, (double) tn, plsc->qsasconfig ); } else { - plform( PL_X_AXIS, - tn, - xscale, - xprec, - string, - STRING_LEN, - llx, - lfx, - lox ); + plform( PL_X_AXIS, tn, xscale, xprec, string, STRING_LEN, llx, lfx, lox ); } height = lix ? 1.75 : 1.5; pos = ( vpwxmax > vpwxmin ) ? @@ -1437,11 +1395,9 @@ * label function is provided. */ if ( plsc->label_data ) { - height = - ((PLLabelDefaults *) plsc->label_data )->exp_label_disp; - pos = ((PLLabelDefaults *) plsc->label_data )->exp_label_pos; - just = - ((PLLabelDefaults *) plsc->label_data )->exp_label_just; + height = ((PLLabelDefaults *) plsc->label_data )->exp_label_disp; + pos = ((PLLabelDefaults *) plsc->label_data )->exp_label_pos; + just = ((PLLabelDefaults *) plsc->label_data )->exp_label_just; } else { @@ -1478,23 +1434,11 @@ { if ( ldy ) { - strfqsas( string, - STRING_LEN, - timefmt, - (double) tn, - plsc->qsasconfig ); + strfqsas( string, STRING_LEN, timefmt, (double) tn, plsc->qsasconfig ); } else { - plform( PL_Y_AXIS, - tn, - yscale, - yprec, - string, - STRING_LEN, - lly, - lfy, - loy ); + plform( PL_Y_AXIS, tn, yscale, yprec, string, STRING_LEN, lly, lfy, loy ); } pos = ( vpwymax > vpwymin ) ? ( tn - vpwymi ) / ( vpwyma - vpwymi ) : @@ -1539,11 +1483,9 @@ snprintf( string, STRING_LEN, "(x10#u%d#d)", (int) yscale ); if ( plsc->label_data ) { - height = - ((PLLabelDefaults *) plsc->label_data )->exp_label_disp; - pos = ((PLLabelDefaults *) plsc->label_data )->exp_label_pos; - just = - ((PLLabelDefaults *) plsc->label_data )->exp_label_just; + height = ((PLLabelDefaults *) plsc->label_data )->exp_label_disp; + pos = ((PLLabelDefaults *) plsc->label_data )->exp_label_pos; + just = ((PLLabelDefaults *) plsc->label_data )->exp_label_just; } else { @@ -1592,15 +1534,7 @@ \*--------------------------------------------------------------------------*/ static void -plform( PLINT axis, - PLFLT value, - PLINT scale, - PLINT prec, - char *string, - PLINT len, - PLBOOL ll, - PLBOOL lf, - PLBOOL lo ) +plform( PLINT axis, PLFLT value, PLINT scale, PLINT prec, char *string, PLINT len, PLBOOL ll, PLBOOL lf, PLBOOL lo ) { /* Check to see if a custom labeling function is defined. If not, */ if ( lo && plsc->label_func ) @@ -1611,8 +1545,7 @@ { if ( lo ) { - plwarn( - "Custom axis labels requested without a labeling function \ + plwarn( "Custom axis labels requested without a labeling function \ - using default." ); } if ( ll ) @@ -1696,11 +1629,7 @@ * \*--------------------------------------------------------------------------*/ void -c_plslabelfunc( void ( *label_func )( PLINT, - PLFLT, - char *, - PLINT, - PLPointer ), PLPointer label_data ) +c_plslabelfunc( void ( *label_func )( PLINT, PLFLT, char *, PLINT, PLPointer ), PLPointer label_data ) { plsc->label_func = label_func; plsc->label_data = label_data; Modified: trunk/src/plbuf.c =================================================================== --- trunk/src/plbuf.c 2009-09-24 03:26:53 UTC (rev 10469) +++ trunk/src/plbuf.c 2009-09-24 03:50:46 UTC (rev 10470) @@ -267,10 +267,7 @@ wr_data( pls, pls->dev_ix, sizeof ( short ) * npts ); wr_data( pls, pls->dev_iy, sizeof ( short ) * npts ); - wr_data( pls, - pls->dev_z, - sizeof ( unsigned short ) * - ( pls->dev_nptsX - 1 ) * ( pls->dev_nptsY - 1 )); + wr_data( pls, pls->dev_z, sizeof ( unsigned short ) * ( pls->dev_nptsX - 1 ) * ( pls->dev_nptsY - 1 )); } /*--------------------------------------------------------------------------*\ @@ -310,9 +307,7 @@ wr_data( pls, &text->unicode_array_len, sizeof ( PLINT )); if ( text->unicode_array_len ) - wr_data( pls, - text->unicode_array, - sizeof ( PLUNICODE ) * text->unicode_array_len ); + wr_data( pls, text->unicode_array, sizeof ( PLUNICODE ) * text->unicode_array_len ); } /*--------------------------------------------------------------------------*\ @@ -578,10 +573,7 @@ if ((int) icol0 >= pls->ncol0 ) { char buffer[256]; - snprintf( buffer, - 256, - "rdbuf_state: Invalid color map entry: %d", - (int) icol0 ); + snprintf( buffer, 256, "rdbuf_state: Invalid color map entry: %d", (int) icol0 ); plabort( buffer ); return; } @@ -755,18 +747,12 @@ */ if ((( dev_ix = (short *) malloc( npts * sizeof ( short ))) == NULL ) || (( dev_iy = (short *) malloc( npts * sizeof ( short ))) == NULL ) || - (( dev_z = - (unsigned short *) malloc(( nptsX - - 1 ) * - ( nptsY - - 1 ) * sizeof ( unsigned short ))) == - NULL )) + (( dev_z = (unsigned short *) malloc(( nptsX - 1 ) * ( nptsY - 1 ) * sizeof ( unsigned short ))) == NULL )) plexit( "rdbuf_image: Insufficient memory" ); rd_data( pls, dev_ix, sizeof ( short ) * npts ); rd_data( pls, dev_iy, sizeof ( short ) * npts ); - rd_data( pls, dev_z, sizeof ( unsigned short ) * - ( nptsX - 1 ) * ( nptsY - 1 )); + rd_data( pls, dev_z, sizeof ( unsigned short ) * ( nptsX - 1 ) * ( nptsY - 1 )); /* * COMMENTED OUT by Hezekiah Carty @@ -845,9 +831,7 @@ rd_data( pls, &text.unicode_array_len, sizeof ( PLINT )); if ( text.unicode_array_len ) { - if (( unicode = - (PLUNICODE *) malloc( text.unicode_array_len * - sizeof ( PLUNICODE ))) + if (( unicode = (PLUNICODE *) malloc( text.unicode_array_len * sizeof ( PLUNICODE ))) == NULL ) plexit( "rdbuf_text: Insufficient memory" ); @@ -1010,10 +994,7 @@ break; default: - pldebug( "plbuf_control", - "Unrecognized command %d, previous %d\n", - c, - c_old ); + pldebug( "plbuf_control", "Unrecognized command %d, previous %d\n", c, c_old ); } c_old = c; } @@ -1034,8 +1015,7 @@ #else if ( pls->plbuf_readpos < pls->plbuf_top ) { - *p_c = - *(U_CHAR *) ((U_CHAR *) pls->plbuf_buffer + pls->plbuf_readpos ); + *p_c = *(U_CHAR *) ((U_CHAR *) pls->plbuf_buffer + pls->plbuf_readpos ); pls->plbuf_readpos += sizeof ( U_CHAR ); count = sizeof ( U_CHAR ); } @@ -1086,16 +1066,13 @@ pls->plbuf_buffer_size += pls->plbuf_buffer_grow; if ( pls->verbose ) - printf( "Growing buffer to %d KB\n", - (int) ( pls->plbuf_buffer_size / 1024 )); - if (( pls->plbuf_buffer = - realloc( pls->plbuf_buffer, pls->plbuf_buffer_size )) == NULL ) + printf( "Growing buffer to %d KB\n", (int) ( pls->plbuf_buffer_size / 1024 )); + if (( pls->plbuf_buffer = realloc( pls->plbuf_buffer, pls->plbuf_buffer_size )) == NULL ) plexit( "plbuf wr_data: Plot buffer grow failed" ); } *(U_CHAR *) ((U_CHAR *) pls->plbuf_buffer + pls->plbuf_top ) = c; - pls->plbuf_top += - sizeof ( U_CHAR ); + pls->plbuf_top += sizeof ( U_CHAR ); #endif } @@ -1116,13 +1093,11 @@ /* Not enough space, need to grow the buffer */ /* Must make sure the increase is enough for this data */ pls->plbuf_buffer_size += pls->plbuf_buffer_grow * - (( pls->plbuf_top + buf_size - - pls->plbuf_buffer_size ) / + (( pls->plbuf_top + buf_size - pls->plbuf_buffer_size ) / pls->plbuf_buffer_grow + 1 ); while ( pls->plbuf_top + buf_size >= pls->plbuf_buffer_size ) ; - if (( pls->plbuf_buffer = - realloc( pls->plbuf_buffer, pls->plbuf_buffer_size )) == NULL ) + if (( pls->plbuf_buffer = realloc( pls->plbuf_buffer, pls->plbuf_buffer_size )) == NULL ) plexit( "plbuf wr_data: Plot buffer grow failed" ); } @@ -1206,16 +1181,13 @@ if ( plot_state->size < save_size ) { /* Yes, reallocate a larger one */ - if (( plot_state = - (struct _state *) realloc( state, - save_size )) == NULL ) + if (( plot_state = (struct _state *) realloc( state, save_size )) == NULL ) { /* NOTE: If realloc fails, then plot_state ill be NULL. * This will leave the original buffer untouched, thus we * mark it as invalid and return it back to the caller. */ - plwarn( - "plbuf: Unable to reallocate sufficient memory to save state" ); + plwarn( "plbuf: Unable to reallocate sufficient memory to save state" ); plot_state->valid = 0; return state; @@ -1228,8 +1200,7 @@ /* A buffer does not exist, so we need to allocate one */ if (( plot_state = (struct _state *) malloc( save_size )) == NULL ) { - plwarn( - "plbuf: Unable to allocate sufficient memory to save state" ); + plwarn( "plbuf: Unable to allocate sufficient memory to save state" ); return NULL; } @@ -1275,8 +1246,7 @@ rewind( pls->plbufFile ); while ( count = fread( &tmp, sizeof ( U_CHAR ), 1, pls->plbufFile )) { - if ( fwrite( &tmp, sizeof ( U_CHAR ), 1, - plot_state->plbufFile ) != count ) + if ( fwrite( &tmp, sizeof ( U_CHAR ), 1, plot_state->plbufFile ) != count ) { /* Throw a warning since this might be a permissions problem * and we may not want to force an exit @@ -1301,8 +1271,7 @@ /* Copy the plot buffer to our new buffer. Again, I must stress, that we only * are copying the portion of the plot buffer that is being used */ - if ( memcpy( plot_state->plbuf_buffer, pls->plbuf_buffer, - pls->plbuf_top ) == NULL ) + if ( memcpy( plot_state->plbuf_buffer, pls->plbuf_buffer, pls->plbuf_top ) == NULL ) { /* This should never be NULL */ plwarn( "plbuf: Got a NULL in memcpy!" ); Modified: trunk/src/plcont.c =================================================================== --- trunk/src/plcont.c 2009-09-24 03:26:53 UTC (rev 10469) +++ trunk/src/plcont.c 2009-09-24 03:50:46 UTC (rev 10470) @@ -60,11 +60,7 @@ plP_pcwcy( PLINT y ); static void -pl_drawcontlabel( PLFLT tpx, - PLFLT tpy, - char *flabel, - PLFLT *distance, - PLINT *lastindex ); +pl_drawcontlabel( PLFLT tpx, PLFLT tpy, char *flabel, PLFLT *distance, PLINT *lastindex ); /* Error flag for aborts */ @@ -152,13 +148,9 @@ realloc_line( CONT_LINE *line ) { if ((( line->x = (PLFLT *) realloc( line->x, - ( line->npts + - LINE_ITEMS ) * sizeof ( PLFLT ))) == - NULL ) || + ( line->npts + LINE_ITEMS ) * sizeof ( PLFLT ))) == NULL ) || (( line->y = (PLFLT *) realloc( line->y, - ( line->npts + - LINE_ITEMS ) * sizeof ( PLFLT ))) == - NULL )) + ( line->npts + LINE_ITEMS ) * sizeof ( PLFLT ))) == NULL )) plexit( "realloc_line: Insufficient memory" ); } @@ -258,10 +250,7 @@ } /* small routine to set offset and spacing of contour labels, see desciption above */ -void c_pl_setcontlabelparam( PLFLT offset, - PLFLT size, - PLFLT spacing, - PLINT active ) +void c_pl_setcontlabelparam( PLFLT offset, PLFLT size, PLFLT spacing, PLINT active ) { contlabel_offset = offset; contlabel_size = size; @@ -276,11 +265,7 @@ sigprec = sigdig; } -static void pl_drawcontlabel( PLFLT tpx, - PLFLT tpy, - char *flabel, - PLFLT *distance, - PLINT *lastindex ) +static void pl_drawcontlabel( PLFLT tpx, PLFLT tpy, char *flabel, PLFLT *distance, PLINT *lastindex ) { PLFLT delta_x, delta_y; PLINT currx_old, curry_old; @@ -380,11 +365,7 @@ mant = value / pow( 10.0, exponent ); if ( mant != 0.0 ) - mant = - (int ) ( mant * - pow( 10.0, prec - 1 ) + 0.5 * mant / fabs( mant )) / pow( - 10.0, - prec - 1 ); + mant = (int ) ( mant * pow( 10.0, prec - 1 ) + 0.5 * mant / fabs( mant )) / pow( 10.0, prec - 1 ); snprintf( form, FORM_LEN, "%%.%df", prec - 1 ); snprintf( string, len, form, mant ); @@ -728,9 +709,7 @@ num++; first = 0; } - for ( k = 0, i = ( startedge < 0 ? 0 : startedge ); - k < 4; - k++, i = ( i + 1 ) % 4 ) + for ( k = 0, i = ( startedge < 0 ? 0 : startedge ); k < 4; k++, i = ( i + 1 ) % 4 ) { if ( i == startedge ) continue; @@ -752,12 +731,8 @@ j = ( i + 1 ) % 4; if ( f[i] != 0.0 ) { - locx[num] = - ( px[i] * fabs( f[j] ) + px[j] * - fabs( f[i] )) / fabs( f[j] - f[i] ); - locy[num] = - ( py[i] * fabs( f[j] ) + py[j] * - fabs( f[i] )) / fabs( f[j] - f[i] ); + locx[num] = ( px[i] * fabs( f[j] ) + px[j] * fabs( f[i] )) / fabs( f[j] - f[i] ); + locy[num] = ( py[i] * fabs( f[j] ) + py[j] * fabs( f[i] )) / fabs( f[j] - f[i] ); } else { @@ -776,11 +751,7 @@ { /* Link to the next point on the contour */ if ( contlabel_active ) - pl_drawcontlabel( locx[num], - locy[num], - flabel, - distance, - lastindex ); + pl_drawcontlabel( locx[num], locy[num], flabel, distance, lastindex ); else cont_xy_store( locx[num], locy[num] ); /* Need to follow contour into next grid box */ Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2009-09-24 03:26:53 UTC (rev 10469) +++ trunk/src/plcore.c 2009-09-24 03:50:46 UTC (rev 10470) @@ -126,8 +126,7 @@ * translating the Greek characters from the #g escape sequences into * the Hershey and Unicode codings */ -const char plP_greek_mnemonic[] = - "ABGDEZYHIKLMNCOPRSTUFXQWabgdezyhiklmncoprstufxqw"; +const char plP_greek_mnemonic[] = "ABGDEZYHIKLMNCOPRSTUFXQWabgdezyhiklmncoprstufxqw"; void plP_init( void ) @@ -264,13 +263,7 @@ if ( plsc->difilt ) { args = (EscText*) ptr; - difilt( &( args->x ), - &( args->y ), - 1, - &clpxmi, - &clpxma, - &clpymi, - &clpyma ); + difilt( &( args->x ), &( args->y ), 1, &clpxmi, &clpxma, &clpymi, &clpyma ); } } @@ -424,8 +417,7 @@ { if ( !foo ) { - plwarn( - "Driver does not support hardware solid fills, switching to software fill.\n" ); + plwarn( "Driver does not support hardware solid fills, switching to software fill.\n" ); foo = 1; } plsc->patt = 8; @@ -491,10 +483,7 @@ if ( end != endptr[0] ) { - snprintf( msgbuf, - BUFFER_SIZE, - "text2num: invalid control string detected - %c expected", - end ); + snprintf( msgbuf, BUFFER_SIZE, "text2num: invalid control string detected - %c expected", end ); plwarn( msgbuf ); } @@ -519,9 +508,7 @@ * impossible value, and the function returns 0. \*--------------------------------------------------------------------------*/ -int text2fci( const char *text, - unsigned char *hexdigit, - unsigned char *hexpower ) +int text2fci( const char *text, unsigned char *hexdigit, unsigned char *hexpower ) { typedef struct { @@ -601,8 +588,8 @@ { len = strlen( string ); /* this length is only used in the loop - * counter, we will work out the length of - * the unicode string as we go */ + * counter, we will work out the length of + * the unicode string as we go */ plgesc( &esc ); /* At this stage we will do some translations into unicode, like @@ -623,7 +610,7 @@ plP_esc( PLESC_BEGIN_TEXT, &args ); } for ( j = i = 0; i < len; i++ ) /* Walk through the string, and convert - * some stuff to unicode on the fly */ + * some stuff to unicode on the fly */ { skip = 0; @@ -638,20 +625,16 @@ fcisave = fci; plP_hex2fci( PL_FCI_SYMBOL, PL_FCI_FAMILY, &fci ); unicode_buffer[j++] = fci; - unicode_buffer[j++] = - (PLUNICODE) hershey_to_unicode_lookup_table[idx - ]. - Unicode; + unicode_buffer[j++] = \ + (PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode; if ( plsc->alt_unicode ) { args.n_fci = fci; args.n_ctrl_char = PLTEXT_FONTCHANGE; plP_esc( PLESC_CONTROL_CHAR, &args ); - args.n_char = - (PLUNICODE) hershey_to_unicode_lookup_table - [idx] - .Unicode; + args.n_char = \ + (PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode; plP_esc( PLESC_TEXT_CHAR, &args ); } @@ -662,8 +645,7 @@ * escape characters that are interpreted by the device * driver. */ - if ( unicode_buffer[j - 1] == - esc ) unicode_buffer[j++] = esc; + if ( unicode_buffer[j - 1] == esc ) unicode_buffer[j++] = esc; fci = fcisave; unicode_buffer[j] = fci; skip = 1; @@ -693,8 +675,7 @@ * escape characters that are interpreted by the device * driver. */ - if ( unicode_buffer[j - 1] == - esc ) unicode_buffer[j++] = esc; + if ( unicode_buffer[j - 1] == esc ) unicode_buffer[j++] = esc; fci = fcisave; unicode_buffer[j] = fci; skip = 1; @@ -727,8 +708,7 @@ * digit and hex digit value in second rightmost * hex digit. */ - hexdigit = - ( code >> 4 ) & PL_FCI_HEXDIGIT_MASK; + hexdigit = ( code >> 4 ) & PL_FCI_HEXDIGIT_MASK; hexpower = code & PL_FCI_HEXPOWER_MASK; plP_hex2fci( hexdigit, hexpower, &fci ); unicode_buffer[j] = fci; @@ -745,9 +725,7 @@ else { - i += text2fci( &string[i + 1], - &hexdigit, - &hexpower ); + i += text2fci( &string[i + 1], &hexdigit, &hexpower ); if ( hexpower < 7 ) { plP_hex2fci( hexdigit, hexpower, &fci ); @@ -835,22 +813,17 @@ { if ( ig >= 24 ) ig = ig + 100 - 24; - idx = plhershey2unicode( - ig + 527 ); - unicode_buffer[j++] = - (PLUNICODE) hershey_to_unicode_lookup_table - [idx] - .Unicode; + idx = plhershey2unicode( ig + 527 ); + unicode_buffer[j++] = \ + (PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode; i += 2; skip = 1; /* skip is set if we have copied something - * into the unicode table */ + * into the unicode table */ if ( plsc->alt_unicode ) { - args.n_char = - (PLUNICODE) - hershey_to_unicode_lookup_table[ - idx].Unicode; + args.n_char = \ + (PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode; plP_esc( PLESC_TEXT_CHAR, &args ); } } @@ -861,14 +834,12 @@ unicode_buffer[j++] = (PLUNICODE) 0x00; i += 2; skip = 1; /* skip is set if we have copied something - * into the unicode table */ + * into the unicode table */ if ( plsc->alt_unicode ) { - args.n_char = - (PLUNICODE) - hershey_to_unicode_lookup_table[ - idx].Unicode; + args.n_char = \ + (PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode; plP_esc( PLESC_TEXT_CHAR, &args ); } } @@ -909,21 +880,17 @@ { PLUNICODE unichar = 0; #ifdef HAVE_LIBUNICODE - char * ptr = unicode_get_utf8( string + i, - &unichar ); + char * ptr = unicode_get_utf8( string + i, &unichar ); #else - char* ptr = utf8_to_ucs4( string + i, &unichar ); + char * ptr = utf8_to_ucs4( string + i, &unichar ); #endif if ( ptr == NULL ) { char buf[BUFFER_SIZE]; strncpy( buf, string, 30 ); buf[30] = '\0'; - snprintf( buf, - BUFFER_SIZE, - "UTF-8 string is malformed: %s%s", - buf, - strlen( string ) > 30 ? "[...]" : "" ); + snprintf( buf, BUFFER_SIZE, "UTF-8 string is malformed: %s%s", + buf, strlen( string ) > 30 ? "[...]" : "" ); plabort( buf ); return; } @@ -953,11 +920,11 @@ if ( j > 0 ) { args.unicode_array_len = j; /* Much easier to set the length than - * work it out later :-) */ + * work it out later :-) */ args.unicode_array = &unicode_buffer[0]; /* Get address of the - * unicode buffer (even - * though it is - * currently static) */ + * unicode buffer (even + * though it is + * currently static) */ } else /* Don't print anything, if there is no unicode to print! */ @@ -1190,12 +1157,8 @@ { for ( i = 0; i < npts; i++ ) { - x = - (PLINT) ( plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + - plsc->dioxb ); - y = - (PLINT) ( plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + - plsc->dioyb ); + x = (PLINT) ( plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + plsc->dioxb ); + y = (PLINT) ( plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + plsc->dioyb ); xscl[i] = x; yscl[i] = y; } @@ -1260,12 +1223,8 @@ { for ( i = 0; i < npts; i++ ) { - x = - (PLINT) ( plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + - plsc->dioxb ); - y = - (PLINT) ( plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + - plsc->dioyb ); + x = (PLINT) ( plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + plsc->dioxb ); + y = (PLINT) ( plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + plsc->dioyb ); xscl[i] = x; yscl[i] = y; } @@ -1864,10 +1823,8 @@ PLINT pxmin, pxmax, pymin, pymax; PLFLT dimxlen, dimylen, pxlen, pylen; - if (( plsc->dimxmin == plsc->phyxmi ) && - ( plsc->dimxmax == plsc->phyxma ) && - ( plsc->dimymin == plsc->phyymi ) && - ( plsc->dimymax == plsc->phyyma ) && + if (( plsc->dimxmin == plsc->phyxmi ) && ( plsc->dimxmax == plsc->phyxma ) && + ( plsc->dimymin == plsc->phyymi ) && ( plsc->dimymax == plsc->phyyma ) && ( plsc->dimxpmm == plsc->xpmm ) && ( plsc->dimypmm == plsc->ypmm )) { plsc->difilt &= ~PLDI_MAP; @@ -2461,8 +2418,7 @@ if ( plsc->cmap0 != NULL ) free((void *) plsc->cmap0 ); - if (( plsc->cmap0 = - (PLColor *) calloc( 1, plsc->ncol0 * sizeof ( PLColor ))) == NULL ) + if (( plsc->cmap0 = (PLColor *) calloc( 1, plsc->ncol0 * sizeof ( PLColor ))) == NULL ) { plexit( "c_plcpstrm: Insufficient memory" ); } @@ -2477,8 +2433,7 @@ if ( plsc->cmap1 != NULL ) free((void *) plsc->cmap1 ); - if (( plsc->cmap1 = - (PLColor *) calloc( 1, plsc->ncol1 * sizeof ( PLColor ))) == NULL ) + if (( plsc->cmap1 = (PLColor *) calloc( 1, plsc->ncol1 * sizeof ( PLColor ))) == NULL ) { plexit( "c_plcpstrm: Insufficient memory" ); } @@ -2560,8 +2515,7 @@ } } if ( chdir( currdir ) != 0 ) - pldebug( "plInBuildTree():", - "Unable to chdir to current directory" ); + pldebug( "plInBuildTree():", "Unable to chdir to current directory" ); } } inited = 1; @@ -2676,9 +2630,7 @@ fd = fopen( path, "r" ); if ( fd == NULL ) { - snprintf( - buf, - BUFFER2_SIZE, + snprintf( buf, BUFFER2_SIZE, "plInitDispatchTable: Could not open driver info file %s\n", name ); plabort( buf ); @@ -2711,9 +2663,7 @@ /* Allocate space for the dispatch table. */ if (( dispatch_table = (PLDispatchTable **) - malloc(( nplstaticdevices + - npldynamicdevices ) * - sizeof ( PLDispatchTable * ))) == NULL ) + malloc(( nplstaticdevices + npldynamicdevices ) * sizeof ( PLDispatchTable * ))) == NULL ) { plexit( "plInitDispatchTable: Insufficient memory" ); } @@ -2725,9 +2675,7 @@ for ( n = 0; n < nplstaticdevices; n++ ) { - if (( dispatch_table[n] = - (PLDispatchTable *) malloc( sizeof ( PLDispatchTable ))) == - NULL ) + if (( dispatch_table[n] = (PLDispatchTable *) malloc( sizeof ( PLDispatchTable ))) == NULL ) { plexit( "plInitDispatchTable: Insufficient memory" ); } @@ -2741,12 +2689,8 @@ /* Allocate space for the device and driver specs. We may not use all of * these driver descriptors, but we obviously won't need more drivers than * devices... */ - if ((( loadable_device_list = - malloc( npldynamicdevices * sizeof ( PLLoadableDevice ))) == - NULL ) || - (( loadable_driver_list = - malloc( npldynamicdevices * sizeof ( PLLoadableDriver ))) == - NULL )) + if ((( loadable_device_list = malloc( npldynamicdevices * sizeof ( PLLoadableDevice ))) == NULL ) || + (( loadable_driver_list = malloc( npldynamicdevices * sizeof ( PLLoadableDriver ))) == NULL )) { plexit( "plInitDispatchTable: Insufficient memory" ); } @@ -3017,13 +2961,10 @@ snprintf( sym, BUFFER_SIZE, "plD_dispatch_init_%s", tag ); { - PLDispatchInit dispatch_init = (PLDispatchInit) lt_dlsym( - driver->dlhand, - sym ); + PLDispatchInit dispatch_init = (PLDispatchInit) lt_dlsym( driver->dlhand, sym ); if ( !dispatch_init ) { - fprintf( - stderr, + fprintf( stderr, "Unable to locate dispatch table initialization function for driver: %s.\n", driver->drvnam ); return; @@ -3106,10 +3047,7 @@ } static void -plgdevlst( const char **p_menustr, - const char **p_devname, - int *p_ndev, - int type ) +plgdevlst( const char **p_menustr, const char **p_devname, int *p_ndev, int type ) { int i, j; @@ -3157,8 +3095,7 @@ c_plspage( PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng, PLINT xoff, PLINT yoff ) { if ( plsc->level > 0 ) - plwarn( - "calling plspage() after plinit() may give unpredictable results" ); + plwarn( "calling plspage() after plinit() may give unpredictable results" ); if ( xp ) plsc->xdpi = xp; @@ -3485,12 +3422,10 @@ { PLUNICODE mask; hexpower = hexpower & PL_FCI_HEXPOWER_MASK; - mask = - ~(((PLUNICODE) PL_FCI_HEXDIGIT_MASK ) << ((PLUNICODE) 4 * hexpower )); - *pfci = *pfci & mask; - mask = - (((PLUNICODE) ( hexdigit & PL_FCI_HEXDIGIT_MASK )) << ( 4 * hexpower )); - *pfci = *pfci | mask; + mask = ~(((PLUNICODE) PL_FCI_HEXDIGIT_MASK ) << ((PLUNICODE) 4 * hexpower )); + *pfci = *pfci & mask; + mask = (((PLUNICODE) ( hexdigit & PL_FCI_HEXDIGIT_MASK )) << ( 4 * hexpower )); + *pfci = *pfci | mask; } /* Retrieve hex digit value from FCI that is masked out and shifted to the @@ -3499,9 +3434,8 @@ plP_fci2hex( PLUNICODE fci, unsigned char *phexdigit, unsigned char hexpower ) { PLUNICODE mask; - hexpower = hexpower & PL_FCI_HEXPOWER_MASK; - mask = - (((PLUNICODE) PL_FCI_HEXPOWER_MASK ) << ((PLUNICODE) ( 4 * hexpower ))); + hexpower = hexpower & PL_FCI_HEXPOWER_MASK; + mask = (((PLUNICODE) PL_FCI_HEXPOWER_MASK ) << ((PLUNICODE) ( 4 * hexpower ))); *phexdigit = (unsigned char) (( fci & mask ) >> ((PLUNICODE) ( 4 * hexpower ))); } @@ -3876,7 +3810,7 @@ PLINT ret = 0; /* set up return code to 0, the value if no devices match*/ buff = (char *) malloc((size_t) PL_NSTREAMS * 8 ); /* Allocate enough memory for 8 - * characters for each possible stream */ + * characters for each possible stream */ if ( buff != NULL ) { @@ -3912,15 +3846,8 @@ \*--------------------------------------------------------------------------*/ void -plP_image( PLFLT *z, - PLINT nx, - PLINT ny, - PLFLT xmin, - PLFLT ymin, - PLFLT dx, - PLFLT dy, - void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), - PLPointer pltr_data ) +plP_image( PLFLT *z, PLINT nx, PLINT ny, PLFLT xmin, PLFLT ymin, PLFLT dx, PLFLT dy, + void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), PLPointer pltr_data ) { plsc->page_status = DRAWING; @@ -3978,8 +3905,7 @@ { PLINT clpxmi, clpxma, clpymi, clpyma; - if ((( xscl = (short *) malloc( nx * ny * sizeof ( short ))) == - NULL ) || + if ((( xscl = (short *) malloc( nx * ny * sizeof ( short ))) == NULL ) || (( yscl = (short *) malloc( nx * ny * sizeof ( short ))) == NULL )) { plexit( "plP_image: Insufficient memory" ); Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2009-09-24 03:26:53 UTC (rev 10469) +++ trunk/src/plctrl.c 2009-09-24 03:50:46 UTC (rev 10470) @@ -133,8 +133,7 @@ if ( icol0 < 0 || icol0 >= plsc->ncol0 ) { char buffer[BUFFER_SIZE]; - snprintf( buffer, BUFFER_SIZE, "plcol0: Invalid color map entry: %d", - (int) icol0 ); + snprintf( buffer, BUFFER_SIZE, "plcol0: Invalid color map entry: %d", (int) icol0 ); plabort( buffer ); return; } @@ -168,8 +167,7 @@ if ( col1 < 0 || col1 > 1 || isnan( col1 )) { char buffer[BUFFER_SIZE]; - snprintf( buffer, BUFFER_SIZE, "plcol1: Invalid color map position: %f", - (PLFLT) col1 ); + snprintf( buffer, BUFFER_SIZE, "plcol1: Invalid color map position: %f", (PLFLT) col1 ); plabort( buffer ); return; } @@ -250,8 +248,7 @@ if ( icol0 < 0 || icol0 >= plsc->ncol0 ) { char buffer[BUFFER_SIZE]; - snprintf( buffer, BUFFER_SIZE, "plscol0: Illegal color table value: %d", - (int) icol0 ); + snprintf( buffer, BUFFER_SIZE, "plscol0: Illegal color table value: %d", (int) icol0 ); plabort( buffer ); return; } @@ -282,25 +279,15 @@ if ( icol0 < 0 || icol0 >= plsc->ncol0 ) { char buffer[BUFFER_SIZE]; - snprintf( buffer, - BUFFER_SIZE, - "plscol0a: Illegal color table value: %d", - (int) icol0 ); + snprintf( buffer, BUFFER_SIZE, "plscol0a: Illegal color table value: %d", (int) icol0 ); plabort( buffer ); return; } - if (( r < 0 || - r > 255 ) || - ( g < 0 || g > 255 ) || ( b < 0 || b > 255 ) || ( a < 0 || a > 1.0 )) + if (( r < 0 || r > 255 ) || ( g < 0 || g > 255 ) || ( b < 0 || b > 255 ) || ( a < 0 || a > 1.0 )) { char buffer[BUFFER_SIZE]; - snprintf( buffer, - BUFFER_SIZE, - "plscol0a: Invalid RGB color: %d, %d, %d, %f", - (int) r, - (int) g, - (int) b, - (double) a ); + snprintf( buffer, BUFFER_SIZE, "plscol0a: Invalid RGB color: %d, %d, %d, %f", + (int) r, (int) g, (int) b, (double) a ); plabort( buffer ); return; } @@ -334,10 +321,7 @@ if ( icol0 < 0 || icol0 > plsc->ncol0 ) { char buffer[BUFFER_SIZE]; - snprintf( buffer, - BUFFER_SIZE, - "plgcol0: Invalid color index: %d", - (int) icol0 ); + snprintf( buffer, BUFFER_SIZE, "plgcol0: Invalid color index: %d", (int) icol0 ); plabort( buffer ); return; } @@ -370,10 +354,7 @@ if ( icol0 < 0 || icol0 > plsc->ncol0 ) { char buffer[BUFFER_SIZE]; - snprintf( buffer, - BUFFER_SIZE, - "plgcol0: Invalid color index: %d", - (int) icol0 ); + snprintf( buffer, BUFFER_SIZE, "plgcol0: Invalid color index: %d", (int) icol0 ); plabort( buffer ); return; } @@ -407,12 +388,8 @@ ( b[i] < 0 || b[i] > 255 )) { char buffer[BUFFER_SIZE]; - snprintf( buffer, - BUFFER_SIZE, - "plscmap0: Invalid RGB color: %d, %d, %d", - (int) r[i], - (int) g[i], - (int) b[i] ); + snprintf( buffer, BUFFER_SIZE, "plscmap0: Invalid RGB color: %d, %d, %d", + (int) r[i], (int) g[i], (int) b[i] ); plabort( buffer ); return; } @@ -449,13 +426,8 @@ ( a[i] < 0.0 || a[i] > 1.0 )) { char buffer[BUFFER_SIZE]; - snprintf( buffer, - BUFFER_SIZE, - "plscmap0a: Invalid RGB color: %d, %d, %d, %f", - (int) r[i], - (int) g[i], - (int) b[i], - (double) a[i] ); + snprintf( buffer, BUFFER_SIZE, "plscmap0a: Invalid RGB color: %d, %d, %d, %f", + (int) r[i], (int) g[i], (int) b[i], (double) a[i] ); plabort( buffer ); return; } @@ -491,12 +463,8 @@ ( b[i] < 0 || b[i] > 255 )) { char buffer[BUFFER_SIZE]; - snprintf( buffer, - BUFFER_SIZE, - "plscmap1: Invalid RGB color: %d, %d, %d", - (int) r[i], - (int) g[i], - (int) b[i] ); + snprintf( buffer, BUFFER_SIZE, "plscmap1: Invalid RGB color: %d, %d, %d", + (int) r[i], (int) g[i], (int) b[i] ); plabort( buffer ); return; } @@ -532,13 +500,8 @@ ( a[i] < 0.0 || a[i] > 1.0 )) { char buffer[BUFFER_SIZE]; - snprintf( buffer, - BUFFER_SIZE, - "plscmap1a: Invalid RGB color: %d, %d, %d, %f", - (int) r[i], - (int) g[i], - (int) b[i], - (double) a[i] ); + snprintf( buffer, BUFFER_SIZE, "plscmap1a: Invalid RGB color: %d, %d, %d, %f", + (int) r[i], (int) g[i], (int) b[i], (double) a[i] ); plabort( buffer ); return; } @@ -975,8 +938,7 @@ } else { - if (( plsc->cmap1 = - (PLColor *) calloc( ncol, sizeof ( PLColor ))) == NULL ) + if (( plsc->cmap1 = (PLColor *) calloc( ncol, sizeof ( PLColor ))) == NULL ) { plexit( "c_plscmap1n: Insufficient memory" ); } @@ -1292,10 +1254,7 @@ fp = plLibOpen( PL_DEFAULT_CMAP0_FILE ); if ( fp == NULL ) { - snprintf( msgbuf, - 1024, - ... [truncated message content] |