Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[tesh] Don't define variables twice.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 18 May 2011 12:25:27 +0000 (14:25 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 18 May 2011 14:40:29 +0000 (16:40 +0200)
Declare them "extern" in include file.
Found by compiling with "-fno-common".

tools/tesh/tesh.c
tools/tesh/tesh.h

index cd96399..34c92b1 100644 (file)
@@ -21,8 +21,13 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(tesh, "TEst SHell utility");
 /*** Options ***/
 int timeout_value = 5;          /* child timeout value */
 int sort_len = 19;              /* length of the prefix to sort */
 /*** Options ***/
 int timeout_value = 5;          /* child timeout value */
 int sort_len = 19;              /* length of the prefix to sort */
+char *option;
 
 
+rctx_t rctx;
 const char *testsuite_name;
 const char *testsuite_name;
+
+xbt_dict_t env;
+
 static void handle_line(const char *filepos, char *line)
 {
   /* Search end */
 static void handle_line(const char *filepos, char *line)
 {
   /* Search end */
index 326c1f5..0dfd22b 100644 (file)
@@ -22,13 +22,13 @@ const char *signal_name(unsigned int got, char *expected);
 #include "run_context.h"
 
 /*** Options ***/
 #include "run_context.h"
 
 /*** Options ***/
-int timeout_value;              /* child timeout value */
-int sort_len;                   /* length of the prefix to sort */
-char* option;                                  /* cfg for command line */
+extern int timeout_value;       /* child timeout value */
+extern int sort_len;            /* length of the prefix to sort */
+extern char* option;            /* cfg for command line */
 #define SORT_LEN_DEFAULT 19
 
 #define SORT_LEN_DEFAULT 19
 
-rctx_t rctx;
-const char *testsuite_name;
+extern rctx_t rctx;
+extern const char *testsuite_name;
 
 
 /* Environment related definitions */
 
 
 /* Environment related definitions */
@@ -41,6 +41,6 @@ const char *testsuite_name;
 extern char **environ;
 # endif
 
 extern char **environ;
 # endif
 
-xbt_dict_t env;                 /* the environment, stored as a dict (for variable substitution) */
+extern xbt_dict_t env; /* the environment, stored as a dict (for variable substitution) */
 
 #endif                          /* TESH_H */
 
 #endif                          /* TESH_H */