Fix clang-tidy cppcoreguidelines-macro-usage findings (macros as constants)

This commit is contained in:
Tim Wojtulewicz 2025-05-09 11:57:58 -07:00
parent d6d56d330b
commit ad99a6821e
16 changed files with 96 additions and 80 deletions

View file

@ -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);
}