From a61cf9dabf627125ada5e55686ce7f8d57097c71 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 31 Jan 2016 00:38:33 +0100 Subject: [PATCH 1/1] [cpu_ti] small code untangling --- src/surf/cpu_ti.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index d30954206e..c50f2f87bd 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -385,17 +385,6 @@ int CpuTiTrace::binarySearch(double *array, double a, int low, int high) } } -/************* - * CallBacks * - *************/ - -static void cpu_ti_define_callbacks() -{ - simgrid::surf::on_postparse.connect([]() { - surf_cpu_model_pm->addTraces(); - }); -} - /********* * Model * *********/ @@ -406,13 +395,14 @@ void surf_cpu_model_init_ti() xbt_assert(!surf_cpu_model_vm,"CPU model already initialized. This should not happen."); surf_cpu_model_pm = new simgrid::surf::CpuTiModel(); + xbt_dynar_push(all_existing_models, &surf_cpu_model_pm); + surf_cpu_model_vm = new simgrid::surf::CpuTiModel(); + xbt_dynar_push(all_existing_models, &surf_cpu_model_vm); - cpu_ti_define_callbacks(); - simgrid::surf::Model *model_pm = static_cast(surf_cpu_model_pm); - simgrid::surf::Model *model_vm = static_cast(surf_cpu_model_vm); - xbt_dynar_push(all_existing_models, &model_pm); - xbt_dynar_push(all_existing_models, &model_vm); + simgrid::surf::on_postparse.connect([]() { + surf_cpu_model_pm->addTraces(); + }); } namespace simgrid { -- 2.20.1