diff --git a/src/script_opt/ZAM/AM-Opt.cc b/src/script_opt/ZAM/AM-Opt.cc index 1a1ab57686..0f35148ff6 100644 --- a/src/script_opt/ZAM/AM-Opt.cc +++ b/src/script_opt/ZAM/AM-Opt.cc @@ -689,7 +689,7 @@ void ZAMCompiler::ReMapVar(ID* id, int slot, bro_uint_t inst) if ( s.scope_end <= static_cast(inst) && s.is_managed == is_managed ) { // It's compatible. - if ( s.scope_end == inst ) + if ( s.scope_end == static_cast(inst) ) { // It ends right on the money. apt_slot = i; break; diff --git a/src/script_opt/ZAM/Driver.cc b/src/script_opt/ZAM/Driver.cc index 76dd71057d..2d4f4abd25 100644 --- a/src/script_opt/ZAM/Driver.cc +++ b/src/script_opt/ZAM/Driver.cc @@ -315,7 +315,7 @@ void ZAMCompiler::RemapFrameDenizens(const std::vector& inst1_to_inst2) // the form "slotX = slotX". In that // case, look forward for the next viable // instruction. - while ( start < int(insts1.size()) && + while ( start < insts1.size() && inst1_to_inst2[start] == -1 ) ++start; diff --git a/src/script_opt/ZAM/ZInst.cc b/src/script_opt/ZAM/ZInst.cc index 154b6bb30e..cafe99079b 100644 --- a/src/script_opt/ZAM/ZInst.cc +++ b/src/script_opt/ZAM/ZInst.cc @@ -9,7 +9,7 @@ using std::string; namespace zeek::detail { -void ZInst::Dump(int inst_num, const FrameReMap* mappings) const +void ZInst::Dump(bro_uint_t inst_num, const FrameReMap* mappings) const { // printf("v%d ", n); @@ -214,7 +214,7 @@ int ZInst::NumSlots() const return -1; } -string ZInst::VName(int n, int inst_num, const FrameReMap* mappings) const +string ZInst::VName(int n, bro_uint_t inst_num, const FrameReMap* mappings) const { if ( n > NumFrameSlots() ) return ""; @@ -333,11 +333,12 @@ string ZInstI::VName(int n, const FrameMap* frame_ids, auto& map = (*remappings)[slot]; unsigned int i; + auto inst_num_u = static_cast(inst_num); for ( i = 0; i < map.id_start.size(); ++i ) { // See discussion for ZInst::VName. - if ( (n == 1 && map.id_start[i] > inst_num) || - (n > 1 && map.id_start[i] >= inst_num) ) + if ( (n == 1 && map.id_start[i] > inst_num_u) || + (n > 1 && map.id_start[i] >= inst_num_u) ) // Went too far. break; } diff --git a/src/script_opt/ZAM/ZInst.h b/src/script_opt/ZAM/ZInst.h index 0f82400907..5db65bcc29 100644 --- a/src/script_opt/ZAM/ZInst.h +++ b/src/script_opt/ZAM/ZInst.h @@ -66,7 +66,7 @@ public: virtual ~ZInst() { } // Methods for printing out the instruction for debugging/maintenance. - void Dump(int inst_num, const FrameReMap* mappings) const; + void Dump(bro_uint_t inst_num, const FrameReMap* mappings) const; void Dump(const std::string& id1, const std::string& id2, const std::string& id3, const std::string& id4) const; @@ -75,7 +75,7 @@ public: // by its number within a larger set. "mappings" provides the // mappings used to translate raw slots to the corresponding // script variable(s). - std::string VName(int n, int inst_num, + std::string VName(int n, bro_uint_t inst_num, const FrameReMap* mappings) const; // Number of slots that refer to a frame element. These always