clang-format: Set IndentCaseBlocks to false

This commit is contained in:
Tim Wojtulewicz 2021-09-24 15:40:37 -07:00
parent 02206f3215
commit 4423574d26
58 changed files with 4729 additions and 4766 deletions

View file

@ -47,7 +47,7 @@ ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: false
FixNamespaceComments: false
IndentCaseLabels: true
IndentCaseBlocks: true
IndentCaseBlocks: false
IndentExternBlock: NoIndent
IndentPPDirectives: None
IndentWidth: 4

View file

@ -331,8 +331,8 @@ void Attributes::CheckAttr(Attr* a)
FuncType* aft = at->AsFuncType();
if ( ! same_type(aft->Yield(), type) )
{
a->GetExpr()->Error(
is_add ? "&add_func function must yield same type as variable"
a->GetExpr()->Error(is_add
? "&add_func function must yield same type as variable"
: "&delete_func function must yield same type as variable");
break;
}
@ -359,8 +359,7 @@ void Attributes::CheckAttr(Attr* a)
// Record defaults may be promotable.
if ( (type->Tag() == TYPE_RECORD && atype->Tag() == TYPE_RECORD &&
record_promotion_compatible(atype->AsRecordType(),
type->AsRecordType())) )
record_promotion_compatible(atype->AsRecordType(), type->AsRecordType())) )
// Ok.
break;
@ -393,8 +392,7 @@ void Attributes::CheckAttr(Attr* a)
if ( atype->Tag() == TYPE_FUNC )
{
FuncType* f = atype->AsFuncType();
if ( ! f->CheckArgs(tt->GetIndexTypes()) ||
! same_type(f->Yield(), ytype) )
if ( ! f->CheckArgs(tt->GetIndexTypes()) || ! same_type(f->Yield(), ytype) )
Error("&default function type clash");
// Ok.
@ -432,8 +430,7 @@ void Attributes::CheckAttr(Attr* a)
// Ok.
break;
if ( (atype->Tag() == TYPE_TABLE &&
atype->AsTableType()->IsUnspecifiedTable()) )
if ( (atype->Tag() == TYPE_TABLE && atype->AsTableType()->IsUnspecifiedTable()) )
{
auto e = check_and_promote_expr(a->GetExpr(), type);

View file

@ -263,8 +263,7 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
const auto& f = Func::GetFuncPtrByID(id);
if ( ! f )
reporter->InternalError(
"failed to look up unique function id %" PRIu32
reporter->InternalError("failed to look up unique function id %" PRIu32
" in CompositeHash::RecoverOneVal()",
id);
@ -314,8 +313,7 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
RE_Matcher* re = new RE_Matcher(texts[0], texts[1]);
if ( ! re->Compile() )
reporter->InternalError(
"failed compiling table/set key pattern: %s",
reporter->InternalError("failed compiling table/set key pattern: %s",
re->PatternText());
*pval = make_intrusive<PatternVal>(re);
@ -335,8 +333,7 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
Attributes* a = rt->FieldDecl(i)->attrs.get();
bool optional = (a && a->Find(ATTR_OPTIONAL));
if ( ! RecoverOneVal(hk, rt->GetFieldType(i).get(), &v, optional,
false) )
if ( ! RecoverOneVal(hk, rt->GetFieldType(i).get(), &v, optional, false) )
{
*pval = nullptr;
return false;
@ -378,8 +375,7 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
for ( int i = 0; i < n; ++i )
{
ValPtr key;
if ( ! RecoverOneVal(hk, tt->GetIndices().get(), &key, false,
false) )
if ( ! RecoverOneVal(hk, tt->GetIndices().get(), &key, false, false) )
{
*pval = nullptr;
return false;
@ -390,8 +386,7 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
else
{
ValPtr value;
if ( ! RecoverOneVal(hk, tt->Yield().get(), &value, false,
false) )
if ( ! RecoverOneVal(hk, tt->Yield().get(), &value, false, false) )
{
*pval = nullptr;
return false;
@ -455,8 +450,7 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
default:
{
reporter->InternalError(
"bad index type in CompositeHash::RecoverOneVal");
reporter->InternalError("bad index type in CompositeHash::RecoverOneVal");
*pval = nullptr;
return false;
}
@ -474,8 +468,7 @@ bool CompositeHash::RecoverOneVal(const HashKey& hk, Type* t, ValPtr* pval, bool
hk.EnsureReadSpace(n);
}
*pval =
make_intrusive<StringVal>(new String((const byte_vec)hk.KeyAtRead(), n, true));
*pval = make_intrusive<StringVal>(new String((const byte_vec)hk.KeyAtRead(), n, true));
hk.SkipRead("string", n);
}
break;
@ -569,10 +562,8 @@ bool CompositeHash::SingleValHash(HashKey& hk, const Val* v, Type* bt, bool type
hk.Allocate();
}
hk.Write("pattern-string1", static_cast<const void*>(texts[0]),
lens[0]);
hk.Write("pattern-string2", static_cast<const void*>(texts[1]),
lens[1]);
hk.Write("pattern-string1", static_cast<const void*>(texts[0]), lens[0]);
hk.Write("pattern-string2", static_cast<const void*>(texts[1]), lens[1]);
break;
}
@ -595,8 +586,8 @@ bool CompositeHash::SingleValHash(HashKey& hk, const Val* v, Type* bt, bool type
if ( ! (rv_i || optional_attr) )
return false;
if ( ! SingleValHash(hk, rv_i.get(), rt->GetFieldType(i).get(),
type_check, optional_attr, false) )
if ( ! SingleValHash(hk, rv_i.get(), rt->GetFieldType(i).get(), type_check,
optional_attr, false) )
return false;
}
break;
@ -616,16 +607,16 @@ bool CompositeHash::SingleValHash(HashKey& hk, const Val* v, Type* bt, bool type
{
auto key = kv.second;
if ( ! SingleValHash(hk, key.get(), key->GetType().get(),
type_check, false, false) )
if ( ! SingleValHash(hk, key.get(), key->GetType().get(), type_check, false,
false) )
return false;
if ( ! v->GetType()->IsSet() )
{
auto val = const_cast<TableVal*>(tv)->FindOrDefault(key);
if ( ! SingleValHash(hk, val.get(), val->GetType().get(),
type_check, false, false) )
if ( ! SingleValHash(hk, val.get(), val->GetType().get(), type_check,
false, false) )
return false;
}
}
@ -648,8 +639,8 @@ bool CompositeHash::SingleValHash(HashKey& hk, const Val* v, Type* bt, bool type
hk.Write("vector-idx", i);
hk.Write("vector-idx-present", val != nullptr);
if ( val && ! SingleValHash(hk, val.get(), vt->Yield().get(),
type_check, false, false) )
if ( val && ! SingleValHash(hk, val.get(), vt->Yield().get(), type_check,
false, false) )
return false;
}
}
@ -673,8 +664,8 @@ bool CompositeHash::SingleValHash(HashKey& hk, const Val* v, Type* bt, bool type
for ( int i = 0; i < lv->Length(); ++i )
{
Val* entry_val = lv->Idx(i).get();
if ( ! SingleValHash(hk, entry_val, entry_val->GetType().get(),
type_check, false, false) )
if ( ! SingleValHash(hk, entry_val, entry_val->GetType().get(), type_check,
false, false) )
return false;
}
}
@ -682,8 +673,7 @@ bool CompositeHash::SingleValHash(HashKey& hk, const Val* v, Type* bt, bool type
default:
{
reporter->InternalError(
"bad index type in CompositeHash::SingleValHash");
reporter->InternalError("bad index type in CompositeHash::SingleValHash");
return false;
}
}
@ -804,10 +794,9 @@ bool CompositeHash::ReserveSingleTypeKeySize(HashKey& hk, Type* bt, const Val* v
}
// +1 in the following to include null terminators
hk.Reserve("pattern-string1", strlen(v->AsPattern()->PatternText()) + 1,
hk.Reserve("pattern-string1", strlen(v->AsPattern()->PatternText()) + 1, 0);
hk.Reserve("pattern-string1", strlen(v->AsPattern()->AnywherePatternText()) + 1,
0);
hk.Reserve("pattern-string1",
strlen(v->AsPattern()->AnywherePatternText()) + 1, 0);
break;
}
@ -826,9 +815,9 @@ bool CompositeHash::ReserveSingleTypeKeySize(HashKey& hk, Type* bt, const Val* v
bool optional_attr = (a && a->Find(ATTR_OPTIONAL));
auto rv_v = rv ? rv->GetField(i) : nullptr;
if ( ! ReserveSingleTypeKeySize(
hk, rt->GetFieldType(i).get(), rv_v.get(), type_check,
optional_attr, calc_static_size, false) )
if ( ! ReserveSingleTypeKeySize(hk, rt->GetFieldType(i).get(), rv_v.get(),
type_check, optional_attr, calc_static_size,
false) )
return false;
}
break;
@ -856,9 +845,9 @@ bool CompositeHash::ReserveSingleTypeKeySize(HashKey& hk, Type* bt, const Val* v
if ( ! bt->IsSet() )
{
auto val = const_cast<TableVal*>(tv)->FindOrDefault(key);
if ( ! ReserveSingleTypeKeySize(hk, val->GetType().get(),
val.get(), type_check, false,
calc_static_size, false) )
if ( ! ReserveSingleTypeKeySize(hk, val->GetType().get(), val.get(),
type_check, false, calc_static_size,
false) )
return false;
}
}

View file

@ -379,8 +379,8 @@ const char* assign_to_index(ValPtr v1, ValPtr v2, ValPtr v3, bool& iterators_inv
auto vtt = vt->Tag();
std::string tn = vtt == TYPE_RECORD ? vt->GetName() : type_name(vtt);
return util::fmt(
"table index assignment failed for invalid type '%s', value: %s",
tn.data(), d.Description());
"table index assignment failed for invalid type '%s', value: %s", tn.data(),
d.Description());
}
else
return "assignment failed with null value";

View file

@ -278,15 +278,14 @@ void Func::CheckPluginResult(bool handled, const ValPtr& hook_result, FunctionFl
if ( (! yt) || yt->Tag() == TYPE_VOID )
{
if ( hook_result )
reporter->InternalError(
"plugin returned non-void result for void method %s", this->Name());
reporter->InternalError("plugin returned non-void result for void method %s",
this->Name());
}
else if ( hook_result && hook_result->GetType()->Tag() != yt->Tag() &&
yt->Tag() != TYPE_ANY )
{
reporter->InternalError(
"plugin returned wrong type (got %d, expecting %d) for %s",
reporter->InternalError("plugin returned wrong type (got %d, expecting %d) for %s",
hook_result->GetType()->Tag(), yt->Tag(), this->Name());
}

View file

@ -70,8 +70,7 @@ RecordValPtr IPv6_Hdr::ToVal(VectorValPtr chain) const
rv->Assign(5, make_intrusive<AddrVal>(IPAddr(ip6->ip6_src)));
rv->Assign(6, make_intrusive<AddrVal>(IPAddr(ip6->ip6_dst)));
if ( ! chain )
chain =
make_intrusive<VectorVal>(id::find_type<VectorType>("ip6_ext_hdr_chain"));
chain = make_intrusive<VectorVal>(id::find_type<VectorType>("ip6_ext_hdr_chain"));
rv->Assign(7, std::move(chain));
}
break;
@ -224,8 +223,8 @@ RecordValPtr IPv6_Hdr::ToVal(VectorValPtr chain) const
auto m = make_intrusive<RecordVal>(ip6_mob_hot_type);
m->Assign(0, ntohs(*((uint16_t*)msg_data)));
m->Assign(1, ntohll(*((uint64_t*)(msg_data + sizeof(uint16_t)))));
m->Assign(2, ntohll(*((uint64_t*)(msg_data + sizeof(uint16_t) +
sizeof(uint64_t)))));
m->Assign(
2, ntohll(*((uint64_t*)(msg_data + sizeof(uint16_t) + sizeof(uint64_t)))));
off += sizeof(uint16_t) + 2 * sizeof(uint64_t);
m->Assign(3, BuildOptionsVal(data + off, Length() - off));
msg->Assign(4, std::move(m));
@ -237,8 +236,8 @@ RecordValPtr IPv6_Hdr::ToVal(VectorValPtr chain) const
auto m = make_intrusive<RecordVal>(ip6_mob_cot_type);
m->Assign(0, ntohs(*((uint16_t*)msg_data)));
m->Assign(1, ntohll(*((uint64_t*)(msg_data + sizeof(uint16_t)))));
m->Assign(2, ntohll(*((uint64_t*)(msg_data + sizeof(uint16_t) +
sizeof(uint64_t)))));
m->Assign(
2, ntohll(*((uint64_t*)(msg_data + sizeof(uint16_t) + sizeof(uint64_t)))));
off += sizeof(uint16_t) + 2 * sizeof(uint64_t);
m->Assign(3, BuildOptionsVal(data + off, Length() - off));
msg->Assign(5, std::move(m));
@ -250,17 +249,13 @@ RecordValPtr IPv6_Hdr::ToVal(VectorValPtr chain) const
auto m = make_intrusive<RecordVal>(ip6_mob_bu_type);
m->Assign(0, ntohs(*((uint16_t*)msg_data)));
m->Assign(1, static_cast<bool>(
ntohs(*((uint16_t*)(msg_data + sizeof(uint16_t)))) &
0x8000));
ntohs(*((uint16_t*)(msg_data + sizeof(uint16_t)))) & 0x8000));
m->Assign(2, static_cast<bool>(
ntohs(*((uint16_t*)(msg_data + sizeof(uint16_t)))) &
0x4000));
ntohs(*((uint16_t*)(msg_data + sizeof(uint16_t)))) & 0x4000));
m->Assign(3, static_cast<bool>(
ntohs(*((uint16_t*)(msg_data + sizeof(uint16_t)))) &
0x2000));
ntohs(*((uint16_t*)(msg_data + sizeof(uint16_t)))) & 0x2000));
m->Assign(4, static_cast<bool>(
ntohs(*((uint16_t*)(msg_data + sizeof(uint16_t)))) &
0x1000));
ntohs(*((uint16_t*)(msg_data + sizeof(uint16_t)))) & 0x1000));
m->Assign(5, ntohs(*((uint16_t*)(msg_data + 2 * sizeof(uint16_t)))));
off += 3 * sizeof(uint16_t);
m->Assign(6, BuildOptionsVal(data + off, Length() - off));
@ -272,8 +267,8 @@ RecordValPtr IPv6_Hdr::ToVal(VectorValPtr chain) const
{
auto m = make_intrusive<RecordVal>(ip6_mob_back_type);
m->Assign(0, *((uint8_t*)msg_data));
m->Assign(1, static_cast<bool>(
*((uint8_t*)(msg_data + sizeof(uint8_t))) & 0x80));
m->Assign(1,
static_cast<bool>(*((uint8_t*)(msg_data + sizeof(uint8_t))) & 0x80));
m->Assign(2, ntohs(*((uint16_t*)(msg_data + sizeof(uint16_t)))));
m->Assign(3, ntohs(*((uint16_t*)(msg_data + 2 * sizeof(uint16_t)))));
off += 3 * sizeof(uint16_t);
@ -646,8 +641,7 @@ void IPv6_Hdr_Chain::ProcessDstOpts(const struct ip6_dest* d, uint16_t len)
// Double-check that the len can hold the whole option structure.
// Otherwise we get a buffer-overflow when we check the option_len.
// Also check that it holds everything for the option itself.
if ( len < sizeof(struct ip6_opt) ||
len < sizeof(struct ip6_opt) + opt->ip6o_len )
if ( len < sizeof(struct ip6_opt) || len < sizeof(struct ip6_opt) + opt->ip6o_len )
{
reporter->Weird(SrcAddr(), DstAddr(), "bad_ipv6_dest_opt_len");
len = 0;

View file

@ -2101,8 +2101,7 @@ bool same_type(const Type& arg_t1, const Type& arg_t2, bool is_init, bool match_
{
auto tt1 = t1->AsTypeType();
auto tt2 = t2->AsTypeType();
result =
same_type(tt1->GetType(), tt1->GetType(), is_init, match_record_field_names);
result = same_type(tt1->GetType(), tt1->GetType(), is_init, match_record_field_names);
break;
}

View file

@ -536,8 +536,7 @@ int BitTorrentTracker_Analyzer::ResponseParseBenc(void)
benc_raw_type = detail::BENC_TYPE_DIR;
/* fall through */
default:
VIOLATION_IF(benc_stack.back() == 'd' &&
! (benc_count.back() % 2),
VIOLATION_IF(benc_stack.back() == 'd' && ! (benc_count.back() % 2),
"BitTorrentTracker: directory key is not a string "
"but a directory")
++benc_raw_len;
@ -561,8 +560,7 @@ int BitTorrentTracker_Analyzer::ResponseParseBenc(void)
/* fall through */
default:
VIOLATION_IF(benc_stack.back() == 'd' &&
! (benc_count.back() % 2),
VIOLATION_IF(benc_stack.back() == 'd' && ! (benc_count.back() % 2),
"BitTorrentTracker: directory key is not a string "
"but a list")
++benc_raw_len;
@ -573,11 +571,9 @@ int BitTorrentTracker_Analyzer::ResponseParseBenc(void)
break;
case 'i':
VIOLATION_IF(
! benc_stack.size(),
VIOLATION_IF(! benc_stack.size(),
"BitTorrentTracker: not a bencoded directory (first char: i)")
VIOLATION_IF(
benc_stack.back() == 'd' && ! (benc_count.back() % 2),
VIOLATION_IF(benc_stack.back() == 'd' && ! (benc_count.back() % 2),
"BitTorrentTracker: directory key is not a string but an int")
if ( benc_raw_type != detail::BENC_TYPE_NONE )
@ -587,8 +583,7 @@ int BitTorrentTracker_Analyzer::ResponseParseBenc(void)
break;
case 'e':
VIOLATION_IF(
! benc_stack.size(),
VIOLATION_IF(! benc_stack.size(),
"BitTorrentTracker: not a bencoded directory (first char: e)")
VIOLATION_IF(benc_stack.back() == 'd' && benc_count.back() % 2,
"BitTorrentTracker: directory has an odd count of members")

View file

@ -801,8 +801,8 @@ bool DNS_Interpreter::ParseRR_EDNS(detail::DNS_MsgInfo* msg, const u_char*& data
break;
}
analyzer->EnqueueConnEvent(dns_EDNS_ecs, analyzer->ConnVal(),
msg->BuildHdrVal(), msg->BuildEDNS_ECS_Val(&opt));
analyzer->EnqueueConnEvent(dns_EDNS_ecs, analyzer->ConnVal(), msg->BuildHdrVal(),
msg->BuildEDNS_ECS_Val(&opt));
data += option_len;
break;
} // END EDNS ECS
@ -860,8 +860,7 @@ bool DNS_Interpreter::ParseRR_EDNS(detail::DNS_MsgInfo* msg, const u_char*& data
int client_cookie_len = 8;
int server_cookie_len = option_len - client_cookie_len;
cookie.client_cookie =
ExtractStream(data, client_cookie_len, client_cookie_len);
cookie.client_cookie = ExtractStream(data, client_cookie_len, client_cookie_len);
cookie.server_cookie = nullptr;
if ( server_cookie_len >= 8 )
@ -870,8 +869,7 @@ bool DNS_Interpreter::ParseRR_EDNS(detail::DNS_MsgInfo* msg, const u_char*& data
ExtractStream(data, server_cookie_len, server_cookie_len);
}
analyzer->EnqueueConnEvent(dns_EDNS_cookie, analyzer->ConnVal(),
msg->BuildHdrVal(),
analyzer->EnqueueConnEvent(dns_EDNS_cookie, analyzer->ConnVal(), msg->BuildHdrVal(),
msg->BuildEDNS_COOKIE_Val(&cookie));
break;

View file

@ -942,8 +942,7 @@ void HTTP_Analyzer::DeliverStream(int len, const u_char* data, bool is_orig)
request_ongoing = 1;
unanswered_requests.push(request_method);
HTTP_Request();
InitHTTPMessage(content_line, request_message, is_orig, HTTP_BODY_MAYBE,
len);
InitHTTPMessage(content_line, request_message, is_orig, HTTP_BODY_MAYBE, len);
}
else

View file

@ -209,8 +209,7 @@ void TelnetAuthenticateOption::RecvSubOption(u_char* data, int len)
{
case HERE_IS_AUTHENTICATION:
{
TelnetAuthenticateOption* peer =
(TelnetAuthenticateOption*)endp->FindPeerOption(code);
TelnetAuthenticateOption* peer = (TelnetAuthenticateOption*)endp->FindPeerOption(code);
if ( ! peer )
{

View file

@ -650,8 +650,7 @@ void Contents_RPC::DeliverStream(int len, const u_char* data, bool orig)
if ( ! dummy_p )
{
reporter->AnalyzerError(this,
"inconsistent RPC record marker extraction");
reporter->AnalyzerError(this, "inconsistent RPC record marker extraction");
return;
}
@ -692,9 +691,8 @@ void Contents_RPC::DeliverStream(int len, const u_char* data, bool orig)
const u_char* dummy_p = msg_buf.GetBuf();
int dummy_len = (int)msg_buf.GetFill();
if ( ! interp->DeliverRPC(dummy_p, dummy_len,
(int)msg_buf.GetExpected(), IsOrig(),
start_time, last_time) )
if ( ! interp->DeliverRPC(dummy_p, dummy_len, (int)msg_buf.GetExpected(),
IsOrig(), start_time, last_time) )
Conn()->Weird("partial_RPC");
state = WAIT_FOR_MESSAGE;

View file

@ -70,8 +70,7 @@ broker::backend_options to_backend_options(broker::backend backend, RecordVal* o
{
case broker::backend::sqlite:
{
auto path =
options->GetFieldAs<RecordVal>(0)->GetFieldAs<StringVal>(0)->CheckString();
auto path = options->GetFieldAs<RecordVal>(0)->GetFieldAs<StringVal>(0)->CheckString();
return {{"path", path}};
}

View file

@ -2354,8 +2354,7 @@ Val* Manager::ValueToVal(const Stream* i, const Value* val, Type* request_type,
auto t = make_intrusive<TableVal>(std::move(s));
for ( int j = 0; j < val->val.set_val.size; j++ )
{
Val* assignval =
ValueToVal(i, val->val.set_val.vals[j], type.get(), have_error);
Val* assignval = ValueToVal(i, val->val.set_val.vals[j], type.get(), have_error);
if ( have_error )
return nullptr;
@ -2401,8 +2400,8 @@ Val* Manager::ValueToVal(const Stream* i, const Value* val, Type* request_type,
bro_int_t index = request_type->AsEnumType()->Lookup(module, var.c_str());
if ( index == -1 )
{
Warning(i, "Value '%s' for stream '%s' is not a valid enum.",
enum_string.c_str(), i->name.c_str());
Warning(i, "Value '%s' for stream '%s' is not a valid enum.", enum_string.c_str(),
i->name.c_str());
have_error = true;
return nullptr;

View file

@ -278,8 +278,8 @@ int SQLite::AddParams(Value* val, int pos)
if ( ! val->val.string_val.length || val->val.string_val.length == 0 )
return sqlite3_bind_null(st, pos);
return sqlite3_bind_text(st, pos, val->val.string_val.data,
val->val.string_val.length, SQLITE_TRANSIENT);
return sqlite3_bind_text(st, pos, val->val.string_val.data, val->val.string_val.length,
SQLITE_TRANSIENT);
}
case TYPE_TABLE:

View file

@ -651,8 +651,8 @@ Val* Value::ValueToVal(const std::string& source, const Value* val, bool& have_e
int intval = t->Lookup(id->ModuleName(), id->Name());
if ( intval < 0 )
{
reporter->Warning("Enum value '%s' for source '%s' not found.",
enum_string.c_str(), source.c_str());
reporter->Warning("Enum value '%s' for source '%s' not found.", enum_string.c_str(),
source.c_str());
have_error = true;
return nullptr;

View file

@ -348,8 +348,8 @@ Value* Ascii::ParseValue(const string& s, const string& name, TypeTag type, Type
}
}
GetThread()->Warning(GetThread()->Fmt("String '%s' contained no parseable pattern.",
candidate.c_str()));
GetThread()->Warning(
GetThread()->Fmt("String '%s' contained no parseable pattern.", candidate.c_str()));
goto parse_error;
}

View file

@ -152,8 +152,7 @@ void JSON::BuildJSON(NullDoubleWriter& writer, Value* val, const std::string& na
if ( frac < 0 )
frac += 1;
snprintf(buffer2, sizeof(buffer2), "%s.%06.0fZ", buffer,
fabs(frac) * 1000000);
snprintf(buffer2, sizeof(buffer2), "%s.%06.0fZ", buffer, fabs(frac) * 1000000);
writer.String(buffer2, strlen(buffer2));
}
}

View file

@ -82,8 +82,7 @@ static void write_plugin_components(FILE* f, const plugin::Plugin* p)
{
case plugin::component::ANALYZER:
{
const analyzer::Component* c =
dynamic_cast<const analyzer::Component*>(component);
const analyzer::Component* c = dynamic_cast<const analyzer::Component*>(component);
if ( c )
write_analyzer_component(f, c);