From 3344890b7ae11302d717d964e6dd96fe2d10ac6a Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 5 Oct 2020 21:54:35 +0200 Subject: [PATCH] Prefer C++ headers, and C++-style void-arg declarations. Clang-tidy enabled checks: modernize-deprecated-headers modernize-redundant-void-arg --- .../smpi_s4u_masterworker/masterworker_mailbox_smpi.cpp | 2 +- src/kernel/resource/profile/DatedValue.cpp | 2 +- src/mc/mc_private.hpp | 2 +- src/mc/mc_smx.hpp | 2 +- src/mc/remote/CheckerSide.cpp | 2 +- src/simix/popping_private.hpp | 2 +- src/smpi/colls/smpi_mvapich2_selector_stampede.hpp | 2 +- src/xbt/log.cpp | 8 ++++---- src/xbt/xbt_os_file.cpp | 2 +- teshsuite/s4u/actor-suspend/actor-suspend.cpp | 4 ++-- teshsuite/s4u/comm-get-sender/comm-get-sender.cpp | 2 +- .../evaluate-get-route-time/evaluate-get-route-time.cpp | 2 +- teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/smpi/smpi_s4u_masterworker/masterworker_mailbox_smpi.cpp b/examples/smpi/smpi_s4u_masterworker/masterworker_mailbox_smpi.cpp index 901e2860ee..76afde33f8 100644 --- a/examples/smpi/smpi_s4u_masterworker/masterworker_mailbox_smpi.cpp +++ b/examples/smpi/smpi_s4u_masterworker/masterworker_mailbox_smpi.cpp @@ -6,7 +6,7 @@ #include "mpi.h" #include "simgrid/s4u.hpp" -#include /* snprintf */ +#include /* snprintf */ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); diff --git a/src/kernel/resource/profile/DatedValue.cpp b/src/kernel/resource/profile/DatedValue.cpp index 88fac59b9a..68955de29b 100644 --- a/src/kernel/resource/profile/DatedValue.cpp +++ b/src/kernel/resource/profile/DatedValue.cpp @@ -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 +#include namespace simgrid { namespace kernel { diff --git a/src/mc/mc_private.hpp b/src/mc/mc_private.hpp index c89997cb0a..d8455b9b75 100644 --- a/src/mc/mc_private.hpp +++ b/src/mc/mc_private.hpp @@ -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 { diff --git a/src/mc/mc_smx.hpp b/src/mc/mc_smx.hpp index 524c581cba..2c00bd3085 100644 --- a/src/mc/mc_smx.hpp +++ b/src/mc/mc_smx.hpp @@ -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 diff --git a/src/mc/remote/CheckerSide.cpp b/src/mc/remote/CheckerSide.cpp index 1aa3fe298e..36caac8599 100644 --- a/src/mc/remote/CheckerSide.cpp +++ b/src/mc/remote/CheckerSide.cpp @@ -4,7 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/mc/remote/CheckerSide.hpp" -#include +#include #include namespace simgrid { diff --git a/src/simix/popping_private.hpp b/src/simix/popping_private.hpp index 83e7c00935..4b3ad069ee 100644 --- a/src/simix/popping_private.hpp +++ b/src/simix/popping_private.hpp @@ -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 { diff --git a/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp b/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp index 8b3928c0d7..c385b979af 100644 --- a/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp +++ b/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp @@ -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; diff --git a/src/xbt/log.cpp b/src/xbt/log.cpp index 5b16eff25b..ae51917ec5 100644 --- a/src/xbt/log.cpp +++ b/src/xbt/log.cpp @@ -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), " "); diff --git a/src/xbt/xbt_os_file.cpp b/src/xbt/xbt_os_file.cpp index 713009edb6..4316ee4367 100644 --- a/src/xbt/xbt_os_file.cpp +++ b/src/xbt/xbt_os_file.cpp @@ -17,8 +17,8 @@ #include #endif +#include #include -#include #include /* POSIX dirname */ simgrid::xbt::Path::Path() diff --git a/teshsuite/s4u/actor-suspend/actor-suspend.cpp b/teshsuite/s4u/actor-suspend/actor-suspend.cpp index 14bf657f9b..e157191735 100644 --- a/teshsuite/s4u/actor-suspend/actor-suspend.cpp +++ b/teshsuite/s4u/actor-suspend/actor-suspend.cpp @@ -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 +#include #include #include -#include -#include #include XBT_LOG_NEW_DEFAULT_CATEGORY(mwe, "Minimum Working Example"); diff --git a/teshsuite/s4u/comm-get-sender/comm-get-sender.cpp b/teshsuite/s4u/comm-get-sender/comm-get-sender.cpp index 043223ba55..28e7e71155 100644 --- a/teshsuite/s4u/comm-get-sender/comm-get-sender.cpp +++ b/teshsuite/s4u/comm-get-sender/comm-get-sender.cpp @@ -5,7 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "simgrid/s4u.hpp" -#include +#include XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific to this example"); static void sender_fun() diff --git a/teshsuite/s4u/evaluate-get-route-time/evaluate-get-route-time.cpp b/teshsuite/s4u/evaluate-get-route-time/evaluate-get-route-time.cpp index 0367a741c4..fefe8e1ee8 100644 --- a/teshsuite/s4u/evaluate-get-route-time/evaluate-get-route-time.cpp +++ b/teshsuite/s4u/evaluate-get-route-time/evaluate-get-route-time.cpp @@ -14,7 +14,7 @@ done #include "simgrid/s4u.hpp" #include "xbt/random.hpp" #include "xbt/xbt_os_time.h" -#include +#include int main(int argc, char** argv) { diff --git a/teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp b/teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp index cebfa6c71c..5f1665e286 100644 --- a/teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp +++ b/teshsuite/s4u/evaluate-parse-time/evaluate-parse-time.cpp @@ -5,7 +5,7 @@ // teshsuite/s4u/evaluate-parse-time/evaluate-parse-time examples/platforms/g5k.xml -#include +#include #include "simgrid/s4u/Engine.hpp" #include "xbt/xbt_os_time.h" -- 2.20.1