From: degomme Date: Wed, 22 Feb 2017 17:20:12 +0000 (+0100) Subject: somehow off_t is not enough there, and ends up being negative on some 32 bits systems X-Git-Tag: v3_15~314 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ab922137b20cd1e668e3da66a63134886aebe3bb?hp=51103b4c6fa48b0be6a54f7cf2ec35ca7c228c2c somehow off_t is not enough there, and ends up being negative on some 32 bits systems --- diff --git a/src/mc/Process.cpp b/src/mc/Process.cpp index df7ef3cc28..7ffd7b3f99 100644 --- a/src/mc/Process.cpp +++ b/src/mc/Process.cpp @@ -498,8 +498,7 @@ const void *Process::read_bytes(void* buffer, std::size_t size, } #endif } - - if (pread_whole(this->memory_file, buffer, size, (off_t) address.address()) < 0) + if (pread_whole(this->memory_file, buffer, size, (size_t) address.address()) < 0) xbt_die("Read at %p from process %lli failed", (void*)address.address(), (long long)this->pid_); return buffer; } @@ -512,7 +511,7 @@ const void *Process::read_bytes(void* buffer, std::size_t size, */ void Process::write_bytes(const void* buffer, size_t len, RemotePtr address) { - if (pwrite_whole(this->memory_file, buffer, len, address.address()) < 0) + if (pwrite_whole(this->memory_file, buffer, len, (size_t)address.address()) < 0) xbt_die("Write to process %lli failed", (long long) this->pid_); }