|
From: <and...@us...> - 2009-11-16 12:21:45
|
Revision: 10597
http://plplot.svn.sourceforge.net/plplot/?rev=10597&view=rev
Author: andrewross
Date: 2009-11-16 12:21:25 +0000 (Mon, 16 Nov 2009)
Log Message:
-----------
Add comments about one remaining use of tmpnam in source code.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2009-11-16 12:03:10 UTC (rev 10596)
+++ trunk/drivers/tk.c 2009-11-16 12:21:25 UTC (rev 10597)
@@ -1504,6 +1504,8 @@
if ( !pls->dp )
{
+ /* This of tmpnam should (?) be safe since mkfifo
+ will fail if the filename already exists */
iodev->fileName = (char *) tmpnam( NULL );
if ( mkfifo( iodev->fileName,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ) < 0 )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2010-01-14 21:50:21
|
Revision: 10754
http://plplot.svn.sourceforge.net/plplot/?rev=10754&view=rev
Author: andrewross
Date: 2010-01-14 21:34:06 +0000 (Thu, 14 Jan 2010)
Log Message:
-----------
Fix window name bug in tk driver. tk driver now correctly displays the window name (including the -plwindow option). Note that tk has some rules over what is a valid names so all spaces and . are converted to _ . Also any window name which starts with an upper case letter will have it converted to lower case.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2010-01-14 19:43:31 UTC (rev 10753)
+++ trunk/drivers/tk.c 2010-01-14 21:34:06 UTC (rev 10754)
@@ -1374,10 +1374,24 @@
TkDev *dev = (TkDev *) pls->dev;
char command[CMD_LEN];
unsigned int bg;
+ char *tmp;
+ int i,n;
dbug_enter( "plwindow_init" );
- Tcl_SetVar( dev->interp, "plwindow", pls->plwindow, 0 );
+ /* Set tcl plwindow variable to be pls->plwindow with a . prepended and
+ * and with ' ' replaced by '_' and all other '.' by '_' to avoid
+ * quoting and bad window name problems. Also avoid name starting with
+ * an upper case letter. */
+ n = strlen(pls->plwindow)+1;
+ tmp = (char *)malloc(sizeof(char)*(n+1));
+ sprintf(tmp,".%s",pls->plwindow);
+ for (i=1;i<n;i++) {
+ if ( (tmp[i] == ' ') || (tmp[i] == '.') ) tmp[i] = '_';
+ }
+ if (isupper(tmp[1])) tmp[1] = tolower(tmp[1]);
+ Tcl_SetVar( dev->interp, "plwindow", tmp, 0 );
+ free(tmp);
/* Create the plframe widget & anything else you want with it. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-01-20 06:29:56
|
Revision: 10760
http://plplot.svn.sourceforge.net/plplot/?rev=10760&view=rev
Author: airwin
Date: 2010-01-20 06:29:50 +0000 (Wed, 20 Jan 2010)
Log Message:
-----------
Style recent changes.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2010-01-20 03:33:06 UTC (rev 10759)
+++ trunk/drivers/tk.c 2010-01-20 06:29:50 UTC (rev 10760)
@@ -1375,7 +1375,7 @@
char command[CMD_LEN];
unsigned int bg;
char *tmp;
- int i,n;
+ int i, n;
dbug_enter( "plwindow_init" );
@@ -1383,15 +1383,16 @@
* and with ' ' replaced by '_' and all other '.' by '_' to avoid
* quoting and bad window name problems. Also avoid name starting with
* an upper case letter. */
- n = strlen(pls->plwindow)+1;
- tmp = (char *)malloc(sizeof(char)*(n+1));
- sprintf(tmp,".%s",pls->plwindow);
- for (i=1;i<n;i++) {
- if ( (tmp[i] == ' ') || (tmp[i] == '.') ) tmp[i] = '_';
+ n = strlen( pls->plwindow ) + 1;
+ tmp = (char *) malloc( sizeof ( char ) * ( n + 1 ));
+ sprintf( tmp, ".%s", pls->plwindow );
+ for ( i = 1; i < n; i++ )
+ {
+ if (( tmp[i] == ' ' ) || ( tmp[i] == '.' )) tmp[i] = '_';
}
- if (isupper(tmp[1])) tmp[1] = tolower(tmp[1]);
+ if ( isupper( tmp[1] )) tmp[1] = tolower( tmp[1] );
Tcl_SetVar( dev->interp, "plwindow", tmp, 0 );
- free(tmp);
+ free( tmp );
/* Create the plframe widget & anything else you want with it. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2011-10-19 11:09:03
|
Revision: 11976
http://plplot.svn.sourceforge.net/plplot/?rev=11976&view=rev
Author: andrewross
Date: 2011-10-19 11:08:56 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
Change from using vfork to using fork. There is a slight performance overhead involved in this, but it is much more standard. vfork was never a well established standard and the Linux man page strongly discourages its use.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2011-10-19 11:05:10 UTC (rev 11975)
+++ trunk/drivers/tk.c 2011-10-19 11:08:56 UTC (rev 11976)
@@ -1283,7 +1283,7 @@
if ( pls->dp && pls->server_host != NULL )
{
- if ( ( dev->child_pid = vfork() ) < 0 )
+ if ( ( dev->child_pid = fork() ) < 0 )
{
abort_session( pls, "Unable to fork server process" );
}
@@ -1305,7 +1305,7 @@
else
{
plserver_exec = plFindCommand( pls->plserver );
- if ( ( plserver_exec == NULL ) || ( dev->child_pid = vfork() ) < 0 )
+ if ( ( plserver_exec == NULL ) || ( dev->child_pid = fork() ) < 0 )
{
abort_session( pls, "Unable to fork server process" );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2011-10-20 12:49:13
|
Revision: 11987
http://plplot.svn.sourceforge.net/plplot/?rev=11987&view=rev
Author: andrewross
Date: 2011-10-20 12:49:06 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
Add back explicit casts to fix compiler warnings for standard gcc flags.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2011-10-20 08:55:17 UTC (rev 11986)
+++ trunk/drivers/tk.c 2011-10-20 12:49:06 UTC (rev 11987)
@@ -1209,7 +1209,7 @@
else
{
argv[i++] = "-name"; // plserver name
- argv[i++] = pls->program;
+ argv[i++] = (char *) pls->program;
}
if ( pls->auto_path != NULL )
@@ -1230,10 +1230,10 @@
if ( pls->dp )
{
argv[i++] = "-client_host";
- argv[i++] = Tcl_GetVar( dev->interp, "client_host", TCL_GLOBAL_ONLY );
+ argv[i++] = (char *) Tcl_GetVar( dev->interp, "client_host", TCL_GLOBAL_ONLY );
argv[i++] = "-client_port";
- argv[i++] = Tcl_GetVar( dev->interp, "client_port", TCL_GLOBAL_ONLY );
+ argv[i++] = (char *) Tcl_GetVar( dev->interp, "client_port", TCL_GLOBAL_ONLY );
if ( pls->user != NULL )
{
@@ -1244,7 +1244,7 @@
else
{
argv[i++] = "-client_name";
- argv[i++] = Tcl_GetVar( dev->interp, "client_name", TCL_GLOBAL_ONLY );
+ argv[i++] = (char *) Tcl_GetVar( dev->interp, "client_name", TCL_GLOBAL_ONLY );
}
// The display absolutely must be set if invoking a remote server (by rsh)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2011-10-20 14:12:25
|
Revision: 11989
http://plplot.svn.sourceforge.net/plplot/?rev=11989&view=rev
Author: andrewross
Date: 2011-10-20 14:12:19 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
Fix some more const char * warnings.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2011-10-20 14:11:41 UTC (rev 11988)
+++ trunk/drivers/tk.c 2011-10-20 14:12:19 UTC (rev 11989)
@@ -1136,7 +1136,7 @@
launch_server( PLStream *pls )
{
TkDev *dev = (TkDev *) pls->dev;
- char * argv[20];
+ const char *argv[20];
char *plserver_exec = NULL, *ptr;
char *tmp = NULL;
int i;
@@ -1209,7 +1209,7 @@
else
{
argv[i++] = "-name"; // plserver name
- argv[i++] = (char *) pls->program;
+ argv[i++] = pls->program;
}
if ( pls->auto_path != NULL )
@@ -1230,10 +1230,10 @@
if ( pls->dp )
{
argv[i++] = "-client_host";
- argv[i++] = (char *) Tcl_GetVar( dev->interp, "client_host", TCL_GLOBAL_ONLY );
+ argv[i++] = Tcl_GetVar( dev->interp, "client_host", TCL_GLOBAL_ONLY );
argv[i++] = "-client_port";
- argv[i++] = (char *) Tcl_GetVar( dev->interp, "client_port", TCL_GLOBAL_ONLY );
+ argv[i++] = Tcl_GetVar( dev->interp, "client_port", TCL_GLOBAL_ONLY );
if ( pls->user != NULL )
{
@@ -1244,7 +1244,7 @@
else
{
argv[i++] = "-client_name";
- argv[i++] = (char *) Tcl_GetVar( dev->interp, "client_name", TCL_GLOBAL_ONLY );
+ argv[i++] = Tcl_GetVar( dev->interp, "client_name", TCL_GLOBAL_ONLY );
}
// The display absolutely must be set if invoking a remote server (by rsh)
@@ -1292,7 +1292,7 @@
fprintf( stderr, "Starting up %s on node %s\n", pls->plserver,
pls->server_host );
- if ( execvp( "rsh", argv ) )
+ if ( execvp( "rsh", (char *const *)argv ) )
{
perror( "Unable to exec server process" );
_exit( 1 );
@@ -1323,7 +1323,7 @@
}
pldebug( "launch_server", "Starting up %s\n", plserver_exec );
- if ( execv( plserver_exec, argv ) )
+ if ( execv( plserver_exec, (char * const *) argv ) )
{
fprintf( stderr, "Unable to exec server process.\n" );
_exit( 1 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2011-12-08 20:53:43
|
Revision: 12104
http://plplot.svn.sourceforge.net/plplot/?rev=12104&view=rev
Author: andrewross
Date: 2011-12-08 20:53:37 +0000 (Thu, 08 Dec 2011)
Log Message:
-----------
tk driver doesn't really need plxwd.h including (only X11/keysym.h) and not including it avoids warnings about unused variables.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2011-12-08 20:52:22 UTC (rev 12103)
+++ trunk/drivers/tk.c 2011-12-08 20:53:37 UTC (rev 12104)
@@ -39,12 +39,12 @@
#define NEED_PLDEBUG
#include "pltkd.h"
-#include "plxwd.h"
#include "pltcl.h"
#include "tcpip.h"
#include "drivers.h"
#include "metadefs.h"
#include "plevent.h"
+#include <X11/keysym.h>
#if PL_HAVE_UNISTD_H
# include <unistd.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2013-12-18 21:53:57
|
Revision: 12878
http://sourceforge.net/p/plplot/code/12878
Author: andrewross
Date: 2013-12-18 21:53:52 +0000 (Wed, 18 Dec 2013)
Log Message:
-----------
Fix failure to free memory in tk driver allocated by pl_create_tempfifo.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2013-12-18 02:14:25 UTC (rev 12877)
+++ trunk/drivers/tk.c 2013-12-18 21:53:52 UTC (rev 12878)
@@ -1558,8 +1558,11 @@
if ( unlink( iodev->fileName ) == -1 )
abort_session( pls, "Error removing fifo" );
+ free(iodev->fileName);
+ iodev->fileName = NULL;
if ( rmdir( dirname ) == -1 )
abort_session( pls, "Error removing temporary directory" );
+ free(dirname);
}
// Create socket for data transfer to the plframe widget
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2013-12-18 21:56:17
|
Revision: 12879
http://sourceforge.net/p/plplot/code/12879
Author: andrewross
Date: 2013-12-18 21:56:15 +0000 (Wed, 18 Dec 2013)
Log Message:
-----------
Cast pointer to (void *) in call to free to suppress gcc warning.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2013-12-18 21:53:52 UTC (rev 12878)
+++ trunk/drivers/tk.c 2013-12-18 21:56:15 UTC (rev 12879)
@@ -1558,11 +1558,11 @@
if ( unlink( iodev->fileName ) == -1 )
abort_session( pls, "Error removing fifo" );
- free(iodev->fileName);
+ free( (void *) iodev->fileName);
iodev->fileName = NULL;
if ( rmdir( dirname ) == -1 )
abort_session( pls, "Error removing temporary directory" );
- free(dirname);
+ free( (void *) dirname);
}
// Create socket for data transfer to the plframe widget
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2013-12-22 00:15:16
|
Revision: 12901
http://sourceforge.net/p/plplot/code/12901
Author: airwin
Date: 2013-12-22 00:15:08 +0000 (Sun, 22 Dec 2013)
Log Message:
-----------
Style previous commit.
Modified Paths:
--------------
trunk/drivers/tk.c
Modified: trunk/drivers/tk.c
===================================================================
--- trunk/drivers/tk.c 2013-12-22 00:10:13 UTC (rev 12900)
+++ trunk/drivers/tk.c 2013-12-22 00:15:08 UTC (rev 12901)
@@ -1558,11 +1558,11 @@
if ( unlink( iodev->fileName ) == -1 )
abort_session( pls, "Error removing fifo" );
- free( (void *) iodev->fileName);
+ free( (void *) iodev->fileName );
iodev->fileName = NULL;
if ( rmdir( dirname ) == -1 )
abort_session( pls, "Error removing temporary directory" );
- free( (void *) dirname);
+ free( (void *) dirname );
}
// Create socket for data transfer to the plframe widget
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|