Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove/cleanup/fix some #include
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 26 Feb 2016 12:36:50 +0000 (13:36 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 26 Feb 2016 13:20:48 +0000 (14:20 +0100)
34 files changed:
src/mc/ChunkedData.cpp
src/mc/DwarfExpression.hpp
src/mc/Frame.cpp
src/mc/LocationList.cpp
src/mc/ObjectInformation.cpp
src/mc/Process.cpp
src/mc/Process.hpp
src/mc/mc_base.cpp
src/mc/mc_checkpoint.cpp
src/mc/mc_client.cpp
src/mc/mc_client_api.cpp
src/mc/mc_global.cpp
src/mc/mc_liveness.cpp
src/mc/mc_liveness.h
src/mc/mc_member.cpp
src/mc/mc_mmalloc.h
src/mc/mc_mmu.h
src/mc/mc_record.cpp
src/mc/mc_record.h
src/mc/mc_request.cpp
src/mc/mc_request.h
src/mc/mc_safety.cpp
src/mc/mc_safety.h
src/mc/mc_smx.cpp
src/mc/mc_smx.h
src/mc/mc_snapshot.cpp
src/mc/mc_snapshot.h
src/mc/mc_state.cpp
src/mc/mc_state.h
src/mc/mc_unw.h
src/mc/mc_visited.cpp
src/mc/mc_xbt.cpp
src/mc/mc_xbt.hpp
tools/cmake/DefinePackages.cmake

index 8a5d334..cfacbfa 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <vector>
 
-#include <xbt/misc.h>
+#include <xbt/misc.h> // xbt_pagesize and friends
 #include <xbt/asserts.h>
 
 #include "src/mc/AddressSpace.hpp"
index 5063a44..6cb4fea 100644 (file)
@@ -10,7 +10,7 @@
 #include <cstdint>
 #include <cstdlib>
 
-#include <stdexcept>
+#include <stdexcept> // runtime_error
 #include <utility>
 #include <vector>
 
index 5a114d8..40f9ed3 100644 (file)
@@ -4,6 +4,10 @@
 /* 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 <libunwind.h>
+
+#include <xbt/sysdep.h>
+
 #include "src/mc/Frame.hpp"
 
 namespace simgrid {
@@ -13,7 +17,7 @@ void* Frame::frame_base(unw_cursor_t& unw_cursor) const
 {
   simgrid::dwarf::Location location = simgrid::dwarf::resolve(
                              frame_base_location, object_info,
-                             &unw_cursor, NULL, NULL, -1);
+                             &unw_cursor, nullptr, nullptr, -1);
   if (location.in_memory())
     return location.address();
   else if (location.in_register()) {
index aabcab5..2797bc0 100644 (file)
@@ -4,6 +4,15 @@
 /* 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 <cstddef>
+#include <cstdint>
+#include <utility>
+
+#include <xbt/asserts.h>
+#include <xbt/sysdep.h>
+
+#include <libunwind.h>
+
 #include "src/mc/mc_dwarf.hpp"
 #include "src/mc/ObjectInformation.hpp"
 #include "src/mc/LocationList.hpp"
index 6418c0a..43b3a1f 100644 (file)
@@ -4,6 +4,10 @@
 /* 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 <cstdint>
+
+#include <vector>
+
 #include "src/mc/Frame.hpp"
 #include "src/mc/ObjectInformation.hpp"
 #include "src/mc/Variable.hpp"
index 95187ee..cb39d09 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <assert.h>
 #include <stddef.h>
-#include <stdbool.h>
 #include <stdint.h>
 #include <errno.h>
 
index 6ecad0e..bb7194e 100644 (file)
@@ -7,16 +7,17 @@
 #ifndef SIMGRID_MC_PROCESS_H
 #define SIMGRID_MC_PROCESS_H
 
-#include <type_traits>
-
-#include <sys/types.h>
+#include <cstdint>
+#include <cstddef>
 
+#include <type_traits>
 #include <vector>
 #include <memory>
 
-#include "simgrid_config.h"
 #include <sys/types.h>
 
+#include <simgrid_config.h>
+
 #include <xbt/base.h>
 #include <xbt/mmalloc.h>
 
@@ -32,7 +33,6 @@
 
 #include "src/mc/mc_forward.hpp"
 #include "src/mc/mc_base.h"
-#include "src/mc/mc_mmalloc.h" // std_heap
 #include "src/mc/AddressSpace.hpp"
 #include "src/mc/mc_protocol.h"
 #include "src/mc/ObjectInformation.hpp"
index d7cf4eb..c5ec355 100644 (file)
@@ -4,13 +4,18 @@
 /* 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 <assert.h>
+#include <cassert>
+
+#include <simgrid_config.h>
+
+#include <xbt/log.h>
+#include <xbt/asserts.h>
+#include <xbt/dynar.h>
 
 #include <simgrid/simix.h>
 
 #include "src/mc/mc_base.h"
 #include "src/simix/smx_private.h"
-#include "src/mc/mc_record.h"
 #include "src/mc/mc_replay.h"
 #include "mc/mc.h"
 #include "src/mc/mc_protocol.h"
index 19fb550..990bf5a 100644 (file)
@@ -15,7 +15,6 @@
 #include "xbt/module.h"
 #include <xbt/mmalloc.h>
 #include "src/smpi/private.h"
-#include <alloca.h>
 
 #include "src/xbt/mmalloc/mmprivate.h"
 
index 07e65fb..733ecba 100644 (file)
@@ -19,7 +19,6 @@
 #include "src/mc/mc_client.h"
 
 // We won't need those once the separation MCer/MCed is complete:
-#include "src/mc/mc_mmalloc.h"
 #include "src/mc/mc_ignore.h"
 #include "src/mc/mc_private.h" // MC_deadlock_check()
 #include "src/mc/mc_smx.h"
index 9bbceb0..21a1db9 100644 (file)
@@ -11,7 +11,6 @@
 
 #include "src/mc/mc_record.h"
 #include "src/mc/mc_private.h"
-#include "src/mc/mc_mmalloc.h"
 #include "src/mc/mc_ignore.h"
 #include "src/mc/mc_protocol.h"
 #include "src/mc/mc_client.h"
index d692f5e..6b9b8e7 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "mc_base.h"
 
+#include "mc/mc.h"
+
 #ifndef _XBT_WIN32
 #include <unistd.h>
 #include <sys/wait.h>
@@ -20,6 +22,8 @@
 #include <xbt/fifo.h>
 #include <xbt/automaton.h>
 
+#include "src/simix/smx_process_private.h"
+
 #ifdef HAVE_MC
 #include <libunwind.h>
 #include "src/mc/mc_comm_pattern.h"
index bb3fadc..73995fa 100644 (file)
@@ -4,11 +4,17 @@
 /* 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 <cstring>
+
 #include <unistd.h>
 #include <sys/wait.h>
 
-#include <xbt/dynar.h>
 #include <xbt/automaton.h>
+#include <xbt/dynar.h>
+#include <xbt/fifo.h>
+#include <xbt/log.h>
+#include <xbt/parmap.h>
+#include <xbt/sysdep.h>
 
 #include "src/mc/mc_request.h"
 #include "src/mc/mc_liveness.h"
@@ -154,7 +160,7 @@ static int MC_automaton_evaluate_label(xbt_automaton_exp_label_t l,
       unsigned int cursor = 0;
       xbt_automaton_propositional_symbol_t p = NULL;
       xbt_dynar_foreach(_mc_property_automaton->propositional_symbols, cursor, p) {
-        if (strcmp(xbt_automaton_propositional_symbol_get_name(p), l->u.predicat) == 0)
+        if (std::strcmp(xbt_automaton_propositional_symbol_get_name(p), l->u.predicat) == 0)
           return (int) xbt_dynar_get_as(atomic_propositions_values, cursor, int);
       }
       return -1;
index f33cc54..72142a7 100644 (file)
@@ -10,6 +10,7 @@
 #include <stdint.h>
 
 #include <simgrid_config.h>
+#include <xbt/base.h>
 #include <xbt/fifo.h>
 #include <xbt/dynar.h>
 #include <xbt/automaton.h>
index e709912..a6f7e6d 100644 (file)
@@ -4,13 +4,10 @@
 /* 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 <xbt/misc.h>
-
 #include "src/mc/mc_private.h"
 #include "src/mc/Type.hpp"
 #include "src/mc/mc_dwarf.hpp"
 
-
 namespace simgrid {
 namespace dwarf {
 
index 9fe0968..e69de29 100644 (file)
@@ -1,37 +0,0 @@
-/* Copyright (c) 2007-2015. 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. */
-
-#ifndef SIMGRID_MC_MMALLOC_H
-#define SIMGRID_MC_MMALLOC_H
-
-#include <xbt/misc.h>
-#include <xbt/mmalloc.h>
-
-/** file
- *  Support for seperate heaps.
- *
- *  The possible memory modes for the modelchecker are standard and raw.
- *  Normally the system should operate in std, for switching to raw mode
- *  you must wrap the code between MC_SET_RAW_MODE and MC_UNSET_RAW_MODE.
- */
-
-SG_BEGIN_DECL()
-
-/* FIXME: Horrible hack! because the mmalloc library doesn't provide yet of */
-/* an API to query about the status of a heap, we simply call mmstats and */
-/* because I now how does structure looks like, then I redefine it here */
-
-/* struct mstats { */
-/*   size_t bytes_total;           /\* Total size of the heap. *\/ */
-/*   size_t chunks_used;           /\* Chunks allocated by the user. *\/ */
-/*   size_t bytes_used;            /\* Byte total of user-allocated chunks. *\/ */
-/*   size_t chunks_free;           /\* Chunks in the free list. *\/ */
-/*   size_t bytes_free;            /\* Byte total of chunks in the free list. *\/ */
-/* }; */
-
-SG_END_DECL()
-
-#endif
index 6968f7b..e0236e5 100644 (file)
@@ -7,8 +7,7 @@
 #ifndef SIMGRID_MC_MMU_H
 #define SIMGRID_MC_MMU_H
 
-#include <stdint.h>
-#include <stdbool.h>
+#include <cstdint>
 
 #include <xbt/asserts.h>
 #include <xbt/misc.h>
@@ -41,7 +40,7 @@ static inline __attribute__ ((always_inline))
 size_t mc_page_number(const void* base, const void* address)
 {
   xbt_assert(address>=base, "The address is not in the range");
-  return ((uintptr_t) address - (uintptr_t) base) >> xbt_pagebits;
+  return ((std::uintptr_t) address - (std::uintptr_t) base) >> xbt_pagebits;
 }
 
 /** @brief Get the offset of an address within a memory page
@@ -52,7 +51,7 @@ size_t mc_page_number(const void* base, const void* address)
 static inline __attribute__ ((always_inline))
 size_t mc_page_offset(const void* address)
 {
-  return ((uintptr_t) address) & (xbt_pagesize-1);
+  return ((std::uintptr_t) address) & (xbt_pagesize-1);
 }
 
 /** @brief Get the virtual address of a virtual memory page
@@ -69,7 +68,8 @@ void* mc_page_from_number(const void* base, size_t page)
 static inline __attribute__ ((always_inline))
 bool mc_same_page(const void* a, const void* b)
 {
-  return ((uintptr_t) a >> xbt_pagebits) == ((uintptr_t) b >> xbt_pagebits);
+  return ((std::uintptr_t) a >> xbt_pagebits)
+    == ((std::uintptr_t) b >> xbt_pagebits);
 }
 
 SG_END_DECL()
index 4541cef..9ac3ecb 100644 (file)
@@ -8,8 +8,14 @@
 #include <cstdio>
 #include <cstdlib>
 
+#include <xbt/log.h>
+#include <xbt/sysdep.h>
+
 #include "simgrid/simix.h"
 
+#include "src/simix/smx_private.h"
+#include "src/simix/smx_process_private.h"
+
 #include "src/mc/mc_replay.h"
 #include "src/mc/mc_record.h"
 #include "src/mc/mc_base.h"
index b050ee5..94f6040 100644 (file)
@@ -17,8 +17,6 @@
 #ifndef SIMGRID_MC_RECORD_H
 #define SIMGRID_MC_RECORD_H
 
-#include <stdbool.h>
-
 #include <xbt/base.h>
 
 SG_BEGIN_DECL()
index c77bc95..cee8330 100644 (file)
@@ -4,7 +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 <assert.h>
+#include <cassert>
+
+#include <xbt/log.h>
+#include <xbt/str.h>
+#include <xbt/sysdep.h>
+#include <xbt/dynar.h>
+#include <xbt/misc.h>
 
 #include "src/mc/mc_request.h"
 #include "src/mc/mc_safety.h"
index 55fa040..1ca589c 100644 (file)
@@ -9,8 +9,6 @@
 
 #include <xbt/base.h>
 
-#include <simgrid_config.h>
-
 #include "src/simix/smx_private.h"
 
 SG_BEGIN_DECL()
index 160fea3..4beb1d5 100644 (file)
@@ -4,7 +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 <assert.h>
+#include <cassert>
+
+#include <cstdio>
+
+#include <xbt/log.h>
+#include <xbt/fifo.h>
+#include <xbt/sysdep.h>
 
 #include "src/mc/mc_state.h"
 #include "src/mc/mc_request.h"
@@ -142,12 +148,12 @@ int MC_modelcheck_safety(void)
         );
 
         if (dot_output != NULL)
-          fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, next_state->num, req_str);
+          std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, next_state->num, req_str);
 
       } else {
 
         if (dot_output != NULL)
-          fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, visited_state->other_num == -1 ? visited_state->num : visited_state->other_num, req_str);
+          std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, visited_state->other_num == -1 ? visited_state->num : visited_state->other_num, req_str);
 
       }
 
index d6c907d..46c5ec9 100644 (file)
 #include <stdint.h>
 
 #include <simgrid_config.h>
+
 #include <xbt/base.h>
-#include <xbt/dict.h>
+#include <xbt/dynar.h>
+
 #include "src/mc/mc_forward.hpp"
 #include "src/mc/mc_state.h"
 
index c24b2ac..a9dfb37 100644 (file)
@@ -4,7 +4,7 @@
 /* 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 <assert.h>
+#include <cassert>
 
 #include <xbt/log.h>
 #include <xbt/string.hpp>
index 7de26cf..31fdaba 100644 (file)
@@ -9,7 +9,9 @@
 
 #include <stddef.h>
 
+#include <xbt/base.h>
 #include <xbt/log.h>
+
 #include <simgrid/simix.h>
 
 #include "src/smpi/private.h"
index fdcae06..aacc9d1 100644 (file)
@@ -4,7 +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 <stdbool.h>
+#include <cstddef>
+
+#include <memory>
+#include <utility>
+
+#include <xbt/asserts.h>
+#include <xbt/sysdep.h>
 
 #include "src/internal_config.h"
 #include "src/smpi/private.h"
index 47bfc14..45db54c 100644 (file)
@@ -7,23 +7,24 @@
 #ifndef SIMGRID_MC_SNAPSHOT_H
 #define SIMGRID_MC_SNAPSHOT_H
 
-#include <sys/types.h> // off_t
-#include <stdint.h> // size_t
+#include <cstdint>
+#include <cstddef>
 
 #include <vector>
 #include <set>
+#include <string>
 #include <memory>
 
+#include <sys/types.h> // off_t
+
 #include <simgrid_config.h>
 #include "src/xbt/mmalloc/mmprivate.h"
 #include <xbt/asserts.h>
-#include <xbt/dynar.h>
 #include <xbt/base.h>
 
 #include "src/mc/mc_forward.hpp"
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/PageStore.hpp"
-#include "src/mc/mc_mmalloc.h"
 #include "src/mc/AddressSpace.hpp"
 #include "src/mc/mc_unw.h"
 #include "src/mc/RegionSnapshot.hpp"
index 3720ff7..7786efd 100644 (file)
@@ -6,8 +6,11 @@
 
 #include <assert.h>
 
+#include <xbt/log.h>
+#include <xbt/sysdep.h>
+#include <xbt/fifo.h>
+
 #include "src/simix/smx_private.h"
-#include "xbt/fifo.h"
 #include "src/mc/mc_state.h"
 #include "src/mc/mc_request.h"
 #include "src/mc/mc_private.h"
index 8ab1b11..40c9a6e 100644 (file)
@@ -8,6 +8,7 @@
 #define SIMGRID_MC_STATE_H
 
 #include <xbt/base.h>
+#include <xbt/dynar.h>
 
 #include <simgrid_config.h>
 #include "src/simix/smx_private.h"
index 53982a0..3470bd8 100644 (file)
@@ -28,6 +28,8 @@
 
 #include <xbt/base.h>
 
+#include <libunwind.h>
+
 #include "src/mc/Process.hpp"
 
 SG_BEGIN_DECL()
index 7634c31..391f445 100644 (file)
@@ -7,6 +7,12 @@
 #include <unistd.h>
 #include <sys/wait.h>
 
+#include <xbt/automaton.h>
+#include <xbt/log.h>
+#include <xbt/sysdep.h>
+#include <xbt/dynar.h>
+#include <xbt/fifo.h>
+
 #include "src/mc/mc_comm_pattern.h"
 #include "src/mc/mc_safety.h"
 #include "src/mc/mc_liveness.h"
index 6c832f8..8a2ff91 100644 (file)
@@ -4,16 +4,19 @@
 /* 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 <xbt/sysdep.h>
+#include <cstddef>
 
+#include "src/mc/remote_ptr.hpp"
 #include "src/mc/AddressSpace.hpp"
 #include "src/mc/mc_xbt.hpp"
 
+#include <xbt/sysdep.h>
+
 namespace simgrid {
 namespace mc {
 
 void read_element(AddressSpace const& as,
-  void* local, remote_ptr<s_xbt_dynar_t> addr, size_t i, size_t len)
+  void* local, remote_ptr<s_xbt_dynar_t> addr, std::size_t i, std::size_t len)
 {
   s_xbt_dynar_t d;
   as.read_bytes(&d, sizeof(d), addr);
index e6dbd53..4640bff 100644 (file)
@@ -7,15 +7,18 @@
 #ifndef SIMGRID_MC_XBT_HPP
 #define SIMGRID_MC_XBT_HPP
 
+#include <cstddef>
+
 #include <xbt/base.h>
 
+#include "src/mc/remote_ptr.hpp"
 #include "src/mc/AddressSpace.hpp"
 
 namespace simgrid {
 namespace mc {
 
 XBT_PRIVATE void read_element(AddressSpace const& as,
-  void* local, remote_ptr<s_xbt_dynar_t> addr, size_t i, size_t len);
+  void* local, remote_ptr<s_xbt_dynar_t> addr, std::size_t i, std::size_t len);
 XBT_PRIVATE std::size_t read_length(
   AddressSpace const& as, remote_ptr<s_xbt_dynar_t> addr);
 
index 726c247..cc808af 100644 (file)
@@ -582,7 +582,6 @@ set(MC_SRC
   src/mc/mc_unw.h
   src/mc/mc_unw.cpp
   src/mc/mc_unw_vmread.cpp
-  src/mc/mc_mmalloc.h
   src/mc/mc_object_info.h
   src/mc/mc_checkpoint.cpp
   src/mc/mc_snapshot.h