Re: [Plplot-devel] [PATCH] Move plgdev call to after plinit in example 14

2010-02-06 Thread David MacMahon

On Feb 5, 2010, at 17:51 , Hazen Babcock wrote:

> Thank you David for this patch and for your previous patch of  
> plargs, as of v10793 they have both been incorporated.

Thanks, Hazen, and sorry I forgot to send the patch as an attachment.

FWIW, I have since learned that users of git can run "git config  
format.attach true" to modify an individual repository's .git/config  
so that "git format-patch" and "git send-email" in that repository  
will default to creating patches as attachments.

I'm still looking for the option to compress attachments.  I get the  
feeling that compressing attachments goes somewhat against the grain  
of the git developers' philosophy of wanting to be able to review the  
patches in their email/text viewer before applying them with "git  
am" (apply mailbox).  They may also want to avoid any potentially  
unpleasant combinations of libZ and gIT! :-)

Dave


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] [PATCH] Move plgdev call to after plinit in example 14

2010-02-05 Thread Hazen Babcock

David MacMahon wrote:
> Changes examples/*/x14*.* to call plgdev and print the driver name after
> calling plinit.  Calling plgdev after plparseopts but before plinit will
> only get a device name if one is specified on the command line via the
> -dev option.  If the device is not specified via -dev, calling plgdev
> before plinit will get an empty string.  To ensure that plgdev gets a
> device name regardless of how it is specified, it must be called after
> plinit (specifically, after pllib_devinit, which is called by plinit).
> Without this change, running example 14 with no device specified on the
> command line would result in the following message...
> 
> "Demo of multiple output streams via the  driver."
> 
> Note the double space between "the" and "driver" where the driver name
> belongs.
> 
> Also removes previously superfluous, now invalid call to plsdev before
> plinit.
> 
> Tested C++, C, F77, and F95 versions.  Not sure if other languages are
> modified correctly.

Thank you David for this patch and for your previous patch of plargs, as 
of v10793 they have both been incorporated.

-Hazen

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


[Plplot-devel] [PATCH] Move plgdev call to after plinit in example 14

2010-02-05 Thread David MacMahon
Changes examples/*/x14*.* to call plgdev and print the driver name after
calling plinit.  Calling plgdev after plparseopts but before plinit will
only get a device name if one is specified on the command line via the
-dev option.  If the device is not specified via -dev, calling plgdev
before plinit will get an empty string.  To ensure that plgdev gets a
device name regardless of how it is specified, it must be called after
plinit (specifically, after pllib_devinit, which is called by plinit).
Without this change, running example 14 with no device specified on the
command line would result in the following message...

"Demo of multiple output streams via the  driver."

Note the double space between "the" and "driver" where the driver name
belongs.

Also removes previously superfluous, now invalid call to plsdev before
plinit.

Tested C++, C, F77, and F95 versions.  Not sure if other languages are
modified correctly.
---
 examples/c++/x14.cc|   17 -
 examples/c/x14c.c  |   17 -
 examples/d/x14d.d  |   21 ++---
 examples/f77/x14f.fm4  |   25 -
 examples/f95/x14f.f90  |   25 -
 examples/java/x14.java |   19 +--
 examples/lua/x14.lua   |   13 ++---
 examples/ocaml/x14.ml  |   15 +++
 examples/octave/x14c.m |   25 -
 examples/perl/x14.pl   |   15 +++
 examples/tcl/x14.tcl   |   13 ++---
 11 files changed, 97 insertions(+), 108 deletions(-)

diff --git a/examples/c++/x14.cc b/examples/c++/x14.cc
index 80569ad..54759c8 100644
--- a/examples/c++/x14.cc
+++ b/examples/c++/x14.cc
@@ -92,7 +92,7 @@ x14::x14( int argc, const char ** argv )
 // Using DP results in a crash at the end due to some odd cleanup problems
 // The geometry strings MUST be in writable memory
 
-char   driver[80];
+char   driver[80] = "";
 
 PLINT  fam, num, bmax;
 
@@ -110,13 +110,6 @@ x14::x14( int argc, const char ** argv )
 // Parse and process command line arguments.
 pls1->parseopts( &argc, argv, PL_PARSE_FULL );
 
-pls1->gdev( driver );
-pls1->gfam( fam, num, bmax );
-
-cout << "Demo of multiple output streams via the " <<
-driver << " driver." << endl;
-cout << "Running with the second stream as slave to the first.\n" << endl;
-
 //If valid geometry specified on command line, use it for both streams.
 pls1->gpage( xp0, yp0, xleng0, yleng0, xoff0, yoff0 );
 valid_geometry = ( xleng0 > 0 && yleng0 > 0 );
@@ -128,12 +121,18 @@ x14::x14( int argc, const char ** argv )
 else
 pls1->setopt( "geometry", geometry_master );
 
-pls1->sdev( driver );
 pls1->ssub( 2, 2 );
 
 // Initialize PLplot.
 pls1->init();
 
+pls1->gdev( driver );
+pls1->gfam( fam, num, bmax );
+
+cout << "Demo of multiple output streams via the " <<
+driver << " driver." << endl;
+cout << "Running with the second stream as slave to the first.\n" << endl;
+
 pls2 = new plstream();
 
 if ( valid_geometry )
diff --git a/examples/c/x14c.c b/examples/c/x14c.c
index 22e38ba..ace4aa4 100644
--- a/examples/c/x14c.c
+++ b/examples/c/x14c.c
@@ -58,7 +58,7 @@ main( int argc, const char *argv[] )
 char  geometry_master[] = "500x410+100+200";
 char  geometry_slave[]  = "500x410+650+200";
 
-char  driver[80];
+char  driver[80] = "";
 
 PLINT fam, num, bmax;
 PLFLT xp0, yp0;
@@ -70,13 +70,6 @@ main( int argc, const char *argv[] )
 
 (void) plparseopts( &argc, argv, PL_PARSE_FULL );
 
-plgdev( driver );
-plgfam( &fam, &num, &bmax );
-
-printf( "Demo of multiple output streams via the %s driver.\n", driver );
-printf( "Running with the second stream as slave to the first.\n" );
-printf( "\n" );
-
 /* If valid geometry specified on command line, use it for both streams. */
 plgpage( &xp0, &yp0, &xleng0, &yleng0, &xoff0, &yoff0 );
 valid_geometry = ( xleng0 > 0 && yleng0 > 0 );
@@ -88,10 +81,16 @@ main( int argc, const char *argv[] )
 else
 plsetopt( "geometry", geometry_master );
 
-plsdev( driver );
 plssub( 2, 2 );
 plinit();
 
+plgdev( driver );
+plgfam( &fam, &num, &bmax );
+
+printf( "Demo of multiple output streams via the %s driver.\n", driver );
+printf( "Running with the second stream as slave to the first.\n" );
+printf( "\n" );
+
 /* Start next stream */
 
 plsstrm( 1 );
diff --git a/examples/d/x14d.d b/examples/d/x14d.d
index 41fe5bb..0782f90 100644
--- a/examples/d/x14d.d
+++ b/examples/d/x14d.d
@@ -51,15 +51,6 @@ int main( char[][] args )
 /* Parse and process command line arguments */
 plparseopts( args, PL_PARSE_FULL );
 
-string driver;
-plgdev( driver );
-
-PLINT fam, num, bmax;
-plgfam( &fam, &num, &bmax );
-
-writefln( "Demo of multiple output streams via the %s driver.", driver );
-writefln( "Running with the second stream as