forked from enlightenment/efl
eolian: rename is_ref API to is_ptr to match syntax
This commit is contained in:
parent
4a66bd14b7
commit
f399e77a92
|
@ -306,7 +306,7 @@ ffi.cdef [[
|
|||
size_t eolian_type_array_size_get(const Eolian_Type *tp);
|
||||
Eina_Bool eolian_type_is_own(const Eolian_Type *tp);
|
||||
Eina_Bool eolian_type_is_const(const Eolian_Type *tp);
|
||||
Eina_Bool eolian_type_is_ref(const Eolian_Type *tp);
|
||||
Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp);
|
||||
|
||||
Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
|
||||
|
||||
|
@ -668,8 +668,8 @@ M.Type = ffi.metatype("Eolian_Type", {
|
|||
return eolian.eolian_type_is_const(self) ~= 0
|
||||
end,
|
||||
|
||||
is_ref = function(self)
|
||||
return eolian.eolian_type_is_ref(self) ~= 0
|
||||
is_ptr = function(self)
|
||||
return eolian.eolian_type_is_ptr(self) ~= 0
|
||||
end,
|
||||
|
||||
c_type_get = function(self)
|
||||
|
|
|
@ -1801,7 +1801,7 @@ EAPI Eina_Bool eolian_type_is_const(const Eolian_Type *tp);
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Bool eolian_type_is_ref(const Eolian_Type *tp);
|
||||
EAPI Eina_Bool eolian_type_is_ptr(const Eolian_Type *tp);
|
||||
|
||||
/*
|
||||
* @brief Get the full C type name of the given type.
|
||||
|
|
|
@ -117,7 +117,7 @@ database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
|
|||
}
|
||||
if (tp->type == EOLIAN_TYPE_COMPLEX || tp->type == EOLIAN_TYPE_CLASS)
|
||||
_buf_add_suffix(buf, "*");
|
||||
if (tp->is_ref)
|
||||
if (tp->is_ptr)
|
||||
_buf_add_suffix(buf, "*");
|
||||
_buf_add_suffix(buf, name);
|
||||
}
|
||||
|
|
|
@ -335,10 +335,10 @@ eolian_type_is_const(const Eolian_Type *tp)
|
|||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
eolian_type_is_ref(const Eolian_Type *tp)
|
||||
eolian_type_is_ptr(const Eolian_Type *tp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
|
||||
return tp->is_ref;
|
||||
return tp->is_ptr;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
|
|
|
@ -709,7 +709,7 @@ static const Eina_Bool _ownable_types[] = {
|
|||
static Eina_Bool
|
||||
_type_is_ownable(Eolian_Type *tp)
|
||||
{
|
||||
if (tp->is_ref)
|
||||
if (tp->is_ptr)
|
||||
return EINA_TRUE;
|
||||
if (tp->type == EOLIAN_TYPE_REGULAR)
|
||||
{
|
||||
|
@ -766,7 +766,7 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ref, Eina_Bool allow_sarray)
|
|||
check_next(ls, '(');
|
||||
def = parse_type_void(ls, EINA_FALSE, EINA_FALSE);
|
||||
FILL_BASE(def->base, ls, line, col);
|
||||
def->is_ref = EINA_TRUE;
|
||||
def->is_ptr = EINA_TRUE;
|
||||
check_match(ls, ')', '(', pline, pcol);
|
||||
goto parse_ptr;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ struct _Eolian_Type
|
|||
size_t static_size;
|
||||
Eina_Bool is_const :1;
|
||||
Eina_Bool is_own :1;
|
||||
Eina_Bool is_ref :1;
|
||||
Eina_Bool is_ptr :1;
|
||||
};
|
||||
|
||||
struct _Eolian_Typedecl
|
||||
|
|
|
@ -611,7 +611,7 @@ START_TEST(eolian_simple_parsing)
|
|||
/* Method */
|
||||
fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
|
||||
fail_if(!eolian_function_is_beta(fid));
|
||||
fail_if(eolian_type_is_ref(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
|
||||
fail_if(eolian_type_is_ptr(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
|
||||
/* Function return */
|
||||
tp = eolian_function_return_type_get(fid, EOLIAN_METHOD);
|
||||
fail_if(!tp);
|
||||
|
@ -648,7 +648,7 @@ START_TEST(eolian_simple_parsing)
|
|||
fail_if(!(eina_iterator_next(iter, (void**)¶m)));
|
||||
fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
|
||||
fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
|
||||
fail_if(!eolian_type_is_ref(eolian_parameter_type_get(param)));
|
||||
fail_if(!eolian_type_is_ptr(eolian_parameter_type_get(param)));
|
||||
fail_if(strcmp(eolian_parameter_name_get(param), "d"));
|
||||
fail_if(eina_iterator_next(iter, &dummy));
|
||||
eina_iterator_free(iter);
|
||||
|
@ -658,7 +658,7 @@ START_TEST(eolian_simple_parsing)
|
|||
fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
|
||||
fail_if(!eolian_function_is_c_only(fid));
|
||||
fail_if(eolian_function_is_beta(fid));
|
||||
fail_if(!eolian_type_is_ref(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
|
||||
fail_if(!eolian_type_is_ptr(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
|
||||
|
||||
eolian_shutdown();
|
||||
}
|
||||
|
@ -692,18 +692,18 @@ START_TEST(eolian_struct)
|
|||
fail_if(strcmp(file, "struct.eo"));
|
||||
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "field")));
|
||||
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
|
||||
fail_if(!eolian_type_is_ref(ftype));
|
||||
fail_if(!eolian_type_is_ptr(ftype));
|
||||
fail_if(!(type_name = eolian_type_name_get(ftype)));
|
||||
fail_if(strcmp(type_name, "int"));
|
||||
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "something")));
|
||||
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
|
||||
fail_if(eolian_type_is_ref(ftype));
|
||||
fail_if(eolian_type_is_ptr(ftype));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(ftype)));
|
||||
fail_if(strcmp(type_name, "const char *"));
|
||||
eina_stringshare_del(type_name);
|
||||
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "arr")));
|
||||
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
|
||||
fail_if(eolian_type_is_ref(ftype));
|
||||
fail_if(eolian_type_is_ptr(ftype));
|
||||
fail_if(eolian_type_array_size_get(ftype) != 16);
|
||||
fail_if(eolian_type_type_get(ftype) != EOLIAN_TYPE_STATIC_ARRAY);
|
||||
fail_if(!(type_name = eolian_type_c_type_get(ftype)));
|
||||
|
@ -711,7 +711,7 @@ START_TEST(eolian_struct)
|
|||
eina_stringshare_del(type_name);
|
||||
fail_if(!(field = eolian_typedecl_struct_field_get(tdl, "tarr")));
|
||||
fail_if(!(ftype = eolian_typedecl_struct_field_type_get(field)));
|
||||
fail_if(eolian_type_is_ref(ftype));
|
||||
fail_if(eolian_type_is_ptr(ftype));
|
||||
fail_if(!(type_name = eolian_type_c_type_get(ftype)));
|
||||
fail_if(eolian_type_type_get(ftype) != EOLIAN_TYPE_TERMINATED_ARRAY);
|
||||
fail_if(strcmp(type_name, "const char **"));
|
||||
|
|
Loading…
Reference in New Issue