Merge pull request #704 from bruvzg/fix_const_ptr

pull/706/head
Rémi Verschelde 2022-02-16 13:29:29 +01:00 committed by GitHub
commit 7fa81e798b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 21 deletions

View File

@ -790,6 +790,8 @@ def generate_engine_classes_bindings(api, output_dir, use_template_get_node):
if "arguments" in method:
for argument in method["arguments"]:
type_name = argument["type"]
if type_name.startswith("const "):
type_name = type_name[6:]
if type_name.endswith("*"):
type_name = type_name[:-1]
if is_included(type_name, class_name):
@ -803,6 +805,8 @@ def generate_engine_classes_bindings(api, output_dir, use_template_get_node):
fully_used_classes.add("Ref")
if "return_value" in method:
type_name = method["return_value"]["type"]
if type_name.startswith("const "):
type_name = type_name[6:]
if type_name.endswith("*"):
type_name = type_name[:-1]
if is_included(type_name, class_name):

View File

@ -203,8 +203,8 @@ struct PtrToArg<const T *> {
return (const m_type *)(*(const void **)p_ptr); \
} \
typedef const m_type *EncodeT; \
_FORCE_INLINE_ static void encode(m_type *p_var, void *p_ptr) { \
*((void **)p_ptr) = p_var; \
_FORCE_INLINE_ static void encode(const m_type *p_var, const void *p_ptr) { \
*((const void **)p_ptr) = p_var; \
} \
}