Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prefer C++ headers, and C++-style void-arg declarations.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 5 Oct 2020 19:54:35 +0000 (21:54 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 5 Oct 2020 21:21:55 +0000 (23:21 +0200)
Clang-tidy enabled checks:
    modernize-deprecated-headers
    modernize-redundant-void-arg

13 files changed:
examples/smpi/smpi_s4u_masterworker/masterworker_mailbox_smpi.cpp
src/kernel/resource/profile/DatedValue.cpp
src/mc/mc_private.hpp
src/mc/mc_smx.hpp
src/mc/remote/CheckerSide.cpp
src/simix/popping_private.hpp
src/smpi/colls/smpi_mvapich2_selector_stampede.hpp
src/xbt/log.cpp
src/xbt/xbt_os_file.cpp
teshsuite/s4u/actor-suspend/actor-suspend.cpp
teshsuite/s4u/comm-get-sender/comm-get-sender.cpp
teshsuite/s4u/evaluate-get-route-time/evaluate-get-route-time.cpp
teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp

index 901e286..76afde3 100644 (file)
@@ -6,7 +6,7 @@
 #include "mpi.h"
 #include "simgrid/s4u.hpp"
 
-#include <stdio.h> /* snprintf */
+#include <cstdio> /* snprintf */
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
index 88fac59..68955de 100644 (file)
@@ -4,7 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/resource/profile/DatedValue.hpp"
-#include <math.h>
+#include <cmath>
 
 namespace simgrid {
 namespace kernel {
index c89997c..d8455b9 100644 (file)
@@ -30,7 +30,7 @@ XBT_PRIVATE void MC_init_dot_output();
 
 XBT_PRIVATE extern FILE* dot_output;
 
-XBT_PRIVATE void MC_show_deadlock(void);
+XBT_PRIVATE void MC_show_deadlock();
 
 /********************************** Miscellaneous **********************************/
 namespace simgrid {
index 524c581..2c00bd3 100644 (file)
@@ -42,6 +42,6 @@ XBT_PRIVATE smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall const* req);
 XBT_PRIVATE const char* MC_smx_actor_get_name(smx_actor_t p);
 XBT_PRIVATE const char* MC_smx_actor_get_host_name(smx_actor_t p);
 
-XBT_PRIVATE unsigned long MC_smx_get_maxpid(void);
+XBT_PRIVATE unsigned long MC_smx_get_maxpid();
 
 #endif
index 1aa3fe2..36caac8 100644 (file)
@@ -4,7 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/mc/remote/CheckerSide.hpp"
-#include <signal.h>
+#include <csignal>
 #include <sys/wait.h>
 
 namespace simgrid {
index 83e7c00..4b3ad06 100644 (file)
@@ -19,7 +19,7 @@ XBT_PUBLIC_DATA const char* 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)(void); // Hide the ugliness
+typedef void (*FPtr)(); // Hide the ugliness
 
 /* Pack all possible scalar types in an union */
 union u_smx_scalar {
index 8b3928c..c385b97 100644 (file)
@@ -16,7 +16,7 @@
 
 #define MV2_MAX_NB_THRESHOLDS 32
 
-XBT_PUBLIC void smpi_coll_cleanup_mvapich2(void);
+XBT_PUBLIC void smpi_coll_cleanup_mvapich2();
 
 struct mv2_alltoall_tuning_element {
   int min;
index 5b16eff..ae51917 100644 (file)
@@ -76,8 +76,8 @@ void xbt_log_preinit(void)
   log_cat_init_mutex                   = new std::recursive_mutex();
 }
 
-static void xbt_log_help(void);
-static void xbt_log_help_categories(void);
+static void xbt_log_help();
+static void xbt_log_help_categories();
 
 /** @brief Get all logging settings from the command line
  *
@@ -545,7 +545,7 @@ void xbt_log_additivity_set(xbt_log_category_t cat, int additivity)
   cat->additivity = additivity;
 }
 
-static void xbt_log_help(void)
+static void xbt_log_help()
 {
   XBT_HELP(
       "Description of the logging output:\n"
@@ -637,7 +637,7 @@ static void xbt_log_help_categories_rec(xbt_log_category_t category, const std::
   }
 }
 
-static void xbt_log_help_categories(void)
+static void xbt_log_help_categories()
 {
   XBT_HELP("Current log category hierarchy:");
   xbt_log_help_categories_rec(&_XBT_LOGV(XBT_LOG_ROOT_CAT), "   ");
index 713009e..4316ee4 100644 (file)
@@ -17,8 +17,8 @@
 #include <unistd.h>
 #endif
 
+#include <cerrno>
 #include <cstring>
-#include <errno.h>
 #include <libgen.h> /* POSIX dirname */
 
 simgrid::xbt::Path::Path()
index 14bf657..e157191 100644 (file)
@@ -6,10 +6,10 @@
 // This is the MWE of https://framagit.org/simgrid/simgrid/-/issues/50
 // The problem was occurring when suspending an actor that will be executed later in the same scheduling round
 
+#include <cstdio>
+#include <cstdlib>
 #include <iostream>
 #include <simgrid/s4u.hpp>
-#include <stdio.h>
-#include <stdlib.h>
 #include <vector>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(mwe, "Minimum Working Example");
index 043223b..28e7e71 100644 (file)
@@ -5,7 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u.hpp"
-#include <float.h>
+#include <cfloat>
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific to this example");
 
 static void sender_fun()
index 0367a74..fefe8e1 100644 (file)
@@ -14,7 +14,7 @@ done
 #include "simgrid/s4u.hpp"
 #include "xbt/random.hpp"
 #include "xbt/xbt_os_time.h"
-#include <stdio.h>
+#include <cstdio>
 
 int main(int argc, char** argv)
 {
index cebfa6c..5f1665e 100644 (file)
@@ -5,7 +5,7 @@
 
 // teshsuite/s4u/evaluate-parse-time/evaluate-parse-time examples/platforms/g5k.xml
 
-#include <stdio.h>
+#include <cstdio>
 
 #include "simgrid/s4u/Engine.hpp"
 #include "xbt/xbt_os_time.h"