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

@@ -15,10 +15,8 @@ bool IsTag(string const & str)
{
// tag consists of a-z or A-Z letters or _ and not empty
for (auto const c : str)
{
if (!(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z') && c != '_')
return false;
}
return !str.empty();
}
@@ -38,14 +36,14 @@ bool ParseSelector(string const & str, SelectorExpression & e)
// [tag]
if (str.empty())
return false; // invalid format
return false; // invalid format
// [!tag]
if (str[0] == '!')
{
string tag(str.begin() + 1, str.end());
if (!IsTag(tag))
return false; // invalid format
return false; // invalid format
e.m_operator = SelectorOperatorIsNotSet;
e.m_tag = std::move(tag);
@@ -65,7 +63,7 @@ bool ParseSelector(string const & str, SelectorExpression & e)
// Find first entrance of >, < or =
size_t pos = string::npos;
size_t len = 0;
char const c[] = { '>', '<', '=', 0 };
char const c[] = {'>', '<', '=', 0};
for (size_t i = 0; c[i] != 0; ++i)
{
size_t p = str.find(c[i]);
@@ -77,15 +75,15 @@ bool ParseSelector(string const & str, SelectorExpression & e)
}
// If there is no entrance or no space for tag or value then it is invalid format
if (pos == 0 || len == 0 || pos == str.size()-1)
return false; // invalid format
if (pos == 0 || len == 0 || pos == str.size() - 1)
return false; // invalid format
// Dedicate the operator type, real operator position and length
SelectorOperatorType op = SelectorOperatorUnknown;
if (str[pos] == '>')
{
op = SelectorOperatorGreater;
if (str[pos+1] == '=')
if (str[pos + 1] == '=')
{
++len;
op = SelectorOperatorGreaterOrEqual;
@@ -94,7 +92,7 @@ bool ParseSelector(string const & str, SelectorExpression & e)
else if (str[pos] == '<')
{
op = SelectorOperatorLess;
if (str[pos+1] == '=')
if (str[pos + 1] == '=')
{
++len;
op = SelectorOperatorLessOrEqual;
@@ -104,7 +102,7 @@ bool ParseSelector(string const & str, SelectorExpression & e)
{
ASSERT(str[pos] == '=', ());
op = SelectorOperatorEqual;
if (str[pos-1] == '!')
if (str[pos - 1] == '!')
{
--pos;
++len;
@@ -114,7 +112,7 @@ bool ParseSelector(string const & str, SelectorExpression & e)
string tag(str.begin(), str.begin() + pos);
if (!IsTag(tag))
return false; // invalid format
return false; // invalid format
e.m_operator = op;
e.m_tag = std::move(tag);