Format all C++ and Java code via clang-format

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-17 14:32:37 +07:00
parent 9f0290c0ec
commit bfffa1fff4
2169 changed files with 56441 additions and 64188 deletions

View File

@@ -18,18 +18,15 @@ IsHatchingTerritoryChecker::IsHatchingTerritoryChecker()
Classificator const & c = classif();
base::StringIL const arr3[] = {
{"boundary", "protected_area", "1"},
{"boundary", "protected_area", "1"},
};
for (auto const & sl : arr3)
m_types.push_back(c.GetTypeByPath(sl));
m_type3end = m_types.size();
base::StringIL const arr2[] = {
{"boundary", "aboriginal_lands"},
{"leisure", "nature_reserve"},
{"boundary", "national_park"},
{"landuse", "military"},
{"amenity", "prison"},
{"boundary", "aboriginal_lands"}, {"leisure", "nature_reserve"}, {"boundary", "national_park"},
{"landuse", "military"}, {"amenity", "prison"},
};
for (auto const & sl : arr2)
m_types.push_back(c.GetTypeByPath(sl));
@@ -45,8 +42,8 @@ bool IsHatchingTerritoryChecker::IsMatched(uint32_t type) const
return std::find(iEnd3, m_types.end(), PrepareToMatch(type, 2)) != m_types.end();
}
void CaptionDescription::Init(FeatureType & f, int8_t deviceLang, int zoomLevel,
feature::GeomType geomType, bool auxCaptionExists)
void CaptionDescription::Init(FeatureType & f, int8_t deviceLang, int zoomLevel, feature::GeomType geomType,
bool auxCaptionExists)
{
feature::NameParamsOut out;
// TODO(pastk) : remove forced secondary text for all lines and set it via styles for major roads and rivers only.
@@ -75,7 +72,7 @@ void CaptionDescription::Init(FeatureType & f, int8_t deviceLang, int zoomLevel,
}
// Set max text length to avoid VB/IB overflow in rendering.
size_t constexpr kMaxTextLength = 65;
size_t constexpr kMaxTextLength = 65;
if (strings::Truncate(m_mainText, kMaxTextLength))
m_mainText += "";
@@ -85,7 +82,8 @@ void CaptionDescription::Init(FeatureType & f, int8_t deviceLang, int zoomLevel,
if (geomType != feature::GeomType::Line && zoomLevel >= kHousenumbersMinZoom &&
(auxCaptionExists || m_mainText.empty()))
{
// TODO(pastk) : its not obvious that a housenumber display is dependent on a secondary caption drule existance in styles.
// TODO(pastk) : its not obvious that a housenumber display is dependent on a secondary caption drule existance in
// styles.
m_houseNumberText = f.GetHouseNumber();
if (!m_houseNumberText.empty() && !m_mainText.empty() && m_houseNumberText.find(m_mainText) != std::string::npos)
m_mainText.clear();
@@ -102,20 +100,18 @@ void Stylist::ProcessKey(FeatureType & f, drule::Key const & key)
switch (key.m_type)
{
case drule::symbol:
ASSERT(dRule->GetSymbol() && !m_symbolRule &&
(geomType == GeomType::Point || geomType == GeomType::Area),
ASSERT(dRule->GetSymbol() && !m_symbolRule && (geomType == GeomType::Point || geomType == GeomType::Area),
(m_symbolRule == nullptr, geomType, f.DebugString()));
m_symbolRule = dRule->GetSymbol();
break;
case drule::caption:
ASSERT(dRule->GetCaption() && dRule->GetCaption()->has_primary() && !m_captionRule &&
(geomType == GeomType::Point || geomType == GeomType::Area),
(geomType == GeomType::Point || geomType == GeomType::Area),
(m_captionRule == nullptr, f.DebugString()));
m_captionRule = dRule->GetCaption();
break;
case drule::pathtext:
ASSERT(dRule->GetPathtext() && dRule->GetPathtext()->has_primary() && !m_pathtextRule &&
geomType == GeomType::Line,
ASSERT(dRule->GetPathtext() && dRule->GetPathtext()->has_primary() && !m_pathtextRule && geomType == GeomType::Line,
(m_pathtextRule == nullptr, geomType, f.DebugString()));
m_pathtextRule = dRule->GetPathtext();
break;
@@ -144,9 +140,7 @@ void Stylist::ProcessKey(FeatureType & f, drule::Key const & key)
// TODO(pastk) : check if circle/waymarker support exists still (not used in styles ATM).
case drule::circle:
case drule::waymarker:
default:
ASSERT(false, (key.m_type, f.DebugString()));
return;
default: ASSERT(false, (key.m_type, f.DebugString())); return;
}
}
@@ -187,9 +181,8 @@ Stylist::Stylist(FeatureType & f, uint8_t zoomLevel, int8_t deviceLang)
for (auto & k : typeKeys)
{
// Take overlay drules from the main type only.
if (t == mainOverlayType ||
(k.m_type != drule::caption && k.m_type != drule::symbol &&
k.m_type != drule::shield && k.m_type != drule::pathtext))
if (t == mainOverlayType || (k.m_type != drule::caption && k.m_type != drule::symbol &&
k.m_type != drule::shield && k.m_type != drule::pathtext))
{
if (hasHatching && k.m_type == drule::area)
k.m_hatching = true;
@@ -211,8 +204,8 @@ Stylist::Stylist(FeatureType & f, uint8_t zoomLevel, int8_t deviceLang)
if (m_captionRule || m_pathtextRule)
{
bool const auxExists = (m_captionRule && m_captionRule->has_secondary()) ||
(m_pathtextRule && m_pathtextRule->has_secondary());
bool const auxExists =
(m_captionRule && m_captionRule->has_secondary()) || (m_pathtextRule && m_pathtextRule->has_secondary());
m_captionDescriptor.Init(f, deviceLang, zoomLevel, geomType, auxExists);
if (m_captionDescriptor.IsHouseNumberExists())