[GRASS-SVN] r60205 - grass/trunk/display/d.mon

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 11 19:03:01 PDT 2014


Author: hcho
Date: 2014-05-11 19:03:01 -0700 (Sun, 11 May 2014)
New Revision: 60205

Modified:
   grass/trunk/display/d.mon/start.c
   grass/trunk/display/d.mon/stop.c
Log:
Removed unnecessary variables

Modified: grass/trunk/display/d.mon/start.c
===================================================================
--- grass/trunk/display/d.mon/start.c	2014-05-12 01:55:09 UTC (rev 60204)
+++ grass/trunk/display/d.mon/start.c	2014-05-12 02:03:01 UTC (rev 60205)
@@ -13,16 +13,13 @@
 /* start file-based monitor */
 void start(const char *name, const char *output)
 {
-    char *u_name;
     char *env_name;
 
     if (!output)
 	return;
 
-    u_name = G_store_upper(name);
-
     env_name = NULL;
-    G_asprintf(&env_name, "MONITOR_%s_MAPFILE", u_name);
+    G_asprintf(&env_name, "MONITOR_%s_MAPFILE", G_store_upper(name));
     G_setenv(env_name, output);
 }
 
@@ -31,14 +28,11 @@
 	      const char *env_value, const char *cmd_value,
 	      int width, int height)
 {
-    char *u_name;
     char progname[GPATH_MAX];
     char *env_name, *map_value, str_width[1024], str_height[1024];
 
-    u_name = G_store_upper(name);
-
     env_name = NULL;
-    G_asprintf(&env_name, "MONITOR_%s_MAPFILE", u_name);
+    G_asprintf(&env_name, "MONITOR_%s_MAPFILE", G_store_upper(name));
     G_asprintf(&map_value, "%s.ppm", tempfile);
     G_setenv(env_name, map_value);
     /* close(creat(map_value, 0666)); */

Modified: grass/trunk/display/d.mon/stop.c
===================================================================
--- grass/trunk/display/d.mon/stop.c	2014-05-12 01:55:09 UTC (rev 60204)
+++ grass/trunk/display/d.mon/stop.c	2014-05-12 02:03:01 UTC (rev 60205)
@@ -26,14 +26,11 @@
 
 int stop(const char *name)
 {
-    char *u_name;
     char *env_name;
     const char *env_file;
 
-    u_name = G_store_upper(name);
-
     env_name = NULL;
-    G_asprintf(&env_name, "MONITOR_%s_ENVFILE", u_name);
+    G_asprintf(&env_name, "MONITOR_%s_ENVFILE", G_store_upper(name));
     
     env_file = G__getenv(env_name);
     if (!env_file)
@@ -46,14 +43,11 @@
 
 int stop_wx(const char *name)
 {
-    char *u_name;
     char *env_name;
     const char *pid;
 
-    u_name = G_store_upper(name);
-
     env_name = NULL;
-    G_asprintf(&env_name, "MONITOR_%s_PID", u_name);
+    G_asprintf(&env_name, "MONITOR_%s_PID", G_store_upper(name));
     
     pid = G__getenv(env_name);
     if (!pid) {



More information about the grass-commit mailing list