Explicitly convert to narrower type.
authorDavid Neto <dneto@google.com>
Tue, 5 Jan 2016 19:57:58 +0000 (14:57 -0500)
committerDavid Neto <dneto@google.com>
Wed, 6 Jan 2016 18:11:42 +0000 (13:11 -0500)
Fixes a strict Clang warning.

source/binary.cpp

index 7a3ec35..94cbf9c 100755 (executable)
@@ -769,7 +769,8 @@ spv_result_t Parser::setNumericTypeInfoForType(
 
   parsed_operand->number_kind = info.type;
   parsed_operand->number_bit_width = info.bit_width;
-  parsed_operand->num_words = (info.bit_width + 31) / 32;  // Round up
+  // Round up the word count.
+  parsed_operand->num_words = static_cast<uint16_t>((info.bit_width + 31) / 32);
   return SPV_SUCCESS;
 }