mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
Fix clang-tidy modernize-return-braced-init-list findings
This commit is contained in:
parent
8c3eee7a87
commit
17c14a3ce1
9 changed files with 26 additions and 29 deletions
|
@ -141,7 +141,7 @@ string CPPCompile::GenExpr(const Expr* e, GenType gt, bool top_level) {
|
|||
default:
|
||||
// Intended to catch errors in overlooking the possible
|
||||
// expressions that might appear.
|
||||
return string("EXPR");
|
||||
return "EXPR";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -825,7 +825,7 @@ string CPPCompile::GenVal(const ValPtr& v) {
|
|||
auto it = t->InternalType();
|
||||
|
||||
if ( tag == TYPE_BOOL )
|
||||
return string(v->IsZero() ? "false" : "true");
|
||||
return v->IsZero() ? "false" : "true";
|
||||
|
||||
if ( tag == TYPE_ENUM )
|
||||
return GenEnum(t, v);
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
namespace zeek::detail {
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op) { return ZInstI(op); }
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op) { return {op}; }
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1) { return ZInstI(op, Frame1Slot(v1, op)); }
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1) { return {op, Frame1Slot(v1, op)}; }
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, int i) {
|
||||
auto z = ZInstI(op, Frame1Slot(v1, op), i);
|
||||
|
@ -24,46 +24,42 @@ ZInstI ZAMCompiler::GenInst(ZOp op, const ConstExpr* c, const NameExpr* v1, int
|
|||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const NameExpr* v2) {
|
||||
int nv2 = FrameSlot(v2);
|
||||
return ZInstI(op, Frame1Slot(v1, op), nv2);
|
||||
return {op, Frame1Slot(v1, op), nv2};
|
||||
}
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const NameExpr* v2, const NameExpr* v3) {
|
||||
int nv2 = FrameSlot(v2);
|
||||
int nv3 = FrameSlot(v3);
|
||||
return ZInstI(op, Frame1Slot(v1, op), nv2, nv3);
|
||||
return {op, Frame1Slot(v1, op), nv2, nv3};
|
||||
}
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const NameExpr* v2, const NameExpr* v3, const NameExpr* v4) {
|
||||
int nv2 = FrameSlot(v2);
|
||||
int nv3 = FrameSlot(v3);
|
||||
int nv4 = FrameSlot(v4);
|
||||
return ZInstI(op, Frame1Slot(v1, op), nv2, nv3, nv4);
|
||||
return {op, Frame1Slot(v1, op), nv2, nv3, nv4};
|
||||
}
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const ConstExpr* ce) { return ZInstI(op, ce); }
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const ConstExpr* ce) { return {op, ce}; }
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const ConstExpr* ce) {
|
||||
return ZInstI(op, Frame1Slot(v1, op), ce);
|
||||
}
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const ConstExpr* ce) { return {op, Frame1Slot(v1, op), ce}; }
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const ConstExpr* ce, const NameExpr* v1) {
|
||||
return ZInstI(op, Frame1Slot(v1, op), ce);
|
||||
}
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const ConstExpr* ce, const NameExpr* v1) { return {op, Frame1Slot(v1, op), ce}; }
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const ConstExpr* ce, const NameExpr* v2) {
|
||||
int nv2 = FrameSlot(v2);
|
||||
return ZInstI(op, Frame1Slot(v1, op), nv2, ce);
|
||||
return {op, Frame1Slot(v1, op), nv2, ce};
|
||||
}
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const NameExpr* v2, const ConstExpr* ce) {
|
||||
int nv2 = FrameSlot(v2);
|
||||
return ZInstI(op, Frame1Slot(v1, op), nv2, ce);
|
||||
return {op, Frame1Slot(v1, op), nv2, ce};
|
||||
}
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const NameExpr* v2, const NameExpr* v3, const ConstExpr* ce) {
|
||||
int nv2 = FrameSlot(v2);
|
||||
int nv3 = FrameSlot(v3);
|
||||
return ZInstI(op, Frame1Slot(v1, op), nv2, nv3, ce);
|
||||
return {op, Frame1Slot(v1, op), nv2, nv3, ce};
|
||||
}
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const NameExpr* v2, const ConstExpr* ce, const NameExpr* v3) {
|
||||
|
@ -71,7 +67,7 @@ ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const NameExpr* v2, cons
|
|||
// us from needing to implement a redundant constructor.
|
||||
int nv2 = FrameSlot(v2);
|
||||
int nv3 = FrameSlot(v3);
|
||||
return ZInstI(op, Frame1Slot(v1, op), nv2, nv3, ce);
|
||||
return {op, Frame1Slot(v1, op), nv2, nv3, ce};
|
||||
}
|
||||
|
||||
ZInstI ZAMCompiler::GenInst(ZOp op, const NameExpr* v1, const ConstExpr* c, int i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue