mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Fix clang-tidy cppcoreguidelines-macro-usage findings (macros as constants)
This commit is contained in:
parent
d6d56d330b
commit
ad99a6821e
16 changed files with 96 additions and 80 deletions
|
@ -19,8 +19,6 @@
|
|||
#include "zeek/iosource/PktSrc.h"
|
||||
#include "zeek/plugin/Manager.h"
|
||||
|
||||
#define DEFAULT_PREFIX "pcap"
|
||||
|
||||
extern int signal_val;
|
||||
|
||||
namespace zeek::iosource {
|
||||
|
@ -368,6 +366,10 @@ void Manager::Register(PktSrc* src) {
|
|||
poll_interval = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the path comes with a prefix telling us which type of PktSrc to use. If no
|
||||
* prefix exists, return "pcap" as a default.
|
||||
*/
|
||||
static std::pair<std::string, std::string> split_prefix(std::string path) {
|
||||
// See if the path comes with a prefix telling us which type of
|
||||
// PktSrc to use. If not, choose default.
|
||||
|
@ -378,9 +380,8 @@ static std::pair<std::string, std::string> split_prefix(std::string path) {
|
|||
prefix = path.substr(0, i);
|
||||
path = path.substr(i + 2, std::string::npos);
|
||||
}
|
||||
|
||||
else
|
||||
prefix = DEFAULT_PREFIX;
|
||||
prefix = "pcap";
|
||||
|
||||
return std::make_pair(prefix, path);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue