mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
clang-format: Set penalty for breaking after assignment operator
This commit is contained in:
parent
4423574d26
commit
9af6b2f48d
54 changed files with 255 additions and 247 deletions
|
@ -526,8 +526,8 @@ bool Manager::TraverseRecord(Stream* stream, Filter* filter, RecordType* rt, Tab
|
|||
|
||||
bool optional = (bool)rtype->FieldDecl(i)->GetAttr(detail::ATTR_OPTIONAL);
|
||||
|
||||
filter->fields[filter->num_fields - 1] =
|
||||
new threading::Field(new_path.c_str(), nullptr, t->Tag(), st, optional);
|
||||
filter->fields[filter->num_fields - 1] = new threading::Field(new_path.c_str(), nullptr,
|
||||
t->Tag(), st, optional);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -868,8 +868,8 @@ bool Manager::Write(EnumVal* id, RecordVal* columns_arg)
|
|||
if ( const auto& val = filter->field_name_map->Find(fn) )
|
||||
{
|
||||
delete[] filter->fields[j]->name;
|
||||
filter->fields[j]->name =
|
||||
util::copy_string(val->AsStringVal()->CheckString());
|
||||
filter->fields[j]->name = util::copy_string(
|
||||
val->AsStringVal()->CheckString());
|
||||
}
|
||||
}
|
||||
arg_fields[j] = new threading::Field(*filter->fields[j]);
|
||||
|
@ -1049,8 +1049,8 @@ threading::Value* Manager::ValToLogVal(Val* val, Type* ty)
|
|||
|
||||
for ( bro_int_t i = 0; i < lval->val.vector_val.size; i++ )
|
||||
{
|
||||
lval->val.vector_val.vals[i] =
|
||||
ValToLogVal(vec->ValAt(i).get(), vec->GetType()->Yield().get());
|
||||
lval->val.vector_val.vals[i] = ValToLogVal(vec->ValAt(i).get(),
|
||||
vec->GetType()->Yield().get());
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1153,8 +1153,8 @@ WriterFrontend* Manager::CreateWriter(EnumVal* id, EnumVal* writer, WriterBacken
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Stream::WriterMap::iterator w =
|
||||
stream->writers.find(Stream::WriterPathPair(writer->AsEnum(), info->path));
|
||||
Stream::WriterMap::iterator w = stream->writers.find(
|
||||
Stream::WriterPathPair(writer->AsEnum(), info->path));
|
||||
|
||||
if ( w != stream->writers.end() )
|
||||
{
|
||||
|
@ -1279,8 +1279,8 @@ bool Manager::WriteFromRemote(EnumVal* id, EnumVal* writer, const string& path,
|
|||
return true;
|
||||
}
|
||||
|
||||
Stream::WriterMap::iterator w =
|
||||
stream->writers.find(Stream::WriterPathPair(writer->AsEnum(), path));
|
||||
Stream::WriterMap::iterator w = stream->writers.find(
|
||||
Stream::WriterPathPair(writer->AsEnum(), path));
|
||||
|
||||
if ( w == stream->writers.end() )
|
||||
{
|
||||
|
@ -1478,11 +1478,11 @@ void Manager::InstallRotationTimer(WriterInfo* winfo)
|
|||
static auto base_time = log_rotate_base_time->AsString()->CheckString();
|
||||
|
||||
double base = util::detail::parse_rotate_base_time(base_time);
|
||||
double delta_t =
|
||||
util::detail::calc_next_rotate(run_state::network_time, rotation_interval, base);
|
||||
double delta_t = util::detail::calc_next_rotate(run_state::network_time,
|
||||
rotation_interval, base);
|
||||
|
||||
winfo->rotation_timer =
|
||||
new RotationTimer(run_state::network_time + delta_t, winfo, true);
|
||||
winfo->rotation_timer = new RotationTimer(run_state::network_time + delta_t, winfo,
|
||||
true);
|
||||
}
|
||||
|
||||
zeek::detail::timer_mgr->Add(winfo->rotation_timer);
|
||||
|
@ -1561,9 +1561,9 @@ void Manager::Rotate(WriterInfo* winfo)
|
|||
else
|
||||
ppf = default_ppf;
|
||||
|
||||
auto rotation_path =
|
||||
FormatRotationPath({NewRef{}, winfo->type}, winfo->writer->Info().path, winfo->open_time,
|
||||
run_state::network_time, run_state::terminating, std::move(ppf));
|
||||
auto rotation_path = FormatRotationPath({NewRef{}, winfo->type}, winfo->writer->Info().path,
|
||||
winfo->open_time, run_state::network_time,
|
||||
run_state::terminating, std::move(ppf));
|
||||
|
||||
winfo->writer->Rotate(rotation_path.data(), winfo->open_time, run_state::network_time,
|
||||
run_state::terminating);
|
||||
|
|
|
@ -239,9 +239,9 @@ bool WriterBackend::Write(int arg_num_fields, int num_writes, Value*** vals)
|
|||
if ( vals[j][i]->type != fields[i]->type )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
const char* msg =
|
||||
Fmt("Field #%d type doesn't match in WriterBackend::Write() (%d vs. %d)", i,
|
||||
vals[j][i]->type, fields[i]->type);
|
||||
const char* msg = Fmt(
|
||||
"Field #%d type doesn't match in WriterBackend::Write() (%d vs. %d)", i,
|
||||
vals[j][i]->type, fields[i]->type);
|
||||
Debug(DBG_LOGGING, msg);
|
||||
#endif
|
||||
DisableFrontend();
|
||||
|
|
|
@ -101,8 +101,8 @@ public:
|
|||
WriterInfo(const WriterInfo& other)
|
||||
{
|
||||
path = other.path ? util::copy_string(other.path) : nullptr;
|
||||
post_proc_func =
|
||||
other.post_proc_func ? util::copy_string(other.post_proc_func) : nullptr;
|
||||
post_proc_func = other.post_proc_func ? util::copy_string(other.post_proc_func)
|
||||
: nullptr;
|
||||
rotation_interval = other.rotation_interval;
|
||||
rotation_base = other.rotation_base;
|
||||
network_time = other.network_time;
|
||||
|
|
|
@ -105,8 +105,8 @@ static std::optional<LeftoverLog> parse_shadow_log(const std::string& fname)
|
|||
|
||||
if ( ! sf_stream )
|
||||
{
|
||||
rval.error =
|
||||
util::fmt("Failed to open %s: %s", rval.shadow_filename.data(), strerror(errno));
|
||||
rval.error = util::fmt("Failed to open %s: %s", rval.shadow_filename.data(),
|
||||
strerror(errno));
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
@ -124,8 +124,8 @@ static std::optional<LeftoverLog> parse_shadow_log(const std::string& fname)
|
|||
|
||||
if ( sf_len == -1 )
|
||||
{
|
||||
rval.error =
|
||||
util::fmt("Failed to ftell() on %s: %s", rval.shadow_filename.data(), strerror(errno));
|
||||
rval.error = util::fmt("Failed to ftell() on %s: %s", rval.shadow_filename.data(),
|
||||
strerror(errno));
|
||||
fclose(sf_stream);
|
||||
return rval;
|
||||
}
|
||||
|
@ -169,8 +169,8 @@ static std::optional<LeftoverLog> parse_shadow_log(const std::string& fname)
|
|||
// Use shadow file's modification time as creation time.
|
||||
if ( stat(rval.shadow_filename.data(), &st) != 0 )
|
||||
{
|
||||
rval.error =
|
||||
util::fmt("Failed to stat %s: %s", rval.shadow_filename.data(), strerror(errno));
|
||||
rval.error = util::fmt("Failed to stat %s: %s", rval.shadow_filename.data(),
|
||||
strerror(errno));
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
@ -454,8 +454,8 @@ bool Ascii::DoInit(const WriterInfo& info, int num_fields, const threading::Fiel
|
|||
|
||||
fname += ext;
|
||||
|
||||
bool use_shadow =
|
||||
BifConst::LogAscii::enable_leftover_log_rotation && Info().rotation_interval > 0;
|
||||
bool use_shadow = BifConst::LogAscii::enable_leftover_log_rotation &&
|
||||
Info().rotation_interval > 0;
|
||||
|
||||
if ( use_shadow )
|
||||
{
|
||||
|
@ -676,8 +676,8 @@ bool Ascii::DoRotate(const char* rotated_path, double open, double close, bool t
|
|||
return false;
|
||||
}
|
||||
|
||||
bool use_shadow =
|
||||
BifConst::LogAscii::enable_leftover_log_rotation && Info().rotation_interval > 0;
|
||||
bool use_shadow = BifConst::LogAscii::enable_leftover_log_rotation &&
|
||||
Info().rotation_interval > 0;
|
||||
|
||||
if ( use_shadow )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue