Commit 3896c047 authored by Ben Smith's avatar Ben Smith Committed by Commit Bot

[wasm] Use uint32_t instead of unsigned

The style guide says that only `int` should be used of the builtin
integer types. Instead, we should use the stdint types.

See https://google.github.io/styleguide/cppguide.html#Integer_Types

Change-Id: I1af53a3bceefbfed85589b74a602c8ebe1c7ee25
Reviewed-on: https://chromium-review.googlesource.com/c/1342663Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57851}
parent 9266bc24
This diff is collapsed.
......@@ -203,7 +203,7 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
i.pc());
os << " // @" << i.pc_offset();
if (decoder.Complete(imm)) {
for (unsigned i = 0; i < imm.out_arity(); i++) {
for (uint32_t i = 0; i < imm.out_arity(); i++) {
os << " " << ValueTypes::TypeName(imm.out_type(i));
}
}
......
......@@ -157,7 +157,7 @@ class WasmGraphBuildingInterface {
ssa_env_->SetNotMerged();
if (!decoder->ok()) return;
// Wrap input merge into phis.
for (unsigned i = 0; i < block->start_merge.arity; ++i) {
for (uint32_t i = 0; i < block->start_merge.arity; ++i) {
Value& val = block->start_merge[i];
val.node = builder_->Phi(val.type, 1, &val.node, block->end_env->control);
}
......@@ -248,7 +248,7 @@ class WasmGraphBuildingInterface {
for (size_t i = 0; i < num_values; ++i) {
buffer[i] = values[i].node;
}
BUILD(Return, static_cast<unsigned>(values.size()), buffer);
BUILD(Return, static_cast<uint32_t>(values.size()), buffer);
}
void GetLocal(FullDecoder* decoder, Value* result,
......
......@@ -1305,7 +1305,7 @@ class ModuleDecoderImpl : public Decoder {
const byte* pos = pc();
uint8_t opcode = consume_u8("opcode");
WasmInitExpr expr;
unsigned len = 0;
uint32_t len = 0;
switch (opcode) {
case kExprGetGlobal: {
GlobalIndexImmediate<Decoder::kValidate> imm(this, pc() - 1);
......@@ -1686,7 +1686,7 @@ AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* tables_start,
Decoder decoder(tables_start, tables_end);
uint32_t functions_count = decoder.consume_u32v("functions count");
// Reserve space for the entries, taking care of invalid input.
if (functions_count < static_cast<unsigned>(tables_end - tables_start)) {
if (functions_count < static_cast<uint32_t>(tables_end - tables_start)) {
table.reserve(functions_count);
}
......
......@@ -1244,7 +1244,7 @@ class ThreadImpl {
pc_t pc;
sp_t sp;
size_t fp;
unsigned arity;
uint32_t arity;
};
friend class InterpretedFrameImpl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment