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

@@ -10,9 +10,7 @@ namespace traits
namespace impl
{
template <typename T>
auto has_arrow_operator_checker(int) -> decltype(
std::declval<T &>().operator->(),
std::true_type {});
auto has_arrow_operator_checker(int) -> decltype(std::declval<T &>().operator->(), std::true_type{});
template <typename T>
std::false_type has_arrow_operator_checker(...);
@@ -23,8 +21,8 @@ using has_arrow_operator = decltype(impl::has_arrow_operator_checker<T>(0));
} // namespace traits
template <class Sink, typename T>
std::enable_if_t<!traits::has_arrow_operator<Sink>::value &&
(std::is_integral<T>::value || std::is_enum<T>::value), void>
std::enable_if_t<!traits::has_arrow_operator<Sink>::value && (std::is_integral<T>::value || std::is_enum<T>::value),
void>
WriteToSink(Sink & sink, T const & v)
{
T const t = SwapIfBigEndianMacroBased(v);
@@ -32,8 +30,8 @@ WriteToSink(Sink & sink, T const & v)
}
template <class Sink, typename T>
std::enable_if_t<traits::has_arrow_operator<Sink>::value &&
(std::is_integral<T>::value || std::is_enum<T>::value), void>
std::enable_if_t<traits::has_arrow_operator<Sink>::value && (std::is_integral<T>::value || std::is_enum<T>::value),
void>
WriteToSink(Sink & sink, T const & v)
{
T const t = SwapIfBigEndianMacroBased(v);
@@ -43,7 +41,7 @@ WriteToSink(Sink & sink, T const & v)
template <class Sink>
void WriteZeroesToSink(Sink & sink, uint64_t size)
{
uint8_t const zeroes[256] = { 0 };
uint8_t const zeroes[256] = {0};
for (uint64_t i = 0; i < (size >> 8); ++i)
sink.Write(zeroes, 256);
sink.Write(zeroes, size & 255);
@@ -55,7 +53,8 @@ class WriterFunctor
public:
explicit WriterFunctor(Sink & sink) : m_sink(sink) {}
template <typename T> void operator() (T const & t) const
template <typename T>
void operator()(T const & t) const
{
m_sink.Write(&t, sizeof(T));
}