diff options
author | Andrew Woloszyn <awoloszyn@google.com> | 2015-11-11 11:05:07 -0500 |
---|---|---|
committer | David Neto <dneto@google.com> | 2015-11-11 12:12:13 -0500 |
commit | 55ecc2e097405a6ab38d53e0a4f6046447e45c05 (patch) | |
tree | 2fabf88e71e8944743ccbc4d0fc88f58c593ff35 /source/binary.cpp | |
parent | 9049bb48771cc74dcf72b8aa754d845eb51cf18a (diff) |
Fixed warnings on windows and constness of spv_binary.
Replaced uint64_t with size_t in the places that make sense and
added spv_const_binary{,_t} to allow the interface to accept non
modifiable spirv where appropriate.
Diffstat (limited to 'source/binary.cpp')
-rwxr-xr-x[-rw-r--r--] | source/binary.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/binary.cpp b/source/binary.cpp index 699f6b05..5e4c7328 100644..100755 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -39,7 +39,7 @@ #include "opcode.h" #include "operand.h" -spv_result_t spvBinaryHeaderGet(const spv_binary binary, +spv_result_t spvBinaryHeaderGet(const spv_const_binary binary, const spv_endianness_t endian, spv_header_t* pHeader) { if (!binary->code) return SPV_ERROR_INVALID_BINARY; @@ -241,7 +241,7 @@ spv_result_t Parser::parseModule() { << " words instead of " << SPV_INDEX_INSTRUCTION; // Check the magic number and detect the module's endianness. - spv_binary_t binary = {_.words, _.num_words}; // Can't make this const. :-( + spv_const_binary_t binary{_.words, _.num_words}; if (spvBinaryEndianness(&binary, &_.endian)) { return diagnostic() << "Invalid SPIR-V magic number '" << std::hex << _.words[0] << "'."; @@ -671,7 +671,7 @@ void Parser::recordNumberType(const spv_parsed_instruction_t* inst) { } // anonymous namespace -spv_result_t spvBinaryParse(void* user_data, const uint32_t* const code, +spv_result_t spvBinaryParse(void* user_data, const uint32_t* code, const size_t num_words, spv_parsed_header_fn_t parsed_header, spv_parsed_instruction_fn_t parsed_instruction, |