diff --git a/userspace/engine/filter_evttype_resolver.cpp b/userspace/engine/filter_evttype_resolver.cpp index 8b8a54c9..44d5a0c7 100644 --- a/userspace/engine/filter_evttype_resolver.cpp +++ b/userspace/engine/filter_evttype_resolver.cpp @@ -17,12 +17,11 @@ limitations under the License. #include "filter_evttype_resolver.h" #include -using namespace std; using namespace libsinsp::filter; extern sinsp_evttables g_infotables; -static bool is_evttype_operator(const string& op) +static bool is_evttype_operator(const std::string& op) { return op == "==" || op == "=" || op == "!=" || op == "in"; } @@ -44,7 +43,7 @@ void filter_evttype_resolver::visitor::inversion(falco_event_types& types) } } -void filter_evttype_resolver::visitor::evttypes(string evtname, falco_event_types& out) +void filter_evttype_resolver::visitor::evttypes(const std::string& evtname, falco_event_types& out) { // Fill in from 2 to PPM_EVENT_MAX-1. 0 and 1 are excluded as // those are PPM_GENERIC_E/PPME_GENERIC_X @@ -53,7 +52,7 @@ void filter_evttype_resolver::visitor::evttypes(string evtname, falco_event_type { // Skip unused events or events not matching the requested evtname if(!(etable[i].flags & EF_UNUSED) - && (evtname.empty() || string(etable[i].name) == evtname)) + && (evtname.empty() || std::string(etable[i].name) == evtname)) { out.insert(i); } diff --git a/userspace/engine/filter_evttype_resolver.h b/userspace/engine/filter_evttype_resolver.h index 3de0e35e..7858da97 100644 --- a/userspace/engine/filter_evttype_resolver.h +++ b/userspace/engine/filter_evttype_resolver.h @@ -157,7 +157,7 @@ public: string is passed, all the available evttypes are collected \param out The set to be filled with the evttypes */ - inline void evttypes(std::string evtname, falco_event_types& out) const + inline void evttypes(const std::string& evtname, falco_event_types& out) const { falco_event_types evt_types; visitor().evttypes(evtname, evt_types); @@ -205,6 +205,6 @@ private: void visit(libsinsp::filter::ast::unary_check_expr* e) override; void visit(libsinsp::filter::ast::binary_check_expr* e) override; void inversion(falco_event_types& types); - void evttypes(std::string evtname, falco_event_types& out); + void evttypes(const std::string& evtname, falco_event_types& out); }; }; diff --git a/userspace/falco/app_actions/print_support.cpp b/userspace/falco/app_actions/print_support.cpp index d4ff0e9a..d0863c81 100644 --- a/userspace/falco/app_actions/print_support.cpp +++ b/userspace/falco/app_actions/print_support.cpp @@ -21,7 +21,7 @@ limitations under the License. using namespace falco::app; -static std::string read_file(std::string &filename) +static std::string read_file(const std::string &filename) { std::ifstream t(filename); std::string str((std::istreambuf_iterator(t)),