summaryrefslogtreecommitdiff
path: root/src/stream.cc
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2017-02-27 18:09:36 -0800
committerGitHub <noreply@github.com>2017-02-27 18:09:36 -0800
commitf94275a6cf1f9ef990ec47d97a1174765790d56c (patch)
tree75d3b317855052872901e699af42f307d9c8ae58 /src/stream.cc
parent86ee5244e68cc2320f1e8bde02aefe255d334430 (diff)
downloadwabt-f94275a6cf1f9ef990ec47d97a1174765790d56c.tar.gz
wabt-f94275a6cf1f9ef990ec47d97a1174765790d56c.tar.bz2
wabt-f94275a6cf1f9ef990ec47d97a1174765790d56c.zip
Require C++-style casts, disallow C-style casts (#320)
Diffstat (limited to 'src/stream.cc')
-rw-r--r--src/stream.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/stream.cc b/src/stream.cc
index 14a2c284..64073d0f 100644
--- a/src/stream.cc
+++ b/src/stream.cc
@@ -125,14 +125,16 @@ void wabt_write_memory_dump(WabtStream* stream,
WabtPrintChars print_chars,
const char* prefix,
const char* desc) {
- const uint8_t* p = (const uint8_t*)start;
+ const uint8_t* p = static_cast<const uint8_t*>(start);
const uint8_t* end = p + size;
while (p < end) {
const uint8_t* line = p;
const uint8_t* line_end = p + DUMP_OCTETS_PER_LINE;
if (prefix)
wabt_writef(stream, "%s", prefix);
- wabt_writef(stream, "%07" PRIzx ": ", (size_t)p - (size_t)start + offset);
+ wabt_writef(stream, "%07" PRIzx ": ",
+ reinterpret_cast<intptr_t>(p) -
+ reinterpret_cast<intptr_t>(start) + offset);
while (p < line_end) {
int i;
for (i = 0; i < DUMP_OCTETS_PER_GROUP; ++i, ++p) {