X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e86b9249c03f07996e386a45add92857c9853963..759b677627770c75dbd000ca81c6441b2452c1a5:/src/mc/mc_compare.cpp diff --git a/src/mc/mc_compare.cpp b/src/mc/mc_compare.cpp index 5a7c634617..8d0f597204 100644 --- a/src/mc/mc_compare.cpp +++ b/src/mc/mc_compare.cpp @@ -4,6 +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. */ +#define __STDC_FORMAT_MACROS #include #include @@ -29,9 +30,10 @@ typedef struct s_pointers_pair { namespace boost { template<> struct hash { - typedef uint64_t result_type; + typedef uintptr_t result_type; result_type operator()(s_pointers_pair const& x) const { - return (result_type) x.p1 ^ (result_type) x.p2 << 8; + return (result_type) x.p1 ^ + ((result_type) x.p2 << 8 | (result_type) x.p2 >> (8*sizeof(uintptr_t) - 8)); } }; } @@ -245,6 +247,7 @@ static int compare_global_variables(int region_type, mc_mem_region_t r1, mc_mem_region_t r2, mc_snapshot_t snapshot1, mc_snapshot_t snapshot2) { + xbt_assert(r1 && r2, "Missing region."); struct mc_compare_state state; xbt_dynar_t variables;