diff --git a/.clang-tidy b/.clang-tidy index 231bf392..c8a0249d 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -16,6 +16,7 @@ Checks: '*include*, readability-convert-member-functions-to-static, cppcoreguidelines-pro-type-member-init, performance-unnecessary-value-param, + google-runtime-int, -altera-unroll-loops, -altera-id-dependent-backward-branch, -bugprone-easily-swappable-parameters, diff --git a/src/interpreter/Interpreter.cpp b/src/interpreter/Interpreter.cpp index 11cc8c92..4e0dfd64 100644 --- a/src/interpreter/Interpreter.cpp +++ b/src/interpreter/Interpreter.cpp @@ -165,7 +165,7 @@ void Interpreter::triggerDoesNotUnderstand(VMSymbol* signature) { // the receiver should not go into the argumentsArray // so, numberOfArgs - 2 - for (long i = numberOfArgs - 2; i >= 0; --i) { + for (int64_t i = numberOfArgs - 2; i >= 0; --i) { vm_oop_t o = GetFrame()->Pop(); argumentsArray->SetIndexableField(i, o); } @@ -176,7 +176,7 @@ void Interpreter::triggerDoesNotUnderstand(VMSymbol* signature) { // check if current frame is big enough for this unplanned Send // doesNotUnderstand: needs 3 slots, one for this, one for method name, one // for args - long const additionalStackSlots = 3 - GetFrame()->RemainingStackSize(); + int64_t const additionalStackSlots = 3 - GetFrame()->RemainingStackSize(); if (additionalStackSlots > 0) { GetFrame()->SetBytecodeIndex(bytecodeIndexGlobal); // copy current frame into a bigger one and replace the current frame @@ -288,7 +288,7 @@ void Interpreter::SendUnknownGlobal(VMSymbol* globalName) { // check if there is enough space on the stack for this unplanned Send // unknowGlobal: needs 2 slots, one for "this" and one for the argument - long const additionalStackSlots = 2 - GetFrame()->RemainingStackSize(); + int64_t const additionalStackSlots = 2 - GetFrame()->RemainingStackSize(); if (additionalStackSlots > 0) { GetFrame()->SetBytecodeIndex(bytecodeIndexGlobal); // copy current frame into a bigger one and replace the current @@ -461,7 +461,8 @@ void Interpreter::doReturnNonLocal() { // check if current frame is big enough for this unplanned send // #escapedBlock: needs 2 slots, one for self, and one for the block - long const additionalStackSlots = 2 - GetFrame()->RemainingStackSize(); + int64_t const additionalStackSlots = + 2 - GetFrame()->RemainingStackSize(); if (additionalStackSlots > 0) { GetFrame()->SetBytecodeIndex(bytecodeIndexGlobal); // copy current frame into a bigger one, and replace it diff --git a/src/memory/DebugCopyingCollector.cpp b/src/memory/DebugCopyingCollector.cpp index f1cad1f1..4a59914e 100644 --- a/src/memory/DebugCopyingCollector.cpp +++ b/src/memory/DebugCopyingCollector.cpp @@ -3,6 +3,7 @@ #include #include +#include #include "../memory/Heap.h" #include "../misc/Timer.h" diff --git a/src/vm/Universe.cpp b/src/vm/Universe.cpp index 19ae1793..9190e662 100644 --- a/src/vm/Universe.cpp +++ b/src/vm/Universe.cpp @@ -343,8 +343,8 @@ void Universe::initialize(int32_t _argc, char** _argv) { #if CACHE_INTEGER // create prebuilt integers - for (long it = INT_CACHE_MIN_VALUE; it <= INT_CACHE_MAX_VALUE; ++it) { - prebuildInts[(unsigned long)(it - INT_CACHE_MIN_VALUE)] = + for (int64_t it = INT_CACHE_MIN_VALUE; it <= INT_CACHE_MAX_VALUE; ++it) { + prebuildInts[(size_t)(it - INT_CACHE_MIN_VALUE)] = store_root(new (GetHeap(), 0) VMInteger(it)); } #endif