X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b3b356352e87ae00a20f737c48e19b0c8413455a..1d95145df4657e19b9a02db53de4c9f758a0c6f5:/src/mc/mc_mmu.h diff --git a/src/mc/mc_mmu.h b/src/mc/mc_mmu.h index 6968f7bd38..e0236e56dd 100644 --- a/src/mc/mc_mmu.h +++ b/src/mc/mc_mmu.h @@ -7,8 +7,7 @@ #ifndef SIMGRID_MC_MMU_H #define SIMGRID_MC_MMU_H -#include -#include +#include #include #include @@ -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()