From: Gabriel Corona Date: Fri, 26 Feb 2016 14:13:38 +0000 (+0100) Subject: Remove/cleanup/fix #include X-Git-Tag: v3_13~647^2~10 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/740d50812a81c59013f22888ab313da5a8113227 Remove/cleanup/fix #include --- diff --git a/src/mc/AddressSpace.hpp b/src/mc/AddressSpace.hpp index 8d370bd502..0ff146ac86 100644 --- a/src/mc/AddressSpace.hpp +++ b/src/mc/AddressSpace.hpp @@ -11,8 +11,6 @@ #include #include -#include - #include "src/mc/mc_forward.hpp" #include "src/mc/remote_ptr.hpp" diff --git a/src/mc/Process.cpp b/src/mc/Process.cpp index 9fa3ba4205..482c07d1a3 100644 --- a/src/mc/Process.cpp +++ b/src/mc/Process.cpp @@ -24,6 +24,9 @@ #include #include +#include +#include +#include #include #include "src/mc/mc_object_info.h" diff --git a/src/mc/Process.hpp b/src/mc/Process.hpp index bb7194ef8b..4ab4e06ef9 100644 --- a/src/mc/Process.hpp +++ b/src/mc/Process.hpp @@ -19,6 +19,7 @@ #include #include +#include #include #ifdef HAVE_MC @@ -50,14 +51,14 @@ namespace mc { struct IgnoredRegion { std::uint64_t addr; - size_t size; + std::size_t size; }; struct IgnoredHeapRegion { int block; int fragment; void *address; - size_t size; + std::size_t size; }; /** Representation of a process diff --git a/src/mc/RegionSnapshot.cpp b/src/mc/RegionSnapshot.cpp index 8a8c370be4..7e96951979 100644 --- a/src/mc/RegionSnapshot.cpp +++ b/src/mc/RegionSnapshot.cpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include #include "mc/mc.h" @@ -41,7 +43,7 @@ void data_deleter::operator()(void* p) const { switch(type_) { case Free: - free(p); + std::free(p); break; case Munmap: munmap(p, size_); @@ -55,7 +57,7 @@ RegionSnapshot dense_region( { simgrid::mc::RegionSnapshot::flat_data_ptr data; if (!_sg_mc_ksm) - data = simgrid::mc::RegionSnapshot::flat_data_ptr((char*) malloc(size)); + data = simgrid::mc::RegionSnapshot::flat_data_ptr((char*) std::malloc(size)); else { char* ptr = (char*) mmap(nullptr, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE, -1, 0); if (ptr == MAP_FAILED) diff --git a/src/mc/RegionSnapshot.hpp b/src/mc/RegionSnapshot.hpp index 1ece645c94..a0031910ec 100644 --- a/src/mc/RegionSnapshot.hpp +++ b/src/mc/RegionSnapshot.hpp @@ -10,8 +10,12 @@ #include #include +#include +#include + #include +#include "src/mc/remote_ptr.hpp" #include "src/mc/PageStore.hpp" #include "src/mc/AddressSpace.hpp" #include "src/mc/ChunkedData.hpp" diff --git a/src/mc/Type.hpp b/src/mc/Type.hpp index f94d944291..5839a3b89b 100644 --- a/src/mc/Type.hpp +++ b/src/mc/Type.hpp @@ -7,10 +7,15 @@ #ifndef SIMGRID_MC_TYPE_HPP #define SIMGRID_MC_TYPE_HPP +#include + #include #include #include +#include + +#include #include "src/mc/mc_forward.h" #include "src/mc/LocationList.hpp" diff --git a/src/mc/Variable.hpp b/src/mc/Variable.hpp index 5b82b6cebd..7e04621a49 100644 --- a/src/mc/Variable.hpp +++ b/src/mc/Variable.hpp @@ -7,9 +7,9 @@ #ifndef SIMGRID_MC_VARIABLE_HPP #define SIMGRID_MC_VARIABLE_HPP -#include +#include -#include +#include #include "src/mc/mc_forward.h" #include "src/mc/LocationList.hpp" @@ -29,7 +29,7 @@ public: // Use either of: simgrid::dwarf::LocationList location_list; void* address = nullptr; - size_t start_scope = 0; + std::size_t start_scope = 0; simgrid::mc::ObjectInformation* object_info = nullptr; }; diff --git a/src/mc/mc_client.h b/src/mc/mc_client.h index 6b68dbe45d..fb12858964 100644 --- a/src/mc/mc_client.h +++ b/src/mc/mc_client.h @@ -7,7 +7,9 @@ #ifndef SIMGRID_MC_CLIENT_H #define SIMGRID_MC_CLIENT_H -#include +#include + +#include #include "src/mc/mc_protocol.h" SG_BEGIN_DECL() @@ -21,11 +23,11 @@ extern XBT_PRIVATE mc_client_t mc_client; XBT_PRIVATE void MC_client_init(void); XBT_PRIVATE void MC_client_handle_messages(void); -XBT_PRIVATE void MC_client_send_message(void* message, size_t size); +XBT_PRIVATE void MC_client_send_message(void* message, std::size_t size); XBT_PRIVATE void MC_client_send_simple_message(e_mc_message_type type); #ifdef HAVE_MC -void MC_ignore(void* addr, size_t size); +void MC_ignore(void* addr, std::size_t size); #endif void MC_client_main_loop(void); diff --git a/src/mc/mc_comm_determinism.cpp b/src/mc/mc_comm_determinism.cpp index 9b98b74257..1be100a433 100644 --- a/src/mc/mc_comm_determinism.cpp +++ b/src/mc/mc_comm_determinism.cpp @@ -4,6 +4,13 @@ /* 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. */ +#include + +#include +#include +#include +#include + #include "src/mc/mc_state.h" #include "src/mc/mc_comm_pattern.h" #include "src/mc/mc_request.h" diff --git a/src/mc/mc_dwarf.hpp b/src/mc/mc_dwarf.hpp index 85c7641e7b..62fb9a18a9 100644 --- a/src/mc/mc_dwarf.hpp +++ b/src/mc/mc_dwarf.hpp @@ -11,6 +11,7 @@ #include +#include #include #define DW_LANG_Objc DW_LANG_ObjC /* fix spelling error in older dwarf.h */ diff --git a/src/mc/mc_hash.cpp b/src/mc/mc_hash.cpp index b260507326..72dd93cfac 100644 --- a/src/mc/mc_hash.cpp +++ b/src/mc/mc_hash.cpp @@ -8,7 +8,10 @@ #include +#include + #include "src/mc/mc_private.h" +#include "src/mc/mc_snapshot.h" #include "mc/datatypes.h" #include "src/mc/mc_hash.hpp" #include diff --git a/src/mc/mc_hash.hpp b/src/mc/mc_hash.hpp index 767fcc062c..68a408a98c 100644 --- a/src/mc/mc_hash.hpp +++ b/src/mc/mc_hash.hpp @@ -8,10 +8,10 @@ #define SIMGRID_MC_HASH_HPP #include -#include -#include "xbt/misc.h" -#include "src/mc/mc_snapshot.h" +#include + +#include "src/mc/mc_forward.hpp" namespace simgrid { namespace mc { diff --git a/src/mc/mc_ignore.h b/src/mc/mc_ignore.h index 4824094415..ba91c35914 100644 --- a/src/mc/mc_ignore.h +++ b/src/mc/mc_ignore.h @@ -7,13 +7,9 @@ #ifndef SIMGRID_MC_IGNORE_H #define SIMGRID_MC_IGNORE_H +#include /* SG_BEGIN_DECL */ #include -#include "mc/datatypes.h" -#include "src/mc/Process.hpp" - -#include "xbt/misc.h" /* SG_BEGIN_DECL */ - SG_BEGIN_DECL(); XBT_PRIVATE xbt_dynar_t MC_checkpoint_ignore_new(void); diff --git a/src/mc/mc_memory.cpp b/src/mc/mc_memory.cpp index 7cc36bd612..3df9bbe2bf 100644 --- a/src/mc/mc_memory.cpp +++ b/src/mc/mc_memory.cpp @@ -8,8 +8,6 @@ #include #include "xbt/log.h" -#include "xbt/dynar.h" -#include "xbt/virtu.h" #include "mc/mc.h" #include "src/mc/mc_private.h" diff --git a/src/mc/mc_mmu.h b/src/mc/mc_mmu.h index e0236e56dd..50b83dd430 100644 --- a/src/mc/mc_mmu.h +++ b/src/mc/mc_mmu.h @@ -8,8 +8,10 @@ #define SIMGRID_MC_MMU_H #include +#include #include +#include // xbt_pagesize... #include #include diff --git a/src/mc/mc_pair.cpp b/src/mc/mc_pair.cpp index 21208f3454..afed72aa13 100644 --- a/src/mc/mc_pair.cpp +++ b/src/mc/mc_pair.cpp @@ -4,6 +4,9 @@ /* 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. */ +#include +#include + #include "src/mc/mc_liveness.h" #include "src/mc/mc_private.h" diff --git a/src/mc/mc_protocol.h b/src/mc/mc_protocol.h index 5858f5479c..bd6fd13538 100644 --- a/src/mc/mc_protocol.h +++ b/src/mc/mc_protocol.h @@ -9,7 +9,7 @@ #include -#include +#include #include "mc/datatypes.h" diff --git a/src/mc/mc_record.cpp b/src/mc/mc_record.cpp index 9ac3ecb536..f0ff676b31 100644 --- a/src/mc/mc_record.cpp +++ b/src/mc/mc_record.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include diff --git a/src/mc/mc_record.h b/src/mc/mc_record.h index 94f6040c81..17493f04a4 100644 --- a/src/mc/mc_record.h +++ b/src/mc/mc_record.h @@ -18,6 +18,8 @@ #define SIMGRID_MC_RECORD_H #include +#include +#include SG_BEGIN_DECL() diff --git a/src/mc/mc_replay.h b/src/mc/mc_replay.h index 5dc957ae9c..cfd41a63db 100644 --- a/src/mc/mc_replay.h +++ b/src/mc/mc_replay.h @@ -9,7 +9,7 @@ #ifndef SIMGRID_MC_REPLAY_H #define SIMGRID_MC_REPLAY_H -#include +#include SG_BEGIN_DECL() diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index c0708c4a2c..c52a33c5b9 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include "src/mc/mc_request.h" #include "src/mc/mc_safety.h" diff --git a/src/mc/mc_safety.cpp b/src/mc/mc_safety.cpp index f25f11c37d..594cb71a0a 100644 --- a/src/mc/mc_safety.cpp +++ b/src/mc/mc_safety.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include diff --git a/src/mc/mc_smx.cpp b/src/mc/mc_smx.cpp index 9abf26bcda..205fcf7ed3 100644 --- a/src/mc/mc_smx.cpp +++ b/src/mc/mc_smx.cpp @@ -5,14 +5,17 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include +#include #include -#include +#include +#include +#include #include "src/simix/smx_private.h" #include "src/mc/mc_smx.h" -#include "ModelChecker.hpp" +#include "src/mc/ModelChecker.hpp" using simgrid::mc::remote; @@ -22,7 +25,7 @@ static void MC_smx_process_info_clear(mc_smx_process_info_t p) { p->hostname = nullptr; - free(p->name); + std::free(p->name); p->name = nullptr; } diff --git a/src/mc/mc_smx.h b/src/mc/mc_smx.h index 31fdaba5f3..3ca4e5d3b8 100644 --- a/src/mc/mc_smx.h +++ b/src/mc/mc_smx.h @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/src/mc/mc_xbt.cpp b/src/mc/mc_xbt.cpp index 8a2ff912f1..bfdd15619b 100644 --- a/src/mc/mc_xbt.cpp +++ b/src/mc/mc_xbt.cpp @@ -10,6 +10,7 @@ #include "src/mc/AddressSpace.hpp" #include "src/mc/mc_xbt.hpp" +#include #include namespace simgrid { diff --git a/src/mc/mc_xbt.hpp b/src/mc/mc_xbt.hpp index 4640bfff9e..cc23b1aca0 100644 --- a/src/mc/mc_xbt.hpp +++ b/src/mc/mc_xbt.hpp @@ -9,7 +9,7 @@ #include -#include +#include #include "src/mc/remote_ptr.hpp" #include "src/mc/AddressSpace.hpp" diff --git a/src/mc/simgrid_mc.cpp b/src/mc/simgrid_mc.cpp index a0e727231b..8b7962b275 100644 --- a/src/mc/simgrid_mc.cpp +++ b/src/mc/simgrid_mc.cpp @@ -27,6 +27,7 @@ #endif #include +#include #include #include "simgrid/sg_config.h"