From f1031e8ac4a4eb2ec886c03fa432d5b5b3cc56a0 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Mon, 15 May 2017 10:07:21 -0700 Subject: 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. --- src/binary-error-handler.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/binary-error-handler.h') 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 #include +#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(); -- cgit v1.2.3