mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user