mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
Fix various compiler/linter warnings in script_opt/CPP code
This commit is contained in:
parent
e200016200
commit
3e85375010
15 changed files with 43 additions and 41 deletions
|
@ -233,14 +233,14 @@ void CPPCompile::AddRecordConstant(const ValPtr& v, string& const_name)
|
|||
auto r = cast_intrusive<RecordVal>(v);
|
||||
auto n = r->NumFields();
|
||||
|
||||
for ( auto i = 0; i < n; ++i )
|
||||
for ( auto i = 0u; i < n; ++i )
|
||||
{
|
||||
const auto& r_i = r->GetField(i);
|
||||
|
||||
if ( r_i )
|
||||
{
|
||||
auto r_i_c = BuildConstant(v, r_i);
|
||||
AddInit(v, const_name + "->Assign(" + Fmt(i) +
|
||||
AddInit(v, const_name + "->Assign(" + Fmt(static_cast<int>(i)) +
|
||||
", " + r_i_c + ");");
|
||||
}
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ void CPPCompile::AddVectorConstant(const ValPtr& v, string& const_name)
|
|||
auto vv = cast_intrusive<VectorVal>(v);
|
||||
auto n = vv->Size();
|
||||
|
||||
for ( auto i = 0; i < n; ++i )
|
||||
for ( auto i = 0u; i < n; ++i )
|
||||
{
|
||||
const auto& v_i = vv->ValAt(i);
|
||||
auto v_i_c = BuildConstant(v, v_i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue