mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
gen-zam: clang-tidy: Avoid bugprone narrowing conversions
This commit is contained in:
parent
bacd56258c
commit
27d674edc0
2 changed files with 6 additions and 6 deletions
|
@ -273,7 +273,7 @@ void ZAM_OpTemplate::UnaryInstantiate()
|
|||
void ZAM_OpTemplate::Parse(const string& attr, const string& line, const Words& words)
|
||||
{
|
||||
int num_args = -1; // -1 = don't enforce
|
||||
int nwords = words.size();
|
||||
int nwords = static_cast<int>(words.size());
|
||||
|
||||
if ( attr == "type" )
|
||||
{
|
||||
|
@ -1015,7 +1015,7 @@ void ZAM_ExprOpTemplate::Instantiate()
|
|||
InstantiateV(op_types);
|
||||
}
|
||||
|
||||
void ZAM_ExprOpTemplate::InstantiateC1(const vector<ZAM_OperandType>& ots, int arity, bool do_vec)
|
||||
void ZAM_ExprOpTemplate::InstantiateC1(const vector<ZAM_OperandType>& ots, size_t arity, bool do_vec)
|
||||
{
|
||||
string args = "lhs, r1->AsConstExpr()";
|
||||
|
||||
|
@ -1050,7 +1050,7 @@ void ZAM_ExprOpTemplate::InstantiateC1(const vector<ZAM_OperandType>& ots, int a
|
|||
}
|
||||
}
|
||||
|
||||
void ZAM_ExprOpTemplate::InstantiateC2(const vector<ZAM_OperandType>& ots, int arity)
|
||||
void ZAM_ExprOpTemplate::InstantiateC2(const vector<ZAM_OperandType>& ots, size_t arity)
|
||||
{
|
||||
string args = "lhs, r1->AsNameExpr(), r2->AsConstExpr()";
|
||||
|
||||
|
@ -1909,7 +1909,7 @@ string TemplateInput::SkipWords(const string& line, int n) const
|
|||
void TemplateInput::Gripe(const char* msg, const string& input) const
|
||||
{
|
||||
auto input_s = input.c_str();
|
||||
int n = strlen(input_s);
|
||||
size_t n = strlen(input_s);
|
||||
|
||||
fprintf(stderr, "%s, line %d: %s - %s", loc.file_name, loc.line_num, msg, input_s);
|
||||
if ( n == 0 || input_s[n - 1] != '\n' )
|
||||
|
|
|
@ -668,8 +668,8 @@ protected:
|
|||
|
||||
// Instantiates versions of the operation that have a constant
|
||||
// as the first, second, or third operand ...
|
||||
void InstantiateC1(const vector<ZAM_OperandType>& ots, int arity, bool do_vec = false);
|
||||
void InstantiateC2(const vector<ZAM_OperandType>& ots, int arity);
|
||||
void InstantiateC1(const vector<ZAM_OperandType>& ots, size_t arity, bool do_vec = false);
|
||||
void InstantiateC2(const vector<ZAM_OperandType>& ots, size_t arity);
|
||||
void InstantiateC3(const vector<ZAM_OperandType>& ots);
|
||||
|
||||
// ... or if all of the operands are non-constant.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue