Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless typedef's from C++ files.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 10 Oct 2017 20:48:18 +0000 (22:48 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 10 Oct 2017 20:58:49 +0000 (22:58 +0200)
66 files changed:
doc/doxygen/uhood_switch.doc
examples/s4u/app-bittorrent/s4u-bittorrent.hpp
examples/s4u/dht-chord/s4u-dht-chord.hpp
include/simgrid/msg.h
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/ConditionVariable.hpp
include/simgrid/s4u/VirtualMachine.hpp
include/simgrid/simdag.h
include/simgrid/simix.h
src/bindings/lua/lua_utils.hpp
src/include/smpi/smpi_utils.hpp
src/include/surf/datatypes.h
src/instr/instr_interface.cpp
src/instr/instr_private.hpp
src/instr/instr_smpi.hpp
src/kernel/activity/CommImpl.hpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DijkstraZone.hpp
src/mc/ModelChecker.hpp
src/mc/RegionSnapshot.hpp
src/mc/compare.cpp
src/mc/mc_checkpoint.cpp
src/mc/mc_comm_pattern.hpp
src/mc/mc_snapshot.hpp
src/mc/mc_unw_vmread.cpp
src/mc/remote/RemoteClient.cpp
src/msg/msg_private.hpp
src/msg/msg_synchro.cpp
src/msg/msg_task.cpp
src/msg/msg_vm.cpp
src/plugins/vm/VirtualMachineImpl.hpp
src/simdag/simdag_private.hpp
src/simix/ActorImpl.hpp
src/simix/popping_private.hpp
src/simix/smx_global.cpp
src/simix/smx_synchro.cpp
src/simix/smx_synchro_private.hpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/colls/allreduce/allreduce-rab2.cpp
src/smpi/colls/allreduce/allreduce-rdb.cpp
src/smpi/colls/allreduce/allreduce-smp-rdb.cpp
src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp
src/smpi/colls/allreduce/allreduce-smp-rsag.cpp
src/smpi/colls/coll_tuned_topo.hpp
src/smpi/colls/reduce/reduce-rab.cpp
src/smpi/colls/smpi_intel_mpi_selector.cpp
src/smpi/colls/smpi_mvapich2_selector_stampede.hpp
src/smpi/include/private.hpp
src/smpi/include/smpi_coll.hpp
src/smpi/include/smpi_datatype.hpp
src/smpi/include/smpi_keyvals.hpp
src/smpi/internals/smpi_dvfs.cpp
src/smpi/internals/smpi_memory.cpp
src/smpi/internals/smpi_static_variables.cpp
src/surf/StorageImpl.hpp
src/surf/maxmin.cpp
src/surf/maxmin_private.hpp
src/surf/surf_interface.hpp
src/surf/surf_private.hpp
src/surf/trace_mgr.hpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_sax_cb.cpp
src/xbt/backtrace_linux.cpp
src/xbt/cunit.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/surf/lmm_usage/lmm_usage.cpp

index ccb9e72..684eacb 100644 (file)
@@ -629,7 +629,7 @@ which can be exposed using the same API as `std::condition_variable`:
 @code{cpp}
 class ConditionVariable {
 private:
-  friend s_smx_cond;
+  friend s_smx_cond_t;
   smx_cond_t cond_;
   ConditionVariable(smx_cond_t cond) : cond_(cond) {}
 public:
index a3b296a..61e64bd 100644 (file)
@@ -44,7 +44,7 @@
 #define MESSAGE_CANCEL_SIZE 17
 
 /** Types of messages exchanged between two peers. */
-typedef enum {
+enum e_message_type {
   MESSAGE_HANDSHAKE,
   MESSAGE_CHOKE,
   MESSAGE_UNCHOKE,
@@ -55,7 +55,7 @@ typedef enum {
   MESSAGE_REQUEST,
   MESSAGE_PIECE,
   MESSAGE_CANCEL
-} e_message_type;
+};
 
 class Message {
 public:
index 4c44d8f..ff05252 100644 (file)
@@ -42,7 +42,7 @@ public:
 };
 
 /* Types of tasks exchanged between nodes. */
-typedef enum {
+enum e_message_type_t {
   FIND_SUCCESSOR,
   FIND_SUCCESSOR_ANSWER,
   GET_PREDECESSOR,
@@ -52,7 +52,7 @@ typedef enum {
   PREDECESSOR_LEAVING,
   PREDECESSOR_ALIVE,
   PREDECESSOR_ALIVE_ANSWER
-} e_message_type_t;
+};
 
 class ChordMessage {
 public:
index c621759..8ee47ab 100644 (file)
@@ -51,7 +51,7 @@ typedef sg_host_t msg_host_t;
 XBT_PUBLIC_DATA(int) sg_storage_max_file_descriptors;
 /* ******************************** Task ************************************ */
 
-typedef struct simdata_task *simdata_task_t;
+typedef struct s_simdata_task_t* simdata_task_t;
 
 typedef struct msg_task {
   char *name;                   /**< @brief task name if any */
@@ -449,7 +449,8 @@ XBT_PUBLIC(void) MSG_action_exit();
  *  @ingroup msg_synchro
  *  @hideinitializer
  */
-typedef struct s_smx_sem *msg_sem_t; // Yeah that's a rename of the smx_sem_t which doesnt require smx_sem_t to be declared here
+typedef struct s_smx_sem_t* msg_sem_t; // Yeah that's a rename of the smx_sem_t which doesnt require smx_sem_t to be
+                                       // declared here
 XBT_PUBLIC(msg_sem_t) MSG_sem_init(int initial_value);
 XBT_PUBLIC(void) MSG_sem_acquire(msg_sem_t sem);
 XBT_PUBLIC(msg_error_t) MSG_sem_acquire_timeout(msg_sem_t sem, double timeout);
@@ -464,7 +465,7 @@ XBT_PUBLIC(int) MSG_sem_would_block(msg_sem_t sem);
  */
 
 #define MSG_BARRIER_SERIAL_PROCESS -1
-typedef struct s_msg_bar* msg_bar_t;
+typedef struct s_msg_bar_t* msg_bar_t;
 XBT_PUBLIC(msg_bar_t) MSG_barrier_init( unsigned int count);
 XBT_PUBLIC(void) MSG_barrier_destroy(msg_bar_t bar);
 XBT_PUBLIC(int) MSG_barrier_wait(msg_bar_t bar);
index d0c8b54..4568e52 100644 (file)
@@ -9,7 +9,7 @@
 #include <simgrid/s4u/forward.hpp>
 #include <simgrid/forward.h>
 
-typedef enum { inited = 0, started, canceled, errored, finished } e_s4u_activity_state_t;
+enum e_s4u_activity_state_t { inited = 0, started, canceled, errored, finished };
 
 namespace simgrid {
 namespace s4u {
index 5af3446..25d1dcf 100644 (file)
@@ -33,7 +33,7 @@ namespace s4u {
 XBT_PUBLIC_CLASS ConditionVariable
 {
 private:
-  friend s_smx_cond;
+  friend s_smx_cond_t;
   smx_cond_t cond_;
   explicit ConditionVariable(smx_cond_t cond) : cond_(cond) {}
 public:
index 4453039..0d6023d 100644 (file)
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/forward.hpp"
 
-typedef enum {
+enum e_surf_vm_state_t {
   SURF_VM_STATE_CREATED, /**< created, but not yet started */
   SURF_VM_STATE_RUNNING,
   SURF_VM_STATE_SUSPENDED, /**< Suspend/resume does not involve disk I/O, so we assume there is no transition states. */
   SURF_VM_STATE_DESTROYED
-} e_surf_vm_state_t;
+};
 
 namespace simgrid {
 namespace vm {
index 55f8ba0..8f64ea3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2010, 2012-2016. The SimGrid Team.
+/* Copyright (c) 2006-2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@ typedef sg_link_t SD_link_t;
     Each task has a <em>\ref e_SD_task_state_t "state"</em> indicating whether the task is scheduled, running, done, ...
 
     */
-typedef struct SD_task *SD_task_t;
+typedef struct s_SD_task_t* SD_task_t;
 
 /** @brief Task states
     @ingroup SD_task_api */
index 976487a..8d27291 100644 (file)
@@ -49,11 +49,11 @@ typedef enum {
 /**
  * \ingroup simix_synchro_management
  */
-typedef struct s_smx_cond *smx_cond_t;
+typedef struct s_smx_cond_t* smx_cond_t;
 /**
  * \ingroup simix_synchro_management
  */
-typedef struct s_smx_sem *smx_sem_t;
+typedef struct s_smx_sem_t* smx_sem_t;
 
 /* ****************************** Process *********************************** */
 
@@ -106,7 +106,7 @@ XBT_PUBLIC(void) SIMIX_run();
 XBT_PUBLIC(double) SIMIX_get_clock();
 
 /* Timer functions FIXME: should these be public? */
-typedef struct s_smx_timer* smx_timer_t;
+typedef struct s_smx_timer_t* smx_timer_t;
 
 XBT_PUBLIC(smx_timer_t) SIMIX_timer_set(double date, void (*function)(void*), void *arg);
 XBT_PUBLIC(void) SIMIX_timer_remove(smx_timer_t timer);
index cbf83e7..acc134b 100644 (file)
@@ -17,11 +17,12 @@ extern "C" {
  *
  * This structure is used as the userdata parameter of lua_Writer.
  */
-typedef struct s_sglua_buffer {
+struct s_sglua_buffer_t {
   char* data;
   size_t size;
   size_t capacity;
-} s_sglua_buffer_t, *sglua_buffer_t;
+};
+typedef s_sglua_buffer_t* sglua_buffer_t;
 
 const char* sglua_tostring(lua_State* L, int index);
 const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index);
index 8af0b0a..9b991fd 100644 (file)
 extern "C" {
 
 // Methods used to parse and store the values for timing injections in smpi
-typedef struct s_smpi_factor *smpi_os_factor_t;
-typedef struct s_smpi_factor{
+struct s_smpi_factor_t {
   size_t factor=0;
   std::vector<double> values;
-} s_smpi_factor_t;
+};
+typedef s_smpi_factor_t* smpi_os_factor_t;
 }
 
 XBT_PUBLIC(std::vector<s_smpi_factor_t>) parse_factor(const char *smpi_coef_string);
index 1ce9da6..445ddc1 100644 (file)
@@ -6,10 +6,10 @@
 #ifndef MAXMIN_DATATYPES_H
 #define MAXMIN_DATATYPES_H
 
-typedef struct lmm_element *lmm_element_t;
-typedef struct lmm_variable *lmm_variable_t;
-typedef struct lmm_constraint *lmm_constraint_t;
-typedef struct lmm_constraint_light *lmm_constraint_light_t;
-typedef struct lmm_system *lmm_system_t;
+typedef struct s_lmm_element_t* lmm_element_t;
+typedef struct s_lmm_variable_t* lmm_variable_t;
+typedef struct s_lmm_constraint_t* lmm_constraint_t;
+typedef struct s_lmm_constraint_light_t* lmm_constraint_light_t;
+typedef struct s_lmm_system_t* lmm_system_t;
 
 #endif
index bad1970..61b1891 100644 (file)
 #include "surf/surf.h"
 #include <algorithm>
 
-typedef enum {
-  INSTR_US_DECLARE,
-  INSTR_US_SET,
-  INSTR_US_ADD,
-  INSTR_US_SUB
-} InstrUserVariable;
+enum InstrUserVariable { INSTR_US_DECLARE, INSTR_US_SET, INSTR_US_ADD, INSTR_US_SUB };
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_api, instr, "API");
 
index b158f63..0982344 100644 (file)
@@ -29,7 +29,7 @@
 
 namespace simgrid {
 namespace instr {
-typedef enum {
+enum e_event_type {
   PAJE_DefineContainerType,
   PAJE_DefineVariableType,
   PAJE_DefineStateType,
@@ -48,9 +48,9 @@ typedef enum {
   PAJE_StartLink,
   PAJE_EndLink,
   PAJE_NewEvent
-} e_event_type;
+};
 
-typedef enum { TYPE_VARIABLE, TYPE_LINK, TYPE_CONTAINER, TYPE_STATE, TYPE_EVENT } e_entity_types;
+enum e_entity_types { TYPE_VARIABLE, TYPE_LINK, TYPE_CONTAINER, TYPE_STATE, TYPE_EVENT };
 
 //--------------------------------------------------
 
@@ -97,7 +97,7 @@ public:
 };
 
 //--------------------------------------------------
-typedef enum {
+enum e_container_types {
   INSTR_HOST,
   INSTR_LINK,
   INSTR_ROUTER,
@@ -106,7 +106,7 @@ typedef enum {
   INSTR_MSG_VM,
   INSTR_MSG_PROCESS,
   INSTR_MSG_TASK
-} e_container_types;
+};
 
 //--------------------------------------------------
 
@@ -318,10 +318,7 @@ XBT_PRIVATE void TRACE_paje_dump_buffer(int force);
 XBT_PRIVATE void dump_comment_file(const char* filename);
 XBT_PRIVATE void dump_comment(const char* comment);
 
-struct s_instr_extra_data;
-typedef struct s_instr_extra_data* instr_extra_data;
-
-typedef enum {
+enum e_caller_type {
   TRACING_INIT,
   TRACING_FINALIZE,
   TRACING_COMM_SIZE,
@@ -355,9 +352,9 @@ typedef enum {
   TRACING_SLEEPING,
   TRACING_SCAN,
   TRACING_EXSCAN
-} e_caller_type;
+};
 
-typedef struct s_instr_extra_data {
+struct s_instr_extra_data_t {
   e_caller_type type;
   int send_size;
   int recv_size;
@@ -371,7 +368,8 @@ typedef struct s_instr_extra_data {
   int* sendcounts;
   int* recvcounts;
   int num_processes;
-} s_instr_extra_data_t;
+};
+typedef s_instr_extra_data_t* instr_extra_data;
 
 /* Format of TRACING output.
  *   - paje is the regular format, that we all know
@@ -379,7 +377,7 @@ typedef struct s_instr_extra_data {
  *     trace can easily be replayed with smpi_replay afterward. This trick should be removed and replaced by some code
  *     using the signal that we will create to cleanup the TRACING
  */
-typedef enum { instr_fmt_paje, instr_fmt_TI } instr_fmt_type_t;
+enum instr_fmt_type_t { instr_fmt_paje, instr_fmt_TI };
 extern instr_fmt_type_t instr_fmt_type;
 }
 
index 9b01f6f..8b08e92 100644 (file)
@@ -36,7 +36,8 @@ XBT_PRIVATE char* smpi_container(int rank, char* container, int n);
 
 XBT_PRIVATE const char* encode_datatype(MPI_Datatype datatype, int* known);
 
-typedef struct smpi_trace_call_location {
+class smpi_trace_call_location_t {
+public:
   const char* filename;
   int linenumber;
 
@@ -48,8 +49,7 @@ typedef struct smpi_trace_call_location {
     return std::string(previous_filename) + ':' + std::to_string(previous_linenumber) + ':' + filename + ':' +
            std::to_string(linenumber);
   }
-
-} smpi_trace_call_location_t;
+};
 }
 
 #endif
index fb60e05..2eecc69 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/kernel/activity/ActivityImpl.hpp"
 #include "surf/surf.h"
 
-typedef enum { SIMIX_COMM_SEND, SIMIX_COMM_RECEIVE, SIMIX_COMM_READY, SIMIX_COMM_DONE } e_smx_comm_type_t;
+enum e_smx_comm_type_t { SIMIX_COMM_SEND, SIMIX_COMM_RECEIVE, SIMIX_COMM_READY, SIMIX_COMM_DONE };
 
 namespace simgrid {
 namespace kernel {
index 2d978c9..0c40a07 100644 (file)
@@ -87,12 +87,12 @@ void DijkstraZone::seal()
 
 xbt_node_t DijkstraZone::routeGraphNewNode(int id, int graph_id)
 {
-  graph_node_data_t data         = xbt_new0(struct graph_node_data, 1);
+  graph_node_data_t data = xbt_new0(s_graph_node_data_t, 1);
   data->id       = id;
   data->graph_id = graph_id;
 
   xbt_node_t node                = xbt_graph_new_node(routeGraph_, data);
-  graph_node_map_element_t elm   = xbt_new0(struct graph_node_map_element, 1);
+  graph_node_map_element_t elm   = xbt_new0(s_graph_node_map_element_t, 1);
   elm->node = node;
   xbt_dict_set_ext(graphNodeMap_, (char*)(&id), sizeof(int), (xbt_dictelm_t)elm, nullptr);
 
@@ -288,7 +288,7 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
 
   if (routeCache_ && elm == nullptr) {
     /* add to predecessor list of the current src-host to cache */
-    elm           = xbt_new0(struct route_cache_element, 1);
+    elm           = xbt_new0(s_route_cache_element_t, 1);
     elm->pred_arr = pred_arr;
     elm->size     = size;
     xbt_dict_set_ext(routeCache_, (char*)(&src_id), sizeof(int), (xbt_dictelm_t)elm, nullptr);
index 29e8b90..f595e66 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,21 +8,21 @@
 
 #include "src/kernel/routing/RoutedZone.hpp"
 
-typedef struct graph_node_data {
+struct s_graph_node_data_t {
   int id;
   int graph_id; /* used for caching internal graph id's */
-} s_graph_node_data_t;
+};
 typedef s_graph_node_data_t* graph_node_data_t;
 
-typedef struct graph_node_map_element {
+struct s_graph_node_map_element_t {
   xbt_node_t node;
-} s_graph_node_map_element_t;
+};
 typedef s_graph_node_map_element_t* graph_node_map_element_t;
 
-typedef struct route_cache_element {
+struct s_route_cache_element_t {
   int* pred_arr;
   int size;
-} s_route_cache_element_t;
+};
 typedef s_route_cache_element_t* route_cache_element_t;
 
 namespace simgrid {
index bb733e3..fc33672 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 52deff2..cb94127 100644 (file)
@@ -276,6 +276,6 @@ simgrid::mc::RegionSnapshot region(
 }
 }
 
-typedef class simgrid::mc::RegionSnapshot s_mc_mem_region_t;
+typedef simgrid::mc::RegionSnapshot s_mc_mem_region_t;
 typedef s_mc_mem_region_t* mc_mem_region_t;
 #endif
index 6516f89..fdc2afc 100644 (file)
@@ -128,8 +128,8 @@ template <class X, class Y> class hash<std::pair<X, Y>> {
 public:
   std::size_t operator()(std::pair<X,Y>const& x) const
   {
-    struct hash<X> h1;
-    struct hash<X> h2;
+    hash<X> h1;
+    hash<X> h2;
     return h1(x.first) ^ h2(x.second);
   }
 };
index d5a334f..dcea47e 100644 (file)
@@ -278,10 +278,8 @@ static bool valid_variable(simgrid::mc::Variable* var,
     return true;
 }
 
-static void fill_local_variables_values(mc_stack_frame_t stack_frame,
-                                           simgrid::mc::Frame* scope,
-                                           int process_index,
-                                           std::vector<s_local_variable>& result)
+static void fill_local_variables_values(mc_stack_frame_t stack_frame, simgrid::mc::Frame* scope, int process_index,
+                                        std::vector<s_local_variable_t>& result)
 {
   simgrid::mc::RemoteClient* process = &mc_model_checker->process();
 
@@ -335,10 +333,10 @@ static void fill_local_variables_values(mc_stack_frame_t stack_frame,
       stack_frame, &nested_scope, process_index, result);
 }
 
-static std::vector<s_local_variable> get_local_variables_values(
-  std::vector<s_mc_stack_frame_t>& stack_frames, int process_index)
+static std::vector<s_local_variable_t> get_local_variables_values(std::vector<s_mc_stack_frame_t>& stack_frames,
+                                                                  int process_index)
 {
-  std::vector<s_local_variable> variables;
+  std::vector<s_local_variable_t> variables;
   for (s_mc_stack_frame_t& stack_frame : stack_frames)
     fill_local_variables_values(&stack_frame, stack_frame.frame, process_index, variables);
   return variables;
index feac5b4..cc189d7 100644 (file)
@@ -35,15 +35,15 @@ extern XBT_PRIVATE xbt_dynar_t initial_communications_pattern;
  */
 extern XBT_PRIVATE xbt_dynar_t incomplete_communications_pattern;
 
-typedef enum {
+enum e_mc_call_type_t {
   MC_CALL_TYPE_NONE,
   MC_CALL_TYPE_SEND,
   MC_CALL_TYPE_RECV,
   MC_CALL_TYPE_WAIT,
   MC_CALL_TYPE_WAITANY,
-} e_mc_call_type_t;
+};
 
-typedef enum {
+enum e_mc_comm_pattern_difference_t {
   NONE_DIFF,
   TYPE_DIFF,
   RDV_DIFF,
@@ -52,7 +52,7 @@ typedef enum {
   DST_PROC_DIFF,
   DATA_SIZE_DIFF,
   DATA_DIFF,
-} e_mc_comm_pattern_difference_t;
+};
 
 static inline e_mc_call_type_t MC_get_call_type(smx_simcall_t req)
 {
index 8c97902..686019f 100644 (file)
@@ -63,20 +63,20 @@ XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(const void* addr, const simgr
  *  Some parts of the snapshot are ignored by zeroing them out: the real
  *  values is stored here.
  * */
-typedef struct s_mc_snapshot_ignored_data {
+struct s_mc_snapshot_ignored_data_t {
   void* start;
   std::vector<char> data;
-} s_mc_snapshot_ignored_data_t;
+};
 
-typedef struct s_fd_infos {
+struct s_fd_infos_t {
   std::string filename;
   int number;
   off_t current_position;
   int flags;
-} s_fd_infos_t;
+};
 
 /** Information about a given stack frame */
-typedef struct s_mc_stack_frame {
+struct s_mc_stack_frame_t {
   /** Instruction pointer */
   unw_word_t ip;
   /** Stack pointer */
@@ -85,25 +85,26 @@ typedef struct s_mc_stack_frame {
   simgrid::mc::Frame* frame;
   std::string frame_name;
   unw_cursor_t unw_cursor;
-} s_mc_stack_frame_t;
+};
 typedef s_mc_stack_frame_t* mc_stack_frame_t;
 
-typedef struct s_local_variable {
+struct s_local_variable_t {
   simgrid::mc::Frame* subprogram;
   unsigned long ip;
   std::string name;
   simgrid::mc::Type* type;
   void* address;
   int region;
-} s_local_variable_t;
+};
 typedef s_local_variable_t* local_variable_t;
 
-typedef struct XBT_PRIVATE s_mc_snapshot_stack {
-  std::vector<s_local_variable> local_variables;
+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;
   int process_index;
-} s_mc_snapshot_stack_t, *mc_snapshot_stack_t;
+};
+typedef s_mc_snapshot_stack_t* mc_snapshot_stack_t;
 
 namespace simgrid {
 namespace mc {
@@ -125,7 +126,7 @@ public:
   std::vector<s_mc_snapshot_stack_t> stacks;
   std::vector<simgrid::mc::IgnoredHeapRegion> to_ignore;
   std::uint64_t hash;
-  std::vector<s_mc_snapshot_ignored_data> ignored_data;
+  std::vector<s_mc_snapshot_ignored_data_t> ignored_data;
   std::vector<s_fd_infos_t> current_fds;
 };
 }
index 2777a0c..3614cc3 100644 (file)
@@ -36,7 +36,7 @@ struct _UPT_info {
 static inline
 pid_t _UPT_getpid(void* arg)
 {
-  struct _UPT_info* info = static_cast<_UPT_info*>(arg);
+  _UPT_info* info = static_cast<_UPT_info*>(arg);
   return info->pid;
 }
 
index b2ac880..37abc50 100644 (file)
@@ -116,7 +116,7 @@ struct s_mc_memory_map_re {
   regex_t version_re;
 };
 
-static char* get_lib_name(const char* pathname, struct s_mc_memory_map_re* res)
+static char* get_lib_name(const char* pathname, s_mc_memory_map_re* res)
 {
   char* map_basename = xbt_basename(pathname);
 
@@ -227,7 +227,7 @@ void RemoteClient::init()
     xbt_die("No heap information in the target process");
   if (not std_heap_var->address)
     xbt_die("No constant address for this variable");
-  this->read_bytes(&this->heap_address, sizeof(struct mdesc*), remote(std_heap_var->address),
+  this->read_bytes(&this->heap_address, sizeof(mdesc*), remote(std_heap_var->address),
                    simgrid::mc::ProcessIndexDisabled);
 
   this->smx_actors_infos.clear();
@@ -262,8 +262,7 @@ void RemoteClient::refresh_heap()
   // Read/dereference/refresh the std_heap pointer:
   if (not this->heap)
     this->heap = std::unique_ptr<s_xbt_mheap_t>(new s_xbt_mheap_t());
-  this->read_bytes(this->heap.get(), sizeof(struct mdesc), remote(this->heap_address),
-                   simgrid::mc::ProcessIndexDisabled);
+  this->read_bytes(this->heap.get(), sizeof(mdesc), remote(this->heap_address), simgrid::mc::ProcessIndexDisabled);
   this->cache_flags_ |= RemoteClient::cache_heap;
 }
 
@@ -295,7 +294,7 @@ void RemoteClient::init_memory_map_info()
   this->binary_info     = nullptr;
   this->libsimgrid_info = nullptr;
 
-  struct s_mc_memory_map_re res;
+  s_mc_memory_map_re res;
 
   if (regcomp(&res.so_re, SO_RE, 0) || regcomp(&res.version_re, VERSION_RE, 0))
     xbt_die(".so regexp did not compile");
index e7d1ef9..b30226e 100644 (file)
@@ -27,8 +27,8 @@ public:
 }
 /********************************* Task **************************************/
 
-typedef struct simdata_task {
-  ~simdata_task()
+struct s_simdata_task_t {
+  ~s_simdata_task_t()
   {
     /* parallel tasks only */
     xbt_free(this->host_list);
@@ -57,7 +57,7 @@ typedef struct simdata_task {
 
 private:
   void reportMultipleUse() const;
-} s_simdata_task_t;
+};
 
 /******************************* Process *************************************/
 
@@ -85,12 +85,12 @@ public:
 }
 
 /************************** Global variables ********************************/
-typedef struct MSG_Global {
+struct s_MSG_Global_t {
   int debug_multiple_use;            /* whether we want an error message when reusing the same Task for 2 things */
   std::atomic_int_fast32_t sent_msg; /* Total amount of messages sent during the simulation */
   void (*task_copy_callback)(msg_task_t task, msg_process_t src, msg_process_t dst);
   void_f_pvoid_t process_data_cleanup;
-} s_MSG_Global_t;
+};
 typedef s_MSG_Global_t* MSG_Global_t;
 
 extern "C" {
@@ -132,7 +132,7 @@ XBT_PRIVATE void TRACE_msg_process_sleep_in(msg_process_t process); // called fr
 XBT_PRIVATE void TRACE_msg_process_sleep_out(msg_process_t process);
 }
 
-inline void simdata_task::setUsed()
+inline void s_simdata_task_t::setUsed()
 {
   if (this->isused)
     this->reportMultipleUse();
index 703fbee..b475b9d 100644 (file)
@@ -63,16 +63,16 @@ int MSG_sem_would_block(msg_sem_t sem) {
 }
 
 /*-**** barrier related functions ****-*/
-typedef struct s_msg_bar {
+struct s_msg_bar_t {
   xbt_mutex_t mutex;
   xbt_cond_t cond;
   unsigned int arrived_processes;
   unsigned int expected_processes;
-} s_msg_bar_t;
+};
 
 /** @brief Initializes a barrier, with count elements */
 msg_bar_t MSG_barrier_init(unsigned int count) {
-  msg_bar_t bar           = xbt_new0(s_msg_bar, 1);
+  msg_bar_t bar           = xbt_new0(s_msg_bar_t, 1);
   bar->expected_processes = count;
   bar->arrived_processes  = 0;
   bar->mutex              = xbt_mutex_init();
index 814282b..c9b9fda 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
 
-void simdata_task::reportMultipleUse() const
+void s_simdata_task_t::reportMultipleUse() const
 {
   if (msg_global->debug_multiple_use){
     XBT_ERROR("This task is already used in there:");
index 14ac69d..c6449bb 100644 (file)
 
 extern "C" {
 
-struct dirty_page {
+struct s_dirty_page {
   double prev_clock;
   double prev_remaining;
   msg_task_t task;
 };
-typedef struct dirty_page s_dirty_page;
-typedef struct dirty_page* dirty_page_t;
+typedef s_dirty_page* dirty_page_t;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg, "Cloud-oriented parts of the MSG API");
 
@@ -242,7 +241,7 @@ static int migration_rx_fun(int argc, char *argv[])
   XBT_DEBUG("mig: rx_start");
 
   // The structure has been created in the do_migration function and should only be freed in the same place ;)
-  struct migration_session* ms = static_cast<migration_session*>(MSG_process_get_data(MSG_process_self()));
+  migration_session* ms = static_cast<migration_session*>(MSG_process_get_data(MSG_process_self()));
 
   bool received_finalize = false;
 
@@ -507,7 +506,7 @@ static int migration_tx_fun(int argc, char *argv[])
   XBT_DEBUG("mig: tx_start");
 
   // Note that the ms structure has been allocated in do_migration and hence should be freed in the same function ;)
-  migration_session *ms = static_cast<migration_session *>(MSG_process_get_data(MSG_process_self()));
+  migration_session* ms = static_cast<migration_session*>(MSG_process_get_data(MSG_process_self()));
 
   double host_speed = ms->vm->pimpl_vm_->getPm()->getSpeed();
   s_vm_params_t params;
@@ -706,7 +705,7 @@ void MSG_vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
 
   vm->pimpl_vm_->isMigrating = true;
 
-  struct migration_session *ms = xbt_new(struct migration_session, 1);
+  migration_session* ms = xbt_new(migration_session, 1);
   ms->vm = vm;
   ms->src_pm = src_pm;
   ms->dst_pm = dst_pm;
index 79c3aff..fbc0483 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -16,7 +16,7 @@
 #define GUESTOS_NOISE 100 // This value corresponds to the cost of the global action associated to the VM
                           // It corresponds to the cost of a VM running no tasks.
 
-typedef struct dirty_page* dirty_page_t;
+typedef struct s_dirty_page* dirty_page_t;
 
 namespace simgrid {
 namespace vm {
index 84cb5ee..6b14965 100644 (file)
@@ -38,7 +38,7 @@ extern "C" {
 extern XBT_PRIVATE simgrid::sd::Global *sd_global;
 
 /* Task */
-typedef struct SD_task {
+struct s_SD_task_t {
   e_SD_task_state_t state;
   void *data;                   /* user data */
   char *name;
@@ -63,7 +63,7 @@ typedef struct SD_task {
   double *flops_amount;
   double *bytes_amount;
   double rate;
-} s_SD_task_t;
+};
 
 /* SimDag private functions */
 XBT_PRIVATE void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state);
index 5e9b5c2..7682fbd 100644 (file)
 #include <list>
 #include <map>
 
-typedef struct s_smx_process_exit_fun {
+struct s_smx_process_exit_fun_t {
   int_f_pvoid_pvoid_t fun;
   void *arg;
-} s_smx_process_exit_fun_t;
+};
 typedef s_smx_process_exit_fun_t* smx_process_exit_fun_t;
 
 namespace simgrid {
index d6c0a5c..8dbbec1 100644 (file)
@@ -52,8 +52,8 @@ struct s_smx_simcall {
   smx_actor_t issuer;
   smx_timer_t timer;
   int mc_value;
-  union u_smx_scalar args[11];
-  union u_smx_scalar result;
+  u_smx_scalar args[11];
+  u_smx_scalar result;
 };
 
 #define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall)->mc_value = (value))
index d01e0f8..4abd638 100644 (file)
@@ -53,15 +53,15 @@ std::unique_ptr<simgrid::simix::Global> simix_global;
 static xbt_heap_t simix_timers = nullptr;
 
 /** @brief Timer datatype */
-typedef class s_smx_timer {
+class s_smx_timer_t {
   double date = 0.0;
-  s_smx_timer() = default;
+  s_smx_timer_t() = default;
 
 public:
   simgrid::xbt::Task<void()> callback;
   double getDate() { return date; }
-  s_smx_timer(double date, simgrid::xbt::Task<void()> callback) : date(date), callback(std::move(callback)) {}
-} s_smx_timer_t;
+  s_smx_timer_t(double date, simgrid::xbt::Task<void()> callback) : date(date), callback(std::move(callback)) {}
+};
 
 void (*SMPI_switch_data_segment)(int) = nullptr;
 
index be7ca2f..27def86 100644 (file)
@@ -232,7 +232,7 @@ smx_cond_t SIMIX_cond_init()
 {
   XBT_IN("()");
   simgrid::simix::ActorImpl p;
-  smx_cond_t cond = new s_smx_cond();
+  smx_cond_t cond = new s_smx_cond_t();
   cond->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
   cond->refcount_ = 1;
   XBT_OUT();
index 8eb66a5..7349982 100644 (file)
@@ -52,19 +52,19 @@ private:
 }
 }
 
-typedef struct s_smx_cond {
-  s_smx_cond() : cond_(this) {}
+struct s_smx_cond_t {
+  s_smx_cond_t() : cond_(this) {}
 
   std::atomic_int_fast32_t refcount_{1};
   smx_mutex_t mutex   = nullptr;
   xbt_swag_t sleeping = nullptr; /* list of sleeping process */
   simgrid::s4u::ConditionVariable cond_;
-} s_smx_cond_t;
+};
 
-typedef struct s_smx_sem {
+struct s_smx_sem_t {
   unsigned int value;
   xbt_swag_t sleeping; /* list of sleeping process */
-} s_smx_sem_t;
+};
 
 XBT_PRIVATE void SIMIX_post_synchro(smx_activity_t synchro);
 XBT_PRIVATE void SIMIX_synchro_stop_waiting(smx_actor_t process, smx_simcall_t simcall);
index ac91c2d..81dbe1b 100644 (file)
@@ -650,13 +650,13 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
 
   smpi_bench_end();
   //save requests information for tracing
-  typedef struct {
+  struct savedvalstype {
     int src;
     int dst;
     int recv;
     int tag;
     MPI_Comm comm;
-  } savedvalstype;
+  };
   savedvalstype* savedvals = xbt_new0(savedvalstype, count);
 
   for (int i = 0; i < count; i++) {
@@ -696,14 +696,14 @@ int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
 {
   smpi_bench_end();
   //save information from requests
-  typedef struct {
+  struct savedvalstype {
     int src;
     int dst;
     int recv;
     int tag;
     int valid;
     MPI_Comm comm;
-  } savedvalstype;
+  };
   savedvalstype* savedvals=xbt_new0(savedvalstype, count);
 
   for (int i = 0; i < count; i++) {
index 487854c..6978a46 100644 (file)
@@ -23,7 +23,7 @@ int Coll_allreduce_rab2::allreduce(void *sbuff, void *rbuff,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index e1f85a7..a7ee1d1 100644 (file)
@@ -21,7 +21,7 @@ int Coll_allreduce_rdb::allreduce(void *sbuff, void *rbuff, int count,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index 5c96b62..e94211a 100644 (file)
@@ -49,7 +49,7 @@ int Coll_allreduce_smp_rdb::allreduce(void *send_buf, void *recv_buf, int count,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index 72eba89..4b9b0cf 100644 (file)
@@ -37,7 +37,7 @@ int Coll_allreduce_smp_rsag_lr::allreduce(void *send_buf, void *recv_buf,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index 7176495..c86b16a 100644 (file)
@@ -36,7 +36,7 @@ int Coll_allreduce_smp_rsag::allreduce(void *send_buf, void *recv_buf,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index 8271823..e6ff4b4 100644 (file)
       (SEGCOUNT)++;                                                                                                    \
   }
 
-typedef struct ompi_coll_tree_t {
+struct ompi_coll_tree_t {
   int32_t tree_root;
   int32_t tree_fanout;
   int32_t tree_bmtree;
   int32_t tree_prev;
   int32_t tree_next[MAXTREEFANOUT];
   int32_t tree_nextsize;
-} ompi_coll_tree_t;
+};
 
 ompi_coll_tree_t* ompi_coll_tuned_topo_build_tree(int fanout, MPI_Comm com, int root);
 ompi_coll_tree_t* ompi_coll_tuned_topo_build_in_order_bintree(MPI_Comm comm);
index 394544c..b399292 100644 (file)
@@ -409,13 +409,31 @@ Benchmark results on CRAY T3E
 #endif
 #endif
 
-typedef enum {MPIM_SHORT, MPIM_INT, MPIM_LONG, MPIM_UNSIGNED_SHORT,
-              MPIM_UNSIGNED, MPIM_UNSIGNED_LONG, MPIM_UNSIGNED_LONG_LONG, MPIM_FLOAT,
-              MPIM_DOUBLE, MPIM_BYTE} MPIM_Datatype;
-
-typedef enum {MPIM_MAX, MPIM_MIN, MPIM_SUM, MPIM_PROD,
-              MPIM_LAND, MPIM_BAND, MPIM_LOR, MPIM_BOR,
-              MPIM_LXOR, MPIM_BXOR} MPIM_Op;
+enum MPIM_Datatype {
+  MPIM_SHORT,
+  MPIM_INT,
+  MPIM_LONG,
+  MPIM_UNSIGNED_SHORT,
+  MPIM_UNSIGNED,
+  MPIM_UNSIGNED_LONG,
+  MPIM_UNSIGNED_LONG_LONG,
+  MPIM_FLOAT,
+  MPIM_DOUBLE,
+  MPIM_BYTE
+};
+
+enum MPIM_Op {
+  MPIM_MAX,
+  MPIM_MIN,
+  MPIM_SUM,
+  MPIM_PROD,
+  MPIM_LAND,
+  MPIM_BAND,
+  MPIM_LOR,
+  MPIM_BOR,
+  MPIM_LXOR,
+  MPIM_BXOR
+};
 #define MPI_I_DO_OP_C_INTEGER(MPI_I_do_op_TYPE,TYPE)                   \
 static void MPI_I_do_op_TYPE(TYPE* b1,TYPE* b2,TYPE* rslt, int cnt,MPIM_Op op)\
 { int i;                                                               \
index 53bf9cd..8c6630b 100644 (file)
 #define INTEL_MAX_NB_NUMPROCS  12
 #define INTEL_MAX_NB_PPN  5  /* 1 2 4 8 16 ppn */
 
-typedef struct {
+struct intel_tuning_table_size_element {
   unsigned int max_size;
   int algo;
-} intel_tuning_table_size_element;
+};
 
-typedef struct {
+struct intel_tuning_table_numproc_element {
   int max_num_proc;
   int num_elems;
   intel_tuning_table_size_element elems[INTEL_MAX_NB_THRESHOLDS];
-} intel_tuning_table_numproc_element;
+};
 
-typedef struct {
+struct intel_tuning_table_element {
   int ppn;
   intel_tuning_table_numproc_element elems[INTEL_MAX_NB_NUMPROCS];
-} intel_tuning_table_element;
+};
 
 /*
 I_MPI_ADJUST_ALLREDUCE
index 7f69d1c..a922738 100644 (file)
 
 XBT_PUBLIC(void) smpi_coll_cleanup_mvapich2(void);
 
-typedef struct {
+struct mv2_alltoall_tuning_element {
   int min;
   int max;
   int (*MV2_pt_Alltoall_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                                   MPI_Datatype recvtype, MPI_Comm comm_ptr);
-} mv2_alltoall_tuning_element;
+};
 
-typedef struct {
+struct mv2_alltoall_tuning_table {
   int numproc;
   int size_table;
   mv2_alltoall_tuning_element algo_table[MV2_MAX_NB_THRESHOLDS];
   mv2_alltoall_tuning_element in_place_algo_table[MV2_MAX_NB_THRESHOLDS];
-} mv2_alltoall_tuning_table;
+};
 
 int (*MV2_Alltoall_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                              MPI_Datatype recvtype, MPI_Comm comm_ptr) = NULL;
@@ -331,19 +331,19 @@ static void init_mv2_alltoall_tables_stampede()
 
 /************ Allgather variables and initializers                        */
 
-typedef struct {
+struct mv2_allgather_tuning_element {
   int min;
   int max;
   int (*MV2_pt_Allgatherction)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                                MPI_Datatype recvtype, MPI_Comm comm_ptr);
-} mv2_allgather_tuning_element;
+};
 
-typedef struct {
+struct mv2_allgather_tuning_table {
   int numproc;
   int two_level[MV2_MAX_NB_THRESHOLDS];
   int size_inter_table;
   mv2_allgather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-} mv2_allgather_tuning_table;
+};
 
 int (*MV2_Allgatherction)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                           MPI_Datatype recvtype, MPI_Comm comm);
@@ -567,20 +567,20 @@ static void init_mv2_allgather_tables_stampede()
 
 /************ Gather variables and initializers                        */
 
-typedef struct {
+struct mv2_gather_tuning_element {
   int min;
   int max;
   int (*MV2_pt_Gather_function)(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
                                 MPI_Datatype recvtype, int root, MPI_Comm comm_ptr);
-} mv2_gather_tuning_element;
+};
 
-typedef struct {
+struct mv2_gather_tuning_table {
   int numproc;
   int size_inter_table;
   mv2_gather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
   int size_intra_table;
   mv2_gather_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_gather_tuning_table;
+};
 
 int mv2_size_gather_tuning_table                     = 7;
 mv2_gather_tuning_table* mv2_gather_thresholds_table = NULL;
@@ -659,18 +659,18 @@ static void init_mv2_gather_tables_stampede()
 
 /************ Allgatherv variables and initializers                        */
 
-typedef struct {
+struct mv2_allgatherv_tuning_element {
   int min;
   int max;
   int (*MV2_pt_Allgatherv_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
                                     int* displs, MPI_Datatype recvtype, MPI_Comm commg);
-} mv2_allgatherv_tuning_element;
+};
 
-typedef struct {
+struct mv2_allgatherv_tuning_table {
   int numproc;
   int size_inter_table;
   mv2_allgatherv_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-} mv2_allgatherv_tuning_table;
+};
 
 int (*MV2_Allgatherv_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
                                int* displs, MPI_Datatype recvtype, MPI_Comm comm);
@@ -740,14 +740,14 @@ static void init_mv2_allgatherv_tables_stampede()
 
 /************ Allreduce variables and initializers                        */
 
-typedef struct {
+struct mv2_allreduce_tuning_element {
   int min;
   int max;
   int (*MV2_pt_Allreducection)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
                                MPI_Comm comm);
-} mv2_allreduce_tuning_element;
+};
 
-typedef struct {
+struct mv2_allreduce_tuning_table {
   int numproc;
   int mcast_enabled;
   int is_two_level_allreduce[MV2_MAX_NB_THRESHOLDS];
@@ -755,7 +755,7 @@ typedef struct {
   mv2_allreduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
   int size_intra_table;
   mv2_allreduce_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_allreduce_tuning_table;
+};
 
 int (*MV2_Allreducection)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
                           MPI_Comm comm) = NULL;
@@ -931,14 +931,14 @@ static void init_mv2_allreduce_tables_stampede()
          mv2_size_allreduce_tuning_table * sizeof(mv2_allreduce_tuning_table));
 }
 
-typedef struct {
+struct mv2_bcast_tuning_element {
   int min;
   int max;
   int (*MV2_pt_Bcast_function)(void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm_ptr);
   int zcpy_pipelined_knomial_factor;
-} mv2_bcast_tuning_element;
+};
 
-typedef struct {
+struct mv2_bcast_tuning_table {
   int numproc;
   int bcast_segment_size;
   int intra_node_knomial_factor;
@@ -948,7 +948,7 @@ typedef struct {
   mv2_bcast_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
   int size_intra_table;
   mv2_bcast_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_bcast_tuning_table;
+};
 
 int mv2_size_bcast_tuning_table                    = 0;
 mv2_bcast_tuning_table* mv2_bcast_thresholds_table = NULL;
@@ -1162,14 +1162,14 @@ static void init_mv2_bcast_tables_stampede()
 
 /************ Reduce variables and initializers                        */
 
-typedef struct {
+struct mv2_reduce_tuning_element {
   int min;
   int max;
   int (*MV2_pt_Reduce_function)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
                                 MPI_Comm comm_ptr);
-} mv2_reduce_tuning_element;
+};
 
-typedef struct {
+struct mv2_reduce_tuning_table {
   int numproc;
   int inter_k_degree;
   int intra_k_degree;
@@ -1178,7 +1178,7 @@ typedef struct {
   mv2_reduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
   int size_intra_table;
   mv2_reduce_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_reduce_tuning_table;
+};
 
 int mv2_size_reduce_tuning_table                     = 0;
 mv2_reduce_tuning_table* mv2_reduce_thresholds_table = NULL;
@@ -1396,18 +1396,18 @@ static void init_mv2_reduce_tables_stampede()
 
 /************ Reduce scatter variables and initializers                        */
 
-typedef struct {
+struct mv2_red_scat_tuning_element {
   int min;
   int max;
   int (*MV2_pt_Red_scat_function)(void* sendbuf, void* recvbuf, int* recvcnts, MPI_Datatype datatype, MPI_Op op,
                                   MPI_Comm comm_ptr);
-} mv2_red_scat_tuning_element;
+};
 
-typedef struct {
+struct mv2_red_scat_tuning_table {
   int numproc;
   int size_inter_table;
   mv2_red_scat_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-} mv2_red_scat_tuning_table;
+};
 
 int mv2_size_red_scat_tuning_table                       = 0;
 mv2_red_scat_tuning_table* mv2_red_scat_thresholds_table = NULL;
@@ -1490,20 +1490,20 @@ static void init_mv2_reduce_scatter_tables_stampede()
 
 /************ Scatter variables and initializers                        */
 
-typedef struct {
+struct mv2_scatter_tuning_element {
   int min;
   int max;
   int (*MV2_pt_Scatter_function)(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
                                  MPI_Datatype recvtype, int root, MPI_Comm comm);
-} mv2_scatter_tuning_element;
+};
 
-typedef struct {
+struct mv2_scatter_tuning_table {
   int numproc;
   int size_inter_table;
   mv2_scatter_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
   int size_intra_table;
   mv2_scatter_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_scatter_tuning_table;
+};
 
 int* mv2_scatter_table_ppn_conf                         = NULL;
 int mv2_scatter_num_ppn_conf                            = 1;
index 9504e94..4f0ca57 100644 (file)
@@ -85,7 +85,7 @@ extern XBT_PRIVATE double smpi_host_speed;
 extern XBT_PRIVATE char* smpi_data_exe_start; // start of the data+bss segment of the executable
 extern XBT_PRIVATE int smpi_data_exe_size;    // size of the data+bss segment of the executable
 
-typedef enum { shmalloc_none, shmalloc_local, shmalloc_global } shared_malloc_type;
+enum shared_malloc_type { shmalloc_none, shmalloc_local, shmalloc_global };
 extern XBT_PRIVATE shared_malloc_type smpi_cfg_shared_malloc; // Whether to activate shared malloc
 
 XBT_PRIVATE void smpi_switch_data_segment(int dest);
@@ -404,10 +404,10 @@ void mpi_file_write_(int* fh, void* buf, int* count, int* datatype, MPI_Status*
 
 // TODO, make this static and expose it more cleanly
 
-typedef struct s_smpi_privatization_region {
+struct s_smpi_privatization_region_t {
   void* address;
   int file_descriptor;
-} s_smpi_privatization_region_t;
+};
 typedef s_smpi_privatization_region_t* smpi_privatization_region_t;
 
 extern XBT_PRIVATE smpi_privatization_region_t smpi_privatization_regions;
@@ -437,12 +437,12 @@ XBT_PUBLIC(smpi_trace_call_location_t*) smpi_process_get_call_location();
 XBT_PUBLIC(smpi_trace_call_location_t*) smpi_trace_get_call_location();
 }
 
-typedef enum {
+enum smpi_priv_strategies {
   SMPI_PRIVATIZE_NONE    = 0,
   SMPI_PRIVATIZE_MMAP    = 1,
   SMPI_PRIVATIZE_DLOPEN  = 2,
   SMPI_PRIVATIZE_DEFAULT = SMPI_PRIVATIZE_MMAP
-} smpi_priv_strategies;
+};
 
 extern XBT_PRIVATE int smpi_privatize_global_variables;
 
index f9356ea..3993774 100644 (file)
@@ -82,12 +82,11 @@ static ret cat  (COLL_UNPAREN args); \
 namespace simgrid{
 namespace smpi{
 
-struct mpi_coll_description {
+struct s_mpi_coll_description_t {
   const char *name;
   const char *description;
   void *coll;
 };
-typedef struct mpi_coll_description  s_mpi_coll_description_t;
 
 class Colls{
   public:
index 3b1fd7d..2fc90cf 100644 (file)
 extern const MPI_Datatype MPI_PTR;
 
 //The following are datatypes for the MPI functions MPI_MAXLOC and MPI_MINLOC.
-typedef struct {
+struct float_int {
   float value;
   int index;
-} float_int;
-typedef struct {
+};
+struct float_float {
   float value;
   float index;
-} float_float;
-typedef struct {
+};
+struct long_long {
   long value;
   long index;
-} long_long;
-typedef struct {
+};
+struct double_double {
   double value;
   double index;
-} double_double;
-typedef struct {
+};
+struct long_int {
   long value;
   int index;
-} long_int;
-typedef struct {
+};
+struct double_int {
   double value;
   int index;
-} double_int;
-typedef struct {
+};
+struct short_int {
   short value;
   int index;
-} short_int;
-typedef struct {
+};
+struct int_int {
   int value;
   int index;
-} int_int;
-typedef struct {
+};
+struct long_double_int {
   long double value;
   int index;
-} long_double_int;
-typedef struct {
+};
+struct integer128_t {
   int64_t value;
   int64_t index;
-} integer128_t;
-
+};
 
 namespace simgrid{
 namespace smpi{
index c0ee395..bd4dd80 100644 (file)
 
 #include <unordered_map>
 
-typedef struct smpi_delete_fn{
+struct smpi_delete_fn {
   MPI_Comm_delete_attr_function          *comm_delete_fn;
   MPI_Type_delete_attr_function          *type_delete_fn;
   MPI_Win_delete_attr_function           *win_delete_fn;
-} smpi_delete_fn;
+};
 
-typedef struct smpi_copy_fn{
+struct smpi_copy_fn {
   MPI_Comm_copy_attr_function          *comm_copy_fn;
   MPI_Type_copy_attr_function          *type_copy_fn;
   MPI_Win_copy_attr_function           *win_copy_fn;
-} smpi_copy_fn;
+};
 
-typedef struct s_smpi_key_elem {
+struct s_smpi_key_elem_t {
   smpi_copy_fn copy_fn;
   smpi_delete_fn delete_fn;
   int refcount;
-} s_smpi_mpi_key_elem_t;
+};
 
-typedef struct s_smpi_key_elem *smpi_key_elem;
+typedef s_smpi_key_elem_t* smpi_key_elem;
 
 namespace simgrid{
 namespace smpi{
@@ -54,7 +54,7 @@ class Keyval{
 
 template <typename T> int Keyval::keyval_create(smpi_copy_fn copy_fn, smpi_delete_fn delete_fn, int* keyval, void* extra_state){
 
-  smpi_key_elem value = (smpi_key_elem) xbt_new0(s_smpi_mpi_key_elem_t,1);
+  smpi_key_elem value = (smpi_key_elem)xbt_new0(s_smpi_key_elem_t, 1);
 
   value->copy_fn=copy_fn;
   value->delete_fn=delete_fn;
index f83165f..69e8a08 100644 (file)
@@ -79,14 +79,14 @@ typedef char *address;
 typedef short int shortint;
 typedef float real;
 typedef double doublereal;
-typedef struct {
+struct complex {
   real r;
   real i;
-} complex;
-typedef struct {
+};
+struct doublecomplex {
   doublereal r;
   doublereal i;
-} doublecomplex;
+};
 
 extern "C" XBT_PUBLIC(doublereal) smpi_get_host_power_peak_at_(integer *pstate_index);
 doublereal smpi_get_host_power_peak_at_(integer *pstate_index)
index dbdb570..7811d95 100644 (file)
@@ -147,7 +147,7 @@ void smpi_initialize_global_memory_segments()
   }
 
   smpi_privatization_regions = static_cast<smpi_privatization_region_t>(
-      xbt_malloc(smpi_process_count() * sizeof(struct s_smpi_privatization_region)));
+      xbt_malloc(smpi_process_count() * sizeof(s_smpi_privatization_region_t)));
 
   for (int i=0; i< smpi_process_count(); i++){
     // create SIMIX_process_count() mappings of this size with the same data inside
index af3ecbb..0d504c4 100644 (file)
@@ -6,10 +6,10 @@
 #include "private.hpp"
 #include <stack>
 
-typedef struct s_smpi_static {
+struct s_smpi_static_t {
   void *ptr;
   void_f_pvoid_t free_fn;
-} s_smpi_static_t;
+};
 
 /**
  * \brief Holds a reference to all static variables that were registered
index b74d624..b5f52e1 100644 (file)
@@ -165,10 +165,10 @@ private:
 /** @ingroup SURF_storage_interface
  * @brief The possible type of action for the storage component
  */
-typedef enum {
+enum e_surf_action_storage_type_t {
   READ = 0, /**< Read a file */
   WRITE     /**< Write in a file */
-} e_surf_action_storage_type_t;
+};
 
 /** @ingroup SURF_storage_interface
  * @brief SURF storage action interface class
index 23ca225..017e6f4 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_maxmin, surf, "Logging specific to SURF (maxmin)");
 
-typedef struct s_dyn_light {
+struct s_dyn_light_t {
   int *data;
   int pos;
   int size;
-} s_dyn_light_t;
+};
 typedef s_dyn_light_t* dyn_light_t;
 
 double sg_maxmin_precision = 0.00001; /* Change this with --cfg=maxmin/precision:VALUE */
index 15de20f..976caa0 100644 (file)
@@ -17,7 +17,7 @@
  * Basically, each variable will have a set of elements, one for each constraint where it is involved.
  * Then, it is used to list all variables involved in constraint through constraint's xxx_element_set lists, or vice-versa list all constraints for a given variable.
  */
-typedef struct lmm_element {
+struct s_lmm_element_t {
   /* hookup to constraint */
   s_xbt_swag_hookup_t enabled_element_set_hookup;
   s_xbt_swag_hookup_t disabled_element_set_hookup;
@@ -30,14 +30,14 @@ typedef struct lmm_element {
   //   - if CPU, then probably 1.
   //   - If network, then 1 in forward direction and 0.05 backward for the ACKs
   double consumption_weight;
-} s_lmm_element_t;
+};
 #define make_elem_active(elem) xbt_swag_insert_at_head(elem,&(elem->constraint->active_element_set))
 #define make_elem_inactive(elem) xbt_swag_remove(elem,&(elem->constraint->active_element_set))
 
-typedef struct lmm_constraint_light {
+struct s_lmm_constraint_light_t {
   double remaining_over_usage;
   lmm_constraint_t cnst;
-} s_lmm_constraint_light_t;
+};
 
 /** @ingroup SURF_lmm
  * @brief LMM constraint
@@ -47,7 +47,7 @@ typedef struct lmm_constraint_light {
  * \li Active elements which variable's weight is non-zero (i.e. it is enabled) AND its element value is non-zero. LMM_solve iterates over active elements during resolution, dynamically making them active or unactive.
  *
  */
-typedef struct lmm_constraint {
+struct s_lmm_constraint_t {
   /* hookup to system */
   s_xbt_swag_hookup_t constraint_set_hookup;
   s_xbt_swag_hookup_t active_constraint_set_hookup;
@@ -71,14 +71,14 @@ typedef struct lmm_constraint {
   double lambda;
   double new_lambda;
   lmm_constraint_light_t cnst_light;
-} s_lmm_constraint_t;
+};
 
 /** @ingroup SURF_lmm
  * @brief LMM variable
  *
  * When something prevents us from enabling a variable, we "stage" the weight that we would have like to set, so that as soon as possible we enable the variable with desired weight
  */
-typedef struct lmm_variable {
+struct s_lmm_variable_t {
   /* hookup to system */
   s_xbt_swag_hookup_t variable_set_hookup;
   s_xbt_swag_hookup_t saturated_variable_set_hookup;
@@ -103,16 +103,16 @@ typedef struct lmm_variable {
   /* \begin{For Lagrange only} */
   double mu;
   double new_mu;
-  double (*func_f) (struct lmm_variable * var, double x);       /* (f)    */
-  double (*func_fp) (struct lmm_variable * var, double x);      /* (f')    */
-  double (*func_fpi) (struct lmm_variable * var, double x);     /* (f')^{-1}    */
+  double (*func_f)(s_lmm_variable_t* var, double x);   /* (f)    */
+  double (*func_fp)(s_lmm_variable_t* var, double x);  /* (f')    */
+  double (*func_fpi)(s_lmm_variable_t* var, double x); /* (f')^{-1}    */
   /* \end{For Lagrange only} */
-} s_lmm_variable_t;
+};
 
 /** @ingroup SURF_lmm
  * @brief LMM system
  */
-typedef struct lmm_system {
+struct s_lmm_system_t {
   int modified;
   bool selective_update_active;  /* flag to update partially the system only selecting changed portions */
   unsigned visited_counter;     /* used by lmm_update_modified_set  and lmm_remove_modified_set to cleverly (un-)flag the constraints (more details in these functions)*/
@@ -130,7 +130,7 @@ typedef struct lmm_system {
   xbt_mallocator_t variable_mallocator;
 
   void (*solve_fun)(lmm_system_t self);
-} s_lmm_system_t;
+};
 
 #define extract_variable(sys) xbt_swag_extract(&(sys->variable_set))
 #define extract_constraint(sys) xbt_swag_extract(&(sys->constraint_set))
index a481159..93cbaf9 100644 (file)
@@ -345,11 +345,11 @@ private:
 /** @ingroup SURF_interface
  * @brief Resource which have a metric handled by a maxmin system
  */
-typedef struct {
+struct s_surf_metric_t {
   double peak;              /**< The peak of the metric, ie its max value */
   double scale;             /**< Current availability of the metric according to the traces, in [0,1] */
   tmgr_trace_event_t event; /**< The associated trace event associated to the metric */
-} s_surf_metric_t;
+};
 
 namespace simgrid {
 namespace surf {
index 0e9fec3..3e8d90c 100644 (file)
@@ -19,14 +19,14 @@ extern XBT_PRIVATE const char* surf_action_state_names[6];
 /** @ingroup SURF_interface
  * @brief Possible update mechanisms
  */
-typedef enum {
+enum e_UM_t {
   UM_FULL,     /**< Full update mechanism: the remaining time of every action is recomputed at each step */
   UM_LAZY,     /**< Lazy update mechanism: only the modified actions get recomputed.
                     It may be slower than full if your system is tightly coupled to the point where every action
                     gets recomputed anyway. In that case, you'd better not try to be cleaver with lazy and go for
                     a simple full update.  */
   UM_UNDEFINED /**< Mechanism not defined */
-} e_UM_t;
+};
 
 /* Generic functions common to all models */
 
index 625db04..b687772 100644 (file)
 extern "C" {
 
 /* Iterator within a trace */
-typedef struct tmgr_trace_event {
+struct s_tmgr_trace_event_t {
   tmgr_trace_t trace;
   unsigned int idx;
   sg_resource_t resource;
   int free_me;
-} s_tmgr_trace_event_t;
-typedef struct tmgr_trace_event* tmgr_trace_event_t;
+};
+typedef s_tmgr_trace_event_t* tmgr_trace_event_t;
 
 /**
  * \brief Free a trace event structure
index a4f9047..93b710e 100644 (file)
@@ -23,12 +23,12 @@ extern "C" {
 typedef size_t yy_size_t;
 #endif
 
-typedef enum {
-  SURF_CLUSTER_DRAGONFLY=3,
-  SURF_CLUSTER_FAT_TREE=2,
-  SURF_CLUSTER_FLAT = 1,
-  SURF_CLUSTER_TORUS = 0
-} e_surf_cluster_topology_t;
+enum e_surf_cluster_topology_t {
+  SURF_CLUSTER_DRAGONFLY = 3,
+  SURF_CLUSTER_FAT_TREE  = 2,
+  SURF_CLUSTER_FLAT      = 1,
+  SURF_CLUSTER_TORUS     = 0
+};
 
 /* ***************************************** */
 /*
@@ -41,7 +41,7 @@ typedef enum {
  * used, instead of malloced structures.
  */
 
-typedef struct {
+struct s_sg_platf_host_cbarg_t {
   const char* id;
   std::vector<double> speed_per_pstate;
   int pstate;
@@ -50,7 +50,7 @@ typedef struct {
   tmgr_trace_t state_trace;
   const char* coord;
   std::map<std::string, std::string>* properties;
-} s_sg_platf_host_cbarg_t;
+};
 typedef s_sg_platf_host_cbarg_t* sg_platf_host_cbarg_t;
 
 class HostLinkCreationArgs {
@@ -83,15 +83,15 @@ public:
   tmgr_trace_t state_trace;
 };
 
-typedef struct s_sg_platf_route_cbarg *sg_platf_route_cbarg_t;
-typedef struct s_sg_platf_route_cbarg {
+struct s_sg_platf_route_cbarg_t {
   bool symmetrical;
   sg_netpoint_t src;
   sg_netpoint_t dst;
   sg_netpoint_t gw_src;
   sg_netpoint_t gw_dst;
   std::vector<simgrid::surf::LinkImpl*>* link_list;
-} s_sg_platf_route_cbarg_t;
+};
+typedef s_sg_platf_route_cbarg_t* sg_platf_route_cbarg_t;
 
 class ClusterCreationArgs {
 public:
@@ -152,11 +152,11 @@ public:
   std::string name;
 };
 
-typedef struct s_sg_platf_prop_cbarg *sg_platf_prop_cbarg_t;
-typedef struct s_sg_platf_prop_cbarg {
+struct s_sg_platf_prop_cbarg_t {
   const char *id;
   const char *value;
-} s_sg_platf_prop_cbarg_t;
+};
+typedef s_sg_platf_prop_cbarg_t* sg_platf_prop_cbarg_t;
 
 class TraceCreationArgs {
 public:
@@ -173,8 +173,7 @@ public:
   std::string element;
 };
 
-typedef struct s_sg_platf_process_cbarg *sg_platf_process_cbarg_t;
-typedef struct s_sg_platf_process_cbarg {
+struct s_sg_platf_process_cbarg_t {
   const char **argv;
   int argc;
   std::map<std::string, std::string>* properties;
@@ -183,7 +182,8 @@ typedef struct s_sg_platf_process_cbarg {
   double start_time;
   double kill_time;
   e_surf_process_on_failure_t on_failure;
-} s_sg_platf_process_cbarg_t;
+};
+typedef s_sg_platf_process_cbarg_t* sg_platf_process_cbarg_t;
 
 class ZoneCreationArgs {
 public:
index 2b16c03..a84649f 100644 (file)
@@ -144,9 +144,8 @@ struct unit_scale {
 };
 
 /* Note: field `unit' for the last element of parameter `units' should be nullptr. */
-static double surf_parse_get_value_with_unit(const char* string, const struct unit_scale* units,
-                                             const char* entity_kind, std::string name, const char* error_msg,
-                                             const char* default_unit)
+static double surf_parse_get_value_with_unit(const char* string, const unit_scale* units, const char* entity_kind,
+                                             std::string name, const char* error_msg, const char* default_unit)
 {
   char* ptr;
   int i;
@@ -174,113 +173,91 @@ static double surf_parse_get_value_with_unit(const char* string, const struct un
 
 double surf_parse_get_time(const char* string, const char* entity_kind, std::string name)
 {
-  const struct unit_scale units[] = {
-    { "w",  7 * 24 * 60 * 60 },
-    { "d",  24 * 60 * 60 },
-    { "h",  60 * 60 },
-    { "m",  60 },
-    { "s",  1.0 },
-    { "ms", 1e-3 },
-    { "us", 1e-6 },
-    { "ns", 1e-9 },
-    { "ps", 1e-12 },
-    { nullptr, 0 }
-  };
+  const unit_scale units[] = {{"w", 7 * 24 * 60 * 60},
+                              {"d", 24 * 60 * 60},
+                              {"h", 60 * 60},
+                              {"m", 60},
+                              {"s", 1.0},
+                              {"ms", 1e-3},
+                              {"us", 1e-6},
+                              {"ns", 1e-9},
+                              {"ps", 1e-12},
+                              {nullptr, 0}};
   return surf_parse_get_value_with_unit(string, units, entity_kind, name,
       "Append 's' to your time to get seconds", "s");
 }
 
 double surf_parse_get_size(const char* string, const char* entity_kind, std::string name)
 {
-  const struct unit_scale units[] = {
-    { "EiB", pow(1024, 6) },
-    { "PiB", pow(1024, 5) },
-    { "TiB", pow(1024, 4) },
-    { "GiB", pow(1024, 3) },
-    { "MiB", pow(1024, 2) },
-    { "KiB", 1024 },
-    { "EB",  1e18 },
-    { "PB",  1e15 },
-    { "TB",  1e12 },
-    { "GB",  1e9 },
-    { "MB",  1e6 },
-    { "kB",  1e3 },
-    { "B",   1.0 },
-    { "Eib", 0.125 * pow(1024, 6) },
-    { "Pib", 0.125 * pow(1024, 5) },
-    { "Tib", 0.125 * pow(1024, 4) },
-    { "Gib", 0.125 * pow(1024, 3) },
-    { "Mib", 0.125 * pow(1024, 2) },
-    { "Kib", 0.125 * 1024 },
-    { "Eb",  0.125 * 1e18 },
-    { "Pb",  0.125 * 1e15 },
-    { "Tb",  0.125 * 1e12 },
-    { "Gb",  0.125 * 1e9 },
-    { "Mb",  0.125 * 1e6 },
-    { "kb",  0.125 * 1e3 },
-    { "b",   0.125 },
-    { nullptr,    0 }
-  };
+  const unit_scale units[] = {{"EiB", pow(1024, 6)},
+                              {"PiB", pow(1024, 5)},
+                              {"TiB", pow(1024, 4)},
+                              {"GiB", pow(1024, 3)},
+                              {"MiB", pow(1024, 2)},
+                              {"KiB", 1024},
+                              {"EB", 1e18},
+                              {"PB", 1e15},
+                              {"TB", 1e12},
+                              {"GB", 1e9},
+                              {"MB", 1e6},
+                              {"kB", 1e3},
+                              {"B", 1.0},
+                              {"Eib", 0.125 * pow(1024, 6)},
+                              {"Pib", 0.125 * pow(1024, 5)},
+                              {"Tib", 0.125 * pow(1024, 4)},
+                              {"Gib", 0.125 * pow(1024, 3)},
+                              {"Mib", 0.125 * pow(1024, 2)},
+                              {"Kib", 0.125 * 1024},
+                              {"Eb", 0.125 * 1e18},
+                              {"Pb", 0.125 * 1e15},
+                              {"Tb", 0.125 * 1e12},
+                              {"Gb", 0.125 * 1e9},
+                              {"Mb", 0.125 * 1e6},
+                              {"kb", 0.125 * 1e3},
+                              {"b", 0.125},
+                              {nullptr, 0}};
   return surf_parse_get_value_with_unit(string, units, entity_kind, name,
       "Append 'B' to get bytes (or 'b' for bits but 1B = 8b).", "B");
 }
 
 double surf_parse_get_bandwidth(const char* string, const char* entity_kind, std::string name)
 {
-  const struct unit_scale units[] = {
-    { "EiBps", pow(1024, 6) },
-    { "PiBps", pow(1024, 5) },
-    { "TiBps", pow(1024, 4) },
-    { "GiBps", pow(1024, 3) },
-    { "MiBps", pow(1024, 2) },
-    { "KiBps", 1024 },
-    { "EBps",  1e18 },
-    { "PBps",  1e15 },
-    { "TBps",  1e12 },
-    { "GBps",  1e9 },
-    { "MBps",  1e6 },
-    { "kBps",  1e3 },
-    { "Bps",   1.0 },
-    { "Eibps", 0.125 * pow(1024, 6) },
-    { "Pibps", 0.125 * pow(1024, 5) },
-    { "Tibps", 0.125 * pow(1024, 4) },
-    { "Gibps", 0.125 * pow(1024, 3) },
-    { "Mibps", 0.125 * pow(1024, 2) },
-    { "Kibps", 0.125 * 1024 },
-    { "Tbps",  0.125 * 1e12 },
-    { "Gbps",  0.125 * 1e9 },
-    { "Mbps",  0.125 * 1e6 },
-    { "kbps",  0.125 * 1e3 },
-    { "bps",   0.125 },
-    { nullptr,    0 }
-  };
+  const unit_scale units[] = {{"EiBps", pow(1024, 6)},
+                              {"PiBps", pow(1024, 5)},
+                              {"TiBps", pow(1024, 4)},
+                              {"GiBps", pow(1024, 3)},
+                              {"MiBps", pow(1024, 2)},
+                              {"KiBps", 1024},
+                              {"EBps", 1e18},
+                              {"PBps", 1e15},
+                              {"TBps", 1e12},
+                              {"GBps", 1e9},
+                              {"MBps", 1e6},
+                              {"kBps", 1e3},
+                              {"Bps", 1.0},
+                              {"Eibps", 0.125 * pow(1024, 6)},
+                              {"Pibps", 0.125 * pow(1024, 5)},
+                              {"Tibps", 0.125 * pow(1024, 4)},
+                              {"Gibps", 0.125 * pow(1024, 3)},
+                              {"Mibps", 0.125 * pow(1024, 2)},
+                              {"Kibps", 0.125 * 1024},
+                              {"Tbps", 0.125 * 1e12},
+                              {"Gbps", 0.125 * 1e9},
+                              {"Mbps", 0.125 * 1e6},
+                              {"kbps", 0.125 * 1e3},
+                              {"bps", 0.125},
+                              {nullptr, 0}};
   return surf_parse_get_value_with_unit(string, units, entity_kind, name,
       "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps");
 }
 
 double surf_parse_get_speed(const char* string, const char* entity_kind, std::string name)
 {
-  const struct unit_scale units[] = {
-    { "yottaflops", 1e24 },
-    { "Yf",         1e24 },
-    { "zettaflops", 1e21 },
-    { "Zf",         1e21 },
-    { "exaflops",   1e18 },
-    { "Ef",         1e18 },
-    { "petaflops",  1e15 },
-    { "Pf",         1e15 },
-    { "teraflops",  1e12 },
-    { "Tf",         1e12 },
-    { "gigaflops",  1e9 },
-    { "Gf",         1e9 },
-    { "megaflops",  1e6 },
-    { "Mf",         1e6 },
-    { "kiloflops",  1e3 },
-    { "kf",         1e3 },
-    { "flops",      1.0 },
-    { "f",          1.0 },
-    { nullptr,         0 }
-  };
+  const unit_scale units[] = {{"yottaflops", 1e24}, {"Yf", 1e24}, {"zettaflops", 1e21}, {"Zf", 1e21},
+                              {"exaflops", 1e18},   {"Ef", 1e18}, {"petaflops", 1e15},  {"Pf", 1e15},
+                              {"teraflops", 1e12},  {"Tf", 1e12}, {"gigaflops", 1e9},   {"Gf", 1e9},
+                              {"megaflops", 1e6},   {"Mf", 1e6},  {"kiloflops", 1e3},   {"kf", 1e3},
+                              {"flops", 1.0},       {"f", 1.0},   {nullptr, 0}};
   return surf_parse_get_value_with_unit(string, units, entity_kind, name,
       "Append 'f' or 'flops' to your speed to get flop per second", "f");
 }
index 097519c..5b23cb1 100644 (file)
@@ -38,10 +38,9 @@ struct trace_arg {
   int size;
 };
 
-static _Unwind_Reason_Code
-backtrace_helper (struct _Unwind_Context *ctx, void *a)
+static _Unwind_Reason_Code backtrace_helper(_Unwind_Context* ctx, void* a)
 {
-  struct trace_arg *arg = (struct trace_arg *) a;
+  trace_arg* arg = static_cast<trace_arg*>(a);
 
   /* We are first called with address in the __backtrace function.
      Skip it.  */
index 87c869c..cde26d9 100644 (file)
@@ -40,11 +40,12 @@ static int _xbt_test_suite_disabled = 0;
 xbt_test_unit_t _xbt_test_current_unit = nullptr;
 
 /* test suite test log */
-typedef struct s_xbt_test_log {
+struct s_xbt_test_log {
   char *text;
   const char *file;
   int line;
-} *xbt_test_log_t;
+};
+typedef s_xbt_test_log* xbt_test_log_t;
 
 static void xbt_test_log_dump(xbt_test_log_t log)
 {
@@ -55,7 +56,7 @@ static void xbt_test_log_dump(xbt_test_log_t log)
 }
 
 /* test suite test check */
-typedef struct s_xbt_test_test {
+struct s_xbt_test_test {
   char *title;
   int failed;
   int expected_failure;
@@ -63,7 +64,8 @@ typedef struct s_xbt_test_test {
   const char *file;
   int line;
   xbt_dynar_t logs;
-} *xbt_test_test_t;
+};
+typedef s_xbt_test_test* xbt_test_test_t;
 
 static void xbt_test_test_dump(xbt_test_test_t test)
 {
@@ -165,7 +167,7 @@ static void xbt_test_log_free(void *log)
 /** @brief create test suite */
 xbt_test_suite_t xbt_test_suite_new(const char *name, const char *fmt, ...)
 {
-  xbt_test_suite_t suite = xbt_new0(struct s_xbt_test_suite, 1);
+  xbt_test_suite_t suite = xbt_new0(s_xbt_test_suite, 1);
   va_list ap;
 
   if (_xbt_test_suites == nullptr)
@@ -231,7 +233,7 @@ void xbt_test_suite_push(xbt_test_suite_t suite, const char *name, ts_test_cb_t
   xbt_assert(func);
   xbt_assert(fmt);
 
-  unit = xbt_new0(struct s_xbt_test_unit, 1);
+  unit = xbt_new0(s_xbt_test_unit, 1);
   va_start(ap, fmt);
   unit->title = bvprintf(fmt, ap);
   va_end(ap);
@@ -646,7 +648,7 @@ void _xbt_test_add(const char *file, int line, const char *fmt, ...)
   xbt_assert(unit);
 
   va_list ap;
-  xbt_test_test_t test = xbt_new0(struct s_xbt_test_test, 1);
+  xbt_test_test_t test = xbt_new0(s_xbt_test_test, 1);
   va_start(ap, fmt);
   test->title = bvprintf(fmt, ap);
   va_end(ap);
@@ -668,7 +670,7 @@ void _xbt_test_fail(const char *file, int line, const char *fmt, ...)
       "Test failed even before being declared (broken unit: %s)", unit->title);
 
   va_list ap;
-  xbt_test_log_t log = xbt_new(struct s_xbt_test_log, 1);
+  xbt_test_log_t log = xbt_new(s_xbt_test_log, 1);
   va_start(ap, fmt);
   log->text = bvprintf(fmt, ap);
   va_end(ap);
@@ -711,7 +713,7 @@ void _xbt_test_log(const char *file, int line, const char *fmt, ...)
       "Test logged into even before being declared (broken test unit: %s)", unit->title);
 
   va_list ap;
-  xbt_test_log_t log = xbt_new(struct s_xbt_test_log, 1);
+  xbt_test_log_t log = xbt_new(s_xbt_test_log, 1);
   va_start(ap, fmt);
   log->text = bvprintf(fmt, ap);
   va_end(ap);
index 16ad053..0bc60e6 100644 (file)
@@ -105,11 +105,13 @@ static simgrid::mc::Member* find_member(simgrid::mc::Type& type, const char* nam
 
 int some_local_variable = 0;
 
-typedef struct foo {int i;} s_foo;
+struct s_foo {
+  int i;
+};
 
 static void test_type_by_name(simgrid::mc::RemoteClient& process, s_foo my_foo)
 {
-  assert(process.binary_info->full_types_by_name.find("struct foo") != process.binary_info->full_types_by_name.end());
+  assert(process.binary_info->full_types_by_name.find("struct s_foo") != process.binary_info->full_types_by_name.end());
 }
 
 int main(int argc, char** argv)
index 3a57290..73c34da 100644 (file)
@@ -23,11 +23,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 /*  ==l1==  L2  ==L3==           */
 /*        ------                 */
 
-typedef enum {
-  MAXMIN,
-  LAGRANGE_RENO,
-  LAGRANGE_VEGAS
-} method_t;
+enum method_t { MAXMIN, LAGRANGE_RENO, LAGRANGE_VEGAS };
 
 static double dichotomy(double func(double), double min, double max, double min_error)
 {