Merge pull request #89270 from Repiteo/enforce-typename-in-templates

Enforce template syntax `typename` over `class`
This commit is contained in:
Rémi Verschelde 2024-03-14 22:34:37 +01:00
commit 453485aede
No known key found for this signature in database
GPG key ID: C3336907360768E1
102 changed files with 541 additions and 538 deletions

View file

@ -70,7 +70,7 @@ protected:
AccessType get_access_type() const;
virtual String fix_path(const String &p_path) const;
template <class T>
template <typename T>
static Ref<DirAccess> _create_builtin() {
return memnew(T);
}
@ -130,7 +130,7 @@ public:
static Ref<DirAccess> create(AccessType p_access);
static Error get_open_error();
template <class T>
template <typename T>
static void make_default(AccessType p_access) {
create_func[p_access] = _create_builtin<T>;
}

View file

@ -114,7 +114,7 @@ private:
AccessType _access_type = ACCESS_FILESYSTEM;
static CreateFunc create_func[ACCESS_MAX]; /** default file access creation function for a platform */
template <class T>
template <typename T>
static Ref<FileAccess> _create_builtin() {
return memnew(T);
}
@ -226,7 +226,7 @@ public:
static PackedByteArray _get_file_as_bytes(const String &p_path) { return get_file_as_bytes(p_path, &last_file_open_error); }
static String _get_file_as_string(const String &p_path) { return get_file_as_string(p_path, &last_file_open_error); }
template <class T>
template <typename T>
static void make_default(AccessType p_access) {
create_func[p_access] = _create_builtin<T>;
}

View file

@ -679,7 +679,7 @@ static double _bicubic_interp_kernel(double x) {
return bc;
}
template <int CC, class T>
template <int CC, typename T>
static void _scale_cubic(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height) {
// get source image size
int width = p_src_width;
@ -766,7 +766,7 @@ static void _scale_cubic(const uint8_t *__restrict p_src, uint8_t *__restrict p_
}
}
template <int CC, class T>
template <int CC, typename T>
static void _scale_bilinear(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height) {
enum {
FRAC_BITS = 8,
@ -856,7 +856,7 @@ static void _scale_bilinear(const uint8_t *__restrict p_src, uint8_t *__restrict
}
}
template <int CC, class T>
template <int CC, typename T>
static void _scale_nearest(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height) {
for (uint32_t i = 0; i < p_dst_height; i++) {
uint32_t src_yofs = i * p_src_height / p_dst_height;
@ -883,7 +883,7 @@ static float _lanczos(float p_x) {
return Math::abs(p_x) >= LANCZOS_TYPE ? 0 : Math::sincn(p_x) * Math::sincn(p_x / LANCZOS_TYPE);
}
template <int CC, class T>
template <int CC, typename T>
static void _scale_lanczos(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height) {
int32_t src_width = p_src_width;
int32_t src_height = p_src_height;
@ -1665,7 +1665,7 @@ bool Image::_can_modify(Format p_format) const {
return p_format <= FORMAT_RGBE9995;
}
template <class Component, int CC, bool renormalize,
template <typename Component, int CC, bool renormalize,
void (*average_func)(Component &, const Component &, const Component &, const Component &, const Component &),
void (*renormalize_func)(Component *)>
static void _generate_po2_mipmap(const Component *p_src, Component *p_dst, uint32_t p_width, uint32_t p_height) {