diff --git a/src/script_opt/ZAM/AM-Opt.cc b/src/script_opt/ZAM/AM-Opt.cc index a2b69275f2..1a1ab57686 100644 --- a/src/script_opt/ZAM/AM-Opt.cc +++ b/src/script_opt/ZAM/AM-Opt.cc @@ -484,7 +484,7 @@ void ZAMCompiler::ReMapFrame() frame1_to_frame2.resize(frame_layout1.size(), -1); managed_slotsI.clear(); - for ( unsigned int i = 0; i < insts1.size(); ++i ) + for ( bro_uint_t i = 0; i < insts1.size(); ++i ) { auto inst = insts1[i]; @@ -659,7 +659,7 @@ void ZAMCompiler::ReMapInterpreterFrame() remapped_intrp_frame_sizes[func] = next_interp_slot; } -void ZAMCompiler::ReMapVar(ID* id, int slot, int inst) +void ZAMCompiler::ReMapVar(ID* id, int slot, bro_uint_t inst) { // A greedy algorithm for this is to simply find the first suitable // frame slot. We do that with one twist: we also look for a @@ -686,7 +686,8 @@ void ZAMCompiler::ReMapVar(ID* id, int slot, int inst) // ZAM instructions are careful to allow operands and // assignment destinations to refer to the same slot. - if ( s.scope_end <= inst && s.is_managed == is_managed ) + if ( s.scope_end <= static_cast(inst) && + s.is_managed == is_managed ) { // It's compatible. if ( s.scope_end == inst ) { // It ends right on the money. @@ -727,7 +728,8 @@ void ZAMCompiler::ReMapVar(ID* id, int slot, int inst) void ZAMCompiler::CheckSlotAssignment(int slot, const ZInstI* inst) { - ASSERT(slot >= 0 && slot < frame_denizens.size()); + ASSERT(slot >= 0 && + static_cast(slot) < frame_denizens.size()); // We construct temporaries such that their values are never used // earlier than their definitions in loop bodies. For other @@ -766,7 +768,7 @@ void ZAMCompiler::CheckSlotUse(int slot, const ZInstI* inst) if ( slot < 0 ) return; - ASSERT(slot < frame_denizens.size()); + ASSERT(static_cast(slot) < frame_denizens.size()); if ( denizen_beginning.count(slot) == 0 ) { diff --git a/src/script_opt/ZAM/Branches.cc b/src/script_opt/ZAM/Branches.cc index 330e5cbd0f..63fd662ac9 100644 --- a/src/script_opt/ZAM/Branches.cc +++ b/src/script_opt/ZAM/Branches.cc @@ -78,7 +78,7 @@ ZInstI* ZAMCompiler::FindLiveTarget(ZInstI* goto_target) return goto_target; int idx = goto_target->inst_num; - ASSERT(idx >= 0 && idx <= insts1.size()); + ASSERT(idx >= 0 && idx <= int(insts1.size())); while ( idx < int(insts1.size()) && ! insts1[idx]->live ) ++idx; diff --git a/src/script_opt/ZAM/Compile.h b/src/script_opt/ZAM/Compile.h index f394ec705c..990eaee88d 100644 --- a/src/script_opt/ZAM/Compile.h +++ b/src/script_opt/ZAM/Compile.h @@ -450,7 +450,7 @@ private: // Computes the remapping for a variable currently in the given slot, // whose scope begins at the given instruction. - void ReMapVar(ID* id, int slot, int inst); + void ReMapVar(ID* id, int slot, bro_uint_t inst); // Look to initialize the beginning of local lifetime based on slot // assignment at instruction inst. diff --git a/src/script_opt/ZAM/Stmt.cc b/src/script_opt/ZAM/Stmt.cc index 5a77a1c4e6..008c1a2dad 100644 --- a/src/script_opt/ZAM/Stmt.cc +++ b/src/script_opt/ZAM/Stmt.cc @@ -807,7 +807,7 @@ const ZAMStmt ZAMCompiler::LoopOverTable(const ForStmt* f, const NameExpr* val) auto aux = new ZInstAux(0); - for ( auto i = 0U; i < loop_vars->length(); ++i ) + for ( auto i = 0; i < loop_vars->length(); ++i ) { auto id = (*loop_vars)[i]; diff --git a/src/script_opt/ZAM/ZInst.cc b/src/script_opt/ZAM/ZInst.cc index 817441ea48..154b6bb30e 100644 --- a/src/script_opt/ZAM/ZInst.cc +++ b/src/script_opt/ZAM/ZInst.cc @@ -225,7 +225,7 @@ string ZInst::VName(int n, int inst_num, const FrameReMap* mappings) const return ""; // Find which identifier manifests at this instruction. - ASSERT(slot >= 0 && slot < mappings->size()); + ASSERT(slot >= 0 && static_cast(slot) < mappings->size()); auto& map = (*mappings)[slot]; @@ -327,7 +327,8 @@ string ZInstI::VName(int n, const FrameMap* frame_ids, if ( remappings && live ) { // Find which identifier manifests at this instruction. - ASSERT(slot >= 0 && slot < remappings->size()); + ASSERT(slot >= 0 && + static_cast(slot) < remappings->size()); auto& map = (*remappings)[slot]; diff --git a/src/script_opt/ZAM/ZInst.h b/src/script_opt/ZAM/ZInst.h index 3ec17848b6..0f82400907 100644 --- a/src/script_opt/ZAM/ZInst.h +++ b/src/script_opt/ZAM/ZInst.h @@ -35,7 +35,7 @@ public: // The ZAM instruction number where a given identifier starts its // scope, parallel to "ids". - std::vector id_start; + std::vector id_start; // The current end of the frame slot's scope. Gets updated as // new IDs are added to share the slot.