/// @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,
} // 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,
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<char> 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;