From d02a51fd8db70e859945d38c28729140e0060148 Mon Sep 17 00:00:00 2001 From: Medusa Slockbower Date: Sat, 26 Jul 2025 21:13:32 -0400 Subject: [PATCH] - Removed Double Underscores for portability --- CMakeLists.txt | 32 ++++---- include/fennec/containers/array.h | 6 +- .../containers/detail/{__tuple.h => _tuple.h} | 10 +-- include/fennec/containers/tuple.h | 10 +-- .../filesystem/detail/{__stdio.h => _stdio.h} | 0 include/fennec/fproc/strings/cstring.h | 4 +- .../strings/detail/{__ctype.h => _ctype.h} | 0 .../strings/detail/{__locale.h => _locale.h} | 0 include/fennec/fproc/strings/locale.h | 2 +- include/fennec/fproc/strings/string.h | 2 +- include/fennec/fproc/strings/wcstring.h | 4 +- include/fennec/fproc/strings/wstring.h | 2 +- include/fennec/lang/assert.h | 6 +- include/fennec/lang/bits.h | 8 +- .../fennec/lang/detail/__numeric_transforms.h | 59 --------------- include/fennec/lang/detail/__type_traits.h | 75 ------------------- .../fennec/lang/detail/{__bits.h => _bits.h} | 54 ++++++------- .../fennec/lang/detail/{__int.h => _int.h} | 0 .../fennec/lang/detail/_numeric_transforms.h | 59 +++++++++++++++ .../lang/detail/{__stdlib.h => _stdlib.h} | 0 .../{__type_sequences.h => _type_sequences.h} | 10 +-- include/fennec/lang/detail/_type_traits.h | 75 +++++++++++++++++++ ...__type_transforms.h => _type_transforms.h} | 8 +- .../lang/detail/{__typeuuid.h => _typeuuid.h} | 2 +- include/fennec/lang/numeric_transforms.h | 6 +- include/fennec/lang/type_sequences.h | 6 +- include/fennec/lang/type_traits.h | 24 +++--- include/fennec/lang/type_transforms.h | 6 +- include/fennec/lang/types.h | 2 +- include/fennec/lang/typeuuid.h | 4 +- include/fennec/math/common.h | 2 +- .../fennec/math/detail/{__fwd.h => _fwd.h} | 6 +- .../fennec/math/detail/{__math.h => _math.h} | 0 .../math/detail/{__matrix.h => _matrix.h} | 2 +- .../math/detail/{__types.h => _types.h} | 4 +- .../{__vector_traits.h => _vector_traits.h} | 2 +- include/fennec/math/exponential.h | 2 +- include/fennec/math/matrix.h | 4 +- include/fennec/math/scalar.h | 4 +- include/fennec/math/trigonometric.h | 2 +- include/fennec/math/vector.h | 4 +- include/fennec/math/vector_base.h | 2 +- include/fennec/math/vector_traits.h | 2 +- include/fennec/memory/common.h | 2 +- .../detail/{__ptr_traits.h => _ptr_traits.h} | 24 +++--- .../memory/detail/{__string.h => _string.h} | 0 include/fennec/memory/ptr_traits.h | 6 +- source/debug/assert_impl.cpp | 2 +- source/lang/assert.cpp | 8 +- source/memory/new.cpp | 2 +- test/tests/math/test_matrix.h | 2 +- 51 files changed, 279 insertions(+), 279 deletions(-) rename include/fennec/containers/detail/{__tuple.h => _tuple.h} (87%) rename include/fennec/fproc/filesystem/detail/{__stdio.h => _stdio.h} (100%) rename include/fennec/fproc/strings/detail/{__ctype.h => _ctype.h} (100%) rename include/fennec/fproc/strings/detail/{__locale.h => _locale.h} (100%) delete mode 100644 include/fennec/lang/detail/__numeric_transforms.h delete mode 100644 include/fennec/lang/detail/__type_traits.h rename include/fennec/lang/detail/{__bits.h => _bits.h} (72%) rename include/fennec/lang/detail/{__int.h => _int.h} (100%) create mode 100644 include/fennec/lang/detail/_numeric_transforms.h rename include/fennec/lang/detail/{__stdlib.h => _stdlib.h} (100%) rename include/fennec/lang/detail/{__type_sequences.h => _type_sequences.h} (78%) create mode 100644 include/fennec/lang/detail/_type_traits.h rename include/fennec/lang/detail/{__type_transforms.h => _type_transforms.h} (89%) rename include/fennec/lang/detail/{__typeuuid.h => _typeuuid.h} (96%) rename include/fennec/math/detail/{__fwd.h => _fwd.h} (83%) rename include/fennec/math/detail/{__math.h => _math.h} (100%) rename include/fennec/math/detail/{__matrix.h => _matrix.h} (99%) rename include/fennec/math/detail/{__types.h => _types.h} (83%) rename include/fennec/math/detail/{__vector_traits.h => _vector_traits.h} (98%) rename include/fennec/memory/detail/{__ptr_traits.h => _ptr_traits.h} (74%) rename include/fennec/memory/detail/{__string.h => _string.h} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index c31dadb..78fd910 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ add_library(fennec STATIC include/fennec/containers/set.h include/fennec/containers/tuple.h - include/fennec/containers/detail/__tuple.h + include/fennec/containers/detail/_tuple.h # LANG ================================================================================================================= @@ -93,14 +93,14 @@ add_library(fennec STATIC include/fennec/lang/utility.h include/fennec/lang/integer.h - include/fennec/lang/detail/__bits.h - include/fennec/lang/detail/__int.h - include/fennec/lang/detail/__numeric_transforms.h - include/fennec/lang/detail/__stdlib.h - include/fennec/lang/detail/__type_traits.h - include/fennec/lang/detail/__type_transforms.h - include/fennec/lang/detail/__type_sequences.h - include/fennec/lang/detail/__typeuuid.h + include/fennec/lang/detail/_bits.h + include/fennec/lang/detail/_int.h + include/fennec/lang/detail/_numeric_transforms.h + include/fennec/lang/detail/_stdlib.h + include/fennec/lang/detail/_type_traits.h + include/fennec/lang/detail/_type_transforms.h + include/fennec/lang/detail/_type_sequences.h + include/fennec/lang/detail/_typeuuid.h include/fennec/lang/assert.h source/lang/assert.cpp @@ -115,7 +115,7 @@ add_library(fennec STATIC include/fennec/memory/pointers.h include/fennec/memory/ptr_traits.h - include/fennec/memory/detail/__ptr_traits.h + include/fennec/memory/detail/_ptr_traits.h # DEBUG ================================================================================================================ source/debug/assert_impl.cpp @@ -150,11 +150,11 @@ add_library(fennec STATIC include/fennec/math/ext/trigonometric.h - include/fennec/math/detail/__fwd.h - include/fennec/math/detail/__math.h - include/fennec/math/detail/__matrix.h - include/fennec/math/detail/__types.h - include/fennec/math/detail/__vector_traits.h + include/fennec/math/detail/_fwd.h + include/fennec/math/detail/_math.h + include/fennec/math/detail/_matrix.h + include/fennec/math/detail/_types.h + include/fennec/math/detail/_vector_traits.h # FPROC ================================================================================================================ @@ -163,7 +163,7 @@ add_library(fennec STATIC include/fennec/fproc/strings/locale.h include/fennec/fproc/strings/string.h - include/fennec/fproc/strings/detail/__ctype.h + include/fennec/fproc/strings/detail/_ctype.h # Filesystem include/fennec/fproc/filesystem/file.h source/fproc/filesystem/file.cpp diff --git a/include/fennec/containers/array.h b/include/fennec/containers/array.h index 2cceb48..3fedb8b 100644 --- a/include/fennec/containers/array.h +++ b/include/fennec/containers/array.h @@ -113,18 +113,18 @@ struct array /// /// \brief friend constexpr bool_t operator==(const array& lhs, const array& rhs) { - return array::__compare(lhs, rhs, make_index_sequence{}); + return array::_compare(lhs, rhs, make_index_sequence{}); } friend constexpr bool_t operator!=(const array& lhs, const array& rhs) { - return not array::__compare(lhs, rhs, make_index_sequence{}); + return not array::_compare(lhs, rhs, make_index_sequence{}); } /// @} private: template - static bool __compare(const array& lhs, const array& rhs, index_sequence) { + static bool _compare(const array& lhs, const array& rhs, index_sequence) { return ((lhs[i] == rhs[i]) && ...); } }; diff --git a/include/fennec/containers/detail/__tuple.h b/include/fennec/containers/detail/_tuple.h similarity index 87% rename from include/fennec/containers/detail/__tuple.h rename to include/fennec/containers/detail/_tuple.h index c6fe199..de3cd0a 100644 --- a/include/fennec/containers/detail/__tuple.h +++ b/include/fennec/containers/detail/_tuple.h @@ -26,11 +26,11 @@ namespace fennec::detail // leaves template -struct __tuple_leaf { +struct _tuple_leaf { T value; template - __tuple_leaf(ArgsT&&...args) : value(args...) { + _tuple_leaf(ArgsT&&...args) : value(args...) { } constexpr operator T&() { @@ -44,13 +44,13 @@ struct __tuple_leaf { // proxy template -struct __tuple; +struct _tuple; template -struct __tuple, TypesT...> : __tuple_leaf... { +struct _tuple, TypesT...> : _tuple_leaf... { template - __tuple(ArgsT&&...args) : __tuple_leaf(args)... { + _tuple(ArgsT&&...args) : _tuple_leaf(args)... { } }; diff --git a/include/fennec/containers/tuple.h b/include/fennec/containers/tuple.h index 6c0cf20..cd23e49 100644 --- a/include/fennec/containers/tuple.h +++ b/include/fennec/containers/tuple.h @@ -19,7 +19,7 @@ #ifndef FENNEC_CONTAINERS_TUPLE_H #define FENNEC_CONTAINERS_TUPLE_H -#include +#include #include namespace fennec @@ -33,23 +33,23 @@ template struct tuple; template constexpr typename tuple::template elem_t& get(tuple& x) { using elem_t = typename tuple::template elem_t; - auto& it = static_cast>(x); + auto& it = static_cast>(x); return it; } template constexpr const typename tuple::template elem_t& get(tuple& x) { using elem_t = typename tuple::template elem_t; - auto& it = static_cast>(x); + auto& it = static_cast>(x); return it; } template -struct tuple : detail::__tuple, TypesT...> { +struct tuple : detail::_tuple, TypesT...> { public: - using base_t = detail::__tuple, TypesT...>; + using base_t = detail::_tuple, TypesT...>; template using elem_t = nth_element; diff --git a/include/fennec/fproc/filesystem/detail/__stdio.h b/include/fennec/fproc/filesystem/detail/_stdio.h similarity index 100% rename from include/fennec/fproc/filesystem/detail/__stdio.h rename to include/fennec/fproc/filesystem/detail/_stdio.h diff --git a/include/fennec/fproc/strings/cstring.h b/include/fennec/fproc/strings/cstring.h index b26f2d2..63e2eb8 100644 --- a/include/fennec/fproc/strings/cstring.h +++ b/include/fennec/fproc/strings/cstring.h @@ -19,8 +19,8 @@ #ifndef FENNEC_FPROC_STRINGS_CSTRING_H #define FENNEC_FPROC_STRINGS_CSTRING_H -#include -#include +#include +#include #include diff --git a/include/fennec/fproc/strings/detail/__ctype.h b/include/fennec/fproc/strings/detail/_ctype.h similarity index 100% rename from include/fennec/fproc/strings/detail/__ctype.h rename to include/fennec/fproc/strings/detail/_ctype.h diff --git a/include/fennec/fproc/strings/detail/__locale.h b/include/fennec/fproc/strings/detail/_locale.h similarity index 100% rename from include/fennec/fproc/strings/detail/__locale.h rename to include/fennec/fproc/strings/detail/_locale.h diff --git a/include/fennec/fproc/strings/locale.h b/include/fennec/fproc/strings/locale.h index 2a0b43b..87b2600 100644 --- a/include/fennec/fproc/strings/locale.h +++ b/include/fennec/fproc/strings/locale.h @@ -19,7 +19,7 @@ #ifndef FENNEC_FPROC_STRINGS_LOCALE_H #define FENNEC_FPROC_STRINGS_LOCALE_H -#include +#include namespace fennec { diff --git a/include/fennec/fproc/strings/string.h b/include/fennec/fproc/strings/string.h index 9c15a83..77276cb 100644 --- a/include/fennec/fproc/strings/string.h +++ b/include/fennec/fproc/strings/string.h @@ -19,7 +19,7 @@ #ifndef FENNEC_FPROC_STRINGS_STRING_H #define FENNEC_FPROC_STRINGS_STRING_H -#include +#include #include #include diff --git a/include/fennec/fproc/strings/wcstring.h b/include/fennec/fproc/strings/wcstring.h index facb3a0..637d7a9 100644 --- a/include/fennec/fproc/strings/wcstring.h +++ b/include/fennec/fproc/strings/wcstring.h @@ -19,8 +19,8 @@ #ifndef FENNEC_FPROC_STRINGS_wcstring_H #define FENNEC_FPROC_STRINGS_wcstring_H -#include -#include +#include +#include #include diff --git a/include/fennec/fproc/strings/wstring.h b/include/fennec/fproc/strings/wstring.h index 893ebc8..e6d4a50 100644 --- a/include/fennec/fproc/strings/wstring.h +++ b/include/fennec/fproc/strings/wstring.h @@ -19,7 +19,7 @@ #ifndef FENNEC_FPROC_wstringS_wstring_H #define FENNEC_FPROC_wstringS_wstring_H -#include +#include #include #include diff --git a/include/fennec/lang/assert.h b/include/fennec/lang/assert.h index eefcdd5..1dc7c2a 100644 --- a/include/fennec/lang/assert.h +++ b/include/fennec/lang/assert.h @@ -70,17 +70,17 @@ using assert_handler = void (*)(const char *, const char *, int , const char *); -void __assert_impl(const char* expression, const char* file, int line, const char* function, const char* desc, bool halt); +void _assert_impl(const char* expression, const char* file, int line, const char* function, const char* desc, bool halt); // flagged unlikely to optimize branch prediction #define assert(expression, description) \ if(not(expression)) [[unlikely]] { \ - __assert_impl(#expression, __FILE__, __LINE__, __PRETTY_FUNCTION__, description, not FENNEC_RELEASE); \ + _assert_impl(#expression, __FILE__, __LINE__, __PRETTY_FUNCTION__, description, not FENNEC_RELEASE); \ } #define assertf(expression, description) \ if(not(expression)) [[unlikely]] { \ - __assert_impl(#expression, __FILE__, __LINE__, __PRETTY_FUNCTION__, description, true); \ + _assert_impl(#expression, __FILE__, __LINE__, __PRETTY_FUNCTION__, description, true); \ } #if FENNEC_RELEASE diff --git a/include/fennec/lang/bits.h b/include/fennec/lang/bits.h index c4d26ae..6d1d7c6 100644 --- a/include/fennec/lang/bits.h +++ b/include/fennec/lang/bits.h @@ -81,7 +81,7 @@ #include #include -#include +#include namespace fennec { @@ -126,7 +126,7 @@ constexpr void* bit_and(void* arr, const void* mask, size_t n) { const uint8_t* s = static_cast(mask); while (n > 0) { - const size_t step = detail::__bit_and(d, s, n); + const size_t step = detail::_bit_and(d, s, n); d += step; s += step; n -= step; } @@ -167,7 +167,7 @@ constexpr void* bit_or(void* arr, const void* mask, size_t n) { const uint8_t* s = static_cast(mask); while (n > 0) { - const size_t step = detail::__bit_or(d, s, n); + const size_t step = detail::_bit_or(d, s, n); d += step; s += step; n -= step; } @@ -207,7 +207,7 @@ constexpr void* bit_xor(void* arr, const void* mask, size_t n) { uint8_t* d = static_cast(arr); const uint8_t* s = static_cast(mask); while (n > 0) { - const size_t step = detail::__bit_xor(d, s, n); + const size_t step = detail::_bit_xor(d, s, n); d += step; s += step; n -= step; } diff --git a/include/fennec/lang/detail/__numeric_transforms.h b/include/fennec/lang/detail/__numeric_transforms.h deleted file mode 100644 index b98d433..0000000 --- a/include/fennec/lang/detail/__numeric_transforms.h +++ /dev/null @@ -1,59 +0,0 @@ -// ===================================================================================================================== -// fennec, a free and open source game engine -// Copyright © 2025 Medusa Slockbower -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// ===================================================================================================================== - -#ifndef FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H -#define FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H - -#include -#include - -namespace fennec::detail -{ - - template struct __make_unsigned : type_identity {}; - - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - template<> struct __make_unsigned : type_identity {}; - - - template struct __make_signed : type_identity {}; - - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - template<> struct __make_signed : type_identity {}; - -} - -#endif // FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H diff --git a/include/fennec/lang/detail/__type_traits.h b/include/fennec/lang/detail/__type_traits.h deleted file mode 100644 index f770620..0000000 --- a/include/fennec/lang/detail/__type_traits.h +++ /dev/null @@ -1,75 +0,0 @@ -// ===================================================================================================================== -// fennec, a free and open source game engine -// Copyright © 2025 Medusa Slockbower -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// ===================================================================================================================== - -#ifndef FENNEC_LANG_DETAIL_TYPE_TRAITS_H -#define FENNEC_LANG_DETAIL_TYPE_TRAITS_H - -#include -#include - -namespace fennec::detail -{ - - // Nothing interesting to note here - template struct __is_void : false_type {}; - template<> struct __is_void : true_type {}; - - template struct __is_bool : false_type {}; - template<> struct __is_bool : true_type {}; - - template struct __is_null_pointer : false_type {}; - template<> struct __is_null_pointer : true_type {}; - - // Provides definitions for all builtin int types - template struct __is_integral : false_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - template<> struct __is_integral : true_type {}; - - // Most unsigned types will underflow `-1` to the types maximum value - template struct __is_signed : bool_constant {}; - template struct __is_unsigned : bool_constant= TypeT(0)> {}; - - template struct __is_floating_point : false_type {}; - template<> struct __is_floating_point : true_type {}; - template<> struct __is_floating_point : true_type {}; - - template struct __is_pointer : false_type {}; - template struct __is_pointer : true_type {}; - - template U __declval(int); - template T __declval(long); - - template struct __declval_protector : bool_constant {}; - -} - -#endif // FENNEC_LANG_DETAIL_TYPE_TRAITS_H diff --git a/include/fennec/lang/detail/__bits.h b/include/fennec/lang/detail/_bits.h similarity index 72% rename from include/fennec/lang/detail/__bits.h rename to include/fennec/lang/detail/_bits.h index 7540f7d..5732a9e 100644 --- a/include/fennec/lang/detail/__bits.h +++ b/include/fennec/lang/detail/_bits.h @@ -25,112 +25,112 @@ namespace fennec::detail { // helper for bitwise and for 1 byte - constexpr size_t __bit_and_8(void* dst, const void* src) { + constexpr size_t _bit_and_8(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) & *static_cast(src); return 1; } // helper for bitwise and 2 bytes at once - constexpr size_t __bit_and_16(void* dst, const void* src) { + constexpr size_t _bit_and_16(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) & *static_cast(src); return 2; } // helper for bitwise and 4 bytes at once - constexpr size_t __bit_and_32(void* dst, const void* src) { + constexpr size_t _bit_and_32(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) & *static_cast(src); return 4; } // helper for bitwise and 8 bytes at once - constexpr size_t __bit_and_64(void* dst, const void* src) { + constexpr size_t _bit_and_64(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) & *static_cast(src); return 8; } // helper for selecting size - constexpr size_t __bit_and(void* dst, const void* src, size_t n) { + constexpr size_t _bit_and(void* dst, const void* src, size_t n) { switch (n) { case 0: return 0; case 1: - return __bit_and_8(dst, src); + return _bit_and_8(dst, src); case 2: case 3: - return __bit_and_16(dst, src); + return _bit_and_16(dst, src); case 4: case 5: case 6: case 7: - return __bit_and_32(dst, src); + return _bit_and_32(dst, src); default: - return __bit_and_64(dst, src); + return _bit_and_64(dst, src); } } // helper for bitwise or for 1 byte - constexpr size_t __bit_or_8(void* dst, const void* src) { + constexpr size_t _bit_or_8(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) | *static_cast(src); return 1; } // helper for bitwise or 2 bytes at once - constexpr size_t __bit_or_16(void* dst, const void* src) { + constexpr size_t _bit_or_16(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) | *static_cast(src); return 2; } // helper for bitwise or 4 bytes at once - constexpr size_t __bit_or_32(void* dst, const void* src) { + constexpr size_t _bit_or_32(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) | *static_cast(src); return 4; } // helper for bitwise or 8 bytes at once - constexpr size_t __bit_or_64(void* dst, const void* src) { + constexpr size_t _bit_or_64(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) | *static_cast(src); return 8; } // helper for selecting size - constexpr size_t __bit_or(void* dst, const void* src, size_t n) { + constexpr size_t _bit_or(void* dst, const void* src, size_t n) { switch (n) { case 0: return 0; case 1: - return __bit_or_8(dst, src); + return _bit_or_8(dst, src); case 2: case 3: - return __bit_or_16(dst, src); + return _bit_or_16(dst, src); case 4: case 5: case 6: case 7: - return __bit_or_32(dst, src); + return _bit_or_32(dst, src); default: - return __bit_or_64(dst, src); + return _bit_or_64(dst, src); } } // helper for bitwise and 1 byte - constexpr size_t __bit_xor_8(void* dst, const void* src) { + constexpr size_t _bit_xor_8(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) ^ *static_cast(src); return 1; } // helper for bitwise xor 2 bytes at once - constexpr size_t __bit_xor_16(void* dst, const void* src) { + constexpr size_t _bit_xor_16(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) ^ *static_cast(src); return 2; } // helper for bitwise xor 4 bytes at once - constexpr size_t __bit_xor_32(void* dst, const void* src) { + constexpr size_t _bit_xor_32(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) ^ *static_cast(src); return 4; } // helper for bitwise xor 8 bytes at once - constexpr size_t __bit_xor_64(void* dst, const void* src) { + constexpr size_t _bit_xor_64(void* dst, const void* src) { *static_cast(dst) = *static_cast(dst) ^ *static_cast(src); return 8; } // helper for selecting size - constexpr size_t __bit_xor(void* dst, const void* src, size_t n) { + constexpr size_t _bit_xor(void* dst, const void* src, size_t n) { switch (n) { case 0: return 0; case 1: - return __bit_xor_8(dst, src); + return _bit_xor_8(dst, src); case 2: case 3: - return __bit_xor_16(dst, src); + return _bit_xor_16(dst, src); case 4: case 5: case 6: case 7: - return __bit_xor_32(dst, src); + return _bit_xor_32(dst, src); default: - return __bit_xor_64(dst, src); + return _bit_xor_64(dst, src); } } diff --git a/include/fennec/lang/detail/__int.h b/include/fennec/lang/detail/_int.h similarity index 100% rename from include/fennec/lang/detail/__int.h rename to include/fennec/lang/detail/_int.h diff --git a/include/fennec/lang/detail/_numeric_transforms.h b/include/fennec/lang/detail/_numeric_transforms.h new file mode 100644 index 0000000..64880f9 --- /dev/null +++ b/include/fennec/lang/detail/_numeric_transforms.h @@ -0,0 +1,59 @@ +// ===================================================================================================================== +// fennec, a free and open source game engine +// Copyright © 2025 Medusa Slockbower +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// ===================================================================================================================== + +#ifndef FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H +#define FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H + +#include +#include + +namespace fennec::detail +{ + + template struct _make_unsigned : type_identity {}; + + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + template<> struct _make_unsigned : type_identity {}; + + + template struct _make_signed : type_identity {}; + + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + template<> struct _make_signed : type_identity {}; + +} + +#endif // FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H diff --git a/include/fennec/lang/detail/__stdlib.h b/include/fennec/lang/detail/_stdlib.h similarity index 100% rename from include/fennec/lang/detail/__stdlib.h rename to include/fennec/lang/detail/_stdlib.h diff --git a/include/fennec/lang/detail/__type_sequences.h b/include/fennec/lang/detail/_type_sequences.h similarity index 78% rename from include/fennec/lang/detail/__type_sequences.h rename to include/fennec/lang/detail/_type_sequences.h index 180bb4f..eba03cf 100644 --- a/include/fennec/lang/detail/__type_sequences.h +++ b/include/fennec/lang/detail/_type_sequences.h @@ -24,16 +24,16 @@ namespace fennec::detail { - template struct __first_element : type_identity {}; + template struct _first_element : type_identity {}; - template struct __nth_element; + template struct _nth_element; - template struct __nth_element : type_identity {}; + template struct _nth_element : type_identity {}; template - struct __nth_element : conditional< + struct _nth_element : conditional< n == i, type_identity, - __nth_element + _nth_element > {}; } diff --git a/include/fennec/lang/detail/_type_traits.h b/include/fennec/lang/detail/_type_traits.h new file mode 100644 index 0000000..c335876 --- /dev/null +++ b/include/fennec/lang/detail/_type_traits.h @@ -0,0 +1,75 @@ +// ===================================================================================================================== +// fennec, a free and open source game engine +// Copyright © 2025 Medusa Slockbower +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// ===================================================================================================================== + +#ifndef FENNEC_LANG_DETAIL_TYPE_TRAITS_H +#define FENNEC_LANG_DETAIL_TYPE_TRAITS_H + +#include +#include + +namespace fennec::detail +{ + + // Nothing interesting to note here + template struct _is_void : false_type {}; + template<> struct _is_void : true_type {}; + + template struct _is_bool : false_type {}; + template<> struct _is_bool : true_type {}; + + template struct _is_null_pointer : false_type {}; + template<> struct _is_null_pointer : true_type {}; + + // Provides definitions for all builtin int types + template struct _is_integral : false_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + template<> struct _is_integral : true_type {}; + + // Most unsigned types will underflow `-1` to the types maximum value + template struct _is_signed : bool_constant {}; + template struct _is_unsigned : bool_constant= TypeT(0)> {}; + + template struct _is_floating_point : false_type {}; + template<> struct _is_floating_point : true_type {}; + template<> struct _is_floating_point : true_type {}; + + template struct _is_pointer : false_type {}; + template struct _is_pointer : true_type {}; + + template U _declval(int); + template T _declval(long); + + template struct _declval_protector : bool_constant {}; + +} + +#endif // FENNEC_LANG_DETAIL_TYPE_TRAITS_H diff --git a/include/fennec/lang/detail/__type_transforms.h b/include/fennec/lang/detail/_type_transforms.h similarity index 89% rename from include/fennec/lang/detail/__type_transforms.h rename to include/fennec/lang/detail/_type_transforms.h index 63083fc..bfa4ee1 100644 --- a/include/fennec/lang/detail/__type_transforms.h +++ b/include/fennec/lang/detail/_type_transforms.h @@ -25,23 +25,23 @@ namespace fennec::detail { template - struct __add_lvalue_reference { + struct _add_lvalue_reference { using type = _Tp; }; template - struct __add_lvalue_reference<_Tp, void_t<_Tp&>> { + struct _add_lvalue_reference<_Tp, void_t<_Tp&>> { using type = _Tp&; }; template - struct __add_rvalue_reference { + struct _add_rvalue_reference { using type = _Tp; }; template - struct __add_rvalue_reference<_Tp, void_t<_Tp&&>> { + struct _add_rvalue_reference<_Tp, void_t<_Tp&&>> { using type = _Tp&&; }; diff --git a/include/fennec/lang/detail/__typeuuid.h b/include/fennec/lang/detail/_typeuuid.h similarity index 96% rename from include/fennec/lang/detail/__typeuuid.h rename to include/fennec/lang/detail/_typeuuid.h index d0469e6..ef1f632 100644 --- a/include/fennec/lang/detail/__typeuuid.h +++ b/include/fennec/lang/detail/_typeuuid.h @@ -25,7 +25,7 @@ namespace fennec::detail { template -FENNEC_NO_INLINE uint64_t __typeuuid() { +FENNEC_NO_INLINE uint64_t _typeuuid() { static uint64_t i = 0; return ++i; } diff --git a/include/fennec/lang/numeric_transforms.h b/include/fennec/lang/numeric_transforms.h index df45d83..be636ed 100644 --- a/include/fennec/lang/numeric_transforms.h +++ b/include/fennec/lang/numeric_transforms.h @@ -55,7 +55,7 @@ /// #include -#include +#include namespace fennec { @@ -63,7 +63,7 @@ namespace fennec /// /// \brief Get the corresponding signed integral type of TypeT /// \tparam TypeT the integral type to transform -template struct make_signed : detail::__make_signed> {}; +template struct make_signed : detail::_make_signed> {}; /// /// \brief Shorthand for `typename make_signed::type` @@ -73,7 +73,7 @@ template using make_signed_t = typename make_signed::type /// /// \brief Get the corresponding unsigned integral type of TypeT /// \tparam TypeT the integral type to transform -template struct make_unsigned : detail::__make_unsigned> {}; +template struct make_unsigned : detail::_make_unsigned> {}; /// /// \brief Shorthand for `typename make_unsigned::type` diff --git a/include/fennec/lang/type_sequences.h b/include/fennec/lang/type_sequences.h index 1632616..22ed6dc 100644 --- a/include/fennec/lang/type_sequences.h +++ b/include/fennec/lang/type_sequences.h @@ -54,7 +54,7 @@ /// /// -#include +#include namespace fennec { @@ -62,14 +62,14 @@ namespace fennec /// /// \brief Get the first element of a template parameter pack /// \tparam TypesT the Parameter Pack -template struct first_element : detail::__first_element {}; +template struct first_element : detail::_first_element {}; /// /// \brief alias for first_element::type template using first_element_t = typename first_element::type; -template struct nth_element : detail::__nth_element {}; +template struct nth_element : detail::_nth_element {}; /// diff --git a/include/fennec/lang/type_traits.h b/include/fennec/lang/type_traits.h index 12d99f4..1d297d4 100644 --- a/include/fennec/lang/type_traits.h +++ b/include/fennec/lang/type_traits.h @@ -107,16 +107,16 @@ /// #include -#include +#include namespace fennec { // fennec::declval ===================================================================================================== -template auto declval() noexcept -> decltype(detail::__declval(0)) { - static_assert(detail::__declval_protector{}, "declval must not be used"); - return detail::__declval(0); +template auto declval() noexcept -> decltype(detail::_declval(0)) { + static_assert(detail::_declval_protector{}, "declval must not be used"); + return detail::_declval(0); } constexpr inline bool is_constant_evaluated() noexcept { @@ -136,7 +136,7 @@ constexpr inline bool is_constant_evaluated() noexcept { /// \details Stores a boolean value in `is_void::value`, representing whether the provided type is of base type void. /// \tparam T type to check template struct is_void - : detail::__is_void>{}; + : detail::_is_void>{}; /// /// \brief shorthand for ```is_void::value``` @@ -153,7 +153,7 @@ template constexpr bool_t is_void_v = is_void::value; /// \details Stores a boolean value in `is_bool::value`, representing whether the provided type is of base type bool. /// \tparam T type to check template struct is_bool - : detail::__is_bool>{}; + : detail::_is_bool>{}; /// /// \brief shorthand for ```is_bool::value``` @@ -170,7 +170,7 @@ template constexpr bool_t is_bool_v = is_bool::value; /// \details Stores a boolean value in `is_null_pointer::value`, representing whether the provided type is of base type nullptr_t. /// \tparam T type to check template struct is_null_pointer - : detail::__is_null_pointer>{}; + : detail::_is_null_pointer>{}; /// /// \brief shorthand for ```is_null_pointer::value``` @@ -235,7 +235,7 @@ template constexpr size_t is_class_v = is_class::value; /// \details Stores a boolean value in `is_integral::value`, representing whether the provided type is of a base integer type. /// \tparam T type to check template struct is_integral - : detail::__is_integral> {}; + : detail::_is_integral> {}; /// /// \brief shorthand for ```is_integral::value``` @@ -249,7 +249,7 @@ template constexpr bool_t is_integral_v = is_integral::value; /// \details Checks if type `T` is a signed type i.e. `T(-1) < T(0)` and stores it in `is_same::value`. /// \tparam T type to check template struct is_signed - : detail::__is_signed> {}; + : detail::_is_signed> {}; /// /// \brief shorthand for ```is_signed::value``` @@ -263,7 +263,7 @@ template constexpr bool_t is_signed_v = is_signed::value; /// \details Checks if type `T` is an unsigned type i.e. `T(-1) > T(0)` and stores it in `is_same::value`. /// \tparam T type to check template struct is_unsigned - : detail::__is_unsigned> {}; + : detail::_is_unsigned> {}; /// /// \brief shorthand for ```is_unsigned::value``` @@ -280,7 +280,7 @@ template constexpr bool_t is_unsigned_v = is_unsigned::value; /// \details Checks if type `T` is a floating point type and store it in `is_same::value`. /// \tparam T type to check template struct is_floating_point - : detail::__is_floating_point>{}; + : detail::_is_floating_point>{}; /// /// \brief shorthand for ```is_floating_point::value``` @@ -296,7 +296,7 @@ template constexpr bool_t is_floating_point_v = is_floating_point /// \details Checks if type `T` is a floating point type and store it in `is_same::value`. /// \tparam T type to check template struct is_pointer - : detail::__is_pointer>{}; + : detail::_is_pointer>{}; /// /// \brief shorthand for ```is_floating_point::value``` diff --git a/include/fennec/lang/type_transforms.h b/include/fennec/lang/type_transforms.h index 46268dc..b81016d 100644 --- a/include/fennec/lang/type_transforms.h +++ b/include/fennec/lang/type_transforms.h @@ -32,7 +32,7 @@ #define FENNEC_LANG_TYPE_TRANSFORMS_H #include -#include +#include /// /// \page fennec_lang_type_transforms Type Transforms @@ -192,7 +192,7 @@ template using remove_reference_t = typename remove_reference::t /// /// \details adds a lvalue reference to the provided type such that 'T' becomes 'T&' /// \tparam T Reference Type -template struct add_lvalue_reference : detail::__add_lvalue_reference {}; +template struct add_lvalue_reference : detail::_add_lvalue_reference {}; /// /// \brief shorthand for `typename remove_reference::type` @@ -204,7 +204,7 @@ template using add_lvalue_reference_t = typename add_lvalue_referen /// /// \details adds a rvalue reference to the provided type such that 'T' becomes 'T&&' /// \tparam T Reference Type -template struct add_rvalue_reference : detail::__add_rvalue_reference {}; +template struct add_rvalue_reference : detail::_add_rvalue_reference {}; /// /// \brief shorthand for `typename remove_reference::type` diff --git a/include/fennec/lang/types.h b/include/fennec/lang/types.h index 18bb5ec..11c5fdf 100644 --- a/include/fennec/lang/types.h +++ b/include/fennec/lang/types.h @@ -201,7 +201,7 @@ /// /// -#include +#include #include diff --git a/include/fennec/lang/typeuuid.h b/include/fennec/lang/typeuuid.h index 6d46f6d..129f8a9 100644 --- a/include/fennec/lang/typeuuid.h +++ b/include/fennec/lang/typeuuid.h @@ -23,7 +23,7 @@ #include #include -#include +#include namespace fennec { @@ -39,7 +39,7 @@ FENNEC_NO_INLINE uint64_t typeuuid() { if (init) return id; init = true; - return id = detail::__typeuuid(); + return id = detail::_typeuuid(); } } diff --git a/include/fennec/math/common.h b/include/fennec/math/common.h index 3addc92..487a291 100644 --- a/include/fennec/math/common.h +++ b/include/fennec/math/common.h @@ -269,7 +269,7 @@ /// /// -#include +#include #include diff --git a/include/fennec/math/detail/__fwd.h b/include/fennec/math/detail/_fwd.h similarity index 83% rename from include/fennec/math/detail/__fwd.h rename to include/fennec/math/detail/_fwd.h index 135036d..3da4535 100644 --- a/include/fennec/math/detail/__fwd.h +++ b/include/fennec/math/detail/_fwd.h @@ -19,7 +19,7 @@ #ifndef FENNEC_MATH_DETAIL_FWD_H #define FENNEC_MATH_DETAIL_FWD_H -#include +#include namespace fennec { @@ -29,10 +29,10 @@ template struct matrix; // // Simplified interface for creating sized vectors or matrices template using vec - = decltype(detail::__gen_vector(make_index_sequence{})); // Gets the type returned by this function + = decltype(detail::_gen_vector(make_index_sequence{})); // Gets the type returned by this function template using mat - = decltype(detail::__gen_matrix(make_index_sequence{})); // Gets the type returned by this function + = decltype(detail::_gen_matrix(make_index_sequence{})); // Gets the type returned by this function } diff --git a/include/fennec/math/detail/__math.h b/include/fennec/math/detail/_math.h similarity index 100% rename from include/fennec/math/detail/__math.h rename to include/fennec/math/detail/_math.h diff --git a/include/fennec/math/detail/__matrix.h b/include/fennec/math/detail/_matrix.h similarity index 99% rename from include/fennec/math/detail/__matrix.h rename to include/fennec/math/detail/_matrix.h index 8e20cd8..ce2c3ab 100644 --- a/include/fennec/math/detail/__matrix.h +++ b/include/fennec/math/detail/_matrix.h @@ -19,7 +19,7 @@ #ifndef FENNEC_MATH_DETAIL_MATRIX_H #define FENNEC_MATH_DETAIL_MATRIX_H -#include +#include namespace fennec { diff --git a/include/fennec/math/detail/__types.h b/include/fennec/math/detail/_types.h similarity index 83% rename from include/fennec/math/detail/__types.h rename to include/fennec/math/detail/_types.h index 3da7c8d..df7f282 100644 --- a/include/fennec/math/detail/__types.h +++ b/include/fennec/math/detail/_types.h @@ -28,11 +28,11 @@ namespace detail { template typename VectorT, typename ScalarT, size_t...IndicesV> -VectorT __gen_vector(index_sequence); // Helper for substituting a size N with sequence of integers +VectorT _gen_vector(index_sequence); // Helper for substituting a size N with sequence of integers template typename MatrixT, typename ScalarT, size_t RowsV, size_t...IndicesV> -MatrixT __gen_matrix(index_sequence); // Helper for substituting a size Columns with sequence of integers +MatrixT _gen_matrix(index_sequence); // Helper for substituting a size Columns with sequence of integers } diff --git a/include/fennec/math/detail/__vector_traits.h b/include/fennec/math/detail/_vector_traits.h similarity index 98% rename from include/fennec/math/detail/__vector_traits.h rename to include/fennec/math/detail/_vector_traits.h index b4490ee..1f78893 100644 --- a/include/fennec/math/detail/__vector_traits.h +++ b/include/fennec/math/detail/_vector_traits.h @@ -19,7 +19,7 @@ #ifndef FENNEC_MATH_DETAIL_VECTOR_TRAITS_H #define FENNEC_MATH_DETAIL_VECTOR_TRAITS_H -#include +#include #include #include diff --git a/include/fennec/math/exponential.h b/include/fennec/math/exponential.h index c61add5..d13a26e 100644 --- a/include/fennec/math/exponential.h +++ b/include/fennec/math/exponential.h @@ -87,7 +87,7 @@ /// /// -#include +#include #include namespace fennec diff --git a/include/fennec/math/matrix.h b/include/fennec/math/matrix.h index c0827e9..6c3ee65 100644 --- a/include/fennec/math/matrix.h +++ b/include/fennec/math/matrix.h @@ -43,8 +43,8 @@ /// /// -#include -#include +#include +#include #include diff --git a/include/fennec/math/scalar.h b/include/fennec/math/scalar.h index b4e2136..7296e03 100644 --- a/include/fennec/math/scalar.h +++ b/include/fennec/math/scalar.h @@ -59,8 +59,8 @@ #include -#include -#include +#include +#include namespace fennec { diff --git a/include/fennec/math/trigonometric.h b/include/fennec/math/trigonometric.h index 969d557..d0bc588 100644 --- a/include/fennec/math/trigonometric.h +++ b/include/fennec/math/trigonometric.h @@ -144,7 +144,7 @@ /// /// -#include +#include namespace fennec { diff --git a/include/fennec/math/vector.h b/include/fennec/math/vector.h index a39f4a1..1a89b6a 100644 --- a/include/fennec/math/vector.h +++ b/include/fennec/math/vector.h @@ -103,7 +103,7 @@ /// /// -#include +#include #include #include @@ -120,7 +120,7 @@ namespace fennec /// \tparam ScalarT The type of the Components /// \tparam SizeV The number of Components template -using vec = decltype(detail::__gen_vector(make_index_sequence{})); +using vec = decltype(detail::_gen_vector(make_index_sequence{})); /// diff --git a/include/fennec/math/vector_base.h b/include/fennec/math/vector_base.h index 7d3751a..5313936 100644 --- a/include/fennec/math/vector_base.h +++ b/include/fennec/math/vector_base.h @@ -20,7 +20,7 @@ #ifndef FENNEC_MATH_VECTOR_BASE_H #define FENNEC_MATH_VECTOR_BASE_H -#include +#include #include #include diff --git a/include/fennec/math/vector_traits.h b/include/fennec/math/vector_traits.h index b08b454..0477177 100644 --- a/include/fennec/math/vector_traits.h +++ b/include/fennec/math/vector_traits.h @@ -63,7 +63,7 @@ /// /// -#include +#include namespace fennec { diff --git a/include/fennec/memory/common.h b/include/fennec/memory/common.h index 2415888..47e4f7e 100644 --- a/include/fennec/memory/common.h +++ b/include/fennec/memory/common.h @@ -33,7 +33,7 @@ #define FENNEC_MEMORY_H #include -#include +#include namespace fennec { diff --git a/include/fennec/memory/detail/__ptr_traits.h b/include/fennec/memory/detail/_ptr_traits.h similarity index 74% rename from include/fennec/memory/detail/__ptr_traits.h rename to include/fennec/memory/detail/_ptr_traits.h index 05a9ec2..5a5e8c7 100644 --- a/include/fennec/memory/detail/__ptr_traits.h +++ b/include/fennec/memory/detail/_ptr_traits.h @@ -32,15 +32,15 @@ namespace detail // helper to get the element type of the pointer class template -struct __ptr_get_element : first_element { }; // Default case, return the first template parameter +struct _ptr_get_element : first_element { }; // Default case, return the first template parameter // overload for types that have a member `ClassT::element_t` template requires requires { typename ClassT::element_t; } -struct __ptr_get_element { using type = typename ClassT::element_t; }; +struct _ptr_get_element { using type = typename ClassT::element_t; }; // helper for generating `pointer_to` template> -struct __ptr_traits_ptr_to +struct _ptr_traits_ptr_to { using pointer_t = PtrT; using element_t = ElemT; @@ -52,7 +52,7 @@ struct __ptr_traits_ptr_to // overload for C style pointers template -struct __ptr_traits_ptr_to +struct _ptr_traits_ptr_to { using pointer_t = ElemT*; using element_t = ElemT; @@ -64,28 +64,28 @@ struct __ptr_traits_ptr_to // underlying implementation for classes that behave like pointers template> -struct __ptr_traits_impl : __ptr_traits_ptr_to +struct _ptr_traits_impl : _ptr_traits_ptr_to { private: template - using __diff_t = typename TypeT::diff_t; // Helper to prevent substitution issues with detecting the difference type + using _diff_t = typename TypeT::diff_t; // Helper to prevent substitution issues with detecting the difference type template // Helper to prevent substitution issues with detecting a defined rebind - using __rebind_helper = type_identity>; + using _rebind_helper = type_identity>; public: using pointer_t = ClassT; - using element_t = __ptr_get_element; - using diff_t = __diff_t; + using element_t = _ptr_get_element; + using diff_t = _diff_t; - template using rebind = detect_t, __rebind_helper, ClassT, ElemT>; + template using rebind = detect_t, _rebind_helper, ClassT, ElemT>; }; // overload for an undefined type -template struct __ptr_traits_impl {}; +template struct _ptr_traits_impl {}; // overload for void element -template struct __ptr_traits_ptr_to { }; +template struct _ptr_traits_ptr_to { }; } diff --git a/include/fennec/memory/detail/__string.h b/include/fennec/memory/detail/_string.h similarity index 100% rename from include/fennec/memory/detail/__string.h rename to include/fennec/memory/detail/_string.h diff --git a/include/fennec/memory/ptr_traits.h b/include/fennec/memory/ptr_traits.h index d756d85..b8240e9 100644 --- a/include/fennec/memory/ptr_traits.h +++ b/include/fennec/memory/ptr_traits.h @@ -20,7 +20,7 @@ #define FENNEC_MEMORY_PTR_TRAITS_H #include -#include +#include namespace fennec { @@ -30,11 +30,11 @@ namespace fennec /// \tparam ClassT The Pointer class type template struct ptr_traits - : detail::__ptr_traits_impl> {}; + : detail::_ptr_traits_impl> {}; // overload for C-Style Pointers template -struct ptr_traits : detail::__ptr_traits_ptr_to +struct ptr_traits : detail::_ptr_traits_ptr_to { using pointer_t = ElemT*; using element_t = ElemT; diff --git a/source/debug/assert_impl.cpp b/source/debug/assert_impl.cpp index 933a5d4..9c924d6 100644 --- a/source/debug/assert_impl.cpp +++ b/source/debug/assert_impl.cpp @@ -19,7 +19,7 @@ #include #include -void __assert_callback(const char* expression, const char* file, int line, const char* function, const char* description) +void _assert_callback(const char* expression, const char* file, int line, const char* function, const char* description) { // Skip // __assert_callback diff --git a/source/lang/assert.cpp b/source/lang/assert.cpp index d4ace7f..2851d29 100644 --- a/source/lang/assert.cpp +++ b/source/lang/assert.cpp @@ -16,15 +16,15 @@ // along with this program. If not, see . // ===================================================================================================================== -#include +#include using assert_handler = void (*)(const char *, const char *, int , const char *); -void __assert_callback(const char* expression, const char* file, int line, const char* function, const char* description); +void _assert_callback(const char* expression, const char* file, int line, const char* function, const char* description); -void __assert_impl(const char* expression, const char* file, int line, const char* function, const char* description, bool halt) +void _assert_impl(const char* expression, const char* file, int line, const char* function, const char* description, bool halt) { - __assert_callback(expression, file, line, function, description); + _assert_callback(expression, file, line, function, description); if (halt) { ::abort(); diff --git a/source/memory/new.cpp b/source/memory/new.cpp index f313dd0..dc2b694 100644 --- a/source/memory/new.cpp +++ b/source/memory/new.cpp @@ -16,7 +16,7 @@ // along with this program. If not, see . // ===================================================================================================================== -#include +#include #include diff --git a/test/tests/math/test_matrix.h b/test/tests/math/test_matrix.h index 195e61f..5540a8e 100644 --- a/test/tests/math/test_matrix.h +++ b/test/tests/math/test_matrix.h @@ -20,7 +20,7 @@ #ifndef FENNEC_TEST_MATRIX_H #define FENNEC_TEST_MATRIX_H -#include +#include #include