Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar by removing useless asignments and return statements
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 7 Jan 2017 19:19:10 +0000 (20:19 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 7 Jan 2017 19:19:10 +0000 (20:19 +0100)
41 files changed:
examples/msg/actions-comm/actions-comm.c
examples/msg/actions-storage/actions-storage.c
examples/msg/app-bittorrent/peer.c
examples/msg/app-chainsend/chainsend.c
examples/msg/dht-pastry/dht-pastry.c
examples/msg/energy-consumption/energy-consumption.c
examples/msg/energy-onoff/energy-onoff.c
examples/msg/energy-pstate/energy-pstate.c
examples/msg/energy-vm/energy-vm.c
examples/msg/platform-failures/platform-failures.c
examples/msg/process-kill/process-kill.c
examples/msg/process-migration/process-migration.c
examples/msg/process-startkilltime/process-startkilltime.c
examples/msg/process-suspend/process-suspend.c
examples/msg/task-priority/task-priority.c
src/bindings/java/jmsg.cpp
src/bindings/java/jmsg_comm.cpp
src/instr/instr_interface.cpp
src/instr/instr_resource_utilization.cpp
src/kernel/routing/TorusZone.cpp
src/mc/simgrid_mc.cpp
src/msg/instr_msg_task.cpp
src/simix/smx_global.cpp
src/simix/smx_host.cpp
src/smpi/smpi_base.cpp
src/smpi/smpi_deployment.cpp
src/smpi/smpi_global.cpp
src/surf/cpu_ti.cpp
src/surf/host_clm03.cpp
src/surf/maxmin.cpp
src/surf/network_cm02.cpp
src/surf/ptask_L07.cpp
src/xbt/config.cpp
src/xbt/cunit.cpp
src/xbt/dict.cpp
src/xbt/fifo.c
src/xbt/heap.c
src/xbt/xbt_replay.cpp
teshsuite/msg/get_sender/get_sender.c
teshsuite/msg/pid/pid.c
teshsuite/msg/trace_integration/trace_integration.c

index b5dcc48..e9888db 100644 (file)
@@ -280,8 +280,6 @@ static void action_finalize(const char *const *action)
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   /* Check the given arguments */
   MSG_init(&argc, argv);
   /* Explicit initialization of the action module is required now*/
@@ -312,7 +310,7 @@ int main(int argc, char *argv[])
   xbt_replay_action_register("compute", action_compute);
 
   /* Actually do the simulation using MSG_action_trace_run */
-  res = MSG_action_trace_run(argv[3]);  // it's ok to pass a NULL argument here
+  msg_error_t res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
index d975652..f9b6f64 100644 (file)
@@ -92,10 +92,8 @@ static void action_close(const char *const *action) {
 }
 
 int main(int argc, char *argv[]) {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
-  /* Explicit initialization of the action module is required now*/
+  /* Explicit initialization of the action module is required */
   MSG_action_init();
 
   xbt_assert(argc > 3,"Usage: %s platform_file deployment_file [action_files]\n"
@@ -114,7 +112,7 @@ int main(int argc, char *argv[]) {
   if (opened_files == NULL)
     opened_files = xbt_dict_new_homogeneous(NULL);
   /* Actually do the simulation using MSG_action_trace_run */
-  res = MSG_action_trace_run(argv[3]);  // it's ok to pass a NULL argument here
+  msg_error_t res = MSG_action_trace_run(argv[3]); // it's ok to pass a NULL argument here
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
index ca5f650..d73560c 100644 (file)
@@ -464,9 +464,7 @@ void update_pieces_count_from_bitfield(peer_t peer, char *bitfield)
  */
 int select_piece_to_download(peer_t peer, connection_t remote_peer)
 {
-  int piece = -1;
-
-  piece = partially_downloaded_piece(peer, remote_peer);
+  int piece = partially_downloaded_piece(peer, remote_peer);
   // strict priority policy
   if (piece != -1)
     return piece;
index e7316ac..771e521 100644 (file)
@@ -19,8 +19,6 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_chainsend, "Messages specific for chainsend");
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
 
   MSG_create_environment(argv[1]);
@@ -42,7 +40,7 @@ int main(int argc, char *argv[])
 
   MSG_launch_application(argv[2]);
 
-  res = MSG_main();
+  msg_error_t res = MSG_main();
 
   XBT_INFO("Total simulation time: %e", MSG_get_clock());
 
index 26e3579..f60180c 100644 (file)
@@ -137,13 +137,12 @@ static int closest_in_namespace_set(node_t node, int dest) {
 /* Find the next node to forward a message to */
 static int routing_next(node_t node, int dest) {
   int closest = closest_in_namespace_set(node, dest);
-  int res = -1;
   if (closest!=-1)
     return closest;
 
   int l = shl(node->id, dest);
-  res = node->routing_table[l][domain(dest, l)];
-  if (res!=-1)
+  int res = node->routing_table[l][domain(dest, l)];
+  if (res != -1)
     return res;
 
   //rare case
index c8fa346..f8985ef 100644 (file)
@@ -68,7 +68,6 @@ static int dvfs(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
   sg_energy_plugin_init();
   MSG_init(&argc, argv);
 
@@ -77,7 +76,7 @@ int main(int argc, char *argv[])
   MSG_create_environment(argv[1]);
   MSG_process_create("dvfs_test", dvfs, NULL, MSG_get_host_by_name("MyHost1"));
 
-  res = MSG_main();
+  msg_error_t res = MSG_main();
 
   XBT_INFO("Total simulation time: %.2f", MSG_get_clock());
 
index 5462489..98562d5 100644 (file)
@@ -84,7 +84,6 @@ static int onoff(int argc, char *argv[]) {
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
   sg_energy_plugin_init();
   MSG_init(&argc, argv);
 
@@ -94,7 +93,7 @@ int main(int argc, char *argv[])
 
   MSG_process_create("onoff_test", onoff, NULL, MSG_get_host_by_name("MyHost2"));
 
-  res = MSG_main();
+  msg_error_t res = MSG_main();
 
   XBT_INFO("Total simulation time: %.2f", MSG_get_clock());
 
index fc055b7..0901969 100644 (file)
@@ -69,8 +69,6 @@ static int dvfs(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
 
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
@@ -80,7 +78,7 @@ int main(int argc, char *argv[])
   MSG_process_create("dvfs_test", dvfs, NULL, MSG_get_host_by_name("MyHost1"));
   MSG_process_create("dvfs_test", dvfs, NULL, MSG_get_host_by_name("MyHost2"));
 
-  res = MSG_main();
+  msg_error_t res = MSG_main();
 
   XBT_INFO("Total simulation time: %e", MSG_get_clock());
 
index 752822a..c885f51 100644 (file)
@@ -58,7 +58,6 @@ static int dvfs(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
   sg_energy_plugin_init();
   MSG_init(&argc, argv);
 
@@ -68,7 +67,7 @@ int main(int argc, char *argv[])
 
   MSG_process_create("dvfs",dvfs,NULL,MSG_host_by_name("MyHost1"));
 
-  res = MSG_main();
+  msg_error_t res = MSG_main();
 
   XBT_INFO("Total simulation time: %.2f; All hosts must have the exact same energy consumption.", MSG_get_clock());
 
index 5e44285..1259ff4 100644 (file)
@@ -141,8 +141,6 @@ static int worker(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
              "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
@@ -153,7 +151,7 @@ int main(int argc, char *argv[])
   MSG_function_register("worker", worker);
   MSG_launch_application(argv[2]);
 
-  res = MSG_main();
+  msg_error_t res = MSG_main();
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
index f83b68a..534e6d8 100644 (file)
@@ -36,8 +36,6 @@ static int killer(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
@@ -45,7 +43,7 @@ int main(int argc, char *argv[])
   /* - Create and deploy killer process, that will create the victim process  */
   MSG_process_create("killer", killer, NULL, MSG_host_by_name("Tremblay"));
 
-  res = MSG_main();                 /* - Run the simulation */
+  msg_error_t res = MSG_main(); /* - Run the simulation */
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
index b0f5157..31f6a36 100644 (file)
@@ -54,8 +54,6 @@ static int policeman(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
@@ -64,9 +62,9 @@ int main(int argc, char *argv[])
   MSG_process_create("emigrant", emigrant, NULL, MSG_get_host_by_name("Jacquelin"));
   MSG_process_create("policeman", policeman, NULL, MSG_get_host_by_name("Boivin"));
 
-  checkpoint = xbt_mutex_init();     /* - Initiate the mutex and conditions */
+  checkpoint      = xbt_mutex_init(); /* - Initiate the mutex and conditions */
   identification = xbt_cond_init();
-  res = MSG_main();                  /* - Run the simulation */
+  msg_error_t res = MSG_main(); /* - Run the simulation */
   XBT_INFO("Simulation time %g", MSG_get_clock());
   xbt_cond_destroy(identification);
   xbt_mutex_destroy(checkpoint);
index 287fd11..6e12c39 100644 (file)
@@ -26,8 +26,6 @@ static int sleeper(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
              "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
@@ -36,7 +34,7 @@ int main(int argc, char *argv[])
   MSG_function_register("sleeper", sleeper);
   MSG_launch_application(argv[2]);   /* - Deploy the sleeper processes with explicit start/kill times */
 
-  res = MSG_main();                  /* - Run the simulation */
+  msg_error_t res = MSG_main(); /* - Run the simulation */
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
 }
index b4fb807..e385517 100644 (file)
@@ -73,8 +73,6 @@ static int dream_master(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
   xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
@@ -83,7 +81,7 @@ int main(int argc, char *argv[])
   xbt_dynar_t hosts = MSG_hosts_as_dynar();
   MSG_process_create("dream_master", dream_master, NULL, xbt_dynar_getfirst_as(hosts, msg_host_t));
   xbt_dynar_free(&hosts);
-  res = MSG_main();                 /* - Run the simulation */
+  msg_error_t res = MSG_main(); /* - Run the simulation */
 
   return res != MSG_OK;
 }
index d852f52..a162ffe 100644 (file)
@@ -24,8 +24,6 @@ static int test(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
              "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
@@ -34,7 +32,7 @@ int main(int argc, char *argv[])
   MSG_function_register("test", test);
   MSG_launch_application(argv[2]);
 
-  res = MSG_main();
+  msg_error_t res = MSG_main();
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
index 66a6ebb..f19a1da 100644 (file)
@@ -336,9 +336,7 @@ void java_main_jprocess(jobject jprocess)
   jprocess_bind(context->jprocess, process, env);
 
   // Adrien, ugly path, just to bypass creation of context at low levels (i.e such as for the VM migration for instance)
-  if (context->jprocess == nullptr)
-    return;
-  else
+  if (context->jprocess != nullptr)
     run_jprocess(env, context->jprocess);
 }
 }}}
index 96ddecf..37de834 100644 (file)
@@ -115,7 +115,6 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitCompletion(JNIEnv *env, job
   env->SetBooleanField(jcomm, jcomm_field_Comm_finished, JNI_TRUE);
   if (status == MSG_OK) {
     jcomm_bind_task(env,jcomm);
-    return;
   } else {
     jmsg_throw_status(env,status);
   }
index 78a41cf..6801500 100644 (file)
@@ -277,16 +277,12 @@ static void instr_user_variable(double time, const char *resource, const char *v
   //check if variable is already declared
   char *created = (char*)xbt_dict_get_or_null(filter, variable);
   if (what == INSTR_US_DECLARE){
-    if (created){//already declared
-      return;
-    }else{
+    if (!created) { // not declared yet
       xbt_dict_set (filter, variable, xbt_strdup("1"), nullptr);
       instr_new_user_variable_type (father_type, variable, color);
     }
   }else{
-    if (!created){//not declared, ignore
-      return;
-    } else {
+    if (created) { // declared, let's work
       char valuestr[100];
       snprintf(valuestr, 100, "%g", value);
       container_t container = PJ_container_get(resource);
index 70137b6..c7b0bcd 100644 (file)
@@ -71,7 +71,6 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category,
     type_t type = PJ_type_get (category_type, container->type);
     instr_event (now, delta, type, container, value);
   }
-  return;
 }
 
 /* TRACE_surf_host_set_utilization: entry point from SimGrid */
@@ -79,9 +78,7 @@ void TRACE_surf_host_set_utilization(const char *resource, const char *category,
 {
   //only trace host utilization if host is known by tracing mechanism
   container_t container = PJ_container_get_or_null(resource);
-  if (!container)
-    return;
-  if (!value)
+  if (!container || !value)
     return;
 
   //trace uncategorized host utilization
@@ -102,7 +99,6 @@ void TRACE_surf_host_set_utilization(const char *resource, const char *category,
     type_t type = PJ_type_get (category_type, container->type);
     instr_event (now, delta, type, container, value);
   }
-  return;
 }
 
 void TRACE_surf_resource_utilization_alloc()
index 4c38ff8..226d0f1 100644 (file)
@@ -223,8 +223,6 @@ void TorusZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t
   }
   free(myCoords);
   free(targetCoords);
-
-  return;
 }
 }
 }
index a115825..ec20889 100644 (file)
@@ -64,7 +64,7 @@ int main(int argc, char** argv)
     // Currently, we need this before sg_config_init:
     _sg_do_model_check = 1;
 
-    // The initialisation function can touch argv.
+    // The initialization function can touch argv.
     // We make a copy of argv before modifying it in order to pass the original
     // value to the model-checked:
     char** argv_copy = argvdup(argc, argv);
index ae50dfb..65f32a6 100644 (file)
@@ -79,7 +79,6 @@ void TRACE_msg_task_destroy(msg_task_t task)
   //free category
   xbt_free(task->category);
   task->category = nullptr;
-  return;
 }
 
 /* MSG_task_get related functions */
index 30eec19..598882c 100644 (file)
@@ -321,7 +321,6 @@ void SIMIX_clean()
   surf_exit();
 
   simix_global = nullptr;
-  return;
 }
 
 
index 989eade..dab3c22 100644 (file)
@@ -319,6 +319,5 @@ void SIMIX_set_category(smx_activity_t synchro, const char *category)
   simgrid::kernel::activity::Comm *comm = dynamic_cast<simgrid::kernel::activity::Comm *>(synchro);
   if (comm != nullptr) {
     comm->surf_comm->setCategory(category);
-    return;
   }
 }
index b7af999..24f5645 100644 (file)
@@ -816,8 +816,6 @@ void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
       nsleeps++;
   }
   smpi_mpi_request_free(&request);
-
-  return;
 }
 
 void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
index 2747f0c..d9ad5ac 100644 (file)
@@ -51,7 +51,6 @@ void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_
   }
 
   xbt_dict_set(smpi_instances, name, (void*)instance, nullptr);
-  return;
 }
 
 //get the index of the process in the process_data array
@@ -78,7 +77,6 @@ void smpi_deployment_register_process(const char* instance_id, int rank, int ind
   smpi_group_set_mapping(smpi_comm_group(instance->comm_world), index, rank);
   *bar = instance->finalization_barrier;
   *comm = &instance->comm_world;
-  return;
 }
 
 void smpi_deployment_cleanup_instances(){
index a804bcb..526ad14 100644 (file)
@@ -426,7 +426,7 @@ void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t b
 
 void smpi_comm_null_copy_buffer_callback(smx_activity_t comm, void *buff, size_t buff_size)
 {
-  return;
+  /* nothing done in this version */
 }
 
 static void smpi_check_options(){
@@ -662,7 +662,6 @@ void smpi_global_destroy()
 void __attribute__ ((weak)) user_main_()
 {
   xbt_die("Should not be in this smpi_simulated_main");
-  return;
 }
 
 int __attribute__ ((weak)) smpi_simulated_main_(int argc, char **argv)
index 6e9afb5..530a2e2 100644 (file)
@@ -708,7 +708,6 @@ void CpuTiAction::cancel()
   this->setState(Action::State::failed);
   xbt_heap_remove(getModel()->getActionHeap(), this->indexHeap_);
   cpu_->modified(true);
-  return;
 }
 
 void CpuTiAction::suspend()
index 7a4686e..1712ea9 100644 (file)
@@ -68,7 +68,7 @@ double HostCLM03Model::nextOccuringEvent(double now){
 }
 
 void HostCLM03Model::updateActionsState(double /*now*/, double /*delta*/){
-  return;
+  /* I won't do what you tell me */
 }
 
 }
index 623a3b2..0c7d57a 100644 (file)
@@ -1133,7 +1133,6 @@ void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, double wei
   lmm_check_concurrency(sys);
 
   XBT_OUT();
-  return;
 }
 
 double lmm_get_variable_weight(lmm_variable_t var)
index 75d41bc..b84aa90 100644 (file)
@@ -216,7 +216,6 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
       action->gapRemove();
     }
   }
-  return;
 }
 
 
index f2ae71e..60b919c 100644 (file)
@@ -141,7 +141,6 @@ void HostL07Model::updateActionsState(double /*now*/, double delta) {
       }
     }
   }
-  return;
 }
 
 Action *HostL07Model::executeParallelTask(int host_nb, sg_host_t *host_list,
index 814ec46..d26c4ec 100644 (file)
@@ -612,7 +612,6 @@ on_missing_key:
 on_exception:
   free(optionlist_cpy);
   THROWF(unknown_error, 0, "Could not set variables %s", options);
-  return;
 }
 
 // Horrible mess to translate C++ exceptions to C exceptions:
index e699c85..d98ac9d 100644 (file)
@@ -233,7 +233,6 @@ void xbt_test_suite_push(xbt_test_suite_t suite, const char *name, ts_test_cb_t
   unit->tests = xbt_dynar_new(sizeof(xbt_test_test_t), xbt_test_test_free);
 
   xbt_dynar_push(suite->units, &unit);
-  return;
 }
 
 /* run test one suite */
@@ -643,7 +642,6 @@ void _xbt_test_add(const char *file, int line, const char *fmt, ...)
   test->line = line;
   test->logs = xbt_dynar_new(sizeof(xbt_test_log_t), xbt_test_log_free);
   xbt_dynar_push(unit->tests, &test);
-  return;
 }
 
 /* annotate test case with log message and failure */
index c682720..555ecc4 100644 (file)
@@ -135,7 +135,6 @@ static void xbt_dict_rehash(xbt_dict_t dict)
         if (!*twincell)
           dict->fill++;
         *twincell = bucklet;
-        continue;
       } else {
         pprev = &bucklet->next;
       }
index 3f6714b..fc747c3 100644 (file)
@@ -204,7 +204,6 @@ void xbt_fifo_unshift_item(xbt_fifo_t l, xbt_fifo_item_t new)
   new->next = l->head;
   new->next->prev = new;
   l->head = new;
-  return;
 }
 
 /** Shift bucket
@@ -461,7 +460,6 @@ inline void *xbt_fifo_get_item_content(xbt_fifo_item_t i)
 inline void xbt_fifo_free_item(xbt_fifo_item_t b)
 {
   xbt_mallocator_release(item_mallocator, b);
-  return;
 }
 
 /** Destructor
@@ -471,7 +469,6 @@ inline void xbt_fifo_freeitem(xbt_fifo_item_t b)
 {
   XBT_CWARN(xbt_fifo, "This function is deprecated. Use xbt_fifo_free_item.");
   xbt_fifo_free_item(b);
-  return;
 }
 
 /**
index 5bfca96..e32dfc4 100644 (file)
@@ -98,7 +98,6 @@ void xbt_heap_push(xbt_heap_t H, void *content, double key)
   item->content = content;
   xbt_heap_increase_key(H, count - 1);
   XBT_DEBUG("Heap has now %d elements and max elem is %g",xbt_heap_size(H),xbt_heap_maxkey(H));
-  return;
 }
 
 /**
@@ -277,5 +276,4 @@ static void xbt_heap_increase_key(xbt_heap_t H, int i)
   }
   if (H->update_callback)
     H->update_callback(items[i].content, i);
-  return;
 }
index 50f208a..2fd02d3 100644 (file)
@@ -233,7 +233,7 @@ static char **action_get_action(char *name)
         xbt_dynar_push(otherqueue, &evt);
       }
     }
-    goto todo_done;             // end of file reached while searching in vain for more work
+    // end of file reached while searching in vain for more work
   } else {
     // Get something from my queue and return it
     xbt_dynar_shift(myqueue, &evt);
index 8cdab2f..2048b5f 100644 (file)
@@ -30,8 +30,6 @@ static int receiver_fun(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
 
   MSG_create_environment(argv[1]);
@@ -39,6 +37,5 @@ int main(int argc, char *argv[])
   MSG_process_create("send", sender_fun, NULL, MSG_get_host_by_name("Tremblay"));
   MSG_process_create("receive", receiver_fun, NULL, MSG_get_host_by_name("Tremblay"));
 
-  res = MSG_main();
-  return res != MSG_OK;
+  return MSG_main() != MSG_OK;
 }
index 3a30fc5..540aa6b 100644 (file)
@@ -45,8 +45,6 @@ static int killall(int argc, char *argv[]){
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
 
   MSG_process_killall(atoi(argv[2]));
@@ -57,7 +55,5 @@ int main(int argc, char *argv[])
   MSG_process_create("sendpid", sendpid, NULL, MSG_get_host_by_name("Tremblay"));
   MSG_process_create("killall", killall, NULL, MSG_get_host_by_name("Tremblay"));
 
-  res = MSG_main();
-
-  return res != MSG_OK;
+  return MSG_main() != MSG_OK;
 }
index c39732a..5fdb198 100644 (file)
@@ -11,13 +11,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test_trace_integration, "Messages specific for this
 /** test the trace integration cpu model */
 static int test_trace(int argc, char *argv[])
 {
-  double task_comp_size = 2800;
-  double task_prio = 1.0;
-
   xbt_assert (argc == 3,"Wrong number of arguments!\nUsage: %s <task computational size in FLOPS> <task priority>", argv[0]);
 
-  task_comp_size = xbt_str_parse_double(argv[1],"Invalid computational size: %s");
-  task_prio = xbt_str_parse_double(argv[2], "Invalid task priority: %s");
+  double task_comp_size = xbt_str_parse_double(argv[1], "Invalid computational size: %s");
+  double task_prio      = xbt_str_parse_double(argv[2], "Invalid task priority: %s");
 
   XBT_INFO("Testing the trace integration cpu model: CpuTI");
   XBT_INFO("Task size: %f", task_comp_size);
@@ -36,8 +33,6 @@ static int test_trace(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-  msg_error_t res = MSG_OK;
-
   MSG_init(&argc, argv);
   xbt_assert(argc > 2, "Usage: %s test_trace_integration_model.xml deployment.xml\n", argv[0]);
 
@@ -45,7 +40,5 @@ int main(int argc, char *argv[])
   MSG_create_environment(argv[1]);
   MSG_launch_application(argv[2]);
 
-  res = MSG_main();
-
-  return res != MSG_OK;
+  return MSG_main() != MSG_OK;
 }