Stringname initial cleanup.

This commit is contained in:
Relintai 2023-05-26 18:47:43 +02:00
parent 90316fff65
commit 8d8409ed1e
2 changed files with 15 additions and 14 deletions

View File

@ -41,17 +41,6 @@ extern "C" {
static_assert(sizeof(pandemonium_string_name) == sizeof(StringName), "StringName size mismatch");
void GDAPI pandemonium_string_name_new(pandemonium_string_name *r_dest, const pandemonium_string *p_name) {
StringName *dest = (StringName *)r_dest;
const String *name = (const String *)p_name;
memnew_placement(dest, StringName(*name));
}
void GDAPI pandemonium_string_name_new_data(pandemonium_string_name *r_dest, const char *p_name) {
StringName *dest = (StringName *)r_dest;
memnew_placement(dest, StringName(p_name));
}
pandemonium_string GDAPI pandemonium_string_name_get_name(const pandemonium_string_name *p_self) {
pandemonium_string ret;
const StringName *self = (const StringName *)p_self;
@ -81,6 +70,17 @@ pandemonium_bool GDAPI pandemonium_string_name_operator_less(const pandemonium_s
return *self < *other;
}
void GDAPI pandemonium_string_name_new(pandemonium_string_name *r_dest, const pandemonium_string *p_name) {
StringName *dest = (StringName *)r_dest;
const String *name = (const String *)p_name;
memnew_placement(dest, StringName(*name));
}
void GDAPI pandemonium_string_name_new_data(pandemonium_string_name *r_dest, const char *p_name) {
StringName *dest = (StringName *)r_dest;
memnew_placement(dest, StringName(p_name));
}
void GDAPI pandemonium_string_name_destroy(pandemonium_string_name *p_self) {
StringName *self = (StringName *)p_self;
self->~StringName();

View File

@ -58,9 +58,6 @@ typedef struct {
extern "C" {
#endif
void GDAPI pandemonium_string_name_new(pandemonium_string_name *r_dest, const pandemonium_string *p_name);
void GDAPI pandemonium_string_name_new_data(pandemonium_string_name *r_dest, const char *p_name);
pandemonium_string GDAPI pandemonium_string_name_get_name(const pandemonium_string_name *p_self);
uint32_t GDAPI pandemonium_string_name_get_hash(const pandemonium_string_name *p_self);
@ -69,6 +66,10 @@ const void GDAPI *pandemonium_string_name_get_data_unique_pointer(const pandemon
pandemonium_bool GDAPI pandemonium_string_name_operator_equal(const pandemonium_string_name *p_self, const pandemonium_string_name *p_other);
pandemonium_bool GDAPI pandemonium_string_name_operator_less(const pandemonium_string_name *p_self, const pandemonium_string_name *p_other);
void GDAPI pandemonium_string_name_new(pandemonium_string_name *r_dest, const pandemonium_string *p_name);
void GDAPI pandemonium_string_name_new_data(pandemonium_string_name *r_dest, const char *p_name);
//static variant
void GDAPI pandemonium_string_name_destroy(pandemonium_string_name *p_self);
#ifdef __cplusplus