Skip to content

Commit f01b6ad

Browse files
committed
sync templates
1 parent 82c6c44 commit f01b6ad

10 files changed

Lines changed: 622 additions & 654 deletions

File tree

include/godot_cpp/core/defs.hpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,23 +176,23 @@ namespace godot {
176176
#undef CLAMP
177177

178178
template <typename T>
179-
constexpr const T SIGN(const T m_v) {
180-
return m_v > 0 ? +1.0f : (m_v < 0 ? -1.0f : 0.0f);
179+
constexpr const T SIGN(const T p_value) {
180+
return p_value > 0 ? +1.0f : (p_value < 0 ? -1.0f : 0.0f);
181181
}
182182

183183
template <typename T, typename T2>
184-
constexpr auto MIN(const T m_a, const T2 m_b) {
185-
return m_a < m_b ? m_a : m_b;
184+
constexpr auto MIN(const T p_left, const T2 p_right) {
185+
return p_left < p_right ? p_left : p_right;
186186
}
187187

188188
template <typename T, typename T2>
189-
constexpr auto MAX(const T m_a, const T2 m_b) {
190-
return m_a > m_b ? m_a : m_b;
189+
constexpr auto MAX(const T p_left, const T2 p_right) {
190+
return p_left > p_right ? p_left : p_right;
191191
}
192192

193193
template <typename T, typename T2, typename T3>
194-
constexpr auto CLAMP(const T m_a, const T2 m_min, const T3 m_max) {
195-
return m_a < m_min ? m_min : (m_a > m_max ? m_max : m_a);
194+
constexpr auto CLAMP(const T p_value, const T2 p_min, const T3 p_max) {
195+
return p_value < p_min ? p_min : (p_value > p_max ? p_max : p_value);
196196
}
197197

198198
// Like std::size, but without requiring any additional includes.
@@ -308,6 +308,13 @@ struct is_zero_constructible<const volatile T> : is_zero_constructible<T> {};
308308
template <typename T>
309309
inline constexpr bool is_zero_constructible_v = is_zero_constructible<T>::value;
310310

311+
#if GD_HAS_CPP_ATTRIBUTE(gnu::warn_unused)
312+
// https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html#index-warn_005funused
313+
#define _WARN_UNUSED_ [[gnu::warn_unused]]
314+
#else
315+
#define _WARN_UNUSED_
316+
#endif
317+
311318
// Warning suppression helper macros.
312319
#if defined(__clang__)
313320
#define GODOT_CLANG_PRAGMA(m_content) _Pragma(#m_content)

include/godot_cpp/templates/hash_map.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
#pragma once
3232

33-
#include <godot_cpp/templates/sort_list.h>
3433
#include <godot_cpp/core/error_macros.hpp>
3534
#include <godot_cpp/core/memory.hpp>
3635
#include <godot_cpp/templates/hashfuncs.hpp>
3736
#include <godot_cpp/templates/pair.hpp>
37+
#include <godot_cpp/templates/sort_list.hpp>
3838

3939
#include <initializer_list>
4040

0 commit comments

Comments
 (0)