Reformat Zeek in Spicy style

This largely copies over Spicy's `.clang-format` configuration file. The
one place where we deviate is header include order since Zeek depends on
headers being included in a certain order.
This commit is contained in:
Benjamin Bannier 2023-10-10 21:13:34 +02:00
parent 7b8e7ed72c
commit f5a76c1aed
786 changed files with 131714 additions and 153609 deletions

View file

@ -6,18 +6,11 @@
#include "zeek/script_opt/ProfileFunc.h"
namespace zeek::detail
{
namespace zeek::detail {
// Conversions to strings.
inline std::string Fmt(int i)
{
return std::to_string(i);
}
inline std::string Fmt(p_hash_type u)
{
return std::to_string(u) + "ULL";
}
inline std::string Fmt(int i) { return std::to_string(i); }
inline std::string Fmt(p_hash_type u) { return std::to_string(u) + "ULL"; }
extern std::string Fmt(double d);
// Returns the prefix for the scoping used by the compiler.
@ -39,9 +32,6 @@ extern void unlock_file(const std::string& fname, FILE* f);
// For the given byte array / string, returns a version expanded
// with escape sequences in order to represent it as a C++ string.
extern std::string CPPEscape(const char* b, int len);
inline std::string CPPEscape(const char* s)
{
return CPPEscape(s, strlen(s));
}
inline std::string CPPEscape(const char* s) { return CPPEscape(s, strlen(s)); }
} // zeek::detail
} // namespace zeek::detail