Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prefer "using" to "typedef".
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Nov 2020 15:11:29 +0000 (16:11 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Nov 2020 15:57:30 +0000 (16:57 +0100)
50 files changed:
include/simgrid/Exception.hpp
include/simgrid/forward.h
include/simgrid/jedule/jedule.hpp
include/simgrid/jedule/jedule_events.hpp
include/simgrid/jedule/jedule_platform.hpp
include/simgrid/kernel/future.hpp
include/simgrid/kernel/resource/Action.hpp
include/simgrid/msg.h
include/simgrid/simix.hpp
include/simgrid/simix/blocking_simcall.hpp
include/smpi/forward.hpp
include/xbt/config.h
include/xbt/functional.hpp
include/xbt/replay.hpp
include/xbt/signal.hpp
include/xbt/string.hpp
src/kernel/actor/ActorImpl.hpp
src/kernel/context/Context.hpp
src/kernel/context/ContextBoost.hpp
src/kernel/context/ContextRaw.cpp
src/kernel/lmm/maxmin.cpp
src/kernel/lmm/maxmin.hpp
src/kernel/resource/profile/FutureEvtSet.hpp
src/kernel/routing/DijkstraZone.cpp
src/mc/compare.cpp
src/mc/inspect/DwarfExpression.hpp
src/mc/inspect/LocationList.hpp
src/mc/inspect/ObjectInformation.cpp
src/mc/inspect/Type.hpp
src/mc/mc_hash.hpp
src/mc/mc_record.hpp
src/mc/remote/RemoteSimulation.cpp
src/mc/sosp/PageStore.hpp
src/mc/sosp/Snapshot.hpp
src/simix/popping_private.hpp
src/smpi/include/private.hpp
src/smpi/include/smpi_keyvals.hpp
src/smpi/include/smpi_request.hpp
src/smpi/include/smpi_topo.hpp
src/smpi/internals/smpi_config.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_replay.cpp
src/smpi/internals/smpi_shared.cpp
src/smpi/internals/smpi_utils.cpp
src/smpi/mpi/smpi_request.cpp
src/smpi/plugins/load_balancer/LoadBalancer.cpp
src/smpi/plugins/load_balancer/load_balancer.hpp
src/surf/HostImpl.hpp
src/surf/cpu_ti.hpp
src/xbt/xbt_log_appender_file.cpp

index a030f0b..2369503 100644 (file)
@@ -113,7 +113,7 @@ public:
   ~TimeoutException() override;
 };
 
-XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::TimeoutException") typedef TimeoutException TimeoutError;
+using TimeoutError XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::TimeoutException") = TimeoutException;
 
 /** Exception raised when a host fails */
 class HostFailureException : public Exception {
@@ -239,6 +239,6 @@ private:
 
 } // namespace simgrid
 
-XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::Exception") typedef simgrid::Exception xbt_ex;
+using xbt_ex XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::Exception") = simgrid::Exception;
 
 #endif
index 4d450ab..73212dc 100644 (file)
@@ -101,37 +101,37 @@ namespace kernel {
 class EngineImpl;
 namespace actor {
 class ActorImpl;
-typedef boost::intrusive_ptr<ActorImpl> ActorImplPtr;
+using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
 
 // What's executed as an actor code:
-typedef std::function<void()> ActorCode;
+using ActorCode = std::function<void()>;
 // Create an ActorCode from the parameters parsed in the XML file (or elsewhere)
-typedef std::function<ActorCode(std::vector<std::string> args)> ActorCodeFactory;
+using ActorCodeFactory = std::function<ActorCode(std::vector<std::string> args)>;
 } // namespace actor
 
 namespace activity {
   class ActivityImpl;
   enum class State;
-  typedef boost::intrusive_ptr<ActivityImpl> ActivityImplPtr;
+  using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
   XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
   XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
 
   class ConditionVariableImpl;
 
   class CommImpl;
-  typedef boost::intrusive_ptr<CommImpl> CommImplPtr;
+  using CommImplPtr = boost::intrusive_ptr<CommImpl>;
   class ExecImpl;
-  typedef boost::intrusive_ptr<ExecImpl> ExecImplPtr;
+  using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
   class IoImpl;
-  typedef boost::intrusive_ptr<IoImpl> IoImplPtr;
+  using IoImplPtr = boost::intrusive_ptr<IoImpl>;
   class MutexImpl;
-  typedef boost::intrusive_ptr<MutexImpl> MutexImplPtr;
+  using MutexImplPtr = boost::intrusive_ptr<MutexImpl>;
   class RawImpl;
-  typedef boost::intrusive_ptr<RawImpl> RawImplPtr;
+  using RawImplPtr = boost::intrusive_ptr<RawImpl>;
   class SemaphoreImpl;
-  typedef boost::intrusive_ptr<SemaphoreImpl> SemaphoreImplPtr;
+  using SemaphoreImplPtr = boost::intrusive_ptr<SemaphoreImpl>;
   class SleepImpl;
-  typedef boost::intrusive_ptr<SleepImpl> SleepImplPtr;
+  using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
 
   class MailboxImpl;
 }
@@ -192,30 +192,30 @@ class VirtualMachineImpl;
 } // namespace vm
 } // namespace simgrid
 
-typedef simgrid::s4u::Actor s4u_Actor;
-typedef simgrid::s4u::Barrier s4u_Barrier;
-typedef simgrid::s4u::Comm s4u_Comm;
-typedef simgrid::s4u::Exec s4u_Exec;
-typedef simgrid::s4u::Host s4u_Host;
-typedef simgrid::s4u::Link s4u_Link;
-typedef simgrid::s4u::File s4u_File;
-typedef simgrid::s4u::ConditionVariable s4u_ConditionVariable;
-typedef simgrid::s4u::Mailbox s4u_Mailbox;
-typedef simgrid::s4u::Mutex s4u_Mutex;
-typedef simgrid::s4u::Semaphore s4u_Semaphore;
-typedef simgrid::s4u::Disk s4u_Disk;
-typedef simgrid::s4u::Storage s4u_Storage;
-typedef simgrid::s4u::NetZone s4u_NetZone;
-typedef simgrid::s4u::VirtualMachine s4u_VM;
-
-typedef simgrid::simix::Timer* smx_timer_t;
-typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
-typedef simgrid::kernel::activity::ActivityImpl* smx_activity_t;
-typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
-typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
-typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
-typedef simgrid::kernel::activity::SemaphoreImpl* smx_sem_t;
-XBT_ATTRIB_DEPRECATED_v330("Please use kernel::activity::State") typedef simgrid::kernel::activity::State e_smx_state_t;
+using s4u_Actor             = simgrid::s4u::Actor;
+using s4u_Barrier           = simgrid::s4u::Barrier;
+using s4u_Comm              = simgrid::s4u::Comm;
+using s4u_Exec              = simgrid::s4u::Exec;
+using s4u_Host              = simgrid::s4u::Host;
+using s4u_Link              = simgrid::s4u::Link;
+using s4u_File              = simgrid::s4u::File;
+using s4u_ConditionVariable = simgrid::s4u::ConditionVariable;
+using s4u_Mailbox           = simgrid::s4u::Mailbox;
+using s4u_Mutex             = simgrid::s4u::Mutex;
+using s4u_Semaphore         = simgrid::s4u::Semaphore;
+using s4u_Disk              = simgrid::s4u::Disk;
+using s4u_Storage           = simgrid::s4u::Storage;
+using s4u_NetZone           = simgrid::s4u::NetZone;
+using s4u_VM                = simgrid::s4u::VirtualMachine;
+
+using smx_timer_t    = simgrid::simix::Timer*;
+using smx_actor_t    = simgrid::kernel::actor::ActorImpl*;
+using smx_activity_t = simgrid::kernel::activity::ActivityImpl*;
+using smx_cond_t     = simgrid::kernel::activity::ConditionVariableImpl*;
+using smx_mailbox_t  = simgrid::kernel::activity::MailboxImpl*;
+using smx_mutex_t    = simgrid::kernel::activity::MutexImpl*;
+using smx_sem_t      = simgrid::kernel::activity::SemaphoreImpl*;
+using e_smx_state_t XBT_ATTRIB_DEPRECATED_v330("Please use kernel::activity::State") = simgrid::kernel::activity::State;
 #else
 
 typedef struct s4u_Actor s4u_Actor;
index 55b84eb..06893ce 100644 (file)
@@ -34,6 +34,6 @@ public:
 } // namespace jedule
 } // namespace simgrid
 
-typedef simgrid::jedule::Jedule *jedule_t;
+using jedule_t = simgrid::jedule::Jedule*;
 
 #endif /* JEDULE_HPP_ */
index e7987cb..e6992e5 100644 (file)
@@ -40,6 +40,6 @@ private:
 }
 }
 
-typedef simgrid::jedule::Event* jed_event_t;
+using jed_event_t = simgrid::jedule::Event*;
 
 #endif /* JEDULE_EVENTS_H_ */
index 8097776..a63279e 100644 (file)
@@ -53,7 +53,7 @@ public:
 
 } // namespace jedule
 } // namespace simgrid
-typedef simgrid::jedule::Container * jed_container_t;
+using jed_container_t = simgrid::jedule::Container*;
 void get_resource_selection_by_hosts(std::vector<simgrid::jedule::Subset>& subset_list,
                                      const std::vector<sg_host_t>& host_list);
 
index b41008e..4428b6e 100644 (file)
@@ -329,7 +329,7 @@ public:
    */
   template <class F> auto then_no_unwrap(F continuation) -> Future<decltype(continuation(std::move(*this)))>
   {
-    typedef decltype(continuation(std::move(*this))) R;
+    using R = decltype(continuation(std::move(*this)));
     if (state_ == nullptr)
       throw std::future_error(std::future_errc::no_state);
     auto state = std::move(state_);
index a74f944..7d1db42 100644 (file)
@@ -20,12 +20,11 @@ namespace simgrid {
 namespace kernel {
 namespace resource {
 
-typedef std::pair<double, Action*> heap_element_type;
-typedef boost::heap::pairing_heap<heap_element_type, boost::heap::constant_time_size<false>, boost::heap::stable<true>,
-                                  boost::heap::compare<simgrid::xbt::HeapComparator<heap_element_type>>>
-    heap_type;
+using heap_element_type = std::pair<double, Action*>;
+using heap_type =
+    boost::heap::pairing_heap<heap_element_type, boost::heap::constant_time_size<false>, boost::heap::stable<true>,
+                              boost::heap::compare<simgrid::xbt::HeapComparator<heap_element_type>>>;
 
-typedef std::pair<double, Action*> heap_element_type;
 class XBT_PUBLIC ActionHeap : public heap_type {
   friend Action;
 
@@ -63,14 +62,12 @@ public:
   /* Lazy update needs this Set hook to maintain a list of the tracked actions */
   boost::intrusive::list_member_hook<> modified_set_hook_;
   bool is_within_modified_set() const { return modified_set_hook_.is_linked(); }
-  typedef boost::intrusive::list<
-      Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_>>
-      ModifiedSet;
+  using ModifiedSet = boost::intrusive::list<
+      Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_>>;
 
   boost::intrusive::list_member_hook<> state_set_hook_;
-  typedef boost::intrusive::list<
-      Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_>>
-      StateSet;
+  using StateSet = boost::intrusive::list<
+      Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_>>;
 
   enum class State {
     INITED,   /**< Created, but not started yet */
index b39a672..a0e5a84 100644 (file)
@@ -38,8 +38,8 @@ class Comm;
 class Task;
 }
 }
-typedef simgrid::msg::Comm sg_msg_Comm;
-typedef simgrid::msg::Task sg_msg_Task;
+using sg_msg_Comm = simgrid::msg::Comm;
+using sg_msg_Task = simgrid::msg::Task;
 #else
 typedef struct msg_Comm sg_msg_Comm;
 typedef struct msg_Task sg_msg_Task;
index db2d157..5f61cb1 100644 (file)
@@ -53,7 +53,7 @@ template <class F> typename std::result_of<F()>::type simcall(F&& code, mc::Simc
   // If we are in the application, pass the code to the maestro which
   // executes it for us and reports the result. We use a std::future which
   // conveniently handles the success/failure value for us.
-  typedef typename std::result_of<F()>::type R;
+  using R = typename std::result_of<F()>::type;
   simgrid::xbt::Result<R> result;
   simcall_run_kernel([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward<F>(code)); }, t);
   return result.get();
@@ -96,8 +96,7 @@ template <class R, class F> R simcall_blocking(F&& code, mc::SimcallInspector* t
 namespace simgrid {
 namespace simix {
 
-
-typedef std::pair<double, Timer*> TimerQelt;
+using TimerQelt = std::pair<double, Timer*>;
 static boost::heap::fibonacci_heap<TimerQelt, boost::heap::compare<xbt::HeapComparator<TimerQelt>>> simix_timers;
 
 /** @brief Timer datatype */
index c95e63f..fd9797f 100644 (file)
@@ -45,7 +45,7 @@ XBT_PUBLIC void unblock(smx_actor_t process);
  */
 template <class F> auto kernel_sync(F code) -> decltype(code().get())
 {
-  typedef decltype(code().get()) T;
+  using T = decltype(code().get());
   if (SIMIX_is_maestro())
     xbt_die("Can't execute blocking call in kernel mode");
 
@@ -150,7 +150,7 @@ private:
  */
 template <class F> auto kernel_async(F code) -> Future<decltype(code().get())>
 {
-  typedef decltype(code().get()) T;
+  using T = decltype(code().get());
 
   // Execute the code in the kernel and get the kernel future:
   simgrid::kernel::Future<T> future = simgrid::kernel::actor::simcall(std::move(code));
index 515b34f..69c26ee 100644 (file)
@@ -34,19 +34,19 @@ class Win;
 }
 }
 
-typedef simgrid::smpi::Comm SMPI_Comm;
-typedef simgrid::smpi::Datatype SMPI_Datatype;
-typedef simgrid::smpi::Errhandler SMPI_Errhandler;
-typedef simgrid::smpi::File SMPI_File;
-typedef simgrid::smpi::Group SMPI_Group;
-typedef simgrid::smpi::Info SMPI_Info;
-typedef simgrid::smpi::Op SMPI_Op;
-typedef simgrid::smpi::Request SMPI_Request;
-typedef simgrid::smpi::Topo SMPI_Topology;
-typedef simgrid::smpi::Topo_Cart SMPI_Cart_topology;
-typedef simgrid::smpi::Topo_Dist_Graph SMPI_Dist_Graph_topology;
-typedef simgrid::smpi::Topo_Graph SMPI_Graph_topology;
-typedef simgrid::smpi::Win SMPI_Win;
+using SMPI_Comm                = simgrid::smpi::Comm;
+using SMPI_Datatype            = simgrid::smpi::Datatype;
+using SMPI_Errhandler          = simgrid::smpi::Errhandler;
+using SMPI_File                = simgrid::smpi::File;
+using SMPI_Group               = simgrid::smpi::Group;
+using SMPI_Info                = simgrid::smpi::Info;
+using SMPI_Op                  = simgrid::smpi::Op;
+using SMPI_Request             = simgrid::smpi::Request;
+using SMPI_Topology            = simgrid::smpi::Topo;
+using SMPI_Cart_topology       = simgrid::smpi::Topo_Cart;
+using SMPI_Dist_Graph_topology = simgrid::smpi::Topo_Dist_Graph;
+using SMPI_Graph_topology      = simgrid::smpi::Topo_Graph;
+using SMPI_Win                 = simgrid::smpi::Win;
 
 #else
 
index 2fde39a..e9cb3ad 100644 (file)
@@ -56,7 +56,7 @@
 /** @brief Configuration set's data type is opaque. */
 #ifdef __cplusplus
 #include <xbt/config.hpp>
-typedef simgrid::config::Config* xbt_cfg_t;
+using xbt_cfg_t = simgrid::config::Config*;
 #else
 typedef void* xbt_cfg_t;
 #endif
index cc053a5..b869563 100644 (file)
@@ -99,11 +99,8 @@ class Task<R(Args...)> {
   struct whatever {};
 
   // Union used for storage:
-  typedef typename std::aligned_union<0,
-    void*,
-    std::pair<void(*)(),void*>,
-    std::pair<void(whatever::*)(), whatever*>
-  >::type TaskUnion;
+  using TaskUnion = typename std::aligned_union<0, void*, std::pair<void (*)(), void*>,
+                                                std::pair<void (whatever::*)(), whatever*>>::type;
 
   // Is F suitable for small buffer optimization?
   template<class F>
@@ -117,11 +114,11 @@ class Task<R(Args...)> {
     "SBO not working for reference_wrapper");
 
   // Call (and possibly destroy) the function:
-  typedef R (*call_function)(TaskUnion&, Args...);
+  using call_function = R (*)(TaskUnion&, Args...);
   // Destroy the function (of needed):
-  typedef void (*destroy_function)(TaskUnion&);
+  using destroy_function = void (*)(TaskUnion&);
   // Move the function (otherwise memcpy):
-  typedef void (*move_function)(TaskUnion& dest, TaskUnion& src);
+  using move_function = void (*)(TaskUnion& dest, TaskUnion& src);
 
   // Vtable of functions for manipulating whatever is in the TaskUnion:
   struct TaskVtable {
@@ -248,7 +245,8 @@ template<class F, class... Args>
 class TaskImpl {
   F code_;
   std::tuple<Args...> args_;
-  typedef decltype(simgrid::xbt::apply(std::move(code_), std::move(args_))) result_type;
+  using result_type = decltype(simgrid::xbt::apply(std::move(code_), std::move(args_)));
+
 public:
   TaskImpl(F code, std::tuple<Args...> args) :
     code_(std::move(code)),
index bb8c27e..d1596e5 100644 (file)
 namespace simgrid {
 namespace xbt {
 /* To split the file if a unique one is given (specific variable for the other case live in runner()) */
-typedef std::vector<std::string> ReplayAction;
+using ReplayAction = std::vector<std::string>;
 
 XBT_PUBLIC_DATA std::ifstream* action_fs;
 XBT_PUBLIC int replay_runner(const char* actor_name, const char* trace_filename);
 }
 }
 
-typedef std::function<void(simgrid::xbt::ReplayAction&)> action_fun;
+using action_fun = std::function<void(simgrid::xbt::ReplayAction&)>;
 XBT_PUBLIC void xbt_replay_action_register(const char* action_name, const action_fun& function);
 XBT_PUBLIC action_fun xbt_replay_action_get(const char* action_name);
 
index 4289edd..36bd87f 100644 (file)
@@ -23,7 +23,7 @@ namespace xbt {
   */
   template<class R, class... P>
   class signal<R(P...)> {
-    typedef std::function<R(P...)> callback_type;
+    using callback_type = std::function<R(P...)>;
     std::map<unsigned int, callback_type> handlers_;
     unsigned int callback_sequence_id = 0;
 
index 5278929..8ae6756 100644 (file)
@@ -72,11 +72,11 @@ class XBT_PUBLIC string {
 
 public:
   // Types
-  typedef std::size_t size_type;
-  typedef char& reference;
-  typedef const char& const_reference;
-  typedef char* iterator;
-  typedef const char* const_iterator;
+  using size_type       = std::size_t;
+  using reference       = char&;
+  using const_reference = const char&;
+  using iterator        = char*;
+  using const_iterator  = const char*;
 
   // Dtor
   ~string()
index 1b2e6fb..7123018 100644 (file)
@@ -189,9 +189,9 @@ public:
 };
 
 /* Used to keep the list of actors blocked on a synchro  */
-typedef boost::intrusive::list<ActorImpl, boost::intrusive::member_hook<ActorImpl, boost::intrusive::list_member_hook<>,
-                                                                        &ActorImpl::smx_synchro_hook>>
-    SynchroList;
+using SynchroList =
+    boost::intrusive::list<ActorImpl, boost::intrusive::member_hook<ActorImpl, boost::intrusive::list_member_hook<>,
+                                                                    &ActorImpl::smx_synchro_hook>>;
 
 XBT_PUBLIC void create_maestro(const std::function<void()>& code);
 XBT_PUBLIC int get_maxpid();
index e9bea4b..dc747a1 100644 (file)
@@ -95,7 +95,7 @@ public:
 
 
 /* This allows Java to hijack the context factory (Java induces factories of factory :) */
-typedef ContextFactory* (*ContextFactoryInitializer)();
+using ContextFactoryInitializer = ContextFactory* (*)();
 XBT_PUBLIC_DATA ContextFactoryInitializer factory_initializer;
 
 XBT_PRIVATE ContextFactory* thread_factory();
index 8284fc9..0eaf6c4 100644 (file)
@@ -37,10 +37,10 @@ public:
 private:
 #if BOOST_VERSION < 106100
   boost::context::fcontext_t fc_;
-  typedef intptr_t arg_type;
+  using arg_type = intptr_t;
 #else
   boost::context::detail::fcontext_t fc_;
-  typedef boost::context::detail::transfer_t arg_type;
+  using arg_type = boost::context::detail::transfer_t;
 #endif
 
   XBT_ATTRIB_NORETURN static void wrapper(arg_type arg);
index 3b36ada..443c37f 100644 (file)
@@ -12,9 +12,9 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
 // Raw context routines
 
-typedef void (*rawctx_entry_point_t)(simgrid::kernel::context::SwappedContext*);
+using rawctx_entry_point_t = void (*)(simgrid::kernel::context::SwappedContext*);
 
-typedef void* raw_stack_t;
+using raw_stack_t = void*;
 extern "C" raw_stack_t raw_makecontext(void* malloced_stack, int stack_size, rawctx_entry_point_t entry_point,
                                        simgrid::kernel::context::SwappedContext* arg);
 extern "C" void raw_swapcontext(raw_stack_t* old, raw_stack_t new_context);
index 88c40cf..b780131 100644 (file)
@@ -16,7 +16,7 @@ namespace simgrid {
 namespace kernel {
 namespace lmm {
 
-typedef std::vector<int> dyn_light_t;
+using dyn_light_t = std::vector<int>;
 
 int Variable::next_rank_   = 1;
 int Constraint::next_rank_ = 1;
index 5aef06a..f525dfa 100644 (file)
@@ -532,8 +532,8 @@ public:
   resource::Action::ModifiedSet* modified_set_ = nullptr;
 
 private:
-  typedef std::vector<int> dyn_light_t;
-  
+  using dyn_light_t = std::vector<int>;
+
   //Data used in lmm::solve
   std::vector<ConstraintLight> cnst_light_vec;
   dyn_light_t saturated_constraints;
index 96d0008..9ef271e 100644 (file)
@@ -26,7 +26,7 @@ public:
   void add_event(double date, Event* evt);
 
 private:
-  typedef std::pair<double, Event*> Qelt;
+  using Qelt = std::pair<double, Event*>;
   std::priority_queue<Qelt, std::vector<Qelt>, std::greater<>> heap_;
 };
 
index cebdab7..5c80268 100644 (file)
@@ -129,7 +129,7 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr
     int nr_nodes      = xbt_dynar_length(nodes);
     std::vector<double> cost_arr(nr_nodes); /* link cost from src to other hosts */
     pred_arr.resize(nr_nodes);              /* predecessors in path from src */
-    typedef std::pair<double, int> Qelt;
+    using Qelt = std::pair<double, int>;
     std::priority_queue<Qelt, std::vector<Qelt>, std::greater<>> pqueue;
 
     /* initialize */
index 6baf980..4a0f419 100644 (file)
@@ -38,8 +38,8 @@ public:
   }
 };
 
-typedef std::array<HeapLocation, 2> HeapLocationPair;
-typedef std::set<HeapLocationPair> HeapLocationPairs;
+using HeapLocationPair  = std::array<HeapLocation, 2>;
+using HeapLocationPairs = std::set<HeapLocationPair>;
 
 class HeapArea : public HeapLocation {
 public:
index 797f661..c6258b3 100644 (file)
@@ -34,7 +34,7 @@ namespace dwarf {
  *  just a sequence of dwarf instructions. We currently directly use
  *  `Dwarf_Op` from `dwarf.h` for dwarf instructions.
  */
-typedef std::vector<Dwarf_Op> DwarfExpression;
+using DwarfExpression = std::vector<Dwarf_Op>;
 
 /** Context of evaluation of a DWARF expression
  *
@@ -62,7 +62,7 @@ public:
  */
 class ExpressionStack {
 public:
-  typedef std::uintptr_t value_type;
+  using value_type                  = std::uintptr_t;
   static const std::size_t max_size = 64;
 
 private:
index ea30d90..461a499 100644 (file)
@@ -22,7 +22,7 @@ namespace dwarf {
 /** A DWARF expression with optional validity constraints */
 class LocationListEntry {
 public:
-  typedef simgrid::xbt::Range<std::uint64_t> range_type;
+  using range_type = simgrid::xbt::Range<std::uint64_t>;
 
 private:
   DwarfExpression expression_;
@@ -41,7 +41,7 @@ public:
   bool valid_for_ip(unw_word_t ip) const { return range_.contain(ip); }
 };
 
-typedef std::vector<LocationListEntry> LocationList;
+using LocationList = std::vector<LocationListEntry>;
 
 /** Location of some variable in memory
  *
index c18536f..a1c090c 100644 (file)
@@ -89,7 +89,7 @@ const Variable* ObjectInformation::find_variable(const char* name) const
 
 void ObjectInformation::remove_global_variable(const char* name)
 {
-  typedef std::vector<Variable>::size_type size_type;
+  using size_type = std::vector<Variable>::size_type;
 
   if (this->global_variables.empty())
     return;
@@ -139,7 +139,7 @@ void ObjectInformation::remove_global_variable(const char* name)
 static void remove_local_variable(Frame& scope, const char* var_name, const char* subprogram_name,
                                   Frame const& subprogram)
 {
-  typedef std::vector<Variable>::size_type size_type;
+  using size_type = std::vector<Variable>::size_type;
 
   // If the current subprogram matches the given name:
   if ((subprogram_name == nullptr || (not subprogram.name.empty() && subprogram.name == subprogram_name)) &&
index e7d4cac..14454d4 100644 (file)
@@ -29,7 +29,7 @@ namespace mc {
  */
 class Member {
 public:
-  typedef int flags_type;
+  using flags_type                                 = int;
   static constexpr flags_type INHERITANCE_FLAG     = 1;
   static constexpr flags_type VIRTUAL_POINTER_FLAG = 2;
 
index 7e4e97d..9fb828f 100644 (file)
@@ -12,7 +12,7 @@
 namespace simgrid {
 namespace mc {
 
-typedef std::uint64_t hash_type;
+using hash_type = std::uint64_t;
 
 XBT_PRIVATE hash_type hash(simgrid::mc::Snapshot const& snapshot);
 
index b52aee4..39d960e 100644 (file)
@@ -25,7 +25,7 @@
 namespace simgrid {
 namespace mc {
 
-typedef std::vector<Transition> RecordTrace;
+using RecordTrace = std::vector<Transition>;
 
 /** Convert a string representation of the path into an array of `simgrid::mc::Transition`
  */
index 385bd6c..294d641 100644 (file)
@@ -539,7 +539,7 @@ void RemoteSimulation::ignore_heap(IgnoredHeapRegion const& region)
     return;
   }
 
-  typedef std::vector<IgnoredHeapRegion>::size_type size_type;
+  using size_type = std::vector<IgnoredHeapRegion>::size_type;
 
   size_type start = 0;
   size_type end   = ignored_heap_.size() - 1;
@@ -568,7 +568,7 @@ void RemoteSimulation::ignore_heap(IgnoredHeapRegion const& region)
 
 void RemoteSimulation::unignore_heap(void* address, size_t size)
 {
-  typedef std::vector<IgnoredHeapRegion>::size_type size_type;
+  using size_type = std::vector<IgnoredHeapRegion>::size_type;
 
   size_type start = 0;
   size_type end   = ignored_heap_.size() - 1;
index 702fc15..e43be42 100644 (file)
@@ -73,15 +73,15 @@ namespace mc {
  */
 class PageStore {
 public: // Types
-  typedef std::uint64_t hash_type;
+  using hash_type = std::uint64_t;
 
 private:
   // Types
   // We are using a cheap hash to index a page.
   // We should expect collision and we need to associate multiple page indices
   // to the same hash.
-  typedef std::unordered_set<std::size_t> page_set_type;
-  typedef std::unordered_map<hash_type, page_set_type> pages_map_type;
+  using page_set_type  = std::unordered_set<std::size_t>;
+  using pages_map_type = std::unordered_map<hash_type, page_set_type>;
 
   // Fields:
   /** First page */
index c0531b5..11bc6d2 100644 (file)
@@ -34,7 +34,7 @@ struct s_mc_stack_frame_t {
   std::string frame_name;
   unw_cursor_t unw_cursor;
 };
-typedef s_mc_stack_frame_t* mc_stack_frame_t;
+using mc_stack_frame_t = s_mc_stack_frame_t*;
 
 struct s_local_variable_t {
   simgrid::mc::Frame* subprogram;
@@ -43,16 +43,16 @@ struct s_local_variable_t {
   simgrid::mc::Type* type;
   void* address;
 };
-typedef s_local_variable_t* local_variable_t;
-typedef const s_local_variable_t* const_local_variable_t;
+using local_variable_t       = s_local_variable_t*;
+using const_local_variable_t = const s_local_variable_t*;
 
 struct XBT_PRIVATE s_mc_snapshot_stack_t {
   std::vector<s_local_variable_t> local_variables;
   simgrid::mc::UnwindContext context;
   std::vector<s_mc_stack_frame_t> stack_frames;
 };
-typedef s_mc_snapshot_stack_t* mc_snapshot_stack_t;
-typedef const s_mc_snapshot_stack_t* const_mc_snapshot_stack_t;
+using mc_snapshot_stack_t       = s_mc_snapshot_stack_t*;
+using const_mc_snapshot_stack_t = const s_mc_snapshot_stack_t*;
 
 namespace simgrid {
 namespace mc {
index d5e918a..d0079a6 100644 (file)
 
 XBT_PUBLIC_DATA const std::array<const char*, NUM_SIMCALLS> simcall_names; /* Name of each simcall */
 
-typedef bool (*simix_match_func_t)(void*, void*, simgrid::kernel::activity::CommImpl*);
-typedef void (*simix_copy_data_func_t)(simgrid::kernel::activity::CommImpl*, void*, size_t);
-typedef void (*simix_clean_func_t)(void*);
-typedef void (*FPtr)(); // Hide the ugliness
+using simix_match_func_t     = bool (*)(void*, void*, simgrid::kernel::activity::CommImpl*);
+using simix_copy_data_func_t = void (*)(simgrid::kernel::activity::CommImpl*, void*, size_t);
+using simix_clean_func_t     = void (*)(void*);
+using FPtr                   = void (*)(); // Hide the ugliness
 
 /* Pack all possible scalar types in an union */
 union u_smx_scalar {
index ceb544f..c2bc108 100644 (file)
@@ -67,11 +67,9 @@ extern XBT_PUBLIC int mpi_statuses_ignore_;
 
 extern XBT_PRIVATE MPI_Comm MPI_COMM_UNINITIALIZED;
 
-typedef SMPI_Cart_topology* MPIR_Cart_Topology;
-
-typedef SMPI_Graph_topology* MPIR_Graph_Topology;
-
-typedef SMPI_Dist_Graph_topology* MPIR_Dist_Graph_Topology;
+using MPIR_Cart_Topology       = SMPI_Cart_topology*;
+using MPIR_Graph_Topology      = SMPI_Graph_topology*;
+using MPIR_Dist_Graph_Topology = SMPI_Dist_Graph_topology*;
 
 XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process();
 XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process_remote(simgrid::s4u::ActorPtr actor);
@@ -489,7 +487,7 @@ struct s_smpi_privatization_region_t {
   void* address;
   int file_descriptor;
 };
-typedef s_smpi_privatization_region_t* smpi_privatization_region_t;
+using smpi_privatization_region_t = s_smpi_privatization_region_t*;
 
 extern XBT_PRIVATE int smpi_loaded_page;
 XBT_PRIVATE smpi_privatization_region_t smpi_init_global_memory_segment_process();
@@ -503,7 +501,7 @@ XBT_PRIVATE smpi_privatization_region_t smpi_init_global_memory_segment_process(
 #define TOPAGE(addr) (void*)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
 
 /** Used only if PAPI is compiled in, but integrated anyway so that this file does not depend on internal_config.h (to speed builds) */
-typedef std::vector<std::pair</* counter name */ std::string, /* counter value */ long long>> papi_counter_t;
+using papi_counter_t = std::vector<std::pair</* counter name */ std::string, /* counter value */ long long>>;
 struct papi_process_data {
   papi_counter_t counter_data;
   int event_set;
index 4526b03..5352b42 100644 (file)
@@ -35,7 +35,7 @@ struct s_smpi_key_elem_t {
   int refcount;
 };
 
-typedef s_smpi_key_elem_t* smpi_key_elem;
+using smpi_key_elem = s_smpi_key_elem_t*;
 
 namespace simgrid{
 namespace smpi{
index 091219e..9e6bb45 100644 (file)
 namespace simgrid{
 namespace smpi{
 
-typedef struct s_smpi_mpi_generalized_request_funcs {
+struct smpi_mpi_generalized_request_funcs_t {
   MPI_Grequest_query_function *query_fn;
   MPI_Grequest_free_function *free_fn;
   MPI_Grequest_cancel_function *cancel_fn;
   void* extra_state;
   s4u::ConditionVariablePtr cond;
   s4u::MutexPtr mutex;
-} s_smpi_mpi_generalized_request_funcs_t; 
-typedef struct s_smpi_mpi_generalized_request_funcs *smpi_mpi_generalized_request_funcs;
+};
 
 class Request : public F2C {
   void* buf_;
@@ -48,7 +47,7 @@ class Request : public F2C {
   int refcount_;
   MPI_Op op_;
   int cancelled_; // tri-state
-  smpi_mpi_generalized_request_funcs generalized_funcs;
+  smpi_mpi_generalized_request_funcs_t* generalized_funcs;
   MPI_Request* nbc_requests_;
   int nbc_requests_size_;
   static bool match_common(MPI_Request req, MPI_Request sender, MPI_Request receiver);
index e7354c6..88d27c9 100644 (file)
@@ -10,7 +10,7 @@
 #include "smpi_status.hpp"
 #include <memory>
 
-typedef std::shared_ptr<SMPI_Topology> MPI_Topology;
+using MPI_Topology = std::shared_ptr<SMPI_Topology>;
 
 namespace simgrid{
 namespace smpi{
index f9c3c31..5aa6b92 100644 (file)
@@ -99,7 +99,7 @@ simgrid::config::Flag<std::string> _smpi_cfg_comp_adjustment_file{"smpi/comp-adj
         std::ifstream fstream(filename);
         xbt_assert(fstream.is_open(), "Could not open file %s. Does it exist?", filename.c_str());
         std::string line;
-        typedef boost::tokenizer<boost::escaped_list_separator<char>> Tokenizer;
+        using Tokenizer = boost::tokenizer<boost::escaped_list_separator<char>>;
         std::getline(fstream, line); // Skip the header line
         while (std::getline(fstream, line)) {
           Tokenizer tok(line);
index 9aed93b..590aada 100644 (file)
@@ -236,7 +236,7 @@ static void smpi_init_papi()
       XBT_ERROR("Could not initialize PAPI library; is it correctly installed and linked?"
                 " Expected version is %u", PAPI_VER_CURRENT);
 
-    typedef boost::tokenizer<boost::char_separator<char>> Tokenizer;
+    using Tokenizer = boost::tokenizer<boost::char_separator<char>>;
     boost::char_separator<char> separator_units(";");
     std::string str = smpi_cfg_papi_events_file();
     Tokenizer tokens(str, separator_units);
@@ -288,11 +288,9 @@ static void smpi_init_papi()
 #endif
 }
 
-
-
-typedef std::function<int(int argc, char *argv[])> smpi_entry_point_type;
-typedef int (* smpi_c_entry_point_type)(int argc, char **argv);
-typedef void (*smpi_fortran_entry_point_type)();
+using smpi_entry_point_type         = std::function<int(int argc, char* argv[])>;
+using smpi_c_entry_point_type       = int (*)(int argc, char** argv);
+using smpi_fortran_entry_point_type = void (*)();
 
 template <typename F>
 static int smpi_run_entry_point(const F& entry_point, const std::string& executable_path, std::vector<std::string> args)
index 9bdb30a..749fed9 100644 (file)
@@ -61,8 +61,8 @@ public:
 };
 }
 
-typedef std::tuple</*sender*/ int, /* receiver */ int, /* tag */ int> req_key_t;
-typedef std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int,int,int>>> req_storage_t;
+using req_key_t     = std::tuple</*sender*/ int, /* receiver */ int, /* tag */ int>;
+using req_storage_t = std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int, int, int>>>;
 
 void log_timed_action(const simgrid::xbt::ReplayAction& action, double clock)
 {
index efd249d..766ee46 100644 (file)
@@ -79,7 +79,7 @@ struct shared_data_t {
 };
 
 std::unordered_map<smpi_source_location, shared_data_t, std::hash<std::string>> allocs;
-typedef decltype(allocs)::value_type shared_data_key_type;
+using shared_data_key_type = decltype(allocs)::value_type;
 
 struct shared_metadata_t {
   size_t size;
index c5bf7ff..f15557a 100644 (file)
@@ -22,7 +22,7 @@ std::vector<s_smpi_factor_t> parse_factor(const std::string& smpi_coef_string)
   std::vector<s_smpi_factor_t> smpi_factor;
 
   /** Setup the tokenizer that parses the string **/
-  typedef boost::tokenizer<boost::char_separator<char>> Tokenizer;
+  using Tokenizer = boost::tokenizer<boost::char_separator<char>>;
   boost::char_separator<char> sep(";");
   boost::char_separator<char> factor_separator(":");
   Tokenizer tokens(smpi_coef_string, sep);
index 31fe56f..5dd26dc 100644 (file)
@@ -1164,7 +1164,7 @@ int Request::grequest_start(MPI_Grequest_query_function* query_fn, MPI_Grequest_
   (*request)->flags_ |= MPI_REQ_GENERALIZED;
   (*request)->flags_ |= MPI_REQ_PERSISTENT;
   (*request)->refcount_ = 1;
-  ((*request)->generalized_funcs) = new s_smpi_mpi_generalized_request_funcs_t;
+  ((*request)->generalized_funcs)             = new smpi_mpi_generalized_request_funcs_t;
   ((*request)->generalized_funcs)->query_fn=query_fn;
   ((*request)->generalized_funcs)->free_fn=free_fn;
   ((*request)->generalized_funcs)->cancel_fn=cancel_fn;
index 1e9866c..23d4587 100644 (file)
@@ -23,7 +23,7 @@ public:
   bool operator()(s4u::Host* const a, s4u::Host* const b) const;
 };
 
-typedef boost::heap::fibonacci_heap<s4u::Host*, boost::heap::compare<compare_hosts>>::handle_type heap_handle;
+using heap_handle = boost::heap::fibonacci_heap<s4u::Host*, boost::heap::compare<compare_hosts>>::handle_type;
 
 /** Structure that imitates a std::pair, but it allows us to use meaningful names instead of .first and .second */
 struct XBT_PRIVATE pair_handle_load
index 50e03b4..9d457b4 100644 (file)
@@ -15,7 +15,7 @@ namespace loadbalancer {
 class XBT_PRIVATE Mapping {
 public:
   /** Each host can have an arbitrary number of actors -> multimap **/
-  typedef std::unordered_multimap<s4u::Host*, s4u::ActorPtr> host_to_actors_map_t;
+  using host_to_actors_map_t = std::unordered_multimap<s4u::Host*, s4u::ActorPtr>;
   host_to_actors_map_t host_to_actors;
 
   /** Each actor gets assigned to exactly one host -> map **/
index 1106b4c..08ae367 100644 (file)
@@ -73,11 +73,10 @@ public:
   void remove_actor(kernel::actor::ActorImpl* actor) { xbt::intrusive_erase(actor_list_, *actor); }
   void add_actor_at_boot(kernel::actor::ProcessArg* arg) { actors_at_boot_.emplace_back(arg); }
 
-  typedef boost::intrusive::list<
+  using ActorList = boost::intrusive::list<
       kernel::actor::ActorImpl,
       boost::intrusive::member_hook<kernel::actor::ActorImpl, boost::intrusive::list_member_hook<>,
-                                    &kernel::actor::ActorImpl::host_actor_list_hook>>
-      ActorList;
+                                    &kernel::actor::ActorImpl::host_actor_list_hook>>;
 
   // FIXME: make these private
   ActorList actor_list_;
index 860b5a9..34c1b9b 100644 (file)
@@ -91,8 +91,9 @@ public:
   boost::intrusive::list_member_hook<> action_ti_hook;
 };
 
-typedef boost::intrusive::member_hook<CpuTiAction, boost::intrusive::list_member_hook<>, &CpuTiAction::action_ti_hook> ActionTiListOptions;
-typedef boost::intrusive::list<CpuTiAction, ActionTiListOptions > ActionTiList;
+using ActionTiListOptions =
+    boost::intrusive::member_hook<CpuTiAction, boost::intrusive::list_member_hook<>, &CpuTiAction::action_ti_hook>;
+using ActionTiList = boost::intrusive::list<CpuTiAction, ActionTiListOptions>;
 
 /************
  * Resource *
@@ -130,8 +131,9 @@ public:
   boost::intrusive::list_member_hook<> cpu_ti_hook;
 };
 
-typedef boost::intrusive::member_hook<CpuTi, boost::intrusive::list_member_hook<>, &CpuTi::cpu_ti_hook> CpuTiListOptions;
-typedef boost::intrusive::list<CpuTi, CpuTiListOptions> CpuTiList;
+using CpuTiListOptions =
+    boost::intrusive::member_hook<CpuTi, boost::intrusive::list_member_hook<>, &CpuTi::cpu_ti_hook>;
+using CpuTiList = boost::intrusive::list<CpuTi, CpuTiListOptions>;
 
 /*********
  * Model *
index 577e934..adcd1c1 100644 (file)
@@ -51,7 +51,7 @@ struct xbt_log_append2_file_s {
   int count; //negative for roll
   long  int limit;
 };
-typedef struct xbt_log_append2_file_s* xbt_log_append2_file_t;
+using xbt_log_append2_file_t = xbt_log_append2_file_s*;
 
 static constexpr const char* APPEND2_END_TOKEN       = "\n[End of log]\n";
 static constexpr const char* APPEND2_END_TOKEN_CLEAR = "\n                   ";