mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Fix clang-tidy bugprone-unused-local-non-trivial-variable warnings
This commit is contained in:
parent
8bb015754a
commit
d2045d1834
8 changed files with 1 additions and 7 deletions
|
@ -15,4 +15,5 @@ Checks: [-*,
|
||||||
bugprone-suspicious-include,
|
bugprone-suspicious-include,
|
||||||
bugprone-suspicious-realloc-usage,
|
bugprone-suspicious-realloc-usage,
|
||||||
bugprone-throw-keyword-missing,
|
bugprone-throw-keyword-missing,
|
||||||
|
bugprone-unused-local-non-trivial-variable,
|
||||||
]
|
]
|
||||||
|
|
|
@ -485,7 +485,6 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Conne
|
||||||
std::string loc_str;
|
std::string loc_str;
|
||||||
|
|
||||||
if ( location ) {
|
if ( location ) {
|
||||||
std::string loc_file = "";
|
|
||||||
int loc_line = 0;
|
int loc_line = 0;
|
||||||
|
|
||||||
if ( locations.size() ) {
|
if ( locations.size() ) {
|
||||||
|
|
|
@ -53,7 +53,6 @@ refine connection IMAP_Conn += {
|
||||||
%{
|
%{
|
||||||
string cmdstr = std_str(command);
|
string cmdstr = std_str(command);
|
||||||
std::transform(cmdstr.begin(), cmdstr.end(), cmdstr.begin(), ::tolower);
|
std::transform(cmdstr.begin(), cmdstr.end(), cmdstr.begin(), ::tolower);
|
||||||
string tagstr = std_str(tag);
|
|
||||||
|
|
||||||
if ( !is_orig && cmdstr == "capability" && tag == "*" ) {
|
if ( !is_orig && cmdstr == "capability" && tag == "*" ) {
|
||||||
return CMD_CAPABILITY;
|
return CMD_CAPABILITY;
|
||||||
|
|
|
@ -607,7 +607,6 @@ bool Raw::DoUpdate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string line;
|
|
||||||
assert((NumFields() == 1 && ! use_stderr) || (NumFields() == 2 && use_stderr));
|
assert((NumFields() == 1 && ! use_stderr) || (NumFields() == 2 && use_stderr));
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
if ( stdin_towrite > 0 )
|
if ( stdin_towrite > 0 )
|
||||||
|
|
|
@ -63,7 +63,6 @@ shared_ptr<CPP_InitInfo> CPPCompile::RegisterConstant(const ValPtr& vp, int& con
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tag = t->Tag();
|
auto tag = t->Tag();
|
||||||
auto const_name = const_info[tag]->NextName();
|
|
||||||
shared_ptr<CPP_InitInfo> gi;
|
shared_ptr<CPP_InitInfo> gi;
|
||||||
|
|
||||||
switch ( tag ) {
|
switch ( tag ) {
|
||||||
|
|
|
@ -1241,7 +1241,6 @@ string CPPCompile::GenField(const ExprPtr& rec, int field) {
|
||||||
auto pt = processed_types.find(rt);
|
auto pt = processed_types.find(rt);
|
||||||
ASSERT(pt != processed_types.end());
|
ASSERT(pt != processed_types.end());
|
||||||
auto rt_offset = pt->second->Offset();
|
auto rt_offset = pt->second->Offset();
|
||||||
string field_name = rt->FieldName(field);
|
|
||||||
field_decls.emplace_back(rt_offset, rt->FieldDecl(field));
|
field_decls.emplace_back(rt_offset, rt->FieldDecl(field));
|
||||||
|
|
||||||
if ( rfm != record_field_mappings.end() )
|
if ( rfm != record_field_mappings.end() )
|
||||||
|
|
|
@ -491,7 +491,6 @@ ListTypeInfo::ListTypeInfo(CPPCompile* _c, TypePtr _t)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListTypeInfo::AddInitializerVals(std::vector<std::string>& ivs) const {
|
void ListTypeInfo::AddInitializerVals(std::vector<std::string>& ivs) const {
|
||||||
string type_list;
|
|
||||||
for ( auto& t : types ) {
|
for ( auto& t : types ) {
|
||||||
auto iv = Fmt(c->TypeOffset(t));
|
auto iv = Fmt(c->TypeOffset(t));
|
||||||
ivs.emplace_back(iv);
|
ivs.emplace_back(iv);
|
||||||
|
|
|
@ -255,7 +255,6 @@ bool CSE_ValidityChecker::CheckTableRef(const TypePtr& t) { return CheckSideEffe
|
||||||
|
|
||||||
bool CSE_ValidityChecker::CheckCall(const CallExpr* c) {
|
bool CSE_ValidityChecker::CheckCall(const CallExpr* c) {
|
||||||
auto func = c->Func();
|
auto func = c->Func();
|
||||||
std::string desc;
|
|
||||||
if ( func->Tag() != EXPR_NAME )
|
if ( func->Tag() != EXPR_NAME )
|
||||||
// Can't analyze indirect calls.
|
// Can't analyze indirect calls.
|
||||||
return Invalid();
|
return Invalid();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue