Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sunday smell chase
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Sun, 26 Mar 2017 12:47:35 +0000 (14:47 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Sun, 26 Mar 2017 12:47:35 +0000 (14:47 +0200)
examples/s4u/actor-create/s4u_actor-create.cpp
include/xbt/base.h
include/xbt/matrix.h
include/xbt/strbuff.h
src/msg/msg_private.h
src/xbt/config.cpp
src/xbt/dict_private.h
src/xbt/heap_private.h
src/xbt/log.c
src/xbt/xbt_os_time.c

index f4146a5..a20f02e 100644 (file)
@@ -30,9 +30,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor_create, "The logging channel used in this
 class Sender {
 public:
   std::string msg = "GaBuZoMeu";
-  explicit Sender(){
-      /* Constructor used when no parameter is passed to the actor */
-  };
+  explicit Sender() = default;
   explicit Sender(std::vector<std::string> args)
   {
     /* This constructor is used when we pass parameters to the actor */
index 4ecf84e..de8f8ce 100644 (file)
 
 /* Define _GNU_SOURCE for getline, isfinite, etc. */
 #ifndef _GNU_SOURCE
-  #define _GNU_SOURCE
+#  define _GNU_SOURCE
 #endif
 
 // Teach the compiler that some code path is unreacheable:
 #if defined(__has_builtin)
-  #if __has_builtin(__builtin_unreachable)
-    #define XBT_UNREACHABLE() __builtin_unreachable()
-  #else
-    #include <stdlib.h>
-    #define XBT_UNREACHABLE() abort()
-  #endif
+#  if __has_builtin(__builtin_unreachable)
+#    define XBT_UNREACHABLE() __builtin_unreachable()
+#  else
+#    include <stdlib.h>
+#    define XBT_UNREACHABLE() abort()
+#  endif
 #elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-  #define XBT_UNREACHABLE() __builtin_unreachable()
+#  define XBT_UNREACHABLE() __builtin_unreachable()
 #else
-  #include <stdlib.h>
-  #define XBT_UNREACHABLE() abort()
+#  include <stdlib.h>
+#  define XBT_UNREACHABLE() abort()
 #endif
 
 /* On MinGW, stdio.h defines __MINGW_PRINTF_FORMAT and __MINGW_SCANF_FORMAT
    which are the suitable format style (either gnu_printf or ms_printf)
    depending on which version is available (__USE_MINGW_ANSI_STDIO): */
 #ifdef __MINGW32__
-  #include <stdio.h>
+#  include <stdio.h>
 
-  # define XBT_ATTRIB_PRINTF( format_idx, arg_idx )    \
+ define XBT_ATTRIB_PRINTF( format_idx, arg_idx )    \
      __attribute__((__format__ (__MINGW_PRINTF_FORMAT, format_idx, arg_idx)))
-  # define XBT_ATTRIB_SCANF( format_idx, arg_idx )     \
-         __attribute__((__MINGW_SCANF_FORMAT (__scanf__, format_idx, arg_idx)))
+ define XBT_ATTRIB_SCANF( format_idx, arg_idx )     \
+     __attribute__((__MINGW_SCANF_FORMAT (__scanf__, format_idx, arg_idx)))
 #else
-  # define XBT_ATTRIB_PRINTF( format_idx, arg_idx )    \
+ define XBT_ATTRIB_PRINTF( format_idx, arg_idx )    \
      __attribute__((__format__ (__printf__, format_idx, arg_idx)))
-  # define XBT_ATTRIB_SCANF( format_idx, arg_idx )     \
-         __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
+ define XBT_ATTRIB_SCANF( format_idx, arg_idx )     \
+     __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
 #endif
 
-# define XBT_ATTRIB_NORETURN __attribute__((__noreturn__))
-# define XBT_ATTRIB_UNUSED  __attribute__((__unused__))
-# define XBT_ATTRIB_DEPRECATED(m)  __attribute__((__deprecated__(m)))
+#define XBT_ATTRIB_NORETURN __attribute__((__noreturn__))
+#define XBT_ATTRIB_UNUSED  __attribute__((__unused__))
+#define XBT_ATTRIB_DEPRECATED(m)  __attribute__((__deprecated__(m)))
 
 /* Constructor priorities exist since gcc 4.3.  Apparently, they are however not
  * supported on Macs. */
-# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__APPLE__)
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__APPLE__)
 #  define _XBT_GNUC_CONSTRUCTOR(prio) __attribute__((__constructor__ (prio)))
 #  define _XBT_GNUC_DESTRUCTOR(prio) __attribute__((__destructor__ (prio)))
-# else
+#else
 #  define _XBT_GNUC_CONSTRUCTOR(prio) __attribute__((__constructor__))
 #  define _XBT_GNUC_DESTRUCTOR(prio) __attribute__((__destructor__))
-# endif
+#endif
 
 #if defined(__GNUC__)
-#   define XBT_ALWAYS_INLINE inline __attribute__ ((always_inline))
+#  define XBT_ALWAYS_INLINE inline __attribute__ ((always_inline))
 #else
-#   define XBT_ALWAYS_INLINE inline
+#  define XBT_ALWAYS_INLINE inline
 #endif
 
 #if defined(__GNUC__)
-#   define XBT_THREAD_LOCAL __thread
+#  define XBT_THREAD_LOCAL __thread
 #else
-#   define XBT_THREAD_LOCAL No thread local on this architecture
+#  define XBT_THREAD_LOCAL No thread local on this architecture
 #endif
 
 /* improvable on gcc (by evaluating arguments only once), but wouldn't be portable */
 #ifdef MIN
-# undef MIN
+#  undef MIN
 #endif
 #define MIN(a,b) ((a)<(b)?(a):(b))
 
 #ifdef MAX
-# undef MAX
+#  undef MAX
 #endif
 #define MAX(a,b) ((a)>(b)?(a):(b))
 
index 55363e2..f6ae73f 100644 (file)
@@ -20,8 +20,8 @@ typedef struct {
 
   char *data;
   void_f_pvoid_t free_f;
-} s_xbt_matrix_t, *xbt_matrix_t;
-
+} s_xbt_matrix_t;
+typedef s_xbt_matrix_t* xbt_matrix_t;
 
   /** @brief Retrieve the address of a cell (not its content)
    *  @hideinitializer */
index 585d719..cc7aaa5 100644 (file)
@@ -29,15 +29,15 @@ SG_BEGIN_DECL()
  */
 
 /** @brief Buffer data container **/
-struct xbt_strbuff {
+typedef struct xbt_strbuff {
   char *data;
-  int used, size;
-};
-typedef struct xbt_strbuff  s_xbt_strbuff_t;
-typedef struct xbt_strbuff* xbt_strbuff_t;
+  int used;
+  int size;
+} s_xbt_strbuff_t;
+typedef s_xbt_strbuff_t* xbt_strbuff_t;
 
 XBT_PUBLIC(void) xbt_strbuff_clear(xbt_strbuff_t b);
-XBT_PUBLIC(xbt_strbuff_t) xbt_strbuff_new(void);
+XBT_PUBLIC(xbt_strbuff_t) xbt_strbuff_new();
 XBT_PUBLIC(xbt_strbuff_t) xbt_strbuff_new_from(const char *s);
 XBT_PUBLIC(void) xbt_strbuff_free(xbt_strbuff_t b);
 XBT_PUBLIC(void) xbt_strbuff_free_container(xbt_strbuff_t b);
index add80f2..008bf98 100644 (file)
@@ -90,7 +90,8 @@ typedef struct process_arg {
   int argc;
   char **argv;
   double kill_time;
-} s_process_arg_t, *process_arg_t;
+} s_process_arg_t;
+typedef s_process_arg_t* process_arg_t;
 
 typedef struct msg_comm {
   smx_activity_t s_comm;          /* SIMIX communication object encapsulated (the same for both processes) */
@@ -105,7 +106,8 @@ typedef struct MSG_Global {
   unsigned long int 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, *MSG_Global_t;
+} s_MSG_Global_t;
+typedef s_MSG_Global_t* MSG_Global_t;
 
 SG_BEGIN_DECL()
 
index 539ba59..bbbbf29 100644 (file)
@@ -39,7 +39,7 @@ extern "C" {
 namespace simgrid {
 namespace config {
 
-missing_key_error::~missing_key_error() {}
+missing_key_error::~missing_key_error() = default;
 
 class Config;
 
index 9b5087f..98f4adb 100644 (file)
@@ -24,7 +24,8 @@ SG_BEGIN_DECL()
 typedef struct s_xbt_het_dictelm {
   s_xbt_dictelm_t element;
   void_f_pvoid_t free_f;
-} s_xbt_het_dictelm_t, *xbt_het_dictelm_t;
+} s_xbt_het_dictelm_t;
+typedef s_xbt_het_dictelm_t* xbt_het_dictelm_t;
 
 typedef struct s_xbt_dict {
   void_f_pvoid_t free_f;
index 5c0d12a..aeed373 100644 (file)
@@ -13,7 +13,8 @@
 typedef struct xbt_heap_item {
   void *content;
   double key;
-} s_xbt_heap_item_t, *xbt_heap_item_t;
+} s_xbt_heap_item_t;
+typedef s_xbt_heap_item_t* xbt_heap_item_t;
 
 typedef struct xbt_heap {
   int size;
index c8659e0..e9ed472 100644 (file)
@@ -41,7 +41,9 @@ typedef struct {
   e_xbt_log_priority_t thresh;
   int additivity;
   xbt_log_appender_t appender;
-} s_xbt_log_setting_t, *xbt_log_setting_t;
+} s_xbt_log_setting_t;
+
+typedef s_xbt_log_setting_t* xbt_log_setting_t;
 
 static xbt_dynar_t xbt_log_settings = NULL;
 
index fa6fc2b..0e8951f 100644 (file)
@@ -92,15 +92,22 @@ void xbt_os_sleep(double sec)
  */
 struct s_xbt_os_timer {
 #if HAVE_POSIX_GETTIME
-  struct timespec start, stop, elapse;
+  struct timespec start;
+  struct timespec stop;
+  struct timespec elapse;
 #elif HAVE_GETTIMEOFDAY || defined(_WIN32)
-  struct timeval start, stop, elapse;
+  struct timeval start;
+  struct timeval stop;
+  struct timeval elapse;
 #else
-  unsigned long int start, stop, elapse;
+  unsigned long int start;
+  unsigned long int stop;
+  unsigned long int elapse;
 #endif
 };
 
-size_t xbt_os_timer_size(void){
+size_t xbt_os_timer_size(void)
+{
   return sizeof(struct s_xbt_os_timer);
 }