From: <and...@us...> - 2011-08-03 12:45:53
|
Revision: 11842 http://plplot.svn.sourceforge.net/plplot/?rev=11842&view=rev Author: andrewross Date: 2011-08-03 12:45:46 +0000 (Wed, 03 Aug 2011) Log Message: ----------- Update plarc to use the rotate option to plot ellipses which have the major axis rotated relative to the X-axis. Also work around bug with filled ellipses which caused crash. Modified Paths: -------------- trunk/doc/docbook/src/api.xml trunk/src/plarc.c Modified: trunk/doc/docbook/src/api.xml =================================================================== --- trunk/doc/docbook/src/api.xml 2011-08-03 02:19:05 UTC (rev 11841) +++ trunk/doc/docbook/src/api.xml 2011-08-03 12:45:46 UTC (rev 11842) @@ -362,6 +362,7 @@ <paramdef><parameter>b</parameter></paramdef> <paramdef><parameter>angle1</parameter></paramdef> <paramdef><parameter>angle2</parameter></paramdef> + <paramdef><parameter>rotate</parameter></paramdef> <paramdef><parameter>fill</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -429,7 +430,7 @@ </term> <listitem> <para> - Starting angle of the arc. + Starting angle of the arc relative to the semimajor axis. </para> </listitem> </varlistentry> @@ -440,12 +441,23 @@ </term> <listitem> <para> - Ending angle of the arc. + Ending angle of the arc relative to the semimajor axis. </para> </listitem> </varlistentry> <varlistentry> <term> + <parameter>rotate</parameter> + (<literal>PLFLT</literal>, input) + </term> + <listitem> + <para> + Angle of the semimajor axis relative to the X-axis. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> <parameter>fill</parameter> (<literal>PLBOOL</literal>, input) </term> @@ -462,7 +474,7 @@ <itemizedlist> <listitem> <para> - General: <function>plarc(x, y, a, b, angle1, angle2, fill)</function> + General: <function>plarc(x, y, a, b, angle1, angle2, rotate, fill)</function> </para> </listitem> </itemizedlist> Modified: trunk/src/plarc.c =================================================================== --- trunk/src/plarc.c 2011-08-03 02:19:05 UTC (rev 11841) +++ trunk/src/plarc.c 2011-08-03 12:45:46 UTC (rev 11842) @@ -21,12 +21,9 @@ #include "plplotP.h" -#define CIRCLE_SEGMENTS ( PL_MAXPOLY - 1 ) +#define CIRCLE_SEGMENTS ( PL_MAXPOLY - 2 ) #define DEG_TO_RAD( x ) ( ( x ) * M_PI / 180.0 ) -#define PLARC_POINT_X( x, a, b, theta ) ( ( x ) + ( ( a ) * cos( theta ) ) ) -#define PLARC_POINT_Y( y, a, b, theta ) ( ( y ) + ( ( b ) * sin( theta ) ) ) - //-------------------------------------------------------------------------- // plarc_approx : Plot an approximated arc with a series of lines // @@ -40,12 +37,17 @@ PLFLT theta0, theta_step, theta, d_angle; PLINT segments; PLFLT xs[CIRCLE_SEGMENTS + 1], ys[CIRCLE_SEGMENTS + 1]; + PLFLT cphi,sphi,ctheta,stheta; // The difference between the start and end angles d_angle = DEG_TO_RAD( angle2 - angle1 ); if ( fabs( d_angle ) > M_PI * 2.0 ) d_angle = M_PI * 2.0; + // Calculate cosine and sine of angle of major axis wrt the x axis + cphi = cos(DEG_TO_RAD(rotate)); + sphi = sin(DEG_TO_RAD(rotate)); + // The number of line segments used to approximate the arc segments = fabs( d_angle ) / ( 2.0 * M_PI ) * CIRCLE_SEGMENTS; // Always use at least 2 arc points, otherwise fills will break. @@ -61,8 +63,10 @@ for ( i = 0; i < segments; i++ ) { theta = theta0 + theta_step * (PLFLT) i; - xs[i] = PLARC_POINT_X( x, a, b, theta ); - ys[i] = PLARC_POINT_Y( y, a, b, theta ); + ctheta = cos(theta); + stheta = sin(theta); + xs[i] = x + a*ctheta*cphi - b*stheta*sphi; + ys[i] = y + a*ctheta*sphi + b*stheta*cphi; } if ( fill ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-08-03 23:11:36
|
Revision: 11849 http://plplot.svn.sourceforge.net/plplot/?rev=11849&view=rev Author: hezekiahcarty Date: 2011-08-03 23:11:30 +0000 (Wed, 03 Aug 2011) Log Message: ----------- Fix arc rotation for Cairo devices Modified Paths: -------------- trunk/drivers/cairo.c trunk/include/plplotP.h trunk/src/plarc.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2011-08-03 20:38:11 UTC (rev 11848) +++ trunk/drivers/cairo.c 2011-08-03 23:11:30 UTC (rev 11849) @@ -1546,7 +1546,7 @@ { PLCairo *aStream; double x, y, a, b; - double angle1, angle2; + double angle1, angle2, rotate; set_current_context( pls ); @@ -1561,6 +1561,7 @@ // Degrees to radians angle1 = arc_info->angle1 * M_PI / 180.0; angle2 = arc_info->angle2 * M_PI / 180.0; + rotate = arc_info->rotate * M_PI / 180.0; cairo_save( aStream->cairoContext ); @@ -1570,6 +1571,7 @@ // Make sure the arc is properly shaped and oriented cairo_save( aStream->cairoContext ); cairo_translate( aStream->cairoContext, x, y ); + cairo_rotate( aStream->cairoContext, rotate ); cairo_scale( aStream->cairoContext, a, b ); cairo_arc( aStream->cairoContext, 0.0, 0.0, 1.0, angle1, angle2 ); if ( arc_info->fill ) Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2011-08-03 20:38:11 UTC (rev 11848) +++ trunk/include/plplotP.h 2011-08-03 23:11:30 UTC (rev 11849) @@ -1036,6 +1036,7 @@ PLFLT b; PLFLT angle1; PLFLT angle2; + PLFLT rotate; PLBOOL fill; } arc_struct; Modified: trunk/src/plarc.c =================================================================== --- trunk/src/plarc.c 2011-08-03 20:38:11 UTC (rev 11848) +++ trunk/src/plarc.c 2011-08-03 23:11:30 UTC (rev 11849) @@ -134,6 +134,7 @@ arc_info->angle1 = angle1; arc_info->angle2 = angle2; + arc_info->rotate = rotate; arc_info->fill = fill; plP_esc( PLESC_ARC, arc_info ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-08-06 14:58:11
|
Revision: 11861 http://plplot.svn.sourceforge.net/plplot/?rev=11861&view=rev Author: hezekiahcarty Date: 2011-08-06 14:58:04 +0000 (Sat, 06 Aug 2011) Log Message: ----------- Rename PL_MODE_* to PL_DRAWMODE_* PL_MODE_* is too generic for a drawing mode definition. This makes the purpose clearer. Modified Paths: -------------- trunk/drivers/cairo.c trunk/examples/c/x34c.c trunk/include/plplot.h trunk/src/plctrl.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2011-08-05 10:23:37 UTC (rev 11860) +++ trunk/drivers/cairo.c 2011-08-06 14:58:04 UTC (rev 11861) @@ -601,15 +601,15 @@ switch ( *mode ) { - case PL_MODE_UNKNOWN: // Invalid - do nothing + case PL_DRAWMODE_UNKNOWN: // Invalid - do nothing break; - case PL_MODE_DEFAULT: + case PL_DRAWMODE_DEFAULT: cairo_set_operator( aStream->cairoContext, CAIRO_OPERATOR_OVER ); break; - case PL_MODE_REPLACE: + case PL_DRAWMODE_REPLACE: cairo_set_operator( aStream->cairoContext, CAIRO_OPERATOR_SOURCE ); break; - case PL_MODE_XOR: + case PL_DRAWMODE_XOR: cairo_set_operator( aStream->cairoContext, CAIRO_OPERATOR_XOR ); break; } @@ -633,16 +633,16 @@ switch ( op ) { case CAIRO_OPERATOR_OVER: - *mode = PL_MODE_DEFAULT; + *mode = PL_DRAWMODE_DEFAULT; break; case CAIRO_OPERATOR_SOURCE: - *mode = PL_MODE_REPLACE; + *mode = PL_DRAWMODE_REPLACE; break; case CAIRO_OPERATOR_XOR: - *mode = PL_MODE_XOR; + *mode = PL_DRAWMODE_XOR; break; default: - *mode = PL_MODE_UNKNOWN; + *mode = PL_DRAWMODE_UNKNOWN; } return; } Modified: trunk/examples/c/x34c.c =================================================================== --- trunk/examples/c/x34c.c 2011-08-05 10:23:37 UTC (rev 11860) +++ trunk/examples/c/x34c.c 2011-08-06 14:58:04 UTC (rev 11861) @@ -27,9 +27,9 @@ // Drawing modes to demonstrate #define NUM_MODES 3 PLINT drawing_modes[NUM_MODES] = { - PL_MODE_DEFAULT, - PL_MODE_REPLACE, - PL_MODE_XOR + PL_DRAWMODE_DEFAULT, + PL_DRAWMODE_REPLACE, + PL_DRAWMODE_XOR }; const char *drawing_mode_names[NUM_MODES] = { @@ -61,7 +61,7 @@ // Check for drawing mode support mode = plgdrawmode(); - if ( mode == PL_MODE_UNKNOWN ) + if ( mode == PL_DRAWMODE_UNKNOWN ) { printf( "WARNING: This driver does not support drawing mode getting/setting" ); } @@ -119,7 +119,7 @@ // Draw a background triangle using the default drawing mode plcol0( 2 ); - plsdrawmode( PL_MODE_DEFAULT ); + plsdrawmode( PL_DRAWMODE_DEFAULT ); plfill( 3, xs, ys ); // Draw a circle in the given drawing mode Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-08-05 10:23:37 UTC (rev 11860) +++ trunk/include/plplot.h 2011-08-06 14:58:04 UTC (rev 11861) @@ -1270,10 +1270,10 @@ #define PL_COLORBAR_BOUNDING_BOX 0x10000 // Flags for drawing mode -#define PL_MODE_UNKNOWN 0 -#define PL_MODE_DEFAULT 1 -#define PL_MODE_REPLACE 2 -#define PL_MODE_XOR 4 +#define PL_DRAWMODE_UNKNOWN 0x0 +#define PL_DRAWMODE_DEFAULT 0x1 +#define PL_DRAWMODE_REPLACE 0x2 +#define PL_DRAWMODE_XOR 0x4 // Routine for drawing discrete line, symbol, or cmap0 legends PLDLLIMPEXP void Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2011-08-05 10:23:37 UTC (rev 11860) +++ trunk/src/plctrl.c 2011-08-06 14:58:04 UTC (rev 11861) @@ -1911,7 +1911,7 @@ if ( !plsc->dev_modeset ) { plwarn( "plgdrawmode: Mode getting is not supported" ); - mode = PL_MODE_UNKNOWN; + mode = PL_DRAWMODE_UNKNOWN; } else if ( plsc->level > 0 ) { @@ -1920,7 +1920,7 @@ else { plwarn( "plsdrawmode: Initialize PLplot first" ); - mode = PL_MODE_UNKNOWN; + mode = PL_DRAWMODE_UNKNOWN; } return ( mode ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-08-10 08:51:31
|
Revision: 11867 http://plplot.svn.sourceforge.net/plplot/?rev=11867&view=rev Author: andrewross Date: 2011-08-10 08:51:24 +0000 (Wed, 10 Aug 2011) Log Message: ----------- Add driver-level support for drawing arcs to qt driver. Modified Paths: -------------- trunk/bindings/qt_gui/plqt.cpp trunk/drivers/qt.cpp trunk/include/qt.h Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2011-08-09 22:42:00 UTC (rev 11866) +++ trunk/bindings/qt_gui/plqt.cpp 2011-08-10 08:51:24 UTC (rev 11867) @@ -81,6 +81,34 @@ pls = p; } +void QtPLDriver::drawArc( short x, short y, short a, short b, PLFLT angle1, PLFLT angle2, PLFLT rotate, bool fill ) +{ + if ( !m_painterP->isActive() ) + return; + QRectF rect( (PLFLT) (x-a) * downscale, + m_dHeight - (PLFLT) (y+b) * downscale, + (PLFLT) a * downscale * 2, + (PLFLT) b * downscale * 2 + ); + if (rotate != 0.0) { + m_painterP->save(); + m_painterP->translate((PLFLT)x*downscale, m_dHeight - (PLFLT) y * downscale ); + m_painterP->rotate(-rotate); + m_painterP->translate(-(PLFLT)x*downscale, -m_dHeight + (PLFLT) y * downscale ); + } + + if (fill) + m_painterP->drawPie( rect, (int) (angle1*16), (int) ((angle2-angle1)*16) ); + else + m_painterP->drawArc( rect, (int) (angle1*16), (int) ((angle2-angle1)*16) ); + + if (rotate != 0.0) { + m_painterP->restore(); + } + + +} + void QtPLDriver::drawLine( short x1, short y1, short x2, short y2 ) { if ( !m_painterP->isActive() ) @@ -688,6 +716,11 @@ case SET_GRADIENT: delete i->Data.LinearGradient; break; + + case ARC: + delete i->Data.ArcStruct->rect; + delete i->Data.ArcStruct->dx; + delete i->Data.ArcStruct; default: break; @@ -699,6 +732,28 @@ redrawAll = true; } + +void QtPLWidget::drawArc( short x, short y, short a, short b, PLFLT angle1, PLFLT angle2, PLFLT rotate, bool fill ) +{ + BufferElement el; + el.Element = ARC; + el.Data.ArcStruct = new struct ArcStruct_; + el.Data.ArcStruct->rect = new QRectF( (PLFLT) (x-a) * downscale, + m_dHeight - (PLFLT) (y+b) * downscale, + (PLFLT) a * downscale * 2, + (PLFLT) b * downscale * 2 + ); + el.Data.ArcStruct->startAngle = (int) (angle1*16); + el.Data.ArcStruct->spanAngle = (int) ((angle2-angle1)*16); + el.Data.ArcStruct->rotate = rotate; + el.Data.ArcStruct->dx = new QPointF( (PLFLT)x*downscale, m_dHeight - (PLFLT) y * downscale ); + el.Data.ArcStruct->fill = fill; + + m_listBuffer.append( el ); + redrawFromLastFlush = true; +} + + void QtPLWidget::drawLine( short x1, short y1, short x2, short y2 ) { BufferElement el; @@ -1369,6 +1424,29 @@ p->fillRect( 0, 0, (int) m_dWidth, (int) m_dHeight, SolidBrush ); break; + case ARC: + if ( !hasPen ) + { + p->setPen( SolidPen ); + hasPen = true; + } + if (i->Data.ArcStruct->rotate != 0.0) { + p->save(); + p->translate( *(i->Data.ArcStruct->dx) ); + p->rotate( - i->Data.ArcStruct->rotate ); + p->translate( - *(i->Data.ArcStruct->dx) ); + } + + if (i->Data.ArcStruct->fill) + p->drawPie( *(i->Data.ArcStruct->rect), i->Data.ArcStruct->startAngle, i->Data.ArcStruct->spanAngle ); + else + p->drawArc( *(i->Data.ArcStruct->rect), i->Data.ArcStruct->startAngle, i->Data.ArcStruct->spanAngle ); + + if (i->Data.ArcStruct->rotate != 0.0) { + p->restore(); + } + + break; default: break; } Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2011-08-09 22:42:00 UTC (rev 11866) +++ trunk/drivers/qt.cpp 2011-08-10 08:51:24 UTC (rev 11867) @@ -422,7 +422,7 @@ break; case PLESC_HAS_TEXT: - //$$ call the generic ProcessString function + // call the generic ProcessString function // ProcessString( pls, (EscText *)ptr ); widget->QtPLDriver::setColor( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a ); widget->drawText( (EscText *) ptr ); @@ -860,7 +860,7 @@ break; case PLESC_HAS_TEXT: - //$$ call the generic ProcessString function + // call the generic ProcessString function // ProcessString( pls, (EscText *)ptr ); widget->setColor( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a ); widget->drawText( (EscText *) ptr ); @@ -968,6 +968,7 @@ pls->dev_fill0 = 1; pls->dev_fill1 = 0; pls->dev_gradient = 1; // driver renders gradient + pls->dev_arc = 1; // driver renders arcs // Let the PLplot core handle dashed lines since // the driver results for this capability have a number of issues. // pls->dev_dash=1; @@ -1091,6 +1092,8 @@ PLFLT *alpha; PLINT i; QtEPSDevice * widget = (QtEPSDevice *) pls->dev; + arc_struct *arc_info = (arc_struct *) ptr; + if ( widget != NULL && qt_family_check( pls ) ) { return; @@ -1149,12 +1152,16 @@ break; case PLESC_HAS_TEXT: - //$$ call the generic ProcessString function + // call the generic ProcessString function // ProcessString( pls, (EscText *)ptr ); widget->setColor( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a ); widget->drawText( (EscText *) ptr ); break; + case PLESC_ARC: + widget->drawArc( arc_info->x, arc_info->y, arc_info->a, arc_info->b, arc_info->angle1, arc_info->angle2, arc_info->rotate, arc_info->fill); + break; + default: break; } } @@ -1280,6 +1287,7 @@ pls->dev_fill0 = 1; // Handle solid fills pls->dev_fill1 = 0; pls->dev_gradient = 1; // driver renders gradient + pls->dev_arc = 1; // driver renders arcs // Let the PLplot core handle dashed lines since // the driver results for this capability have a number of issues. // pls->dev_dash=1; @@ -1348,6 +1356,7 @@ unsigned char *r, *g, *b; PLFLT *alpha; QtPLWidget * widget = (QtPLWidget *) pls->dev; + arc_struct *arc_info = (arc_struct *) ptr; if ( widget == NULL ) return; @@ -1407,6 +1416,10 @@ widget->drawText( (EscText *) ptr ); break; + case PLESC_ARC: + widget->drawArc( arc_info->x, arc_info->y, arc_info->a, arc_info->b, arc_info->angle1, arc_info->angle2, arc_info->rotate, arc_info->fill); + break; + case PLESC_FLUSH: widget->flush(); break; @@ -1506,6 +1519,7 @@ pls->dev_fill0 = 1; // Handle solid fills pls->dev_fill1 = 0; pls->dev_gradient = 1; // driver renders gradient + pls->dev_arc = 1; // driver renders arcs // Let the PLplot core handle dashed lines since // the driver results for this capability have a number of issues. // pls->dev_dash=1; @@ -1551,6 +1565,7 @@ unsigned char *r, *g, *b; PLFLT *alpha; QtExtWidget * widget = NULL; + arc_struct *arc_info = (arc_struct *) ptr; widget = (QtExtWidget *) pls->dev; switch ( op ) @@ -1604,12 +1619,16 @@ break; case PLESC_HAS_TEXT: - //$$ call the generic ProcessString function + // call the generic ProcessString function // ProcessString( pls, (EscText *)ptr ); widget->setColor( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a ); widget->drawText( (EscText *) ptr ); break; + case PLESC_ARC: + widget->drawArc( arc_info->x, arc_info->y, arc_info->a, arc_info->b, arc_info->angle1, arc_info->angle2, arc_info->rotate, arc_info->fill); + break; + default: break; } } @@ -1701,6 +1720,7 @@ pls->dev_fill0 = 1; pls->dev_fill1 = 0; pls->dev_gradient = 1; // driver renders gradient + pls->dev_arc = 1; // driver renders arcs // Let the PLplot core handle dashed lines since // the driver results for this capability have a number of issues. // pls->dev_dash=1; Modified: trunk/include/qt.h =================================================================== --- trunk/include/qt.h 2011-08-09 22:42:00 UTC (rev 11866) +++ trunk/include/qt.h 2011-08-10 08:51:24 UTC (rev 11867) @@ -124,6 +124,7 @@ void setPLStream( PLStream *pls ); // store the related stream + virtual void drawArc( short x, short y, short width, short height, PLFLT angle1, PLFLT angle2, PLFLT rotate, bool fill ); // Draws a line from (x1, y1) to (x2, y2) in internal plplot coordinates virtual void drawLine( short x1, short y1, short x2, short y2 ); virtual void drawPolyline( short * x, short * y, PLINT npts ); @@ -243,7 +244,8 @@ SET_GRADIENT, SET_SMOOTH, TEXT, - SET_BG_COLOUR + SET_BG_COLOUR, + ARC } ElementType; // Identifiers for elements of the buffer struct ColourStruct_ @@ -269,6 +271,15 @@ PLFLT chrht; }; +struct ArcStruct_ +{ + QRectF *rect; + QPointF *dx; + int startAngle; + int spanAngle; + PLFLT rotate; + bool fill; +}; class BufferElement { @@ -283,6 +294,7 @@ QLinearGradient * LinearGradient; struct ColourStruct_* ColourStruct; struct TextStruct_ * TextStruct; + struct ArcStruct_ * ArcStruct; PLINT intParam; PLFLT fltParam; } Data; @@ -307,6 +319,7 @@ int pageNumber; + void drawArc( short x, short y, short width, short height, PLFLT angle1, PLFLT angle2, PLFLT rotate, bool fill ); void drawLine( short x1, short y1, short x2, short y2 ); void drawPolyline( short * x, short * y, PLINT npts ); void drawPolygon( short * x, short * y, PLINT npts ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-08-14 01:02:44
|
Revision: 11882 http://plplot.svn.sourceforge.net/plplot/?rev=11882&view=rev Author: hezekiahcarty Date: 2011-08-14 01:02:38 +0000 (Sun, 14 Aug 2011) Log Message: ----------- Large update to OCaml bindings Includes: - High level plcolorbar wrapper (Plplot.Plot.colorbar) for testing of the plcolorbar API - Update the high level pllegend wrapper (Plplot.Plot.legend) to share some options with Plot.colorbar and to support more of the underlying C API's flexibility - Remove lots of replaced code now that plcolorbar and pllegend are wrapped - Use strings (and plstring) rather than the old numeric point definition system for point/symbol plots Modified Paths: -------------- trunk/bindings/ocaml/plplot.ml trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/ocaml/plplot_impl.c trunk/examples/ocaml/xplot01.ml Modified: trunk/bindings/ocaml/plplot.ml =================================================================== --- trunk/bindings/ocaml/plplot.ml 2011-08-14 01:02:06 UTC (rev 11881) +++ trunk/bindings/ocaml/plplot.ml 2011-08-14 01:02:38 UTC (rev 11882) @@ -1,5 +1,5 @@ (* -Copyright 2009, 2010 Hezekiah M. Carty +Copyright 2009, 2010, 2011 Hezekiah M. Carty This file is part of PLplot. @@ -168,22 +168,6 @@ | Line5 | Line6 | Line7 | Line8 | Custom_line of ((int * int) list) - (** Point/symbol styles *) - type symbol_t = - | Point_symbol - | Box_symbol - | Dot_symbol - | Plus_symbol - | Circle_symbol - | X_symbol - | Solar_symbol - | Diamond_symbol - | Open_star_symbol - | Big_dot_symbol - | Star_symbol - | Open_dot_symbol - | Index_symbol of int - type plot_t = (* Standard plot elements *) | Arc of @@ -191,10 +175,6 @@ | Axes of (color_t * axis_options_t list * axis_options_t list * int * line_style_t * (plplot_axis_type -> float -> string) option) - | Colorbar of - (float plot_side_t option * string plot_side_t option * bool option * - float option * [`image of (float * float) | `shade of (float array)] * - axis_options_t list option) | Contours of (color_t * pltr_t * float array * float array array) | Image of image_t | Image_fr of (image_t * (float * float)) @@ -204,7 +184,7 @@ (string option * color_t * float array * float array * int * line_style_t) | Map of (color_t * map_t * float * float * float * float) | Points of - (string option * color_t * float array * float array * symbol_t * float) + (string option * color_t * float array * float array * string * float) | Polygon of (color_t * float array * float array * bool) | Shades of ( int * color_t * int * bool * float * float * float * float * float array @@ -254,6 +234,33 @@ let default_axis_options = [Frame0; Frame1; Major_ticks; Minor_ticks; Invert_ticks; Label] + let string_ticks_of_axis_options ol = + let tick = ref 0.0 in + let sub = ref 0 in + let translated_list = + List.map ( + function + | Axis -> "a" + | Frame0 -> "b" + | Frame1 -> "c" + | Time -> "d" + | Fixed_point -> "f" + | Major_grid -> "g" + | Minor_grid -> "h" + | Invert_ticks -> "i" + | Log -> "l" + | Unconventional_label -> "m" + | Label -> "n" + | Custom_label -> "o" + | Minor_ticks -> "s" + | Minor_tick_count t_sub -> sub := t_sub; "s" + | Major_ticks -> "t" + | Major_tick_spacing t_space -> tick := t_space; "t" + | Vertical_label -> "v" + ) ol + in + String.concat "" translated_list, !tick, !sub + (** Convert a color to a (red, green, blue) triple *) let rgb_of_color = function | White -> 255, 255, 255 @@ -371,22 +378,6 @@ | s -> pllsty (int_of_line_style s) ) - (** Get the integer representation of the line style for use with plssym *) - let int_of_symbol = function - | Point_symbol -> ~-1 - | Box_symbol -> 0 - | Dot_symbol -> 1 - | Plus_symbol -> 2 - | Circle_symbol -> 4 - | X_symbol -> 5 - | Solar_symbol -> 9 - | Diamond_symbol -> 11 - | Open_star_symbol -> 12 - | Big_dot_symbol -> 17 - | Star_symbol -> 18 - | Open_dot_symbol -> 20 - | Index_symbol i -> i - (** NOTE that these are for the ALTERNATE color palette, not the DEFAULT color palette. *) let int_of_color = function @@ -514,14 +505,6 @@ (** [circle ?fill color x y r] - A special case of [arc]. *) let circle ?fill color x y r = arc ?fill color x y r r 0.0 360.0 0.0 - (** Draw a colorbar, optionally log scaled and labeled. *) - let image_colorbar ?custom_axis ?label ?log ?pos ?width data = - Colorbar (pos, label, log, width, `image data, custom_axis) - - (** Draw a shaded colorbar, optionally log scaled and labeled. *) - let shade_colorbar ?custom_axis ?label ?log ?pos ?width data = - Colorbar (pos, label, log, width, `shade data, custom_axis) - (** [contours color pltr contours data] *) let contours color pltr contours data = Contours (color, pltr, contours, data) @@ -553,7 +536,7 @@ (** [points ?label ?scale color xs ys] *) let points ?label ?symbol ?scale color xs ys = - Points (label, color, xs, ys, symbol |? Open_dot_symbol, scale |? 1.0) + Points (label, color, xs, ys, symbol |? "#(135)", scale |? 1.0) (** [polygon ?fill color xs ys fill] *) let polygon ?(fill = false) color xs ys = Polygon (color, xs, ys, fill) @@ -678,41 +661,87 @@ let column_major x y = Column_major (x, y) - let legend ?pos ?(plot_width = 0.1) ?bg ?bb ?layout + type position_t = + | Viewport of unit plot_side_t option * unit plot_side_t option * float * float * bool option + | Subpage of unit plot_side_t option * unit plot_side_t option * float * float * bool option + + let viewport_pos ?side1 ?side2 ?inside x y = + Viewport (side1, side2, x, y, inside) + + let subpage_pos ?side1 ?side2 ?inside x y = + Subpage (side1, side2, x, y, inside) + + let pos_opt_of_side = function + | Right _ -> PL_POSITION_RIGHT + | Left _ -> PL_POSITION_LEFT + | Top _ -> PL_POSITION_TOP + | Bottom _ -> PL_POSITION_BOTTOM + + (** Convert a position_t to a low-level position definition. *) + let convert_position pos_maybe = + match pos_maybe with + | None -> 0.0, 0.0, [] + | Some pos -> begin + let opt_list side1 side2 inside = + let side1_opt = + Option.map_default (fun s -> [pos_opt_of_side s]) [] side1 + in + let side2_opt = + Option.map_default (fun s -> [pos_opt_of_side s]) [] side2 + in + let inside_opt = + Option.map_default ( + fun b -> + if b then [PL_POSITION_INSIDE] else [PL_POSITION_OUTSIDE] + ) [] inside + in + List.concat [side1_opt; side2_opt; inside_opt] + in + match pos with + | Viewport (side1, side2, x, y, inside) -> + (* x-offset, y-offset and position options *) + x, y, PL_POSITION_VIEWPORT :: opt_list side1 side2 inside + | Subpage (side1, side2, x, y, inside) -> + (* x-offset, y-offset and position options *) + x, y, PL_POSITION_SUBPAGE :: opt_list side1 side2 inside + end + + (** Convert a backgroun color into a legend/colorbar-ready definition *) + let convert_bg bg opt = + match bg with + | Some color -> int_of_color color, [opt] + | None -> 0, [] + + (** Convert a bounding box definition into a legend/colorbar-ready + definition *) + let convert_bb bb opt = + match bb with + | Some (color, style) -> int_of_color color, int_of_line_style style, [opt] + | None -> 0, 0, [] + + (** Set the drawing color in [f], and restore the previous drawing color + when [f] is complete. *) + let set_color_in ?stream c f = + with_stream ?stream ( + fun () -> + let old_color = plg_current_col0 () in + set_color c; + f (); + plcol0 old_color; + () + ) + + let legend ?pos ?(plot_width = 0.1) ?bg ?bb ?layout ?color ?(text_offset = 1.0) ?(text_scale = 1.0) ?(text_spacing = 2.0) ?(text_justification = 1.0) ?(text_left = false) entries = (* Legend position *) - let legend_x, legend_y, pos_opt = - match pos with - | Some (p1, p2) -> - begin - let convert = function - | Right x -> x, PL_POSITION_RIGHT - | Left x -> x, PL_POSITION_LEFT - | Top x -> x, PL_POSITION_TOP - | Bottom x -> x, PL_POSITION_BOTTOM - in - let p1_x, p1_opt = convert p1 in - let p2_x, p2_opt = convert p2 in - p1_x, p2_x, [p1_opt; p2_opt] - end - | None -> - 0.0, 0.0, [] - in + let legend_x, legend_y, pos_opt = convert_position pos in (* Legend background color *) - let bg, bg_opt = - match bg with - | Some color -> color, [PL_LEGEND_BACKGROUND] - | None -> 0, [] - in + let bg, bg_opt = convert_bg bg PL_LEGEND_BACKGROUND in (* Legend bounding box *) - let bb, bb_style, bb_opt = - match bb with - | Some (color, style) -> color, style, [PL_LEGEND_BOUNDING_BOX] - | None -> 0, 0, [] - in + let bb, bb_style, bb_opt = convert_bb bb PL_LEGEND_BOUNDING_BOX in (* Legend layout *) let rows, columns, layout_opt = match layout with @@ -727,6 +756,8 @@ (* PLplot's default layout *) 0, 0, [] in + (* Default drawing color *) + let color = color |? Black in (* Text on the left? *) let text_left_opt = if text_left then [PL_LEGEND_TEXT_LEFT] @@ -794,296 +825,145 @@ done; custom ( fun () -> - ignore ( - pllegend opt pos_opt legend_x legend_y plot_width bg bb bb_style - rows columns - entry_opts - text_offset text_scale text_spacing text_justification text_colors text - box_colors box_patterns box_scales box_line_widths - line_colors line_styles line_widths - symbol_colors symbol_scales symbol_numbers symbols + set_color_in color ( + fun () -> + ignore ( + pllegend opt pos_opt legend_x legend_y plot_width bg bb bb_style + rows columns + entry_opts + text_offset text_scale text_spacing text_justification text_colors text + box_colors box_patterns box_scales box_line_widths + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols + ) ) ) - (** Set the drawing color in [f], and restore the previous drawing color - when [f] is complete. *) - let set_color_in ?stream c f = - with_stream ?stream ( + type colorbar_kind_t = + | Gradient_colorbar of float array + | Image_colorbar of float array + | Shade_colorbar of (bool * float array) + + let gradient_colorbar vs = Gradient_colorbar vs + let image_colorbar vs = Image_colorbar vs + let shade_colorbar ?(custom = true) vs = Shade_colorbar (custom, vs) + + let default_colorbar_axis = + [Frame0; Frame1; Invert_ticks; Unconventional_label; Major_ticks; Vertical_label] + + let colorbar ?pos ?bg ?bb ?cap ?contour ?orient ?axis ?label ?color ?scale kind = + (* Colorbar position *) + let colorbar_x, colorbar_y, pos_opt = convert_position pos in + (* Colorbar background color *) + let bg, bg_opt = convert_bg bg PL_COLORBAR_BACKGROUND in + (* Colorbar bounding box *) + let bb, bb_style, bb_opt = convert_bb bb PL_COLORBAR_BOUNDING_BOX in + (* End-caps *) + let cap_low_color, cap_high_color, cap_opt = + match cap with + | Some (Some l, Some h) -> l, h, [PL_COLORBAR_CAP_LOW; PL_COLORBAR_CAP_HIGH] + | Some (Some l, None) -> l, 0.0, [PL_COLORBAR_CAP_LOW] + | Some (None, Some h) -> 0.0, h, [PL_COLORBAR_CAP_HIGH] + | Some (None, None) + | None -> 0.0, 0.0, [] + in + (* Contours *) + let cont_color, cont_width = + match contour with + | None -> 0, 0 + | Some (col, wid) -> int_of_color col, wid + in + (* Orientation *) + let x_length, y_length, orient_opt = + match orient with + | Some o -> begin + (* TODO: Pick something better to use as a type here... *) + match o with + | Right (l, w) -> w, l, [PL_COLORBAR_ORIENT_RIGHT] + | Left (l, w) -> w, l, [PL_COLORBAR_ORIENT_LEFT] + | Top (l, w) -> l, w, [PL_COLORBAR_ORIENT_TOP] + | Bottom (l, w) -> l, w, [PL_COLORBAR_ORIENT_BOTTOM] + end + | None -> + let default_length = 0.75 in + let default_width = 0.05 in + if + List.mem PL_POSITION_LEFT pos_opt || + List.mem PL_POSITION_RIGHT pos_opt + then + (* Tall and narrow (vertical colorbar) *) + default_width, default_length, [] + else if + List.mem PL_POSITION_TOP pos_opt || + List.mem PL_POSITION_BOTTOM pos_opt + then + (* Wide and short (horizontal colorbar) *) + default_length, default_width, [] + else + (* Default to vertical *) + default_width, default_length, [] + in + (* Axis *) + let axis = axis |? default_colorbar_axis in + let axis_string, tick_spacing, sub_ticks = + string_ticks_of_axis_options axis + in + (* Label *) + let label, label_opt = + match label with + | Some p -> begin + match p with + | Right l -> l, [PL_COLORBAR_LABEL_RIGHT] + | Left l -> l, [PL_COLORBAR_LABEL_LEFT] + | Top l -> l, [PL_COLORBAR_LABEL_TOP] + | Bottom l -> l, [PL_COLORBAR_LABEL_BOTTOM] + end + | None -> "", [] + in + (* Color for labels, axes, etc. *) + let color = color |? Black in + (* Values and colorbar type *) + let values, kind_opt = + match kind with + | Gradient_colorbar vs -> vs, [PL_COLORBAR_GRADIENT] + | Image_colorbar vs -> vs, [PL_COLORBAR_IMAGE] + | Shade_colorbar (custom, vs) -> + vs, ( + PL_COLORBAR_SHADE :: + if custom then [PL_COLORBAR_SHADE_LABEL] else [] + ) + in + (* Combine all of the options *) + let opt = + List.concat [bg_opt; bb_opt; cap_opt; orient_opt; label_opt; kind_opt] + in + (* Call the (wrapped) core plcolorbar function *) + custom ( fun () -> - let old_color = plg_current_col0 () in - set_color c; - f (); - plcol0 old_color; - () + Option.may (fun s -> plsmaj 0.0 s; plsmin 0.0 s; plschr 0.0 s) scale; + set_color_in color ( + fun () -> + ignore ( + plcolorbar opt pos_opt colorbar_x colorbar_y x_length y_length + bg bb bb_style + cap_low_color cap_high_color + cont_color cont_width + tick_spacing sub_ticks axis_string + label values + ) + ); + Option.may (fun _ -> plsmaj 0.0 0.0; plsmin 0.0 0.0; plschr 0.0 0.0) scale; ) (** An easier to deduce alternative to {Plplot.plbox} *) let plot_axes ?stream xoptions yoptions = - let xtick = ref 0.0 in - let xsub = ref 0 in - let ytick = ref 0.0 in - let ysub = ref 0 in - let map_axis_options tick sub ol = - List.map ( - function - | Axis -> "a" - | Frame0 -> "b" - | Frame1 -> "c" - | Time -> "d" - | Fixed_point -> "f" - | Major_grid -> "g" - | Minor_grid -> "h" - | Invert_ticks -> "i" - | Log -> "l" - | Unconventional_label -> "m" - | Label -> "n" - | Custom_label -> "o" - | Minor_ticks -> "s" - | Minor_tick_count t_sub -> sub := t_sub; "s" - | Major_ticks -> "t" - | Major_tick_spacing t_space -> tick := t_space; "t" - | Vertical_label -> "v" - ) ol - in - let xopt = String.concat "" (map_axis_options xtick xsub xoptions) in - let yopt = String.concat "" (map_axis_options ytick ysub yoptions) ^ "v" in - with_stream ?stream (fun () -> plbox xopt !xtick !xsub yopt !ytick !ysub) + let xopt, xtick, xsub = string_ticks_of_axis_options xoptions in + let yopt, ytick, ysub = string_ticks_of_axis_options yoptions in + let yopt = yopt ^ "v" in + with_stream ?stream (fun () -> plbox xopt xtick xsub yopt ytick ysub) (** [plot stream l] plots the data in [l] to the plot [stream]. *) let rec plot ?stream plottable_list = - (* TODO: Add legend support. *) - (* - let dims ?(expand = true) l = - let coef = 5.0e-5 in - let one_dims = function - | Pts (xs, ys, _) - | Lines (xs, ys) -> - (Array.reduce min xs, Array.reduce min ys), - (Array.reduce max xs, Array.reduce max ys) - in - let all_dims = List.map one_dims l in - let min_dims, max_dims = List.split all_dims in - let xmins, ymins = List.split min_dims in - let xmaxs, ymaxs = List.split max_dims in - let (xmin, ymin), (xmax, ymax) = - (List.reduce min xmins, List.reduce min ymins), - (List.reduce max xmaxs, List.reduce max ymaxs) - in - let diminish n = n -. n *. coef in - let extend n = n +. n *. coef in - if expand then - (diminish xmin, diminish ymin), - (extend xmax, extend ymax) - else - (xmin, ymin), (xmax, ymax) - in - *) - (** [colorbar_base ?label ?log ?pos values] draws a colorbar, using the given - values for the color range. [label] gives the position and text of the - colorbar label; if [log] is true then the scale is taken to be log rather - than linear ; [pos] sets the position of the colorbar itself, both the - side of the plot to put it on and the distance from the edge - (normalized device units); [width] is the width of the colorbar (again in - normalized device units). - NOTE: This potentially wrecks the current viewport and - window settings, among others, so it should be called AFTER the current - plot page is otherwise complete. *) - let colorbar_base ?custom_axis ?label ?log ?(pos = Right 0.07) ?(width = 0.03) - data = - (* Save the state of the current plot window. *) - let dxmin, dxmax, dymin, dymax = plgvpd () in - let wxmin, wxmax, wymin, wymax = plgvpw () in - (*let old_default, old_scale = plgchr () in*) - - let old_color = plg_current_col0 () in - - (* Small font *) - plschr 0.0 0.75; - (* Small ticks on the vertical axis *) - plsmaj 0.0 0.5; - plsmin 0.0 0.5; - - (* Offset from the edge of the plot surface in normalized device units *) - let offset = - match pos with - | Right off - | Top off -> 1.0 -. off - | Left off - | Bottom off -> off -. width - in - (* Put the bar on the proper side, with the proper offsets. *) - (* Unit major-axis, minor-axis scaled to contour values. *) - let width_start = offset in - let width_end = offset +. width in - - (* Set the viewport and window *) - let init_window min_value max_value = - match pos with - | Right _ - | Left _ -> - plvpor width_start width_end 0.15 0.85; - plwind 0.0 1.0 min_value max_value; - | Top _ - | Bottom _ -> - plvpor 0.15 0.85 width_start width_end; - plwind min_value max_value 0.0 1.0; - in - - (* "Rotate" the image if we have a horizontal (Top or Bottom) colorbar. *) - (* Also, double the amount of data because plshades won't work properly - otherwise. *) - let colorbar_data values = - match pos with - | Right off - | Left off -> [|values; values|] - | Top off - | Bottom off -> Array.map (fun x -> [|x; x|]) values - in - - (* Draw the image or shaded data, depending on what was requested *) - let () = - match data with - | `image (min_value, max_value) -> - (* Draw the color bar as an image. *) - (* TODO FIXME XXX: Change "100" to be the number of color palette 1 - colors once the attribute getting + setting functions are in - place. *) - let colorbar_steps = Array_ext.range ~n:100 min_value max_value in - let data = colorbar_data colorbar_steps in - init_window min_value max_value; - (match pos with - | Right _ - | Left _ -> plot [image (0.0, min_value) (1.0, max_value) data] - | Top _ - | Bottom _ -> plot [image (min_value, 0.0) (max_value, 1.0) data]) - | `shade contours -> - let shade_data = colorbar_data contours in - let max_value, min_value = plMinMax2dGrid [|contours|] in - init_window min_value max_value; - (match pos with - | Right _ - | Left _ -> - plot [ - pltr (pltr1 [|0.0; 1.0|] contours); - shades (0.0, min_value) (1.0, max_value) contours shade_data; - clear_pltr; - ] - | Top _ - | Bottom _ -> - plot [ - pltr (pltr1 contours [|0.0; 1.0|]); - shades (min_value, 0.0) (max_value, 1.0) contours shade_data; - clear_pltr; - ]) - in - - (* Draw a box and tick marks around the color bar. *) - set_color Black; - (* Draw ticks and labels on the major axis. Add other options as - appropriate. *) - let major_axis_opt = - List.concat [ - [Frame0; Frame1]; - (* We draw tick marks ourselves for shade bars *) - (match data with - | `image _ -> [Major_ticks] - | `shade _ -> []); - (* Log? *) - (match log with - | None - | Some false -> [] - | Some true -> [Minor_ticks; Log]); - (* Which side gets the label? We label ourselves for shade bars *) - (match pos with - | Right _ - | Top _ -> - (match data with - | `image _ -> [Unconventional_label] - | `shade _ -> []) - | Left _ - | Bottom _ -> - (match data with - | `image _ -> [Label] - | `shade _ -> [])); - (* Perpendicular labeling? *) - (match pos with - | Right _ - | Left _ -> [Vertical_label] - | Top _ - | Bottom _ -> []); - (* User-specified axis options? *) - (match custom_axis with - | None -> [] - | Some l -> l); - ] - in - (* Just draw the minor axis sides, no labels or ticks. *) - let minor_axis_opt = [Frame0; Frame1] in - let x_opt, y_opt = - match pos with - | Top _ - | Bottom _ -> major_axis_opt, minor_axis_opt - | Left _ - | Right _ -> minor_axis_opt, major_axis_opt - in - plot_axes x_opt y_opt; - - (* Draw axis tick marks and labels if this is a shade bar *) - let () = - match data with - | `image _ -> () (* Nothing to do here *) - | `shade contours -> - let label_pos_string, label_justify = - match pos with - | Right _ -> "rv", 0.0 - | Left _ -> "lv", 1.0 - | Top _ -> "t", 0.5 - | Bottom _ -> "b", 0.5 - in - let max_value, min_value = plMinMax2dGrid [|contours|] in - Array.iter ( - fun label_value -> - let label_position = - (label_value -. min_value) /. (max_value -. min_value) - in - let label_string = sprintf "%g" label_value in - plmtex - label_pos_string 1.0 label_position label_justify label_string - ) contours - in - - (* Draw the label *) - Option.may ( - fun l -> - (* Which side to draw the label on and the offset from that side in - units of character height. *) - let label_string, label_pos_string, label_offset = - let v = - match pos with - | Right _ - | Left _ -> "" - | Top _ - | Bottom _ -> "v" - in - match l with - | Right s -> s, "r" ^ v, 4.0 - | Left s -> s, "l" ^ v, 4.0 - | Top s -> s, "t", 1.5 - | Bottom s -> s, "b", 1.5 - in - plmtex label_pos_string label_offset 0.5 0.5 label_string - ) label; - - (* TODO XXX FIXME - Make sure setting are all properly restored... *) - (* Restore the old plot window settings. *) - plvpor dxmin dxmax dymin dymax; - plwind wxmin wxmax wymin wymax; - plschr 0.0 1.0; - plsmaj 0.0 1.0; - plsmin 0.0 1.0; - set_color (Index_color old_color); - () - in let plot_arc (color, x, y, a, b, angle1, angle2, rotate, fill) = set_color_in color ( fun () -> plarc x y a b angle1 angle2 rotate fill; @@ -1102,9 +982,6 @@ plwid old_width; ) in - let plot_colorbar (pos, label, log, width, data, custom_axis) = - colorbar_base ?custom_axis ?label ?log ?pos ?width data - in let plot_contours (color, pltr, contours, data) = set_color_in color ( fun () -> @@ -1164,7 +1041,7 @@ set_color_in color ( fun () -> plssym 0.0 scale; - plpoin xs ys (int_of_symbol symbol); + plstring xs ys symbol; plssym 0.0 1.0; ) in @@ -1231,7 +1108,6 @@ match p with | Arc a -> plot_arc a | Axes ax -> plot_axes ax - | Colorbar cb -> plot_colorbar cb | Contours c -> plot_contours c | Image i -> plot_image i | Image_fr (i, scale) -> plot_imagefr i scale @@ -1257,41 +1133,6 @@ fun plottable -> with_stream ?stream (fun () -> one_plot plottable) ) plottable_list - (** [colorbar_labeler ?log ?min ?max axis n] can be used as a custom - axis labeling function when a colorbar is meant to represent values - beyond those which are represented. So if the colorbar labeling shows - values from 0.0 to 1.0, but the color for 1.0 is meant to represent - values > 1.0 then set [max_value] 1.0. *) - let colorbar_labeler ?log ?(min = neg_infinity) ?(max = infinity) _ n = - (* Custom text labeling if ">" or "<" prefixes are needed *) - let gt_or_lt = function - | x when x <= min -> "< " - | x when x >= max -> "> " - | _ -> "" - in - let log10_text n = - let power = log10 n in - sprintf "%s10#u%d#d" (gt_or_lt n) (int_of_float power) - in - let decimal_places n = - match log10 n with - | d when d >= 2.0 -> 0 - | d when d >= 0.0 -> 1 - | d -> - let d' = - match d with - | x when x > 0.0 -> ceil x - | x when x < 0.0 -> floor x - | x -> x - in - abs (int_of_float d') - in - let normal_text n = sprintf "%s%.*f" (gt_or_lt n) (decimal_places n) n in - match log with - | None - | Some false -> normal_text n - | Some true -> log10_text n - (** Finish the current page, start a new one (alias for {!start_page}). *) let next_page = start_page @@ -1348,7 +1189,7 @@ (if y_log then Log :: y_axis else y_axis) ) (x_axis, y_axis) log - let maybe_legend names colors = + let maybe_line_legend names colors = maybe ( Option.map ( fun names' -> @@ -1361,20 +1202,38 @@ ) names ) + let maybe_symbol_legend names colors symbols = + maybe ( + Option.map ( + fun names' -> + let entries = + Array.mapi ( + fun i label -> + [symbol_legend ~label colors.(i) symbols.(i)] + ) (Array.of_list names') + in + legend (Array.to_list entries) + ) names + ) + (** [points [xs, ys; ...] plots the points described by the coordinates [xs] and [ys]. *) - let points ?filename ?size ?(device = Window Cairo) ?labels ?log xs_ys_list = + let points ?filename ?size ?(device = Window Cairo) ?labels ?names ?log xs_ys_list = let xs_list, ys_list = List.split xs_ys_list in let xmin, xmax, ymin, ymax = extents xs_list ys_list in let ys_array = Array.of_list ys_list in let stream = init ?filename ?size (xmin, ymin) (xmax, ymax) Greedy device in + let colors = Array.mapi (fun i _ -> Index_color (i + 1)) ys_array in + let symbols = + Array.init (Array.length ys_array) (fun i -> sprintf "#(%03d)" (i + 135)) + in let plottable_points = Array.to_list ( Array.mapi ( fun i xs -> - points ~symbol:(Index_symbol i) (Index_color (i + 1)) + points ~symbol:symbols.(i) colors.(i) xs ys_array.(i) ) (Array.of_list xs_list) ) @@ -1382,6 +1241,8 @@ let x_axis, y_axis = maybe_log log in plot ~stream [ list plottable_points; + (* TODO: Make the legend work *) + maybe_symbol_legend names colors symbols; axes x_axis y_axis; maybe (Option.map (fun (x, y, t) -> label x y t) labels); ]; @@ -1408,7 +1269,7 @@ let x_axis, y_axis = maybe_log log in plot ~stream [ list plottable_lines; - maybe_legend names colors; + maybe_line_legend names colors; axes x_axis y_axis; maybe (Option.map (fun (x, y, t) -> label x y t) labels); ]; @@ -1422,6 +1283,15 @@ let xmin, ymin = 0.0, 0.0 in let xmax, ymax = Array_ext.matrix_dims m in let xmax, ymax = float_of_int xmax, float_of_int ymax in + let axis = + Option.map_default ( + fun l -> + if l then + Log :: default_colorbar_axis + else + default_colorbar_axis + ) default_colorbar_axis log + in let stream = init ?filename ?size (xmin, ymin) (xmax, ymax) Equal_square device in @@ -1430,7 +1300,8 @@ image (xmin, ymin) (xmax, ymax) m; default_axes; maybe (Option.map (fun (x, y, t) -> label x y t) labels); - image_colorbar ?log ~pos:(Right 0.12) (m_min, m_max); + colorbar ~axis ~scale:0.75 ~pos:(viewport_pos 0.05 0.0) + (image_colorbar [|m_min; m_max|]); ]; end_stream ~stream (); () @@ -1467,7 +1338,7 @@ in plot ~stream [ list plot_content; - maybe_legend names colors; + maybe_line_legend names colors; default_axes; maybe (Option.map (fun (x, y, t) -> label x y t) labels); ]; @@ -1479,6 +1350,15 @@ let xmin, ymin = 0.0, 0.0 in let xmax, ymax = Array_ext.matrix_dims m in let xmax, ymax = float_of_int xmax, float_of_int ymax in + let axis = + Option.map_default ( + fun l -> + if l then + Log :: default_colorbar_axis + else + default_colorbar_axis + ) default_colorbar_axis log + in let stream = init ?filename ?size (xmin, ymin) (xmax, ymax) Equal_square device in @@ -1493,7 +1373,8 @@ shades (xmin, ymin) (xmax, ymax) contours m; default_axes; maybe (Option.map (fun (x, y, t) -> label x y t) labels); - shade_colorbar ?log ~pos:(Right 0.12) contours; + colorbar ~axis ~scale:0.75 ~pos:(viewport_pos 0.05 0.0) + (shade_colorbar contours); ]; end_stream ~stream (); () Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2011-08-14 01:02:06 UTC (rev 11881) +++ trunk/bindings/ocaml/plplot.mli 2011-08-14 01:02:38 UTC (rev 11882) @@ -1,5 +1,5 @@ (* -Copyright 2009 Hezekiah M. Carty +Copyright 2009, 2010, 2011 Hezekiah M. Carty This file is part of PLplot. @@ -137,23 +137,6 @@ length of one segment and gap in the line drawing pattern. *) - (** Point/symbol styles *) - type symbol_t = - | Point_symbol - | Box_symbol - | Dot_symbol - | Plus_symbol - | Circle_symbol - | X_symbol - | Solar_symbol - | Diamond_symbol - | Open_star_symbol - | Big_dot_symbol - | Star_symbol - | Open_dot_symbol - | Index_symbol of int (** The index value here is the same value used in - {!plssym}. *) - (** The default list of axis rendering options, used for all plots generated with {!init} if no custom options are provided. *) val default_axis_options : axis_options_t list @@ -344,7 +327,7 @@ (** [points ?label ?symbol ?scale color xs ys] *) val points : ?label:string -> - ?symbol:symbol_t -> + ?symbol:string -> ?scale:float -> color_t -> float array -> float array -> plot_t @@ -385,7 +368,7 @@ [x = min] to [x = max]. [step] can be used to tighten or coarsen the sampling of plot points. *) val func : - ?symbol:symbol_t -> + ?symbol:string -> ?step:float -> color_t -> (float -> float) -> float * float -> plot_t @@ -426,6 +409,19 @@ (** Character height in world coordinate units *) val character_height : ?stream:stream_t -> unit -> float + (** Positioning within viewport or subpage *) + type position_t + + (** Position relative to the plot viewport *) + val viewport_pos : + ?side1:unit plot_side_t -> + ?side2:unit plot_side_t -> ?inside:bool -> float -> float -> position_t + + (** Position relative to the plot subpage *) + val subpage_pos : + ?side1:unit plot_side_t -> + ?side2:unit plot_side_t -> ?inside:bool -> float -> float -> position_t + (** Legend entry *) type legend_entry_t @@ -463,28 +459,49 @@ (** [legend entries] *) val legend : - ?pos:float plot_side_t * float plot_side_t -> + ?pos:position_t -> ?plot_width:float -> - ?bg:int -> - ?bb:int * int -> + ?bg:color_t -> + ?bb:color_t * line_style_t -> ?layout:(int * int) layout_t -> + ?color:color_t -> ?text_offset:float -> ?text_scale:float -> ?text_spacing:float -> ?text_justification:float -> ?text_left:bool -> legend_entry_t list list -> plot_t - (** [colorbar_labeler ?log ?min ?max axis n] can be used as a custom - axis labeling function when a colorbar is meant to represent values - beyond those which are represented. So if the colorbar labeling shows - values from 0.0 to 1.0, but the color for 1.0 is meant to represent - values > 1.0 then set [max_value] 1.0. *) - val colorbar_labeler : - ?log:bool -> - ?min:float -> - ?max:float -> - plplot_axis_type -> float -> string + (** Available colorbar kinds *) + type colorbar_kind_t + (** [gradient_colorbar [|min; max|]] from [min] to [max] *) + val gradient_colorbar : float array -> colorbar_kind_t + + (** [image_colorbar [|min; max|]] from [min] to [max] *) + val image_colorbar : float array -> colorbar_kind_t + + (** [shade_colorbar ?custom contours] defines a shaded contour colorbar + with axis labels at even spacings ([custom = false]) or at the + locations of the values in [contours] + ([custom = true] - the default). *) + val shade_colorbar : ?custom:bool -> float array -> colorbar_kind_t + + (** Default options used for a colorbar axis *) + val default_colorbar_axis : axis_options_t list + + (** [colorbar colorbar_kind] *) + val colorbar : + ?pos:position_t -> + ?bg:color_t -> + ?bb:color_t * line_style_t -> + ?cap:float option * float option -> + ?contour:color_t * int -> + ?orient:(float * float) plot_side_t -> + ?axis:axis_options_t list -> + ?label:string plot_side_t -> + ?color:color_t -> ?scale:float -> + colorbar_kind_t -> plot_t + (** Draw the plot axes on the current plot page *) val plot_axes : ?stream:stream_t -> @@ -513,6 +530,7 @@ ?size:int * int -> ?device:Plot.plot_device_t -> ?labels:string * string * string -> + ?names:string list -> ?log:bool * bool -> (float array * float array) list -> unit (** [lines xs ys] plots the line segments described by the coordinates @@ -543,7 +561,7 @@ ?device:Plot.plot_device_t -> ?labels:string * string * string -> ?names:string list -> - ?symbol:Plot.symbol_t -> + ?symbol:string -> ?step:float -> (float -> float) list -> float * float -> unit (** [shades ?log ?contours m] plots a filled contour/shaded [m] with a @@ -624,9 +642,16 @@ | PL_COLORBAR_IMAGE | PL_COLORBAR_SHADE | PL_COLORBAR_GRADIENT + | PL_COLORBAR_CAP_NONE | PL_COLORBAR_CAP_LOW | PL_COLORBAR_CAP_HIGH | PL_COLORBAR_SHADE_LABEL + | PL_COLORBAR_ORIENT_RIGHT + | PL_COLORBAR_ORIENT_TOP + | PL_COLORBAR_ORIENT_LEFT + | PL_COLORBAR_ORIENT_BOTTOM + | PL_COLORBAR_BACKGROUND + | PL_COLORBAR_BOUNDING_BOX and plplot_colorbar_opt = plplot_colorbar_enum list and plplot_fci_family_enum = | PL_FCI_FAMILY_UNCHANGED Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2011-08-14 01:02:06 UTC (rev 11881) +++ trunk/bindings/ocaml/plplot_core.idl 2011-08-14 01:02:38 UTC (rev 11882) @@ -1,5 +1,5 @@ /* -Copyright 2007, 2008 Hezekiah M. Carty +Copyright 2007, 2008, 2009, 2010, 2011 Hezekiah M. Carty This file is part of ocaml-plplot. @@ -59,40 +59,47 @@ typedef enum plplot_run_level_enum plplot_run_level; enum plplot_position_enum { - PL_POSITION_LEFT = 1, - PL_POSITION_RIGHT = 2, - PL_POSITION_TOP = 4, - PL_POSITION_BOTTOM = 8, - PL_POSITION_INSIDE = 16, - PL_POSITION_OUTSIDE = 32, - PL_POSITION_VIEWPORT = 64, - PL_POSITION_SUBPAGE = 128, + PL_POSITION_LEFT = 0x1, + PL_POSITION_RIGHT = 0x2, + PL_POSITION_TOP = 0x4, + PL_POSITION_BOTTOM = 0x8, + PL_POSITION_INSIDE = 0x10, + PL_POSITION_OUTSIDE = 0x20, + PL_POSITION_VIEWPORT = 0x40, + PL_POSITION_SUBPAGE = 0x80, }; typedef [set] enum plplot_position_enum plplot_position_opt; enum plplot_legend_enum { - PL_LEGEND_NONE = 1, - PL_LEGEND_COLOR_BOX = 2, - PL_LEGEND_LINE = 4, - PL_LEGEND_SYMBOL = 8, - PL_LEGEND_TEXT_LEFT = 16, - PL_LEGEND_BACKGROUND = 32, - PL_LEGEND_BOUNDING_BOX = 64, - PL_LEGEND_ROW_MAJOR = 128, + PL_LEGEND_NONE = 0x1, + PL_LEGEND_COLOR_BOX = 0x2, + PL_LEGEND_LINE = 0x4, + PL_LEGEND_SYMBOL = 0x8, + PL_LEGEND_TEXT_LEFT = 0x10, + PL_LEGEND_BACKGROUND = 0x20, + PL_LEGEND_BOUNDING_BOX = 0x40, + PL_LEGEND_ROW_MAJOR = 0x80, }; typedef [set] enum plplot_legend_enum plplot_legend_opt; enum plplot_colorbar_enum { - PL_COLORBAR_LABEL_LEFT = 1, - PL_COLORBAR_LABEL_RIGHT = 2, - PL_COLORBAR_LABEL_TOP = 4, - PL_COLORBAR_LABEL_BOTTOM = 8, - PL_COLORBAR_IMAGE = 16, - PL_COLORBAR_SHADE = 32, - PL_COLORBAR_GRADIENT = 64, - PL_COLORBAR_CAP_LOW = 128, - PL_COLORBAR_CAP_HIGH = 256, - PL_COLORBAR_SHADE_LABEL = 512, + PL_COLORBAR_LABEL_LEFT = 0x1, + PL_COLORBAR_LABEL_RIGHT = 0x2, + PL_COLORBAR_LABEL_TOP = 0x4, + PL_COLORBAR_LABEL_BOTTOM = 0x8, + PL_COLORBAR_IMAGE = 0x10, + PL_COLORBAR_SHADE = 0x20, + PL_COLORBAR_GRADIENT = 0x40, + PL_COLORBAR_CAP_NONE = 0x80, + PL_COLORBAR_CAP_LOW = 0x100, + PL_COLORBAR_CAP_HIGH = 0x200, + PL_COLORBAR_SHADE_LABEL = 0x400, + PL_COLORBAR_ORIENT_RIGHT = 0x800, + PL_COLORBAR_ORIENT_TOP = 0x1000, + PL_COLORBAR_ORIENT_LEFT = 0x2000, + PL_COLORBAR_ORIENT_BOTTOM = 0x4000, + PL_COLORBAR_BACKGROUND = 0x8000, + PL_COLORBAR_BOUNDING_BOX = 0x10000, }; typedef [set] enum plplot_colorbar_enum plplot_colorbar_opt; Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2011-08-14 01:02:06 UTC (rev 11881) +++ trunk/bindings/ocaml/plplot_impl.c 2011-08-14 01:02:38 UTC (rev 11882) @@ -1,5 +1,5 @@ // -// Copyright 2007, 2008, 2009 Hezekiah M. Carty +// Copyright 2007, 2008, 2009, 2010, 2011 Hezekiah M. Carty // // This file is part of PLplot. // Modified: trunk/examples/ocaml/xplot01.ml =================================================================== --- trunk/examples/ocaml/xplot01.ml 2011-08-14 01:02:06 UTC (rev 11881) +++ trunk/examples/ocaml/xplot01.ml 2011-08-14 01:02:38 UTC (rev 11882) @@ -94,7 +94,7 @@ P.plot ~stream [ (* Plot the data points *) - P.points ~symbol:P.Solar_symbol P.Green xs ys; + P.points ~symbol:"⊙" P.Green xs ys; (* Draw the line through the data *) P.lines P.Red x y; (* Show the axes *) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-08-14 01:03:24
|
Revision: 11884 http://plplot.svn.sourceforge.net/plplot/?rev=11884&view=rev Author: hezekiahcarty Date: 2011-08-14 01:03:18 +0000 (Sun, 14 Aug 2011) Log Message: ----------- Experimental support for building OCaml bindings with a static PLplot core The OCaml bindings could only previously be compiled against a shared library version of PLplot. This commit updates the CMake rules so that, at least on my system (Ubunty 11.04, 64bit), the OCaml bindings and examples build and run properly when -DBUILD_SHARED_LIBS=OFF is passed to cmake. Testing on other distributions and OSs is welcome! Modified Paths: -------------- trunk/bindings/ocaml/CMakeLists.txt trunk/cmake/modules/ocaml.cmake trunk/examples/ocaml/CMakeLists.txt Modified: trunk/bindings/ocaml/CMakeLists.txt =================================================================== --- trunk/bindings/ocaml/CMakeLists.txt 2011-08-14 01:02:52 UTC (rev 11883) +++ trunk/bindings/ocaml/CMakeLists.txt 2011-08-14 01:03:18 UTC (rev 11884) @@ -27,6 +27,32 @@ # Optionally build the Plcairo module add_subdirectory(plcairo) + # Stack on a bunch of extra flags if we are building against a static PLplot core + set(ocaml_STATIC_FLAGS) + if(NOT BUILD_SHARED_LIBS) + foreach(DEP ${plplotd_LIB_DEPENDS} ${csirocsa_LIB_DEPENDS} ${csironn_LIB_DEPENDS}) + if(DEP STREQUAL "csirocsa" OR DEP STREQUAL "csironn" OR DEP STREQUAL "qsastime") + set(internal_LIB_DIR) + if(DEP STREQUAL "csirocsa") + set(internal_LIB_DIR "csa") + elseif(DEP STREQUAL "csironn") + set(internal_LIB_DIR "nn") + elseif(DEP STREQUAL "qsastime") + set(internal_LIB_DIR "qsastime") + endif() + set(ocaml_STATIC_FLAGS ${ocaml_STATIC_FLAGS} -cclib ${CMAKE_BINARY_DIR}/lib/${internal_LIB_DIR}/lib${DEP}.a) + elseif(DEP STREQUAL "general") + set(ocaml_STATIC_FLAGS ${ocaml_STATIC_FLAGS}) + else() + if(DEP MATCHES "^-") + set(ocaml_STATIC_FLAGS ${ocaml_STATIC_FLAGS} -ccopt ${DEP}) + else() + set(ocaml_STATIC_FLAGS ${ocaml_STATIC_FLAGS} -cclib ${DEP}) + endif() + endif() + endforeach(DEP ${plplotd_LIB_DEPENDS}) + endif(NOT BUILD_SHARED_LIBS) + # optional command to generate generated_plplot_h.inc. This generated # version of the file should be identical to plplot_h.inc. if(GENERATE_PLPLOT_H_INC) @@ -76,7 +102,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/libplplot_stubs.a COMMAND ${OCAMLC} -c ${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.c COMMAND ${OCAMLC} -ccopt -I${CMAKE_SOURCE_DIR}/include -ccopt -I${CMAKE_BINARY_DIR}/include -ccopt -I${CMAKE_SOURCE_DIR}/lib/qsastime -c ${CMAKE_CURRENT_SOURCE_DIR}/plplot_impl.c - COMMAND ${OCAMLMKLIB} -o plplot_stubs -L${CAMLIDL_LIB_DIR} -lcamlidl -L${CMAKE_BINARY_DIR}/src -lplplot${LIB_TAG} ${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.o ${CMAKE_CURRENT_BINARY_DIR}/plplot_impl.o + COMMAND ${OCAMLMKLIB} -o plplot_stubs -L${CAMLIDL_LIB_DIR} -lcamlidl -L${CMAKE_BINARY_DIR}/src -lplplot${LIB_TAG} ${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.o ${CMAKE_CURRENT_BINARY_DIR}/plplot_impl.o ${ocaml_STATIC_FLAGS} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.c ${CMAKE_CURRENT_SOURCE_DIR}/plplot_impl.c @@ -135,7 +161,7 @@ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plplot.cma - COMMAND ${OCAMLC} -a -custom -o ${CMAKE_CURRENT_BINARY_DIR}/plplot.cma ${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmo ${CMAKE_CURRENT_BINARY_DIR}/plplot.cmo -dllib -lplplot_stubs -ccopt -L${CMAKE_CURRENT_BINARY_DIR} -cclib -lplplot_stubs -ccopt -L${CAMLIDL_LIB_DIR} -cclib -lcamlidl -ccopt -L${CMAKE_BINARY_DIR}/src -cclib -lplplot${LIB_TAG} -dllpath ${CMAKE_BINARY_DIR}/src + COMMAND ${OCAMLC} -a -custom -o ${CMAKE_CURRENT_BINARY_DIR}/plplot.cma ${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmo ${CMAKE_CURRENT_BINARY_DIR}/plplot.cmo -dllib -lplplot_stubs -ccopt -L${CMAKE_CURRENT_BINARY_DIR} -cclib -lplplot_stubs -ccopt -L${CAMLIDL_LIB_DIR} -cclib -lcamlidl -ccopt -L${CMAKE_BINARY_DIR}/src -cclib -lplplot${LIB_TAG} -dllpath ${CMAKE_BINARY_DIR}/src ${ocaml_STATIC_FLAGS} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmo ${CMAKE_CURRENT_BINARY_DIR}/plplot.cmo @@ -188,7 +214,7 @@ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plplot.cmxa ${CMAKE_CURRENT_BINARY_DIR}/plplot.a - COMMAND ${OCAMLOPT} -a -o ${CMAKE_CURRENT_BINARY_DIR}/plplot.cmxa ${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmx ${CMAKE_CURRENT_BINARY_DIR}/plplot.cmx -ccopt -L${CMAKE_CURRENT_BINARY_DIR} -cclib -lplplot_stubs -ccopt -L${CAMLIDL_LIB_DIR} -cclib -lcamlidl -ccopt -L${CMAKE_BINARY_DIR}/src -cclib -lplplot${LIB_TAG} + COMMAND ${OCAMLOPT} -a -o ${CMAKE_CURRENT_BINARY_DIR}/plplot.cmxa ${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmx ${CMAKE_CURRENT_BINARY_DIR}/plplot.cmx -ccopt -L${CMAKE_CURRENT_BINARY_DIR} -cclib -lplplot_stubs -ccopt -L${CAMLIDL_LIB_DIR} -cclib -lcamlidl -ccopt -L${CMAKE_BINARY_DIR}/src -cclib -lplplot${LIB_TAG} ${ocaml_STATIC_FLAGS} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmx ${CMAKE_CURRENT_BINARY_DIR}/plplot.cmx Modified: trunk/cmake/modules/ocaml.cmake =================================================================== --- trunk/cmake/modules/ocaml.cmake 2011-08-14 01:02:52 UTC (rev 11883) +++ trunk/cmake/modules/ocaml.cmake 2011-08-14 01:03:18 UTC (rev 11884) @@ -28,9 +28,10 @@ endif(DEFAULT_NO_BINDINGS) if(ENABLE_ocaml AND NOT BUILD_SHARED_LIBS) - message(STATUS "WARNING: " - "OCaml requires shared libraries. Disabling ocaml bindings") - set(ENABLE_ocaml OFF CACHE BOOL "Enable OCaml bindings" FORCE) + message(STATUS "NOTICE: " + "OCaml requires -fPIC flag when building static PLplot. Forcing -fPIC for C and C++ compilation.") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif(ENABLE_ocaml AND NOT BUILD_SHARED_LIBS) if(ENABLE_ocaml) Modified: trunk/examples/ocaml/CMakeLists.txt =================================================================== --- trunk/examples/ocaml/CMakeLists.txt 2011-08-14 01:02:52 UTC (rev 11883) +++ trunk/examples/ocaml/CMakeLists.txt 2011-08-14 01:03:18 UTC (rev 11884) @@ -120,10 +120,14 @@ set(ocaml_EXTRA_CLEAN_FILES) if(CORE_BUILD) set(I_OPTION ${CMAKE_BINARY_DIR}/bindings/ocaml) - set(ccopt_OPTION "-L ${CMAKE_BINARY_DIR}/src -Wl,-rpath -Wl,${CMAKE_BINARY_DIR}/src ") + if(BUILD_SHARED_LIBS) + set(ccopt_OPTION -ccopt "-L ${CMAKE_BINARY_DIR}/src -Wl,-rpath -Wl,${CMAKE_BINARY_DIR}/src ") + endif() else(CORE_BUILD) set(I_OPTION ${OCAML_INSTALL_DIR}/plplot) - set(ccopt_OPTION "-L ${CMAKE_INSTALL_LIBDIR} -Wl,-rpath -Wl,${CMAKE_INSTALL_LIBDIR} ") + if(BUILD_SHARED_LIBS) + set(ccopt_OPTION -ccopt "-L ${CMAKE_INSTALL_LIBDIR} -Wl,-rpath -Wl,${CMAKE_INSTALL_LIBDIR} ") + endif() endif(CORE_BUILD) get_property(files_plplot_ocaml GLOBAL PROPERTY FILES_plplot_ocaml) @@ -155,7 +159,7 @@ COMMAND ${ocaml_compiler} -g -I ${I_OPTION} - -ccopt ${ccopt_OPTION} + ${ccopt_OPTION} plplot.${ocaml_lib_extension} ${unix_lib} -o ${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hba...@us...> - 2011-08-16 19:49:22
|
Revision: 11887 http://plplot.svn.sourceforge.net/plplot/?rev=11887&view=rev Author: hbabcock Date: 2011-08-16 19:49:14 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Remove plgset.c and related references. This was an abandoned attempt (by me, Hazen Babcock) to provide a 'unified' way to get or set many of the variable in the PLStream structure. Modified Paths: -------------- trunk/include/plplot.h trunk/src/CMakeLists.txt Removed Paths: ------------- trunk/src/plgset.c Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-08-16 19:38:35 UTC (rev 11886) +++ trunk/include/plplot.h 2011-08-16 19:49:14 UTC (rev 11887) @@ -483,58 +483,6 @@ } PLLabelDefaults; // -// Structures and Enumerations used by plget and plset. -// - -enum PLAttributeName // alphabetical? -{ - PL_CMAP0, - PL_CMAP1, - PL_CURCHARSIZE, - PL_CURCOLOR0, - PL_CURMAJORTICK, - PL_CURMINORTICK, - PL_DEFCHARSIZE, - PL_DEFMAJORTICK, - PL_DEFMINORTICK, - PL_ICOL0, - PL_ICOL1, - PL_NCOL0, - PL_NCOL1, - PL_PENWIDTH, - PL_PRECISION, - PL_SETPRECISION, - PL_XDIGITS, - PL_XDIGMAX, - PL_YDIGITS, - PL_YDIGMAX, - PL_ZDIGITS, - PL_ZDIGMAX -}; - -enum PLAttributeType -{ - PL_COLOR, - PL_COLORPTR, - PL_FLT, - PL_FLTPTR, - PL_INT, - PL_INTPTR -}; - -typedef struct -{ - PLINT attributeType; - PLINT intValue; - PLINT *intValues; - PLFLT fltValue; - PLFLT *fltValues; - PLColor colorValue; - PLColor *colorValues; - PLINT nValues; -} PLAttribute; - -// // typedefs for access methods for arbitrary (i.e. user defined) data storage // @@ -674,7 +622,6 @@ #define plgfci c_plgfci #define plgfnam c_plgfnam #define plgfont c_plgfont -#define plget c_plget #define plglevel c_plglevel #define plgpage c_plgpage #define plgra c_plgra @@ -751,7 +698,6 @@ #define plsdiplz c_plsdiplz #define plseed c_plseed #define plsesc c_plsesc -#define plset c_plset #define plsetopt c_plsetopt #define plsfam c_plsfam #define plsfci c_plsfci @@ -2032,15 +1978,7 @@ PLDLLIMPEXP void c_plxormod( PLBOOL mode, PLBOOL *status ); -// Get the value of a variable from the current stream. -PLDLLIMPEXP void -c_plget( enum PLAttributeName attrName, PLAttribute *attr ); -// Set the value of a variable in the current stream. -PLDLLIMPEXP void -c_plset( enum PLAttributeName attrName, PLAttribute attr ); - - //-------------------------------------------------------------------------- // Functions for use from C or C++ only //-------------------------------------------------------------------------- Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2011-08-16 19:38:35 UTC (rev 11886) +++ trunk/src/CMakeLists.txt 2011-08-16 19:49:14 UTC (rev 11887) @@ -35,7 +35,6 @@ plfill.c plfreetype.c plgradient.c - plgset.c plhist.c plimage.c plline.c Deleted: trunk/src/plgset.c =================================================================== --- trunk/src/plgset.c 2011-08-16 19:38:35 UTC (rev 11886) +++ trunk/src/plgset.c 2011-08-16 19:49:14 UTC (rev 11887) @@ -1,379 +0,0 @@ -// plget/plset() -// -// Copyright (C) 2009 Hazen Babcock -// -// This file is part of PLplot. -// -// PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU Library General Public License as published -// by the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// PLplot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public License -// along with PLplot; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// - -#include "plplotP.h" -#include "plstrm.h" - -//-------------------------------------------------------------------------- -// plget : Get the value of the specified variable in the current plot stream -//-------------------------------------------------------------------------- -void -c_plget( enum PLAttributeName attrName, PLAttribute *attrValue ) -{ - PLINT i; - - attrValue->attributeType = -1; - switch ( attrName ) - { - // get the entire color map 0 - case PL_CMAP0: - attrValue->attributeType = PL_COLORPTR; - attrValue->colorValues = (PLColor *) malloc( sizeof ( PLColor ) * plsc->ncol0 ); - for ( i = 0; i < plsc->ncol0; i++ ) - { - attrValue->colorValues[i].r = plsc->cmap0[i].r; - attrValue->colorValues[i].g = plsc->cmap0[i].g; - attrValue->colorValues[i].b = plsc->cmap0[i].b; - attrValue->colorValues[i].a = plsc->cmap0[i].a; - } - attrValue->nValues = plsc->ncol0; - break; - // get the entire color map 1 - case PL_CMAP1: - attrValue->attributeType = PL_COLORPTR; - attrValue->colorValues = (PLColor *) malloc( sizeof ( PLColor ) * plsc->ncol1 ); - for ( i = 0; i < plsc->ncol1; i++ ) - { - attrValue->colorValues[i].r = plsc->cmap1[i].r; - attrValue->colorValues[i].g = plsc->cmap1[i].g; - attrValue->colorValues[i].b = plsc->cmap1[i].b; - attrValue->colorValues[i].a = plsc->cmap1[i].a; - } - attrValue->nValues = plsc->ncol1; - break; - // get the current (scaled) character height - case PL_CURCHARSIZE: - attrValue->attributeType = PL_FLT; - attrValue->fltValue = plsc->chrht; - break; - // get the current color map 0 color - case PL_CURCOLOR0: - attrValue->attributeType = PL_COLOR; - attrValue->colorValue.r = plsc->curcolor.r; - attrValue->colorValue.g = plsc->curcolor.g; - attrValue->colorValue.b = plsc->curcolor.b; - attrValue->colorValue.a = plsc->curcolor.a; - break; - // get the current (scaled) major tick size - case PL_CURMAJORTICK: - attrValue->attributeType = PL_FLT; - attrValue->fltValue = plsc->majht; - break; - // get the current (scaled) minor tick size - case PL_CURMINORTICK: - attrValue->attributeType = PL_FLT; - attrValue->fltValue = plsc->minht; - break; - // get the default character height (in mm) - case PL_DEFCHARSIZE: - attrValue->attributeType = PL_FLT; - attrValue->fltValue = plsc->chrdef; - break; - // get the default major tick size (in mm) - case PL_DEFMAJORTICK: - attrValue->attributeType = PL_FLT; - attrValue->fltValue = plsc->majdef; - break; - // get the default minor tick size (in mm) - case PL_DEFMINORTICK: - attrValue->attributeType = PL_FLT; - attrValue->fltValue = plsc->mindef; - break; - // get the index of the current color map 0 color - case PL_ICOL0: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->icol0; - break; - // get the index of the current color map 1 color - case PL_ICOL1: - attrValue->attributeType = PL_FLT; - attrValue->intValue = ( (PLFLT) plsc->icol1 ) / ( (PLFLT) plsc->ncol1 ); - break; - // get the number of colors in color map 0 - case PL_NCOL0: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->ncol0; - break; - // get the number of colors in color map 1 - case PL_NCOL1: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->ncol1; - break; - // get the current pen width - case PL_PENWIDTH: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->width; - break; - // get the current number of digits of precision - case PL_PRECISION: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->precis; - break; - // get whether or not to use user specified number of digits of precision - case PL_SETPRECISION: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->setpre; - break; - // get x fields digit value (?) - case PL_XDIGITS: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->xdigits; - break; - // get x maximum digits (0 = no maximum) - case PL_XDIGMAX: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->xdigmax; - break; - // get y fields digit value (?) - case PL_YDIGITS: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->ydigits; - break; - // get y maximum digits (0 = no maximum) - case PL_YDIGMAX: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->ydigmax; - break; - // get z fields digit value (?) - case PL_ZDIGITS: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->zdigits; - break; - // get z maximum digits (0 = no maximum) - case PL_ZDIGMAX: - attrValue->attributeType = PL_INT; - attrValue->intValue = plsc->zdigmax; - break; - default: - break; - } -} - -//-------------------------------------------------------------------------- -// plset : Set the value of the specified variable in the current plot stream -// -// Note: This is a little tricker since we can't just set the value & expect -// the driver to respond, instead we have to call the appropriate function -// in PLplot core. -// -//-------------------------------------------------------------------------- -void -c_plset( enum PLAttributeName attrName, PLAttribute attrValue ) -{ - PLINT i; - PLINT *r, *g, *b; - PLFLT *a; - - switch ( attrName ) - { - // set color map 0 from an array of PL_COLOR values - case PL_CMAP0: - if ( attrValue.attributeType == PL_COLORPTR ) - { - r = (PLINT *) malloc( sizeof ( PLINT ) * attrValue.nValues ); - g = (PLINT *) malloc( sizeof ( PLINT ) * attrValue.nValues ); - b = (PLINT *) malloc( sizeof ( PLINT ) * attrValue.nValues ); - a = (PLFLT *) malloc( sizeof ( PLFLT ) * attrValue.nValues ); - for ( i = 0; i < attrValue.nValues; i++ ) - { - r[i] = attrValue.colorValues[i].r; - g[i] = attrValue.colorValues[i].g; - b[i] = attrValue.colorValues[i].b; - a[i] = attrValue.colorValues[i].a; - } - plscmap0a( r, g, b, a, attrValue.nValues ); - free( r ); - free( g ); - free( b ); - free( a ); - } - break; - // set color map 1 from an array of PL_COLOR values - case PL_CMAP1: - if ( attrValue.attributeType == PL_COLORPTR ) - { - r = (PLINT *) malloc( sizeof ( PLINT ) * attrValue.nValues ); - g = (PLINT *) malloc( sizeof ( PLINT ) * attrValue.nValues ); - b = (PLINT *) malloc( sizeof ( PLINT ) * attrValue.nValues ); - a = (PLFLT *) malloc( sizeof ( PLFLT ) * attrValue.nValues ); - for ( i = 0; i < attrValue.nValues; i++ ) - { - r[i] = attrValue.colorValues[i].r; - g[i] = attrValue.colorValues[i].g; - b[i] = attrValue.colorValues[i].b; - a[i] = attrValue.colorValues[i].a; - } - plscmap1a( r, g, b, a, attrValue.nValues ); - free( r ); - free( g ); - free( b ); - free( a ); - } - break; - // set the (scaled) character height - case PL_CURCHARSIZE: - if ( attrValue.attributeType == PL_FLT ) - { - plschr( 0.0, attrValue.fltValue ); - } - break; - // set the current color map 0 color - case PL_CURCOLOR0: - if ( attrValue.attributeType == PL_COLOR ) - { - plscol0( plsc->icol0, - attrValue.colorValue.r, - attrValue.colorValue.g, - attrValue.colorValue.b ); - plcol0( plsc->icol0 ); - } - break; - // set the (scaled) major tick length - case PL_CURMAJORTICK: - if ( attrValue.attributeType == PL_FLT ) - { - plsmaj( 0.0, attrValue.fltValue ); - } - break; - // set the (scaled) minor tick length - case PL_CURMINORTICK: - if ( attrValue.attributeType == PL_FLT ) - { - plsmin( 0.0, attrValue.fltValue ); - } - break; - // set the default character height (mm) - case PL_DEFCHARSIZE: - if ( attrValue.attributeType == PL_FLT ) - { - plschr( attrValue.fltValue, plsc->chrht ); - } - break; - // set the default major tick size (mm) - case PL_DEFMAJORTICK: - if ( attrValue.attributeType == PL_FLT ) - { - plsmaj( attrValue.fltValue, plsc->majht ); - } - break; - // set the default minor tick size (mm) - case PL_DEFMINORTICK: - if ( attrValue.attributeType == PL_FLT ) - { - plsmin( attrValue.fltValue, plsc->minht ); - } - break; - // set the index of the current color map 0 color - case PL_ICOL0: - if ( attrValue.attributeType == PL_INT ) - { - plcol0( attrValue.intValue ); - } - break; - // set the index of the current color map 1 color - case PL_ICOL1: - if ( attrValue.attributeType == PL_FLT ) - { - plcol1( attrValue.fltValue ); - } - break; - // set the number of colors in color map 0 - case PL_NCOL0: - if ( attrValue.attributeType == PL_INT ) - { - plscmap0n( attrValue.intValue ); - } - break; - // set the number of colors in color map 1 - case PL_NCOL1: - if ( attrValue.attributeType == PL_INT ) - { - plscmap1n( attrValue.intValue ); - } - break; - // set the current pen width - case PL_PENWIDTH: - if ( attrValue.attributeType == PL_INT ) - { - plwid( attrValue.intValue ); - } - break; - // set the current number of digits of precision - case PL_PRECISION: - if ( attrValue.attributeType == PL_INT ) - { - plprec( plsc->setpre, attrValue.intValue ); - } - break; - // set whether or not to use user specified number of digits of precision - case PL_SETPRECISION: - if ( attrValue.attributeType == PL_INT ) - { - plprec( attrValue.intValue, plsc->precis ); - } - break; - // set x fields digit value (?) - case PL_XDIGITS: - if ( attrValue.attributeType == PL_INT ) - { - plsxax( plsc->xdigmax, attrValue.intValue ); - } - break; - // get x maximum digits (0 = no maximum) - case PL_XDIGMAX: - if ( attrValue.attributeType == PL_INT ) - { - plsxax( attrValue.intValue, plsc->xdigits ); - } - break; - // set y fields digit value (?) - case PL_YDIGITS: - if ( attrValue.attributeType == PL_INT ) - { - plsyax( plsc->ydigmax, attrValue.intValue ); - } - break; - // set y maximum digits (0 = no maximum) - case PL_YDIGMAX: - if ( attrValue.attributeType == PL_INT ) - { - plsyax( attrValue.intValue, plsc->ydigits ); - } - break; - // set z fields digit value (?) - case PL_ZDIGITS: - if ( attrValue.attributeType == PL_INT ) - { - plszax( plsc->zdigmax, attrValue.intValue ); - } - break; - // set z maximum digits (0 = no maximum) - case PL_ZDIGMAX: - if ( attrValue.attributeType == PL_INT ) - { - plszax( attrValue.intValue, plsc->zdigits ); - } - break; - default: - break; - } -} - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-08-22 18:09:40
|
Revision: 11889 http://plplot.svn.sourceforge.net/plplot/?rev=11889&view=rev Author: andrewross Date: 2011-08-22 18:09:33 +0000 (Mon, 22 Aug 2011) Log Message: ----------- Change the location for installing ocaml libraries to an unversioned path, e.g. /usr/lib/ocaml/3.11.2 to /usr/lib/ocaml following Debian and other major Linux distrbibutions. Modified Paths: -------------- trunk/cmake/modules/ocaml.cmake trunk/doc/docbook/src/ocaml.xml Modified: trunk/cmake/modules/ocaml.cmake =================================================================== --- trunk/cmake/modules/ocaml.cmake 2011-08-18 19:03:54 UTC (rev 11888) +++ trunk/cmake/modules/ocaml.cmake 2011-08-22 18:09:33 UTC (rev 11889) @@ -122,7 +122,7 @@ # Installation follows the Debian ocaml policy for want of a better # standard. - set(OCAML_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/ocaml/${OCAML_VERSION} + set(OCAML_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/ocaml CACHE PATH "install location for ocaml files" ) Modified: trunk/doc/docbook/src/ocaml.xml =================================================================== --- trunk/doc/docbook/src/ocaml.xml 2011-08-18 19:03:54 UTC (rev 11888) +++ trunk/doc/docbook/src/ocaml.xml 2011-08-22 18:09:33 UTC (rev 11889) @@ -209,8 +209,8 @@ look for PLplot: </para> <programlisting> - export OCAMLPATH=$PLPLOT_INSTALL_PREFIX/lib/ocaml/$OCAML_VERSION:$OCAMLPATH - export LD_LIBRARY_PATH=$PLPLOT_INSTALL_PREFIX/lib/ocaml/$OCAML_VERSION/stublibs:$LD_LIBRARY_PATH + export OCAMLPATH=$PLPLOT_INSTALL_PREFIX/lib/ocaml:$OCAMLPATH + export LD_LIBRARY_PATH=$PLPLOT_INSTALL_PREFIX/lib/ocaml/stublibs:$LD_LIBRARY_PATH </programlisting> </sect2> <sect2 id="ocaml_command_line_sample_project_core"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-09-13 12:09:17
|
Revision: 11920 http://plplot.svn.sourceforge.net/plplot/?rev=11920&view=rev Author: andrewross Date: 2011-09-13 12:09:04 +0000 (Tue, 13 Sep 2011) Log Message: ----------- Remove further references to obsolete functions. Modified Paths: -------------- trunk/examples/python/x09.py trunk/scripts/check_api_completeness.sh Modified: trunk/examples/python/x09.py =================================================================== --- trunk/examples/python/x09.py 2011-09-13 12:06:24 UTC (rev 11919) +++ trunk/examples/python/x09.py 2011-09-13 12:09:04 UTC (rev 11920) @@ -64,13 +64,7 @@ ## PLcGrid cgrid1; ## PLcGrid2 cgrid2; ## -##/* Parse and process command line arguments */ -## -## (void) plParseOpts(&argc, argv, PL_PARSE_FULL); -## ##/* Initialize plplot */ -## -## plinit(); plinit() Modified: trunk/scripts/check_api_completeness.sh =================================================================== --- trunk/scripts/check_api_completeness.sh 2011-09-13 12:06:24 UTC (rev 11919) +++ trunk/scripts/check_api_completeness.sh 2011-09-13 12:09:04 UTC (rev 11920) @@ -15,7 +15,6 @@ grep -v 'plclr$' |\ grep -v 'plcol$' |\ grep -v 'plhls$' |\ -grep -v 'plHLS$' |\ grep -v 'plpage$' |\ grep -v 'plrgb$' |\ grep -v 'plrgb1$' |\ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-09-25 16:09:45
|
Revision: 11935 http://plplot.svn.sourceforge.net/plplot/?rev=11935&view=rev Author: airwin Date: 2011-09-25 16:09:38 +0000 (Sun, 25 Sep 2011) Log Message: ----------- Style previous changes. Modified Paths: -------------- trunk/bindings/c++/plstream.cc trunk/bindings/qt_gui/plqt.cpp trunk/drivers/ps.c trunk/drivers/qt.cpp trunk/drivers/wxwidgets_gc.cpp trunk/examples/c/x27c.c trunk/examples/c++/x27.cc trunk/examples/d/x27d.d trunk/examples/java/x27.java trunk/include/qt.h trunk/src/plarc.c trunk/src/plctrl.c trunk/utils/plrender.c Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/bindings/c++/plstream.cc 2011-09-25 16:09:38 UTC (rev 11935) @@ -1940,7 +1940,7 @@ // Set the RGB memory area to be plotted (with the 'mem' or 'memcairo' drivers) -void plstream::smem( PLINT maxx, PLINT maxy, void *plotmem) +void plstream::smem( PLINT maxx, PLINT maxy, void *plotmem ) { set_stream(); @@ -1949,7 +1949,7 @@ // Set the RGBA memory area to be plotted (with the 'memcairo' drivers) -void plstream::smema( PLINT maxx, PLINT maxy, void *plotmem) +void plstream::smema( PLINT maxx, PLINT maxy, void *plotmem ) { set_stream(); Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/bindings/qt_gui/plqt.cpp 2011-09-25 16:09:38 UTC (rev 11935) @@ -81,32 +81,32 @@ pls = p; } -void QtPLDriver::drawArc( short x, short y, short a, short b, PLFLT angle1, PLFLT angle2, PLFLT rotate, bool fill ) +void QtPLDriver::drawArc( short x, short y, short a, short b, PLFLT angle1, PLFLT angle2, PLFLT rotate, bool fill ) { if ( !m_painterP->isActive() ) return; - QRectF rect( (PLFLT) (x-a) * downscale, - m_dHeight - (PLFLT) (y+b) * downscale, + QRectF rect( (PLFLT) ( x - a ) * downscale, + m_dHeight - (PLFLT) ( y + b ) * downscale, (PLFLT) a * downscale * 2, (PLFLT) b * downscale * 2 ); - if (rotate != 0.0) { - m_painterP->save(); - m_painterP->translate((PLFLT)x*downscale, m_dHeight - (PLFLT) y * downscale ); - m_painterP->rotate(-rotate); - m_painterP->translate(-(PLFLT)x*downscale, -m_dHeight + (PLFLT) y * downscale ); - } + if ( rotate != 0.0 ) + { + m_painterP->save(); + m_painterP->translate( (PLFLT) x * downscale, m_dHeight - (PLFLT) y * downscale ); + m_painterP->rotate( -rotate ); + m_painterP->translate( -(PLFLT) x * downscale, -m_dHeight + (PLFLT) y * downscale ); + } - if (fill) - m_painterP->drawPie( rect, (int) (angle1*16), (int) ((angle2-angle1)*16) ); + if ( fill ) + m_painterP->drawPie( rect, (int) ( angle1 * 16 ), (int) ( ( angle2 - angle1 ) * 16 ) ); else - m_painterP->drawArc( rect, (int) (angle1*16), (int) ((angle2-angle1)*16) ); + m_painterP->drawArc( rect, (int) ( angle1 * 16 ), (int) ( ( angle2 - angle1 ) * 16 ) ); - if (rotate != 0.0) { - m_painterP->restore(); - } - - + if ( rotate != 0.0 ) + { + m_painterP->restore(); + } } void QtPLDriver::drawLine( short x1, short y1, short x2, short y2 ) @@ -716,12 +716,12 @@ case SET_GRADIENT: delete i->Data.LinearGradient; break; - - case ARC: - delete i->Data.ArcStruct->rect; - delete i->Data.ArcStruct->dx; - delete i->Data.ArcStruct; + case ARC: + delete i->Data.ArcStruct->rect; + delete i->Data.ArcStruct->dx; + delete i->Data.ArcStruct; + default: break; } @@ -733,24 +733,24 @@ } -void QtPLWidget::drawArc( short x, short y, short a, short b, PLFLT angle1, PLFLT angle2, PLFLT rotate, bool fill ) +void QtPLWidget::drawArc( short x, short y, short a, short b, PLFLT angle1, PLFLT angle2, PLFLT rotate, bool fill ) { BufferElement el; - el.Element = ARC; - el.Data.ArcStruct = new struct ArcStruct_; - el.Data.ArcStruct->rect = new QRectF( (PLFLT) (x-a) * downscale, - m_dHeight - (PLFLT) (y+b) * downscale, - (PLFLT) a * downscale * 2, - (PLFLT) b * downscale * 2 - ); - el.Data.ArcStruct->startAngle = (int) (angle1*16); - el.Data.ArcStruct->spanAngle = (int) ((angle2-angle1)*16); - el.Data.ArcStruct->rotate = rotate; - el.Data.ArcStruct->dx = new QPointF( (PLFLT)x*downscale, m_dHeight - (PLFLT) y * downscale ); - el.Data.ArcStruct->fill = fill; + el.Element = ARC; + el.Data.ArcStruct = new struct ArcStruct_; + el.Data.ArcStruct->rect = new QRectF( (PLFLT) ( x - a ) * downscale, + m_dHeight - (PLFLT) ( y + b ) * downscale, + (PLFLT) a * downscale * 2, + (PLFLT) b * downscale * 2 + ); + el.Data.ArcStruct->startAngle = (int) ( angle1 * 16 ); + el.Data.ArcStruct->spanAngle = (int) ( ( angle2 - angle1 ) * 16 ); + el.Data.ArcStruct->rotate = rotate; + el.Data.ArcStruct->dx = new QPointF( (PLFLT) x * downscale, m_dHeight - (PLFLT) y * downscale ); + el.Data.ArcStruct->fill = fill; m_listBuffer.append( el ); - redrawFromLastFlush = true; + redrawFromLastFlush = true; } @@ -1430,22 +1430,24 @@ p->setPen( SolidPen ); hasPen = true; } - if (i->Data.ArcStruct->rotate != 0.0) { - p->save(); - p->translate( *(i->Data.ArcStruct->dx) ); - p->rotate( - i->Data.ArcStruct->rotate ); - p->translate( - *(i->Data.ArcStruct->dx) ); - } + if ( i->Data.ArcStruct->rotate != 0.0 ) + { + p->save(); + p->translate( *( i->Data.ArcStruct->dx ) ); + p->rotate( -i->Data.ArcStruct->rotate ); + p->translate( -*( i->Data.ArcStruct->dx ) ); + } - if (i->Data.ArcStruct->fill) - p->drawPie( *(i->Data.ArcStruct->rect), i->Data.ArcStruct->startAngle, i->Data.ArcStruct->spanAngle ); - else - p->drawArc( *(i->Data.ArcStruct->rect), i->Data.ArcStruct->startAngle, i->Data.ArcStruct->spanAngle ); - - if (i->Data.ArcStruct->rotate != 0.0) { - p->restore(); - } + if ( i->Data.ArcStruct->fill ) + p->drawPie( *( i->Data.ArcStruct->rect ), i->Data.ArcStruct->startAngle, i->Data.ArcStruct->spanAngle ); + else + p->drawArc( *( i->Data.ArcStruct->rect ), i->Data.ArcStruct->startAngle, i->Data.ArcStruct->spanAngle ); + if ( i->Data.ArcStruct->rotate != 0.0 ) + { + p->restore(); + } + break; default: break; Modified: trunk/drivers/ps.c =================================================================== --- trunk/drivers/ps.c 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/drivers/ps.c 2011-09-25 16:09:38 UTC (rev 11935) @@ -167,8 +167,8 @@ { pls->xlength = 540; pls->ylength = 720; - pls->xoffset = 32; - pls->yoffset = 32; + pls->xoffset = 32; + pls->yoffset = 32; } if ( pls->xdpi <= 0 ) pls->xdpi = 72.; Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/drivers/qt.cpp 2011-09-25 16:09:38 UTC (rev 11935) @@ -97,9 +97,9 @@ snprintf( argv[0], 10, "qt_driver" ); argv[1][0] = '\0'; #ifdef Q_WS_X11 - // On X11 if DISPLAY is not set then cannot open GUI. This allows non-interactive devices to still work in this case. - if (getenv("DISPLAY") == NULL) - isGUI = false; + // On X11 if DISPLAY is not set then cannot open GUI. This allows non-interactive devices to still work in this case. + if ( getenv( "DISPLAY" ) == NULL ) + isGUI = false; #endif new QApplication( argc, argv, isGUI ); res = true; @@ -1096,8 +1096,8 @@ unsigned char *r, *g, *b; PLFLT *alpha; PLINT i; - QtEPSDevice * widget = (QtEPSDevice *) pls->dev; - arc_struct *arc_info = (arc_struct *) ptr; + QtEPSDevice * widget = (QtEPSDevice *) pls->dev; + arc_struct *arc_info = (arc_struct *) ptr; if ( widget != NULL && qt_family_check( pls ) ) { @@ -1164,8 +1164,8 @@ break; case PLESC_ARC: - widget->drawArc( arc_info->x, arc_info->y, arc_info->a, arc_info->b, arc_info->angle1, arc_info->angle2, arc_info->rotate, arc_info->fill); - break; + widget->drawArc( arc_info->x, arc_info->y, arc_info->a, arc_info->b, arc_info->angle1, arc_info->angle2, arc_info->rotate, arc_info->fill ); + break; default: break; } @@ -1360,8 +1360,8 @@ PLINT i; unsigned char *r, *g, *b; PLFLT *alpha; - QtPLWidget * widget = (QtPLWidget *) pls->dev; - arc_struct *arc_info = (arc_struct *) ptr; + QtPLWidget * widget = (QtPLWidget *) pls->dev; + arc_struct *arc_info = (arc_struct *) ptr; if ( widget == NULL ) return; @@ -1422,8 +1422,8 @@ break; case PLESC_ARC: - widget->drawArc( arc_info->x, arc_info->y, arc_info->a, arc_info->b, arc_info->angle1, arc_info->angle2, arc_info->rotate, arc_info->fill); - break; + widget->drawArc( arc_info->x, arc_info->y, arc_info->a, arc_info->b, arc_info->angle1, arc_info->angle2, arc_info->rotate, arc_info->fill ); + break; case PLESC_FLUSH: widget->flush(); @@ -1569,8 +1569,8 @@ PLINT i; unsigned char *r, *g, *b; PLFLT *alpha; - QtExtWidget * widget = NULL; - arc_struct *arc_info = (arc_struct *) ptr; + QtExtWidget * widget = NULL; + arc_struct *arc_info = (arc_struct *) ptr; widget = (QtExtWidget *) pls->dev; switch ( op ) @@ -1631,8 +1631,8 @@ break; case PLESC_ARC: - widget->drawArc( arc_info->x, arc_info->y, arc_info->a, arc_info->b, arc_info->angle1, arc_info->angle2, arc_info->rotate, arc_info->fill); - break; + widget->drawArc( arc_info->x, arc_info->y, arc_info->a, arc_info->b, arc_info->angle1, arc_info->angle2, arc_info->rotate, arc_info->fill ); + break; default: break; } Modified: trunk/drivers/wxwidgets_gc.cpp =================================================================== --- trunk/drivers/wxwidgets_gc.cpp 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/drivers/wxwidgets_gc.cpp 2011-09-25 16:09:38 UTC (rev 11935) @@ -245,10 +245,11 @@ ( (wxMemoryDC *) m_dc )->SelectObject( *m_bitmap ); // select new bitmap } - if ( m_dc ) { - delete m_context; + if ( m_dc ) + { + delete m_context; m_context = wxGraphicsContext::Create( *( (wxMemoryDC *) m_dc ) ); - } + } } @@ -425,17 +426,17 @@ PLINT rcx[4], rcy[4]; difilt_clip( rcx, rcy ); -#ifdef __WXOSX_COCOA__ - wxPoint topLeft(width, height), bottomRight(-1, -1); +#ifdef __WXOSX_COCOA__ + wxPoint topLeft( width, height ), bottomRight( -1, -1 ); for ( int i = 0; i < 4; i++ ) { - topLeft.x = topLeft.x > (rcx[i] / scalex) ? (rcx[i] / scalex) : topLeft.x; - topLeft.y = topLeft.y > (height - rcy[i] / scaley) ? (height - rcy[i] / scaley) : topLeft.y; - bottomRight.x = bottomRight.x < (rcx[i] / scalex) ? (rcx[i] / scalex) : bottomRight.x; - bottomRight.y = bottomRight.y < (height - rcy[i] / scaley) ? (height - rcy[i] / scaley) : bottomRight.y; + topLeft.x = topLeft.x > ( rcx[i] / scalex ) ? ( rcx[i] / scalex ) : topLeft.x; + topLeft.y = topLeft.y > ( height - rcy[i] / scaley ) ? ( height - rcy[i] / scaley ) : topLeft.y; + bottomRight.x = bottomRight.x < ( rcx[i] / scalex ) ? ( rcx[i] / scalex ) : bottomRight.x; + bottomRight.y = bottomRight.y < ( height - rcy[i] / scaley ) ? ( height - rcy[i] / scaley ) : bottomRight.y; } - m_context->Clip( wxRegion( topLeft.x, topLeft.y, bottomRight.x-topLeft.x, bottomRight.y-topLeft.y ) ); + m_context->Clip( wxRegion( topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y ) ); // m_context->Clip( wxRegion( topLeft, bottomRight) ); // this wxRegion constructor doesn't work in wxWidgets 2.9.2/Cocoa #else wxPoint cpoints[4]; Modified: trunk/examples/c/x27c.c =================================================================== --- trunk/examples/c/x27c.c 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/examples/c/x27c.c 2011-09-25 16:09:38 UTC (rev 11935) @@ -222,32 +222,34 @@ } } -void arcs() { -#define NSEG 8 - int i; +void arcs() +{ +#define NSEG 8 + int i; PLFLT theta, dtheta; PLFLT a, b; - theta = 0.0; + theta = 0.0; dtheta = 360.0 / NSEG; plenv( -10.0, 10.0, -10.0, 10.0, 1, 0 ); // Plot segments of circle in different colors - for ( i = 0; i < NSEG; i++ ) { - plcol0( i%2 + 1 ); - plarc(0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, 0); + for ( i = 0; i < NSEG; i++ ) + { + plcol0( i % 2 + 1 ); + plarc( 0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, 0 ); theta = theta + dtheta; } // Draw several filled ellipses inside the circle at different // angles. - a = 3.0; - b = a * tan( (dtheta/180.0*M_PI)/2.0 ); - theta = dtheta/2.0; - for ( i = 0; i < NSEG; i++ ) { - plcol0( 2 - i%2 ); - plarc( a*cos(theta/180.0*M_PI), a*sin(theta/180.0*M_PI), a, b, 0.0, 360.0, theta, 1); + a = 3.0; + b = a * tan( ( dtheta / 180.0 * M_PI ) / 2.0 ); + theta = dtheta / 2.0; + for ( i = 0; i < NSEG; i++ ) + { + plcol0( 2 - i % 2 ); + plarc( a * cos( theta / 180.0 * M_PI ), a * sin( theta / 180.0 * M_PI ), a, b, 0.0, 360.0, theta, 1 ); theta = theta + dtheta; } - } Modified: trunk/examples/c++/x27.cc =================================================================== --- trunk/examples/c++/x27.cc 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/examples/c++/x27.cc 2011-09-25 16:09:38 UTC (rev 11935) @@ -230,35 +230,37 @@ } } -void -x27::arcs() { -#define NSEG 8 - int i; +void +x27::arcs() +{ +#define NSEG 8 + int i; PLFLT theta, dtheta; PLFLT a, b; - theta = 0.0; + theta = 0.0; dtheta = 360.0 / NSEG; pls->env( -10.0, 10.0, -10.0, 10.0, 1, 0 ); // Plot segments of circle in different colors - for ( i = 0; i < NSEG; i++ ) { - pls->col0( i%2 + 1 ); - pls->arc(0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, 0); + for ( i = 0; i < NSEG; i++ ) + { + pls->col0( i % 2 + 1 ); + pls->arc( 0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, 0 ); theta = theta + dtheta; } // Draw several filled ellipses inside the circle at different // angles. - a = 3.0; - b = a * tan( (dtheta/180.0*M_PI)/2.0 ); - theta = dtheta/2.0; - for ( i = 0; i < NSEG; i++ ) { - pls->col0( 2 - i%2 ); - pls->arc( a*cos(theta/180.0*M_PI), a*sin(theta/180.0*M_PI), a, b, 0.0, 360.0, theta, 1); + a = 3.0; + b = a * tan( ( dtheta / 180.0 * M_PI ) / 2.0 ); + theta = dtheta / 2.0; + for ( i = 0; i < NSEG; i++ ) + { + pls->col0( 2 - i % 2 ); + pls->arc( a * cos( theta / 180.0 * M_PI ), a * sin( theta / 180.0 * M_PI ), a, b, 0.0, 360.0, theta, 1 ); theta = theta + dtheta; } - } Modified: trunk/examples/d/x27d.d =================================================================== --- trunk/examples/d/x27d.d 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/examples/d/x27d.d 2011-09-25 16:09:38 UTC (rev 11935) @@ -198,32 +198,34 @@ } } -void arcs() { +void arcs() +{ const int NSEG = 8; - int i; - PLFLT theta, dtheta; - PLFLT a, b; + int i; + PLFLT theta, dtheta; + PLFLT a, b; - theta = 0.0; + theta = 0.0; dtheta = 360.0 / NSEG; plenv( -10.0, 10.0, -10.0, 10.0, 1, 0 ); // Plot segments of circle in different colors - for ( i = 0; i < NSEG; i++ ) { - plcol0( i%2 + 1 ); - plarc(0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, 0); + for ( i = 0; i < NSEG; i++ ) + { + plcol0( i % 2 + 1 ); + plarc( 0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, 0 ); theta = theta + dtheta; } // Draw several filled ellipses inside the circle at different // angles. - a = 3.0; - b = a * tan( (dtheta/180.0*PI)/2.0 ); - theta = dtheta/2.0; - for ( i = 0; i < NSEG; i++ ) { - plcol0( 2 - i%2 ); - plarc( a*cos(theta/180.0*PI), a*sin(theta/180.0*PI), a, b, 0.0, 360.0, theta, 1); + a = 3.0; + b = a * tan( ( dtheta / 180.0 * PI ) / 2.0 ); + theta = dtheta / 2.0; + for ( i = 0; i < NSEG; i++ ) + { + plcol0( 2 - i % 2 ); + plarc( a * cos( theta / 180.0 * PI ), a * sin( theta / 180.0 * PI ), a, b, 0.0, 360.0, theta, 1 ); theta = theta + dtheta; } - } Modified: trunk/examples/java/x27.java =================================================================== --- trunk/examples/java/x27.java 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/examples/java/x27.java 2011-09-25 16:09:38 UTC (rev 11935) @@ -112,10 +112,10 @@ pls.vpor( 0.0, 1.0, 0.0, 1.0 ); spiro( params[i], fill ); } - - // Finally, an example to test out plarc capabilities - arcs(); - + + // Finally, an example to test out plarc capabilities + arcs(); + pls.end(); } @@ -216,36 +216,37 @@ pls.line( xcoord, ycoord ); } - void arcs() { - int NSEG = 8; - int i; - double theta, dtheta; - double a, b; + void arcs() + { + int NSEG = 8; + int i; + double theta, dtheta; + double a, b; - theta = 0.0; - dtheta = 360.0 / NSEG; - pls.env( -10.0, 10.0, -10.0, 10.0, 1, 0 ); - - // Plot segments of circle in different colors - for ( i = 0; i < NSEG; i++ ) { - pls.col0( i%2 + 1 ); - pls.arc(0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, false); - theta = theta + dtheta; - } - - // Draw several filled ellipses inside the circle at different - // angles. - a = 3.0; - b = a * Math.tan( (dtheta/180.0*Math.PI)/2.0 ); - theta = dtheta/2.0; - for ( i = 0; i < NSEG; i++ ) { - pls.col0( 2 - i%2 ); - pls.arc( a*Math.cos(theta/180.0*Math.PI), a*Math.sin(theta/180.0*Math.PI), a, b, 0.0, 360.0, theta, true); - theta = theta + dtheta; - } - + theta = 0.0; + dtheta = 360.0 / NSEG; + pls.env( -10.0, 10.0, -10.0, 10.0, 1, 0 ); + + // Plot segments of circle in different colors + for ( i = 0; i < NSEG; i++ ) + { + pls.col0( i % 2 + 1 ); + pls.arc( 0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, false ); + theta = theta + dtheta; + } + + // Draw several filled ellipses inside the circle at different + // angles. + a = 3.0; + b = a * Math.tan( ( dtheta / 180.0 * Math.PI ) / 2.0 ); + theta = dtheta / 2.0; + for ( i = 0; i < NSEG; i++ ) + { + pls.col0( 2 - i % 2 ); + pls.arc( a * Math.cos( theta / 180.0 * Math.PI ), a * Math.sin( theta / 180.0 * Math.PI ), a, b, 0.0, 360.0, theta, true ); + theta = theta + dtheta; + } } - } //-------------------------------------------------------------------------- Modified: trunk/include/qt.h =================================================================== --- trunk/include/qt.h 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/include/qt.h 2011-09-25 16:09:38 UTC (rev 11935) @@ -273,12 +273,12 @@ struct ArcStruct_ { - QRectF *rect; + QRectF *rect; QPointF *dx; - int startAngle; - int spanAngle; - PLFLT rotate; - bool fill; + int startAngle; + int spanAngle; + PLFLT rotate; + bool fill; }; class BufferElement @@ -294,7 +294,7 @@ QLinearGradient * LinearGradient; struct ColourStruct_* ColourStruct; struct TextStruct_ * TextStruct; - struct ArcStruct_ * ArcStruct; + struct ArcStruct_ * ArcStruct; PLINT intParam; PLFLT fltParam; } Data; Modified: trunk/src/plarc.c =================================================================== --- trunk/src/plarc.c 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/src/plarc.c 2011-09-25 16:09:38 UTC (rev 11935) @@ -22,7 +22,7 @@ #include "plplotP.h" #define CIRCLE_SEGMENTS ( PL_MAXPOLY - 1 ) -#define DEG_TO_RAD( x ) ( ( x ) * M_PI / 180.0 ) +#define DEG_TO_RAD( x ) ( ( x ) * M_PI / 180.0 ) //-------------------------------------------------------------------------- // plarc_approx : Plot an approximated arc with a series of lines @@ -37,7 +37,7 @@ PLFLT theta0, theta_step, theta, d_angle; PLINT segments; PLFLT xs[CIRCLE_SEGMENTS + 1], ys[CIRCLE_SEGMENTS + 1]; - PLFLT cphi,sphi,ctheta,stheta; + PLFLT cphi, sphi, ctheta, stheta; // The difference between the start and end angles d_angle = DEG_TO_RAD( angle2 - angle1 ); @@ -45,8 +45,8 @@ d_angle = M_PI * 2.0; // Calculate cosine and sine of angle of major axis wrt the x axis - cphi = cos(DEG_TO_RAD(rotate)); - sphi = sin(DEG_TO_RAD(rotate)); + cphi = cos( DEG_TO_RAD( rotate ) ); + sphi = sin( DEG_TO_RAD( rotate ) ); // The number of line segments used to approximate the arc segments = fabs( d_angle ) / ( 2.0 * M_PI ) * CIRCLE_SEGMENTS; @@ -62,11 +62,11 @@ // The coordinates for the circle outline for ( i = 0; i < segments; i++ ) { - theta = theta0 + theta_step * (PLFLT) i; - ctheta = cos(theta); - stheta = sin(theta); - xs[i] = x + a*ctheta*cphi - b*stheta*sphi; - ys[i] = y + a*ctheta*sphi + b*stheta*cphi; + theta = theta0 + theta_step * (PLFLT) i; + ctheta = cos( theta ); + stheta = sin( theta ); + xs[i] = x + a * ctheta * cphi - b * stheta * sphi; + ys[i] = y + a * ctheta * sphi + b * stheta * cphi; } if ( fill ) Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/src/plctrl.c 2011-09-25 16:09:38 UTC (rev 11935) @@ -1245,12 +1245,13 @@ } else { - if ( fscanf( fp, "%*[^\n]\n" ) == EOF && ferror(fp) ) { + if ( fscanf( fp, "%*[^\n]\n" ) == EOF && ferror( fp ) ) + { return NULL; } } - + pchr = strchr( buffer, '\r' ); if ( pchr != NULL ) { Modified: trunk/utils/plrender.c =================================================================== --- trunk/utils/plrender.c 2011-09-23 13:34:31 UTC (rev 11934) +++ trunk/utils/plrender.c 2011-09-25 16:09:38 UTC (rev 11935) @@ -830,10 +830,10 @@ // Read n coordinate vectors. //-------------------------------------------------------------------------- -#define plr_rdn( code ) \ - if ( code ) { fprintf( stderr, \ +#define plr_rdn( code ) \ + if ( code ) { fprintf( stderr, \ "Unable to read in %s at line %d, bytecount %d\n\ -Bytes requested: %d\n", __FILE__, __LINE__, \ +Bytes requested: %d\n", __FILE__, __LINE__, \ (int) pdfs->bp, (int) 2 * n ); return -1; } static void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-10-06 18:14:05
|
Revision: 11938 http://plplot.svn.sourceforge.net/plplot/?rev=11938&view=rev Author: airwin Date: 2011-10-06 18:13:58 +0000 (Thu, 06 Oct 2011) Log Message: ----------- Fix for Windows broken build for the 5.9.8 release. This fix supplies a needed lt_dlmakeresident routine for ltdl_win32.c so that dynamic devices can be built on Windows. Currently, this version of lt_dlmakeresident does nothing but return success. The net result is that on Windows plend will unload all libraries that our dynamic devices depend on just like what happened for 5.9.7. Note that for Linux we found that if we did not call the lt_dlmakeresident version for libltdl, that calls to plend (which in turn call lt_dlexit()) unloaded the external libraries that are depended on by our dynamic devices. That library unloading sometimes lead to exit handler errors for those libraries on Linux. In the future if library unloading also leads to issues for Windows, we will need to add real functionality to the lt_dlmakeresident function in ltdl_win32.c to also avoid unloading the libraries in that case. However, we have no reports of such library unloading issues on Windows so a lt_dlmakeresident version for ltdl_win32.h that does nothing other than return success is all we appear to need at the present time. Modified Paths: -------------- trunk/include/ltdl_win32.h trunk/src/ltdl_win32.c Modified: trunk/include/ltdl_win32.h =================================================================== --- trunk/include/ltdl_win32.h 2011-09-30 14:51:11 UTC (rev 11937) +++ trunk/include/ltdl_win32.h 2011-10-06 18:13:58 UTC (rev 11938) @@ -46,4 +46,6 @@ PLDLLIMPEXP void* lt_dlsym( lt_dlhandle dlhandle, const char* symbol ); +PLDLLIMPEXP int lt_dlmakeresident (lt_dlhandle handle); + #endif // __LTDL_WIN32_H__ Modified: trunk/src/ltdl_win32.c =================================================================== --- trunk/src/ltdl_win32.c 2011-09-30 14:51:11 UTC (rev 11937) +++ trunk/src/ltdl_win32.c 2011-10-06 18:13:58 UTC (rev 11938) @@ -111,3 +111,9 @@ else return NULL; } + +// Placeholder that does nothing for now. +int lt_dlmakeresident (lt_dlhandle handle) +{ + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hba...@us...> - 2011-10-13 01:36:01
|
Revision: 11957 http://plplot.svn.sourceforge.net/plplot/?rev=11957&view=rev Author: hbabcock Date: 2011-10-13 01:35:53 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Update README files for the next release. Modified Paths: -------------- trunk/OLD-README.release trunk/README.release Modified: trunk/OLD-README.release =================================================================== --- trunk/OLD-README.release 2011-10-13 01:11:04 UTC (rev 11956) +++ trunk/OLD-README.release 2011-10-13 01:35:53 UTC (rev 11957) @@ -1,3 +1,1270 @@ +PLplot Release 5.9.9 +~~~~~~~~~~~~~~~~~~~~ +This is a development release of PLplot. It represents the ongoing efforts +of the community to improve the PLplot plotting package. Development +releases in the 5.9.x series will be available every few months. The next +stable release will be 5.10.0. + + If you encounter a problem that is not already documented in the +PROBLEMS file or on our bugtracker, then please send bug reports to PLplot +developers via the mailing lists at +http://sourceforge.net/mail/?group_id=2915 (preferred) or on our bugtracker +at http://sourceforge.net/tracker/?group_id=2915&atid=102915. + + Please see the license under which this software is distributed +(LGPL), and the disclaimer of all warranties, given in the COPYING.LIB +file. + +INDEX + +OFFICIAL NOTICES FOR USERS + +CHANGES + +-1. Important changes we should have mentioned in previous release announcements. + +-1.1 Add full bindings and examples for the D language. + +0. Tests made for release 5.9.9 + +1. Changes relative to PLplot 5.9.8 (the previous development release) + +2. Changes relative to PLplot 5.8.0 (the previous stable release) + +2.1 All autotools-related files have now been removed +2.2 Build system bug fixes +2.3 Build system improvements +2.4 Implement build-system infrastructure for installed Ada bindings and +examples +2.5 Code cleanup +2.6 Date / time labels for axes +2.7 Alpha value support +2.8 New PLplot functions +2.9 External libLASi library improvements affecting our psttf device +2.10 Improvements to the cairo driver family +2.11 wxWidgets driver improvements +2.12 pdf driver improvements +2.13 svg driver improvements +2.14 Ada language support +2.15 OCaml language support +2.16 Perl/PDL language support +2.17 Update to various language bindings +2.18 Update to various examples +2.19 Extension of our test framework +2.20 Rename test subdirectory to plplot_test +2.21 Website support files updated +2.22 Internal changes to function visibility +2.23 Dynamic driver support in Windows +2.24 Documentation updates +2.25 libnistcd (a.k.a. libcd) now built internally for -dev cgm +2.26 get-drv-info now changed to test-drv-info +2.27 Text clipping now enabled by default for the cairo devices +2.28 A powerful qt device driver has been implemented +2.29 The PLplot API is now accessible from Qt GUI applications +2.30 NaN / Inf support for some PLplot functions +2.31 Various bug fixes +2.32 Cairo driver improvements +2.33 PyQt changes +2.34 Color Palettes +2.35 Re-implementation of a "soft landing" when a bad/missing compiler is +detected +2.36 Make PLplot aware of LC_NUMERIC locale +2.37 Linear gradients have been implemented +2.38 Cairo Windows driver implemented +2.39 Custom axis labeling implemented +2.40 Universal coordinate transform implemented +2.41 Support for arbitrary storage of 2D user data +2.42 Font improvements +2.42 Alpha value support for plotting in memory. +2.43 Add a Qt device for in memory plotting. +2.44 Add discrete legend capability. +2.45 Add full bindings and examples for the D language. +2.46 The plstring and plstring3 functions have been added +2.47 The pllegend API has been finalized +2.48 Octave bindings now implemented with swig +2.49 Documentation redone for our swig-generated Python and Octave bindings +2.50 Support large polygons +2.51 Complete set of PLplot parameters now available for Fortran +2.52 The plarc function has been added + +OFFICIAL NOTICES FOR USERS + +(5.9.9) This is a quick release to deal with two broken build issues +that were recently discovered for our Windows platform. Windows users should +avoid 5.9.8 because of these problems for that release, and instead use +5.9.9 which has been heavily tested on a number of platforms including +Windows, see "Tests made for release 5.9.9" below. + +(5.9.8) For unicode-aware devices we now follow what is done for the +Hershey font case for epsilon, theta, and phi. This means the #ge, +#gh, and #gf escapes now give users the Greek lunate epsilon, the +ordinary Greek lower case theta, and the Greek symbol phi for Unicode +fonts just like has occurred since the dawn of PLplot history for the +Hershey font case. Previously these legacy escapes were assigned to +ordinary Greek lower-case epsilon, the Greek symbol theta (= script +theta), and the ordinary Greek lower case phi for unicode fonts +inconsistently with what occurred for Hershey fonts. This change gets +rid of this inconsistency, that is the #g escapes should give the best +unicode approximation to the Hershey glyph result that is possible for +unicode-aware devices. + +In general we encourage users of unicode-aware devices who might +dislike the Greek glyph Hershey-lookalike choices they get with the +legacy #g escapes to use instead either PLplot unicode escapes (e.g., +"#[0x03b5]" for ordinary Greek lower-case epsilon, see page 3 of +example 23) or better yet, UTF-8 strings (e.g., "ε") to specify +exactly what unicode glyph they want. + +(5.9.8) The full set of PLplot constants have been made available to +our Fortran 95 users as part of the plplot module. This means those +users will have to remove any parameter statements where they have +previously defined the PLplot constants (whose names typically start +with "PL_" for themselves. For a complete list of the affected +constants, see the #defines in swig-support/plplotcapi.i which are +used internally to help generate the plplot module. See also Index +item 2.51 below. + +(5.9.8) There has been widespread const modifier changes in the API +for libplplotd and libplplotcxxd. Those backwards-incompatible API +changes are indicated in the usual way by a soversion bump in those +two libraries which will force all apps and libraries that depend on +those two libraries to be rebuilt. + +Specifically, we have changed the following arguments in the C library +(libplplotd) case + +type * name1 ==> const type * name1 +type * name2 ==> const type ** name2 + +and the following arguments in the C++ library (libplplotcxxd) case + +type * name1 ==> const type * name1 +type * name1 ==> const type * const * name2 + +where name1 is the name of a singly dimensioned array whose values are +not changed internally by the PLplot libraries and name2 is the name +of a doubly dimensioned array whose values are not changed internally +by the PLplot libraries. + +The general documentation and safety justification for such const +modifier changes to our API is given in +http://www.cprogrammbing.com/tutorial/const_correctness.html. +Essentially, the above const modifier changes constitute our guarantee +that the associated arrays are not changed internally by the PLplot +libraries. + +Although it is necessary to rebuild all apps and libraries that depend +on libplplotd and/or libplplotcxxd, that rebuild should be possible +with unchanged source code without build errors in all cases. For C +apps and libraries (depending on libplplotd) there will be additional +build warnings due to a limitation in the C standard discussed at +http://c-faq.com/ansi/constmismatch.html unless all doubly dimensioned +arrays (but not singly dimensioned) are explicitly cast to (const type +**). However, such source code changes will not be necessary to avoid +warning messages for the C++ (libplplotcxxd) change because of the +double use of const in the above "const type * const * name2" change. + +(5.9.8) The plarc API has changed in release 5.9.8. The plarc API now +has a rotation parameter which will eventually allow for rotated arcs. +PLplot does not currently support rotated arcs, but the plarc function +signature has been modified to avoid changing the API when this +functionality is added. + +(5.9.6) We have retired the pbm driver containing the pbm (actually +portable pixmap) file device. This device is quite primitive and +poorly maintained. It ignores unicode fonts (i.e., uses the Hershey +font fallback), falls back to ugly software fills, doesn't support +alpha transparency, etc. It also has a serious run-time issue with +example 2 (double free detected by glibc) which probably indicates +some fundamental issue with the 100 colours in cmap0 for that +example. For those who really need portable pixmap results, we suggest +using the ImageMagick convert programme, e.g., "convert +examples/x24c01.pngqt test.ppm" or "convert examples/x24c01.pngcairo +test.ppm" to produce good-looking portable pixmap results from our +best png device results. + +(5.9.6) We have retired the linuxvga driver containing the linuxvga +interactive device. This device is quite primitive, difficult to +test, and poorly maintained. It ignores unicode fonts (i.e., uses the +Hershey font fallback), falls back to ugly software fills, doesn't +support alpha transparency, etc. It is Linux only, can only be run as +root, and svgalib (the library used by linuxsvga) is not supported by +some mainstream (e.g., Intel) chipsets. All of these characteristics +make it difficult to even test this device much less use it for +anything serious. Finally, it has had a well-known issue for years +(incorrect colours) which has never been fixed indicating nobody is +interested in maintaining this device. + +(5.9.6) We have retired our platform support of djgpp that used to +reside in sys/dos/djgpp. The developer (Andrew Roach) who used to +maintain those support files for djgpp feels that the djgpp platform +is no longer actively developed, and he no longer uses djgpp himself. + +(5.9.6) We have changed plpoin results for ascii codes 92, 94, and 95 +from centred dot, degree symbol, and centred dot glyphs to the correct +backslash, caret, and underscore glyphs that are associated with those +ascii indices. This change is consistent with the documentation of +plpoin and solves a long-standing issue with backslash, caret, and +underscore ascii characters in character strings used for example by +pl[mp]tex. Those who need access to a centred dot with plpoin should +use index 1. The degree symbol is no longer accessible with plpoin, +but it is available in ordinary text input to PLplot as Hershey escape +"#(718)", where 718 is the Hershey index of the degree symbol, unicode +escape "#[0x00B0]" where 0x00B0 is the unicode index for the degree +symbol or direct UTF8 unicode string "°". + +(5.9.6) We have retired the gcw device driver and the related gnome2 +and pygcw bindings since these are unmaintained and there are good +replacements. These components of PLplot were deprecated as of +release 5.9.3. A good replacement for the gcw device is either the +xcairo or qtwidget device. A good replacement for the gnome2 bindings +is the externally supplied XDrawable or Cairo context associated with +the xcairo device and the extcairo device (see +examples/c/README.cairo). A good replacement for pygcw is our new +pyqt4 bindings for PLplot. + +(5.9.6) We have deprecated support for the python Numeric array +extensions. Numeric is no longer maintained and users of Numeric are +advised to migrate to numpy. Numpy has been the standard for PLplot +for some time. If numpy is not present PLplot will now disable python +by default. If you still require Numeric support in the short term +then set USE_NUMERIC to ON in cmake. The PLplot support for Numeric +will be dropped in a future release. + +(5.9.5) We have removed pyqt3 access to PLplot and replaced it by +pyqt4 access to PLplot (see details below). + +(5.9.5) The only method of specifying a non-default compiler (and +associated compiler options) that we support is the environment +variable approach, e.g., + +export CC='gcc -g -fvisibility=hidden' +export CXX='g++ -g -fvisibility=hidden' +export FC='gfortran -g -fvisibility=hidden' + +All other CMake methods of specifying a non-default compiler and +associated compiler options will not be supported until CMake bug 9220 +is fixed, see discussion below of the soft-landing re-implementation +for details. + +(5.9.5) We have retired the hpgl driver (containing the hp7470, +hp7580, and lj_hpgl devices), the impress driver (containing the imp +device), the ljii driver (containing the ljii and ljiip devices), and +the tek driver (containing the conex, mskermit, tek4107, tek4107f, +tek4010, tek4010f, versaterm, vlt, and xterm devices). Retirement +means we have removed the build options which would allow these +devices to build and install. Recent tests have shown a number of +run-time issues (hpgl, impress, and ljii) or build-time issues (tek) +with these devices, and as far as we know there is no more user +interest in them. Therefore, we have decided to retire these devices +rather than fix them. + +(5.9.4) We have deprecated the pbm device driver (containing the pbm +device) because glibc detects a catastrophic double free. + +(5.9.3) Our build system requires CMake version 2.6.0 or higher. + +(5.9.3) We have deprecated the gcw device driver and the related +gnome2 and pygcw bindings since these are essentially unmaintained. +For example, the gcw device and associated bindings still depends on +the plfreetype approach for accessing unicode fonts which has known +issues (inconsistent text offsets, inconvenient font setting +capabilities, and incorrect rendering of CTL languages). To avoid +these issues we advise using the xcairo device and the externally +supplied XDrawable or Cairo context associated with the xcairo device +and the extcairo device (see examples/c/README.cairo) instead. If you +still absolutely must use -dev gcw or the related gnome2 or pygcw +bindings despite the known problems, then they can still be accessed +by setting PLD_gcw, ENABLE_gnome2, and/or ENABLE_pygcw to ON. + +(5.9.3) We have deprecated the gd device driver which implements the +png, jpeg, and gif devices. This device driver is essentially +unmaintained. For example, it still depends on the plfreetype approach +for accessing unicode fonts which has known issues (inconsistent text +offsets, inconvenient font setting capabilities, and incorrect +rendering of CTL languages). To avoid these issues for PNG format, we +advise using the pngcairo or pngqt devices. To avoid these issues for +the JPEG format, we advise using the jpgqt device. PNG is normally +considered a better raster format than GIF, but if you absolutely +require GIF format, we advise using the pngcairo or pngqt devices and +then downgrading the results to the GIF format using the ImageMagick +"convert" application. For those platforms where libgd (the +dependency of the gd device driver) is accessible while the required +dependencies of the cairo and/or qt devices are not accessible, you +can still use these deprecated devices by setting PLD_png, PLD_jpeg, +or PLD_gif to ON. + +(5.9.3) We have re-enabled the tk, itk, and itcl components of PLplot +by default that were disabled by default as of release 5.9.1 due to +segfaults. The cause of the segfaults was a bug (now fixed) in how +pthread support was implemented for the Tk-related components of +PLplot. + +(5.9.2) We have set HAVE_PTHREAD (now called PL_HAVE_PTHREAD as of +release 5.9.8) to ON by default for all platforms other than Darwin. +Darwin will follow later once it appears the Apple version of X +supports it. + +(5.9.1) We have removed our previously deprecated autotools-based +build system. Instead, use the CMake-based build system following the +directions in the INSTALL file. + +(5.9.1) We no longer support Octave-2.1.73 which has a variety of +run-time issues in our tests of the Octave examples on different +platforms. In contrast our tests show we get good run-time results +with all our Octave examples for Octave-3.0.1. Also, that is the +recommended stable version of Octave at +http://www.gnu.org/software/octave/download.html so that is the only +version of Octave we support at this time. + +(5.9.1) We have decided for consistency sake to change the PLplot +stream variables plsc->vpwxmi, plsc->vpwxma, plsc->vpwymi, and +plsc->vpwyma and the results returned by plgvpw to reflect the exact +window limit values input by users using plwind. Previously to this +change, the stream variables and the values returned by plgvpw +reflected the internal slightly expanded range of window limits used +by PLplot so that the user's specified limits would be on the graph. +Two users noted this slight difference, and we agree with them it +should not be there. Note that internally, PLplot still uses the +expanded ranges so most users results will be identical. However, you +may notice some small changes to your plot results if you use these +stream variables directly (only possible in C/C++) or use plgvpw. + +CHANGES + +-1. Important changes we should have mentioned in previous release announcements. + +-1.1 Add full bindings and examples for the D language. + +As of release 5.9.5 we added full bindings and examples for the D +language. The results for the D examples are generally consistent +with the corresponding C examples which helps to verify the D +bindings. + +Since the release of 5.9.5 it has come to our attention that the +version of gdc supplied with several recent versions of Ubuntu has a +very serious bug on 64-bit systems (see +https://bugs.launchpad.net/ubuntu/+source/gdc-4.2/+bug/235955) which +causes several of the plplot D examples to crash. If this affects you, +you are recommended to disable the d bindings or switch to an +alternative d compiler (the Digital Mars compiler is reported to be +good). + + +0. Tests made for release 5.9.9 + +* (Alan W. Irwin) The scripts/comprehensive_test.sh script was run for + a fully loaded (all Linux bindings other than PDL, all Linux device + drivers including our qt and cairo device drivers) Debian Squeeze + Linux platform with no obvious build-time or run-time issues being + found. This script runs 7 major tests for each of our three + principal build configurations (shared library/dynamic device + drivers, shared libraries/nondynamic device drivers, static + libraries/nondynamic device drivers). Those 7 tests are ctest and + the test_noninteractive and test_interactive targets in the build + tree, the test_noninteractive and test_interactive targets + configured with CMake in the installed examples tree, and the + traditional (MakeFile + pkg-config) test_noninteractive and + test_interactive targets in the installed examples tree. + + These tests were done with OCaml disabled because of a segfault and + a series of bad valgrind test results that occurred for OCaml + 3.11.2. We have tentatively ascribed this issue to issues with the + OCaml stack on that platform since this bad OCaml result contrasts + with good OCaml results on other reported platforms. + + In addition to the scripts/comprehensive_test.sh result, + comprehensive valgrind results were clean for all C examples for + both -dev psc and -dev epsqt for the build-tree/shared + library/dynamic device drivers case. The first result verifies + there are no core memory management issues for our C library and C + examples for one of our simpler devices that has no external + dependencies. The second result shows in addition that there are no + memory management issues for our epsqt device and the part of the + Qt4 version 4.6.3 stack that it uses on this platform. + +* (Andrew Ross) For one Ubuntu platform the test_noninteractive and + test_interactive targets for the shared libraries and dynamic + drivers case gave good results. This was for a fully loaded + platform including our qt and cairo device drivers. + +* (Hezekiah M. Carty) scripts/comprehensive_test.sh failed on a Ubuntu + Linux platform because of segfaults in the qt devices. We + have tentatively ascribed this issue to issues with the Qt4 stack of + libraries on that platform since this bad qt result contrasts with + the good qt result on the previous two Linux platforms. When qt devices + were ignored, clean valgrind results were obtained for OCaml-3.12.1 and + OCaml-3.11.2 (in contrast to the results seen for OCaml-3.11.2 above). + Testing with the comprehensive_test.sh script and qt devices disabled + completed with good results. + +* (Arjen Markus) MinGW/MSYS installed on a lightly loaded (at least + compared to Linux tests) Windows XP system gives good results for + the test_noninteractive target in the build tree for the shared + library/dynamic device drivers case. + +* (Arjen Markus) The combination of Microsoft Visual C/C++ version 9.0 + and Intel Fortran compilers installed on a lightly loaded Windows XP + system gives good results for the "all" target for the shared + library/dynamic device drivers case. That target just builds the + software. In addition, some run-time testing was done by hand with + no sign of any run-time trouble. + +* (Jerry Bauck) Mac OS X 10.6.8 (Snow Leopard) platform with Ada + bindings and good coverage of devices (e.g., qt and cairo) but + lightly loaded with regard to non-Ada bindings give fairly good + results for ctest and the test_noninteractive target for the shared + library/dynamic device drivers case. All tests passed including qt + and cairo device driver tests, but when looking at detailed results + some missing circular symbol issues were discovered for the pscairo + results. We don't understand this issue because the cairo devices + give both superb and reliable results on our Linux platforms. The + cairo device driver depends on a subset (e.g., pango and cairo) of + the GTK+ stack of libraries. These results were obtained for GTK+ + version 2.18.5. + +* (Werner Smekal) Mac OS X 10.7.1, XCode 4.1 platform that is lightly + loaded (e.g., GTK+ but no Qt4) gave mixed results for ctest and the + test_noninteractive target for the shared library/dynamic device + drivers case. The build worked without issues, and also everything + but cairo devices at run time. However, all cairo device results + had major run-time errors (e.g., segfaults). In this case the GTK+ + library was newer than we have tested before (version 2.24 from the + Homebrew packaging effort as compared to 2.21 that gives such good + results on Linux) so there may be a mismatch between our cairo + device driver and this newer version of GTK+ that needs to be sorted + out. + +1. Changes relative to PLplot 5.9.8 (the previous development release) + +No notable new features. This is a bug fix release. See the above +announcements. + +2. Changes relative to PLplot 5.8.0 (the previous stable release) + +2.1 All autotools-related files have now been removed + +CMake is now the only supported build system. It has been tested on +Linux / Unix, Mac OS-X and Windows platforms. + +2.2 Build system bug fixes + +Various fixes include the following: + +Ctest will now work correctly when the build tree path includes symlinks. + +Dependencies for swig generated files fixed so they are not rebuilt every +time make is called. + +Various dependency fixes to ensure that parallel builds (using make -j) +work under unix. + +2.3 Build system improvements + +We now transform link flag results delivered to the CMake environment by +pkg-config into the preferred CMake form of library information. The +practical effect of this improvement is that external libraries in +non-standard locations now have their rpath options set correctly for our +build system both for the build tree and the install tree so you don't have +to fiddle with LD_LIBRARY_PATH, etc. + +2.4 Implement build-system infrastructure for installed Ada bindings and +examples + +Install source files, library information files, and the plplotada library +associated with the Ada bindings. Configure and install the pkg-config file +for the plplotada library. Install the Ada examples and a configured Makefile +to build them in the install tree. + +2.5 Code cleanup + +The PLplot source code has been cleaned up to make consistent use of +(const char *) and (char *) throughout. Some API functions have changed +to use const char * instead of char * to make it clear that the strings +are not modified by the function. The C and C++ examples have been updated +consistent with this. These changes fix a large number of warnings +with gcc-4.2. Note: this should not require programs using PLplot to be +recompiled as it is not a binary API change. + +There has also been some cleanup of include files in the C++ examples +so the code will compile with the forthcoming gcc-4.3. + +2.6 Date / time labels for axes + +PLplot now allows date / time labels to be used on axes. A new option +('d') is available for the xopt and yopt arguments to plbox which +indicates that the axis should be interpreted as a date / time. Similarly +there is a new range of options for plenv to select date / time labels. +The time format is seconds since the epoch (usually 1 Jan 1970). This +format is commonly used on most systems. The C gmtime routine can be +used to calculate this for a given date and time. The format for the +labels is controlled using a new pltimefmt function, which takes a +format string. All formatting is done using the C strftime function. +See documentation for available options on your platform. Example 29 +demonstrates the new capabilities. + +N.B. Our reliance on C library POSIX time routines to (1) convert from +broken-down time to time-epoch, (2) to convert from time-epoch to +broken-down time, and (3) to format results with strftime have proved +problematic for non-C languages which have time routines of variable +quality. Also, it is not clear that even the POSIX time routines are +available on Windows. So we have plans afoot to implement high-quality +versions of (1), (2), and (3) with additional functions to get/set the epoch +in the PLplot core library itself. These routines should work on all C +platforms and should also be uniformly accessible for all our language +bindings. + +WARNING..... Therefore, assuming these plans are implemented, the present +part of our date/time PLplot API that uses POSIX time routines will be +changed. + +2.7 Alpha value support + +PLplot core has been modified to support a transparency or alpha value +channel for each color in color map 0 and 1. In addition a number of new +functions were added the PLplot API so that the user can both set and query +alpha values for color in the two color maps. These functions have the same +name as their non-alpha value equivalents, but with a an "a" added to the +end. Example 30 demonstrates some different ways to use these functions +and the effects of alpha values, at least for those drivers that support alpha +values. This change should have no effect on the device drivers that do not +currently support alpha values. Currently only the cairo, qt, gd, wxwidgets and +aquaterm drivers support alpha values. There are some limitations with the gd +driver due to transparency support in the underlying libgd library. + +2.8 New PLplot functions + +An enhanced version of plimage, plimagefr has been added. This allows images +to be plotted using coordinate transformation, and also for the dynamic range +of the plotted values to be altered. Example 20 has been modified to +demonstrate this new functionality. + +To ensure consistent results in example 21 between different platforms and +language bindings PLplot now includes a small random number generator within +the library. plrandd will return a PLFLT random number in the range 0.0-1.0. +plseed will allow the random number generator to be seeded. + +2.9 External libLASi library improvements affecting our psttf device + +Our psttf device depends on the libLASi library. libLASi-1.1.0 has just been +released at http://sourceforge.net/svn/?group_id=187113 . We recommend +using this latest version of libLASi for building PLplot and the psttf +device since this version of libLASi is more robust against glyph +information returned by pango/cairo/fontconfig that on rare occasions is not +suitable for use by libLASi. + +2.10 Improvements to the cairo driver family + +Jonathan Woithe improved the xcairo driver so that it can optionally be +used with an external user supplied X Drawable. This enables a nice +separation of graphing (PLplot) and window management (Gtk, etc..). Doug +Hunt fixed the bugs that broke the memcairo driver and it is now fully +functional. Additionally, a new extcairo driver was added that will plot +into a user supplied cairo context. + +2.11 wxWidgets driver improvements + +Complete reorganization of the driver code. A new backend was added, based +on the wxGraphicsContext class, which is available for wxWidgets 2.8.4 +and later. This backend produces antialized output similar to the +AGG backend but has no dependency on the AGG library. The basic wxDC +backend and the wxGraphicsContext backend process the text output +on their own, which results in much nicer plots than with the standard +Hershey fonts and is much faster than using the freetype library. New +options were introduced in the wxWidgets driver: + - backend: Choose backend: (0) standard, (1) using AGG library, + (2) using wxGraphicsContext + - hrshsym: Use Hershey symbol set (hrshsym=0|1) + - text: Use own text routines (text=0|1) + - freetype: Use FreeType library (freetype=0|1) +The option "text" changed its meaning, since it enabled the FreeType library +support, while now the option enables the driver's own text routines. + +Some other features were added: + * the wxWidgets driver now correctly clears the background (or parts of it) + * transparency support was added + * the "locate mode" (already available in the xwin and tk driver) was + implemented, where graphics input events are processed and translated + to world coordinates + +2.12 pdf driver improvements + +The pdf driver (which is based on the haru library http://www.libharu.org) +processes the text output now on its own. So far only the Adobe Type1 +fonts are supported. TrueType font support will follow. Full unicode +support will follow after the haru library will support unicode strings. The +driver is now able to produce A4, letter, A5 and A3 pages. The Hershey font +may be used only for symbols. Output can now be compressed, resulting in +much smaller file sizes. +Added new options: + - text: Use own text routines (text=0|1) + - compress: Compress pdf output (compress=0|1) + - hrshsym: Use Hershey symbol set (hrshsym=0|1) + - pagesize: Set page size (pagesize=A4|letter|A3|A5) + +2.13 svg driver improvements + +This device driver has had the following improvements: schema for generated +file now validates properly at http://validator.w3.org/ for the +automatically detected document type of SVG 1.1; -geometry option now works; +alpha channel transparency has been implemented; file familying for +multipage examples has been implemented; coordinate scaling has been +implemented so that full internal PLplot resolution is used; extraneous +whitespace and line endings that were being injected into text in error have +now been removed; and differential correction to string justification is now +applied. + +The result of these improvements is that our SVG device now gives the +best-looking results of all our devices. However, currently you must be +careful of which SVG viewer or editor you try because a number of them have +some bugs that need to be resolved. For example, there is a librsvg bug in +text placement (http://bugzilla.gnome.org/show_bug.cgi?id=525023) that +affects all svg use within GNOME as well as the ImageMagick "display" +application. However, at least the latest konqueror and firefox as well as +inkscape and scribus-ng (but not scribus!) give outstanding looking results +for files generated by our svg device driver. + +2.14 Ada language support + +We now have a complete Ada bindings implemented for PLplot. We also have a +complete set of our standard examples implemented in Ada which give results +that are identical with corresponding results for the C standard examples. +This is an excellent test of a large subset of the Ada bindings. We now +enable Ada by default for our users and request widespread testing of this +new feature. + +2.15 OCaml language support + +Thanks primarily to Hezekiah M. Carty's efforts we now have a complete OCaml +bindings implemented for PLplot. We also have a complete set of our standard +examples implemented in OCaml which give results that are identical with +corresponding results for the C standard examples. This is an excellent test +of a large subset of the OCaml bindings. We now enable OCaml by default for +our users and request widespread testing of this new feature. + +2.16 Perl/PDL language support + +Thanks to Doug Hunt's efforts the external Perl/PDL module, +PDL::Graphics::PLplot version 0.46 available at +http://search.cpan.org/dist/PDL-Graphics-PLplot has been brought up to date +to give access to recently added PLplot API. The instructions for how to +install this module on top of an official PDL release are given in +examples/perl/README.perldemos. Doug has also finished implementing a +complete set of standard examples in Perl/PDL which are part of PLplot and +which produce identical results to their C counterparts if the above updated +module has been installed. Our build system tests the version of +PDL::Graphics::PLplot that is available, and if it is not 0.46 or later, the +list of Perl/PDL examples that are run as part of our standard tests is +substantially reduced to avoid examples that use the new functionality. In +sum, if you use PDL::Graphics::PLplot version 0.46 or later the full +complement of PLplot commands is available to you from Perl/PDL, but +otherwise not. + +2.17 Updates to various language bindings + +A concerted effort has been made to bring all the language bindings up to +date with recently added functions. Ada, C++, f77, f95, Java, OCaml, Octave, +Perl/PDL, Python, and Tcl now all support the common PLplot API (with the +exception of the mapping functions which are not yet implemented for all +bindings due to technical issues.) This is a significant step forward for +those using languages other than C. + +2.18 Updates to various examples + +To help test the updates to the language bindings the examples have been +thoroughly checked. Ada, C, C++, f77, f95, and OCaml now contain a full set +of non-interactive tests (examples 1-31 excluding 14 and 17). Java, Octave, +Python and Tcl are missing example 19 because of the issue with the mapping +functions. The examples have also been checked to ensure consistent results +between different language bindings. Currently there are still some minor +differences in the results for the tcl examples, probably due to rounding +errors. Some of the Tcl examples (example 21) require Tcl version 8.5 for +proper support for NaNs. + +Also new is an option for the plplot_test.sh script to run the examples +using a debugging command. This is enabled using the --debug option. The +default it to use the valgrind memory checker. This has highlighted at +least one memory leaks in PLplot which have been fixed. It is not part +of the standard ctest tests because it can be _very_ slow for a complete +set of language bindings and device drivers. + +2.19 Extension of our test framework + +The standard test suite for PLplot now carries out a comparison of the +stdout output (especially important for example 31 which tests most of our +set and get functions) and PostScript output for different languages as a +check. Thanks to the addition of example 31, the inclusion of examples 14 +and 17 in the test suite and other recent extensions of the other +examples we now have rigourous testing in place for almost the entirety +of our common API. This extensive testing framework has already helped +us track down a number of bugs, and it should make it much easier for us +to maintain high quality for our ongoing PLplot releases. + +2.20 Rename test subdirectory to plplot_test + +This change was necessary to quit clashing with the "make test" target which +now works for the first time ever (by executing ctest). + +2.21 Website support files updated + +Our new website content is generated with PHP and uses CSS (cascaded style +sheets) to implement a consistent style. This new approach demanded lots of +changes in the website support files that are used to generate and upload +our website and which are automatically included with the release. + +2.22 Internal changes to function visibility + +The internal definitions of functions in PLplot have been significantly +tidied up to allow the use of the -fvisibility=hidden option with newer +versions of gcc. This prevents internal functions from being exported +to the user where possible. This extends the existing support for this +on windows. + +2.23 Dynamic driver support in Windows + +An interface based on the ltdl library function calls was established +which allows to open and close dynamic link libraries (DLL) during +run-time and call functions from these libraries. As a consequence +drivers can now be compiled into single DLLs separate from the core +PLplot DLL also in Windows. The cmake option ENABLE_DYNDRIVERS is now +ON by default for Windows if a shared PLplot library is built. + +2.24 Documentation updates + +The DocBook documentation has been updated to include many of the +C-specific functions (for example plAlloc2dGrid) which are not part +of the common API, but are used in the examples and may be helpful +for PLplot users. + +2.25 libnistcd (a.k.a. libcd) now built internally for -dev cgm + +CGM format is a long-established (since 1987) open standard for vector +graphics that is supported by w3c (see http://www.w3.org/Graphics/WebCGM/). +PLplot has long had a cgm device driver which depended on the (mostly) +public domain libcd library that was distributed in the mid 90's by National +Institute of Standards and Technology (NIST) and which is still available +from http://www.pa.msu.edu/ftp/pub/unix/cd1.3.tar.gz. As a convenience +to our -dev cgm users, we have brought that +source code in house under lib/nistcd and now build libnistcd routinely +as part of our ordinary builds. The only changes we have made to the +cd1.3 source code is visibility changes in cd.h and swapping the sense of +the return codes for the test executables so that 0 is returned on success +and 1 on failure. If you want to test libnistcd on your platform, +please run + +make test_nistcd + +in the top-level build tree. (That tests runs all the test executables +that are built as part of cd1.3 and compares the results that are generated +with the *.cgm files that are supplied as part of cd1.3.) + +Two applications that convert and/or display CGM results on Linux are +ralcgm (which is called by the ImageMagick convert and display applications) +and uniconvertor. + +Some additional work on -dev cgm is required to implement antialiasing and +non-Hershey fonts, but both those should be possible using libnistcd according +to the text that is shown by lib/nistcd/cdtext.cgm and lib/nistcd/cdexp1.cgm. + +2.26 get-drv-info now changed to test-drv-info + +To make cross-building much easier for PLplot we now configure the *.rc +files that are used to describe our various dynamic devices rather than +generating the required *.rc files with get-drv-info. We have changed the +name of get-drv-info to test-drv-info. That name is more appropriate +because that executable has always tested dynamic loading of the driver +plug-ins as well as generating the *.rc files from the information gleaned +from that dynamic loading. Now, we simply run test-drv-info as an option +(defaults to ON unless cross-building is enabled) and compare the resulting +*.rc file with the one configured by cmake to be sure the dynamic device +has been built correctly. + +2.27 Text clipping now enabled by default for the cairo devices + +When correct text clipping was first implemented for cairo devices, it was +discovered that the libcairo library of that era (2007-08) did that clipping +quite inefficiently so text clipping was disabled by default. Recent tests +of text clipping for the cairo devices using libcairo 1.6.4 (released in +2008-04) shows text clipping is quite efficient now. Therefore, it is now +enabled by default. If you notice a significant slowdown for some libcairo +version prior to 1.6.4 you can use the option -drvopt text_clipping=0 for +your cairo device plots (and accept the improperly clipped text results that +might occur with that option). Better yet, use libcairo 1.6.4 or later. + +2.28 A powerful qt device driver has been implemented + +Thanks to the efforts of Alban Rochel of the QSAS team, we now have a new qt +device driver which delivers the following 9 (!) devices: qtwidget, bmpqt, +jpgqt, pngqt, ppmqt, tiffqt, epsqt, pdfqt, and svgqt. qtwidget is an +elementary interactive device where, for now, the possible interactions +consist of resizing the window and right clicking with the mouse (or hitting +<return> to be consistent with other PLplot interactive devices) to control +paging. The qtwidget overall size is expressed in pixels. bmpqt, jpgqt, +pngqt, ppmqt, and tiffqt are file devices whose overall sizes are specified +in pixels and whose output is BMP (Windows bitmap), JPEG, PNG, PPM (portable +pixmap), and TIFF (tagged image file format) formatted files. epsqt, pdfqt, +svgqt are file devices whose overall sizes are specified in points (1/72 of +an inch) and whose output is EPS (encapsulated PostScript), PDF, and SVG +formatted files. The qt device driver is based on the powerful facilities +of Qt4 so all qt devices implement variable opacity (alpha channel) effects +(see example 30). The qt devices also use system unicode fonts, and deal +with CTL (complex text layout) languages automatically without any +intervention required by the user. (To show this, try qt device results +from examples 23 [mathematical symbols] and 24 [CTL languages].) + +Our exhaustive Linux testing of the qt devices (which consisted of detailed +comparisons for all our standard examples between qt device results and the +corresponding cairo device results) indicates this device driver is mature, +but testing on other platforms is requested to confirm that maturity. Qt-4.5 +(the version we used for most of our tests) has some essential SVG +functionality so we recommend that version (downloadable from +http://www.qtsoftware.com/downloads for Linux, Mac OS X, and Windows) for +svgqt. One of our developers found that pdfqt was orders of magnitude +slower than the other qt devices for Qt-4.4.3 on Ubuntu 8.10 installed on a +64 bit box. That problem was completely cured by moving to the downloadable +Qt-4.5 version. However, we have also had good Qt-4.4.3 pdfqt reports on +other platforms. One of our developers also found that all first pages of +examples were black for just the qtwidget device for Qt-4.5.1 on Mac OS X. +From the other improvements we see in Qt-4.5.1 relative to Qt-4.4.3 we +assume this black first page for qtwidget problem also exists for Qt-4.4.3, +but we haven't tested that combination. + +In sum, Qt-4.4.3 is worth trying if it is already installed on your machine, +but if you run into any difficulty with it please switch to Qt-4.5.x (once +Qt-4.5.x is installed all you have to do is to put the 4.5.x version of +qmake in your path, and cmake does the rest). If the problem persists for +Qt-4.5, then it is worth reporting a qt bug. + +2.29 The PLplot API is now accessible from Qt GUI applications + +This important new feature has been implemented by Alban Rochel of the QSAS +team as a spin-off of the qt device driver project using the extqt device +(which constitutes the tenth qt device). See examples/c++/README.qt_example +for a brief description of a simple Qt example which accesses the PLplot API +and which is built in the installed examples tree using the pkg-config +approach. Our build system has been enhanced to configure the necessary +plplotd-qt.pc file. + +2.30 NaN / Inf support for some PLplot functions + +Some PLplot now correctly handle Nan or Inf values in the data to be plotted. +Line plotting (plline etc) and image plotting (plimage, plimagefr) will +now ignore NaN / Inf values. Currently some of the contour plotting / 3-d +routines do not handle NaN / Inf values. This functionality will +depend on whether the language binding used supports NaN / Inf values. + +2.31 Various bug fixes + +Various bugs in the 5.9.3 release have been fixed including: + +- Include missing file needed for the aqt driver on Mac OS X +- Missing library version number for nistcd +- Fixes for the qt examples with dynamic drivers disabled +- Fixes to several tcl examples so they work with plserver +- Fix pkg-config files to work correctly with Debug / Release build types set +- Make Fortran command line argument parsing work with shared libraries on Windows + +2.32 Cairo driver improvements + +Improvements to the cairo driver to give better results for bitmap +formats when used with anti-aliasing file viewers. + +2.33 PyQt changes + +Years ago we got a donation of a hand-crafted pyqt3 interface to PLplot +(some of the functions in plplot_widgetmodule.c in bindings/python) and a +proof-of-concept example (prova.py and qplplot.py in examples/python), but +this code did not gain any developer interest and was therefore not +understood or maintained. Recently one of our core developers has +implemented a sip-generated pyqt4 interface to PLplot (controlled by +plplot_pyqt4.sip in bindings/qt_gui/pyqt4) that builds without problems as a +python extension module, and a good-looking pyqt4 example (pyqt4_example.py +in examples/python) that works well. Since this pyqt4 approach is +maintained by a PLplot developer it appears to have a good future, and we +have therefore decided to concentrate on pyqt4 and remove the pyqt3 PLplot +interface and example completely. + +2.34 Color Palettes + +Support has been added to PLplot for user defined color palette files. +These files can be loaded at the command line using the -cmap0 or +-cmap1 commands, or via the API using the plspal0 and plspal1 commands. +The commands cmap0 / plspal0 are used to load cmap0 type files which +specify the colors in PLplot's color table 0. The commands cmap1 / +plspal1 are used to load cmap1 type files which specify PLplot's color +table 1. Examples of both types of files can be found in either the +plplot-source/data directory or the PLplot installed directory +(typically /usr/local/share/plplotx.y.z/ on Linux). + +2.35 Reimplementation of a "soft landing" when a bad/missing compiler is +detected + +The PLplot core library is written in C so our CMake-based build system will +error out if it doesn't detect a working C compiler. However all other +compiled languages (Ada, C++, D, Fortran, Java, and OCaml) we support are +optional. If a working compiler is not available, we give a "soft landing" +(give a warning message, disable the optional component, and keep going). +The old implementation of the soft landing was not applied consistently (C++ +was unnecessarily mandatory before) and also caused problems for ccmake (a +CLI front-end to the cmake application) and cmake-gui (a CMake GUI front-end +to the cmake application) which incorrectly dropped languages as a result +even when there was a working compiler. + +We now have completely reimplemented the soft landing logic. The result +works well for cmake, ccmake, and cmake-gui. The one limitation of this new +method that we are aware of is it only recognizes either the default +compiler chosen by the generator or else a compiler specified by the +environment variable approach (see Official Notice XII above). Once CMake +bug 9220 has been fixed (so that the OPTIONAL signature of the +enable_language command actually works without erroring out), then our +soft-landing approach (which is a workaround for bug 9220) will be replaced +by the OPTIONAL signature of enable_language, and all CMake methods of +specifying compilers and compiler options will automatically be recognized +as a result. + +2.36 Make PLplot aware of LC_NUMERIC locale + +For POSIX-compliant systems, locale is set globally so any external +applications or libraries that use the PLplot library or any external +libraries used by the PLplot library or PLplot device drivers could +potentially change the LC_NUMERIC locale used by PLplot to anything those +external applications and libraries choose. The principal consequence of +such choice is the decimal separator could be a comma (for some locales) +rather than the period assumed for the "C" locale. For previous versions of +PLplot a comma decimal separator would have lead to a large number of +errors, but this issue is now addressed with a side benefit that our plots +now have the capability of displaying the comma (e.g., in axis labels) for +the decimal separator for those locales which require that. + +If you are not satisfied with the results for the default PLplot locale set +by external applications and libraries, then you can now choose the +LC_NUMERIC locale for PLplot by (a) specifying the new -locale command-line +option for PLplot (if you do not specify that option, a default locale is +chosen depending on applications and libraries external to PLplot (see +comments above), and (b) setting an environment variable (LC_ALL, +LC_NUMERIC, or LANG on Linux, for example) to some locale that has been +installed on your system. On Linux, to find what locales are installed, use +the "locale -a" option. The "C" locale is always installed, but usually +there is also a principal locale that works on a platform such as +en_US.UTF8, nl_NL.UTF8, etc. Furthermore, it is straightforward to build +and install any additional locale you desire. (For example, on Debian Linux +you do that by running "dpkg-reconfigure locales".) + +Normally, users will not use the -locale option since the period +decimal separator that you get for the normal LC_NUMERIC default "C" +locale used by external applications and libraries is fine for their needs. +However, if the resulting decimal separator is not what the user +wants, then they would do something like the following to (a) use a period +decimal separator for command-line input and plots: + +LC_ALL=C examples/c/x09c -locale -dev psc -o test.psc -ori 0.5 + +or (b) use a comma decimal separator for command-line input and plots: + +LC_ALL=nl_NL.UTF8 examples/c/x09c -locale -dev psc -o test.psc -ori 0,5 + +N.B. in either case if the wrong separator is used for input (e.g., -ori 0,5 +in the first case or -ori 0.5 in the second) the floating-point conversion +(using atof) is silently terminated at the wrong separator for the locale, +i.e., the fractional part of the number is silently dropped. This is +obviously not ideal, but on the other hand there are relatively few +floating-point command-line options for PLplot, and we also expect those who +use the -locale option to specifically ask for a given separator for plots +(e.g., axis labels) will then use it for command-line input of +floating-point values as well. + +Certain critical areas of the PLplot library (e.g., our colour palette file +reading routines and much of the code in our device drivers) absolutely +require a period for the decimal separator. We now protect those critical +areas by saving the normal PLplot LC_NUMERIC locale (established with the +above -locale option or by default by whatever is set by external +applications or libraries), setting the LC_NUMERIC "C" locale, executing the +critical code, then restoring back to the normal PLplot LC_NUMERIC locale. +Previous versions of PLplot did not have this protection of the critical +areas so were vulnerable to default LC_NUMERIC settings of external +applications that resulted in a comma decimal separator that did not work +correctly for the critical areas. + +2.37 Linear gradients have been implemented + +The new plgradient routine draws a linear gradient (based on the +current colour map 1) at a specified angle with the x axis for a +specified polygon. Standard examples 25 and 30 now demonstrate use of +plgradient. Some devices use a software fallback to render the +gradient. This fallback is implemented with plshades which uses a +series of rectangles to approximate the gradient. Tiny alignment +issues for those rectangles relative to the pixel grid may look +problematic for transparency gradients. To avoid that issue, we try +to use native gradient capability whenever that is possible for any of +our devices. Currently, this has been implemented for our svg, qt, +and cairo devices. The result is nice-looking smooth transparency +gradients for those devices, for, e.g., example 30, page 2. + +2.38 Cairo Windows driver implemented + +A cairo Windows driver has been implemented. This provides an +interactive cairo driver for Windows similar to xcairo on Linux. +Work to improve its functionality is ongoing. + +2.39 Custom axis labeling implemented + +Axis text labels can now be customized using the new plslabelfunc function. +This allows a user to specify what text should be draw at a given position +along a plot axis. Example 19 has been updated to illustrate this function's +use through labeling geographic coordinates in degrees North, South, East and +West. + +2.40 Universal coordinate transform implemented + +A custom coordinate transformation function can be set using plstransform. +This transformation function affects all subsequent plot function calls which +work with plot window coordinates. Testing and refinement of this support is +ongoing. + +2.41 Support for arbitrary storage of 2D user data + +This improvement courtesy of David MacMahon adds support for arbitrary +storage of 2D user data. This is very similar to the technique employed +by some existing functions (e.g. plfcont and plfshade) that use "evaluator" +functions to access 2D user data that is stored in an arbitrary format. +The new approach extends the concept of a user-supplied (or predefined) +"evaluator" function to a group of user-supplied (or predefined) "operator" +functions. The operator functions provide for various operations on the +arbitrarily stored 2D data including: get, set, +=, -=, *=, /=, isnan, +minmax, and f2eval. + +To facilitate the passing of an entire family of operator functions (via +function pointers), a plf2ops_t structure is defined to contain a +pointer to each type of operator function. Predefined operator +functions are defined for several common 2D data storage techniques. +Variables (of type plf2ops_t) containing function pointers for these +operator functions are also defined. + +New variants of functions that accept 2D data are created. The new +variants accept the 2D data as two parameters: a pointer to a plf2ops_t +structure containing (pointers to) suitable operator functions and a +PLPointer to the actual 2D data store. Existing functions that accept +2D data are modified to simply pass their parameters to the +corresponding new variant of the function, along with a pointer to the +suitable predefined plf2ops_t structure of operator function pointers. + +The list of functions for which new variants are created is: +c_plimage, c_plimagefr, c_plmesh, c_plmeshc, c_plot3d, c_plot3dc, +c_plot3dcl, c_plshade1, c_plshades, c_plsurf3d, and c_plsurf3dl, and +c_plgriddata. The new variants are named the same as their +corresponding existing function except that the "c_" prefix is changed +to "plf" (e.g. the new variant of c_plmesh is called plfmesh). + +Adds plfvect declaration to plplot.h and changes the names (and only the +names) of some plfvect arguments to make them slightly clearer. In +order to maintain backwards API compatibility, this function and the +other existing functions that use "evaluator" functions are NOT changed +to use the new operator functions. + +Makes plplot.h and libplplot consistent vis-a-vis pltr0f and pltr2d. +Moves the definitions of pltr2f (already declared in plplot.h) from the +sccont.c files of the FORTRAN 77 and Fortran 95 bindings into plcont.c. +Removes pltr0f declaration from plplot.h. + +Changes x08c.c to demonstrate use of new support for arbitrary storage +of 2D data arrays. Shows how to do surface plots with the following +four types of 2D data arrays: + +1) PLFLT z[nx][ny]; +2) PLfGrid2 z; +3) PLFLT z[nx*ny]; /* row major order */ +4) PLFLT z[nx*ny]; /* column major order */ + +2.42 Font improvements + +We have added the underscore to the Hershey glyphs (thanks to David +MacMahon) and slightly rearranged the ascii index to the Hershey +indices so that plpoin now generates the complete set of printable +ascii characters in the correct order for the Hershey fonts (and therefore +the Type1 and TrueType fonts as well). + +We have improved how we access TrueType and Type1 fonts via the Hershey +font index (used by plpoin, plsym, and the Hershey escape sequences in pl*tex +commands). We have added considerably to the Hershey index to Unicode index +translation table both for the compact and extended Hershey indexing scheme, +and we have adopted the standard Unicode to Type1 index translation tables +from http://unicode.org/Public/MAPPINGS/VENDORS/ADOBE/. + +We have also dropped the momentary switch to symbol font that was +implemented in the PLplot core library. That switch was designed to partially +compensate for the lack of symbol glyphs in the standard Type1 fonts. That +was a bad design because it affected TrueType font devices as well as +the desired Type1 font devices. To replace this bad idea we now +change from Type1 standard fonts to the Type1 Symbol font (and vice +versa) whenever there is a glyph lookup failure in the Type1 font +device drivers (ps and pdf). + +2.42 Alpha value support for plotting in memory. + +The function plsmema() was added to the PLplot API. This allows the user +to supply a RGBA formatted array that PLplot can use to do in memory +plotting with alpha value support. At present only the memcairo device +is capable of using RGBA formatted memory. The mem device, at least +for the time being, only supports RGB formatted memory and will exit +if the user attempts to give it RGBA formatted memory to plot in. + +2.43 Add a Qt device for in memory plotting. + +A new device called memqt has been added for in memory plotting using +Qt. This device is the Qt equivalent of the memcairo device. + +2.44 Add discrete legend capability. + +A new routine called pllegend has been added to our core C API. +(N.B. This is an experimental API that may be subject to further +change as we gain more experience with it.) This routine creates a +discrete plot legend with a plotted box, line, and/or line of symbols +for each annotated legend entry. The arguments of pllegend provide +control over the location and size of the legend within the current +subpage as well as the location and characteristics of the elements +(most of which are optional) within that legend. The resulting legend +is clipped at the boundaries of the current subpage + + +2.45 Add full bindings and examples for the D language. + +As of release 5.9.5 we added full bindings and examples for the D +language. The results for the D examples are generally consistent +with the corresponding C examples which helps to verify the D +bindings. + +Since the release of 5.9.5 it has come to our attention that the +version of gdc supplied with several recent versions of Ubuntu has a +very serious bug on 64-bit systems (see +https://bugs.launchpad.net/ubuntu/+source/gdc-4.2/+bug/235955) which +causes several of the plplot D examples to crash. If this affects you, +you are recommended to disable the d bindings or switch to an +alternative d compiler (the Digital Mars compiler is reported to be +good). + +2.46 The plstring and plstring3 functions have been added + +The plstring function largely supersedes plpoin and plsym +because many(!) more glyphs are accessible with plstring. The glyph +is specified with a PLplot user string. As with plmtex and plptex, +the user string can contain... [truncated message content] |
From: <ai...@us...> - 2011-10-13 21:45:54
|
Revision: 11958 http://plplot.svn.sourceforge.net/plplot/?rev=11958&view=rev Author: airwin Date: 2011-10-13 21:45:47 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Implement the list_example_files function to generate lists of files created by plplot-test.sh. Use that function to create complete OUTPUT files for the custom commands used for non-interactive testing. This change automatically assures "make clean" will remove essentially all plot file output generated by the test_noninteractive target. This should greatly reduce the disk space requirements of scripts/comprehensive_test.sh when the (default) --do_clean_as_you_go option is used for that script. ToDo: implement a custom target to use this same function to remove all ctest file output to reduce the disk requirements of scripts/comprehensive_test.sh some more. Modified Paths: -------------- trunk/cmake/modules/plplot.cmake trunk/examples/CMakeLists.txt Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2011-10-13 01:35:53 UTC (rev 11957) +++ trunk/cmake/modules/plplot.cmake 2011-10-13 21:45:47 UTC (rev 11958) @@ -46,6 +46,147 @@ # Useful functions go here. +function(list_example_files path device suffix output_list) + # Return list of files (with ${path}/ prepended to form the full path + # name for each file) that are generated by plplot-test.sh for a + # particular device and file suffix corresponding to front-end + # language. This list will be used for OUTPUT files of a custom + # command so that these files will be properly deleted by "make + # clean". Thus, it doesn't matter if we miss a few examples or + # pages that are only implemented for one of the languages. + # However, if we specify a file that is not generated by + # plplot-test.sh for the specified device and language, then that + # custom command is never satisfied and will continue to regenerate + # the files. Therefore only specify examples and pages that you + # _know_ are generated by all language bindings. + set(examples_pages_LIST + x01:01 + x02:02 + x03:01 + x04:02 + x05:01 + x06:05 + x07:20 + x08:08 + x09:05 + x10:01 + x11:08 + x12:01 + x13:01 + x14:02 + x14a:02 + x15:03 + x16:05 + x17:01 + x18:08 + x19:04 + x20:06 + x21:03 + x22:04 + x23:16 + x24:01 + x25:08 + x26:02 + x27:20 + x28:05 + x29:10 + x30:02 + x31:01 + # 32 missing deliberately since that only implemented for C + x33:04 + ) + + # This list taken directly from plplot-test.sh.cmake. Update as needed. + if( + ${device} STREQUAL "png" OR + ${device} STREQUAL "pngcairo" OR + ${device} STREQUAL "jpeg" OR + ${device} STREQUAL "xfig" OR + ${device} STREQUAL "svg" OR + ${device} STREQUAL "svgcairo" OR + ${device} STREQUAL "bmpqt" OR + ${device} STREQUAL "jpgqt" OR + ${device} STREQUAL "pngqt" OR + ${device} STREQUAL "ppmqt" OR + ${device} STREQUAL "tiffqt" OR + ${device} STREQUAL "svgqt" OR + ${device} STREQUAL "epsqt" OR + ${device} STREQUAL "pdfqt" OR + ${device} STREQUAL "gif" + ) + set(familying ON) + else( + ${device} STREQUAL "png" OR + ${device} STREQUAL "pngcairo" OR + ${device} STREQUAL "jpeg" OR + ${device} STREQUAL "xfig" OR + ${device} STREQUAL "svg" OR + ${device} STREQUAL "svgcairo" OR + ${device} STREQUAL "bmpqt" OR + ${device} STREQUAL "jpgqt" OR + ${device} STREQUAL "pngqt" OR + ${device} STREQUAL "ppmqt" OR + ${device} STREQUAL "tiffqt" OR + ${device} STREQUAL "svgqt" OR + ${device} STREQUAL "epsqt" OR + ${device} STREQUAL "pdfqt" OR + ${device} STREQUAL "gif" + ) + set(familying OFF) + endif( + ${device} STREQUAL "png" OR + ${device} STREQUAL "pngcairo" OR + ${device} STREQUAL "jpeg" OR + ${device} STREQUAL "xfig" OR + ${device} STREQUAL "svg" OR + ${device} STREQUAL "svgcairo" OR + ${device} STREQUAL "bmpqt" OR + ${device} STREQUAL "jpgqt" OR + ${device} STREQUAL "pngqt" OR + ${device} STREQUAL "ppmqt" OR + ${device} STREQUAL "tiffqt" OR + ${device} STREQUAL "svgqt" OR + ${device} STREQUAL "epsqt" OR + ${device} STREQUAL "pdfqt" OR + ${device} STREQUAL "gif" + ) + set(file_list) + + foreach(example_pages ${examples_pages_LIST}) + string(REGEX REPLACE "^(.*):.*$" "\\1" example ${example_pages}) + string(REGEX REPLACE "^.*:(.*)$" "\\1" pages ${example_pages}) + if(${suffix} STREQUAL "a") + string(REGEX REPLACE "^x" "xthick" thick_example ${example}) + else(${suffix} STREQUAL "a") + set(thick_example) + endif(${suffix} STREQUAL "a") + if(familying) + foreach(famnum RANGE 1 ${pages}) + if(famnum LESS 10) + set(famnum 0${famnum}) + endif(famnum LESS 10) + list(APPEND file_list ${path}/${example}${suffix}${famnum}.${device}) + if(thick_example) + list(APPEND file_list ${path}/${thick_example}${suffix}${famnum}.${device}) + endif(thick_example) + endforeach(famnum RANGE 1 ${pages}) + else(familying) + list(APPEND file_list ${path}/${example}${suffix}.${device}) + if(thick_example) + list(APPEND file_list ${path}/${thick_example}${suffix}.${device}) + endif(thick_example) + endif(familying) + if(NOT ${example} STREQUAL "x14a") + list(APPEND file_list ${path}/${example}${suffix}_${device}.txt) + if(thick_example) + list(APPEND file_list ${path}/${thick_example}${suffix}_${device}.txt) + endif(thick_example) + endif(NOT ${example} STREQUAL "x14a") + endforeach(example_pages ${examples_pages_LIST}) + + set(${output_list} ${file_list} PARENT_SCOPE) +endfunction(list_example_files ) + function(TRANSFORM_VERSION numerical_result version) # internal_version ignores everything in version after any character that # is not 0-9 or ".". This should take care of the case when there is Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2011-10-13 01:35:53 UTC (rev 11957) +++ trunk/examples/CMakeLists.txt 2011-10-13 21:45:47 UTC (rev 11958) @@ -410,8 +410,6 @@ set(compare_command ${CMAKE_CURRENT_SOURCE_DIR}/test_diff.sh) endif(CORE_BUILD) - # Pick a standard example to depend on which is available in all languages. - set(stdnum 01) if(PLD_psc) set(compare_file_depends ${custom_test_command}) if(ENABLE_DYNDRIVERS) @@ -466,18 +464,19 @@ set(environment ${custom_env}) endif(language STREQUAL "java") + list_example_files(${CMAKE_CURRENT_BINARY_DIR} psc ${suffix} output_list) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/x${stdnum}${suffix}.psc + OUTPUT ${output_list} COMMAND ${CMAKE_COMMAND} -E echo "Generate ${language} results for psc device" COMMAND env ${environment} ${custom_test_command} --verbose --front-end=${language} --device=psc DEPENDS ${compare_file_depends_${language}} VERBATIM ) add_custom_target(test_${language}_psc - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/x${stdnum}${suffix}.psc + DEPENDS ${output_list} ) list(APPEND diff_targets_LIST test_${language}_psc) - list(APPEND diff_files_LIST ${CMAKE_CURRENT_BINARY_DIR}/x${stdnum}${suffix}.psc) + list(APPEND diff_files_LIST ${output_list}) # If the subdirectory used an add_custom_target (as indicated # by both files_examples_${language} and targets_examples_${language} # being true), then for that special case must add a target-level @@ -537,16 +536,6 @@ string(REGEX REPLACE "^.*:(.*):.*$" "\\1" driver ${file_devices_info}) string(REGEX REPLACE "^.*:.*:(.*)$" "\\1" familied ${file_devices_info}) - # If familying turned on for this device in plplot-test.sh, then the OUTPUT - # files appear in the form x??c??.${device} rather than x??c.${device}. - # Put in a representative placeholder for the familying index in the - # OUTPUT name. - if(familied) - set(index 01) - else(familied) - set(index) - endif(familied) - set(file_device_depends_${device} ${device_depends}) if(ENABLE_DYNDRIVERS) get_property(FILE_DEPENDS_${driver} @@ -556,10 +545,10 @@ ${FILE_DEPENDS_${driver}} ${driver} ) endif(ENABLE_DYNDRIVERS) - #message("DEBUG: OUTPUT filename = x${stdnum}c${index}.${device}") #message("DEBUG:file_device_depends_${device} = ${file_device_depends_${device}}") + list_example_files(${CMAKE_CURRENT_BINARY_DIR} ${device} c output_list) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/x${stdnum}c${index}.${device} + OUTPUT ${output_list} COMMAND ${CMAKE_COMMAND} -E echo "Generate C results for ${device} file device" COMMAND env ${custom_env} ${custom_test_command} --verbose --front-end=c --device=${device} DEPENDS @@ -567,7 +556,7 @@ VERBATIM ) add_custom_target(test_c_${device} - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/x${stdnum}c${index}.${device} + DEPENDS ${output_list} ) list(APPEND noninteractive_targets_LIST test_c_${device}) # Follow what was done above. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-14 07:10:12
|
Revision: 11966 http://plplot.svn.sourceforge.net/plplot/?rev=11966&view=rev Author: andrewross Date: 2011-10-14 07:10:05 +0000 (Fri, 14 Oct 2011) Log Message: ----------- Number of cleanups to fix warnings with gcc -std=c99 -pedantic flags. Primarily includes - fixing missing / incomplete prototypes - avoiding local variables shadowing global variables - adding missing const attribute to char * Modified Paths: -------------- trunk/include/plfci-truetype.h trunk/include/plplot.h trunk/include/plplotP.h trunk/src/pdfutils.c trunk/src/plarc.c trunk/src/plargs.c trunk/src/plctrl.c trunk/src/plfill.c trunk/src/plgridd.c trunk/src/plimage.c trunk/src/pllegend.c trunk/src/plot3d.c Modified: trunk/include/plfci-truetype.h =================================================================== --- trunk/include/plfci-truetype.h 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/include/plfci-truetype.h 2011-10-14 07:10:05 UTC (rev 11966) @@ -26,34 +26,34 @@ // #define N_TrueTypeLookup 30 static const FCI_to_FontName_Table TrueTypeLookup[N_TrueTypeLookup] = { - { PL_FCI_MARK | 0x000, (unsigned char *) PL_FREETYPE_SANS }, - { PL_FCI_MARK | 0x001, (unsigned char *) PL_FREETYPE_SERIF }, - { PL_FCI_MARK | 0x002, (unsigned char *) PL_FREETYPE_MONO }, - { PL_FCI_MARK | 0x003, (unsigned char *) PL_FREETYPE_SCRIPT }, - { PL_FCI_MARK | 0x004, (unsigned char *) PL_FREETYPE_SYMBOL }, - { PL_FCI_MARK | 0x010, (unsigned char *) PL_FREETYPE_SANS_ITALIC }, - { PL_FCI_MARK | 0x011, (unsigned char *) PL_FREETYPE_SERIF_ITALIC }, - { PL_FCI_MARK | 0x012, (unsigned char *) PL_FREETYPE_MONO_ITALIC }, - { PL_FCI_MARK | 0x013, (unsigned char *) PL_FREETYPE_SCRIPT_ITALIC }, - { PL_FCI_MARK | 0x014, (unsigned char *) PL_FREETYPE_SYMBOL_ITALIC }, - { PL_FCI_MARK | 0x020, (unsigned char *) PL_FREETYPE_SANS_OBLIQUE }, - { PL_FCI_MARK | 0x021, (unsigned char *) PL_FREETYPE_SERIF_OBLIQUE }, - { PL_FCI_MARK | 0x022, (unsigned char *) PL_FREETYPE_MONO_OBLIQUE }, - { PL_FCI_MARK | 0x023, (unsigned char *) PL_FREETYPE_SCRIPT_OBLIQUE }, - { PL_FCI_MARK | 0x024, (unsigned char *) PL_FREETYPE_SYMBOL_OBLIQUE }, - { PL_FCI_MARK | 0x100, (unsigned char *) PL_FREETYPE_SANS_BOLD }, - { PL_FCI_MARK | 0x101, (unsigned char *) PL_FREETYPE_SERIF_BOLD }, - { PL_FCI_MARK | 0x102, (unsigned char *) PL_FREETYPE_MONO_BOLD }, - { PL_FCI_MARK | 0x103, (unsigned char *) PL_FREETYPE_SCRIPT_BOLD }, - { PL_FCI_MARK | 0x104, (unsigned char *) PL_FREETYPE_SYMBOL_BOLD }, - { PL_FCI_MARK | 0x110, (unsigned char *) PL_FREETYPE_SANS_BOLD_ITALIC }, - { PL_FCI_MARK | 0x111, (unsigned char *) PL_FREETYPE_SERIF_BOLD_ITALIC }, - { PL_FCI_MARK | 0x112, (unsigned char *) PL_FREETYPE_MONO_BOLD_ITALIC }, - { PL_FCI_MARK | 0x113, (unsigned char *) PL_FREETYPE_SCRIPT_BOLD_ITALIC }, - { PL_FCI_MARK | 0x114, (unsigned char *) PL_FREETYPE_SYMBOL_BOLD_ITALIC }, - { PL_FCI_MARK | 0x120, (unsigned char *) PL_FREETYPE_SANS_BOLD_OBLIQUE }, - { PL_FCI_MARK | 0x121, (unsigned char *) PL_FREETYPE_SERIF_BOLD_OBLIQUE }, - { PL_FCI_MARK | 0x122, (unsigned char *) PL_FREETYPE_MONO_BOLD_OBLIQUE }, - { PL_FCI_MARK | 0x123, (unsigned char *) PL_FREETYPE_SCRIPT_BOLD_OBLIQUE }, - { PL_FCI_MARK | 0x124, (unsigned char *) PL_FREETYPE_SYMBOL_BOLD_OBLIQUE } + { PL_FCI_MARK | 0x000, (const unsigned char *) PL_FREETYPE_SANS }, + { PL_FCI_MARK | 0x001, (const unsigned char *) PL_FREETYPE_SERIF }, + { PL_FCI_MARK | 0x002, (const unsigned char *) PL_FREETYPE_MONO }, + { PL_FCI_MARK | 0x003, (const unsigned char *) PL_FREETYPE_SCRIPT }, + { PL_FCI_MARK | 0x004, (const unsigned char *) PL_FREETYPE_SYMBOL }, + { PL_FCI_MARK | 0x010, (const unsigned char *) PL_FREETYPE_SANS_ITALIC }, + { PL_FCI_MARK | 0x011, (const unsigned char *) PL_FREETYPE_SERIF_ITALIC }, + { PL_FCI_MARK | 0x012, (const unsigned char *) PL_FREETYPE_MONO_ITALIC }, + { PL_FCI_MARK | 0x013, (const unsigned char *) PL_FREETYPE_SCRIPT_ITALIC }, + { PL_FCI_MARK | 0x014, (const unsigned char *) PL_FREETYPE_SYMBOL_ITALIC }, + { PL_FCI_MARK | 0x020, (const unsigned char *) PL_FREETYPE_SANS_OBLIQUE }, + { PL_FCI_MARK | 0x021, (const unsigned char *) PL_FREETYPE_SERIF_OBLIQUE }, + { PL_FCI_MARK | 0x022, (const unsigned char *) PL_FREETYPE_MONO_OBLIQUE }, + { PL_FCI_MARK | 0x023, (const unsigned char *) PL_FREETYPE_SCRIPT_OBLIQUE }, + { PL_FCI_MARK | 0x024, (const unsigned char *) PL_FREETYPE_SYMBOL_OBLIQUE }, + { PL_FCI_MARK | 0x100, (const unsigned char *) PL_FREETYPE_SANS_BOLD }, + { PL_FCI_MARK | 0x101, (const unsigned char *) PL_FREETYPE_SERIF_BOLD }, + { PL_FCI_MARK | 0x102, (const unsigned char *) PL_FREETYPE_MONO_BOLD }, + { PL_FCI_MARK | 0x103, (const unsigned char *) PL_FREETYPE_SCRIPT_BOLD }, + { PL_FCI_MARK | 0x104, (const unsigned char *) PL_FREETYPE_SYMBOL_BOLD }, + { PL_FCI_MARK | 0x110, (const unsigned char *) PL_FREETYPE_SANS_BOLD_ITALIC }, + { PL_FCI_MARK | 0x111, (const unsigned char *) PL_FREETYPE_SERIF_BOLD_ITALIC }, + { PL_FCI_MARK | 0x112, (const unsigned char *) PL_FREETYPE_MONO_BOLD_ITALIC }, + { PL_FCI_MARK | 0x113, (const unsigned char *) PL_FREETYPE_SCRIPT_BOLD_ITALIC }, + { PL_FCI_MARK | 0x114, (const unsigned char *) PL_FREETYPE_SYMBOL_BOLD_ITALIC }, + { PL_FCI_MARK | 0x120, (const unsigned char *) PL_FREETYPE_SANS_BOLD_OBLIQUE }, + { PL_FCI_MARK | 0x121, (const unsigned char *) PL_FREETYPE_SERIF_BOLD_OBLIQUE }, + { PL_FCI_MARK | 0x122, (const unsigned char *) PL_FREETYPE_MONO_BOLD_OBLIQUE }, + { PL_FCI_MARK | 0x123, (const unsigned char *) PL_FREETYPE_SCRIPT_BOLD_OBLIQUE }, + { PL_FCI_MARK | 0x124, (const unsigned char *) PL_FREETYPE_SYMBOL_BOLD_OBLIQUE } }; Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/include/plplot.h 2011-10-14 07:10:05 UTC (rev 11966) @@ -321,7 +321,7 @@ // Obsolete names #define plParseInternalOpts( a, b, c ) c_plparseopts( a, b, c ) -#define plSetInternalOpt( a, b ) plSetOpt( a, b ) +#define plSetInternalOpt( a, b ) c_plsetopt( a, b ) #endif // PL_DEPRECATED @@ -1038,7 +1038,7 @@ // Get the drawing mode PLDLLIMPEXP PLINT -c_plgdrawmode(); +c_plgdrawmode( void ); // Get FCI (font characterization integer) @@ -2068,7 +2068,7 @@ // PLDLLIMPEXP PLF2OPS -plf2ops_c(); +plf2ops_c( void ); // // Returns a pointer to a plf2ops_t stucture with pointers to functions for accessing 2-D data @@ -2077,7 +2077,7 @@ // PLDLLIMPEXP PLF2OPS -plf2ops_grid_c(); +plf2ops_grid_c( void ); // // Returns a pointer to a plf2ops_t stucture with pointers to functions for @@ -2089,7 +2089,7 @@ // PLDLLIMPEXP PLF2OPS -plf2ops_grid_row_major(); +plf2ops_grid_row_major( void ); // // Returns a pointer to a plf2ops_t stucture with pointers to functions for @@ -2101,7 +2101,7 @@ // PLDLLIMPEXP PLF2OPS -plf2ops_grid_col_major(); +plf2ops_grid_col_major( void ); // Function evaluators (Should these be deprecated in favor of plf2ops?) Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/include/plplotP.h 2011-10-14 07:10:05 UTC (rev 11966) @@ -845,7 +845,7 @@ // Get the date / time format for numeric labels const char * -plP_gtimefmt(); +plP_gtimefmt( void ); // Computes the length of a string in mm, including escape sequences. @@ -1117,7 +1117,7 @@ grimage( short *x, short *y, unsigned short *z, PLINT nx, PLINT ny ); PLDLLIMPEXP int -plInBuildTree(); +plInBuildTree( void ); void plimageslow( PLFLT *idata, PLINT nx, PLINT ny, @@ -1154,7 +1154,7 @@ typedef struct { PLUNICODE fci; - unsigned char *pfont; + const unsigned char *pfont; } FCI_to_FontName_Table; // Internal function to obtain a pointer to a valid font name. @@ -1165,7 +1165,7 @@ // Internal function to free memory from driver options void -plP_FreeDrvOpts(); +plP_FreeDrvOpts( void ); // Convert a ucs4 unichar to utf8 char string PLDLLIMPEXP int Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/src/pdfutils.c 2011-10-14 07:10:05 UTC (rev 11966) @@ -774,7 +774,7 @@ { double fdbl, fmant, f_new; float fsgl, f_tmp; - int istat, exp, e_new, e_off, bias = 127; + int istat, ex, e_new, e_off, bias = 127; U_LONG value, s_ieee, e_ieee, f_ieee; if ( f == 0.0 ) @@ -784,7 +784,7 @@ } fdbl = f; fsgl = (float) fdbl; - fmant = frexp( fdbl, &exp ); + fmant = frexp( fdbl, &ex ); if ( fmant < 0 ) s_ieee = 1; @@ -793,7 +793,7 @@ fmant = fabs( fmant ); f_new = 2 * fmant; - e_new = exp - 1; + e_new = ex - 1; if ( e_new < 1 - bias ) { @@ -843,7 +843,7 @@ { double f_new, f_tmp; float fsgl; - int istat, exp, bias = 127; + int istat, ex, bias = 127; U_LONG value, s_ieee, e_ieee, f_ieee; if ( ( istat = pdf_rd_4bytes( pdfs, &value ) ) ) @@ -857,16 +857,16 @@ if ( e_ieee == 0 ) { - exp = 1 - bias; + ex = 1 - bias; f_new = f_tmp; } else { - exp = (int) e_ieee - bias; + ex = (int) e_ieee - bias; f_new = 1.0 + f_tmp; } - fsgl = (float) ( f_new * pow( 2.0, (double) exp ) ); + fsgl = (float) ( f_new * pow( 2.0, (double) ex ) ); if ( s_ieee == 1 ) fsgl = -fsgl; @@ -981,7 +981,7 @@ //-------------------------------------------------------------------------- void -plMinMax2dGrid( const PLFLT **f, PLINT nx, PLINT ny, PLFLT *fmax, PLFLT *fmin ) +plMinMax2dGrid( const PLFLT **f, PLINT nx, PLINT ny, PLFLT *fnmax, PLFLT *fnmin ) { int i, j; PLFLT m, M; @@ -1006,6 +1006,6 @@ m = f[i][j]; } } - *fmax = M; - *fmin = m; + *fnmax = M; + *fnmin = m; } Modified: trunk/src/plarc.c =================================================================== --- trunk/src/plarc.c 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/src/plarc.c 2011-10-14 07:10:05 UTC (rev 11966) @@ -24,6 +24,8 @@ #define CIRCLE_SEGMENTS ( PL_MAXPOLY - 1 ) #define DEG_TO_RAD( x ) ( ( x ) * M_PI / 180.0 ) +void plarc_approx( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, PLFLT rotate, PLBOOL fill ); + //-------------------------------------------------------------------------- // plarc_approx : Plot an approximated arc with a series of lines // Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/src/plargs.c 2011-10-14 07:10:05 UTC (rev 11966) @@ -113,6 +113,10 @@ static void Help( void ); static void Syntax( void ); +#ifndef PL_DEPRECATED +int plSetOpt( const char *opt, const char *optarg ); +#endif + // Option handlers static int opt_h( const char *, const char *, void * ); @@ -720,13 +724,13 @@ //-------------------------------------------------------------------------- int -c_plsetopt( const char *opt, const char *optarg ) +plSetOpt( const char *opt, const char *optarg ) { - return ( plSetOpt( opt, optarg ) ); + return ( c_plsetopt( opt, optarg ) ); } int -plSetOpt( const char *opt, const char *optarg ) +c_plsetopt( const char *opt, const char *optarg ) { int mode = 0, argc = 2, status; const char *argv[3]; @@ -1112,7 +1116,7 @@ // Set var (can be NULL initially) to point to optarg string - *(char **) tab->var = (char *) optarg; + *(char **) tab->var = (const char *) optarg; break; default: @@ -2414,7 +2418,7 @@ opt_locale( const char *opt, const char *optarg, void *client_data ) { char *locale; - if ( locale = setlocale( LC_NUMERIC, "" ) ) + if ( ( locale = setlocale( LC_NUMERIC, "" ) ) ) { printf( "LC_NUMERIC locale set to \"%s\"\n", locale ); } Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/src/plctrl.c 2011-10-14 07:10:05 UTC (rev 11966) @@ -70,7 +70,7 @@ char PLDLLIMPEXP * plplotLibDir = 0; static void -color_set( PLINT i, U_CHAR r, U_CHAR g, U_CHAR b, PLFLT a, char *name ); +color_set( PLINT i, U_CHAR r, U_CHAR g, U_CHAR b, PLFLT a, const char *name ); static void strcat_delim( char *dirspec ); @@ -95,7 +95,9 @@ static void cmap0_palette_read( const char *filename, - int *number_colors, int **r, int **g, int **b, double **a ); + int *number_colors, unsigned int **r, unsigned int **g, + unsigned int **b, double **a ); + // An additional hardwired location for lib files. // I have no plans to change these again, ever. @@ -905,7 +907,7 @@ //-------------------------------------------------------------------------- void -color_set( PLINT i, U_CHAR r, U_CHAR g, U_CHAR b, PLFLT a, char *name ) +color_set( PLINT i, U_CHAR r, U_CHAR g, U_CHAR b, PLFLT a, const char *name ) { plsc->cmap0[i].r = r; plsc->cmap0[i].g = g; @@ -927,14 +929,15 @@ void plcmap0_def( int imin, int imax ) { - int i, *r, *g, *b; + int i; + unsigned int *r, *g, *b; double *a; int number_colors; if ( imin <= imax ) { cmap0_palette_read( "", &number_colors, &r, &g, &b, &a ); for ( i = imin; i <= MIN( ( number_colors - 1 ), imax ); i++ ) - color_def( i, r[i], g[i], b[i], a[i], + color_def( i, (PLINT) r[i], (PLINT) g[i], (PLINT) b[i], a[i], "colors defined by default cmap0 palette file" ); free( r ); free( g ); @@ -1278,7 +1281,7 @@ void cmap0_palette_read( const char *filename, - int *number_colors, int **r, int **g, int **b, double **a ) + int *number_colors, unsigned int **r, unsigned int **g, unsigned int **b, double **a ) { int i, err = 0; char color_info[COLLEN]; @@ -1318,9 +1321,9 @@ { // Allocate arrays to hold r, g, b, and a data for calling routine. // The caller must free these after it is finished with them. - if ( ( ( *r = (int *) malloc( *number_colors * sizeof ( int ) ) ) == NULL ) || - ( ( *g = (int *) malloc( *number_colors * sizeof ( int ) ) ) == NULL ) || - ( ( *b = (int *) malloc( *number_colors * sizeof ( int ) ) ) == NULL ) || + if ( ( ( *r = (unsigned int *) malloc( *number_colors * sizeof ( unsigned int ) ) ) == NULL ) || + ( ( *g = (unsigned int *) malloc( *number_colors * sizeof ( unsigned int ) ) ) == NULL ) || + ( ( *b = (unsigned int *) malloc( *number_colors * sizeof ( unsigned int ) ) ) == NULL ) || ( ( *a = (double *) malloc( *number_colors * sizeof ( double ) ) ) == NULL ) ) { fclose( fp ); @@ -1339,7 +1342,8 @@ if ( strlen( color_info ) == 7 ) { if ( sscanf( color_info, "#%2x%2x%2x", - (int *) ( *r + i ), (int *) ( *g + i ), (int *) ( *b + i ) ) != 3 ) + (unsigned int *) ( *r + i ), (unsigned int *) ( *g + i ), + (unsigned int *) ( *b + i ) ) != 3 ) { err = 1; break; @@ -1349,8 +1353,8 @@ else if ( strlen( color_info ) > 9 ) { if ( sscanf( color_info, "#%2x%2x%2x %lf", - (int *) ( *r + i ), (int *) ( *g + i ), (int *) ( *b + i ), - (double *) ( *a + i ) ) != 4 ) + (unsigned int *) ( *r + i ), (unsigned int *) ( *g + i ), + (unsigned int *) ( *b + i ), (double *) ( *a + i ) ) != 4 ) { err = 1; break; @@ -1393,9 +1397,9 @@ if ( err ) { *number_colors = 16; - if ( ( ( *r = (int *) malloc( *number_colors * sizeof ( int ) ) ) == NULL ) || - ( ( *g = (int *) malloc( *number_colors * sizeof ( int ) ) ) == NULL ) || - ( ( *b = (int *) malloc( *number_colors * sizeof ( int ) ) ) == NULL ) || + if ( ( ( *r = (unsigned int *) malloc( *number_colors * sizeof ( int ) ) ) == NULL ) || + ( ( *g = (unsigned int *) malloc( *number_colors * sizeof ( unsigned int ) ) ) == NULL ) || + ( ( *b = (unsigned int *) malloc( *number_colors * sizeof ( unsigned int ) ) ) == NULL ) || ( ( *a = (double *) malloc( *number_colors * sizeof ( double ) ) ) == NULL ) ) { plexit( "cmap0_palette_read: insufficient memory" ); @@ -1426,7 +1430,8 @@ void c_plspal0( const char *filename ) { - int i, *r, *g, *b; + int i; + unsigned int *r, *g, *b; double *a; int number_colors; cmap0_palette_read( filename, &number_colors, &r, &g, &b, &a ); @@ -1440,7 +1445,7 @@ } for ( i = 0; i < number_colors; i++ ) { - c_plscol0a( i, r[i], g[i], b[i], a[i] ); + c_plscol0a( i, (PLINT) r[i], (PLINT) g[i], (PLINT) b[i], a[i] ); } free( r ); free( g ); @@ -1478,7 +1483,8 @@ int format_version, err; PLBOOL rgb; char color_info[PALLEN]; - int r_i, g_i, b_i, pos_i, rev_i; + unsigned int r_i, g_i, b_i; + int pos_i, rev_i; double r_d, g_d, b_d, a_d, pos_d; PLFLT *r, *g, *b, *a, *pos; PLINT *ri, *gi, *bi; @@ -1560,7 +1566,7 @@ if ( format_version == 0 ) { - int return_sscanf, return_sscanf_old = 0; + int return_sscanf = -1, return_sscanf_old = 0; // Old tk file format for ( i = 0; i < number_colors; i++ ) { @@ -2189,7 +2195,6 @@ { int n; char buf[PLPLOT_MAX_PATH], *cp; - extern int errno; struct stat sbuf; pldebug( "plFindName", "Trying to find %s\n", p ); Modified: trunk/src/plfill.c =================================================================== --- trunk/src/plfill.c 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/src/plfill.c 2011-10-14 07:10:05 UTC (rev 11966) @@ -1599,7 +1599,7 @@ { i1intersect[ncrossed] = i1; if ( ncrossed_change == 2 ) - ; + ; i1intersect[1] = i1; ncrossed += ncrossed_change; Modified: trunk/src/plgridd.c =================================================================== --- trunk/src/plgridd.c 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/src/plgridd.c 2011-10-14 07:10:05 UTC (rev 11966) @@ -62,7 +62,7 @@ static void grid_nni( const PLFLT *x, const PLFLT *y, const PLFLT *z, int npts, const PLFLT *xg, int nptsx, const PLFLT *yg, int nptsy, - PLF2OPS zops, PLPointer zgp, PLFLT wmin ); + PLF2OPS zops, PLPointer zgp, PLFLT wtmin ); static void grid_dtli( const PLFLT *x, const PLFLT *y, const PLFLT *z, int npts, @@ -645,7 +645,7 @@ static void grid_nni( const PLFLT *x, const PLFLT *y, const PLFLT *z, int npts, const PLFLT *xg, int nptsx, const PLFLT *yg, int nptsy, PLF2OPS zops, PLPointer zgp, - PLFLT wmin ) + PLFLT wtmin ) { PLFLT *xt, *yt, *zt; point *pin, *pgrid, *pt; @@ -658,10 +658,10 @@ return; } - if ( wmin == 0. ) // only accept weights greater than wmin + if ( wtmin == 0. ) // only accept weights greater than wtmin { - plwarn( "plgriddata(): GRID_NNI: wmin must be specified with 'data' arg. Using -PLFLT_MAX" ); - wmin = -PLFLT_MAX; + plwarn( "plgriddata(): GRID_NNI: wtmin must be specified with 'data' arg. Using -PLFLT_MAX" ); + wtmin = -PLFLT_MAX; } if ( ( pin = (point *) malloc( npts * sizeof ( point ) ) ) == NULL ) @@ -702,7 +702,7 @@ yt++; } - nnpi_interpolate_points( npts, pin, wmin, nptsg, pgrid ); + nnpi_interpolate_points( npts, pin, wtmin, nptsg, pgrid ); for ( i = 0; i < nptsx; i++ ) { for ( j = 0; j < nptsy; j++ ) Modified: trunk/src/plimage.c =================================================================== --- trunk/src/plimage.c 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/src/plimage.c 2011-10-14 07:10:05 UTC (rev 11966) @@ -56,25 +56,28 @@ plP_esc( PLESC_IMAGEOPS, &op ); } -void -disabledisplay() -{ - PLINT op = ZEROW2D; +// +// Unused functions - comment out +// +//void +//disabledisplay() +//{ +// PLINT op = ZEROW2D; +// +// plP_esc( PLESC_IMAGEOPS, &op ); +//} +// +//void +//enabledisplay() +//{ +// PLINT op = ONEW2D; +// +// plP_esc( PLESC_IMAGEOPS, &op ); +// plP_esc( PLESC_EXPOSE, NULL ); +//} +// - plP_esc( PLESC_IMAGEOPS, &op ); -} -void -enabledisplay() -{ - PLINT op = ONEW2D; - - plP_esc( PLESC_IMAGEOPS, &op ); - plP_esc( PLESC_EXPOSE, NULL ); -} - - - // // NOTE: The plshade* functions require that both pltr and pltr_data are set // in order for pltr to be used. plimageslow does NOT require this, so it is Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/src/pllegend.c 2011-10-14 07:10:05 UTC (rev 11966) @@ -905,8 +905,8 @@ //! @param characters Null-terminated string consisting of ascii characters //! to be removed from string. -void -static remove_characters( char *string, const char *characters ) +static void +remove_characters( char *string, const char *characters ) { size_t length = strlen( string ); size_t prefix_length = strcspn( string, characters ); @@ -941,8 +941,8 @@ //! @param color Color (color palette 1) used to fill the end cap. //! -void -static draw_cap( PLBOOL if_edge, PLINT orientation, PLFLT xmin, PLFLT xmax, +static void +draw_cap( PLBOOL if_edge, PLINT orientation, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT color ) { // Save current drawing color. Modified: trunk/src/plot3d.c =================================================================== --- trunk/src/plot3d.c 2011-10-14 07:07:52 UTC (rev 11965) +++ trunk/src/plot3d.c 2011-10-14 07:10:05 UTC (rev 11966) @@ -69,8 +69,8 @@ static void savelopoint( PLINT, PLINT ); static void swaphiview( void ); static void swaploview( void ); -static void myexit( char * ); -static void myabort( char * ); +static void myexit( const char * ); +static void myabort( const char * ); static void freework( void ); static int plabv( PLINT, PLINT, PLINT, PLINT, PLINT, PLINT ); static void pl3cut( PLINT, PLINT, PLINT, PLINT, PLINT, @@ -2644,7 +2644,7 @@ //-------------------------------------------------------------------------- static void -myexit( char *msg ) +myexit( const char *msg ) { freework(); plexit( msg ); @@ -2658,7 +2658,7 @@ //-------------------------------------------------------------------------- static void -myabort( char *msg ) +myabort( const char *msg ) { freework(); plabort( msg ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-10-14 08:30:26
|
Revision: 11970 http://plplot.svn.sourceforge.net/plplot/?rev=11970&view=rev Author: airwin Date: 2011-10-14 08:30:19 +0000 (Fri, 14 Oct 2011) Log Message: ----------- Style previous changes. ctest shows no obvious issues with these changes (and Andrew's previous compiler warning fix changes). Modified Paths: -------------- trunk/drivers/svg.c trunk/examples/c/x11c.c trunk/examples/c/x14c.c trunk/examples/c/x16c.c trunk/examples/c/x19c.c trunk/examples/c/x21c.c trunk/examples/c/x22c.c trunk/examples/c/x23c.c trunk/examples/c/x26c.c trunk/examples/c/x27c.c trunk/examples/c/x28c.c trunk/examples/c/x29c.c trunk/examples/c/x33c.c trunk/examples/c/x34c.c trunk/examples/c++/x19.cc trunk/examples/c++/x27.cc trunk/examples/c++/x29.cc trunk/include/ltdl_win32.h trunk/include/plplotP.h trunk/lib/csa/csa.c trunk/lib/csa/csa.h trunk/lib/nn/nnai.c trunk/lib/nn/nnpi.c trunk/lib/qsastime/deltaT-gen.c trunk/lib/qsastime/qsastime.c trunk/src/ltdl_win32.c trunk/src/pdfutils.c trunk/src/plctrl.c trunk/src/plfill.c trunk/src/pllegend.c Modified: trunk/drivers/svg.c =================================================================== --- trunk/drivers/svg.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/drivers/svg.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -940,10 +940,10 @@ void svg_attr_values( SVG *aStream, const char *attribute, const char *format, ... ) { - va_list ap; - const char *p, *sval; - int ival; - double dval; + va_list ap; + const char *p, *sval; + int ival; + double dval; svg_indent( aStream ); fprintf( aStream->svgFile, "%s=\"", attribute ); Modified: trunk/examples/c/x11c.c =================================================================== --- trunk/examples/c/x11c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x11c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -27,12 +27,12 @@ #define YPTS 46 // Data points in y #define LEVELS 10 -static int opt[] = { DRAW_LINEXY, DRAW_LINEXY }; +static int opt[] = { DRAW_LINEXY, DRAW_LINEXY }; -static PLFLT alt[] = { 33.0, 17.0 }; -static PLFLT az[] = { 24.0, 115.0 }; +static PLFLT alt[] = { 33.0, 17.0 }; +static PLFLT az[] = { 24.0, 115.0 }; -static const char *title[4] = +static const char *title[4] = { "#frPLplot Example 11 - Alt=33, Az=24, Opt=3", "#frPLplot Example 11 - Alt=17, Az=115, Opt=3", Modified: trunk/examples/c/x14c.c =================================================================== --- trunk/examples/c/x14c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x14c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -359,7 +359,7 @@ for ( i = 0; i <= 360; i++ ) { - r = sin( dtr * ( 5 * i ) ); + r = sin( dtr * ( 5 * i ) ); x1[i] = x0[i] * r; y1[i] = y0[i] * r; } Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x16c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -166,7 +166,7 @@ // Allocate data structures clevel = (PLFLT *) calloc( (size_t) ns, sizeof ( PLFLT ) ); - shedge = (PLFLT *) calloc( (size_t) (ns + 1), sizeof ( PLFLT ) ); + shedge = (PLFLT *) calloc( (size_t) ( ns + 1 ), sizeof ( PLFLT ) ); xg1 = (PLFLT *) calloc( (size_t) nx, sizeof ( PLFLT ) ); yg1 = (PLFLT *) calloc( (size_t) ny, sizeof ( PLFLT ) ); Modified: trunk/examples/c/x19c.c =================================================================== --- trunk/examples/c/x19c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x19c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -44,7 +44,7 @@ // "Normalize" longitude values so that they always fall between -180.0 and // 180.0 -PLFLT +PLFLT normalize_longitude( PLFLT lon ) { PLFLT times; Modified: trunk/examples/c/x21c.c =================================================================== --- trunk/examples/c/x21c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x21c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -152,19 +152,19 @@ int main( int argc, const char *argv[] ) { - PLFLT *x, *y, *z, *clev; - PLFLT *xg, *yg, **zg; - PLFLT zmin, zmax, lzm, lzM; - int i, j, k; - PLINT alg; - const char *title[] = { "Cubic Spline Approximation", - "Delaunay Linear Interpolation", - "Natural Neighbors Interpolation", - "KNN Inv. Distance Weighted", - "3NN Linear Interpolation", - "4NN Around Inv. Dist. Weighted" }; + PLFLT *x, *y, *z, *clev; + PLFLT *xg, *yg, **zg; + PLFLT zmin, zmax, lzm, lzM; + int i, j, k; + PLINT alg; + const char *title[] = { "Cubic Spline Approximation", + "Delaunay Linear Interpolation", + "Natural Neighbors Interpolation", + "KNN Inv. Distance Weighted", + "3NN Linear Interpolation", + "4NN Around Inv. Dist. Weighted" }; - PLFLT opt[] = { 0., 0., 0., 0., 0., 0. }; + PLFLT opt[] = { 0., 0., 0., 0., 0., 0. }; xm = ym = -0.2; xM = yM = 0.6; Modified: trunk/examples/c/x22c.c =================================================================== --- trunk/examples/c/x22c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x22c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -169,7 +169,7 @@ -void +void f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fnmin, PLFLT *fnmax ) { int i, j; @@ -190,7 +190,7 @@ // // Vector plot of the gradient of a shielded potential (see example 9) // -void +void potential( void ) { #if !defined ( WIN32 ) Modified: trunk/examples/c/x23c.c =================================================================== --- trunk/examples/c/x23c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x23c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -38,7 +38,7 @@ "#gn", "#gc", "#go", "#gp", "#gr", "#gs", "#gt", "#gu", "#gf", "#gx", "#gq", "#gw", }; -static int Type1[] = { +static int Type1[] = { 0x0020, 0x0021, 0x0023, 0x0025, 0x0026, 0x0028, 0x0029, 0x002b, 0x002c, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, @@ -89,7 +89,7 @@ "#<0x10>PLplot Example 23 - Mathematical Operators Unicode Block (d)", }; -static int lo[] = { +static int lo[] = { 0x0, 0x0, 0x40, @@ -103,7 +103,7 @@ 0x22c0, }; -static int hi[] = { +static int hi[] = { 0x30, 0x40, 0x80, @@ -117,7 +117,7 @@ 0x2300, }; -static int nxcells[] = { +static int nxcells[] = { 12, 8, 8, @@ -131,7 +131,7 @@ 8, }; -static int nycells[] = { +static int nycells[] = { 8, 8, 8, Modified: trunk/examples/c/x26c.c =================================================================== --- trunk/examples/c/x26c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x26c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -100,8 +100,8 @@ NULL }; -void plot1( int type, const char *x_label, const char *y_label, - const char *alty_label, const char * legend_text[], +void plot1( int type, const char *x_label, const char *y_label, + const char *alty_label, const char * legend_text[], const char *title_label, const char *line_label ); //-------------------------------------------------------------------------- Modified: trunk/examples/c/x27c.c =================================================================== --- trunk/examples/c/x27c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x27c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -48,15 +48,15 @@ // N.B. N is just a place holder since it is no longer used // (because we now have proper termination of the angle loop). PLFLT params[9][4] = { - { 21.0, 7.0, 7.0, 3.0} , // Deltoid - { 21.0, 7.0, 10.0, 3.0} , - { 21.0, -7.0, 10.0, 3.0} , - { 20.0, 3.0, 7.0, 20.0} , - { 20.0, 3.0, 10.0, 20.0} , - { 20.0, -3.0, 10.0, 20.0} , - { 20.0, 13.0, 7.0, 20.0} , - { 20.0, 13.0, 20.0, 20.0} , - { 20.0, -13.0, 20.0, 20.0} + { 21.0, 7.0, 7.0, 3.0 }, // Deltoid + { 21.0, 7.0, 10.0, 3.0 }, + { 21.0, -7.0, 10.0, 3.0 }, + { 20.0, 3.0, 7.0, 20.0 }, + { 20.0, 3.0, 10.0, 20.0 }, + { 20.0, -3.0, 10.0, 20.0 }, + { 20.0, 13.0, 7.0, 20.0 }, + { 20.0, 13.0, 20.0, 20.0 }, + { 20.0, -13.0, 20.0, 20.0 } }; int i; @@ -175,7 +175,7 @@ // Proper termination of the angle loop very near the beginning // point, see // http://mathforum.org/mathimages/index.php/Hypotrochoid. - windings = (PLINT) (abs( params[1] ) / gcd( (PLINT) params[0], (PLINT) params[1] )); + windings = (PLINT) ( abs( params[1] ) / gcd( (PLINT) params[0], (PLINT) params[1] ) ); steps = NPNT / windings; dphi = 2.0 * PI / (PLFLT) steps; Modified: trunk/examples/c/x28c.c =================================================================== --- trunk/examples/c/x28c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x28c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -61,8 +61,8 @@ PLFLT radius, pitch, xpos, ypos, zpos; // p1string must be exactly one character + the null termination // character. - char p1string[] = "O"; - const char *pstring = "The future of our civilization depends on software freedom."; + char p1string[] = "O"; + const char *pstring = "The future of our civilization depends on software freedom."; // Allocate and define the minimal x, y, and z to insure 3D box x = (PLFLT *) calloc( XPTS, sizeof ( PLFLT ) ); y = (PLFLT *) calloc( YPTS, sizeof ( PLFLT ) ); Modified: trunk/examples/c/x29c.c =================================================================== --- trunk/examples/c/x29c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x29c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -365,7 +365,7 @@ plbox( "bcnstd", xlabel_step, 0, "bcnstv", 0., 0 ); plcol0( 3 ); strncpy( title, "@frPLplot Example 29 - TAI-UTC ", 100 ); - strncat( title, title_suffix, 100 - strlen(title) ); + strncat( title, title_suffix, 100 - strlen( title ) ); pllab( xtitle, "TAI-UTC (sec)", title ); plcol0( 4 ); Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x33c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -299,25 +299,25 @@ int main( int argc, const char *argv[] ) { - int i, k; - PLINT opt; - PLINT nlegend, nturn; - PLINT opt_array[MAX_NLEGEND]; - PLINT text_colors[MAX_NLEGEND]; - PLINT box_colors[MAX_NLEGEND]; - PLINT box_patterns[MAX_NLEGEND]; - PLFLT box_scales[MAX_NLEGEND]; - PLINT box_line_widths[MAX_NLEGEND]; - PLINT line_colors[MAX_NLEGEND]; - PLINT line_styles[MAX_NLEGEND]; - PLINT line_widths[MAX_NLEGEND]; - PLINT symbol_numbers[MAX_NLEGEND], symbol_colors[MAX_NLEGEND]; - PLFLT symbol_scales[MAX_NLEGEND]; - char *text[MAX_NLEGEND]; + int i, k; + PLINT opt; + PLINT nlegend, nturn; + PLINT opt_array[MAX_NLEGEND]; + PLINT text_colors[MAX_NLEGEND]; + PLINT box_colors[MAX_NLEGEND]; + PLINT box_patterns[MAX_NLEGEND]; + PLFLT box_scales[MAX_NLEGEND]; + PLINT box_line_widths[MAX_NLEGEND]; + PLINT line_colors[MAX_NLEGEND]; + PLINT line_styles[MAX_NLEGEND]; + PLINT line_widths[MAX_NLEGEND]; + PLINT symbol_numbers[MAX_NLEGEND], symbol_colors[MAX_NLEGEND]; + PLFLT symbol_scales[MAX_NLEGEND]; + char *text[MAX_NLEGEND]; const char *symbols[MAX_NLEGEND]; - PLFLT legend_width, legend_height, x, y, xstart, ystart; - PLFLT max_height, text_scale; - PLINT position, opt_base, nrow, ncolumn; + PLFLT legend_width, legend_height, x, y, xstart, ystart; + PLFLT max_height, text_scale; + PLINT position, opt_base, nrow, ncolumn; // Create space to contain legend text. for ( k = 0; k < MAX_NLEGEND; k++ ) Modified: trunk/examples/c/x34c.c =================================================================== --- trunk/examples/c/x34c.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c/x34c.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -80,7 +80,7 @@ // Clean up plend(); - exit(0); + exit( 0 ); } void initialize_colors( void ) Modified: trunk/examples/c++/x19.cc =================================================================== --- trunk/examples/c++/x19.cc 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c++/x19.cc 2011-10-14 08:30:19 UTC (rev 11970) @@ -103,7 +103,7 @@ geolocation_labeler( PLINT axis, PLFLT value, char *label, PLINT length, PLPointer data ) { const char *direction_label = ""; - PLFLT label_val = 0.0; + PLFLT label_val = 0.0; if ( axis == PL_Y_AXIS ) { Modified: trunk/examples/c++/x27.cc =================================================================== --- trunk/examples/c++/x27.cc 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c++/x27.cc 2011-10-14 08:30:19 UTC (rev 11970) @@ -60,15 +60,15 @@ // N.B. N is just a place holder since it is no longer used // (because we now have proper termination of the angle loop). PLFLT params[9][4] = { - { 21.0, 7.0, 7.0, 3.0} , // Deltoid - { 21.0, 7.0, 10.0, 3.0} , - { 21.0, -7.0, 10.0, 3.0} , - { 20.0, 3.0, 7.0, 20.0} , - { 20.0, 3.0, 10.0, 20.0} , - { 20.0, -3.0, 10.0, 20.0} , - { 20.0, 13.0, 7.0, 20.0} , - { 20.0, 13.0, 20.0, 20.0} , - { 20.0, -13.0, 20.0, 20.0} + { 21.0, 7.0, 7.0, 3.0 }, // Deltoid + { 21.0, 7.0, 10.0, 3.0 }, + { 21.0, -7.0, 10.0, 3.0 }, + { 20.0, 3.0, 7.0, 20.0 }, + { 20.0, 3.0, 10.0, 20.0 }, + { 20.0, -3.0, 10.0, 20.0 }, + { 20.0, 13.0, 7.0, 20.0 }, + { 20.0, 13.0, 20.0, 20.0 }, + { 20.0, -13.0, 20.0, 20.0 } }; int i; Modified: trunk/examples/c++/x29.cc =================================================================== --- trunk/examples/c++/x29.cc 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/examples/c++/x29.cc 2011-10-14 08:30:19 UTC (rev 11970) @@ -375,7 +375,7 @@ pls->box( "bcnstd", xlabel_step, 0, "bcnstv", 0., 0 ); pls->col0( 3 ); strncpy( title, "@frPLplot Example 29 - TAI-UTC ", 100 ); - strncat( title, title_suffix, 100 - strlen(title) ); + strncat( title, title_suffix, 100 - strlen( title ) ); pls->lab( xtitle, "TAI-UTC (sec)", title ); pls->col0( 4 ); Modified: trunk/include/ltdl_win32.h =================================================================== --- trunk/include/ltdl_win32.h 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/include/ltdl_win32.h 2011-10-14 08:30:19 UTC (rev 11970) @@ -46,6 +46,6 @@ PLDLLIMPEXP void* lt_dlsym( lt_dlhandle dlhandle, const char* symbol ); -PLDLLIMPEXP int lt_dlmakeresident (lt_dlhandle handle); +PLDLLIMPEXP int lt_dlmakeresident( lt_dlhandle handle ); #endif // __LTDL_WIN32_H__ Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/include/plplotP.h 2011-10-14 08:30:19 UTC (rev 11970) @@ -1153,7 +1153,7 @@ // struct used for FCI to FontName lookups. typedef struct { - PLUNICODE fci; + PLUNICODE fci; const unsigned char *pfont; } FCI_to_FontName_Table; Modified: trunk/lib/csa/csa.c =================================================================== --- trunk/lib/csa/csa.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/lib/csa/csa.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -673,8 +673,8 @@ for ( ii = 0; ii < t->npoints; ++ii ) { point * p = t->points[ii]; - i = (int) floor( ( p->x - xmin ) / h ); - j = (int) floor( ( p->y - ymin ) / h ); + i = (int) floor( ( p->x - xmin ) / h ); + j = (int) floor( ( p->y - ymin ) / h ); square* s = squares[j][i]; if ( s->npoints == 0 ) Modified: trunk/lib/csa/csa.h =================================================================== --- trunk/lib/csa/csa.h 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/lib/csa/csa.h 2011-10-14 08:30:19 UTC (rev 11970) @@ -34,7 +34,7 @@ } point; #endif -extern int csa_verbose; +extern int csa_verbose; extern const char* csa_version; struct csa; Modified: trunk/lib/nn/nnai.c =================================================================== --- trunk/lib/nn/nnai.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/lib/nn/nnai.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -63,7 +63,7 @@ // nnai* nnai_build( delaunay* d, int n, double* x, double* y ) { - nnai * nn = malloc( sizeof ( nnai ) ); + nnai * nn = malloc( sizeof ( nnai ) ); nnpi * nnp = nnpi_create( d ); int * vertices; double* weights; Modified: trunk/lib/nn/nnpi.c =================================================================== --- trunk/lib/nn/nnpi.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/lib/nn/nnpi.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -517,7 +517,7 @@ // void nnhpi_interpolate( nnhpi* nnhp, point* p ) { - nnpi * nnp = nnhp->nnpi; + nnpi * nnp = nnhp->nnpi; delaunay * d = nnp->d; hashtable * ht_weights = nnhp->ht_weights; nn_weights* weights; Modified: trunk/lib/qsastime/deltaT-gen.c =================================================================== --- trunk/lib/qsastime/deltaT-gen.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/lib/qsastime/deltaT-gen.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -78,13 +78,13 @@ int i = 0; int number_of_lines = 0; - if ( (argc < 2) || ( fr = fopen( argv[1], "r" ) ) == NULL ) + if ( ( argc < 2 ) || ( fr = fopen( argv[1], "r" ) ) == NULL ) { fprintf( stderr, "Cannot open first file as readable\n" ); exit( 1 ); } - if ( (argc < 3) || ( fw = fopen( argv[2], "w" ) ) == NULL ) + if ( ( argc < 3 ) || ( fw = fopen( argv[2], "w" ) ) == NULL ) { fprintf( stderr, "Cannot open second file as writable\n" ); exit( 1 ); Modified: trunk/lib/qsastime/qsastime.c =================================================================== --- trunk/lib/qsastime/qsastime.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/lib/qsastime/qsastime.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -334,7 +334,7 @@ const char * getDayOfWeek( const MJDtime *MJD ) { static const char *dow = { "Wed\0Thu\0Fri\0Sat\0Sun\0Mon\0Tue" }; - int d = MJD->base_day % 7; + int d = MJD->base_day % 7; if ( d < 0 ) d += 7; return &( dow[d * 4] ); @@ -343,7 +343,7 @@ const char * getLongDayOfWeek( const MJDtime *MJD ) { static const char *dow = { "Wednesday\0Thursday\0\0Friday\0\0\0\0Saturday\0\0Sunday\0\0\0\0Monday\0\0\0\0Tuesday" }; - int d = MJD->base_day % 7; + int d = MJD->base_day % 7; if ( d < 0 ) d += 7; return &( dow[d * 10] ); Modified: trunk/src/ltdl_win32.c =================================================================== --- trunk/src/ltdl_win32.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/src/ltdl_win32.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -113,7 +113,7 @@ } // Placeholder that does nothing for now. -int lt_dlmakeresident (lt_dlhandle handle) +int lt_dlmakeresident( lt_dlhandle handle ) { return 0; } Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/src/pdfutils.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -857,12 +857,12 @@ if ( e_ieee == 0 ) { - ex = 1 - bias; + ex = 1 - bias; f_new = f_tmp; } else { - ex = (int) e_ieee - bias; + ex = (int) e_ieee - bias; f_new = 1.0 + f_tmp; } Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/src/plctrl.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -95,7 +95,7 @@ static void cmap0_palette_read( const char *filename, - int *number_colors, unsigned int **r, unsigned int **g, + int *number_colors, unsigned int **r, unsigned int **g, unsigned int **b, double **a ); // An additional hardwired location for lib files. @@ -929,10 +929,10 @@ void plcmap0_def( int imin, int imax ) { - int i; + int i; unsigned int *r, *g, *b; - double *a; - int number_colors; + double *a; + int number_colors; if ( imin <= imax ) { cmap0_palette_read( "", &number_colors, &r, &g, &b, &a ); @@ -1342,7 +1342,7 @@ if ( strlen( color_info ) == 7 ) { if ( sscanf( color_info, "#%2x%2x%2x", - (unsigned int *) ( *r + i ), (unsigned int *) ( *g + i ), + (unsigned int *) ( *r + i ), (unsigned int *) ( *g + i ), (unsigned int *) ( *b + i ) ) != 3 ) { err = 1; @@ -1353,7 +1353,7 @@ else if ( strlen( color_info ) > 9 ) { if ( sscanf( color_info, "#%2x%2x%2x %lf", - (unsigned int *) ( *r + i ), (unsigned int *) ( *g + i ), + (unsigned int *) ( *r + i ), (unsigned int *) ( *g + i ), (unsigned int *) ( *b + i ), (double *) ( *a + i ) ) != 4 ) { err = 1; @@ -1430,10 +1430,10 @@ void c_plspal0( const char *filename ) { - int i; + int i; unsigned int *r, *g, *b; - double *a; - int number_colors; + double *a; + int number_colors; cmap0_palette_read( filename, &number_colors, &r, &g, &b, &a ); // Allocate default number of cmap0 colours if cmap0 allocation not // done already. @@ -1478,20 +1478,20 @@ void c_plspal1( const char *filename, PLBOOL interpolate ) { - int i; - int number_colors; - int format_version, err; - PLBOOL rgb; - char color_info[PALLEN]; - unsigned int r_i, g_i, b_i; - int pos_i, rev_i; - double r_d, g_d, b_d, a_d, pos_d; - PLFLT *r, *g, *b, *a, *pos; - PLINT *ri, *gi, *bi; - PLBOOL *rev; - FILE *fp; - char msgbuf[MSGLEN]; - char * save_locale = plsave_set_locale(); + int i; + int number_colors; + int format_version, err; + PLBOOL rgb; + char color_info[PALLEN]; + unsigned int r_i, g_i, b_i; + int pos_i, rev_i; + double r_d, g_d, b_d, a_d, pos_d; + PLFLT *r, *g, *b, *a, *pos; + PLINT *ri, *gi, *bi; + PLBOOL *rev; + FILE *fp; + char msgbuf[MSGLEN]; + char * save_locale = plsave_set_locale(); rgb = TRUE; err = 0; Modified: trunk/src/plfill.c =================================================================== --- trunk/src/plfill.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/src/plfill.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -1599,7 +1599,7 @@ { i1intersect[ncrossed] = i1; if ( ncrossed_change == 2 ) - ; + ; i1intersect[1] = i1; ncrossed += ncrossed_change; Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-10-14 08:03:51 UTC (rev 11969) +++ trunk/src/pllegend.c 2011-10-14 08:30:19 UTC (rev 11970) @@ -943,7 +943,7 @@ static void draw_cap( PLBOOL if_edge, PLINT orientation, PLFLT xmin, PLFLT xmax, - PLFLT ymin, PLFLT ymax, PLFLT color ) + PLFLT ymin, PLFLT ymax, PLFLT color ) { // Save current drawing color. PLINT col0_save = plsc->icol0; @@ -1120,9 +1120,9 @@ PLFLT label_offset = 1.2; // For building plmtex option string. -#define max_opts 25 - char opt_label[max_opts]; - char perp; +#define max_opts 25 + char opt_label[max_opts]; + char perp; // To help sanity check number of specified labels. PLINT nlabel = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-17 21:16:48
|
Revision: 11973 http://plplot.svn.sourceforge.net/plplot/?rev=11973&view=rev Author: andrewross Date: 2011-10-17 21:16:39 +0000 (Mon, 17 Oct 2011) Log Message: ----------- Another big round of changes to fix gcc warnings / ensure standards conformance. Changes include - explicit casting between types - removing or commenting out unused variables / functions - correct using of "const" modifier - replacing use of finite with isfinite where available (this is in C99, but not supported by MSVC so still need complicated set of macros to check) - rename local variables which shadow other global or local variables / symbols Modified Paths: -------------- trunk/cmake/modules/plplot.cmake trunk/config.h.cmake trunk/drivers/ps.c trunk/drivers/psttf.cc trunk/drivers/svg.c trunk/drivers/xfig.c trunk/include/pdf.h trunk/include/plcore.h trunk/include/plfci-type1.h trunk/include/plfreetype.h trunk/include/plplotP.h trunk/include/plstrm.h trunk/src/mt19937ar.c 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/plcvt.c trunk/src/pldeprecated.c trunk/src/plf2ops.c trunk/src/plfill.c trunk/src/plfreetype.c trunk/src/plgradient.c trunk/src/plgridd.c trunk/src/plimage.c trunk/src/pllegend.c trunk/src/plline.c trunk/src/plmap.c trunk/src/plot3d.c trunk/src/plpage.c trunk/src/plsdef.c trunk/src/plshade.c trunk/src/plstdio.c trunk/src/plstripc.c trunk/src/plsym.c trunk/src/plvect.c trunk/src/plvpor.c Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/cmake/modules/plplot.cmake 2011-10-17 21:16:39 UTC (rev 11973) @@ -226,27 +226,35 @@ # Check for FP functions, including underscored version which # are sometimes all that is available on windows +check_symbol_exists(isfinite "math.h" HAVE_ISFINITE_SYMBOL) check_symbol_exists(finite "math.h" HAVE_FINITE_SYMBOL) -if(HAVE_FINITE_SYMBOL) - set(PL_HAVE_FINITE ON) -else(HAVE_FINITE_SYMBOL) - check_function_exists(finite HAVE_FINITE_FUNCTION) - if(HAVE_FINITE_FUNCTION) +if(HAVE_ISFINITE_SYMBOL) + set(PL_HAVE_ISFINITE ON) +else(HAVE_ISFINITE_SYMBOL) + if(HAVE_FINITE_SYMBOL) set(PL_HAVE_FINITE ON) - else(HAVE_FINITE_FUNCTION) - check_symbol_exists(_finite "math.h" HAVE__FINITE_SYMBOL) - if(HAVE__FINITE_SYMBOL) - set(PL__HAVE_FINITE ON) - else(HAVE__FINITE_SYMBOL) - check_function_exists(_finite HAVE__FINITE_FUNCTION) - if(HAVE__FINITE_FUNCTION) + else(HAVE_FINITE_SYMBOL) + check_function_exists(finite HAVE_FINITE_FUNCTION) + if(HAVE_FINITE_FUNCTION) + set(PL_HAVE_FINITE ON) + else(HAVE_FINITE_FUNCTION) + check_symbol_exists(_finite "math.h" HAVE__FINITE_SYMBOL) + if(HAVE__FINITE_SYMBOL) set(PL__HAVE_FINITE ON) - endif(HAVE__FINITE_FUNCTION) - endif(HAVE__FINITE_SYMBOL) - endif(HAVE_FINITE_FUNCTION) -endif(HAVE_FINITE_SYMBOL) + else(HAVE__FINITE_SYMBOL) + check_function_exists(_finite HAVE__FINITE_FUNCTION) + if(HAVE__FINITE_FUNCTION) + set(PL__HAVE_FINITE ON) + endif(HAVE__FINITE_FUNCTION) + endif(HAVE__FINITE_SYMBOL) + endif(HAVE_FINITE_FUNCTION) + endif(HAVE_FINITE_SYMBOL) +endif(HAVE_ISFINITE_SYMBOL) +if(PL_HAVE_FINITE) + set(PL_HAVE_ISFINITE ON) +endif(PL_HAVE_FINITE) if(PL__HAVE_FINITE) - set(PL_HAVE_FINITE ON) + set(PL_HAVE_ISFINITE ON) endif(PL__HAVE_FINITE) check_symbol_exists(isnan "math.h" HAVE_ISNAN_SYMBOL) Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/config.h.cmake 2011-10-17 21:16:39 UTC (rev 11973) @@ -51,6 +51,9 @@ // Define to 1 if you have the <dlfcn.h> header file. #cmakedefine HAVE_DLFCN_H 1 +// Define if isfinite is available +#cmakedefine PL_HAVE_ISFINITE + // Define if finite is available #cmakedefine PL_HAVE_FINITE Modified: trunk/drivers/ps.c =================================================================== --- trunk/drivers/ps.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/drivers/ps.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -81,7 +81,7 @@ const Unicode_to_Type1_table lookup[], const int number_of_entries ); -static char * +static const char * get_font( PSDev* dev, PLUNICODE fci ); // text > 0 uses some postscript tricks, namely a transformation matrix @@ -450,7 +450,7 @@ dev->ury = MAX( dev->ury, y2 ); fprintf( OF, "%s", outbuf ); - pls->bytecnt += 1 + strlen( outbuf ); + pls->bytecnt += 1 + (PLINT) strlen( outbuf ); dev->xold = x2; dev->yold = y2; } @@ -688,7 +688,7 @@ dev->urx = MAX( dev->urx, x ); dev->ury = MAX( dev->ury, y ); fprintf( OF, "%s", outbuf ); - pls->bytecnt += strlen( outbuf ); + pls->bytecnt += (PLINT) strlen( outbuf ); continue; } @@ -709,7 +709,7 @@ dev->ury = MAX( dev->ury, y ); fprintf( OF, "%s", outbuf ); - pls->bytecnt += strlen( outbuf ); + pls->bytecnt += (PLINT) strlen( outbuf ); pls->linepos += 21; } dev->xold = PL_UNDEFINED; @@ -732,7 +732,7 @@ t = time( (time_t *) 0 ); p = ctime( &t ); - len = strlen( p ); + len = (int) strlen( p ); *( p + len - 1 ) = '\0'; // zap the newline character return p; } @@ -757,12 +757,13 @@ void proc_str( PLStream *pls, EscText *args ) { - PLFLT *t = args->xform, tt[4]; // Transform matrices - PLFLT theta, shear, stride; // Rotation angle and shear from the matrix - PLFLT ft_ht, offset; // Font height and offset - PLFLT cs, sn, l1, l2; - PSDev *dev = (PSDev *) pls->dev; - char *font, esc; + PLFLT *t = args->xform, tt[4]; // Transform matrices + PLFLT theta, shear, stride; // Rotation angle and shear from the matrix + PLFLT ft_ht, offset; // Font height and offset + PLFLT cs, sn, l1, l2; + PSDev *dev = (PSDev *) pls->dev; + const char *font; + char esc; // Be generous. Used to store lots of font changes which take // 3 characters per change. #define PROC_STR_STRING_LENGTH 1000 @@ -779,12 +780,12 @@ // unicode only! so test for it. if ( args->unicode_array_len > 0 ) { - int j, s, f; - char *fonts[PROC_STR_STRING_LENGTH]; + int j, s, f; + const char *fonts[PROC_STR_STRING_LENGTH]; const PLUNICODE *cur_text; - PLUNICODE fci, fci_save; - PLFLT old_sscale, sscale, old_soffset, soffset, dup; - PLINT level = 0; + PLUNICODE fci, fci_save; + PLFLT old_sscale, sscale, old_soffset, soffset, ddup; + PLINT level = 0; // translate from unicode into type 1 font index. // // Choose the font family, style, variant, and weight using @@ -808,7 +809,7 @@ { fci_save = cur_text[j]; fonts[f++] = get_font( dev, fci_save ); - cur_str[s++] = esc; + cur_str[s++] = (unsigned char) esc; cur_str[s++] = 'f'; cur_str[s++] = 'f'; } @@ -842,7 +843,7 @@ // font instead which will return a blank if // that fails as well. fonts[f++] = get_font( dev, 0 ); - cur_str[s++] = esc; + cur_str[s++] = (unsigned char) esc; cur_str[s++] = 'f'; cur_str[s++] = 'f'; cur_str[s++] = plunicode2type1( cur_text[j], dev->lookup, dev->nlookup ); @@ -853,7 +854,7 @@ // font instead which will return a blank if // that fails as well. fonts[f++] = get_font( dev, fci_save ); - cur_str[s++] = esc; + cur_str[s++] = (unsigned char) esc; cur_str[s++] = 'f'; cur_str[s++] = 'f'; cur_str[s++] = plunicode2type1( cur_text[j], dev->lookup, dev->nlookup ); @@ -1014,8 +1015,8 @@ // between the baseline and middle coordinate systems // for subscripts should be // -0.5*(base font size - superscript/subscript font size). - dup = -0.5 * ( 1.0 - sscale ); - up = -font_factor * ENLARGE * ft_ht * ( RISE_FACTOR * soffset + dup ); + ddup = -0.5 * ( 1.0 - sscale ); + up = -font_factor * ENLARGE * ft_ht * ( RISE_FACTOR * soffset + ddup ); break; case 'u': //superscript @@ -1027,8 +1028,8 @@ // between the baseline and middle coordinate systems // for superscripts should be // 0.5*(base font size - superscript/subscript font size). - dup = 0.5 * ( 1.0 - sscale ); - up = font_factor * ENLARGE * ft_ht * ( RISE_FACTOR * soffset + dup ); + ddup = 0.5 * ( 1.0 - sscale ); + up = font_factor * ENLARGE * ft_ht * ( RISE_FACTOR * soffset + ddup ); break; // ignore the next sequences @@ -1190,10 +1191,10 @@ // // Sets the Type1 font. //-------------------------------------------------------------------------- -static char * +static const char * get_font( PSDev* dev, PLUNICODE fci ) { - char *font; + const char *font; // fci = 0 is a special value indicating the Type 1 Symbol font // is desired. This value cannot be confused with a normal FCI value // because it doesn't have the PL_FCI_MARK. Modified: trunk/drivers/psttf.cc =================================================================== --- trunk/drivers/psttf.cc 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/drivers/psttf.cc 2011-10-17 21:16:39 UTC (rev 11973) @@ -31,11 +31,9 @@ #include "plDevs.h" -#define DEBUG - #if defined ( PLD_psttf ) -#define NEED_PLDEBUG +//#define NEED_PLDEBUG #include "plplotP.h" #include "drivers.h" #include "ps.h" @@ -70,7 +68,7 @@ static void ps_init( PLStream * ); static void fill_polygon( PLStream *pls ); static void proc_str( PLStream *, EscText * ); -static void esc_purge( char *, char * ); +//static void esc_purge( char *, char * ); #define OUTBUF_LEN 128 static char outbuf[OUTBUF_LEN]; @@ -450,7 +448,7 @@ doc->osHeader() << "PSDict begin\n"; doc->osHeader() << "@start\n"; - doc->osHeader() << "%d @copies\n", COPIES; + doc->osHeader() << "%d @copies\n" << COPIES; doc->osHeader() << "@line\n"; doc->osHeader() << YSIZE << " @hsize\n"; doc->osHeader() << XSIZE << " @vsize\n"; @@ -1274,44 +1272,44 @@ } } -static void -esc_purge( char *dstr, char *sstr ) -{ - char esc; +//static void +//esc_purge( char *dstr, char *sstr ) +//{ +// char esc; +// +// plgesc( &esc ); +// +// while ( *sstr ) +// { +// if ( *sstr != esc ) +// { +// *dstr++ = *sstr++; +// continue; +// } +// +// sstr++; +// if ( *sstr == esc ) +// { +// *dstr++ = *sstr++; +// continue; +// } +// +// else +// { +// switch ( *sstr++ ) +// { +// case 'f': +// sstr++; +// break; // two chars sequence +// +// default: +// break; // single char escape +// } +// } +// } +// *dstr = '\0'; +//} - plgesc( &esc ); - - while ( *sstr ) - { - if ( *sstr != esc ) - { - *dstr++ = *sstr++; - continue; - } - - sstr++; - if ( *sstr == esc ) - { - *dstr++ = *sstr++; - continue; - } - - else - { - switch ( *sstr++ ) - { - case 'f': - sstr++; - break; // two chars sequence - - default: - break; // single char escape - } - } - } - *dstr = '\0'; -} - #else int pldummy_psttf() Modified: trunk/drivers/svg.c =================================================================== --- trunk/drivers/svg.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/drivers/svg.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -219,7 +219,7 @@ { aStream->textClipping = 1; } - aStream->textClipping = text_clipping; + aStream->textClipping = (short) text_clipping; aStream->svgIndent = 0; aStream->gradient_index = 0; @@ -567,7 +567,7 @@ static short which_clip = 0; short i; short totalTags = 1; - short ucs4Len = args->unicode_array_len; + short ucs4Len = (short) args->unicode_array_len; double ftHt, scaled_offset, scaled_ftHt; PLUNICODE fci; PLINT rcx[4], rcy[4]; @@ -578,7 +578,7 @@ // PLFLT *t = args->xform; PLUNICODE *ucs4 = args->unicode_array; SVG *aStream; - PLFLT old_sscale, sscale, old_soffset, soffset, old_dup, dup; + PLFLT old_sscale, sscale, old_soffset, soffset, old_dup, ddup; PLINT level; // check that we got unicode @@ -750,7 +750,7 @@ i = 0; scaled_ftHt = ftHt; level = 0; - dup = 0.; + ddup = 0.; while ( i < ucs4Len ) { if ( ucs4[i] < PL_FCI_MARK ) // not a font change @@ -795,15 +795,15 @@ // between the baseline and middle coordinate systems // for superscripts should be // 0.5*(base font size - superscript/subscript font size). - old_dup = dup; - dup = 0.5 * ( 1.0 - sscale ); + old_dup = ddup; + ddup = 0.5 * ( 1.0 - sscale ); if ( level <= 0 ) { - scaled_offset = FONT_SHIFT_RATIO * ftHt * ( 0.80 * ( soffset - old_soffset ) - ( dup - old_dup ) ); + scaled_offset = FONT_SHIFT_RATIO * ftHt * ( 0.80 * ( soffset - old_soffset ) - ( ddup - old_dup ) ); } else { - scaled_offset = -FONT_SHIFT_RATIO * ftHt * ( 0.80 * ( soffset - old_soffset ) + ( dup - old_dup ) ); + scaled_offset = -FONT_SHIFT_RATIO * ftHt * ( 0.80 * ( soffset - old_soffset ) + ( ddup - old_dup ) ); } scaled_ftHt = sscale * ftHt; if ( if_write ) @@ -824,15 +824,15 @@ // between the baseline and middle coordinate systems // for superscripts should be // 0.5*(base font size - superscript/subscript font size). - old_dup = dup; - dup = 0.5 * ( 1.0 - sscale ); + old_dup = ddup; + ddup = 0.5 * ( 1.0 - sscale ); if ( level < 0 ) { - scaled_offset = FONT_SHIFT_RATIO * ftHt * ( 0.80 * ( soffset - old_soffset ) - ( dup - old_dup ) ); + scaled_offset = FONT_SHIFT_RATIO * ftHt * ( 0.80 * ( soffset - old_soffset ) - ( ddup - old_dup ) ); } else { - scaled_offset = -FONT_SHIFT_RATIO * ftHt * ( 0.80 * ( soffset - old_soffset ) + ( dup - old_dup ) ); + scaled_offset = -FONT_SHIFT_RATIO * ftHt * ( 0.80 * ( soffset - old_soffset ) + ( ddup - old_dup ) ); } scaled_ftHt = sscale * ftHt; if ( if_write ) Modified: trunk/drivers/xfig.c =================================================================== --- trunk/drivers/xfig.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/drivers/xfig.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -166,7 +166,7 @@ stcmap1( pls ); dev->bufflen = 2 * BSIZE; - dev->buffptr = (int *) malloc( sizeof ( int ) * dev->bufflen ); + dev->buffptr = (int *) malloc( sizeof ( int ) * (size_t) ( dev->bufflen ) ); if ( dev->buffptr == NULL ) plexit( "plD_init_xfig: Out of memory!" ); } @@ -265,7 +265,7 @@ { dev->bufflen += 2 * BSIZE; tempptr = (int *) - realloc( (void *) dev->buffptr, dev->bufflen * sizeof ( int ) ); + realloc( (void *) dev->buffptr, (size_t) ( dev->bufflen ) * sizeof ( int ) ); if ( tempptr == NULL ) { free( (void *) dev->buffptr ); Modified: trunk/include/pdf.h =================================================================== --- trunk/include/pdf.h 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/include/pdf.h 2011-10-17 21:16:39 UTC (rev 11973) @@ -55,7 +55,7 @@ #ifdef PLPLOT_USE_TCL_CHANNELS Tcl_Channel tclChan; // Tcl channel #endif - long bp, bufmax; // Buffer pointer and max size + size_t bp, bufmax; // Buffer pointer and max size } PDFstrm; // Info for the i/o device. Only used by Tcl/TK/dp drivers for now @@ -86,7 +86,7 @@ void pdf_set PLARGS( ( char *option, int value ) ); PLDLLIMPEXP PDFstrm *pdf_fopen PLARGS( ( const char *fileName, const char *mode ) ); -PLDLLIMPEXP PDFstrm *pdf_bopen PLARGS( ( U_CHAR * buffer, long bufmax ) ); +PLDLLIMPEXP PDFstrm *pdf_bopen PLARGS( ( U_CHAR * buffer, size_t bufmax ) ); PLDLLIMPEXP PDFstrm *pdf_finit PLARGS( ( FILE * file ) ); PDFstrm *plLibOpenPdfstrm PLARGS( (const char * fn) ); PLDLLIMPEXP int pdf_close PLARGS( ( PDFstrm * pdfs ) ); Modified: trunk/include/plcore.h =================================================================== --- trunk/include/plcore.h 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/include/plcore.h 2011-10-17 21:16:39 UTC (rev 11973) @@ -50,7 +50,7 @@ // Static function prototypes -static char *utf8_to_ucs4( const char *ptr, PLUNICODE *unichar ); +static const char *utf8_to_ucs4( const char *ptr, PLUNICODE *unichar ); static void grline( short *, short *, PLINT ); static void grpolyline( short *, short *, PLINT ); static void grfill( short *, short *, PLINT ); Modified: trunk/include/plfci-type1.h =================================================================== --- trunk/include/plfci-type1.h 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/include/plfci-type1.h 2011-10-17 21:16:39 UTC (rev 11973) @@ -40,34 +40,34 @@ #define N_Type1Lookup 30 static const FCI_to_FontName_Table Type1Lookup[N_Type1Lookup] = { - { PL_FCI_MARK | 0x000, (unsigned char *) "Helvetica" }, - { PL_FCI_MARK | 0x001, (unsigned char *) "Times-Roman" }, - { PL_FCI_MARK | 0x002, (unsigned char *) "Courier" }, - { PL_FCI_MARK | 0x003, (unsigned char *) "Helvetica" }, - { PL_FCI_MARK | 0x004, (unsigned char *) "Helvetica" }, - { PL_FCI_MARK | 0x010, (unsigned char *) "Helvetica-Oblique" }, - { PL_FCI_MARK | 0x011, (unsigned char *) "Times-Italic" }, - { PL_FCI_MARK | 0x012, (unsigned char *) "Courier-Oblique" }, - { PL_FCI_MARK | 0x013, (unsigned char *) "Helvetica-Oblique" }, - { PL_FCI_MARK | 0x014, (unsigned char *) "Helvetica-Oblique" }, - { PL_FCI_MARK | 0x020, (unsigned char *) "Helvetica-Oblique" }, - { PL_FCI_MARK | 0x021, (unsigned char *) "Times-Italic" }, - { PL_FCI_MARK | 0x022, (unsigned char *) "Courier-Oblique" }, - { PL_FCI_MARK | 0x023, (unsigned char *) "Helvetica-Oblique" }, - { PL_FCI_MARK | 0x024, (unsigned char *) "Helvetica-Oblique" }, - { PL_FCI_MARK | 0x100, (unsigned char *) "Helvetica-Bold" }, - { PL_FCI_MARK | 0x101, (unsigned char *) "Times-Bold" }, - { PL_FCI_MARK | 0x102, (unsigned char *) "Courier-Bold" }, - { PL_FCI_MARK | 0x103, (unsigned char *) "Helvetica-Bold" }, - { PL_FCI_MARK | 0x104, (unsigned char *) "Helvetica-Bold" }, - { PL_FCI_MARK | 0x110, (unsigned char *) "Helvetica-BoldOblique" }, - { PL_FCI_MARK | 0x111, (unsigned char *) "Times-BoldItalic" }, - { PL_FCI_MARK | 0x112, (unsigned char *) "Courier-BoldOblique" }, - { PL_FCI_MARK | 0x113, (unsigned char *) "Helvetica-BoldOblique" }, - { PL_FCI_MARK | 0x114, (unsigned char *) "Helvetica-BoldOblique" }, - { PL_FCI_MARK | 0x120, (unsigned char *) "Helvetica-BoldOblique" }, - { PL_FCI_MARK | 0x121, (unsigned char *) "Times-BoldItalic" }, - { PL_FCI_MARK | 0x122, (unsigned char *) "Courier-BoldOblique" }, - { PL_FCI_MARK | 0x123, (unsigned char *) "Helvetica-BoldOblique" }, - { PL_FCI_MARK | 0x124, (unsigned char *) "Helvetica-BoldOblique" }, + { PL_FCI_MARK | 0x000, (const unsigned char *) "Helvetica" }, + { PL_FCI_MARK | 0x001, (const unsigned char *) "Times-Roman" }, + { PL_FCI_MARK | 0x002, (const unsigned char *) "Courier" }, + { PL_FCI_MARK | 0x003, (const unsigned char *) "Helvetica" }, + { PL_FCI_MARK | 0x004, (const unsigned char *) "Helvetica" }, + { PL_FCI_MARK | 0x010, (const unsigned char *) "Helvetica-Oblique" }, + { PL_FCI_MARK | 0x011, (const unsigned char *) "Times-Italic" }, + { PL_FCI_MARK | 0x012, (const unsigned char *) "Courier-Oblique" }, + { PL_FCI_MARK | 0x013, (const unsigned char *) "Helvetica-Oblique" }, + { PL_FCI_MARK | 0x014, (const unsigned char *) "Helvetica-Oblique" }, + { PL_FCI_MARK | 0x020, (const unsigned char *) "Helvetica-Oblique" }, + { PL_FCI_MARK | 0x021, (const unsigned char *) "Times-Italic" }, + { PL_FCI_MARK | 0x022, (const unsigned char *) "Courier-Oblique" }, + { PL_FCI_MARK | 0x023, (const unsigned char *) "Helvetica-Oblique" }, + { PL_FCI_MARK | 0x024, (const unsigned char *) "Helvetica-Oblique" }, + { PL_FCI_MARK | 0x100, (const unsigned char *) "Helvetica-Bold" }, + { PL_FCI_MARK | 0x101, (const unsigned char *) "Times-Bold" }, + { PL_FCI_MARK | 0x102, (const unsigned char *) "Courier-Bold" }, + { PL_FCI_MARK | 0x103, (const unsigned char *) "Helvetica-Bold" }, + { PL_FCI_MARK | 0x104, (const unsigned char *) "Helvetica-Bold" }, + { PL_FCI_MARK | 0x110, (const unsigned char *) "Helvetica-BoldOblique" }, + { PL_FCI_MARK | 0x111, (const unsigned char *) "Times-BoldItalic" }, + { PL_FCI_MARK | 0x112, (const unsigned char *) "Courier-BoldOblique" }, + { PL_FCI_MARK | 0x113, (const unsigned char *) "Helvetica-BoldOblique" }, + { PL_FCI_MARK | 0x114, (const unsigned char *) "Helvetica-BoldOblique" }, + { PL_FCI_MARK | 0x120, (const unsigned char *) "Helvetica-BoldOblique" }, + { PL_FCI_MARK | 0x121, (const unsigned char *) "Times-BoldItalic" }, + { PL_FCI_MARK | 0x122, (const unsigned char *) "Courier-BoldOblique" }, + { PL_FCI_MARK | 0x123, (const unsigned char *) "Helvetica-BoldOblique" }, + { PL_FCI_MARK | 0x124, (const unsigned char *) "Helvetica-BoldOblique" }, }; Modified: trunk/include/plfreetype.h =================================================================== --- trunk/include/plfreetype.h 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/include/plfreetype.h 2011-10-17 21:16:39 UTC (rev 11973) @@ -34,6 +34,7 @@ #include FT_FREETYPE_H #include FT_GLYPH_H #include FT_OUTLINE_H +#include FT_MODULE_H #define FT_Data _FT_Data_ Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/include/plplotP.h 2011-10-17 21:16:39 UTC (rev 11973) @@ -252,22 +252,25 @@ # endif #endif #if defined ( PL__HAVE_ISINF ) -# define isinf _isinf +# define isinf _isinf #endif +#if defined ( PL_HAVE_FINITE ) +# define isfinite finite +#endif #if defined ( PL__HAVE_FINITE ) -# define finite _finite +# define isfinite _finite #endif // Note these replacements follow the old BSD convention and not // C99. In particular isinf does not distinguish +/- inf. #if !defined ( PL_HAVE_ISNAN ) -# define isnan( x ) ( ( x ) != ( x ) ) +# define isnan( x ) ( ( x ) != ( x ) ) #endif #if !defined ( PL_HAVE_ISINF ) -# define isinf( x ) ( !isnan( x ) && isnan( x - x ) ) +# define isinf( x ) ( !isnan( x ) && isnan( x - x ) ) #endif -#if !defined ( PL_HAVE_FINITE ) -# define finite( x ) ( !isnan( x - x ) ) +#if !defined ( PL_HAVE_ISFINITE ) +# define isfinite( x ) ( !isnan( x - x ) ) #endif // Check if C99 HUGE_VAL macro is available - if not then @@ -1158,7 +1161,7 @@ } FCI_to_FontName_Table; // Internal function to obtain a pointer to a valid font name. -PLDLLIMPEXP char * +PLDLLIMPEXP const char * plP_FCI2FontName( PLUNICODE fci, const FCI_to_FontName_Table lookup[], const int nlookup ); @@ -1190,10 +1193,18 @@ void plio_fgets( char *, int, FILE * ); +// Draws a tick parallel to x, using world coordinates +void +plwxtik( PLFLT x, PLFLT y, PLBOOL minor, PLBOOL invert ); + +// Draws a tick parallel to y, using world coordinates +void +plwytik( PLFLT x, PLFLT y, PLBOOL minor, PLBOOL invert ); + // get drivers directory #ifdef ENABLE_DYNDRIVERS -PLDLLIMPEXP char* +PLDLLIMPEXP const char* plGetDrvDir( void ); #endif Modified: trunk/include/plstrm.h =================================================================== --- trunk/include/plstrm.h 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/include/plstrm.h 2011-10-17 21:16:39 UTC (rev 11973) @@ -774,31 +774,31 @@ // transformation between broken-down and continuous time used in // the qsastime library. - QSASConfig *qsasconfig; + QSASConfig *qsasconfig; // Gradient section. - PLINT dev_gradient; - PLINT ngradient; - PLINT *xgradient, *ygradient; + PLINT dev_gradient; + PLINT ngradient; + PLINT *xgradient, *ygradient; // The next three variables define the polygon boundary used // in the software fallback for the gradient. - PLINT n_polygon; - PLFLT *x_polygon, *y_polygon; + PLINT n_polygon; + const PLFLT *x_polygon, *y_polygon; //CONSTANT SOVERSION FIX - PLBOOL stream_closed; - PLINT line_style; - PLINT dev_mem_alpha; - PLINT has_string_length; - PLFLT string_length; - PLINT get_string_length; - PLINT dev_eofill; + PLBOOL stream_closed; + PLINT line_style; + PLINT dev_mem_alpha; + PLINT has_string_length; + PLFLT string_length; + PLINT get_string_length; + PLINT dev_eofill; // Drawing mode section - PLINT dev_modeset; + PLINT dev_modeset; // Calculate bounding-box limits rather than plot box? - PLBOOL if_boxbb; + PLBOOL if_boxbb; // Bounding box limits in mm for box including decorations // (inverted tick marks and numerical tick labels if either is // present). Modified: trunk/src/mt19937ar.c =================================================================== --- trunk/src/mt19937ar.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/src/mt19937ar.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -63,7 +63,7 @@ for ( mti = 1; mti < N; mti++ ) { mt[mti] = - ( 1812433253UL * ( mt[mti - 1] ^ ( mt[mti - 1] >> 30 ) ) + mti ); + ( 1812433253UL * ( mt[mti - 1] ^ ( mt[mti - 1] >> 30 ) ) + (unsigned long) mti ); // See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. // In the previous versions, MSBs of the seed affect // only MSBs of the array mt[]. @@ -86,8 +86,8 @@ for (; k; k-- ) { mt[i] = ( mt[i] ^ ( ( mt[i - 1] ^ ( mt[i - 1] >> 30 ) ) * 1664525UL ) ) - + init_key[j] + j; // non linear - mt[i] &= 0xffffffffUL; // for WORDSIZE > 32 machines + + init_key[j] + (unsigned long) j; // non linear + mt[i] &= 0xffffffffUL; // for WORDSIZE > 32 machines i++; j++; if ( i >= N ) { @@ -99,8 +99,8 @@ for ( k = N - 1; k; k-- ) { mt[i] = ( mt[i] ^ ( ( mt[i - 1] ^ ( mt[i - 1] >> 30 ) ) * 1566083941UL ) ) - - i; // non linear - mt[i] &= 0xffffffffUL; // for WORDSIZE > 32 machines + - (unsigned long) i; // non linear + mt[i] &= 0xffffffffUL; // for WORDSIZE > 32 machines i++; if ( i >= N ) { @@ -161,14 +161,14 @@ // generates a random number on [0,1]-real-interval double genrand_real1( void ) { - return genrand_int32() * ( 1.0 / 4294967295.0 ); + return (double) genrand_int32() * ( 1.0 / 4294967295.0 ); // divided by 2^32-1 } // generates a random number on [0,1)-real-interval double genrand_real2( void ) { - return genrand_int32() * ( 1.0 / 4294967296.0 ); + return (double) genrand_int32() * ( 1.0 / 4294967296.0 ); // divided by 2^32 } @@ -183,6 +183,6 @@ double genrand_res53( void ) { unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6; - return ( a * 67108864.0 + b ) * ( 1.0 / 9007199254740992.0 ); + return ( (double) a * 67108864.0 + (double) b ) * ( 1.0 / 9007199254740992.0 ); } // These real versions are due to Isaku Wada, 2002/01/09 added Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/src/pdfutils.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -1,4 +1,4 @@ -// $Id$ +// xId: pdfutils.c 11966 2011-10-14 07:10:05Z andrewross $ // // pdf_utils.c // @@ -133,7 +133,7 @@ //-------------------------------------------------------------------------- PDFstrm * -pdf_bopen( U_CHAR *buffer, long bufmax ) +pdf_bopen( U_CHAR *buffer, size_t bufmax ) { PDFstrm *pdfs; @@ -270,7 +270,7 @@ plexit( "pdf_putc: Insufficient memory" ); } } - pdfs->buffer[pdfs->bp++] = c; + pdfs->buffer[pdfs->bp++] = (unsigned char) c; result = c; } else @@ -342,7 +342,7 @@ { if ( pdfs->bp > 0 ) { - pdfs->buffer[--pdfs->bp] = c; + pdfs->buffer[--pdfs->bp] = (unsigned char) c; result = c; } } @@ -365,8 +365,8 @@ if ( pdfs->file != NULL ) { - result = fwrite( x, 1, nitems, pdfs->file ); - pdfs->bp += nitems; + result = (int) fwrite( x, 1, (size_t) nitems, pdfs->file ); + pdfs->bp += (size_t) nitems; #ifdef PLPLOT_USE_TCL_CHANNELS } else if ( pdfs->tclChan != NULL ) @@ -411,8 +411,8 @@ if ( pdfs->file != NULL ) { - result = fread( x, 1, nitems, pdfs->file ); - pdfs->bp += nitems; + result = (int) fread( x, 1, (size_t) nitems, pdfs->file ); + pdfs->bp += (size_t) nitems; #ifdef PLPLOT_USE_TCL_CHANNELS } else if ( pdfs->tclChan != NULL ) @@ -482,7 +482,7 @@ if ( ( c = pdf_getc( pdfs ) ) == EOF ) return PDF_RDERR; - header[i] = c; + header[i] = (char) c; if ( header[i] == '\n' ) break; } @@ -531,7 +531,7 @@ if ( ( c = pdf_getc( pdfs ) ) == EOF ) return PDF_RDERR; - string[i] = c; + string[i] = (char) c; if ( c == '\0' ) break; } @@ -610,8 +610,8 @@ return PDF_RDERR; *ps = 0; - *ps |= (U_LONG) x[0]; - *ps |= (U_LONG) x[1] << 8; + *ps |= (U_SHORT) x[0]; + *ps |= (U_SHORT) x[1] << 8; return 0; } @@ -772,10 +772,11 @@ int pdf_wr_ieeef( PDFstrm *pdfs, float f ) { - double fdbl, fmant, f_new; - float fsgl, f_tmp; - int istat, ex, e_new, e_off, bias = 127; - U_LONG value, s_ieee, e_ieee, f_ieee; + double fdbl, fmant, f_new; + float fsgl, f_tmp; + int istat, ex, e_new, e_off; + const int bias = 127; + U_LONG value, s_ieee, e_ieee, f_ieee; if ( f == 0.0 ) { @@ -803,7 +804,7 @@ } else { - e_ieee = e_new + bias; + e_ieee = (U_LONG) ( e_new + bias ); f_tmp = (float) ( f_new - 1 ); } f_ieee = (U_LONG) ( f_tmp * 8388608 ); // multiply by 2^23 @@ -946,12 +947,12 @@ { PLINT i; - if ( ( *f = (PLFLT **) calloc( nx, sizeof ( PLFLT * ) ) ) == NULL ) + if ( ( *f = (PLFLT **) calloc( (size_t) nx, sizeof ( PLFLT * ) ) ) == NULL ) plexit( "Memory allocation error in \"plAlloc2dGrid\"" ); for ( i = 0; i < nx; i++ ) { - if ( ( ( *f )[i] = (PLFLT *) calloc( ny, sizeof ( PLFLT ) ) ) == NULL ) + if ( ( ( *f )[i] = (PLFLT *) calloc( (size_t) ny, sizeof ( PLFLT ) ) ) == NULL ) plexit( "Memory allocation error in \"plAlloc2dGrid\"" ); } } @@ -986,7 +987,7 @@ int i, j; PLFLT m, M; - if ( !finite( f[0][0] ) ) + if ( !isfinite( f[0][0] ) ) { M = -HUGE_VAL; m = HUGE_VAL; @@ -998,7 +999,7 @@ { for ( j = 0; j < ny; j++ ) { - if ( !finite( f[i][j] ) ) + if ( !isfinite( f[i][j] ) ) continue; if ( f[i][j] > M ) M = f[i][j]; Modified: trunk/src/plarc.c =================================================================== --- trunk/src/plarc.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/src/plarc.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -51,7 +51,7 @@ sphi = sin( DEG_TO_RAD( rotate ) ); // The number of line segments used to approximate the arc - segments = fabs( d_angle ) / ( 2.0 * M_PI ) * CIRCLE_SEGMENTS; + segments = (PLINT) ( fabs( d_angle ) / ( 2.0 * M_PI ) * CIRCLE_SEGMENTS ); // Always use at least 2 arc points, otherwise fills will break. if ( segments < 2 ) segments = 2; Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/src/plargs.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -1116,7 +1116,7 @@ // Set var (can be NULL initially) to point to optarg string - *(char **) tab->var = (const char *) optarg; + *(const char **) tab->var = optarg; break; default: @@ -1247,7 +1247,7 @@ if ( tab->syntax == NULL ) continue; - len = 3 + strlen( tab->syntax ); // space [ string ] + len = 3 + (int) strlen( tab->syntax ); // space [ string ] if ( col + len > 79 ) { fprintf( stderr, "\n " ); // 3 spaces @@ -1728,7 +1728,8 @@ { const char *rgb; char *color_field, *alpha_field; - long bgcolor, r, g, b; + long bgcolor; + PLINT r, g, b; PLFLT a; // Strip off leading "#" (TK-ism) if present. @@ -1761,9 +1762,9 @@ switch ( strlen( color_field ) ) { case 3: - r = ( bgcolor & 0xF00 ) >> 8; - g = ( bgcolor & 0x0F0 ) >> 4; - b = ( bgcolor & 0x00F ); + r = (PLINT) ( ( bgcolor & 0xF00 ) >> 8 ); + g = (PLINT) ( ( bgcolor & 0x0F0 ) >> 4 ); + b = (PLINT) ( bgcolor & 0x00F ); r = r | ( r << 4 ); g = g | ( g << 4 ); // doubling @@ -1771,9 +1772,9 @@ break; case 6: - r = ( bgcolor & 0xFF0000 ) >> 16; - g = ( bgcolor & 0x00FF00 ) >> 8; - b = ( bgcolor & 0x0000FF ); + r = (PLINT) ( ( bgcolor & 0xFF0000 ) >> 16 ); + g = (PLINT) ( ( bgcolor & 0x00FF00 ) >> 8 ); + b = (PLINT) ( bgcolor & 0x0000FF ); break; default: @@ -1975,11 +1976,11 @@ static int opt_fsiz( const char *opt, const char *optarg, void *client_data ) { - PLINT bytemax; - int len = strlen( optarg ); - char lastchar = optarg[len - 1]; - PLFLT multiplier = 1.0e6; - char *spec = (char *) malloc( len + 1 ); + PLINT bytemax; + size_t len = strlen( optarg ); + char lastchar = optarg[len - 1]; + PLFLT multiplier = 1.0e6; + char *spec = (char *) malloc( len + 1 ); if ( spec == NULL ) plexit( "opt_fsiz: Insufficient memory" ); Modified: trunk/src/plbox.c =================================================================== --- trunk/src/plbox.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/src/plbox.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -65,6 +65,15 @@ static void label_box( const char *xopt, PLFLT xtick1, const char *yopt, PLFLT ytick1 ); +static void +plP_default_label_log( PLINT axis, PLFLT value, char *string, PLINT len, void *data ); + +static void +plP_default_label_log_fixed( PLINT axis, PLFLT value, char *string, PLINT len, void *data ); + +static void +plP_default_label( PLINT axis, PLFLT value, char *string, PLINT len, void *data ); + //-------------------------------------------------------------------------- // void plbox() // @@ -127,7 +136,7 @@ const char *yopt, PLFLT ytick, PLINT nysub ) { PLBOOL lax, lbx, lcx, ldx, lgx, lix, llx, lsx, ltx, lux, lwx, lxx; - PLBOOL lay, lBy, lby, lCy, lcy, ldy, lgy, liy, lly, lsy, lty, luy, lwy, lxy; + PLBOOL lay, lby, lcy, ldy, lgy, liy, lly, lsy, lty, luy, lwy, lxy; PLINT xmajor, xminor, ymajor, yminor; PLINT i, i1x, i2x, i3x, i4x, i1y, i2y, i3y, i4y; PLINT nxsub1, nysub1; @@ -1148,7 +1157,7 @@ if ( lm && right ) plztx( "v", dx, dy, wx, wy1, wy2, -0.5, pos, 0.0, string ); - lstring = strlen( string ); + lstring = (PLINT) strlen( string ); *digits = MAX( *digits, lstring ); } if ( !ll && !lo && mode ) @@ -1826,7 +1835,6 @@ PLFLT vpwxmi, vpwxma, vpwymi, vpwyma; PLFLT vpwxmin, vpwxmax, vpwymin, vpwymax; PLFLT pos, tn, offset, height, just; - PLFLT factor, tstart; const char *timefmt; PLINT i; PLINT xdigmax, xdigits, xdigmax_old, xdigits_old; @@ -1834,7 +1842,7 @@ PLINT lxmin, lxmax, lymin, lymax; PLINT pxmin, pxmax, pymin, pymax; PLFLT default_mm, char_height_mm, height_mm; - PLFLT string_length_mm, pos_mm; + PLFLT string_length_mm = 0.0, pos_mm = 0.0; plgchr( &default_mm, &char_height_mm ); @@ -2364,7 +2372,7 @@ void plP_default_label_log( PLINT axis, PLFLT value, char *string, PLINT len, void *data ) { // Exponential, i.e. 10^-1, 10^0, 10^1, etc - snprintf( string, len, "10#u%d", (int) ROUND( value ) ); + snprintf( string, (size_t) len, "10#u%d", (int) ROUND( value ) ); } void plP_default_label_log_fixed( PLINT axis, PLFLT value, char *string, PLINT len, void *data ) @@ -2378,11 +2386,11 @@ { char form[FORMAT_LEN]; snprintf( form, FORMAT_LEN, "%%.%df", ABS( exponent ) ); - snprintf( string, len, form, value ); + snprintf( string, (size_t) len, form, value ); } else { - snprintf( string, len, "%d", (int) value ); + snprintf( string, (size_t) len, "%d", (int) value ); } } @@ -2411,7 +2419,7 @@ snprintf( form, FORMAT_LEN, "%%.%df", (int) prec ); snprintf( temp, TEMP_LEN, form, value ); - strncpy( string, temp, len - 1 ); + strncpy( string, temp, (size_t) ( len - 1 ) ); string[len - 1] = '\0'; } Modified: trunk/src/plbuf.c =================================================================== --- trunk/src/plbuf.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/src/plbuf.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -115,8 +115,8 @@ wr_data( pls, &npts, sizeof ( PLINT ) ); - wr_data( pls, xa, sizeof ( short ) * npts ); - wr_data( pls, ya, sizeof ( short ) * npts ); + wr_data( pls, xa, sizeof ( short ) * (size_t) npts ); + wr_data( pls, ya, sizeof ( short ) * (size_t) npts ); } //-------------------------------------------------------------------------- @@ -265,9 +265,9 @@ wr_data( pls, &pls->dev_zmin, sizeof ( short ) ); wr_data( pls, &pls->dev_zmax, sizeof ( short ) ); - 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_ix, sizeof ( short ) * (size_t) npts ); + wr_data( pls, pls->dev_iy, sizeof ( short ) * (size_t) npts ); + wr_data( pls, pls->dev_z, sizeof ( unsigned short ) * (size_t) ( ( pls->dev_nptsX - 1 ) * ( pls->dev_nptsY - 1 ) ) ); } //-------------------------------------------------------------------------- @@ -421,8 +421,8 @@ dbug_enter( "plbuf_fill" ); wr_data( pls, &pls->dev_npts, sizeof ( PLINT ) ); - wr_data( pls, pls->dev_x, sizeof ( short ) * pls->dev_npts ); - wr_data( pls, pls->dev_y, sizeof ( short ) * pls->dev_npts ); + wr_data( pls, pls->dev_x, sizeof ( short ) * (size_t) pls->dev_npts ); + wr_data( pls, pls->dev_y, sizeof ( short ) * (size_t) pls->dev_npts ); } //-------------------------------------------------------------------------- @@ -475,8 +475,8 @@ dbug_enter( "rdbuf_line" ); - rd_data( pls, xpl, sizeof ( short ) * npts ); - rd_data( pls, ypl, sizeof ( short ) * npts ); + rd_data( pls, xpl, sizeof ( short ) * (size_t) npts ); + rd_data( pls, ypl, sizeof ( short ) * (size_t) npts ); plP_line( xpl, ypl ); } @@ -500,8 +500,8 @@ if ( npts > PL_MAXPOLY ) { - xpl = (short *) malloc( ( npts + 1 ) * sizeof ( PLINT ) ); - ypl = (short *) malloc( ( npts + 1 ) * sizeof ( PLINT ) ); + xpl = (short *) malloc( (size_t) ( npts + 1 ) * sizeof ( short ) ); + ypl = (short *) malloc( (size_t) ( npts + 1 ) * sizeof ( short ) ); if ( ( xpl == NULL ) || ( ypl == NULL ) ) { @@ -515,8 +515,8 @@ } - rd_data( pls, xpl, sizeof ( short ) * npts ); - rd_data( pls, ypl, sizeof ( short ) * npts ); + rd_data( pls, xpl, sizeof ( short ) * (size_t) npts ); + rd_data( pls, ypl, sizeof ( short ) * (size_t) npts ); plP_polyline( xpl, ypl, npts ); @@ -736,8 +736,8 @@ if ( npts > PL_MAXPOLY ) { - xpl = (short *) malloc( ( npts + 1 ) * sizeof ( PLINT ) ); - ypl = (short *) malloc( ( npts + 1 ) * sizeof ( PLINT ) ); + xpl = (short *) malloc( (size_t) ( npts + 1 ) * sizeof ( short ) ); + ypl = (short *) malloc( (size_t) ( npts + 1 ) * sizeof ( short ) ); if ( ( xpl == NULL ) || ( ypl == NULL ) ) { @@ -750,8 +750,8 @@ ypl = _ypl; } - rd_data( pls, xpl, sizeof ( short ) * npts ); - rd_data( pls, ypl, sizeof ( short ) * npts ); + rd_data( pls, xpl, sizeof ( short ) * (size_t) npts ); + rd_data( pls, ypl, sizeof ( short ) * (size_t) npts ); plP_fill( xpl, ypl, npts ); @@ -794,14 +794,14 @@ // we still allocate and copy the data because I think that method works // better in a multithreaded environment. I could be wrong. // - 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 ) ) + if ( ( ( dev_ix = (short *) malloc( (size_t) npts * sizeof ( short ) ) ) == NULL ) || + ( ( dev_iy = (short *) malloc( (size_t) npts * sizeof ( short ) ) ) == NULL ) || + ( ( dev_z = (unsigned short *) malloc( (size_t) ( ( 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_ix, sizeof ( short ) * (size_t) npts ); + rd_data( pls, dev_iy, sizeof ( short ) * (size_t) npts ); + rd_data( pls, dev_z, sizeof ( unsigned short ) * (size_t) ( ( nptsX - 1 ) * ( nptsY - 1 ) ) ); // // COMMENTED OUT by Hezekiah Carty @@ -1217,8 +1217,8 @@ // save_size = sizeof ( struct _state ) + 2 * sizeof ( struct _color_map ) - + pls->ncol0 * sizeof ( PLColor ) - + pls->ncol1 * sizeof ( PLColor ); + + (size_t) ( pls->ncol0 ) * sizeof ( PLColor ) + + (size_t) ( pls->ncol1 ) * sizeof ( PLColor ); #ifndef BUFFERED_FILE // Only copy as much of the plot buffer that is being used @@ -1340,9 +1340,9 @@ // Then we need to make space for the colormaps themselves plot_state->color_map[0].cmap = (PLColor *) buf; - buf += sizeof ( PLColor ) * pls->ncol0; + buf += sizeof ( PLColor ) * (size_t) ( pls->ncol0 ); plot_state->color_map[1].cmap = (PLColor *) buf; - buf += sizeof ( PLColor ) * pls->ncol1; + buf += sizeof ( PLColor ) * (size_t) ( pls->ncol1 ); // Save cmap 0 plot_state->color_map[0].icol = pls->icol0; Modified: trunk/src/plcont.c =================================================================== --- trunk/src/plcont.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/src/plcont.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -148,9 +148,9 @@ realloc_line( CONT_LINE *line ) { if ( ( ( line->x = (PLFLT *) realloc( line->x, - ( line->npts + LINE_ITEMS ) * sizeof ( PLFLT ) ) ) == NULL ) || + (size_t) ( line->npts + LINE_ITEMS ) * sizeof ( PLFLT ) ) ) == NULL ) || ( ( line->y = (PLFLT *) realloc( line->y, - ( line->npts + LINE_ITEMS ) * sizeof ( PLFLT ) ) ) == NULL ) ) + (size_t) ( line->npts + LINE_ITEMS ) * sizeof ( PLFLT ) ) ) == NULL ) ) plexit( "realloc_line: Insufficient memory" ); } @@ -368,9 +368,9 @@ 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 ); + snprintf( string, (size_t) len, form, mant ); snprintf( tmpstring, TMPSTRING_LEN, "#(229)10#u%d", exponent ); - strncat( string, tmpstring, len - strlen( string ) - 1 ); + strncat( string, tmpstring, (size_t) len - strlen( string ) - 1 ); if ( abs( exponent ) < limexp || value == 0.0 ) { @@ -385,7 +385,7 @@ prec = 0; snprintf( form, FORM_LEN, "%%.%df", (int) prec ); - snprintf( string, len, form, value ); + snprintf( string, (size_t) len, form, value ); } } @@ -567,14 +567,14 @@ return; } - if ( ( ipts = (PLINT **) malloc( nx * sizeof ( PLINT * ) ) ) == NULL ) + if ( ( ipts = (PLINT **) malloc( (size_t) nx * sizeof ( PLINT * ) ) ) == NULL ) { plexit( "plfcont: Insufficient memory" ); } for ( i = 0; i < nx; i++ ) { - if ( ( ipts[i] = (PLINT *) malloc( ny * sizeof ( PLINT * ) ) ) == NULL ) + if ( ( ipts[i] = (PLINT *) malloc( (size_t) ny * sizeof ( PLINT * ) ) ) == NULL ) { plexit( "plfcont: Insufficient memory" ); } Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2011-10-17 20:22:53 UTC (rev 11972) +++ trunk/src/plcore.c 2011-10-17 21:16:39 UTC (rev 11973) @@ -89,6 +89,12 @@ #include <errno.h> +int +text2num( const char *text, char end, PLUNICODE *num ); + +int +text2fci( const char *text, unsigned char *hexdigit, unsigned char *hexpower ); + //-------------------------------------------------------------------------- // Driver Interface // @@ -539,7 +545,7 @@ char *endptr; char msgbuf[BUFFER_SIZE]; - *num = strtoul( text, &endptr, 0 ); + *num = (PLUNICODE) strtoul( text, &endptr, 0 ); if ( end != endptr[0] ) { @@ -572,7 +578,7 @@ { typedef struct { - char *ptext; + const char *ptext; unsigned char hexdigit; unsigned char hexpower; } @@ -596,8 +602,8 @@ int i, length; for ( i = 0; i < N_TextLookupTable; i++ ) { - length = strlen( lookup[i].ptext ); - if ( !strncmp( text, lookup[i].ptext, length ) ) + length = (int) strlen( lookup[i].ptext ); + if ( !strncmp( text, lookup[i].ptext, (size_t) length ) ) { *hexdigit = lookup[i].hexdigit; *hexpower = lookup[i].hexpower; @@ -617,13 +623,13 @@ { if ( plsc->dev_text ) // Does the device render it's own text ? { - EscText args; - short len = 0; - char skip; - unsigned short i, j; - PLUNICODE code; - char esc; - int idx; + EscText args; + short len = 0; + char skip; + int i, j; + PLUNICODE code; + char esc; + int idx = -1; args.base = base; args.just = just; @@ -648,9 +654,9 @@ // { - 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 + len = (short) strlen( string ); // this length is only used in the loop + // 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 @@ -677,8 +683,8 @@ switch ( string[i + 1] ) { case '(': // hershey code - i += 2 + text2num( &string[i + 2], ')', &code ); - idx = plhershey2unicode( code ); + i += ( 2 + text2num( &string[i + 2], ')', &code ) ); + idx = plhershey2unicode( (int) code ); unicode_buffer[j++] = \ (PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode; @@ -690,14 +696,14 @@ // escape characters that are interpreted by the device // driver. // - if ( unicode_buffer[j - 1] == esc ) - unicode_buffer[j++] = esc; + if ( unicode_buffer[j - 1] == (PLUNICODE) esc ) + unicode_buffer[j++] = (PLUNICODE) esc; j--; skip = 1; break; case '[': // unicode - i += 2 + text2num( &string[i + 2], ']', &code ); + i += ( 2 + text2num( &string[i + 2], ']', &code ) ); unicode_buffer[j++] = code; @@ -708,8 +714,8 @@ // escape characters that are interpreted by the device // driver. // - if ( unicode_buffer[j - 1] == esc ) - unicode_buffer[j++] = esc; + if ( unicode_buffer[j - 1] == (PLUNICODE) esc ) + unicode_buffer[j++] = (PLUNICODE) esc; j--; skip = 1; break; @@ -817,7 +823,7 @@ ig = 685; else if ( ig == 647 ) ig = 686; - idx = plhershey2unicode( ig ); + idx = (int) plhershey2unicode( ig ); unicode_buffer[j++] = \ (PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode; i += 2; @@ -840,11 +846,11 @@ if ( skip == 0 ) { - PLUNICODE unichar = 0; + PLUNICODE unichar = 0; #ifdef HAVE_LIBUNICODE - char * ptr = unicode_get_utf8( string + i, &unichar ); + const char * ptr = unicode_get_utf8( string + i, &unichar ); #else - char * ptr = utf8_to_ucs4( string + i, &unichar ); + const char * ptr = utf8_to_ucs4( string + i, &unichar ); #endif if ( ptr == NULL ) { @@ -858,27 +864,27 @@ return; } unicode_buffer [j] = unichar; - i += ptr - ( string + i ) - 1; + i += (int) ( ptr - ( string + i ) - 1 ); // Search for escesc (an unescaped escape) in the input // string and adjust unicode_buffer accordingly). // - if ( unicode_buffer[j] == esc && string[i + 1] == esc ) + if ( unicode_buffer[j] == (PLUNICODE) esc && string[i + 1] == esc ) { i++; - unicode_buffer[++j] = esc; + unicode_buffer[++j] = (PLUNICODE) esc; } } j++; } if ( j > 0 ) { - args.unicode_array_len = j; // Much easier to set the length than + args.unicode_array_len = (short unsigned int) j; // Much easier to set the length than // work it out later :-) - args.unicode_array = &unicode_buffer[0]; // Get address of the - // unicode buffer (even - // though it is - // currently static) + args.unicode_array = &unicode_buffer[0]; // Get address of the + // unicode buffer (even + // though it is + // currently static) } @@ -899,7 +905,7 @@ { case '(': // hershey code i += 2 + text2num( &string[i + 2], ')', &code ); - idx = plhershey2unicode( code ); + idx = plhershey2unicode( (int) code ); args.n_char = \ (PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode; plP_esc( PLESC_TEXT_CHAR, &args ); @@ -1069,11 +1075,11 @@ if ( skip == 0 ) { - PLUNICODE unichar = 0; + PLUNICODE unichar = 0; #ifdef HAVE_LIBUNICODE - char * ptr = unicode_get_utf8( string + i, &unichar ); + const char * ptr = unicode_get_utf8( string + i, &unichar ); #else - char * ptr = utf8_to_ucs4( string + i, &unichar ); + const char * ptr = utf8_to_ucs4( string + i, &unichar ); #endif if ( ptr == NULL ) { @@ -1086,7 +1092,7 @@ plabort( buf ); return; } - i += ptr - ( string + i ) - 1; + i += (int) ( ptr - ( string + i ) - 1 ); // Search for escesc (an unescaped escape) in the input // string and adjust unicode_buffer accordingly). @@ -1094,7 +1100,7 @@ if ( string[i] == esc && string[i + 1] == esc ) { i++; - args.n_char = esc; + args.n_char = (PLUNICODE) esc; } else { @@ -1134,7 +1140,7 @@ } // convert utf8 string to ucs4 unichar -static char * +static const char * utf8_to_ucs4( const char *ptr, PLUNICODE *unichar ) { char tmp; @@ -1199,7 +1205,7 @@ } } } while ( cnt > 0 ); - return (char *) ptr; + return ptr; } // convert ucs4 unichar to utf8 string @@ -1219,31 +1225,31 @@ } else if ( ( unichar & 0xfff800 ) == 0 ) // two bytes { - *tmp = (unsigned char) 0xc0 | ( unichar >> 6 ); + *tmp = (unsigned char) 0xc0 | (unsigned char) ( unichar >> 6 ); tmp++; - *tmp = (unsigned char) 0x80 | ( unichar & 0x3f ); + *tmp = (unsigned char) 0x80 | (unsigned char) ( unichar & 0x3f ); tmp++; len = 2; } else if ( ( unichar & 0xff0000 ) == 0 ) // three bytes { - *tmp = (unsigned char) 0xe0 | ( unichar >> 12 ); + *tmp = (unsigned char) 0xe0 | (unsigned char) ( unichar >> 12 ); tmp++; - *tmp = (unsigned char) 0x80 | ( ( unichar >> 6 ) & 0x3f ); + *tmp = (unsigned char) 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ); tmp++; - *tmp = (unsigned char) 0x80 | ( unichar & 0x3f ); + *tmp = (unsigned char) 0x80 | ( (unsigned char) unichar & 0x3f ); tmp++; len = 3; } else if ( ( unichar & 0xe0000 ) == 0 ) // four bytes { - *tmp = (unsigned char) 0xf0 | ( unichar >> 18 ); + *tmp = (unsigned char) 0xf0 | (unsigned char) ( unichar >> 18 ); tmp++; - *tmp = (unsigned char) 0x80 | ( ( unichar >> 12 ) & 0x3f ); + *tmp = (unsigned char) 0x80 | (unsigned char) ( ( unichar >> 12 ) & 0x3f ); tmp++; - *tmp = (unsigned char) 0x80 | ( ( unichar >> 6 ) & 0x3f ); + *tmp = (unsigned char) 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ); tmp++; - *tmp = (unsigned char) 0x80 | ( unichar & 0x3f ); + *tmp = (unsigned char) 0x80 | (unsigned char) ( unichar & 0x3f ); tmp++; len = 4; } @@ -1335,7 +1341,7 @@ //-------------------------------------------------------------------------- void -difilt( PLINT *xscl, PLINT *yscl, PLINT npts, +difilt( PLINT *xsc, PLINT *ysc, PLINT npts, PLINT *clpxmi, PLINT *clpxma, PLINT *clpymi, PLINT *clpyma ) { PLINT i, x, y; @@ -1346,8 +1352,8 @@ { for ( i = 0; i < npts; i++ ) { - xscl[i] = (PLINT) ( plsc->dimxax * xscl[i] + plsc->dimxb ); - yscl[i]... [truncated message content] |
From: <and...@us...> - 2011-10-19 11:05:23
|
Revision: 11975 http://plplot.svn.sourceforge.net/plplot/?rev=11975&view=rev Author: andrewross Date: 2011-10-19 11:05:10 +0000 (Wed, 19 Oct 2011) Log Message: ----------- Another big round of code changes to fix compiler warnings. Modified Paths: -------------- trunk/bindings/tcl/tclAPI.c trunk/bindings/tcl/tclMatrix.c trunk/bindings/tk/plframe.c trunk/bindings/tk/plr.c trunk/bindings/tk/plserver.c trunk/bindings/tk/pltkd.h trunk/bindings/tk/tcpip.c trunk/bindings/tk/tcpip.h trunk/bindings/tk/tkMain.c trunk/drivers/cairo.c trunk/drivers/ps.c trunk/drivers/tk.c trunk/drivers/tkwin.c trunk/drivers/xwin.c trunk/examples/c++/x29.cc trunk/examples/tk/xtk01.c trunk/examples/tk/xtk02.c trunk/examples/tk/xtk04.c trunk/include/pdf.h trunk/include/plplot.h trunk/include/plxwd.h trunk/lib/csa/csa.c trunk/lib/nn/delaunay.c trunk/lib/nn/hash.c trunk/lib/nn/istack.c trunk/lib/nn/lpi.c trunk/lib/nn/nnai.c trunk/lib/nn/nncommon.c trunk/lib/nn/nnpi.c trunk/src/pdfutils.c trunk/src/plctrl.c Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-10-19 07:04:09 UTC (rev 11974) +++ trunk/bindings/tcl/tclAPI.c 2011-10-19 11:05:10 UTC (rev 11975) @@ -70,6 +70,8 @@ static int plimagefrCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plstripcCmd( ClientData, Tcl_Interp *, int, const char ** ); static int plslabelfuncCmd( ClientData, Tcl_Interp *, int, const char ** ); +void mapform( PLINT n, PLFLT *x, PLFLT *y ); +PLFLT tclMatrix_feval( PLINT i, PLINT j, PLPointer p ); // // The following structure defines all of the commands in the PLplot/Tcl @@ -78,17 +80,17 @@ typedef struct Command { - int ( *proc )(); // Procedure to process command. - ClientData clientData; // Arbitrary value to pass to proc. - int *deleteProc; // Procedure to invoke when deleting - // command. - ClientData deleteData; // Arbitrary value to pass to deleteProc - // (usually the same as clientData). + int ( *proc )( void *, struct Tcl_Interp *, int, const char ** ); // Procedure to process command. + ClientData clientData; // Arbitrary value to pass to proc. + int *deleteProc; // Procedure to invoke when deleting + // command. + ClientData deleteData; // Arbitrary value to pass to deleteProc + // (usually the same as clientData). } Command; typedef struct { - char *name; + const char *name; int ( *proc )( void *, struct Tcl_Interp *, int, const char ** ); } CmdInfo; @@ -163,13 +165,13 @@ static void Append_Cmdlist( Tcl_Interp *interp ) { - static int inited = 0; - static char** namelist; - int i, j, ncmds = sizeof ( Cmds ) / sizeof ( CmdInfo ); + static int inited = 0; + static const char** namelist; + int i, j, ncmds = sizeof ( Cmds ) / sizeof ( CmdInfo ); if ( !inited ) { - namelist = (char **) malloc( ncmds * sizeof ( char * ) ); + namelist = (const char **) malloc( (size_t) ncmds * sizeof ( char * ) ); for ( i = 0; i < ncmds; i++ ) namelist[i] = Cmds[i].name; @@ -181,7 +183,7 @@ { if ( strcmp( namelist[i], namelist[j] ) > 0 ) { - char *t = namelist[i]; + const char *t = namelist[i]; namelist[i] = namelist[j]; namelist[j] = t; } @@ -391,7 +393,7 @@ PlbasicInit( Tcl_Interp *interp ) { int debug = plsc->debug; - char *libDir = NULL; + const char *libDir = NULL; static char initScript[] = "tcl_findLibrary plplot " VERSION " \"\" plplot.tcl PL_LIBRARY pllibrary"; #ifdef PLPLOT_EXTENDED_SEARCH @@ -470,7 +472,7 @@ Tcl_ResetResult( interp ); } else - libDir = (char *) Tcl_GetVar( interp, "pllibrary", TCL_GLOBAL_ONLY ); + libDir = Tcl_GetVar( interp, "pllibrary", TCL_GLOBAL_ONLY ); } #ifdef TCL_DIR @@ -504,7 +506,7 @@ Tcl_ResetResult( interp ); } else - libDir = (char *) Tcl_GetVar( interp, "pllibrary", TCL_GLOBAL_ONLY ); + libDir = Tcl_GetVar( interp, "pllibrary", TCL_GLOBAL_ONLY ); } // Last chance, current directory @@ -1584,7 +1586,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -1624,7 +1626,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -1732,7 +1734,7 @@ y = maty->fdata; clev = matlev->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -1780,7 +1782,7 @@ clev = matlev->fdata; nlev = matlev->n[0]; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -1822,7 +1824,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -1863,7 +1865,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -1959,7 +1961,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -2000,7 +2002,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -2108,7 +2110,7 @@ y = maty->fdata; clev = matlev->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -2156,7 +2158,7 @@ clev = matlev->fdata; nlev = matlev->n[0]; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -2198,7 +2200,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -2239,7 +2241,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -2347,7 +2349,7 @@ y = maty->fdata; clev = matlev->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -2395,7 +2397,7 @@ clev = matlev->fdata; nlev = matlev->n[0]; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -2437,7 +2439,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -2478,7 +2480,7 @@ x = matx->fdata; y = maty->fdata; - z = (PLFLT **) malloc( nx * sizeof ( PLFLT * ) ); + z = (PLFLT **) malloc( (size_t) nx * sizeof ( PLFLT * ) ); for ( i = 0; i < nx; i++ ) z[i] = &matz->fdata[ I2D( i, 0 ) ]; } @@ -3506,11 +3508,11 @@ } else { - int len; + size_t len; const char *data = argc > 2 ? argv[2] : 0; tcl_xform_interp = interp; - tcl_xform_procname = strdup( argv[1] ); + tcl_xform_procname = plstrdup( argv[1] ); len = strlen( tcl_xform_template ) + strlen( tcl_xform_procname ); tcl_xform_code = malloc( len ); @@ -3949,11 +3951,11 @@ if ( return_code != TCL_OK ) { - strncpy( string, "ERROR", string_length ); + strncpy( string, "ERROR", (size_t) string_length ); } else { - strncpy( string, Tcl_GetStringResult( tcl_interp ), string_length ); + strncpy( string, Tcl_GetStringResult( tcl_interp ), (size_t) string_length ); } Tcl_DecrRefCount( label_objs[1] ); @@ -4000,13 +4002,13 @@ else { plslabelfunc( labelform, NULL ); - label_objs[0] = Tcl_NewStringObj( argv[1], strlen( argv[1] ) ); + label_objs[0] = Tcl_NewStringObj( argv[1], (int) strlen( argv[1] ) ); Tcl_IncrRefCount( label_objs[0] ); } if ( argc == 3 ) { - label_objs[3] = Tcl_NewStringObj( argv[2], strlen( argv[2] ) ); // Should change with Tcl_Obj interface + label_objs[3] = Tcl_NewStringObj( argv[2], (int) strlen( argv[2] ) ); // Should change with Tcl_Obj interface Tcl_IncrRefCount( label_objs[3] ); } else @@ -4043,7 +4045,7 @@ } else { - array = (int *) malloc( sizeof ( int ) * ( *number ) ); + array = (int *) malloc( sizeof ( int ) * (size_t) ( *number ) ); for ( i = 0; i < ( *number ); i++ ) { Tcl_ListObjIndex( interp, list, i, &elem ); @@ -4070,7 +4072,7 @@ } else { - array = (double *) malloc( sizeof ( double ) * ( *number ) ); + array = (double *) malloc( sizeof ( double ) * (size_t) ( *number ) ); for ( i = 0; i < ( *number ); i++ ) { Tcl_ListObjIndex( interp, list, i, &elem ); @@ -4100,7 +4102,7 @@ } else { - array = (char **) malloc( sizeof ( char* ) * ( *number ) ); + array = (char **) malloc( sizeof ( char* ) * (size_t) ( *number ) ); array[0] = (char *) malloc( sizeof ( char ) * ( strlen( list_strings ) + 1 ) ); idx = 0; for ( i = 0; i < ( *number ); i++ ) @@ -4109,7 +4111,7 @@ string = Tcl_GetStringFromObj( elem, &length ); array[i] = array[0] + idx; - strncpy( array[i], string, length ); + strncpy( array[i], string, (size_t) length ); idx += length + 1; array[0][idx - 1] = '\0'; } @@ -4138,13 +4140,11 @@ char **text; char **symbols; - char string[20]; int number_opts; int number_texts; int dummy; double value; - Tcl_Obj *result; Tcl_Obj *data[2]; if ( argc != 29 ) Modified: trunk/bindings/tcl/tclMatrix.c =================================================================== --- trunk/bindings/tcl/tclMatrix.c 2011-10-19 07:04:09 UTC (rev 11974) +++ trunk/bindings/tcl/tclMatrix.c 2011-10-19 11:05:10 UTC (rev 11975) @@ -151,11 +151,11 @@ for ( i = 1; i < argc; i++ ) { c = argv[i][0]; - length = strlen( argv[i] ); + length = (int) strlen( argv[i] ); // If found, set persist variable and compress argv-list - if ( ( c == '-' ) && ( strncmp( argv[i], "-persist", length ) == 0 ) ) + if ( ( c == '-' ) && ( strncmp( argv[i], "-persist", (size_t) length ) == 0 ) ) { persist = 1; argc--; @@ -206,15 +206,15 @@ argc--; argv++; c = argv[0][0]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); - if ( ( c == 'f' ) && ( strncmp( argv[0], "float", length ) == 0 ) ) + if ( ( c == 'f' ) && ( strncmp( argv[0], "float", (size_t) length ) == 0 ) ) { matPtr->type = TYPE_FLOAT; matPtr->put = MatrixPut_f; matPtr->get = MatrixGet_f; } - else if ( ( c == 'i' ) && ( strncmp( argv[0], "int", length ) == 0 ) ) + else if ( ( c == 'i' ) && ( strncmp( argv[0], "int", (size_t) length ) == 0 ) ) { matPtr->type = TYPE_INT; matPtr->put = MatrixPut_i; @@ -287,13 +287,13 @@ switch ( matPtr->type ) { case TYPE_FLOAT: - matPtr->fdata = (Mat_float *) malloc( matPtr->len * sizeof ( Mat_float ) ); + matPtr->fdata = (Mat_float *) malloc( (size_t) ( matPtr->len ) * sizeof ( Mat_float ) ); for ( i = 0; i < matPtr->len; i++ ) matPtr->fdata[i] = 0.0; break; case TYPE_INT: - matPtr->idata = (Mat_int *) malloc( matPtr->len * sizeof ( Mat_int ) ); + matPtr->idata = (Mat_int *) malloc( (size_t) ( matPtr->len ) * sizeof ( Mat_int ) ); for ( i = 0; i < matPtr->len; i++ ) matPtr->idata[i] = 0; break; @@ -550,12 +550,12 @@ argc--; argv++; c = argv[0][0]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); // dump -- send a nicely formatted listing of the array contents to stdout // (very helpful for debugging) - if ( ( c == 'd' ) && ( strncmp( argv[0], "dump", length ) == 0 ) ) + if ( ( c == 'd' ) && ( strncmp( argv[0], "dump", (size_t) length ) == 0 ) ) { for ( i = nmin[0]; i <= nmax[0]; i++ ) { @@ -578,7 +578,7 @@ // delete -- delete the array - else if ( ( c == 'd' ) && ( strncmp( argv[0], "delete", length ) == 0 ) ) + else if ( ( c == 'd' ) && ( strncmp( argv[0], "delete", (size_t) length ) == 0 ) ) { #ifdef DEBUG fprintf( stderr, "Deleting array %s\n", name ); @@ -590,9 +590,9 @@ // filter // Only works on 1d matrices - else if ( ( c == 'f' ) && ( strncmp( argv[0], "filter", length ) == 0 ) ) + else if ( ( c == 'f' ) && ( strncmp( argv[0], "filter", (size_t) length ) == 0 ) ) { - Mat_float *tmp; + Mat_float *tmpMat; int ifilt, nfilt; if ( argc != 2 ) @@ -610,36 +610,36 @@ return TCL_ERROR; } - nfilt = atoi( argv[1] ); - tmp = (Mat_float *) malloc( ( matPtr->len + 2 ) * sizeof ( Mat_float ) ); + nfilt = atoi( argv[1] ); + tmpMat = (Mat_float *) malloc( (size_t) ( matPtr->len + 2 ) * sizeof ( Mat_float ) ); for ( ifilt = 0; ifilt < nfilt; ifilt++ ) { // Set up temporary filtering array. Use even boundary conditions. - j = 0; tmp[j] = matPtr->fdata[0]; + j = 0; tmpMat[j] = matPtr->fdata[0]; for ( i = 0; i < matPtr->len; i++ ) { - j++; tmp[j] = matPtr->fdata[i]; + j++; tmpMat[j] = matPtr->fdata[i]; } - j++; tmp[j] = matPtr->fdata[matPtr->len - 1]; + j++; tmpMat[j] = matPtr->fdata[matPtr->len - 1]; // Apply 3-point binomial filter for ( i = 0; i < matPtr->len; i++ ) { j = i + 1; - matPtr->fdata[i] = 0.25 * ( tmp[j - 1] + 2 * tmp[j] + tmp[j + 1] ); + matPtr->fdata[i] = 0.25 * ( tmpMat[j - 1] + 2 * tmpMat[j] + tmpMat[j + 1] ); } } - free( (void *) tmp ); + free( (void *) tmpMat ); return TCL_OK; } // help - else if ( ( c == 'h' ) && ( strncmp( argv[0], "help", length ) == 0 ) ) + else if ( ( c == 'h' ) && ( strncmp( argv[0], "help", (size_t) length ) == 0 ) ) { Tcl_AppendResult( interp, "So you really thought there'd be help, eh? Sucker.", @@ -649,7 +649,7 @@ // info - else if ( ( c == 'i' ) && ( strncmp( argv[0], "info", length ) == 0 ) ) + else if ( ( c == 'i' ) && ( strncmp( argv[0], "info", (size_t) length ) == 0 ) ) { for ( i = 0; i < matPtr->dim; i++ ) { @@ -665,7 +665,7 @@ // max - else if ( ( c == 'm' ) && ( strncmp( argv[0], "max", length ) == 0 ) ) + else if ( ( c == 'm' ) && ( strncmp( argv[0], "max", (size_t) length ) == 0 ) ) { int len; if ( argc < 1 || argc > 2 ) @@ -706,7 +706,7 @@ // min - else if ( ( c == 'm' ) && ( strncmp( argv[0], "min", length ) == 0 ) ) + else if ( ( c == 'm' ) && ( strncmp( argv[0], "min", (size_t) length ) == 0 ) ) { int len; if ( argc < 1 || argc > 2 ) @@ -748,7 +748,7 @@ // redim // Only works on 1d matrices - else if ( ( c == 'r' ) && ( strncmp( argv[0], "redim", length ) == 0 ) ) + else if ( ( c == 'r' ) && ( strncmp( argv[0], "redim", (size_t) length ) == 0 ) ) { int newlen; void *data; @@ -772,7 +772,7 @@ switch ( matPtr->type ) { case TYPE_FLOAT: - data = realloc( matPtr->fdata, newlen * sizeof ( Mat_float ) ); + data = realloc( matPtr->fdata, (size_t) newlen * sizeof ( Mat_float ) ); if ( data == NULL ) { Tcl_AppendResult( interp, "redim failed!", @@ -785,7 +785,7 @@ break; case TYPE_INT: - data = realloc( matPtr->idata, newlen * sizeof ( Mat_int ) ); + data = realloc( matPtr->idata, (size_t) newlen * sizeof ( Mat_int ) ); if ( data == NULL ) { Tcl_AppendResult( interp, "redim failed!", @@ -804,7 +804,7 @@ // scale // Only works on 1d matrices - else if ( ( c == 's' ) && ( strncmp( argv[0], "scale", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[0], "scale", (size_t) length ) == 0 ) ) { Mat_float scale; @@ -833,7 +833,7 @@ case TYPE_INT: for ( i = 0; i < matPtr->len; i++ ) - matPtr->idata[i] *= scale; + matPtr->idata[i] = (Mat_int) ( (Mat_float) ( matPtr->idata[i] ) * scale ); break; } return TCL_OK; @@ -845,7 +845,7 @@ tclMatrixXtnsnDescr *p = head; for (; p; p = p->next ) { - if ( ( c == p->cmd[0] ) && ( strncmp( argv[0], p->cmd, length ) == 0 ) ) + if ( ( c == p->cmd[0] ) && ( strncmp( argv[0], p->cmd, (size_t) length ) == 0 ) ) { #ifdef DEBUG printf( "found a match, invoking %s\n", p->cmd ); @@ -980,7 +980,7 @@ if ( ( strlen( string ) > 2 ) && ( strncmp( string, "0x", 2 ) == 0 ) ) { - matPtr->idata[index] = strtoul( &string[2], NULL, 16 ); + matPtr->idata[index] = (Mat_int) strtoul( &string[2], NULL, 16 ); } else matPtr->idata[index] = atoi( string ); Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2011-10-19 07:04:09 UTC (rev 11974) +++ trunk/bindings/tk/plframe.c 2011-10-19 11:05:10 UTC (rev 11975) @@ -212,7 +212,7 @@ static Tk_ConfigSpec configSpecs[] = { { TK_CONFIG_BORDER, "-background", "background", "Background", DEF_PLFRAME_BG_COLOR, Tk_Offset( PlFrame, border ), - TK_CONFIG_COLOR_ONLY }, + TK_CONFIG_COLOR_ONLY, NULL }, // // {TK_CONFIG_COLOR, (char *) NULL, (char *) NULL, (char *) NULL, // (char *) NULL, Tk_Offset(PlFrame, bgColor), @@ -221,11 +221,11 @@ #ifndef MAC_TCL { TK_CONFIG_COLOR, "-plbg", "plbackground", "Plbackground", DEF_PLFRAME_BG_COLOR, Tk_Offset( PlFrame, bgColor ), - TK_CONFIG_COLOR_ONLY }, + TK_CONFIG_COLOR_ONLY, NULL }, #endif { TK_CONFIG_BORDER, "-background", "background", "Background", DEF_PLFRAME_BG_MONO, Tk_Offset( PlFrame, border ), - TK_CONFIG_MONO_ONLY }, + TK_CONFIG_MONO_ONLY, NULL }, // // {TK_CONFIG_COLOR, (char *) NULL, (char *) NULL, (char *) NULL, // (char *) NULL, Tk_Offset(PlFrame, bgColor), @@ -234,36 +234,36 @@ #ifndef MAC_TCL { TK_CONFIG_COLOR, "-plbg", (char *) NULL, (char *) NULL, DEF_PLFRAME_BG_MONO, Tk_Offset( PlFrame, bgColor ), - TK_CONFIG_MONO_ONLY }, + TK_CONFIG_MONO_ONLY, NULL }, #endif { TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *) NULL, - (char *) NULL, 0, 0 }, + (char *) NULL, 0, 0, NULL }, { TK_CONFIG_SYNONYM, "-bg", "background", (char *) NULL, - (char *) NULL, 0, 0 }, + (char *) NULL, 0, 0, NULL }, { TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_PLFRAME_BORDER_WIDTH, Tk_Offset( PlFrame, borderWidth ), 0 }, + DEF_PLFRAME_BORDER_WIDTH, Tk_Offset( PlFrame, borderWidth ), 0, NULL }, { TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", - DEF_PLFRAME_CURSOR, Tk_Offset( PlFrame, cursor ), TK_CONFIG_NULL_OK }, + DEF_PLFRAME_CURSOR, Tk_Offset( PlFrame, cursor ), TK_CONFIG_NULL_OK, NULL }, { TK_CONFIG_STRING, "-bopcmd", "bopcmd", "PgCommand", - (char *) NULL, Tk_Offset( PlFrame, bopCmd ), TK_CONFIG_NULL_OK }, + (char *) NULL, Tk_Offset( PlFrame, bopCmd ), TK_CONFIG_NULL_OK, NULL }, { TK_CONFIG_STRING, "-eopcmd", "eopcmd", "PgCommand", - (char *) NULL, Tk_Offset( PlFrame, eopCmd ), TK_CONFIG_NULL_OK }, + (char *) NULL, Tk_Offset( PlFrame, eopCmd ), TK_CONFIG_NULL_OK, NULL }, { TK_CONFIG_PIXELS, "-height", "height", "Height", - DEF_PLFRAME_HEIGHT, Tk_Offset( PlFrame, height ), 0 }, + DEF_PLFRAME_HEIGHT, Tk_Offset( PlFrame, height ), 0, NULL }, { TK_CONFIG_RELIEF, "-relief", "relief", "Relief", - DEF_PLFRAME_RELIEF, Tk_Offset( PlFrame, relief ), 0 }, + DEF_PLFRAME_RELIEF, Tk_Offset( PlFrame, relief ), 0, NULL }, { TK_CONFIG_PIXELS, "-width", "width", "Width", - DEF_PLFRAME_WIDTH, Tk_Offset( PlFrame, width ), 0 }, + DEF_PLFRAME_WIDTH, Tk_Offset( PlFrame, width ), 0, NULL }, { TK_CONFIG_BOOLEAN, "-xhairs", (char *) NULL, (char *) NULL, - "0", Tk_Offset( PlFrame, xhairs ), TK_CONFIG_DONT_SET_DEFAULT }, + "0", Tk_Offset( PlFrame, xhairs ), TK_CONFIG_DONT_SET_DEFAULT, NULL }, { TK_CONFIG_BOOLEAN, "-rubberband", (char *) NULL, (char *) NULL, - "0", Tk_Offset( PlFrame, rband ), TK_CONFIG_DONT_SET_DEFAULT }, + "0", Tk_Offset( PlFrame, rband ), TK_CONFIG_DONT_SET_DEFAULT, NULL }, { TK_CONFIG_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - (char *) NULL, Tk_Offset( PlFrame, xScrollCmd ), TK_CONFIG_NULL_OK }, + (char *) NULL, Tk_Offset( PlFrame, xScrollCmd ), TK_CONFIG_NULL_OK, NULL }, { TK_CONFIG_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", - (char *) NULL, Tk_Offset( PlFrame, yScrollCmd ), TK_CONFIG_NULL_OK }, + (char *) NULL, Tk_Offset( PlFrame, yScrollCmd ), TK_CONFIG_NULL_OK, NULL }, { TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL, - (char *) NULL, 0, 0 } + (char *) NULL, 0, 0, NULL } }; // Forward declarations for procedures defined later in this file: @@ -540,7 +540,7 @@ } Tk_Preserve( (ClientData) plFramePtr ); c = argv[1][0]; - length = strlen( argv[1] ); + length = (int) strlen( argv[1] ); // First, before anything else, we have to set the stream to be the one that // corresponds to this widget. @@ -548,14 +548,14 @@ // cmd -- issue a command to the PLplot library - if ( ( c == 'c' ) && ( strncmp( argv[1], "cmd", length ) == 0 ) ) + if ( ( c == 'c' ) && ( strncmp( argv[1], "cmd", (size_t) length ) == 0 ) ) { result = Cmd( interp, plFramePtr, argc - 2, argv + 2 ); } // cget - else if ( ( c == 'c' ) && ( strncmp( argv[1], "cget", length ) == 0 ) ) + else if ( ( c == 'c' ) && ( strncmp( argv[1], "cget", (size_t) length ) == 0 ) ) { if ( argc > 2 ) { @@ -573,7 +573,7 @@ // configure - else if ( ( c == 'c' ) && ( strncmp( argv[1], "configure", length ) == 0 ) ) + else if ( ( c == 'c' ) && ( strncmp( argv[1], "configure", (size_t) length ) == 0 ) ) { if ( argc == 2 ) { @@ -595,8 +595,8 @@ // double buffering else if ( ( c == 'd' ) && - ( ( strncmp( argv[1], "db", length ) == 0 ) || - ( strncmp( argv[1], "doublebuffering", length == 0 ) ) ) ) + ( ( strncmp( argv[1], "db", (size_t) length ) == 0 ) || + ( strncmp( argv[1], "doublebuffering", (size_t) length == 0 ) ) ) ) { PLBufferingCB bcb; @@ -625,7 +625,7 @@ // closelink -- Close a binary data link previously opened with openlink - else if ( ( c == 'c' ) && ( strncmp( argv[1], "closelink", length ) == 0 ) ) + else if ( ( c == 'c' ) && ( strncmp( argv[1], "closelink", (size_t) length ) == 0 ) ) { if ( argc > 2 ) { @@ -642,7 +642,7 @@ // draw -- rubber-band draw used in region selection - else if ( ( c == 'd' ) && ( strncmp( argv[1], "draw", length ) == 0 ) ) + else if ( ( c == 'd' ) && ( strncmp( argv[1], "draw", (size_t) length ) == 0 ) ) { if ( argc == 2 ) { @@ -659,31 +659,31 @@ // color-manipulating commands, grouped together for convenience - else if ( ( ( c == 'g' ) && ( ( strncmp( argv[1], "gcmap0", length ) == 0 ) || - ( strncmp( argv[1], "gcmap1", length ) == 0 ) ) ) || - ( ( c == 's' ) && ( ( strncmp( argv[1], "scmap0", length ) == 0 ) || - ( strncmp( argv[1], "scmap1", length ) == 0 ) || - ( strncmp( argv[1], "scol0", length ) == 0 ) || - ( strncmp( argv[1], "scol1", length ) == 0 ) ) ) ) + else if ( ( ( c == 'g' ) && ( ( strncmp( argv[1], "gcmap0", (size_t) length ) == 0 ) || + ( strncmp( argv[1], "gcmap1", (size_t) length ) == 0 ) ) ) || + ( ( c == 's' ) && ( ( strncmp( argv[1], "scmap0", (size_t) length ) == 0 ) || + ( strncmp( argv[1], "scmap1", (size_t) length ) == 0 ) || + ( strncmp( argv[1], "scol0", (size_t) length ) == 0 ) || + ( strncmp( argv[1], "scol1", (size_t) length ) == 0 ) ) ) ) result = ColorManip( interp, plFramePtr, argc - 1, argv + 1 ); // info -- returns requested info - else if ( ( c == 'i' ) && ( strncmp( argv[1], "info", length ) == 0 ) ) + else if ( ( c == 'i' ) && ( strncmp( argv[1], "info", (size_t) length ) == 0 ) ) { result = Info( interp, plFramePtr, argc - 2, argv + 2 ); } // orient -- Set plot orientation - else if ( ( c == 'o' ) && ( strncmp( argv[1], "orient", length ) == 0 ) ) + else if ( ( c == 'o' ) && ( strncmp( argv[1], "orient", (size_t) length ) == 0 ) ) { result = Orient( interp, plFramePtr, argc - 2, argv + 2 ); } // openlink -- Open a binary data link (FIFO or socket) - else if ( ( c == 'o' ) && ( strncmp( argv[1], "openlink", length ) == 0 ) ) + else if ( ( c == 'o' ) && ( strncmp( argv[1], "openlink", (size_t) length ) == 0 ) ) { if ( argc < 3 ) { @@ -700,21 +700,21 @@ // page -- change or return output page setup - else if ( ( c == 'p' ) && ( strncmp( argv[1], "page", length ) == 0 ) ) + else if ( ( c == 'p' ) && ( strncmp( argv[1], "page", (size_t) length ) == 0 ) ) { result = Page( interp, plFramePtr, argc - 2, argv + 2 ); } // print -- prints plot - else if ( ( c == 'p' ) && ( strncmp( argv[1], "print", length ) == 0 ) ) + else if ( ( c == 'p' ) && ( strncmp( argv[1], "print", (size_t) length ) == 0 ) ) { result = Print( interp, plFramePtr, argc - 2, argv + 2 ); } // redraw -- redraw plot - else if ( ( c == 'r' ) && ( strncmp( argv[1], "redraw", length ) == 0 ) ) + else if ( ( c == 'r' ) && ( strncmp( argv[1], "redraw", (size_t) length ) == 0 ) ) { if ( argc > 2 ) { @@ -731,28 +731,28 @@ // report -- find out useful info about the plframe (GMF) - else if ( ( c == 'r' ) && ( strncmp( argv[1], "report", length ) == 0 ) ) + else if ( ( c == 'r' ) && ( strncmp( argv[1], "report", (size_t) length ) == 0 ) ) { result = report( interp, plFramePtr, argc - 2, argv + 2 ); } // save -- saves plot to the specified plot file type - else if ( ( c == 's' ) && ( strncmp( argv[1], "save", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[1], "save", (size_t) length ) == 0 ) ) { result = Save( interp, plFramePtr, argc - 2, argv + 2 ); } // view -- change or return window into plot - else if ( ( c == 'v' ) && ( strncmp( argv[1], "view", length ) == 0 ) ) + else if ( ( c == 'v' ) && ( strncmp( argv[1], "view", (size_t) length ) == 0 ) ) { result = View( interp, plFramePtr, argc - 2, argv + 2 ); } // xscroll -- horizontally scroll window into plot - else if ( ( c == 'x' ) && ( strncmp( argv[1], "xscroll", length ) == 0 ) ) + else if ( ( c == 'x' ) && ( strncmp( argv[1], "xscroll", (size_t) length ) == 0 ) ) { if ( argc == 2 || argc > 3 ) { @@ -769,7 +769,7 @@ // yscroll -- vertically scroll window into plot - else if ( ( c == 'y' ) && ( strncmp( argv[1], "yscroll", length ) == 0 ) ) + else if ( ( c == 'y' ) && ( strncmp( argv[1], "yscroll", (size_t) length ) == 0 ) ) { if ( argc == 2 || argc > 3 ) { @@ -1012,20 +1012,20 @@ { int x0_old, x1_old, y0_old, y1_old, x0_new, x1_new, y0_new, y1_new; - x0_old = plFramePtr->pldis.x; - y0_old = plFramePtr->pldis.y; - x1_old = x0_old + plFramePtr->pldis.width; - y1_old = y0_old + plFramePtr->pldis.height; + x0_old = (int) plFramePtr->pldis.x; + y0_old = (int) plFramePtr->pldis.y; + x1_old = x0_old + (int) plFramePtr->pldis.width; + y1_old = y0_old + (int) plFramePtr->pldis.height; x0_new = event->x; y0_new = event->y; x1_new = x0_new + event->width; y1_new = y0_new + event->height; - plFramePtr->pldis.x = MIN( x0_old, x0_new ); - plFramePtr->pldis.y = MIN( y0_old, y0_new ); - plFramePtr->pldis.width = MAX( x1_old, x1_new ) - plFramePtr->pldis.x; - plFramePtr->pldis.height = MAX( y1_old, y1_new ) - plFramePtr->pldis.y; + plFramePtr->pldis.x = (unsigned int) MIN( x0_old, x0_new ); + plFramePtr->pldis.y = (unsigned int) MIN( y0_old, y0_new ); + plFramePtr->pldis.width = (unsigned int) MAX( x1_old, x1_new ) - plFramePtr->pldis.x; + plFramePtr->pldis.height = (unsigned int) MAX( y1_old, y1_new ) - plFramePtr->pldis.y; } // Invoke DoWhenIdle handler to redisplay widget. @@ -1377,11 +1377,11 @@ if ( plFramePtr->drawing_xhairs ) UpdateXhairs( plFramePtr ); - plFramePtr->xhair_x[0].x = xmin; plFramePtr->xhair_x[0].y = y0; - plFramePtr->xhair_x[1].x = xmax; plFramePtr->xhair_x[1].y = y0; + plFramePtr->xhair_x[0].x = (short) xmin; plFramePtr->xhair_x[0].y = (short) y0; + plFramePtr->xhair_x[1].x = (short) xmax; plFramePtr->xhair_x[1].y = (short) y0; - plFramePtr->xhair_y[0].x = x0; plFramePtr->xhair_y[0].y = ymin; - plFramePtr->xhair_y[1].x = x0; plFramePtr->xhair_y[1].y = ymax; + plFramePtr->xhair_y[0].x = (short) x0; plFramePtr->xhair_y[0].y = (short) ymin; + plFramePtr->xhair_y[1].x = (short) x0; plFramePtr->xhair_y[1].y = (short) ymax; UpdateXhairs( plFramePtr ); } @@ -1430,8 +1430,8 @@ win_y >= 0 && win_y < Tk_Height( tkwin ) ) { // Okay, pointer is in our window. - plFramePtr->rband_pt[0].x = win_x; - plFramePtr->rband_pt[0].y = win_y; + plFramePtr->rband_pt[0].x = (short) win_x; + plFramePtr->rband_pt[0].y = (short) win_y; DrawRband( plFramePtr, win_x, win_y ); plFramePtr->drawing_rband = 1; @@ -1510,7 +1510,7 @@ if ( plFramePtr->drawing_rband ) UpdateRband( plFramePtr ); - plFramePtr->rband_pt[1].x = x0; plFramePtr->rband_pt[1].y = y0; + plFramePtr->rband_pt[1].x = (short) x0; plFramePtr->rband_pt[1].y = (short) y0; UpdateRband( plFramePtr ); } @@ -1563,7 +1563,7 @@ if ( !plFramePtr->tkwin_initted ) { plsstrm( plFramePtr->ipls ); - plsxwin( Tk_WindowId( tkwin ) ); + plsxwin( (PLINT) Tk_WindowId( tkwin ) ); plspause( 0 ); plinit(); // plplot_ccmap is statically defined in plxwd.h. Note that @@ -1739,8 +1739,8 @@ else if ( ( plFramePtr->width != plFramePtr->prevWidth ) || ( plFramePtr->height != plFramePtr->prevHeight ) ) { - plFramePtr->pldis.width = plFramePtr->width; - plFramePtr->pldis.height = plFramePtr->height; + plFramePtr->pldis.width = (unsigned int) plFramePtr->width; + plFramePtr->pldis.height = (unsigned int) plFramePtr->height; plsstrm( plFramePtr->ipls ); pl_cmd( PLESC_RESIZE, (void *) &( plFramePtr->pldis ) ); @@ -1766,10 +1766,10 @@ // Reset window bounds so that next time they are set fresh - plFramePtr->pldis.x = Tk_X( tkwin ) + Tk_Width( tkwin ); - plFramePtr->pldis.y = Tk_Y( tkwin ) + Tk_Height( tkwin ); - plFramePtr->pldis.width = -Tk_Width( tkwin ); - plFramePtr->pldis.height = -Tk_Height( tkwin ); + plFramePtr->pldis.x = (unsigned int) ( Tk_X( tkwin ) + Tk_Width( tkwin ) ); + plFramePtr->pldis.y = (unsigned int) ( Tk_Y( tkwin ) + Tk_Height( tkwin ) ); + plFramePtr->pldis.width = (unsigned int) ( -Tk_Width( tkwin ) ); + plFramePtr->pldis.height = (unsigned int) ( -Tk_Height( tkwin ) ); } // Update graphic crosshairs if necessary @@ -1829,9 +1829,9 @@ ( pls->cmap0[i].g != g ) || ( pls->cmap0[i].b != b ) ) { - pls->cmap0[i].r = r; - pls->cmap0[i].g = g; - pls->cmap0[i].b = b; + pls->cmap0[i].r = (unsigned char) r; + pls->cmap0[i].g = (unsigned char) g; + pls->cmap0[i].b = (unsigned char) b; *p_changed = 1; } @@ -1960,12 +1960,12 @@ plsstrm( plFramePtr->ipls ); c = argv[0][0]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); // gcmap0 -- get color map 0 // first arg is number of colors, the rest are hex number specifications - if ( ( c == 'g' ) && ( strncmp( argv[0], "gcmap0", length ) == 0 ) ) + if ( ( c == 'g' ) && ( strncmp( argv[0], "gcmap0", (size_t) length ) == 0 ) ) { int i; unsigned long plcolor; @@ -1975,9 +1975,9 @@ Tcl_AppendElement( interp, str ); for ( i = 0; i < pls->ncol0; i++ ) { - plcolor = ( ( pls->cmap0[i].r << 16 ) | - ( pls->cmap0[i].g << 8 ) | - ( pls->cmap0[i].b ) ); + plcolor = (unsigned long) ( ( pls->cmap0[i].r << 16 ) | + ( pls->cmap0[i].g << 8 ) | + ( pls->cmap0[i].b ) ); sprintf( str, "#%06lx", ( plcolor & 0xFFFFFF ) ); Tcl_AppendElement( interp, str ); @@ -1989,7 +1989,7 @@ // first arg is number of control points // the rest are hex number specifications followed by positions (0-100) - else if ( ( c == 'g' ) && ( strncmp( argv[0], "gcmap1", length ) == 0 ) ) + else if ( ( c == 'g' ) && ( strncmp( argv[0], "gcmap1", (size_t) length ) == 0 ) ) { int i; unsigned long plcolor; @@ -2011,7 +2011,7 @@ g1 = MAX( 0, MIN( 255, (int) ( 256. * g ) ) ); b1 = MAX( 0, MIN( 255, (int) ( 256. * b ) ) ); - plcolor = ( ( r1 << 16 ) | ( g1 << 8 ) | ( b1 ) ); + plcolor = (unsigned long) ( ( r1 << 16 ) | ( g1 << 8 ) | ( b1 ) ); sprintf( str, "#%06lx", ( plcolor & 0xFFFFFF ) ); Tcl_AppendElement( interp, str ); @@ -2028,7 +2028,7 @@ // scmap0 -- set color map 0 // first arg is number of colors, the rest are hex number specifications - else if ( ( c == 's' ) && ( strncmp( argv[0], "scmap0", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[0], "scmap0", (size_t) length ) == 0 ) ) { int i, changed = 1, ncol0 = atoi( argv[1] ); char *col; @@ -2063,7 +2063,7 @@ // scmap1 -- set color map 1 // first arg is number of colors, the rest are hex number specifications - else if ( ( c == 's' ) && ( strncmp( argv[0], "scmap1", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[0], "scmap1", (size_t) length ) == 0 ) ) { int i, changed = 1, ncp1 = atoi( argv[1] ); char *col, *pos, *rev; @@ -2098,8 +2098,7 @@ if ( changed ) { - PLStream *pls = plFramePtr->pls; - pls->ncp1 = ncp1; + plFramePtr->pls->ncp1 = ncp1; plcmap1_calc(); } } @@ -2107,7 +2106,7 @@ // scol0 -- set single color in cmap0 // first arg is the color number, the next is the color in hex - else if ( ( c == 's' ) && ( strncmp( argv[0], "scol0", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[0], "scol0", (size_t) length ) == 0 ) ) { int i = atoi( argv[1] ), changed = 1; @@ -2128,7 +2127,7 @@ // scol1 -- set color of control point in cmap1 // first arg is the control point, the next two are the color in hex and pos - else if ( ( c == 's' ) && ( strncmp( argv[0], "scol1", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[0], "scol1", (size_t) length ) == 0 ) ) { int i = atoi( argv[1] ), changed = 1; @@ -2354,7 +2353,7 @@ register Tk_Window tkwin = plFramePtr->tkwin; int result = TCL_OK; char c = argv[0][0]; - int length = strlen( argv[0] ); + int length = (int) strlen( argv[0] ); // Make sure widget has been initialized before going any further @@ -2365,14 +2364,14 @@ // init -- sets up for rubber-band drawing - if ( ( c == 'i' ) && ( strncmp( argv[0], "init", length ) == 0 ) ) + if ( ( c == 'i' ) && ( strncmp( argv[0], "init", (size_t) length ) == 0 ) ) { Tk_DefineCursor( tkwin, plFramePtr->xhair_cursor ); } // end -- ends rubber-band drawing - else if ( ( c == 'e' ) && ( strncmp( argv[0], "end", length ) == 0 ) ) + else if ( ( c == 'e' ) && ( strncmp( argv[0], "end", (size_t) length ) == 0 ) ) { Tk_DefineCursor( tkwin, plFramePtr->cursor ); if ( plFramePtr->continue_draw ) @@ -2389,7 +2388,7 @@ // rect -- draw a rectangle, used to select rectangular areas // first draw erases old outline - else if ( ( c == 'r' ) && ( strncmp( argv[0], "rect", length ) == 0 ) ) + else if ( ( c == 'r' ) && ( strncmp( argv[0], "rect", (size_t) length ) == 0 ) ) { if ( argc < 5 ) { @@ -2421,11 +2420,11 @@ XSync( Tk_Display( tkwin ), 0 ); } - plFramePtr->pts[0].x = x0; plFramePtr->pts[0].y = y0; - plFramePtr->pts[1].x = x1; plFramePtr->pts[1].y = y0; - plFramePtr->pts[2].x = x1; plFramePtr->pts[2].y = y1; - plFramePtr->pts[3].x = x0; plFramePtr->pts[3].y = y1; - plFramePtr->pts[4].x = x0; plFramePtr->pts[4].y = y0; + plFramePtr->pts[0].x = (short) x0; plFramePtr->pts[0].y = (short) y0; + plFramePtr->pts[1].x = (short) x1; plFramePtr->pts[1].y = (short) y0; + plFramePtr->pts[2].x = (short) x1; plFramePtr->pts[2].y = (short) y1; + plFramePtr->pts[3].x = (short) x0; plFramePtr->pts[3].y = (short) y1; + plFramePtr->pts[4].x = (short) x0; plFramePtr->pts[4].y = (short) y0; XDrawLines( Tk_Display( tkwin ), Tk_WindowId( tkwin ), plFramePtr->xorGC, plFramePtr->pts, 5, @@ -2463,11 +2462,11 @@ } c = argv[0][0]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); // devkeys -- return list of supported device keywords - if ( ( c == 'd' ) && ( strncmp( argv[0], "devkeys", length ) == 0 ) ) + if ( ( c == 'd' ) && ( strncmp( argv[0], "devkeys", (size_t) length ) == 0 ) ) { int i = 0; while ( plFramePtr->devName[i] != NULL ) @@ -2478,7 +2477,7 @@ // devkeys -- return list of supported device types - else if ( ( c == 'd' ) && ( strncmp( argv[0], "devnames", length ) == 0 ) ) + else if ( ( c == 'd' ) && ( strncmp( argv[0], "devnames", (size_t) length ) == 0 ) ) { int i = 0; while ( plFramePtr->devDesc[i] != NULL ) @@ -2516,13 +2515,13 @@ register PLiodev *iodev = plr->iodev; char c = argv[0][0]; - int length = strlen( argv[0] ); + int length = (int) strlen( argv[0] ); dbug_enter( "Openlink" ); // Open fifo - if ( ( c == 'f' ) && ( strncmp( argv[0], "fifo", length ) == 0 ) ) + if ( ( c == 'f' ) && ( strncmp( argv[0], "fifo", (size_t) length ) == 0 ) ) { if ( argc < 1 ) { @@ -2544,7 +2543,7 @@ // Open socket - else if ( ( c == 's' ) && ( strncmp( argv[0], "socket", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[0], "socket", (size_t) length ) == 0 ) ) { if ( argc < 1 ) { @@ -2728,7 +2727,7 @@ if ( pdfs->bp == 0 ) return TCL_OK; - plr->nbytes = pdfs->bp; + plr->nbytes = (int) pdfs->bp; pdfs->bp = 0; result = process_data( interp, plFramePtr ); } @@ -2984,11 +2983,11 @@ } c = argv[0][0]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); // save to specified device & file - if ( ( c == 'a' ) && ( strncmp( argv[0], "as", length ) == 0 ) ) + if ( ( c == 'a' ) && ( strncmp( argv[0], "as", (size_t) length ) == 0 ) ) { if ( argc < 3 ) { @@ -3045,7 +3044,7 @@ // close save file - else if ( ( c == 'c' ) && ( strncmp( argv[0], "close", length ) == 0 ) ) + else if ( ( c == 'c' ) && ( strncmp( argv[0], "close", (size_t) length ) == 0 ) ) { if ( !plFramePtr->ipls_save ) { @@ -3104,12 +3103,12 @@ } c = argv[0][0]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); // view bounds -- return relative device coordinates of bounds on current // plot window - if ( ( c == 'b' ) && ( strncmp( argv[0], "bounds", length ) == 0 ) ) + if ( ( c == 'b' ) && ( strncmp( argv[0], "bounds", (size_t) length ) == 0 ) ) { char result_str[128]; xl = 0.; yl = 0.; @@ -3122,7 +3121,7 @@ // view reset -- Resets plot - if ( ( c == 'r' ) && ( strncmp( argv[0], "reset", length ) == 0 ) ) + if ( ( c == 'r' ) && ( strncmp( argv[0], "reset", (size_t) length ) == 0 ) ) { xl = 0.; yl = 0.; xr = 1.; yr = 1.; @@ -3132,7 +3131,7 @@ // view select -- set window into plot space // Specifies in terms of plot window coordinates, not device coordinates - else if ( ( c == 's' ) && ( strncmp( argv[0], "select", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[0], "select", (size_t) length ) == 0 ) ) { if ( argc < 5 ) { @@ -3151,7 +3150,7 @@ // view zoom -- set window into plot space incrementally (zoom) // Here we need to take the page (device) offsets into account - else if ( ( c == 'z' ) && ( strncmp( argv[0], "zoom", length ) == 0 ) ) + else if ( ( c == 'z' ) && ( strncmp( argv[0], "zoom", (size_t) length ) == 0 ) ) { if ( argc < 5 ) { @@ -3363,8 +3362,8 @@ return; totalUnits = height; - firstUnit = 0.5 + (PLFLT) height * ( 1. - plFramePtr->yr ); - lastUnit = 0.5 + (PLFLT) height * ( 1. - plFramePtr->yl ); + firstUnit = (int) ( 0.5 + (PLFLT) height * ( 1. - plFramePtr->yr ) ); + lastUnit = (int) ( 0.5 + (PLFLT) height * ( 1. - plFramePtr->yl ) ); windowUnits = lastUnit - firstUnit; sprintf( string, " %d %d %d %d", totalUnits, windowUnits, firstUnit, lastUnit ); @@ -3395,8 +3394,8 @@ return; totalUnits = width; - firstUnit = 0.5 + (PLFLT) width * plFramePtr->xl; - lastUnit = 0.5 + (PLFLT) width * plFramePtr->xr; + firstUnit = (int) ( 0.5 + (PLFLT) width * plFramePtr->xl ); + lastUnit = (int) ( 0.5 + (PLFLT) width * plFramePtr->xr ); windowUnits = lastUnit - firstUnit; sprintf( string, " %d %d %d %d", totalUnits, windowUnits, firstUnit, lastUnit ); Modified: trunk/bindings/tk/plr.c =================================================================== --- trunk/bindings/tk/plr.c 2011-10-19 07:04:09 UTC (rev 11974) +++ trunk/bindings/tk/plr.c 2011-10-19 11:05:10 UTC (rev 11975) @@ -116,7 +116,7 @@ dbug_enter( "plr_process" ); - while ( plr->pdfs->bp < plr->nbytes ) + while ( plr->pdfs->bp < (size_t) plr->nbytes ) { plr_cmd( c = plr_get( plr ) ); csave = c; @@ -217,28 +217,28 @@ if ( !strcmp( tag, "xmin" ) ) { plr_rd( pdf_rd_2bytes( plr->pdfs, &dum_ushort ) ); - plr->xmin = dum_ushort; + plr->xmin = (short) dum_ushort; continue; } if ( !strcmp( tag, "xmax" ) ) { plr_rd( pdf_rd_2bytes( plr->pdfs, &dum_ushort ) ); - plr->xmax = dum_ushort; + plr->xmax = (short) dum_ushort; continue; } if ( !strcmp( tag, "ymin" ) ) { plr_rd( pdf_rd_2bytes( plr->pdfs, &dum_ushort ) ); - plr->ymin = dum_ushort; + plr->ymin = (short) dum_ushort; continue; } if ( !strcmp( tag, "ymax" ) ) { plr_rd( pdf_rd_2bytes( plr->pdfs, &dum_ushort ) ); - plr->ymax = dum_ushort; + plr->ymax = (short) dum_ushort; continue; } @@ -290,7 +290,7 @@ plr_cmd( get_ncoords( plr, x + npts, y + npts, 1 ) ); npts++; - if ( npts == PL_MAXPOLY || ( plr->pdfs->bp == plr->nbytes ) ) + if ( npts == PL_MAXPOLY || ( plr->pdfs->bp == (size_t) plr->nbytes ) ) break; plr_cmd( c1 = plr_get( plr ) ); @@ -337,8 +337,8 @@ if ( n > PL_MAXPOLY ) { - xs = (short *) malloc( sizeof ( short ) * n ); - ys = (short *) malloc( sizeof ( short ) * n ); + xs = (short *) malloc( sizeof ( short ) * (size_t) n ); + ys = (short *) malloc( sizeof ( short ) * (size_t) n ); } else { @@ -428,7 +428,7 @@ case PLSTATE_COLOR0: { short icol0; - plr_rd( pdf_rd_2bytes( plr->pdfs, &icol0 ) ); + plr_rd( pdf_rd_2bytes( plr->pdfs, (unsigned short *) &icol0 ) ); if ( icol0 == PL_RGB_COLOR ) { Modified: trunk/bindings/tk/plserver.c =================================================================== --- trunk/bindings/tk/plserver.c 2011-10-19 07:04:09 UTC (rev 11974) +++ trunk/bindings/tk/plserver.c 2011-10-19 11:05:10 UTC (rev 11975) @@ -98,7 +98,7 @@ int i, myargc = argc; const char *myargv[20]; Tcl_Interp *interp; - char *helpmsg = "Command-specific options:"; + const char *helpmsg = "Command-specific options:"; #ifdef DEBUG fprintf( stderr, "Program %s called with arguments :\n", argv[0] ); Modified: trunk/bindings/tk/pltkd.h =================================================================== --- trunk/bindings/tk/pltkd.h 2011-10-19 07:04:09 UTC (rev 11974) +++ trunk/bindings/tk/pltkd.h 2011-10-19 11:05:10 UTC (rev 11975) @@ -32,9 +32,9 @@ int exit_eventloop; // Break out of event loop int pass_thru; // Skip normal error termination char *cmdbuf; // Command buffer - int cmdbuf_len; // and its length + size_t cmdbuf_len; // and its length PLiodev *iodev; // I/O device info - char *updatecmd; // Name of update command + const char *updatecmd; // Name of update command pid_t child_pid; // PID for child process int instr; // Instruction timer int max_instr; // Limit before issuing an update Modified: trunk/bindings/tk/tcpip.c =================================================================== --- trunk/bindings/tk/tcpip.c 2011-10-19 07:04:09 UTC (rev 11974) +++ trunk/bindings/tk/tcpip.c 2011-10-19 11:05:10 UTC (rev 11975) @@ -84,7 +84,6 @@ #ifdef caddr_t #undef caddr_t #endif -#define PLARGS( a ) ( ) #include <stdio.h> #include <stdlib.h> @@ -97,6 +96,7 @@ #include <unistd.h> #endif +#include "plplot.h" #include "tcpip.h" #include <tcl.h> #include <tk.h> @@ -108,7 +108,7 @@ #include <sys/uio.h> #include <errno.h> -extern int errno; +//extern int errno; #ifndef MIN #define MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) @@ -139,11 +139,13 @@ static PartialRead *partial[MAX_OPEN_FILES]; -static void pl_FreeReadBuffer PLARGS( (int fd) ); -static void pl_Unread PLARGS( ( int fd, char *buffer, - int numBytes, int copy ) ); -static int pl_Read PLARGS( ( int fd, char *buffer, int numReq ) ); +static void pl_FreeReadBuffer( int fd ); +static void pl_Unread( int fd, char *buffer, int numBytes, int copy ); +static int pl_Read( int fd, char *buffer, int numReq ); +int pl_PacketReceive( Tcl_Interp * interp, PLiodev *iodev, PDFstrm *pdfs ); +int pl_PacketSend( Tcl_Interp * interp, PLiodev *iodev, PDFstrm *pdfs ); + // //-------------------------------------------------------------------------- // @@ -162,8 +164,7 @@ // static void -pl_FreeReadBuffer( fd ) -int fd; +pl_FreeReadBuffer( int fd ) { PartialRead *readList; @@ -194,20 +195,20 @@ // static void -pl_Unread( fd, buffer, numBytes, copy ) -int fd; // File descriptor -char *buffer; // Data to unget -int numBytes; // Number of bytes to unget -int copy; // Should we copy the data, or use this - // buffer? +pl_Unread( int fd, char *buffer, int numBytes, int copy ) +//int fd; // File descriptor +//char *buffer; // Data to unget +//int numBytes; // Number of bytes to unget +//int copy; // Should we copy the data, or use this +// buffer? { PartialRead *new; new = (PartialRead *) malloc( sizeof ( PartialRead ) ); if ( copy ) { - new->buffer = (char *) malloc( numBytes ); - memcpy( new->buffer, buffer, numBytes ); + new->buffer = (char *) malloc( (size_t) numBytes ); + memcpy( new->buffer, buffer, (size_t) numBytes ); } else { @@ -238,10 +239,10 @@ // static int -pl_Read( fd, buffer, numReq ) -int fd; // File descriptor to read from -char *buffer; // Place to put the data -int numReq; // Number of bytes to get +pl_Read( int fd, char *buffer, int numReq ) +//int fd; // File descriptor to read from +//char *buffer; // Place to put the data +//int numReq; // Number of bytes to get { PartialRead *readList; PartialRead *tmp; @@ -256,7 +257,7 @@ // if ( readList == NULL ) { - numRead = read( fd, buffer, numReq ); + numRead = (int) read( fd, buffer, (size_t) numReq ); #ifdef DEBUG { int j; @@ -282,7 +283,7 @@ { numToCopy = numReq - numRead; } - memcpy( buffer + numRead, readList->buffer + readList->offset, numToCopy ); + memcpy( buffer + numRead, readList->buffer + readList->offset, (size_t) numToCopy ); // // Consume the data @@ -305,7 +306,7 @@ if ( ( numRead < numReq ) ) { numToCopy = numReq - numRead; - numRead += read( fd, buffer + numRead, numToCopy ); + numRead += (int) read( fd, buffer + numRead, (size_t) numToCopy ); } return numRead; @@ -334,9 +335,7 @@ //-------------------------------------------------------------------------- static char * -get_inet( listptr, length ) -char **listptr; -int length; +get_inet( char ** listptr, int length ) { struct in_addr *ptr; @@ -347,11 +346,7 @@ } int -plHost_ID( clientData, interp, argc, argv ) -ClientData clientData; -Tcl_Interp *interp; -int argc; -char **argv; +plHost_ID( ClientData clientData, Tcl_Interp *interp, int argc, char **argv ) { register struct hostent *hostptr; char hostname[100]; @@ -403,16 +398,13 @@ //-------------------------------------------------------------------------- // int -pl_PacketReceive( interp, iodev, pdfs ) -Tcl_Interp * interp; -PLiodev *iodev; -PDFstrm *pdfs; +pl_PacketReceive( Tcl_Interp *interp, PLiodev *iodev, PDFstrm *pdfs ) { int j, numRead; unsigned int packetLen, header[2]; int headerSize; unsigned char hbuf[8]; - char *errMsg; + const char *errMsg; pdfs->bp = 0; @@ -453,15 +445,15 @@ j = 0; header[0] = 0; - header[0] |= hbuf[j++] << 24; - header[0] |= hbuf[j++] << 16; - header[0] |= hbuf[j++] << 8; + header[0] |= (unsigned int) ( hbuf[j++] << 24 ); + header[0] |= (unsigned int) ( hbuf[j++] << 16 ); + header[0] |= (unsigned int) ( hbuf[j++] << 8 ); header[0] |= hbuf[j++]; header[1] = 0; - header[1] |= hbuf[j++] << 24; - header[1] |= hbuf[j++] << 16; - header[1] |= hbuf[j++] << 8; + header[1] |= (unsigned int) ( hbuf[j++] << 24 ); + header[1] |= (unsigned int) ( hbuf[j++] << 16 ); + header[1] |= (unsigned int) ( hbuf[j++] << 8 ); header[1] |= hbuf[j++]; // @@ -478,7 +470,7 @@ ": badly formatted packet", (char *) NULL ); return TCL_ERROR; } - packetLen = header[1] - headerSize; + packetLen = header[1] - (unsigned int) headerSize; // // Expand the size of the buffer, as needed. @@ -501,7 +493,7 @@ if ( iodev->type == 0 ) { - numRead = pl_Read( iodev->fd, (char *) pdfs->buffer, packetLen ); + numRead = pl_Read( iodev->fd, (char *) pdfs->buffer, (int) packetLen ); } else { @@ -537,7 +529,7 @@ return TCL_OK; } - pdfs->bp = numRead; + pdfs->bp = (size_t) numRead; #ifdef DEBUG fprintf( stderr, "received %d byte packet starting with:", numRead ); for ( j = 0; j < 4; j++ ) @@ -569,7 +561,7 @@ // Record the error before closing the file if ( numRead != 0 ) { - errMsg = (char *) Tcl_PosixError( interp ); + errMsg = Tcl_PosixError( interp ); } else { @@ -622,15 +614,12 @@ // int -pl_PacketSend( interp, iodev, pdfs ) -Tcl_Interp * interp; -PLiodev *iodev; -PDFstrm *pdfs; +pl_PacketSend( Tcl_Interp * interp, PLiodev *iodev, PDFstrm *pdfs ) { int j, numSent; unsigned char hbuf[8]; unsigned int packetLen, header[2]; - int len; + size_t len; char *buffer, tmp[256]; // @@ -640,7 +629,7 @@ // Next packetLen-8 bytes are buffer contents. // - packetLen = pdfs->bp + 8; + packetLen = (unsigned int) pdfs->bp + 8; header[0] = PACKET_MAGIC; header[1] = packetLen; @@ -652,15 +641,15 @@ j = 0; - hbuf[j++] = ( header[0] & (unsigned long) 0xFF000000 ) >> 24; - hbuf[j++] = ( header[0] & (unsigned long) 0x00FF0000 ) >> 16; - hbuf[j++] = ( header[0] & (unsigned long) 0x0000FF00 ) >> 8; - hbuf[j++] = ( header[0] & (unsigned long) 0x000000FF ); + hbuf[j++] = (unsigned char) ( ( header[0] & (unsigned long) 0xFF000000 ) >> 24 ); + hbuf[j++] = (unsigned char) ( ( header[0] & (unsigned long) 0x00FF0000 ) >> 16 ); + hbuf[j++] = (unsigned char) ( ( header[0] & (unsigned long) 0x0000FF00 ) >> 8 ); + hbuf[j++] = (unsigned char) ( header[0] & (unsigned long) 0x000000FF ); - hbuf[j++] = ( header[1] & (unsigned long) 0xFF000000 ) >> 24; - hbuf[j++] = ( header[1] & (unsigned long) 0x00FF0000 ) >> 16; - hbuf[j++] = ( header[1] & (unsigned long) 0x0000FF00 ) >> 8; - hbuf[j++] = ( header[1] & (unsigned long) 0x000000FF ); + hbuf[j++] = (unsigned char) ( ( header[1] & (unsigned long) 0xFF000000 ) >> 24 ); + hbuf[j++] = (unsigned char) ( ( header[1] & (unsigned long) 0x00FF0000 ) >> 16 ); + hbuf[j++] = (unsigned char) ( ( header[1] & (unsigned long) 0x0000FF00 ) >> 8 ); + hbuf[j++] = (unsigned char) ( header[1] & (unsigned long) 0x000000FF ); // // Send it off, with error checking. @@ -675,14 +664,14 @@ memcpy( buffer + 8, (char *) pdfs->buffer, pdfs->bp ); #ifdef DEBUG - fprintf( stderr, "sending %d byte packet starting with:", len ); + fprintf( stderr, "sending %z byte packet starting with:", len ); for ( j = 0; j < 12; j++ ) { fprintf( stderr, " %x", 0x000000FF & (unsigned long) buffer[j] ); } fprintf( stderr, "\n" ); #endif - numSent = write( iodev->fd, buffer, len ); + numSent = (int) write( iodev->fd, buffer, len ); free( buffer ); Modified: trunk/bindings/tk/tcpip.h =================================================================== --- trunk/bindings/tk/tcpip.h 2011-10-19 07:04:09 UTC (rev 11974) +++ trunk/bindings/tk/tcpip.h 2011-10-19 11:05:10 UTC (rev 11975) @@ -16,13 +16,11 @@ // Modified version of the "Tdp_PacketSend" command. PLDLLIMPEXP_TCLTK int -pl_PacketSend PLARGS( ( Tcl_Interp * interp, PLiodev * iodev, - PDFstrm * pdfs ) ); +pl_PacketSend( Tcl_Interp * interp, PLiodev * iodev, PDFstrm * pdfs ); // Modified version of the "Tdp_PacketReceive" command. PLDLLIMPEXP_TCLTK int -pl_PacketReceive PLARGS( ( Tcl_Interp * interp, PLiodev * iodev, - PDFstrm * pdfs ) ); +pl_PacketReceive( Tcl_Interp * interp, PLiodev * iodev, PDFstrm * pdfs ); #endif // __TCPIP_H__ Modified: trunk/bindings/tk/tkMain.c =================================================================== --- trunk/bindings/tk/tkMain.c 2011-10-19 07:04:09 UTC (rev 11974) +++ trunk/bindings/tk/tkMain.c 2011-10-19 11:05:10 UTC (rev 11975) @@ -180,8 +180,8 @@ pltkMain( int argc, const char **argv, char *RcFileName, int ( *AppInit )( Tcl_Interp *interp ) ) { - char *args, *... [truncated message content] |
From: <and...@us...> - 2011-10-19 14:43:34
|
Revision: 11977 http://plplot.svn.sourceforge.net/plplot/?rev=11977&view=rev Author: andrewross Date: 2011-10-19 14:43:26 +0000 (Wed, 19 Oct 2011) Log Message: ----------- Clean up f95 bindings to get rid of compiler warnings and make them more standards compliant. Modified Paths: -------------- trunk/bindings/f95/configurable.f90 trunk/bindings/f95/global_defines.sed trunk/bindings/f95/plplot_parameters.h trunk/bindings/f95/sc3d.c trunk/bindings/f95/sccont.c trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubs.f90 trunk/bindings/f95/sfstubsf95.f90 trunk/bindings/f95/strutil.f90 trunk/examples/f95/plf95demos.inc.cmake trunk/examples/f95/x03f.f90 trunk/examples/f95/x11f.f90 trunk/examples/f95/x14f.f90 trunk/examples/f95/x17f.f90 trunk/examples/f95/x18f.f90 trunk/examples/f95/x19f.f90 trunk/examples/f95/x20f.f90 trunk/examples/f95/x21f.f90 trunk/examples/f95/x22f.f90 trunk/examples/f95/x23f.f90 trunk/examples/f95/x29f.f90 trunk/examples/f95/x30f.f90 trunk/examples/f95/x31f.f90 Removed Paths: ------------- trunk/bindings/f95/sfstubs.h Modified: trunk/bindings/f95/configurable.f90 =================================================================== --- trunk/bindings/f95/configurable.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/configurable.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -19,14 +19,14 @@ ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA subroutine plparseopts(mode) + use plplot implicit none - include 'sfstubs.h' - integer mode - integer maxargs, iargs, numargs, index, maxindex, iargc, islen + integer :: mode + integer :: maxargs, iargs, numargs, index, maxindex, iargc, islen parameter(maxindex = maxlen/4) parameter (maxargs=20) - character*(maxlen) arg - integer*4 iargsarr(maxindex, maxargs) + character (len=maxlen) :: arg + integer, dimension(maxindex, maxargs) :: iargsarr ! write(0,'(a)') 'plparseopts not implemented on this fortran'// ! & ' platform because iargc or getarg are not available' numargs = iargc() Modified: trunk/bindings/f95/global_defines.sed =================================================================== --- trunk/bindings/f95/global_defines.sed 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/global_defines.sed 2011-10-19 14:43:26 UTC (rev 11977) @@ -40,4 +40,5 @@ /^#define/ s?^#define *\(PL_NOTSET\)[ (]*\([^ ]*\)[ )]*\(.*\)$? real(kind=plflt), parameter :: \1 = \2.0_plflt\3\n real(kind=plflt), parameter :: PL_PI = 3.1415926535897932384_plflt\n real(kind=plflt), parameter :: PL_TWOPI = 2.0_plflt*PL_PI? +/^#define/ s?^#define *\([^ ]*\)[ (]*\([oz][^ ]*\)[ )]*\(.*\)$? integer :: \1 \3\n data \1 / \2 /? /^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)[ )]*\(.*\)$? integer, parameter :: \1 = \2 \3? Modified: trunk/bindings/f95/plplot_parameters.h =================================================================== --- trunk/bindings/f95/plplot_parameters.h 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/plplot_parameters.h 2011-10-19 14:43:26 UTC (rev 11977) @@ -29,16 +29,26 @@ integer, parameter :: PLESC_HAS_TEXT = 20 ! driver draws text integer, parameter :: PLESC_IMAGE = 21 ! handle image integer, parameter :: PLESC_IMAGEOPS = 22 ! plimage related operations - integer, parameter :: DRAW_LINEX = z'01' ! draw lines parallel to the X axis - integer, parameter :: DRAW_LINEY = z'02' ! draw lines parallel to the Y axis - integer, parameter :: DRAW_LINEXY = z'03' ! draw lines parallel to both the X and Y axes - integer, parameter :: MAG_COLOR = z'04' ! draw the mesh with a color dependent of the magnitude - integer, parameter :: BASE_CONT = z'08' ! draw contour plot at bottom xy plane - integer, parameter :: TOP_CONT = z'10' ! draw contour plot at top xy plane - integer, parameter :: SURF_CONT = z'20' ! draw contour plot at surface - integer, parameter :: DRAW_SIDES = z'40' ! draw sides - integer, parameter :: FACETED = z'80' ! draw outline for each square that makes up the surface - integer, parameter :: MESH = z'100' ! draw mesh + integer :: DRAW_LINEX ! draw lines parallel to the X axis + data DRAW_LINEX / z'01' / + integer :: DRAW_LINEY ! draw lines parallel to the Y axis + data DRAW_LINEY / z'02' / + integer :: DRAW_LINEXY ! draw lines parallel to both the X and Y axes + data DRAW_LINEXY / z'03' / + integer :: MAG_COLOR ! draw the mesh with a color dependent of the magnitude + data MAG_COLOR / z'04' / + integer :: BASE_CONT ! draw contour plot at bottom xy plane + data BASE_CONT / z'08' / + integer :: TOP_CONT ! draw contour plot at top xy plane + data TOP_CONT / z'10' / + integer :: SURF_CONT ! draw contour plot at surface + data SURF_CONT / z'20' / + integer :: DRAW_SIDES ! draw sides + data DRAW_SIDES / z'40' / + integer :: FACETED ! draw outline for each square that makes up the surface + data FACETED / z'80' / + integer :: MESH ! draw mesh + data MESH / z'100' / integer, parameter :: PL_BIN_DEFAULT = 0 integer, parameter :: PL_BIN_CENTRED = 1 integer, parameter :: PL_BIN_NOEXPAND = 2 @@ -79,43 +89,79 @@ integer, parameter :: PL_X_AXIS = 1 ! The x-axis integer, parameter :: PL_Y_AXIS = 2 ! The y-axis integer, parameter :: PL_Z_AXIS = 3 ! The z-axis - integer, parameter :: PL_OPT_ENABLED = z'0001' ! Obsolete - integer, parameter :: PL_OPT_ARG = z'0002' ! Option has an argment - integer, parameter :: PL_OPT_NODELETE = z'0004' ! Don't delete after processing - integer, parameter :: PL_OPT_INVISIBLE = z'0008' ! Make invisible - integer, parameter :: PL_OPT_DISABLED = z'0010' ! Processing is disabled - integer, parameter :: PL_OPT_FUNC = z'0100' ! Call handler function - integer, parameter :: PL_OPT_BOOL = z'0200' ! Set *var = 1 - integer, parameter :: PL_OPT_INT = z'0400' ! Set *var = atoi(optarg) - integer, parameter :: PL_OPT_FLOAT = z'0800' ! Set *var = atof(optarg) - integer, parameter :: PL_OPT_STRING = z'1000' ! Set var = optarg - integer, parameter :: PL_PARSE_PARTIAL = z'0000' ! For backward compatibility - integer, parameter :: PL_PARSE_FULL = z'0001' ! Process fully & exit if error - integer, parameter :: PL_PARSE_QUIET = z'0002' ! Don't issue messages - integer, parameter :: PL_PARSE_NODELETE = z'0004' ! Don't delete options after - integer, parameter :: PL_PARSE_SHOWALL = z'0008' ! Show invisible options - integer, parameter :: PL_PARSE_OVERRIDE = z'0010' ! Obsolete - integer, parameter :: PL_PARSE_NOPROGRAM = z'0020' ! Program name NOT in *argv[0].. - integer, parameter :: PL_PARSE_NODASH = z'0040' ! Set if leading dash NOT required - integer, parameter :: PL_PARSE_SKIP = z'0080' ! Skip over unrecognized args + integer :: PL_OPT_ENABLED ! Obsolete + data PL_OPT_ENABLED / z'0001' / + integer :: PL_OPT_ARG ! Option has an argment + data PL_OPT_ARG / z'0002' / + integer :: PL_OPT_NODELETE ! Don't delete after processing + data PL_OPT_NODELETE / z'0004' / + integer :: PL_OPT_INVISIBLE ! Make invisible + data PL_OPT_INVISIBLE / z'0008' / + integer :: PL_OPT_DISABLED ! Processing is disabled + data PL_OPT_DISABLED / z'0010' / + integer :: PL_OPT_FUNC ! Call handler function + data PL_OPT_FUNC / z'0100' / + integer :: PL_OPT_BOOL ! Set *var = 1 + data PL_OPT_BOOL / z'0200' / + integer :: PL_OPT_INT ! Set *var = atoi(optarg) + data PL_OPT_INT / z'0400' / + integer :: PL_OPT_FLOAT ! Set *var = atof(optarg) + data PL_OPT_FLOAT / z'0800' / + integer :: PL_OPT_STRING ! Set var = optarg + data PL_OPT_STRING / z'1000' / + integer :: PL_PARSE_PARTIAL ! For backward compatibility + data PL_PARSE_PARTIAL / z'0000' / + integer :: PL_PARSE_FULL ! Process fully & exit if error + data PL_PARSE_FULL / z'0001' / + integer :: PL_PARSE_QUIET ! Don't issue messages + data PL_PARSE_QUIET / z'0002' / + integer :: PL_PARSE_NODELETE ! Don't delete options after + data PL_PARSE_NODELETE / z'0004' / + integer :: PL_PARSE_SHOWALL ! Show invisible options + data PL_PARSE_SHOWALL / z'0008' / + integer :: PL_PARSE_OVERRIDE ! Obsolete + data PL_PARSE_OVERRIDE / z'0010' / + integer :: PL_PARSE_NOPROGRAM ! Program name NOT in *argv[0].. + data PL_PARSE_NOPROGRAM / z'0020' / + integer :: PL_PARSE_NODASH ! Set if leading dash NOT required + data PL_PARSE_NODASH / z'0040' / + integer :: PL_PARSE_SKIP ! Skip over unrecognized args + data PL_PARSE_SKIP / z'0080' / integer, parameter :: PL_FCI_MARK = ishft(1,31) - integer, parameter :: PL_FCI_IMPOSSIBLE = z'00000000' - integer, parameter :: PL_FCI_HEXDIGIT_MASK = z'f' - integer, parameter :: PL_FCI_HEXPOWER_MASK = z'7' - integer, parameter :: PL_FCI_HEXPOWER_IMPOSSIBLE = z'f' - integer, parameter :: PL_FCI_FAMILY = z'0' - integer, parameter :: PL_FCI_STYLE = z'1' - integer, parameter :: PL_FCI_WEIGHT = z'2' - integer, parameter :: PL_FCI_SANS = z'0' - integer, parameter :: PL_FCI_SERIF = z'1' - integer, parameter :: PL_FCI_MONO = z'2' - integer, parameter :: PL_FCI_SCRIPT = z'3' - integer, parameter :: PL_FCI_SYMBOL = z'4' - integer, parameter :: PL_FCI_UPRIGHT = z'0' - integer, parameter :: PL_FCI_ITALIC = z'1' - integer, parameter :: PL_FCI_OBLIQUE = z'2' - integer, parameter :: PL_FCI_MEDIUM = z'0' - integer, parameter :: PL_FCI_BOLD = z'1' + integer :: PL_FCI_IMPOSSIBLE + data PL_FCI_IMPOSSIBLE / z'00000000' / + integer :: PL_FCI_HEXDIGIT_MASK + data PL_FCI_HEXDIGIT_MASK / z'f' / + integer :: PL_FCI_HEXPOWER_MASK + data PL_FCI_HEXPOWER_MASK / z'7' / + integer :: PL_FCI_HEXPOWER_IMPOSSIBLE + data PL_FCI_HEXPOWER_IMPOSSIBLE / z'f' / + integer :: PL_FCI_FAMILY + data PL_FCI_FAMILY / z'0' / + integer :: PL_FCI_STYLE + data PL_FCI_STYLE / z'1' / + integer :: PL_FCI_WEIGHT + data PL_FCI_WEIGHT / z'2' / + integer :: PL_FCI_SANS + data PL_FCI_SANS / z'0' / + integer :: PL_FCI_SERIF + data PL_FCI_SERIF / z'1' / + integer :: PL_FCI_MONO + data PL_FCI_MONO / z'2' / + integer :: PL_FCI_SCRIPT + data PL_FCI_SCRIPT / z'3' / + integer :: PL_FCI_SYMBOL + data PL_FCI_SYMBOL / z'4' / + integer :: PL_FCI_UPRIGHT + data PL_FCI_UPRIGHT / z'0' / + integer :: PL_FCI_ITALIC + data PL_FCI_ITALIC / z'1' / + integer :: PL_FCI_OBLIQUE + data PL_FCI_OBLIQUE / z'2' / + integer :: PL_FCI_MEDIUM + data PL_FCI_MEDIUM / z'0' / + integer :: PL_FCI_BOLD + data PL_FCI_BOLD / z'1' / integer, parameter :: PL_MAXKEY = 16 integer, parameter :: PL_MAXWINDOWS = 64 ! Max number of windows/page tracked real(kind=plflt), parameter :: PL_NOTSET = -42.0_plflt Modified: trunk/bindings/f95/sc3d.c =================================================================== --- trunk/bindings/f95/sc3d.c 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/sc3d.c 2011-10-19 14:43:26 UTC (rev 11977) @@ -24,6 +24,24 @@ #include "plstubs.h" +// Function prototypes +void PLOT3DC__( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx ); +void PLOT3DC( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx ); +void PLSURF3D( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx ); +void PLMESH( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, PLINT *lx ); +void PLMESHC( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx ); +void PLOT3D( PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, PLBOOL *side, PLINT *lx ); + void PLOT3DC__( PLFLT *x, PLFLT *y, PLFLT *z, PLINT *nx, PLINT *ny, PLINT *opt, Modified: trunk/bindings/f95/sccont.c =================================================================== --- trunk/bindings/f95/sccont.c 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/sccont.c 2011-10-19 14:43:26 UTC (rev 11977) @@ -24,6 +24,93 @@ #include "plstubs.h" +// Function prototypes +void pltr0f( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ); +void PLCON07( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, + PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel ); +void PLCON17( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, + PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, + PLFLT *xg, PLFLT *yg ); +void PLCON27( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, + PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, + PLFLT *xg, PLFLT *yg ); +void PLVEC07( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale ); +void PLVEC17( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, + PLFLT *xg, PLFLT *yg ); +void PLVEC27( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, + PLFLT *xg, PLFLT *yg ); +static void pltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ); +void PLCONT7( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx, + PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, PLFLT *ftr ); +void PLVECT7( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale, + PLFLT *ftr ); +void PLSHADE07( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *shade_min, PLFLT *shade_max, + PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, + PLINT *min_color, PLINT *min_width, + PLINT *max_color, PLINT *max_width, PLINT *lx ); +void PLSHADE17( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *shade_min, PLFLT *shade_max, + PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, + PLINT *min_color, PLINT *min_width, + PLINT *max_color, PLINT *max_width, + PLFLT *xg1, PLFLT *yg1, PLINT *lx ); +void PLSHADE27( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *shade_min, PLFLT *shade_max, + PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, + PLINT *min_color, PLINT *min_width, + PLINT *max_color, PLINT *max_width, + PLFLT *xg2, PLFLT *yg2, PLINT *lx ); +void PLSHADE7( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *shade_min, PLFLT *shade_max, + PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width, + PLINT *min_color, PLINT *min_width, + PLINT *max_color, PLINT *max_width, PLFLT *ftr, PLINT *lx ); +void PLSHADES07( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *clevel, PLINT *nlevel, PLINT *fill_width, + PLINT *cont_color, PLINT *cont_width, PLINT *lx ); +void PLSHADES17( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *clevel, PLINT *nlevel, PLINT *fill_width, + PLINT *cont_color, PLINT *cont_width, + PLFLT *xg1, PLFLT *yg1, PLINT *lx ); +void PLSHADES27( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *clevel, PLINT *nlevel, PLINT *fill_width, + PLINT *cont_color, PLINT *cont_width, + PLFLT *xg2, PLFLT *yg2, PLINT *lx ); +void PLSHADES7( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *clevel, PLINT *nlevel, PLINT *fill_width, + PLINT *cont_color, PLINT *cont_width, PLFLT *ftr, PLINT *lx ); +void PLGRIDDATA( PLFLT *x, PLFLT *y, PLFLT *z, PLINT *npts, PLFLT *xg, + PLINT *nx, PLFLT *yg, PLINT *ny, PLFLT *zg, PLINT *type, + PLFLT *data ); +void PLIMAGEFR07( PLFLT *idata, PLINT *nx, PLINT *ny, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *zmin, PLFLT *zmax, PLFLT *valuemin, PLFLT *valuemax, + PLINT *lx ); +void PLIMAGEFR17( PLFLT *idata, PLINT *nx, PLINT *ny, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *zmin, PLFLT *zmax, PLFLT *valuemin, PLFLT *valuemax, + PLFLT *xg, PLFLT *yg, PLINT *lx ); +void PLIMAGEFR27( PLFLT *idata, PLINT *nx, PLINT *ny, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *zmin, PLFLT *zmax, PLFLT *valuemin, PLFLT *valuemax, + PLFLT *xg, PLFLT *yg, PLINT *lx ); +void PLIMAGEFR7( PLFLT *idata, PLINT *nx, PLINT *ny, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *zmin, PLFLT *zmax, PLFLT *valuemin, PLFLT *valuemax, + PLFLT *ftr, PLINT *lx ); + + + + //-------------------------------------------------------------------------- // pltr0f() // Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/scstubs.c 2011-10-19 14:43:26 UTC (rev 11977) @@ -48,6 +48,222 @@ static char **pllegend_text; static char **pllegend_symbols; +// Function prototypes +static void pltransformf2c( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer data ); +void PL_SETCONTLABELFORMAT( PLINT *lexp, PLINT *sigdig ); +void PL_SETCONTLABELFORMATa( PLINT *lexp, PLINT *sigdig ); +void PL_SETCONTLABELPARAM( PLFLT *offset, PLFLT *size, PLFLT *spacing, PLINT *active ); +void PL_SETCONTLABELPARAMa( PLFLT *offset, PLFLT *size, PLFLT *spacing, PLINT *active ); +void PLABORT7( const char *text ); +void PLADV( PLINT *sub ); +void PLARC( PLFLT *x, PLFLT *y, PLFLT *a, PLFLT *b, PLFLT *angle1, PLFLT *angle2, PLFLT *rotate, PLBOOL *fill ); +void PLAXES7( PLFLT *x0, PLFLT *y0, const char *xopt, PLFLT *xtick, + PLINT *nxsub, const char *yopt, PLFLT *ytick, PLINT *nysub ); +void PLBIN( PLINT *nbin, PLFLT *x, PLFLT *y, PLINT *center ); +void PLBTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime ); +void PLBOP( void ); +void PLBOX7( const char *xopt, PLFLT *xtick, PLINT *nxsub, + const char *yopt, PLFLT *ytick, PLINT *nysub ); +void PLBOX37( const char *xopt, const char *xlabel, PLFLT *xtick, PLINT *nxsub, + const char *yopt, const char *ylabel, PLFLT *ytick, PLINT *nysub, + const char *zopt, const char *zlabel, PLFLT *ztick, PLINT *nzsub ); +void PLCALC_WORLD( PLFLT *rx, PLFLT *ry, PLFLT *wx, PLFLT *wy, PLINT *window ); +void PLCALC_WORLDa( PLFLT *rx, PLFLT *ry, PLFLT *wx, PLFLT *wy, PLINT *window ); +void PLCLEAR( void ); +void PLCOL0( PLINT *icol ); +void PLCOL1( PLFLT *col ); +void PLCONFIGTIME( PLFLT *scale, PLFLT *offset1, PLFLT *offset2, PLINT *ccontrol, PLBOOL *ifbtime_offset, PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec ); +void PLCPSTRM( PLINT *iplsr, PLBOOL *flags ); +void PLCTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime ); +void PLEND( void ); +void PLEND1( void ); +void PLENV( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLINT *just, PLINT *axis ); +void PLENV0( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLINT *just, PLINT *axis ); +void PLEOP( void ); +void PLERRX( PLINT *n, PLFLT *xmin, PLFLT *xmax, PLFLT *y ); +void PLERRY( PLINT *n, PLFLT *x, PLFLT *ymin, PLFLT *ymax ); +void PLFAMADV( void ); +void PLFILL( PLINT *n, PLFLT *x, PLFLT *y ); +void PLFILL3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z ); +void PLFLUSH( void ); +void PLFONT( PLINT *font ); +void PLFONTLD( PLINT *charset ); +void PLGCHR( PLFLT *chrdef, PLFLT *chrht ); +void PLGCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b ); +void PLGCOL0A( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a ); +void PLGCOLBG( PLINT *r, PLINT *g, PLINT *b ); +void PLGCOLBGA( PLINT *r, PLINT *g, PLINT *b, PLFLT *a ); +void PLGCOMPRESSION( PLINT *compression ); +void PLGDEV7( char *dev, int length ); +void PLGDIDEV( PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy ); +void PLGDIORI( PLFLT *p_rot ); +void PLGDIPLT( PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax ); +void PLGETCURSOR( PLGraphicsIn *gin ); +void PLGFAM( PLINT *fam, PLINT *num, PLINT *bmax ); +void PLGFCI( PLUNICODE *pfci ); +void PLGFNAM7( char *fnam, int length ); +void PLGFONT( PLINT *family, PLINT *style, PLINT *weight ); +void PLGLEVEL( PLINT *level ); +void PLGPAGE( PLFLT *xpmm, PLFLT *ypmm, PLINT *xwid, PLINT *ywid, PLINT *xoff, PLINT *yoff ); +void PLGRA( void ); +void PLGRADIENT( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *angle ); +void PLGSPA( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax ); +void PLGSTRM( PLINT *strm ); +void PLGVER7( char *ver ); +void PLGVPD( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax ); +void PLGVPW( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax ); +void PLGXAX( PLINT *digmax, PLINT *digits ); +void PLGYAX( PLINT *digmax, PLINT *digits ); +void PLGZAX( PLINT *digmax, PLINT *digits ); +void PLHIST( PLINT *n, PLFLT *data, PLFLT *datmin, PLFLT *datmax, PLINT *nbin, PLINT *oldwin ); +void PLHLS( PLFLT *hue, PLFLT *light, PLFLT *sat ); +void PLHLSRGB( PLFLT *h, PLFLT *l, PLFLT *s, PLFLT *r, PLFLT *g, PLFLT *b ); +void PLIMAGEFR( PLFLT *idata, PLINT *nx, PLINT *ny, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *zmin, PLFLT *zmax, + PLFLT *Dxmin, PLFLT *Dxmax, PLFLT *Dymin, PLFLT *Dymax, + PLFLT *valuemin, PLFLT *valuemax ); +void PLIMAGE( PLFLT *idata, PLINT *nx, PLINT *ny, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *zmin, PLFLT *zmax, + PLFLT *Dxmin, PLFLT *Dxmax, PLFLT *Dymin, PLFLT *Dymax ); +void PLINIT( void ); +void PLJOIN( PLFLT *x1, PLFLT *y1, PLFLT *x2, PLFLT *y2 ); +void PLLAB7( const char *xlab, const char *ylab, const char *title ); +void PLLEGEND_CNV_TEXT( PLINT *id, PLINT *number, char *string, PLINT length ); +void PLLEGEND( PLFLT *p_legend_width, PLFLT *p_legend_height, + PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, PLFLT *plot_width, + PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, + PLINT *nrow, PLINT *ncolumn, + PLINT *nlegend, const PLINT *opt_array, + PLFLT *text_offset, PLFLT *text_scale, PLFLT *text_spacing, + PLFLT *text_justification, + const PLINT *text_colors, + const PLINT *box_colors, const PLINT *box_patterns, + const PLFLT *box_scales, const PLINT *box_line_widths, + const PLINT *line_colors, const PLINT *line_styles, + const PLINT *line_widths, + const PLINT *symbol_colors, const PLFLT *symbol_scales, + const PLINT *symbol_numbers ); +void PLLIGHTSOURCE( PLFLT *x, PLFLT *y, PLFLT *z ); +void PLLINE( PLINT *n, PLFLT *x, PLFLT *y ); +void PLLINE3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z ); +void PLLSTY( PLINT *lin ); +void PLMAP7( const char *type, + PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat ); +void PLMERIDIANS7( PLFLT *dlong, PLFLT *dlat, + PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat ); +void PLMKSTRM( PLINT *p_strm ); +void PLMTEX7( const char *side, PLFLT *disp, PLFLT *pos, PLFLT *just, const char *text ); +void PLMTEX37( const char *side, PLFLT *disp, PLFLT *pos, PLFLT *just, const char *text ); +void PLPARSEOPTS7( int *numargs, const char *iargs, PLINT *mode, PLINT *maxindex ); +void PLPAT( PLINT *nlin, PLINT *inc, PLINT *del ); +void PLPOIN( PLINT *n, PLFLT *x, PLFLT *y, PLINT *code ); +void PLPOIN3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *code ); +void PLPOLY3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLBOOL *draw, PLBOOL *ifcc ); +void PLPREC( PLINT *setp, PLINT *prec ); +void PLPSTY( PLINT *patt ); +void PLPTEX7( PLFLT *x, PLFLT *y, PLFLT *dx, PLFLT *dy, PLFLT *just, const char *text ); +void PLPTEX37(PLFLT *x, PLFLT *y, PLFLT *z, + PLFLT *dx, PLFLT *dy, PLFLT *dz, + PLFLT *sx, PLFLT *sy, PLFLT *sz, + PLFLT *just, const char *text ); +PLFLT PLRANDD( void ); +void PLREPLOT( void ); +void PLRGB( PLFLT *red, PLFLT *green, PLFLT *blue ); +void PLRGB1( PLINT *r, PLINT *g, PLINT *b ); +void PLRGBHLS( PLFLT *r, PLFLT *g, PLFLT *b, PLFLT *h, PLFLT *l, PLFLT *s ); +void PLSCHR( PLFLT *def, PLFLT *scale ); +void PLSCMAP0( PLINT *r, PLINT *g, PLINT *b, PLINT *ncol0 ); +void PLSCMAP0A( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT *ncol0 ); +void PLSCMAP0N( PLINT *n ); +void PLSCMAP1( PLINT *r, PLINT *g, PLINT *b, PLINT *ncol1 ); +void PLSCMAP1A( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT *ncol1 ); +void PLSCMAP1L( PLBOOL *itype, PLINT *npts, PLFLT *intensity, +PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *rev ); +void PLSCMAP1L2( PLBOOL *itype, PLINT *npts, PLFLT *intensity, +PLFLT *coord1, PLFLT *coord2, PLFLT *coord3 ); +void PLSCMAP1LA( PLBOOL *itype, PLINT *npts, PLFLT *intensity, +PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *rev ); +void PLSCMAP1LA2( PLBOOL *itype, PLINT *npts, PLFLT *intensity, +PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a ); +void PLSCMAP1N( PLINT *n ); +void PLSCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b ); +void PLSCOL0A( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a ); +void PLSCOLBG( PLINT *r, PLINT *g, PLINT *b ); +void PLSCOLBGA( PLINT *r, PLINT *g, PLINT *b, PLFLT *a ); +void PLSCOLOR( PLINT *color ); +void PLSCOMPRESSION( PLINT *compression ); +void PLSDEV7( const char *dev ); +void PLSDIDEV( PLFLT *mar, PLFLT *aspect, PLFLT *jx, PLFLT *jy ); +void PLSDIMAP( PLINT *dimxmin, PLINT *dimxmax, PLINT *dimymin, PLINT *dimymax, +PLFLT *dimxpmm, PLFLT *dimypmm ); +void PLSDIORI( PLFLT *rot ); +void PLSDIPLT( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax ); +void PLSDIPLZ( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax ); +void PLSEED( unsigned int *s ); +void PLSESC( PLINT *esc ); +void PLSETOPT7( const char *opt, const char *optarg ); +void PLSFAM( PLINT *fam, PLINT *num, PLINT *bmax ); +void PLSFCI( PLUNICODE *fci ); +void PLSFNAM7( const char *fnam ); +void PLSFONT( PLINT *family, PLINT *style, PLINT *weight ); +void PLSLABELFUNC_ON( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) ); +void PLSLABELFUNC_ONa( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) ); +void PLSLABELFUNC_OFF( PLINT *dummy ); +void PLSLABELFUNC_OFFa( PLINT *dummy ); +void PLSLABELFUNC_NONE( void ); +void PLSLABELFUNC_NONEa( void ); +void PLSMAJ( PLFLT *def, PLFLT *scale ); +void PLSMEM( PLINT *maxx, PLINT *maxy, void *plotmem ); +void PLSMEMA( PLINT *maxx, PLINT *maxy, void *plotmem ); +void PLSMIN( PLFLT *def, PLFLT *scale ); +void PLSORI( PLINT *ori ); +void PLSPAGE( PLFLT *xpmm, PLFLT *ypmm, +PLINT *xwid, PLINT *ywid, PLINT *xoff, PLINT *yoff ); +void PLSPAL07( const char *filename ); +void PLSPAL17( const char *filename, PLBOOL *interpolate ); +void PLSPAUSE( PLBOOL *pause ); +void PLSSTRM( PLINT *strm ); +void PLSSUB( PLINT *nx, PLINT *ny ); +void PLSSYM( PLFLT *def, PLFLT *scale ); +void PLSTAR( PLINT *nx, PLINT *ny ); +void PLSTART7( const char *devname, PLINT *nx, PLINT *ny ); +void PLSTRANSFORM1( void ( STDCALL *transformfunc )( PLFLT *, PLFLT *, PLFLT *, PLFLT * ) ); +void PLSTRANSFORM2( PLINT *dummy ); +void PLSTRANSFORM3( void ); +void PLSTRING7( PLINT *n, PLFLT *x, PLFLT *y, const char *string ); +void PLSTRING37( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, const char *string ); +void PLSTRIPA( PLINT *id, PLINT *pen, PLFLT *x, PLFLT *y ); +void PLSTRIPC( PLINT *id, const char *xspec, const char *yspec, + PLFLT *xmin, PLFLT *xmax, PLFLT *xjump, PLFLT *ymin, PLFLT *ymax, + PLFLT *xlpos, PLFLT *ylpos, + PLBOOL *y_ascl, PLBOOL *acc, + PLINT *colbox, PLINT *collab, + PLINT *colline, PLINT *styline, + const char *legline0, const char *legline1, + const char *legline2, const char *legline3, + const char *labx, const char *laby, const char *labtop ); +void PLSTRIPD( PLINT *id ); +void PLSTYL( PLINT *n, PLINT *mark, PLINT *space ); +void PLSVECT( PLFLT *arrowx, PLFLT *arrowy, PLINT *npts, PLBOOL *fill ); +void PLSVPA( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax ); +void PLSXAX( PLINT *digmax, PLINT *digits ); +void PLSYAX( PLINT *digmax, PLINT *digits ); +void PLSYM( PLINT *n, PLFLT *x, PLFLT *y, PLINT *code ); +void PLSZAX( PLINT *digmax, PLINT *digits ); +void PLTEXT( void ); +void PLTIMEFMT7( const char *fmt ); +void PLVASP( PLFLT *aspect ); +void PLVPAS( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *aspect ); +void PLVPOR( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax ); +void PLVSTA( void ); +void PLW3D( PLFLT *basex, PLFLT *basey, PLFLT *height, + PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, + PLFLT *zmin, PLFLT *zmax, + PLFLT *alt, PLFLT *az ); +void PLWID( PLINT *width ); +void PLWIND( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax ); +void PLXORMOD( PLBOOL *mode, PLBOOL *status ); + static void pltransformf2c( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer data ) { @@ -566,13 +782,13 @@ // Ensure the strings are null terminated - p_string = (char **) malloc( sizeof ( char * ) * ( *number ) ); - data = (char *) malloc( sizeof ( char * ) * ( *number ) * ( length + 1 ) ); + p_string = (char **) malloc( sizeof ( char * ) * (size_t) ( *number ) ); + data = (char *) malloc( sizeof ( char * ) * (size_t) (( *number ) * ( length + 1 ) ) ); for ( j = 0; j < ( *number ); j++ ) { p_string[j] = data + j * ( length + 1 ); - memcpy( p_string[j], &string[j * length], length ); + memcpy( p_string[j], &string[j * length], (size_t) length ); p_string[j][length] = '\0'; i = length - 1; while ( ( i >= 0 ) && ( p_string[j][i] == ' ' ) ) @@ -963,21 +1179,24 @@ // #define PLSETMAPFORMC FNAME( PLSETMAPFORMC, plsetmapformc ) #define PLCLEARMAPFORMC FNAME( PLCLEARMAPFORMC, plclearmapformc ) +void PLSETMAPFORMC( void ( STDCALL *mapform )( PLINT *, PLFLT *, PLFLT * ) ); +void PLCLEARMAPFORMC( void ); + void PLSETMAPFORMC( void ( STDCALL *mapform )( PLINT *, PLFLT *, PLFLT * ) ) { plmapform = mapform; } void -PLCLEARMAPFORMC( ) +PLCLEARMAPFORMC( void ) { plmapform = NULL; } void -PLSETOPT7( const char *opt, const char *optarg ) +PLSETOPT7( const char *opt, const char *oarg ) { - c_plsetopt( opt, optarg ); + c_plsetopt( opt, oarg ); } void @@ -1101,9 +1320,9 @@ } void -PLSPAUSE( PLBOOL *pause ) +PLSPAUSE( PLBOOL *ipause ) { - c_plspause( *pause ); + c_plspause( *ipause ); } void Modified: trunk/bindings/f95/sfstubs.f90 =================================================================== --- trunk/bindings/f95/sfstubs.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/sfstubs.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -41,8 +41,6 @@ implicit none character*(*) opt, optarg - include 'sfstubs.h' - call plstrf2c(opt, string1, maxlen) call plstrf2c(optarg, string2, maxlen) s1 = transfer( string1, s1 ) @@ -58,8 +56,6 @@ implicit none character*(*) text - include 'sfstubs.h' - call plstrf2c(text, string1, maxlen) s1 = transfer( string1, s1 ) call plabort7(s1) @@ -73,8 +69,6 @@ implicit none character*(*) dnam - include 'sfstubs.h' - call plstrf2c(dnam, string1, maxlen) s1 = transfer( string1, s1 ) call plsdev7(s1) @@ -88,8 +82,6 @@ implicit none character*(*) dnam - include 'sfstubs.h' - call plgdev7(string1) call plstrc2f(string1, dnam) @@ -102,8 +94,6 @@ implicit none character*(*) fnam - include 'sfstubs.h' - call plstrf2c(fnam, string1, maxlen) s1 = transfer( string1, s1 ) call plsfnam7(s1) @@ -117,8 +107,6 @@ implicit none character*(*) fnam - include 'sfstubs.h' - call plgfnam7(string1) call plstrc2f(string1, fnam) @@ -131,8 +119,6 @@ implicit none character*(*) ver - include 'sfstubs.h' - call plgver7(s1) string1 = transfer( s1, string1 ) call plstrc2f(string1, ver) @@ -148,8 +134,6 @@ integer nxsub, nysub character*(*) xopt,yopt - include 'sfstubs.h' - call plstrf2c(xopt, string1, maxlen) call plstrf2c(yopt, string2, maxlen) @@ -168,8 +152,6 @@ integer nxsub, nysub character*(*) xopt,yopt - include 'sfstubs.h' - call plstrf2c(xopt, string1, maxlen) call plstrf2c(yopt, string2, maxlen) @@ -189,8 +171,6 @@ character*(*) xopt,xlabel,yopt,ylabel,zopt,zlabel integer nxsub, nysub, nzsub - include 'sfstubs.h' - call plstrf2c(xopt, string1, maxlen) call plstrf2c(xlabel, string2, maxlen) call plstrf2c(yopt, string3, maxlen) @@ -332,8 +312,6 @@ real(kind=plflt) x(:), y(:) character(len=*) string - include 'sfstubs.h' - integer n n = size(x) @@ -352,8 +330,6 @@ real(kind=plflt) x(:), y(:), z(:) character(len=*) string - include 'sfstubs.h' - integer n n = size(x) @@ -425,8 +401,6 @@ real(kind=plflt) shade_min, shade_max, sh_color real(kind=plflt) z(:,:), xmin, xmax, ymin, ymax - include 'sfstubs.h' - ! call plstrf2c(dnam, string1, maxlen) s1 = transfer( string1, s1 ) @@ -454,8 +428,6 @@ real(kind=plflt) shade_min, shade_max, sh_color real(kind=plflt) z(:,:), xmin, xmax, ymin, ymax, xg(:), yg(:) - include 'sfstubs.h' - ! call plstrf2c(dnam, string1, maxlen) s1 = transfer( string1, s1 ) @@ -484,8 +456,6 @@ real(kind=plflt) shade_min, shade_max, sh_color real(kind=plflt) z(:,:), xmin, xmax, ymin, ymax, xg(:,:), yg(:,:) - include 'sfstubs.h' - ! call plstrf2c(dnam, string1, maxlen) s1 = transfer( string1, s1 ) @@ -514,8 +484,6 @@ real(kind=plflt) z(:,:), xmin, xmax, ymin, ymax real(kind=plflt) tr(6) - include 'sfstubs.h' - s1 = transfer( string1, s1 ) call plshade7(z, size(z,1), size(z,2), s1, & xmin, xmax, ymin, ymax, & @@ -538,8 +506,6 @@ real(kind=plflt) clevel(:) real(kind=plflt) z(:,:), xmin, xmax, ymin, ymax - include 'sfstubs.h' - ! call plstrf2c(dnam, string1, maxlen) s1 = transfer( string1, s1 ) @@ -564,8 +530,6 @@ real(kind=plflt) z(:,:), xmin, xmax, ymin, ymax, & xg1(:), yg1(:) - include 'sfstubs.h' - ! call plstrf2c(dnam, string1, maxlen) s1 = transfer( string1, s1 ) @@ -590,8 +554,6 @@ real(kind=plflt) z(:,:), xmin, xmax, ymin, ymax, & xg2(:,:), yg2(:,:) - include 'sfstubs.h' - ! call plstrf2c(dnam, string1, maxlen) s1 = transfer( string1, s1 ) @@ -616,8 +578,6 @@ real(kind=plflt) z(:,:), xmin, xmax, ymin, ymax real(kind=plflt) tr(6) - include 'sfstubs.h' - ! call plstrf2c(dnam, string1, maxlen) s1 = transfer( string1, s1 ) @@ -634,7 +594,6 @@ valuemin,valuemax) implicit none - integer nx, ny, lx real(kind=plflt) z(:,:) real(kind=plflt) xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax @@ -649,7 +608,6 @@ valuemin,valuemax,xg,yg) implicit none - integer nx, ny, lx real(kind=plflt) z(:,:), xg(:), yg(:) real(kind=plflt) xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax @@ -664,7 +622,6 @@ valuemin,valuemax,xg,yg) implicit none - integer nx, ny, lx real(kind=plflt) z(:,:), xg(:,:), yg(:,:) real(kind=plflt) xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax @@ -679,7 +636,6 @@ valuemin,valuemax,tr) implicit none - integer nx, ny, lx real(kind=plflt) z(:,:) real(kind=plflt) xmin, xmax, ymin, ymax, zmin, zmax, valuemin, valuemax real(kind=plflt) tr(6) @@ -696,8 +652,6 @@ implicit none character*(*) xlab,ylab,title - include 'sfstubs.h' - call plstrf2c(xlab, string1, maxlen) call plstrf2c(ylab, string2, maxlen) call plstrf2c(title, string3, maxlen) @@ -716,8 +670,6 @@ implicit none character*(*) filename - include 'sfstubs.h' - call plstrf2c(filename, string1, maxlen) s1 = transfer( string1, s1 ) @@ -733,8 +685,6 @@ character*(*) filename integer interpolate - include 'sfstubs.h' - call plstrf2c(filename, string1, maxlen) s1 = transfer( string1, s1 ) @@ -750,8 +700,6 @@ real(kind=plflt) disp, pos, xjust character*(*) side, text - include 'sfstubs.h' - call plstrf2c(side, string1, maxlen) call plstrf2c(text, string2, maxlen) @@ -769,8 +717,6 @@ real(kind=plflt) disp, pos, xjust character*(*) side, text - include 'sfstubs.h' - call plstrf2c(side, string1, maxlen) call plstrf2c(text, string2, maxlen) @@ -788,8 +734,6 @@ real(kind=plflt) x, y, dx, dy, xjust character*(*) text - include 'sfstubs.h' - call plstrf2c(text, string1, maxlen) s1 = transfer( string1, s1 ) @@ -805,8 +749,6 @@ real(kind=plflt) x, y, z, dx, dy, dz, sx, sy, sz, xjust character*(*) text - include 'sfstubs.h' - call plstrf2c(text, string1, maxlen) s1 = transfer( string1, s1 ) @@ -822,8 +764,6 @@ character*(*) devname integer nx, ny - include 'sfstubs.h' - call plstrf2c(devname, string1, maxlen) s1 = transfer( string1, s1 ) @@ -838,8 +778,6 @@ implicit none character*(*) fmt - include 'sfstubs.h' - call plstrf2c(fmt, string1, maxlen) s1 = transfer( string1, s1 ) call pltimefmt7(s1) Deleted: trunk/bindings/f95/sfstubs.h =================================================================== --- trunk/bindings/f95/sfstubs.h 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/sfstubs.h 2011-10-19 14:43:26 UTC (rev 11977) @@ -1,41 +0,0 @@ -! $Id$ -! common blocks required for routines in sfstubs.f -! -! Copyright (C) 2004 Alan W. Irwin -! -! This file is part of PLplot. -! -! PLplot is free software; you can redistribute it and/or modify -! it under the terms of the GNU Library General Public License as -! published by the Free Software Foundation; either version 2 of the -! License, or (at your option) any later version. -! -! PLplot is distributed in the hope that it will be useful, -! but WITHOUT ANY WARRANTY; without even the implied warranty of -! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -! GNU Library General Public License for more details. -! -! You should have received a copy of the GNU Library General Public -! License along with PLplot; if not, write to the Free Software -! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - integer maxlen - parameter (maxlen = 320) - character*(maxlen) string1, string2, string3 - character*(maxlen) string4, string5, string6 - character*(maxlen) string7, string8, string9 - integer s1(80), s2(80), s3(80), s4(80), s5(80), s6(80), s7(80), s8(80), s9(80) -! equivalence ( s1, string1 ), ( s2, string2 ) -! equivalence ( s3, string3 ), ( s4, string4 ) -! equivalence ( s5, string5 ), ( s6, string6 ) -! equivalence ( s7, string7 ), ( s8, string8 ) -! equivalence ( s9, string9 ) -! common /zzplstr1/ string1 -! common /zzplstr2/ string2 -! common /zzplstr3/ string3 -! common /zzplstr4/ string4 -! common /zzplstr5/ string5 -! common /zzplstr6/ string6 -! common /zzplstr7/ string7 -! common /zzplstr8/ string8 -! common /zzplstr9/ string9 Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/sfstubsf95.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -59,8 +59,23 @@ include 'plflt.inc' end module - module plplotp + ! + ! Parameters and variables for strings / arrays for + ! string conversion + ! + module plplot_str + integer :: maxleni, maxlen + parameter (maxlen = 320) + parameter (maxleni = 80) + character (len = maxlen) :: string1, string2, string3 + character (len = maxlen) :: string4, string5, string6 + character (len = maxlen) :: string7, string8, string9 + integer, dimension(maxleni) :: s1, s2, s3, s4, s5, s6, s7, s8, s9 + end module + + module plplotp use plplot_flt + use plplot_str implicit none interface plcont @@ -1165,13 +1180,12 @@ subroutine plmap1(mapform,mapname,minx,maxx,miny,maxy) use plplot_flt + use plplot_str implicit none real(kind=plflt) minx, maxx, miny, maxy character*(*) mapname external mapform - include 'sfstubs.h' - call plstrf2c(mapname, string1, maxlen) call plsetmapformc(mapform) @@ -1182,12 +1196,11 @@ subroutine plmap2(mapname,minx,maxx,miny,maxy) use plplot_flt + use plplot_str implicit none real(kind=plflt) minx, maxx, miny, maxy character*(*) mapname - include 'sfstubs.h' - call plstrf2c(mapname, string1, maxlen) call plclearmapformc() @@ -1203,8 +1216,6 @@ real(kind=plflt) dlong, dlat, minlong, maxlong, minlat, maxlat external mapform - include 'sfstubs.h' - call plsetmapformc(mapform) call plmeridians7(dlong,dlat,minlong,maxlong,minlat,maxlat) @@ -1216,8 +1227,6 @@ implicit none real(kind=plflt) dlong, dlat, minlong, maxlong, minlat, maxlat - include 'sfstubs.h' - call plclearmapformc call plmeridians7(dlong,dlat,minlong,maxlong,minlat,maxlat) @@ -1403,15 +1412,14 @@ colbox, collab, colline, styline, legline, & labx, laby, labtop) +! use plplot_str implicit none integer id, colbox, collab, colline(4), styline(4) character*(*) xspec, yspec, legline(4), labx, laby, labtop real(kind=plflt) xmin, xmax, xjump, ymin, ymax, xlpos, ylpos - integer nx, ny logical y_ascl, acc integer iy_ascl, iacc - include 'sfstubs.h' call plstrf2c(xspec, string1, maxlen) call plstrf2c(yspec, string2, maxlen) Modified: trunk/bindings/f95/strutil.f90 =================================================================== --- trunk/bindings/f95/strutil.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/bindings/f95/strutil.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -20,10 +20,10 @@ subroutine plstrf2c(string1, string2, maxlen) - integer*4 maxlen - character*(*) string1, string2 + integer :: maxlen + character*(*) :: string1, string2 - integer*4 limit, islen + integer :: limit, islen external islen limit = min0(islen(string1),maxlen-1) @@ -40,8 +40,8 @@ character*(*) string1, string2 - integer*4 limit - character*300 stringbuf + integer :: limit + character (len=300) :: stringbuf limit = 1 10 if (ichar(string1(limit:limit)) .eq. 0) goto 20 @@ -61,7 +61,7 @@ integer function islen(string) character*(*) string - integer i + integer :: i do 100 i = len(string),1,-1 if (string(i:i) .ne. ' ') then Modified: trunk/examples/f95/plf95demos.inc.cmake =================================================================== --- trunk/examples/f95/plf95demos.inc.cmake 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/plf95demos.inc.cmake 2011-10-19 14:43:26 UTC (rev 11977) @@ -1,8 +1,9 @@ function myisnan(x) + use plplot_flt implicit none - logical myisnan - real*8 x + logical :: myisnan + real (kind=plflt) :: x @HAVE_F77_ISNAN_FALSE@ myisnan = (x.ne.x) @HAVE_F77_ISNAN_TRUE@ myisnan = isnan(x) Modified: trunk/examples/f95/x03f.f90 =================================================================== --- trunk/examples/f95/x03f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x03f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -25,7 +25,7 @@ character*3 text real(kind=plflt) x0(0:360), y0(0:360) real(kind=plflt) x(0:360), y(0:360), dtr, theta, dx, dy, r, offset - integer i, j, nsp + integer i, nsp ! Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f95/x11f.f90 =================================================================== --- trunk/examples/f95/x11f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x11f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -24,7 +24,7 @@ integer i, j, k, ifshade, xpts, ypts parameter (xpts=35, ypts=46) - real(kind=plflt) x(xpts), y(ypts), z(xpts,ypts), xx, yy, r + real(kind=plflt) x(xpts), y(ypts), z(xpts,ypts), xx, yy character*80 title(2) real(kind=plflt) alt(2),az(2) Modified: trunk/examples/f95/x14f.f90 =================================================================== --- trunk/examples/f95/x14f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x14f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -28,7 +28,7 @@ use plplot implicit none - integer i, digmax + integer digmax character*80 driver character*15 geometry_master @@ -40,7 +40,6 @@ real(kind=plflt) xs(6), ys(6) real(kind=plflt) xscale, yscale, xoff, yoff common /plotdat/ x, y, xs, ys, xscale, yscale, xoff, yoff - character*80 version real(kind=plflt) xp0, yp0 integer xleng0, yleng0, xoff0, yoff0 logical valid_geometry Modified: trunk/examples/f95/x17f.f90 =================================================================== --- trunk/examples/f95/x17f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x17f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -26,14 +26,13 @@ program x17f use plplot, PI => PL_PI implicit none - integer id1, id2, n, nsteps + integer id1, n, nsteps logical autoy, acc parameter ( nsteps = 1000 ) real(kind=plflt) y1, y2, y3, y4, ymin, ymax, xlab, ylab real(kind=plflt) t, tmin, tmax, tjump, dt, noise integer colbox, collab, colline(4), styline(4) character*20 legline(4) - character*20 toplab logical pl_errcode character*80 errmsg Modified: trunk/examples/f95/x18f.f90 =================================================================== --- trunk/examples/f95/x18f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x18f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -32,7 +32,7 @@ integer NPTS parameter ( NPTS = 1000 ) - integer i, j, k + integer i, k real(kind=plflt) x(NPTS), y(NPTS), z(NPTS) real(kind=plflt) r character*80 title @@ -127,7 +127,7 @@ call plcol0(1) call plw3d(1.0_plflt, 1.0_plflt, 1.0_plflt, & -1.0_plflt, 1.0_plflt, -1.0_plflt, & - 1.0_plflt, -1.0_plflt, 1.0_plflt, & + 1.0_plflt, -1.0_plflt, 1.0_plflt, & alt, az) call plbox3('bnstu', 'x axis', 0.0_plflt, 0, & 'bnstu', 'y axis', 0.0_plflt, 0, & Modified: trunk/examples/f95/x19f.f90 =================================================================== --- trunk/examples/f95/x19f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x19f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -91,7 +91,7 @@ real(kind=plflt) :: value character*(length) label character*5 direction_label - real(kind=plflt) :: label_val + real(kind=plflt) :: label_val = 0.0_plflt real(kind=plflt) :: normalize_longitude if (axis .eq. 2) then @@ -134,7 +134,6 @@ implicit none real(kind=plflt) minx, maxx, miny, maxy real(kind=plflt), dimension(1:1) :: x, y - integer c external map_transform external mapform19 external geolocation_labeler Modified: trunk/examples/f95/x20f.f90 =================================================================== --- trunk/examples/f95/x20f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x20f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -224,7 +224,7 @@ if (get_clip(xi, xe, yi, ye)) then call plend() - call myexit(0) + stop endif ! @@ -295,7 +295,7 @@ deallocate( img_f, xg, yg ) call plend() - call myexit(0) + stop contains @@ -330,17 +330,17 @@ character, dimension(8) :: img character(len=80), dimension(2) :: ver - integer i, j, k, w, h, b + integer :: i, j, w, h, b - integer ierr - integer count - integer record + integer :: ierr + integer :: count + integer :: record - integer bytes - integer lastlf - integer first - integer last - integer pixel + integer :: bytes = 0 + integer :: lastlf = 0 + integer :: first + integer :: last + integer :: pixel ! Naive grayscale binary ppm reading. If you know how to, improve it @@ -499,7 +499,9 @@ real(kind=plflt) sx(5), sy(5) integer PLK_Return - parameter(PLK_Return = Z'0D') + data PLK_Return / Z'0D' / + integer hex100 + data hex100 / Z'100' / xxi = xi yyi = yi @@ -534,7 +536,7 @@ sy(5) = yyi endif - if (iand(gin%state,Z'100').ne.0) then + if (iand(gin%state,hex100).ne.0) then xxe = gin%wX yye = gin%wY if (start) then @@ -640,12 +642,3 @@ enddo end -!---------------------------------------------------------------------------- -! Subroutine myexit -! Just calls exit - works around bug in gfortran <= 4.1 - subroutine myexit(icode) - implicit none - integer icode - - call exit(icode) - end Modified: trunk/examples/f95/x21f.f90 =================================================================== --- trunk/examples/f95/x21f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x21f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -49,9 +49,9 @@ character*80 title(6) data title /'Cubic Spline Approximation', & 'Delaunay Linear Interpolation', & - 'Natural Neighbors Interpolation', & - 'KNN Inv. Distance Weighted', & - '3NN Linear Interpolation', & + 'Natural Neighbors Interpolation', & + 'KNN Inv. Distance Weighted', & + '3NN Linear Interpolation', & '4NN Around Inv. Dist. Weighted'/ real(kind=plflt) opt(6) Modified: trunk/examples/f95/x22f.f90 =================================================================== --- trunk/examples/f95/x22f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x22f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -28,7 +28,7 @@ logical fill parameter (narr=6) real(kind=plflt) arrow_x(narr),arrow_y(narr), & - arrow2_x(narr),arrow2_y(narr) + arrow2_x(narr),arrow2_y(narr) data arrow_x/-0.5_plflt, 0.5_plflt, 0.3_plflt, 0.5_plflt, 0.3_plflt, 0.5_plflt/ data arrow_y/0._plflt, 0._plflt, 0.2_plflt, 0._plflt, -0.2_plflt, 0._plflt/ @@ -87,8 +87,8 @@ xx = (dble(i)-nx/2.0_plflt-0.5_plflt)*dx do j=1,ny yy = (dble(j)-ny/2.0_plflt-0.5_plflt)*dy - xg(i,j) = xx - yg(i,j) = yy + xg(i,j) = xx + yg(i,j) = yy u(i,j) = yy v(i,j) = -xx enddo @@ -96,7 +96,7 @@ call plenv(xmin, xmax, ymin, ymax, 0, 0) call pllab('(x)', '(y)', & - '#frPLplot Example 22 - circulation') + '#frPLplot Example 22 - circulation') call plcol0(2) scaling = 0.0_plflt call plvect(u,v,scaling,xg,yg) @@ -130,8 +130,8 @@ xx = (dble(i)-dble(nx)/2.0_plflt-0.5_plflt)*dx do j=1,ny yy = (dble(j)-dble(ny)/2.0_plflt-0.5_plflt)*dy - xg(i,j) = xx - yg(i,j) = yy + xg(i,j) = xx + yg(i,j) = yy b = ymax/4.0_plflt*(3.0_plflt-cos(PI*xx/xmax)) if (abs(yy).lt.b) then dbdx = ymax/4.0_plflt*sin(PI*xx/xmax)*yy/b @@ -146,7 +146,7 @@ call plenv(xmin, xmax, ymin, ymax, 0, 0) call pllab('(x)', '(y)', & - '#frPLplot Example 22 - constriction') + '#frPLplot Example 22 - constriction') call plcol0(2) scaling = -0.5_plflt call plvect(u,v,scaling,xg,yg) @@ -216,7 +216,7 @@ call plenv(xmin, xmax, ymin, ymax, 0, 0) call pllab('(x)', '(y)', & - '#frPLplot Example 22 - potential gradient vector plot') + '#frPLplot Example 22 - potential gradient vector plot') ! plot contours of the potential dz = abs(zmax - zmin)/dble (nlevel) Modified: trunk/examples/f95/x23f.f90 =================================================================== --- trunk/examples/f95/x23f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x23f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -192,36 +192,36 @@ ! the marker is not needed, in any case, for calls to plsfci. data (fci(i), i=1,fci_combinations) / & - z'00000000', & - z'00000001', & - z'00000002', & - z'00000003', & - z'00000004', & - z'00000010', & - z'00000011', & - z'00000012', & - z'00000013', & - z'00000014', & - z'00000020', & - z'00000021', & - z'00000022', & - z'00000023', & - z'00000024', & - z'00000100', & - z'00000101', & - z'00000102', & - z'00000103', & - z'00000104', & - z'00000110', & - z'00000111', & - z'00000112', & - z'00000113', & - z'00000114', & - z'00000120', & - z'00000121', & - z'00000122', & - z'00000123', & - z'00000124' / + z'00000000', & + z'00000001', & + z'00000002', & + z'00000003', & + z'00000004', & + z'00000010', & + z'00000011', & + z'00000012', & + z'00000013', & + z'00000014', & + z'00000020', & + z'00000021', & + z'00000022', & + z'00000023', & + z'00000024', & + z'00000100', & + z'00000101', & + z'00000102', & + z'00000103', & + z'00000104', & + z'00000110', & + z'00000111', & + z'00000112', & + z'00000113', & + z'00000114', & + z'00000120', & + z'00000121', & + z'00000122', & + z'00000123', & + z'00000124' / data (family(i), i=1,5) / & "sans-serif", & @@ -317,57 +317,57 @@ call plwind(0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt) call plsfci(0_plunicode) if (page == 11) then - call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & + call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & '#<0x10>PLplot Example 23 - '// & 'Set Font with plsfci') elseif (page == 12) then - call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & + call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & '#<0x10>PLplot Example 23 - '// & 'Set Font with plsfont') elseif(page == 13) then - call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & + call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & '#<0x10>PLplot Example 23 - '// & 'Set Font with ##<0x8nnnnnnn> construct') elseif(page == 14) then - call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & + call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & '#<0x10>PLplot Example 23 - '// & 'Set Font with ##<0xmn> constructs') elseif(page == 15) then - call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & + call plmtex('t', 1.5_plflt, 0.5_plflt, 0.5_plflt, & '#<0x10>PLplot Example 23 - '// & 'Set Font with ##<FCI COMMAND STRING/> constructs') endif call plschr(0._plflt, 0.75_plflt) do i=0,fci_combinations-1 - family_index = mod(i,5) - style_index = mod(i/5,3) - weight_index = mod((i/5)/3,2) - if(page == 11) then - call plsfci(fci(i+1)) - write(string,'(a)') & + family_index = mod(i,5) + style_index = mod(i/5,3) + weight_index = mod((i/5)/3,2) + if(page == 11) then + call plsfci(fci(i+1)) + write(string,'(a)') & 'Page 12, '// & trim(family(family_index+1))//', '// & trim(style(style_index+1))//', '// & trim(weight(weight_index+1))//': '// & 'The quick brown fox jumps over the lazy dog' - elseif(page == 12) then - call plsfont(family_index, style_index, weight_index) - write(string,'(a)') & + elseif(page == 12) then + call plsfont(family_index, style_index, weight_index) + write(string,'(a)') & 'Page 13, '// & trim(family(family_index+1))//', '// & trim(style(style_index+1))//', '// & trim(weight(weight_index+1))//': '// & 'The quick brown fox jumps over the lazy dog' - elseif(page == 13) then + elseif(page == 13) then ! Note, must put in missing FCI marker for this particular case. - write(string,'(a,"#<0x8",z7.7,">",a)') & + write(string,'(a,"#<0x8",z7.7,">",a)') & 'Page 14, '//trim(family(family_index+1))//', '// & trim(style(style_index+1))//', '// & trim(weight(weight_index+1))//': ', & fci(i+1), & 'The quick brown fox jumps over the lazy dog' - elseif(page == 14) then - write(string,'(a,"#<0x",z1,"0>#<0x",z1,"1>#<0x",z1,"2>",a)') & + elseif(page == 14) then + write(string,'(a,"#<0x",z1,"0>#<0x",z1,"1>#<0x",z1,"2>",a)') & 'Page 15, '// & trim(family(family_index+1))//', '// & trim(style(style_index+1))//', '// & @@ -376,8 +376,8 @@ style_index, & weight_index, & 'The quick brown fox jumps over the lazy dog' - elseif(page == 15) then - write(string,'(a)') & + elseif(page == 15) then + write(string,'(a)') & 'Page 16, '// & trim(family(family_index+1))//', '// & trim(style(style_index+1))//', '// & Modified: trunk/examples/f95/x29f.f90 =================================================================== --- trunk/examples/f95/x29f.f90 2011-10-19 11:08:56 UTC (rev 11976) +++ trunk/examples/f95/x29f.f90 2011-10-19 14:43:26 UTC (rev 11977) @@ -65,7 +65,7 @@ parameter(ymax = 20.0_plflt) do i = 1,npts - x(i) = xmax*(dble(i-1)/dble(npts)) + x(i) = xmax*(dble(i-1)/dble(npts)) y(i) = 15.0_plflt - 5.0_plflt*cos(2.0_plflt*PI*dble(i-1)/dble(npts)) ! Set x error bars to +/- 5 minute xerr1(i) = x(i)-60.0_plflt*5.0_plflt @@ -176,7 +176,7 @@ integer :: i, npts real(kind=plflt) :: xmin, xmax, ymin, ymax - integer :: tstart, t1, t2 + integer :: tstart ! real(kind=plflt) :: toff real(kind=plflt), dimension(365) :: x, y, xerr1, xerr2, yerr1, yerr2 common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 @@ -240,8 +240,8 @@ real(kind=plflt) :: scale, offset1, offset2 real(kind=plflt) :: xmin, xmax, ymin, ymax, xlabel_step - integer :: k, npts, i - logical :: if_TAI_time_format + integer :: k, npts = 0, i + logical :: if_TAI_time_format = .false. cha... [truncated message content] |
From: <and...@us...> - 2011-10-20 22:02:28
|
Revision: 11991 http://plplot.svn.sourceforge.net/plplot/?rev=11991&view=rev Author: andrewross Date: 2011-10-20 22:02:21 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Yet more code tidying to fix compiler warnings. Modified Paths: -------------- trunk/drivers/tk.c trunk/examples/c/extXdrawable_demo.c trunk/include/plplot.h trunk/include/plstrm.h trunk/src/pdfutils.c trunk/src/plargs.c trunk/src/plbox.c trunk/src/plbuf.c trunk/src/plcore.c trunk/src/plot3d.c Modified: trunk/drivers/tk.c =================================================================== --- trunk/drivers/tk.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/drivers/tk.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -1135,11 +1135,11 @@ static void launch_server( PLStream *pls ) { - TkDev *dev = (TkDev *) pls->dev; - const char *argv[20]; - char *plserver_exec = NULL, *ptr; - char *tmp = NULL; - int i; + TkDev *dev = (TkDev *) pls->dev; + const char *argv[20]; + char *plserver_exec = NULL, *ptr; + char *tmp = NULL; + int i; dbug_enter( "launch_server" ); @@ -1292,7 +1292,7 @@ fprintf( stderr, "Starting up %s on node %s\n", pls->plserver, pls->server_host ); - if ( execvp( "rsh", (char *const *)argv ) ) + if ( execvp( "rsh", (char * const *) argv ) ) { perror( "Unable to exec server process" ); _exit( 1 ); Modified: trunk/examples/c/extXdrawable_demo.c =================================================================== --- trunk/examples/c/extXdrawable_demo.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/examples/c/extXdrawable_demo.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -34,8 +34,8 @@ // Main menu structure static GtkItemFactoryEntry menu_items[] = { - { "/_File", NULL, NULL, 0, "<Branch>" }, - { "/File/_Quit", "<control>Q", gtk_main_quit, 0, NULL }, + { "/_File", NULL, NULL, 0, "<Branch>", NULL }, + { "/File/_Quit", "<control>Q", gtk_main_quit, 0, NULL, NULL }, }; #define APP_INITIAL_WIDTH 320 @@ -155,7 +155,7 @@ // Construct the main menu structure item_factory = gtk_item_factory_new( GTK_TYPE_MENU_BAR, "<main>", accel_group ); - gtk_item_factory_create_items( item_factory, nitems, menu_items, NULL ); + gtk_item_factory_create_items( item_factory, (guint) nitems, menu_items, NULL ); gtk_window_add_accel_group( GTK_WINDOW( a->rootwindow ), accel_group ); menubar = gtk_item_factory_get_widget( item_factory, "<main>" ); gtk_box_pack_start( GTK_BOX( vbox ), menubar, FALSE, FALSE, 0 ); Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/include/plplot.h 2011-10-20 22:02:21 UTC (rev 11991) @@ -386,8 +386,8 @@ typedef struct { - PLFLT *f; - PLINT nx, ny, nz; + const PLFLT *f; + PLINT nx, ny, nz; } PLfGrid; // Modified: trunk/include/plstrm.h =================================================================== --- trunk/include/plstrm.h 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/include/plstrm.h 2011-10-20 22:02:21 UTC (rev 11991) @@ -530,10 +530,10 @@ { // Misc control information - PLINT ipls, level, verbose, debug, initialized, dev_initialized; + PLINT ipls, level, verbose, debug, initialized, dev_initialized; //CONSTANT SOVERSION FIX // PLBOOL stream_closed; - const char *program; + char *program; // Plot-wide coordinate transform Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/pdfutils.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -604,14 +604,17 @@ int pdf_rd_2bytes( PDFstrm *pdfs, U_SHORT *ps ) { - U_CHAR x[2]; + U_CHAR x[2]; + U_SHORT xs; if ( !pdf_rdx( x, 2, pdfs ) ) return PDF_RDERR; *ps = 0; - *ps |= (U_SHORT) x[0]; - *ps |= (U_SHORT) x[1] << 8; + xs = (U_SHORT) x[0]; + *ps |= xs; + xs = (U_SHORT) ( (U_SHORT) x[1] << 8 ); + *ps |= xs; return 0; } @@ -648,8 +651,9 @@ int pdf_rd_2nbytes( PDFstrm *pdfs, U_SHORT *s, PLINT n ) { - PLINT i; - U_CHAR x[2]; + PLINT i; + U_CHAR x[2]; + U_SHORT xs; for ( i = 0; i < n; i++ ) { @@ -657,8 +661,10 @@ return PDF_RDERR; s[i] = 0; - s[i] |= (U_SHORT) x[0]; - s[i] |= (U_SHORT) x[1] << 8; + xs = (U_SHORT) x[0]; + s[i] |= xs; + xs = (U_SHORT) ( (U_SHORT) x[1] << 8 ); + s[i] |= xs; } return 0; } Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plargs.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -856,8 +856,8 @@ if ( !mode_noprogram ) { - program = plstrdup( argv[0] ); - plsc->program = program; + plsc->program = plstrdup( argv[0] ); + program = (const char *) plsc->program; --myargc; ++argv; } if ( myargc == 0 ) Modified: trunk/src/plbox.c =================================================================== --- trunk/src/plbox.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plbox.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -1377,9 +1377,9 @@ PLFLT vpwxmin, vpwxmax, vpwymin, vpwymax; PLFLT pos, tn, tp, offset, height, just; PLFLT factor, tstart; - const char *timefmt; + const char *timefmt = NULL; PLFLT default_mm, char_height_mm, height_mm; - PLFLT string_length_mm, pos_mm; + PLFLT string_length_mm = 0.0, pos_mm = 0.0; plgchr( &default_mm, &char_height_mm ); Modified: trunk/src/plbuf.c =================================================================== --- trunk/src/plbuf.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plbuf.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -771,7 +771,7 @@ static void rdbuf_image( PLStream *pls ) { - short *dev_ix, *dev_iy; + short *dev_ix, *dev_iy = NULL; unsigned short *dev_z, dev_zmin, dev_zmax; PLINT nptsX, nptsY, npts; PLFLT xmin, ymin, dx, dy; Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plcore.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -1227,7 +1227,7 @@ { *tmp = (unsigned char) 0xc0 | (unsigned char) ( unichar >> 6 ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( unichar & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( unichar & (PLUINT) 0x3f ) ); tmp++; len = 2; } @@ -1235,9 +1235,9 @@ { *tmp = (unsigned char) 0xe0 | (unsigned char) ( unichar >> 12 ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ) ); tmp++; - *tmp = (unsigned char) 0x80 | ( (unsigned char) unichar & 0x3f ); + *tmp = (unsigned char) ( 0x80 | ( (unsigned char) unichar & 0x3f ) ); tmp++; len = 3; } @@ -1245,11 +1245,11 @@ { *tmp = (unsigned char) 0xf0 | (unsigned char) ( unichar >> 18 ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( ( unichar >> 12 ) & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( ( unichar >> 12 ) & 0x3f ) ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( ( unichar >> 6 ) & 0x3f ) ); tmp++; - *tmp = (unsigned char) 0x80 | (unsigned char) ( unichar & 0x3f ); + *tmp = (unsigned char) ( 0x80 | (unsigned char) ( unichar & 0x3f ) ); tmp++; len = 4; } @@ -2862,8 +2862,8 @@ static int plDispatchSequencer( const void *p1, const void *p2 ) { - const PLDispatchTable* t1 = *(PLDispatchTable **) p1; - const PLDispatchTable* t2 = *(PLDispatchTable **) p2; + const PLDispatchTable* t1 = *(const PLDispatchTable * const *) p1; + const PLDispatchTable* t2 = *(const PLDispatchTable * const *) p2; // printf( "sorting: t1.name=%s t1.seq=%d t2.name=%s t2.seq=%d\n", // t1->pl_DevName, t1->pl_seq, t2->pl_DevName, t2->pl_seq ); Modified: trunk/src/plot3d.c =================================================================== --- trunk/src/plot3d.c 2011-10-20 19:38:39 UTC (rev 11990) +++ trunk/src/plot3d.c 2011-10-20 22:02:21 UTC (rev 11991) @@ -979,7 +979,7 @@ PLFLT ( *getz )( PLPointer, PLINT, PLINT ) = zops->get; PLFLT *_x = NULL, *_y = NULL, **_z = NULL; const PLFLT *x_modified, *y_modified; - int i; + int i; pl3mode = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-21 07:00:57
|
Revision: 11994 http://plplot.svn.sourceforge.net/plplot/?rev=11994&view=rev Author: andrewross Date: 2011-10-21 07:00:50 +0000 (Fri, 21 Oct 2011) Log Message: ----------- Another round of code warning fixed. This includes - commenting out unused function parameters in C++ (it's allowed in C++) - move static function prototypes from shared headers to the files where they are actually defined. - fixing the issues with plplotP.h needed config.h - more casting fixes and other minor tweaks - extra braces for clarity in nested if / else statements to avoid ambiguity. Modified Paths: -------------- trunk/bindings/qt_gui/plqt.cpp trunk/bindings/tk-x-plat/plplotter.c trunk/config.h.cmake trunk/drivers/cairo.c trunk/drivers/wxwidgets.cpp trunk/drivers/wxwidgets.h trunk/drivers/wxwidgets_app.cpp trunk/drivers/xwin.c trunk/include/plConfig.h.cmake trunk/include/qt.h Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/bindings/qt_gui/plqt.cpp 2011-10-21 07:00:50 UTC (rev 11994) @@ -1046,6 +1046,8 @@ case Qt::RightButton: gin.button = 3; break; + default: + break; } // Map Qt button and key states to the (X windows) values used @@ -1561,7 +1563,7 @@ update(); } -void QtExtWidget::mousePressEvent( QMouseEvent* event ) +void QtExtWidget::mousePressEvent( QMouseEvent* /* event */ ) { } Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/bindings/tk-x-plat/plplotter.c 2011-10-21 07:00:50 UTC (rev 11994) @@ -433,8 +433,8 @@ // Create list of valid device names and keywords for page dumps - plPlotterPtr->devDesc = (char **) malloc( NDEV * sizeof ( char ** ) ); - plPlotterPtr->devName = (char **) malloc( NDEV * sizeof ( char ** ) ); + plPlotterPtr->devDesc = (char **) malloc( (size_t) NDEV * sizeof ( char ** ) ); + plPlotterPtr->devName = (char **) malloc( (size_t) NDEV * sizeof ( char ** ) ); for ( i = 0; i < NDEV; i++ ) { plPlotterPtr->devDesc[i] = NULL; @@ -505,18 +505,18 @@ } Tk_Preserve( (ClientData) plPlotterPtr ); c = argv[1][0]; - length = strlen( argv[1] ); + length = (int) strlen( argv[1] ); // cmd -- issue a command to the PLplot library - if ( ( c == 'c' ) && ( strncmp( argv[1], "cmd", length ) == 0 ) ) + if ( ( c == 'c' ) && ( strncmp( argv[1], "cmd", (size_t) length ) == 0 ) ) { result = Cmd( interp, plPlotterPtr, argc - 2, argv + 2 ); } // configure - else if ( ( c == 'c' ) && ( strncmp( argv[1], "cget", length ) == 0 ) + else if ( ( c == 'c' ) && ( strncmp( argv[1], "cget", (size_t) length ) == 0 ) && ( length >= 2 ) ) { if ( argc != 3 ) @@ -530,7 +530,7 @@ result = Tk_ConfigureValue( interp, plPlotterPtr->tkwin, configSpecs, (char *) plPlotterPtr, argv[2], 0 ); } - else if ( ( c == 'c' ) && ( strncmp( argv[1], "configure", length ) == 0 ) ) + else if ( ( c == 'c' ) && ( strncmp( argv[1], "configure", (size_t) length ) == 0 ) ) { if ( argc == 2 ) { @@ -551,7 +551,7 @@ // closelink -- Close a binary data link previously opened with openlink - else if ( ( c == 'c' ) && ( strncmp( argv[1], "closelink", length ) == 0 ) ) + else if ( ( c == 'c' ) && ( strncmp( argv[1], "closelink", (size_t) length ) == 0 ) ) { if ( argc > 2 ) { @@ -568,7 +568,7 @@ // draw -- rubber-band draw used in region selection - else if ( ( c == 'd' ) && ( strncmp( argv[1], "draw", length ) == 0 ) ) + else if ( ( c == 'd' ) && ( strncmp( argv[1], "draw", (size_t) length ) == 0 ) ) { if ( argc == 2 ) { @@ -585,28 +585,28 @@ // info -- returns requested info - else if ( ( c == 'i' ) && ( strncmp( argv[1], "info", length ) == 0 ) ) + else if ( ( c == 'i' ) && ( strncmp( argv[1], "info", (size_t) length ) == 0 ) ) { result = Info( interp, plPlotterPtr, argc - 2, argv + 2 ); } // next page. called to cancel wait for page in tkwin driver - else if ( ( c == 'n' ) && ( strncmp( argv[1], "nextpage", length ) == 0 ) ) + else if ( ( c == 'n' ) && ( strncmp( argv[1], "nextpage", (size_t) length ) == 0 ) ) { result = NextPage( interp, plPlotterPtr, argc - 2, argv + 2 ); } // orient -- Set plot orientation - else if ( ( c == 'o' ) && ( strncmp( argv[1], "orient", length ) == 0 ) ) + else if ( ( c == 'o' ) && ( strncmp( argv[1], "orient", (size_t) length ) == 0 ) ) { result = Orient( interp, plPlotterPtr, argc - 2, argv + 2 ); } // openlink -- Open a binary data link (FIFO or socket) - else if ( ( c == 'o' ) && ( strncmp( argv[1], "openlink", length ) == 0 ) ) + else if ( ( c == 'o' ) && ( strncmp( argv[1], "openlink", (size_t) length ) == 0 ) ) { if ( argc < 3 ) { @@ -623,21 +623,21 @@ // page -- change or return output page setup - else if ( ( c == 'p' ) && ( strncmp( argv[1], "page", length ) == 0 ) ) + else if ( ( c == 'p' ) && ( strncmp( argv[1], "page", (size_t) length ) == 0 ) ) { result = Page( interp, plPlotterPtr, argc - 2, argv + 2 ); } // print -- prints plot - else if ( ( c == 'p' ) && ( strncmp( argv[1], "print", length ) == 0 ) ) + else if ( ( c == 'p' ) && ( strncmp( argv[1], "print", (size_t) length ) == 0 ) ) { result = Print( interp, plPlotterPtr, argc - 2, argv + 2 ); } // redraw -- redraw plot - else if ( ( c == 'r' ) && ( strncmp( argv[1], "redraw", length ) == 0 ) ) + else if ( ( c == 'r' ) && ( strncmp( argv[1], "redraw", (size_t) length ) == 0 ) ) { if ( argc > 2 ) { @@ -654,28 +654,28 @@ // report -- find out useful info about the plframe (GMF) - else if ( ( c == 'r' ) && ( strncmp( argv[1], "report", length ) == 0 ) ) + else if ( ( c == 'r' ) && ( strncmp( argv[1], "report", (size_t) length ) == 0 ) ) { result = report( interp, plPlotterPtr, argc - 2, argv + 2 ); } // save -- saves plot to the specified plot file type - else if ( ( c == 's' ) && ( strncmp( argv[1], "save", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[1], "save", (size_t) length ) == 0 ) ) { result = Save( interp, plPlotterPtr, argc - 2, argv + 2 ); } // view -- change or return window into plot - else if ( ( c == 'v' ) && ( strncmp( argv[1], "view", length ) == 0 ) ) + else if ( ( c == 'v' ) && ( strncmp( argv[1], "view", (size_t) length ) == 0 ) ) { result = View( interp, plPlotterPtr, argc - 2, argv + 2 ); } // xscroll -- horizontally scroll window into plot - else if ( ( c == 'x' ) && ( strncmp( argv[1], "xview", length ) == 0 ) ) + else if ( ( c == 'x' ) && ( strncmp( argv[1], "xview", (size_t) length ) == 0 ) ) { int count, type; double width = (double) ( plPlotterPtr->xr - plPlotterPtr->xl ); @@ -716,7 +716,7 @@ // yscroll -- vertically scroll window into plot - else if ( ( c == 'y' ) && ( strncmp( argv[1], "yview", length ) == 0 ) ) + else if ( ( c == 'y' ) && ( strncmp( argv[1], "yview", (size_t) length ) == 0 ) ) { int count, type; double height = plPlotterPtr->yr - plPlotterPtr->yl; @@ -973,20 +973,20 @@ { int x0_old, x1_old, y0_old, y1_old, x0_new, x1_new, y0_new, y1_new; - x0_old = plPlotterPtr->pldis.x; - y0_old = plPlotterPtr->pldis.y; - x1_old = x0_old + plPlotterPtr->pldis.width; - y1_old = y0_old + plPlotterPtr->pldis.height; + x0_old = (int) plPlotterPtr->pldis.x; + y0_old = (int) plPlotterPtr->pldis.y; + x1_old = x0_old + (int) plPlotterPtr->pldis.width; + y1_old = y0_old + (int) plPlotterPtr->pldis.height; x0_new = event->x; y0_new = event->y; x1_new = x0_new + event->width; y1_new = y0_new + event->height; - plPlotterPtr->pldis.x = MIN( x0_old, x0_new ); - plPlotterPtr->pldis.y = MIN( y0_old, y0_new ); - plPlotterPtr->pldis.width = MAX( x1_old, x1_new ) - plPlotterPtr->pldis.x; - plPlotterPtr->pldis.height = MAX( y1_old, y1_new ) - plPlotterPtr->pldis.y; + plPlotterPtr->pldis.x = (unsigned int) MIN( x0_old, x0_new ); + plPlotterPtr->pldis.y = (unsigned int) MIN( y0_old, y0_new ); + plPlotterPtr->pldis.width = (unsigned int) MAX( x1_old, x1_new ) - plPlotterPtr->pldis.x; + plPlotterPtr->pldis.height = (unsigned int) MAX( y1_old, y1_new ) - plPlotterPtr->pldis.y; } // Invoke DoWhenIdle handler to redisplay widget. @@ -1199,11 +1199,11 @@ if ( plPlotterPtr->drawing_xhairs ) UpdateXhairs( plPlotterPtr ); - plPlotterPtr->xhair_x[0].x = xmin; plPlotterPtr->xhair_x[0].y = y0; - plPlotterPtr->xhair_x[1].x = xmax; plPlotterPtr->xhair_x[1].y = y0; + plPlotterPtr->xhair_x[0].x = (short) xmin; plPlotterPtr->xhair_x[0].y = (short) y0; + plPlotterPtr->xhair_x[1].x = (short) xmax; plPlotterPtr->xhair_x[1].y = (short) y0; - plPlotterPtr->xhair_y[0].x = x0; plPlotterPtr->xhair_y[0].y = ymin; - plPlotterPtr->xhair_y[1].x = x0; plPlotterPtr->xhair_y[1].y = ymax; + plPlotterPtr->xhair_y[0].x = (short) x0; plPlotterPtr->xhair_y[0].y = (short) ymin; + plPlotterPtr->xhair_y[1].x = (short) x0; plPlotterPtr->xhair_y[1].y = (short) ymax; UpdateXhairs( plPlotterPtr ); } @@ -1259,8 +1259,8 @@ win_y >= 0 && win_y < Tk_Height( tkwin ) ) { // Okay, pointer is in our window. - plPlotterPtr->rband_pt[0].x = win_x; - plPlotterPtr->rband_pt[0].y = win_y; + plPlotterPtr->rband_pt[0].x = (short) win_x; + plPlotterPtr->rband_pt[0].y = (short) win_y; DrawRband( plPlotterPtr, win_x, win_y ); plPlotterPtr->drawing_rband = 1; @@ -1309,7 +1309,7 @@ if ( plPlotterPtr->drawing_rband ) UpdateRband( plPlotterPtr ); - plPlotterPtr->rband_pt[1].x = x0; plPlotterPtr->rband_pt[1].y = y0; + plPlotterPtr->rband_pt[1].x = (short) x0; plPlotterPtr->rband_pt[1].y = (short) y0; UpdateRband( plPlotterPtr ); } @@ -1339,7 +1339,7 @@ plsstrm( plPlotterPtr->ipls ); plsdev( "tkwin" ); // We should probably rename plsxwin to plstkwin - plsxwin( Tk_WindowId( tkwin ) ); + plsxwin( (PLINT) Tk_WindowId( tkwin ) ); plspause( 0 ); plinit(); if ( plplot_tkwin_ccmap ) @@ -1528,8 +1528,8 @@ else if ( ( plPlotterPtr->width != plPlotterPtr->prevWidth ) || ( plPlotterPtr->height != plPlotterPtr->prevHeight ) ) { - plPlotterPtr->pldis.width = plPlotterPtr->width; - plPlotterPtr->pldis.height = plPlotterPtr->height; + plPlotterPtr->pldis.width = (unsigned int) ( plPlotterPtr->width ); + plPlotterPtr->pldis.height = (unsigned int) ( plPlotterPtr->height ); plsstrm( plPlotterPtr->ipls ); pl_cmd( PLESC_RESIZE, (void *) &( plPlotterPtr->pldis ) ); @@ -1563,10 +1563,10 @@ // Reset window bounds so that next time they are set fresh - plPlotterPtr->pldis.x = Tk_X( tkwin ) + Tk_Width( tkwin ); - plPlotterPtr->pldis.y = Tk_Y( tkwin ) + Tk_Height( tkwin ); - plPlotterPtr->pldis.width = -Tk_Width( tkwin ); - plPlotterPtr->pldis.height = -Tk_Height( tkwin ); + plPlotterPtr->pldis.x = (unsigned int) ( Tk_X( tkwin ) + Tk_Width( tkwin ) ); + plPlotterPtr->pldis.y = (unsigned int) ( Tk_Y( tkwin ) + Tk_Height( tkwin ) ); + plPlotterPtr->pldis.width = (unsigned int) -Tk_Width( tkwin ); + plPlotterPtr->pldis.height = (unsigned int) -Tk_Height( tkwin ); } // Update graphic crosshairs if necessary @@ -1626,9 +1626,9 @@ ( pls->cmap0[i].g != g ) || ( pls->cmap0[i].b != b ) ) { - pls->cmap0[i].r = r; - pls->cmap0[i].g = g; - pls->cmap0[i].b = b; + pls->cmap0[i].r = (unsigned char) r; + pls->cmap0[i].g = (unsigned char) g; + pls->cmap0[i].b = (unsigned char) b; *p_changed = 1; } @@ -1752,12 +1752,12 @@ plsstrm( plPlotterPtr->ipls ); c3 = argv[0][2]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); // plgcmap0 -- get color map 0 // first arg is number of colors, the rest are hex number specifications - if ( ( c3 == 'g' ) && ( strncmp( argv[0], "plgcmap0", length ) == 0 ) ) + if ( ( c3 == 'g' ) && ( strncmp( argv[0], "plgcmap0", (size_t) length ) == 0 ) ) { int i; unsigned long plcolor; @@ -1767,9 +1767,9 @@ Tcl_AppendElement( interp, str ); for ( i = 0; i < pls->ncol0; i++ ) { - plcolor = ( ( pls->cmap0[i].r << 16 ) | - ( pls->cmap0[i].g << 8 ) | - ( pls->cmap0[i].b ) ); + plcolor = (unsigned long) ( ( pls->cmap0[i].r << 16 ) | + ( pls->cmap0[i].g << 8 ) | + ( pls->cmap0[i].b ) ); sprintf( str, "#%06lx", ( plcolor & 0xFFFFFF ) ); Tcl_AppendElement( interp, str ); @@ -1781,7 +1781,7 @@ // first arg is number of control points // the rest are hex number specifications followed by positions (0-100) - else if ( ( c3 == 'g' ) && ( strncmp( argv[0], "plgcmap1", length ) == 0 ) ) + else if ( ( c3 == 'g' ) && ( strncmp( argv[0], "plgcmap1", (size_t) length ) == 0 ) ) { int i; unsigned long plcolor; @@ -1803,7 +1803,7 @@ g1 = MAX( 0, MIN( 255, (int) ( 256. * g ) ) ); b1 = MAX( 0, MIN( 255, (int) ( 256. * b ) ) ); - plcolor = ( ( r1 << 16 ) | ( g1 << 8 ) | ( b1 ) ); + plcolor = (unsigned long) ( ( r1 << 16 ) | ( g1 << 8 ) | ( b1 ) ); sprintf( str, "#%06lx", ( plcolor & 0xFFFFFF ) ); Tcl_AppendElement( interp, str ); @@ -1820,7 +1820,7 @@ // plscmap0 -- set color map 0 // first arg is number of colors, the rest are hex number specifications - else if ( ( c3 == 's' ) && ( strncmp( argv[0], "plscmap0", length ) == 0 ) ) + else if ( ( c3 == 's' ) && ( strncmp( argv[0], "plscmap0", (size_t) length ) == 0 ) ) { int i, changed = 1, ncol0 = atoi( argv[1] ); char *col; @@ -1850,7 +1850,7 @@ // plscmap1 -- set color map 1 // first arg is number of colors, the rest are hex number specifications - else if ( ( c3 == 's' ) && ( strncmp( argv[0], "plscmap1", length ) == 0 ) ) + else if ( ( c3 == 's' ) && ( strncmp( argv[0], "plscmap1", (size_t) length ) == 0 ) ) { int i, changed = 1, ncp1 = atoi( argv[1] ); char *col, *pos, *rev; @@ -1890,7 +1890,7 @@ // plscol0 -- set single color in cmap0 // first arg is the color number, the next is the color in hex - else if ( ( c3 == 's' ) && ( strncmp( argv[0], "plscol0", length ) == 0 ) ) + else if ( ( c3 == 's' ) && ( strncmp( argv[0], "plscol0", (size_t) length ) == 0 ) ) { int i = atoi( argv[1] ), changed = 1; @@ -1911,7 +1911,7 @@ // plscol1 -- set color of control point in cmap1 // first arg is the control point, the next two are the color in hex and pos - else if ( ( c3 == 's' ) && ( strncmp( argv[0], "plscol1", length ) == 0 ) ) + else if ( ( c3 == 's' ) && ( strncmp( argv[0], "plscol1", (size_t) length ) == 0 ) ) { int i = atoi( argv[1] ), changed = 1; @@ -1935,7 +1935,7 @@ // plcopy -- copy a region of the plot; useful for scrolling plots // first 4 args are the source rectangle, next 2 args are the destination - else if ( ( c3 == 'c' ) && ( strncmp( argv[0], "plcopy", length ) == 0 ) ) + else if ( ( c3 == 'c' ) && ( strncmp( argv[0], "plcopy", (size_t) length ) == 0 ) ) { PLFLT xx[3], yy[3]; if ( argc != 7 ) @@ -2178,7 +2178,7 @@ register Tk_Window tkwin = plPlotterPtr->tkwin; int result = TCL_OK; char c = argv[0][0]; - int length = strlen( argv[0] ); + int length = (int) strlen( argv[0] ); // Make sure widget has been initialized before going any further @@ -2189,14 +2189,14 @@ // init -- sets up for rubber-band drawing - if ( ( c == 'i' ) && ( strncmp( argv[0], "init", length ) == 0 ) ) + if ( ( c == 'i' ) && ( strncmp( argv[0], "init", (size_t) length ) == 0 ) ) { Tk_DefineCursor( tkwin, plPlotterPtr->xhair_cursor ); } // end -- ends rubber-band drawing - else if ( ( c == 'e' ) && ( strncmp( argv[0], "end", length ) == 0 ) ) + else if ( ( c == 'e' ) && ( strncmp( argv[0], "end", (size_t) length ) == 0 ) ) { Tk_DefineCursor( tkwin, plPlotterPtr->cursor ); if ( plPlotterPtr->continue_draw ) @@ -2213,7 +2213,7 @@ // rect -- draw a rectangle, used to select rectangular areas // first draw erases old outline - else if ( ( c == 'r' ) && ( strncmp( argv[0], "rect", length ) == 0 ) ) + else if ( ( c == 'r' ) && ( strncmp( argv[0], "rect", (size_t) length ) == 0 ) ) { if ( argc < 5 ) { @@ -2245,11 +2245,11 @@ XSync( Tk_Display( tkwin ), 0 ); } - plPlotterPtr->pts[0].x = x0; plPlotterPtr->pts[0].y = y0; - plPlotterPtr->pts[1].x = x1; plPlotterPtr->pts[1].y = y0; - plPlotterPtr->pts[2].x = x1; plPlotterPtr->pts[2].y = y1; - plPlotterPtr->pts[3].x = x0; plPlotterPtr->pts[3].y = y1; - plPlotterPtr->pts[4].x = x0; plPlotterPtr->pts[4].y = y0; + plPlotterPtr->pts[0].x = (short) x0; plPlotterPtr->pts[0].y = (short) y0; + plPlotterPtr->pts[1].x = (short) x1; plPlotterPtr->pts[1].y = (short) y0; + plPlotterPtr->pts[2].x = (short) x1; plPlotterPtr->pts[2].y = (short) y1; + plPlotterPtr->pts[3].x = (short) x0; plPlotterPtr->pts[3].y = (short) y1; + plPlotterPtr->pts[4].x = (short) x0; plPlotterPtr->pts[4].y = (short) y0; XDrawLines( Tk_Display( tkwin ), Tk_WindowId( tkwin ), plPlotterPtr->xorGC, plPlotterPtr->pts, 5, @@ -2287,11 +2287,11 @@ } c = argv[0][0]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); // devkeys -- return list of supported device keywords - if ( ( c == 'd' ) && ( strncmp( argv[0], "devkeys", length ) == 0 ) ) + if ( ( c == 'd' ) && ( strncmp( argv[0], "devkeys", (size_t) length ) == 0 ) ) { int i = 0; while ( plPlotterPtr->devName[i] != NULL ) @@ -2302,7 +2302,7 @@ // devkeys -- return list of supported device types - else if ( ( c == 'd' ) && ( strncmp( argv[0], "devnames", length ) == 0 ) ) + else if ( ( c == 'd' ) && ( strncmp( argv[0], "devnames", (size_t) length ) == 0 ) ) { int i = 0; while ( plPlotterPtr->devDesc[i] != NULL ) @@ -2341,13 +2341,13 @@ register PLiodev *iodev = plr->iodev; char c = argv[0][0]; - int length = strlen( argv[0] ); + int length = (int) strlen( argv[0] ); dbug_enter( "Openlink" ); // Open fifo - if ( ( c == 'f' ) && ( strncmp( argv[0], "fifo", length ) == 0 ) ) + if ( ( c == 'f' ) && ( strncmp( argv[0], "fifo", (size_t) length ) == 0 ) ) { if ( argc < 1 ) { @@ -2369,7 +2369,7 @@ // Open socket - else if ( ( c == 's' ) && ( strncmp( argv[0], "socket", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[0], "socket", (size_t) length ) == 0 ) ) { if ( argc < 1 ) { @@ -2547,7 +2547,7 @@ if ( pdfs->bp == 0 ) return TCL_OK; - plr->nbytes = pdfs->bp; + plr->nbytes = (int) pdfs->bp; pdfs->bp = 0; result = process_data( interp, plPlotterPtr ); } @@ -2826,11 +2826,11 @@ } c = argv[0][0]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); // save to specified device & file - if ( ( c == 'a' ) && ( strncmp( argv[0], "as", length ) == 0 ) ) + if ( ( c == 'a' ) && ( strncmp( argv[0], "as", (size_t) length ) == 0 ) ) { if ( argc < 3 ) { @@ -2885,7 +2885,7 @@ // close save file - else if ( ( c == 'c' ) && ( strncmp( argv[0], "close", length ) == 0 ) ) + else if ( ( c == 'c' ) && ( strncmp( argv[0], "close", (size_t) length ) == 0 ) ) { if ( !plPlotterPtr->ipls_save ) { @@ -2944,12 +2944,12 @@ } c = argv[0][0]; - length = strlen( argv[0] ); + length = (int) strlen( argv[0] ); // view bounds -- return relative device coordinates of bounds on current // plot window - if ( ( c == 'b' ) && ( strncmp( argv[0], "bounds", length ) == 0 ) ) + if ( ( c == 'b' ) && ( strncmp( argv[0], "bounds", (size_t) length ) == 0 ) ) { char result_str[128]; xl = 0.; yl = 0.; @@ -2962,7 +2962,7 @@ // view reset -- Resets plot - if ( ( c == 'r' ) && ( strncmp( argv[0], "reset", length ) == 0 ) ) + if ( ( c == 'r' ) && ( strncmp( argv[0], "reset", (size_t) length ) == 0 ) ) { xl = 0.; yl = 0.; xr = 1.; yr = 1.; @@ -2977,7 +2977,7 @@ // view select -- set window into plot space // Specifies in terms of plot window coordinates, not device coordinates - else if ( ( c == 's' ) && ( strncmp( argv[0], "select", length ) == 0 ) ) + else if ( ( c == 's' ) && ( strncmp( argv[0], "select", (size_t) length ) == 0 ) ) { if ( argc < 5 ) { @@ -2996,7 +2996,7 @@ // view zoom -- set window into plot space incrementally (zoom) // Here we need to take the page (device) offsets into account - else if ( ( c == 'z' ) && ( strncmp( argv[0], "zoom", length ) == 0 ) ) + else if ( ( c == 'z' ) && ( strncmp( argv[0], "zoom", (size_t) length ) == 0 ) ) { if ( argc < 5 ) { Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/config.h.cmake 2011-10-21 07:00:50 UTC (rev 11994) @@ -51,15 +51,6 @@ // Define to 1 if you have the <dlfcn.h> header file. #cmakedefine HAVE_DLFCN_H 1 -// Define if isfinite is available -#cmakedefine PL_HAVE_ISFINITE - -// Define if finite is available -#cmakedefine PL_HAVE_FINITE - -// Define if _finite is available -#cmakedefine PL__HAVE_FINITE - // Define if [freetype] is available #cmakedefine HAVE_FREETYPE Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/drivers/cairo.c 2011-10-21 07:00:50 UTC (rev 11994) @@ -2575,7 +2575,7 @@ // Red, Green, and Blue are stored in the remaining 24 bits in that order stride = pls->xlength * 4; // stride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, pls->xlength); This function missing from version 1.4 :-( - aStream->cairo_format_memory = (unsigned char *) calloc( (size_t) stride * pls->ylength, 1 ); + aStream->cairo_format_memory = (unsigned char *) calloc( (size_t) ( stride * pls->ylength ), 1 ); // Copy the input data into the Cairo data format cairo_mem = aStream->cairo_format_memory; Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/drivers/wxwidgets.cpp 2011-10-21 07:00:50 UTC (rev 11994) @@ -41,6 +41,21 @@ #include "wxwidgets.h" +// Static function prototypes +#ifdef HAVE_FREETYPE +static void plD_pixel_wxwidgets( PLStream *pls, short x, short y ); +static PLINT plD_read_pixel_wxwidgets( PLStream *pls, short x, short y ); +static void plD_set_pixel_wxwidgets( PLStream *pls, short x, short y, PLINT colour ); +static void init_freetype_lv1( PLStream *pls ); +static void init_freetype_lv2( PLStream *pls ); +#endif + +// private functions needed by the wxwidgets Driver +static void install_buffer( PLStream *pls ); +static void wxRunApp( PLStream *pls, bool runonce = false ); +static void GetCursorCmd( PLStream *pls, PLGraphicsIn *ptr ); +static void fill_polygon( PLStream *pls ); + #ifdef __WXMAC__ #include <Carbon/Carbon.h> extern "C" { void CPSEnableForegroundOperation( ProcessSerialNumber* psn ); } @@ -373,10 +388,12 @@ dev = new wxPLDevDC; // by default the own text routines are used for wxDC if ( text == -1 ) + { if ( freetype != 1 ) text = 1; else text = 0; + } if ( freetype == -1 ) freetype = 0; break; @@ -675,10 +692,12 @@ } if ( dev->ownGUI ) + { if ( pls->nopause || !dev->showGUI ) wxRunApp( pls, true ); else wxRunApp( pls ); + } } Modified: trunk/drivers/wxwidgets.h =================================================================== --- trunk/drivers/wxwidgets.h 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/drivers/wxwidgets.h 2011-10-21 07:00:50 UTC (rev 11994) @@ -28,12 +28,6 @@ // freetype headers and macros #ifdef HAVE_FREETYPE #include "plfreetype.h" - -static void plD_pixel_wxwidgets( PLStream *pls, short x, short y ); -static PLINT plD_read_pixel_wxwidgets( PLStream *pls, short x, short y ); -static void plD_set_pixel_wxwidgets( PLStream *pls, short x, short y, PLINT colour ); -static void init_freetype_lv1( PLStream *pls ); -static void init_freetype_lv2( PLStream *pls ); #endif #ifndef max_number_of_grey_levels_used_in_text_smoothing @@ -491,12 +485,7 @@ } #define WX_SUPPRESS_UNUSED_WARN( x ) Use( &x ) -// private functions needed by the wxwidgets Driver -static void install_buffer( PLStream *pls ); -static void wxRunApp( PLStream *pls, bool runonce = false ); -static void GetCursorCmd( PLStream *pls, PLGraphicsIn *ptr ); - //-------------------------------------------------------------------------- // Declarations for the device. //-------------------------------------------------------------------------- @@ -511,7 +500,6 @@ void plD_state_wxwidgets( PLStream *, PLINT ); void plD_esc_wxwidgets( PLStream *, PLINT, void * ); -static void fill_polygon( PLStream *pls ); void wx_set_dc( PLStream* pls, wxDC* dc ); void wx_set_buffer( PLStream* pls, wxImage* buffer ); void wx_set_size( PLStream* pls, int width, int height ); Modified: trunk/drivers/wxwidgets_app.cpp =================================================================== --- trunk/drivers/wxwidgets_app.cpp 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/drivers/wxwidgets_app.cpp 2011-10-21 07:00:50 UTC (rev 11994) @@ -345,7 +345,7 @@ // // Event method, which is called if user //-------------------------------------------------------------------------- -void wxPLplotFrame::OnClose( wxCloseEvent& event ) +void wxPLplotFrame::OnClose( wxCloseEvent& /* event */ ) { // Log_Verbose( "wxPLplotFrame::OnClose" ); @@ -802,10 +802,12 @@ // If invoked by the API, we're done // Otherwise send report to stdout if ( m_dev->locate_mode == LOCATE_INVOKED_VIA_DRIVER ) + { if ( gin->keysym < 0xFF && isprint( gin->keysym ) ) printf( "%f %f %c\n", gin->wX, gin->wY, gin->keysym ); else printf( "%f %f 0x%02x\n", gin->wX, gin->wY, gin->keysym ); + } } else { Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/drivers/xwin.c 2011-10-21 07:00:50 UTC (rev 11994) @@ -1102,8 +1102,8 @@ (void) XGetGeometry( xwd->display, dev->window, &root, &x, &y, &dev->width, &dev->height, &dev->border, &xwd->depth ); - dev->init_width = dev->width; - dev->init_height = dev->height; + dev->init_width = (long) dev->width; + dev->init_height = (long) dev->height; // Set up flags that determine what we are writing to // If nopixmap is set, ignore db Modified: trunk/include/plConfig.h.cmake =================================================================== --- trunk/include/plConfig.h.cmake 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/include/plConfig.h.cmake 2011-10-21 07:00:50 UTC (rev 11994) @@ -66,6 +66,15 @@ #cmakedefine _PL_HAVE_SNPRINTF #endif +// Define if isfinite is available +#cmakedefine PL_HAVE_ISFINITE + +// Define if finite is available +#cmakedefine PL_HAVE_FINITE + +// Define if _finite is available +#cmakedefine PL__HAVE_FINITE + // Define if isinf is available #cmakedefine PL_HAVE_ISINF Modified: trunk/include/qt.h =================================================================== --- trunk/include/qt.h 2011-10-20 23:40:07 UTC (rev 11993) +++ trunk/include/qt.h 2011-10-21 07:00:50 UTC (rev 11994) @@ -131,7 +131,7 @@ virtual void drawPolygon( short * x, short * y, PLINT npts ); virtual void drawText( EscText* txt ); virtual void setColor( int r, int g, int b, double alpha ); - virtual void setBackgroundColor( int r, int g, int b, double alpha ){} + virtual void setBackgroundColor( int /* r */, int /* g */, int /* b */, double /* alpha */ ){} virtual void setGradient( int x1, int x2, int y1, int y2, unsigned char *r, unsigned char *g, unsigned char *b, PLFLT *alpha, PLINT ncol1 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-21 10:00:36
|
Revision: 11995 http://plplot.svn.sourceforge.net/plplot/?rev=11995&view=rev Author: andrewross Date: 2011-10-21 10:00:26 +0000 (Fri, 21 Oct 2011) Log Message: ----------- Yet more code cleaning to remove compiler warnings. Modified Paths: -------------- trunk/bindings/tk/plr.c trunk/drivers/qt.cpp trunk/drivers/wxwidgets_gc.cpp Modified: trunk/bindings/tk/plr.c =================================================================== --- trunk/bindings/tk/plr.c 2011-10-21 07:00:50 UTC (rev 11994) +++ trunk/bindings/tk/plr.c 2011-10-21 10:00:26 UTC (rev 11995) @@ -47,10 +47,14 @@ // Some wrapper macros to return (-1) on error +// Note we use %lu and an explicit cast to unsigned long to print size_t pointers. +// C99 adds %zd as an explicit format specifier for size_t but this is not yet +// fully adopted. + #define plr_rd( code ) \ if ( code ) { fprintf( stderr, \ - "Unable to read from %s in %s at line %d, bytecount %ld\n", \ - plr->iodev->typeName, __FILE__, __LINE__, plr->pdfs->bp ); \ + "Unable to read from %s in %s at line %d, bytecount %lu\n", \ + plr->iodev->typeName, __FILE__, __LINE__, (unsigned long) plr->pdfs->bp ); \ return -1; } #define plr_cmd( code ) \ @@ -59,8 +63,8 @@ // Error termination #define barf( msg ) \ - { fprintf( stderr, "%s\nCommand code: %d, byte count: %ld\n", \ - msg, csave, plr->pdfs->bp ); return -1; } + { fprintf( stderr, "%s\nCommand code: %d, byte count: %lu\n", \ + msg, csave, (unsigned long) plr->pdfs->bp ); return -1; } // Static function prototypes. Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2011-10-21 07:00:50 UTC (rev 11994) +++ trunk/drivers/qt.cpp 2011-10-21 10:00:26 UTC (rev 11995) @@ -1041,8 +1041,6 @@ { double downscale; - int argc = 0; - char argv[] = { '\0' }; if ( qt_family_check( pls ) ) { return; @@ -1677,7 +1675,7 @@ closeQtApp(); } -void plD_eop_extqt( PLStream *pls ) +void plD_eop_extqt( PLStream * /* pls */ ) { } @@ -1802,7 +1800,7 @@ pls->family = true; } -void plD_bop_memqt( PLStream *pls ) +void plD_bop_memqt( PLStream * /* pls */ ) { // Do nothing to preserve user data } Modified: trunk/drivers/wxwidgets_gc.cpp =================================================================== --- trunk/drivers/wxwidgets_gc.cpp 2011-10-21 07:00:50 UTC (rev 11994) +++ trunk/drivers/wxwidgets_gc.cpp 2011-10-21 10:00:26 UTC (rev 11995) @@ -345,6 +345,9 @@ // Log_Verbose( "%s", __FUNCTION__ ); #ifdef __WXGTK__ + // Cast function parameters to (void) to silence compiler warnings about unused parameters + (void) x; + (void) y; // The GetPixel method is incredible slow for wxGTK. Therefore we set the colour // always to the background color, since this is the case anyway 99% of the time. PLINT bgr, bgg, bgb; // red, green, blue This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-21 10:02:16
|
Revision: 11996 http://plplot.svn.sourceforge.net/plplot/?rev=11996&view=rev Author: andrewross Date: 2011-10-21 10:02:09 +0000 (Fri, 21 Oct 2011) Log Message: ----------- Implement UNUSED() macro in plplotP.h to mark unused parameters as such. Use this to remove all warnings from src/plargs.c as this is one of the worst offenders. I would welcome feedback before propogating this further. Modified Paths: -------------- trunk/include/plplotP.h trunk/src/plargs.c Modified: trunk/include/plplotP.h =================================================================== --- trunk/include/plplotP.h 2011-10-21 10:00:26 UTC (rev 11995) +++ trunk/include/plplotP.h 2011-10-21 10:02:09 UTC (rev 11996) @@ -279,6 +279,17 @@ #define HUGE_VAL ( 1.0 / 0.0 ) #endif +// Macro to mark function parameters as unused. +// For gcc this uses the unused attribute to remove compiler warnings. +// For all compilers the parameter name is also mangled to prevent +// accidental use. +#ifdef UNUSED +#elif defined(__GNUC__) +# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) +#else +# define UNUSED(x) UNUSED_ ## x +#endif + //-------------------------------------------------------------------------- // PLPLOT control macros //-------------------------------------------------------------------------- Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2011-10-21 10:00:26 UTC (rev 11995) +++ trunk/src/plargs.c 2011-10-21 10:02:09 UTC (rev 11996) @@ -114,7 +114,7 @@ static void Syntax( void ); #ifndef PL_DEPRECATED -int plSetOpt( const char *opt, const char *opt_arg ); +int plSetOpt( const char * opt, const char *opt_arg ); #endif // Option handlers @@ -724,13 +724,13 @@ //-------------------------------------------------------------------------- int -plSetOpt( const char *opt, const char *opt_arg ) +plSetOpt( const char * opt, const char *opt_arg ) { return ( c_plsetopt( opt, opt_arg ) ); } int -c_plsetopt( const char *opt, const char *opt_arg ) +c_plsetopt( const char * opt, const char *opt_arg ) { int mode = 0, argc = 2, status; const char *argv[3]; @@ -1018,7 +1018,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; @@ -1479,7 +1479,7 @@ //-------------------------------------------------------------------------- static int -opt_h( const char *opt, const char *opt_arg, void *client_data ) +opt_h( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { if ( !mode_quiet ) Help(); @@ -1495,7 +1495,7 @@ //-------------------------------------------------------------------------- static int -opt_v( const char *opt, const char *opt_arg, void *client_data ) +opt_v( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { if ( !mode_quiet ) fprintf( stderr, "PLplot library version: %s\n", VERSION ); @@ -1511,7 +1511,7 @@ //-------------------------------------------------------------------------- static int -opt_verbose( const char *opt, const char *opt_arg, void *client_data ) +opt_verbose( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plsc->verbose = 1; return 0; @@ -1525,7 +1525,7 @@ //-------------------------------------------------------------------------- static int -opt_debug( const char *opt, const char *opt_arg, void *client_data ) +opt_debug( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plsc->debug = 1; plsc->verbose = 1; @@ -1540,7 +1540,7 @@ //-------------------------------------------------------------------------- static int -opt_hack( const char *opt, const char *opt_arg, void *client_data ) +opt_hack( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plsc->hack = 1; return 0; @@ -1554,7 +1554,7 @@ //-------------------------------------------------------------------------- static int -opt_dev( const char *opt, const char *opt_arg, void *client_data ) +opt_dev( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsdev( opt_arg ); return 0; @@ -1568,7 +1568,7 @@ //-------------------------------------------------------------------------- static int -opt_o( const char *opt, const char *opt_arg, void *client_data ) +opt_o( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsfnam( opt_arg ); return 0; @@ -1582,7 +1582,7 @@ //-------------------------------------------------------------------------- static int -opt_mar( const char *opt, const char *opt_arg, void *client_data ) +opt_mar( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsdidev( atof( opt_arg ), PL_NOTSET, PL_NOTSET, PL_NOTSET ); return 0; @@ -1596,7 +1596,7 @@ //-------------------------------------------------------------------------- static int -opt_a( const char *opt, const char *opt_arg, void *client_data ) +opt_a( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsdidev( PL_NOTSET, atof( opt_arg ), PL_NOTSET, PL_NOTSET ); return 0; @@ -1610,7 +1610,7 @@ //-------------------------------------------------------------------------- static int -opt_jx( const char *opt, const char *opt_arg, void *client_data ) +opt_jx( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsdidev( PL_NOTSET, PL_NOTSET, atof( opt_arg ), PL_NOTSET ); return 0; @@ -1624,7 +1624,7 @@ //-------------------------------------------------------------------------- static int -opt_jy( const char *opt, const char *opt_arg, void *client_data ) +opt_jy( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsdidev( PL_NOTSET, PL_NOTSET, PL_NOTSET, atof( opt_arg ) ); return 0; @@ -1638,7 +1638,7 @@ //-------------------------------------------------------------------------- static int -opt_ori( const char *opt, const char *opt_arg, void *client_data ) +opt_ori( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsdiori( atof( opt_arg ) ); return 0; @@ -1652,7 +1652,7 @@ //-------------------------------------------------------------------------- static int -opt_freeaspect( const char *opt, const char *opt_arg, void *client_data ) +opt_freeaspect( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plsc->freeaspect = 1; return 0; @@ -1680,7 +1680,7 @@ //-------------------------------------------------------------------------- static int -opt_portrait( const char *opt, const char *opt_arg, void *client_data ) +opt_portrait( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plsc->portrait = 1; return 0; @@ -1694,7 +1694,7 @@ //-------------------------------------------------------------------------- static int -opt_width( const char *opt, const char *opt_arg, void *client_data ) +opt_width( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { int width; @@ -1724,7 +1724,7 @@ //-------------------------------------------------------------------------- static int -opt_bg( const char *opt, const char *opt_arg, void *client_data ) +opt_bg( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { const char *rgb; char *color_field, *alpha_field; @@ -1800,7 +1800,7 @@ //-------------------------------------------------------------------------- static int -opt_ncol0( const char *opt, const char *opt_arg, void *client_data ) +opt_ncol0( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsc->ncol0 = atoi( opt_arg ); return 0; @@ -1814,7 +1814,7 @@ //-------------------------------------------------------------------------- static int -opt_ncol1( const char *opt, const char *opt_arg, void *client_data ) +opt_ncol1( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsc->ncol1 = atoi( opt_arg ); return 0; @@ -1828,7 +1828,7 @@ //-------------------------------------------------------------------------- static int -opt_wplt( const char *opt, const char *opt_arg, void *client_data ) +opt_wplt( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { char *field; PLFLT xl, yl, xr, yr; @@ -1868,7 +1868,7 @@ //-------------------------------------------------------------------------- static int -opt_drvopt( const char *opt, const char *opt_arg, void *client_data ) +opt_drvopt( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { char t, *tt, *option, *value; int fl = 0; @@ -1951,7 +1951,7 @@ //-------------------------------------------------------------------------- static int -opt_fam( const char *opt, const char *opt_arg, void *client_data ) +opt_fam( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plsfam( 1, -1, -1 ); return 0; @@ -1974,7 +1974,7 @@ //-------------------------------------------------------------------------- static int -opt_fsiz( const char *opt, const char *opt_arg, void *client_data ) +opt_fsiz( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { PLINT bytemax; size_t len = strlen( opt_arg ); @@ -2025,7 +2025,7 @@ //-------------------------------------------------------------------------- static int -opt_fbeg( const char *opt, const char *opt_arg, void *client_data ) +opt_fbeg( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsc->member = atoi( opt_arg ); @@ -2040,7 +2040,7 @@ //-------------------------------------------------------------------------- static int -opt_finc( const char *opt, const char *opt_arg, void *client_data ) +opt_finc( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsc->finc = atoi( opt_arg ); @@ -2055,7 +2055,7 @@ //-------------------------------------------------------------------------- static int -opt_fflen( const char *opt, const char *opt_arg, void *client_data ) +opt_fflen( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsc->fflen = atoi( opt_arg ); @@ -2070,7 +2070,7 @@ //-------------------------------------------------------------------------- static int -opt_np( const char *opt, const char *opt_arg, void *client_data ) +opt_np( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plspause( 0 ); return 0; @@ -2084,7 +2084,7 @@ //-------------------------------------------------------------------------- static int -opt_nopixmap( const char *opt, const char *opt_arg, void *client_data ) +opt_nopixmap( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plsc->nopixmap = 1; return 0; @@ -2098,7 +2098,7 @@ //-------------------------------------------------------------------------- static int -opt_db( const char *opt, const char *opt_arg, void *client_data ) +opt_db( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plsc->db = 1; return 0; @@ -2112,7 +2112,7 @@ //-------------------------------------------------------------------------- static int -opt_bufmax( const char *opt, const char *opt_arg, void *client_data ) +opt_bufmax( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsc->bufmax = atoi( opt_arg ); return 0; @@ -2126,7 +2126,7 @@ //-------------------------------------------------------------------------- static int -opt_server_name( const char *opt, const char *opt_arg, void *client_data ) +opt_server_name( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsc->server_name = plstrdup( opt_arg ); return 0; @@ -2140,7 +2140,7 @@ //-------------------------------------------------------------------------- static int -opt_plserver( const char *opt, const char *opt_arg, void *client_data ) +opt_plserver( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsc->plserver = plstrdup( opt_arg ); return 0; @@ -2154,7 +2154,7 @@ //-------------------------------------------------------------------------- static int -opt_plwindow( const char *opt, const char *opt_arg, void *client_data ) +opt_plwindow( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { if ( ( plsc->plwindow = (char *) malloc( (size_t) ( 1 + strlen( opt_arg ) ) * sizeof ( char ) ) ) == NULL ) { @@ -2172,7 +2172,7 @@ //-------------------------------------------------------------------------- static int -opt_auto_path( const char *opt, const char *opt_arg, void *client_data ) +opt_auto_path( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plsc->auto_path = plstrdup( opt_arg ); return 0; @@ -2186,7 +2186,7 @@ //-------------------------------------------------------------------------- static int -opt_px( const char *opt, const char *opt_arg, void *client_data ) +opt_px( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plssub( atoi( opt_arg ), -1 ); return 0; @@ -2200,7 +2200,7 @@ //-------------------------------------------------------------------------- static int -opt_py( const char *opt, const char *opt_arg, void *client_data ) +opt_py( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plssub( -1, atoi( opt_arg ) ); return 0; @@ -2218,7 +2218,7 @@ //-------------------------------------------------------------------------- static int -opt_geo( const char *opt, const char *opt_arg, void *client_data ) +opt_geo( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { int numargs; PLFLT xdpi = 0., ydpi = 0.; @@ -2304,7 +2304,7 @@ //-------------------------------------------------------------------------- static int -opt_tk_file( const char *opt, const char *opt_arg, void *client_data ) +opt_tk_file( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { if ( ( plsc->tk_file = (char *) malloc( (size_t) ( 1 + strlen( opt_arg ) ) * sizeof ( char ) ) ) == NULL ) { @@ -2327,7 +2327,7 @@ //-------------------------------------------------------------------------- static int -opt_dpi( const char *opt, const char *opt_arg, void *client_data ) +opt_dpi( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { char *field; PLFLT xdpi = 0., ydpi = 0.; @@ -2368,7 +2368,7 @@ //-------------------------------------------------------------------------- static int -opt_dev_compression( const char *opt, const char *opt_arg, void *client_data ) +opt_dev_compression( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { PLINT comp = 0; @@ -2390,7 +2390,7 @@ //-------------------------------------------------------------------------- static int -opt_cmap0( const char *opt, const char *opt_arg, void *client_data ) +opt_cmap0( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plspal0( opt_arg ); return 0; @@ -2403,7 +2403,7 @@ //-------------------------------------------------------------------------- static int -opt_cmap1( const char *opt, const char *opt_arg, void *client_data ) +opt_cmap1( const char * UNUSED(opt), const char *opt_arg, void * UNUSED(client_data) ) { plspal1( opt_arg, TRUE ); return 0; @@ -2416,7 +2416,7 @@ //-------------------------------------------------------------------------- static int -opt_locale( const char *opt, const char *opt_arg, void *client_data ) +opt_locale( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { char *locale; if ( ( locale = setlocale( LC_NUMERIC, "" ) ) ) @@ -2443,7 +2443,7 @@ //-------------------------------------------------------------------------- static int -opt_eofill( const char *opt, const char *opt_arg, void *client_data ) +opt_eofill( const char * UNUSED(opt), const char * UNUSED(opt_arg), void * UNUSED(client_data) ) { plsc->dev_eofill = 1; return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-21 12:34:22
|
Revision: 11998 http://plplot.svn.sourceforge.net/plplot/?rev=11998&view=rev Author: andrewross Date: 2011-10-21 12:34:16 +0000 (Fri, 21 Oct 2011) Log Message: ----------- Fix a few more warnings. Modified Paths: -------------- trunk/include/disptab.h trunk/include/pldebug.h trunk/src/pdfutils.c trunk/src/plshade.c Modified: trunk/include/disptab.h =================================================================== --- trunk/include/disptab.h 2011-10-21 12:03:34 UTC (rev 11997) +++ trunk/include/disptab.h 2011-10-21 12:34:16 UTC (rev 11998) @@ -77,8 +77,8 @@ typedef struct { - const char *pl_MenuStr; - const char *pl_DevName; + char *pl_MenuStr; + char *pl_DevName; int pl_type; int pl_seq; plD_init_fp pl_init; Modified: trunk/include/pldebug.h =================================================================== --- trunk/include/pldebug.h 2011-10-21 12:03:34 UTC (rev 11997) +++ trunk/include/pldebug.h 2011-10-21 12:34:16 UTC (rev 11998) @@ -85,6 +85,9 @@ if ( plsc->termin ) c_plgra(); } +#else + // Avoid warning about unused parameter + (void) label; #endif // DEBUG } #endif // NEED_PLDEBUG Modified: trunk/src/pdfutils.c =================================================================== --- trunk/src/pdfutils.c 2011-10-21 12:03:34 UTC (rev 11997) +++ trunk/src/pdfutils.c 2011-10-21 12:34:16 UTC (rev 11998) @@ -35,7 +35,7 @@ #define NEED_PLDEBUG #include "plplotP.h" -static void print_ieeef( void *, void * ); +static void print_ieeef( float *, U_LONG * ); static int pdf_wrx( const U_CHAR *x, long nitems, PDFstrm *pdfs ); static int debug = 0; @@ -898,10 +898,10 @@ //-------------------------------------------------------------------------- static void -print_ieeef( void *vx, void *vy ) +print_ieeef( float *vx, U_LONG *vy ) { int i; - U_LONG f, *x = (U_LONG *) vx, *y = (U_LONG *) vy; + U_LONG f, *x = (U_LONG *) vx, *y = vy; char bitrep[33]; bitrep[32] = '\0'; Modified: trunk/src/plshade.c =================================================================== --- trunk/src/plshade.c 2011-10-21 12:03:34 UTC (rev 11997) +++ trunk/src/plshade.c 2011-10-21 12:34:16 UTC (rev 11998) @@ -363,7 +363,7 @@ { PLfGrid grid; - grid.f = (PLFLT *) a; + grid.f = a; grid.nx = nx; grid.ny = ny; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-21 12:37:48
|
Revision: 11999 http://plplot.svn.sourceforge.net/plplot/?rev=11999&view=rev Author: andrewross Date: 2011-10-21 12:37:41 +0000 (Fri, 21 Oct 2011) Log Message: ----------- Fix error in URL for reference to information on the use of const in C. Modified Paths: -------------- trunk/OLD-README.release trunk/README.release Modified: trunk/OLD-README.release =================================================================== --- trunk/OLD-README.release 2011-10-21 12:34:16 UTC (rev 11998) +++ trunk/OLD-README.release 2011-10-21 12:37:41 UTC (rev 11999) @@ -148,7 +148,7 @@ The general documentation and safety justification for such const modifier changes to our API is given in -http://www.cprogrammbing.com/tutorial/const_correctness.html. +http://www.cprogramming.com/tutorial/const_correctness.html. Essentially, the above const modifier changes constitute our guarantee that the associated arrays are not changed internally by the PLplot libraries. Modified: trunk/README.release =================================================================== --- trunk/README.release 2011-10-21 12:34:16 UTC (rev 11998) +++ trunk/README.release 2011-10-21 12:37:41 UTC (rev 11999) @@ -206,7 +206,7 @@ The general documentation and safety justification for such const modifier changes to our API is given in -http://www.cprogrammbing.com/tutorial/const_correctness.html. +http://www.cprogramming.com/tutorial/const_correctness.html. Essentially, the above const modifier changes constitute our guarantee that the associated arrays are not changed internally by the PLplot libraries. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-10-27 05:26:38
|
Revision: 12001 http://plplot.svn.sourceforge.net/plplot/?rev=12001&view=rev Author: airwin Date: 2011-10-27 05:26:31 +0000 (Thu, 27 Oct 2011) Log Message: ----------- Implement standard example 00, an extremely simple PLplot demo of a 2D line plot. Modified Paths: -------------- trunk/examples/c/CMakeLists.txt trunk/examples/c/Makefile.examples.in trunk/plplot_test/test_c.sh.in Added Paths: ----------- trunk/examples/c/x00c.c Modified: trunk/examples/c/CMakeLists.txt =================================================================== --- trunk/examples/c/CMakeLists.txt 2011-10-26 22:36:55 UTC (rev 12000) +++ trunk/examples/c/CMakeLists.txt 2011-10-27 05:26:31 UTC (rev 12001) @@ -25,6 +25,7 @@ # BUILD_TEST ON and CORE_BUILD OFF. set(c_STRING_INDICES + "00" "01" "02" "03" Modified: trunk/examples/c/Makefile.examples.in =================================================================== --- trunk/examples/c/Makefile.examples.in 2011-10-26 22:36:55 UTC (rev 12000) +++ trunk/examples/c/Makefile.examples.in 2011-10-27 05:26:31 UTC (rev 12001) @@ -39,6 +39,7 @@ @extcairo_true@@pkg_config_true@ ext-cairo-test$(EXEEXT) EXECUTABLES_list = \ + x00c$(EXEEXT) \ x01c$(EXEEXT) \ x02c$(EXEEXT) \ x03c$(EXEEXT) \ Added: trunk/examples/c/x00c.c =================================================================== --- trunk/examples/c/x00c.c (rev 0) +++ trunk/examples/c/x00c.c 2011-10-27 05:26:31 UTC (rev 12001) @@ -0,0 +1,59 @@ +// $Id$ +// +// Simple demo of a 2D line plot. +// +// Copyright (C) 2011 Alan W. Irwin +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// + +#include "plcdemos.h" +#define NSIZE 101 + +int +main( int argc, const char *argv[] ) +{ + PLFLT x[NSIZE], y[NSIZE]; + PLFLT xmin = 0., xmax = 1., ymin = 0., ymax = 100.; + int i; + + // Prepare data to be plotted. + for ( i = 0; i < NSIZE; i++ ) + { + x[i] = (PLFLT) ( i ) / (PLFLT) ( NSIZE - 1 ); + y[i] = ymax * x[i] * x[i]; + } + + // Parse and process command line arguments + plparseopts( &argc, argv, PL_PARSE_FULL ); + + // Initialize plplot + plinit(); + + // Create a labelled box to hold the plot. + plenv( xmin, xmax, ymin, ymax, 0, 0 ); + pllab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + + // Plot the data that was prepared above. + plline( NSIZE, x, y ); + + // Close PLplot library + plend(); + + exit( 0 ); +} Property changes on: trunk/examples/c/x00c.c ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/plplot_test/test_c.sh.in =================================================================== --- trunk/plplot_test/test_c.sh.in 2011-10-26 22:36:55 UTC (rev 12000) +++ trunk/plplot_test/test_c.sh.in 2011-10-27 05:26:31 UTC (rev 12001) @@ -29,7 +29,7 @@ # Do the standard non-interactive examples. lang="c" export index lang -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 \ +for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 \ 21 22 23 24 25 26 27 28 30 31 33 ${critical_examples}; do if [ "$verbose_test" ] ; then echo "x${index}${lang}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |