summaryrefslogtreecommitdiff
path: root/src/binary-error-handler.h
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2017-05-15 10:07:21 -0700
committerGitHub <noreply@github.com>2017-05-15 10:07:21 -0700
commitf1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0 (patch)
tree1c2144a7c8acadf0850ad183920d0b247ddc501c /src/binary-error-handler.h
parent5d10e89b5d796edc62cfb6bc3f806d8a1b1272c0 (diff)
downloadwabt-f1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0.tar.gz
wabt-f1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0.tar.bz2
wabt-f1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0.zip
Use Index/Address/Offset instead of uint32_t (#433)
An `Index` is an index into one of the WebAssembly index spaces. It also is used for counts for these spaces, as well as parameter counts and result counts. An `Address` is an index into linear memory, or the size of a data region in linear memory. An `Offset` is an offset into the host's file or memory buffer. This fixes issue #322.
Diffstat (limited to 'src/binary-error-handler.h')
-rw-r--r--src/binary-error-handler.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/binary-error-handler.h b/src/binary-error-handler.h
index 2186ecbe..6dc5e669 100644
--- a/src/binary-error-handler.h
+++ b/src/binary-error-handler.h
@@ -21,6 +21,8 @@
#include <cstdio>
#include <string>
+#include "common.h"
+
namespace wabt {
class BinaryErrorHandler {
@@ -28,7 +30,7 @@ class BinaryErrorHandler {
virtual ~BinaryErrorHandler() {}
// Returns true if the error was handled.
- virtual bool OnError(uint32_t offset, const std::string& error) = 0;
+ virtual bool OnError(Offset offset, const std::string& error) = 0;
};
class BinaryErrorHandlerFile : public BinaryErrorHandler {
@@ -43,7 +45,7 @@ class BinaryErrorHandlerFile : public BinaryErrorHandler {
const std::string& header = std::string(),
PrintHeader print_header = PrintHeader::Never);
- bool OnError(uint32_t offset, const std::string& error) override;
+ bool OnError(Offset offset, const std::string& error) override;
private:
void PrintErrorHeader();