Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tidy the scope of some more locals
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 24 May 2017 12:10:29 +0000 (14:10 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 24 May 2017 12:10:29 +0000 (14:10 +0200)
examples/msg/network-ns3/network-ns3.c
examples/smpi/mc/bugged1.c
src/xbt/automaton/automatonparse_promela.c
src/xbt/log.c

index c422f5c..390ca97 100644 (file)
@@ -11,7 +11,6 @@ int timer_start; //set as 1 in the master process
 
 //keep a pointer to all surf running tasks.
 #define NTASKS 1500
 
 //keep a pointer to all surf running tasks.
 #define NTASKS 1500
-int bool_printed = 0;
 double start_time, end_time, elapsed_time;
 double gl_data_size[NTASKS];
 msg_task_t gl_task_array[NTASKS];
 double start_time, end_time, elapsed_time;
 double gl_data_size[NTASKS];
 msg_task_t gl_task_array[NTASKS];
@@ -126,9 +125,6 @@ static int worker(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-  bool_printed = 0;
-
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
              "\tExample: %s platform.xml deployment.xml\n", argv[0], argv[0]);
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
              "\tExample: %s platform.xml deployment.xml\n", argv[0], argv[0]);
@@ -142,7 +138,7 @@ int main(int argc, char *argv[])
 
   MSG_launch_application(argv[2]);
 
 
   MSG_launch_application(argv[2]);
 
-  res = MSG_main();
+  msg_error_t res = MSG_main();
 
   return res != MSG_OK;
 }
 
   return res != MSG_OK;
 }
index 8815dd3..9abacce 100644 (file)
@@ -12,7 +12,7 @@
 
 int main(int argc, char **argv)
 {
 
 int main(int argc, char **argv)
 {
-  int recv_buff, err, size, rank, i;
+  int recv_buff, err, size, rank;
   MPI_Status status;
 
   /* Initialize MPI */
   MPI_Status status;
 
   /* Initialize MPI */
@@ -33,7 +33,7 @@ int main(int argc, char **argv)
   if (rank == 0) {
     printf("MPI_ISend / MPI_IRecv Test \n");
 
   if (rank == 0) {
     printf("MPI_ISend / MPI_IRecv Test \n");
 
-    for(i=0; i < size - 1; i++){
+    for(int i=0; i < size - 1; i++){
       MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
       printf("Message received from %d\n", recv_buff);
     }
       MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
       printf("Message received from %d\n", recv_buff);
     }
index 3d83df1..6364fe3 100644 (file)
@@ -51,9 +51,8 @@ static void new_state(char* id, int src){
 
 static void new_transition(char* id, xbt_automaton_exp_label_t label)
 {
 
 static void new_transition(char* id, xbt_automaton_exp_label_t label)
 {
-  xbt_automaton_state_t state_dst = NULL;
   new_state(id, 0);
   new_state(id, 0);
-  state_dst = xbt_automaton_state_exists(parsed_automaton, id);
+  xbt_automaton_state_t state_dst = xbt_automaton_state_exists(parsed_automaton, id);
   xbt_automaton_state_t state_src = xbt_automaton_state_exists(parsed_automaton, state_id_src);
   
   //xbt_transition_t trans = NULL;
   xbt_automaton_state_t state_src = xbt_automaton_state_exists(parsed_automaton, state_id_src);
   
   //xbt_transition_t trans = NULL;
index 0323fde..a7379c5 100644 (file)
@@ -458,7 +458,6 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
 
   unsigned int cursor;
   xbt_log_setting_t setting = NULL;
 
   unsigned int cursor;
   xbt_log_setting_t setting = NULL;
-  int found = 0;
 
   XBT_DEBUG("Initializing category '%s' (firstChild=%s, nextSibling=%s)", category->name,
          (category->firstChild ? category->firstChild->name : "none"),
 
   XBT_DEBUG("Initializing category '%s' (firstChild=%s, nextSibling=%s)", category->name,
          (category->firstChild ? category->firstChild->name : "none"),
@@ -503,6 +502,7 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
   if (xbt_log_settings) {
     xbt_assert(category, "NULL category");
     xbt_assert(category->name);
   if (xbt_log_settings) {
     xbt_assert(category, "NULL category");
     xbt_assert(category->name);
+    int found = 0;
 
     xbt_dynar_foreach(xbt_log_settings, cursor, setting) {
       xbt_assert(setting, "Damnit, NULL cat in the list");
 
     xbt_dynar_foreach(xbt_log_settings, cursor, setting) {
       xbt_assert(setting, "Damnit, NULL cat in the list");