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

@@ -1,10 +1,10 @@
#include "testing/testing.hpp"
#include "coding/reader_writer_ops.hpp"
#include "coding/byte_stream.hpp"
#include "coding/file_reader.hpp"
#include "coding/file_writer.hpp"
#include "coding/read_write_utils.hpp"
#include "coding/byte_stream.hpp"
#include "coding/reader_writer_ops.hpp"
#include "base/random.hpp"
@@ -17,43 +17,43 @@ using namespace std;
namespace
{
void GetReverseForReaderAndTmpFile(Reader const & src, vector<char> & buffer)
void GetReverseForReaderAndTmpFile(Reader const & src, vector<char> & buffer)
{
char const * tmpFile = "reversed_file.tmp";
{
char const * tmpFile = "reversed_file.tmp";
{
FileWriter writer(tmpFile);
rw_ops::Reverse(src, writer);
}
{
FileReader reader(tmpFile);
buffer.clear();
MemWriter<vector<char> > writer(buffer);
rw_ops::Reverse(reader, writer);
}
FileWriter::DeleteFileX(tmpFile);
FileWriter writer(tmpFile);
rw_ops::Reverse(src, writer);
}
void FillRandFile(string const & fName, size_t count)
{
FileWriter writer(fName);
FileReader reader(tmpFile);
buffer.clear();
MemWriter<vector<char>> writer(buffer);
rw_ops::Reverse(reader, writer);
}
base::UniformRandom<int8_t> rand;
FileWriter::DeleteFileX(tmpFile);
}
while (count-- > 0)
{
int8_t const c = rand();
writer.Write(&c, 1);
}
void FillRandFile(string const & fName, size_t count)
{
FileWriter writer(fName);
base::UniformRandom<int8_t> rand;
while (count-- > 0)
{
int8_t const c = rand();
writer.Write(&c, 1);
}
}
} // namespace
UNIT_TEST(Reverse_Smoke)
{
{
char arr[] = { 0xA, 0xB, 0xC, 0xD, 0xF };
char arr[] = {0xA, 0xB, 0xC, 0xD, 0xF};
size_t const sz = ARRAY_SIZE(arr);
MemReader reader(&arr[0], sz);
@@ -86,17 +86,17 @@ UNIT_TEST(Reverse_Smoke)
namespace
{
struct ThePOD
{
uint32_t m_i;
double m_d;
};
struct ThePOD
{
uint32_t m_i;
double m_d;
};
bool operator==(ThePOD const & r1, ThePOD const & r2)
{
return (r1.m_i == r2.m_i && r1.m_d == r2.m_d);
}
bool operator==(ThePOD const & r1, ThePOD const & r2)
{
return (r1.m_i == r2.m_i && r1.m_d == r2.m_d);
}
} // namespace
UNIT_TEST(ReadWrite_POD)
{
@@ -111,7 +111,7 @@ UNIT_TEST(ReadWrite_POD)
}
vector<char> buffer;
PushBackByteSink<vector<char> > sink(buffer);
PushBackByteSink<vector<char>> sink(buffer);
rw::WriteVectorOfPOD(sink, src);
buffer_vector<ThePOD, 128> dest;
@@ -123,12 +123,11 @@ UNIT_TEST(ReadWrite_POD)
namespace
{
template <class T> void TestIntegral()
template <class T>
void TestIntegral()
{
std::vector<T> ethalon{ static_cast<T>(-1), 0, 1,
static_cast<T>(-2), 2,
std::numeric_limits<T>::min(), std::numeric_limits<T>::max()
};
std::vector<T> ethalon{static_cast<T>(-1), 0, 1, static_cast<T>(-2), 2, std::numeric_limits<T>::min(),
std::numeric_limits<T>::max()};
std::string buffer;
MemWriter writer(buffer);
@@ -141,7 +140,7 @@ template <class T> void TestIntegral()
TEST_EQUAL(ethalon, expected, ());
}
}
} // namespace
UNIT_TEST(ReadWrite_Integral)
{
@@ -151,4 +150,4 @@ UNIT_TEST(ReadWrite_Integral)
TestIntegral<int64_t>();
}
} // namespace rw_ops_tests
} // namespace rw_ops_tests