clang-format: Set penalty for breaking after assignment operator

This commit is contained in:
Tim Wojtulewicz 2021-09-24 16:06:13 -07:00
parent 4423574d26
commit 9af6b2f48d
54 changed files with 255 additions and 247 deletions

View file

@ -1179,8 +1179,8 @@ int Manager::SendEntryTable(Stream* i, const Value* const* vals)
zeek::detail::hash_t valhash = 0;
if ( stream->num_val_fields > 0 )
{
if ( zeek::detail::HashKey* valhashkey =
HashValues(stream->num_val_fields, vals + stream->num_idx_fields) )
if ( zeek::detail::HashKey* valhashkey = HashValues(stream->num_val_fields,
vals + stream->num_idx_fields) )
{
valhash = valhashkey->Hash();
delete (valhashkey);
@ -1681,8 +1681,8 @@ int Manager::PutTable(Stream* i, const Value* const* vals)
{
// in case of update send back the old value.
assert(stream->num_val_fields > 0);
auto ev =
BifType::Enum::Input::Event->GetEnumVal(BifEnum::Input::EVENT_CHANGED);
auto ev = BifType::Enum::Input::Event->GetEnumVal(
BifEnum::Input::EVENT_CHANGED);
assert(oldval != nullptr);
SendEvent(stream->event, 4, stream->description->Ref(), ev.release(), predidx,
oldval.release());
@ -1746,8 +1746,8 @@ bool Manager::Delete(ReaderFrontend* reader, Value** vals)
{
TableStream* stream = (TableStream*)i;
bool convert_error = false;
Val* idxval =
ValueToIndexVal(i, stream->num_idx_fields, stream->itype, vals, convert_error);
Val* idxval = ValueToIndexVal(i, stream->num_idx_fields, stream->itype, vals,
convert_error);
readVals = stream->num_idx_fields + stream->num_val_fields;
bool streamresult = true;
@ -1772,8 +1772,8 @@ bool Manager::Delete(ReaderFrontend* reader, Value** vals)
Unref(predidx);
else
{
auto ev =
BifType::Enum::Input::Event->GetEnumVal(BifEnum::Input::EVENT_REMOVED);
auto ev = BifType::Enum::Input::Event->GetEnumVal(
BifEnum::Input::EVENT_REMOVED);
streamresult = CallPred(stream->pred, 3, ev.release(), predidx,
IntrusivePtr{val}.release());
@ -1906,8 +1906,8 @@ RecordVal* Manager::ListValToRecordVal(ListVal* list, RecordType* request_type,
Val* fieldVal = nullptr;
if ( request_type->GetFieldType(i)->Tag() == TYPE_RECORD )
fieldVal =
ListValToRecordVal(list, request_type->GetFieldType(i)->AsRecordType(), position);
fieldVal = ListValToRecordVal(list, request_type->GetFieldType(i)->AsRecordType(),
position);
else
{
fieldVal = list->Idx(*position).get();

View file

@ -419,8 +419,8 @@ bool Ascii::DoUpdate()
assert(val->type == TYPE_PORT);
// Error(Fmt("Got type %d != PORT with secondary position!", val->type));
val->val.port_val.proto =
formatter->ParseProto(stringfields[(*fit).secondary_position]);
val->val.port_val.proto = formatter->ParseProto(
stringfields[(*fit).secondary_position]);
}
fields[fpos] = val;

View file

@ -69,8 +69,8 @@ bool Config::DoInit(const ReaderInfo& info, int num_fields, const Field* const*
BifConst::InputConfig::empty_field->Len());
threading::formatter::Ascii::SeparatorInfo sep_info("\t", set_separator, "", empty_field);
formatter =
std::unique_ptr<threading::Formatter>(new threading::formatter::Ascii(this, sep_info));
formatter = std::unique_ptr<threading::Formatter>(
new threading::formatter::Ascii(this, sep_info));
return DoUpdate();
}

View file

@ -256,8 +256,8 @@ bool Raw::Execute()
if ( use_stderr )
{
stderrfile =
std::unique_ptr<FILE, int (*)(FILE*)>(fdopen(pipes[stderr_in], "r"), fclose);
stderrfile = std::unique_ptr<FILE, int (*)(FILE*)>(fdopen(pipes[stderr_in], "r"),
fclose);
if ( ! stderrfile )
{
@ -359,8 +359,8 @@ bool Raw::DoInit(const ReaderInfo& info, int num_fields, const Field* const* fie
fname = source.substr(0, fname.length() - 1);
}
ReaderInfo::config_map::const_iterator it =
info.config.find("stdin"); // data that is sent to the child process
ReaderInfo::config_map::const_iterator it = info.config.find(
"stdin"); // data that is sent to the child process
if ( it != info.config.end() )
{
stdin_string = it->second;
@ -486,8 +486,8 @@ int64_t Raw::GetLine(FILE* arg_file)
repeats++;
// bah, we cannot use realloc because we would have to change the delete in the manager
// to a free.
std::unique_ptr<char[]> newbuf =
std::unique_ptr<char[]>(new char[block_size * repeats]);
std::unique_ptr<char[]> newbuf = std::unique_ptr<char[]>(
new char[block_size * repeats]);
memcpy(newbuf.get(), buf.get(), block_size * (repeats - 1));
buf = std::move(newbuf);
offset = block_size * (repeats - 1);