All: Cleanup all files

Add newline to end of files and remove whitespace from end of lines
This commit is contained in:
2024-01-24 14:43:46 +02:00
parent 3441f63298
commit dfe5a2d665
226 changed files with 466 additions and 460 deletions

View File

@@ -249,11 +249,11 @@ namespace BAN
return {};
if (has_sso() && fits_in_sso(new_size))
return {};
char* new_data = (char*)allocator(new_size + 1);
if (new_data == nullptr)
return Error::from_errno(ENOMEM);
if (m_size)
memcpy(new_data, data(), m_size + 1);

View File

@@ -193,4 +193,4 @@ namespace BAN
return m_data;
}
}
}

View File

@@ -38,7 +38,7 @@ namespace BAN
}
BAN::Time from_unix_time(uint64_t unix_time)
{
{
BAN::Time time {};
time.second = unix_time % 60; unix_time /= 60;
@@ -68,4 +68,4 @@ namespace BAN
return time;
}
}
}

View File

@@ -39,7 +39,7 @@ namespace BAN
const Span<T> span() const { return Span(m_data, size()); }
constexpr size_type size() const;
const T* data() const { return m_data; }
T* data() { return m_data; }
@@ -109,4 +109,4 @@ namespace BAN
return S;
}
}
}

View File

@@ -39,4 +39,4 @@ namespace BAN
T m_value;
};
}
}

View File

@@ -125,7 +125,7 @@ namespace BAN
}
value_type* data() { return m_data; }
const value_type* data() const { return m_data; }
const value_type* data() const { return m_data; }
size_type size() const { return m_size; }
@@ -137,4 +137,4 @@ namespace BAN
using ByteSpan = ByteSpanGeneral<false>;
using ConstByteSpan = ByteSpanGeneral<true>;
}
}

View File

@@ -32,7 +32,7 @@ namespace BAN
size_type size() const { return m_size; }
bool empty() const { return size() == 0; }
bool full() const { return size() == capacity(); }
static constexpr size_type capacity() { return S; }
private:
@@ -110,4 +110,4 @@ namespace BAN
return (T*)(m_storage + index * sizeof(T));
}
}
}

View File

@@ -77,4 +77,4 @@ namespace BAN
T raw;
};
}
}

View File

@@ -192,7 +192,7 @@ namespace BAN::Formatter
if (sign)
*(--ptr) = '-';
print(putc, ptr);
}
@@ -205,10 +205,10 @@ namespace BAN::Formatter
frac_part = -frac_part;
print_integer(putc, int_part, format);
if (format.percision > 0)
putc('.');
for (int i = 0; i < format.percision; i++)
{
frac_part *= format.base;

View File

@@ -56,7 +56,7 @@ namespace BAN
return true;
return false;
}
void clear()
{
if (*this)
@@ -145,4 +145,4 @@ namespace BAN
alignas(CallableBase) uint8_t m_storage[m_size] { 0 };
};
}
}

View File

@@ -47,4 +47,4 @@ namespace BAN
}
};
}
}

View File

@@ -66,7 +66,7 @@ namespace BAN
ErrorOr<void> rebucket(size_type);
LinkedList<Entry>& get_bucket(const Key&);
const LinkedList<Entry>& get_bucket(const Key&) const;
private:
Vector<LinkedList<Entry>> m_buckets;
size_type m_size = 0;

View File

@@ -19,7 +19,7 @@ namespace BAN
using size_type = size_t;
using iterator = IteratorDouble<T, Vector, LinkedList, HashSet>;
using const_iterator = ConstIteratorDouble<T, Vector, LinkedList, HashSet>;
public:
HashSet() = default;
HashSet(const HashSet&);
@@ -206,4 +206,4 @@ namespace BAN
template<typename T, typename HASH = hash<T>>
using HashSetUnstable = HashSet<T, HASH, false>;
}
}

View File

@@ -9,4 +9,4 @@ namespace BAN
Break
};
}
}

View File

@@ -287,7 +287,7 @@ namespace BAN
{
Node* node = (Node*)BAN::allocator(sizeof(Node));
if (node == nullptr)
return Error::from_errno(ENOMEM);
return Error::from_errno(ENOMEM);
return node;
}
@@ -396,4 +396,4 @@ namespace BAN
return m_current;
}
}
}

View File

@@ -119,4 +119,4 @@ namespace BAN::Math
return result;
}
}
}

View File

@@ -72,7 +72,7 @@ namespace BAN
Optional<T>::Optional(const T& value)
: m_has_value(true)
{
new (m_storage) T(value);
new (m_storage) T(value);
}
template<typename T>
@@ -192,4 +192,4 @@ namespace BAN
m_has_value = false;
}
}
}

View File

@@ -225,4 +225,4 @@ namespace BAN
return {};
}
}
}

View File

@@ -25,4 +25,4 @@ namespace BAN
bool m_enabled { true };
};
}
}

View File

@@ -120,7 +120,7 @@ namespace BAN::sort
if (parent == 0)
break;
parent--;
}
}

View File

@@ -131,4 +131,4 @@ namespace BAN
return Span(m_data + start, length);
}
}
}

View File

@@ -44,7 +44,7 @@ namespace BAN
bool empty() const;
size_type size() const;
const char* data() const;
private:

View File

@@ -34,4 +34,4 @@ namespace BAN::Formatter
print(putc, "{} {} {} {2}:{2}:{2} GMT+0 {4}", week_days[time.week_day], months[time.month], time.day, time.hour, time.minute, time.second, time.year);
}
}
}

View File

@@ -102,4 +102,4 @@ namespace BAN
template<typename T> struct equal { constexpr bool operator()(const T& lhs, const T& rhs) const { return lhs == rhs; } };
template<typename T> struct greater { constexpr bool operator()(const T& lhs, const T& rhs) const { return lhs > rhs; } };
}
}

View File

@@ -28,7 +28,7 @@ namespace BAN::UTF8
for (uint32_t i = 1; i < length; i++)
if ((bytes[i] & 0xC0) != 0x80)
return UTF8::invalid;
switch (length)
{
case 1: return ((bytes[0] & 0x80) != 0x00) ? UTF8::invalid : bytes[0];
@@ -78,4 +78,4 @@ namespace BAN::UTF8
return true;
}
}
}

View File

@@ -67,7 +67,7 @@ namespace BAN
T* operator->()
{
ASSERT(m_pointer);
return m_pointer;
return m_pointer;
}
const T* operator->() const
@@ -95,4 +95,4 @@ namespace BAN
friend class UniqPtr;
};
}
}

View File

@@ -140,14 +140,14 @@ namespace BAN
Variant(T&& value) requires (can_have<T>() && !is_lvalue_reference_v<T>)
: m_index(detail::index<T, Ts...>())
{
new (m_storage) T(move(value));
new (m_storage) T(move(value));
}
template<typename T>
Variant(const T& value) requires (can_have<T>() && !is_lvalue_reference_v<T>)
: m_index(detail::index<T, Ts...>())
{
new (m_storage) T(value);
new (m_storage) T(value);
}
~Variant()
@@ -292,4 +292,4 @@ namespace BAN
size_t m_index { invalid_index() };
};
}
}

View File

@@ -38,7 +38,7 @@ namespace BAN
ErrorOr<void> emplace(size_type, Args&&...);
ErrorOr<void> insert(size_type, T&&);
ErrorOr<void> insert(size_type, const T&);
iterator begin() { return iterator(m_data); }
iterator end() { return iterator(m_data + m_size); }
const_iterator begin() const { return const_iterator(m_data); }

View File

@@ -104,4 +104,4 @@ namespace BAN
friend class Weakable<T>;
};
}
}