From: David Neto Date: Wed, 11 Nov 2015 14:44:23 +0000 (-0500) Subject: Fix Windows build errors. X-Git-Tag: upstream/2018.6~1468 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce9cef71ac288f8b1c53ba7b8be600cb756329d4;p=platform%2Fupstream%2FSPIRV-Tools.git Fix Windows build errors. - uint64_t != size_t sometimes - don't use C99 runtime sized arrays --- diff --git a/include/libspirv/libspirv.h b/include/libspirv/libspirv.h index 7112e9d..b61138c 100644 --- a/include/libspirv/libspirv.h +++ b/include/libspirv/libspirv.h @@ -480,7 +480,7 @@ void spvTextDestroy(spv_text text); /// @param[out] pDiagnostic contains diagnostic on failure /// /// @return result code -spv_result_t spvBinaryToText(const uint32_t* binary, const uint64_t wordCount, +spv_result_t spvBinaryToText(const uint32_t* binary, const size_t wordCount, const uint32_t options, const spv_opcode_table opcodeTable, const spv_operand_table operandTable, diff --git a/source/disassemble.cpp b/source/disassemble.cpp index de720d0..a439b01 100644 --- a/source/disassemble.cpp +++ b/source/disassemble.cpp @@ -338,7 +338,7 @@ spv_result_t DisassembleInstruction( } // anonymous namespace -spv_result_t spvBinaryToText(const uint32_t* code, const uint64_t wordCount, +spv_result_t spvBinaryToText(const uint32_t* code, const size_t wordCount, const uint32_t options, const spv_opcode_table opcode_table, const spv_operand_table operand_table, diff --git a/test/HexFloat.cpp b/test/HexFloat.cpp index 10c5fb7..ee3be89 100644 --- a/test/HexFloat.cpp +++ b/test/HexFloat.cpp @@ -419,17 +419,17 @@ std::string EncodeViaFloatProxy(const T& value) { std::string NormalizeExponentInFloatString(std::string in) { std::string result; // Reserve one spot for the terminating null, even when the sscanf fails. - char prefix[in.size() + 1]; + std::vector prefix(in.size()+1); char e; char plus_or_minus; int exponent; // in base 10 - if ((4 == std::sscanf(in.c_str(), "%[-+.0123456789]%c%c%d", prefix, &e, + if ((4 == std::sscanf(in.c_str(), "%[-+.0123456789]%c%c%d", prefix.data(), &e, &plus_or_minus, &exponent)) && (e == 'e' || e == 'E') && (plus_or_minus == '-' || plus_or_minus == '+')) { // It looks like a floating point value with exponent. std::stringstream out; - out << prefix << 'e' << plus_or_minus << exponent; + out << prefix.data() << 'e' << plus_or_minus << exponent; result = out.str(); } else { result = in;