eolian: s/dflt/default/g

This commit is contained in:
Daniel Kolesa 2014-07-11 14:30:22 +01:00
parent 888dc3b6fe
commit 5d4cc031f9
11 changed files with 29 additions and 29 deletions

View File

@ -441,11 +441,11 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
func_env.lower_eo_func);
if (!ret_is_void)
{
const char *dflt_ret_val =
eolian_function_return_dflt_value_get(funcid, ftype);
const char *default_ret_val =
eolian_function_return_default_value_get(funcid, ftype);
eina_strbuf_append_printf(eo_func_decl, ", %s%s, %s",
ret_const ? "const " : "", rettype,
dflt_ret_val?dflt_ret_val:"0");
default_ret_val?default_ret_val:"0");
}
if (has_params)

View File

@ -291,12 +291,12 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
{
char tmp_ret_str[0xFF];
sprintf (tmp_ret_str, "%s%s", ret_const?"const ":"", rettype);
const char *dflt_ret_val =
eolian_function_return_dflt_value_get(funcid, ftype);
const char *default_ret_val =
eolian_function_return_default_value_get(funcid, ftype);
Eina_Bool had_star = !!strchr(rettype, '*');
sprintf (tmpstr, " %s%s%s%s = %s;\n",
ret_const?"const ":"", rettype, had_star?"":" ", retname,
dflt_ret_val?dflt_ret_val:"0");
default_ret_val?default_ret_val:"0");
eina_strbuf_replace_all(fbody, "@#ret_type", tmp_ret_str);
eina_strbuf_replace_all(fbody, "@#ret_init_val", tmpstr);

View File

@ -641,7 +641,7 @@ EAPI const Eolian_Type *eolian_function_return_type_get(const Eolian_Function *f
* @ingroup Eolian
*/
EAPI Eina_Stringshare *
eolian_function_return_dflt_value_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
eolian_function_return_default_value_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
/*
* @brief Get the return comment of a function.

View File

@ -137,8 +137,8 @@ _db_fill_accessor(Eolian_Function *foo_id, Eo_Class_Def *kls,
accessor->ret->comment);
database_function_return_flag_set_as_warn_unused(foo_id, ftype,
accessor->ret->warn_unused);
database_function_return_dflt_val_set(foo_id, ftype,
accessor->ret->dflt_ret_val);
database_function_return_default_val_set(foo_id, ftype,
accessor->ret->default_ret_val);
accessor->ret->type = NULL;
}
@ -247,8 +247,8 @@ _db_fill_method(Eolian_Class *cl, Eo_Class_Def *kls, Eo_Method_Def *meth)
meth->ret->comment);
database_function_return_flag_set_as_warn_unused(foo_id, EOLIAN_METHOD,
meth->ret->warn_unused);
database_function_return_dflt_val_set(foo_id, EOLIAN_METHOD,
meth->ret->dflt_ret_val);
database_function_return_default_val_set(foo_id, EOLIAN_METHOD,
meth->ret->default_ret_val);
meth->ret->type = NULL;
}

View File

@ -117,17 +117,17 @@ void database_function_return_type_set(Eolian_Function *fid, Eolian_Function_Typ
}
}
void database_function_return_dflt_val_set(Eolian_Function *fid, Eolian_Function_Type ftype, const char *ret_dflt_value)
void database_function_return_default_val_set(Eolian_Function *fid, Eolian_Function_Type ftype, const char *ret_default_value)
{
const char *key = NULL;
switch (ftype)
{
case EOLIAN_PROP_SET: key = PROP_SET_RETURN_DFLT_VAL; break;
case EOLIAN_PROP_GET: key = PROP_GET_RETURN_DFLT_VAL; break;
case EOLIAN_METHOD: key = METHOD_RETURN_DFLT_VAL; break;
case EOLIAN_PROP_SET: key = PROP_SET_RETURN_DEFAULT_VAL; break;
case EOLIAN_PROP_GET: key = PROP_GET_RETURN_DEFAULT_VAL; break;
case EOLIAN_METHOD: key = METHOD_RETURN_DEFAULT_VAL; break;
default: return;
}
database_function_data_set(fid, key, ret_dflt_value);
database_function_data_set(fid, key, ret_default_value);
}
void database_function_return_comment_set(Eolian_Function *fid, Eolian_Function_Type ftype, const char *ret_comment)

View File

@ -120,14 +120,14 @@ eolian_function_return_type_get(const Eolian_Function *fid, Eolian_Function_Type
}
EAPI Eina_Stringshare *
eolian_function_return_dflt_value_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
eolian_function_return_default_value_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
{
const char *key = NULL;
switch (ftype)
{
case EOLIAN_PROP_SET: key = PROP_SET_RETURN_DFLT_VAL; break;
case EOLIAN_PROP_GET: key = PROP_GET_RETURN_DFLT_VAL; break;
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: key = METHOD_RETURN_DFLT_VAL; break;
case EOLIAN_PROP_SET: key = PROP_SET_RETURN_DEFAULT_VAL; break;
case EOLIAN_PROP_GET: key = PROP_GET_RETURN_DEFAULT_VAL; break;
case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: key = METHOD_RETURN_DEFAULT_VAL; break;
default: return NULL;
}
return eolian_function_data_get(fid, key);

View File

@ -8,7 +8,7 @@ eo_definitions_ret_free(Eo_Ret_Def *ret)
{
if (ret->type) database_type_del(ret->type);
if (ret->comment) eina_stringshare_del(ret->comment);
if (ret->dflt_ret_val) eina_stringshare_del(ret->dflt_ret_val);
if (ret->default_ret_val) eina_stringshare_del(ret->default_ret_val);
free(ret);
}

View File

@ -12,7 +12,7 @@ typedef struct _Eo_Ret_Def
{
Eolian_Type *type;
Eina_Stringshare *comment;
Eina_Stringshare *dflt_ret_val;
Eina_Stringshare *default_ret_val;
Eina_Bool warn_unused:1;
} Eo_Ret_Def;

View File

@ -410,7 +410,7 @@ parse_return(Eo_Lexer *ls, Eina_Bool allow_void)
{
int line = ls->line_number, col = ls->column;
eo_lexer_get_balanced(ls, '(', ')');
ret->dflt_ret_val = eina_stringshare_add(ls->t.value);
ret->default_ret_val = eina_stringshare_add(ls->t.value);
eo_lexer_get(ls);
check_match(ls, ')', '(', line, col);
}

View File

@ -31,9 +31,9 @@ extern Eina_Prefix *_eolian_prefix;
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_eolian_log_dom, __VA_ARGS__)
#define PROP_GET_RETURN_DFLT_VAL "property_get_return_dflt_val"
#define PROP_SET_RETURN_DFLT_VAL "property_set_return_dflt_val"
#define METHOD_RETURN_DFLT_VAL "method_return_dflt_val"
#define PROP_GET_RETURN_DEFAULT_VAL "property_get_return_default_val"
#define PROP_SET_RETURN_DEFAULT_VAL "property_set_return_default_val"
#define METHOD_RETURN_DEFAULT_VAL "method_return_default_val"
#define EOLIAN_METHOD_RETURN_COMMENT "method_return_comment"
#define EOLIAN_PROP_GET_RETURN_COMMENT "property_get_return_comment"
@ -186,7 +186,7 @@ void database_function_data_set(Eolian_Function *function_id, const char *key, c
void database_function_return_type_set(Eolian_Function *foo_id, Eolian_Function_Type ftype, Eolian_Type *ret_type);
void database_function_return_comment_set(Eolian_Function *foo_id, Eolian_Function_Type ftype, const char *ret_comment);
void database_function_return_dflt_val_set(Eolian_Function *foo_id, Eolian_Function_Type ftype, const char *ret_dflt_value);
void database_function_return_default_val_set(Eolian_Function *foo_id, Eolian_Function_Type ftype, const char *ret_default_value);
void database_function_return_flag_set_as_warn_unused(Eolian_Function *foo_id, Eolian_Function_Type ftype, Eina_Bool warn_unused);
void database_function_object_set_as_const(Eolian_Function *foo_id, Eina_Bool is_const);

View File

@ -414,7 +414,7 @@ START_TEST(eolian_simple_parsing)
tp = eolian_function_return_type_get(fid, EOLIAN_PROP_SET);
fail_if(!tp);
fail_if(strcmp(eolian_type_name_get(tp), "Eina_Bool"));
string = eolian_function_return_dflt_value_get(fid, EOLIAN_PROP_SET);
string = eolian_function_return_default_value_get(fid, EOLIAN_PROP_SET);
fail_if(!string);
fail_if(strcmp(string, "EINA_TRUE"));
string = eolian_function_return_comment_get(fid, EOLIAN_PROP_SET);
@ -448,7 +448,7 @@ START_TEST(eolian_simple_parsing)
fail_if(!string);
fail_if(strcmp(string, "char *"));
eina_stringshare_del(string);
string = eolian_function_return_dflt_value_get(fid, EOLIAN_METHOD);
string = eolian_function_return_default_value_get(fid, EOLIAN_METHOD);
fail_if(!string);
fail_if(strcmp(string, "NULL"));
string = eolian_function_return_comment_get(fid, EOLIAN_METHOD);