From 35ada5afffa1e6bc04cc9202b6eb4a1fcdf9441f Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 11 Jul 2014 12:22:36 +0100 Subject: [PATCH] eolian: update print code (it made some obsolete assumptions before) --- src/lib/eolian/database_print.c | 55 +++++++++++++++++++++++++------- src/lib/eolian/eolian_database.h | 4 --- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/lib/eolian/database_print.c b/src/lib/eolian/database_print.c index b0435f6c5b..274ff3c7fa 100644 --- a/src/lib/eolian/database_print.c +++ b/src/lib/eolian/database_print.c @@ -42,6 +42,7 @@ static Eina_Bool _function_print(const Eolian_Function *fid, int nb_spaces) { EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); const char *ret_desc = eolian_function_return_comment_get(fid, fid->type); + const Eolian_Type *tp; switch (fid->type) { case EOLIAN_PROPERTY: @@ -55,10 +56,20 @@ static Eina_Bool _function_print(const Eolian_Function *fid, int nb_spaces) if (str) printf("%*slegacy_get: <%s>\n", nb_spaces + 5, "", str); str = eolian_function_data_get(fid, EOLIAN_LEGACY_SET); if (str) printf("%*slegacy_set: <%s>\n", nb_spaces + 5, "", str); - str = eolian_function_data_get(fid, EOLIAN_PROP_GET_RETURN_TYPE); - if (str) printf("%*sreturn type for get: <%s>\n", nb_spaces + 5, "", str); - str = eolian_function_data_get(fid, EOLIAN_PROP_SET_RETURN_TYPE); - if (str) printf("%*sreturn type for set: <%s>\n", nb_spaces + 5, "", str); + tp = eolian_function_return_type_get(fid, EOLIAN_PROP_GET); + if (tp) + { + printf("%*sreturn type for get: <", nb_spaces + 5, ""); + database_type_print((Eolian_Type*)tp); + printf(">\n"); + } + tp = eolian_function_return_type_get(fid, EOLIAN_PROP_SET); + if (tp) + { + printf("%*sreturn type for set: <", nb_spaces + 5, ""); + database_type_print((Eolian_Type*)tp); + printf(">\n"); + } break; } case EOLIAN_PROP_GET: @@ -68,8 +79,13 @@ static Eina_Bool _function_print(const Eolian_Function *fid, int nb_spaces) if (str) printf("%*s<%s>\n", nb_spaces + 5, "", str); str = eolian_function_data_get(fid, EOLIAN_LEGACY_GET); if (str) printf("%*slegacy: <%s>\n", nb_spaces + 5, "", str); - str = eolian_function_data_get(fid, EOLIAN_PROP_GET_RETURN_TYPE); - if (str) printf("%*sreturn type: <%s>\n", nb_spaces + 5, "", str); + tp = eolian_function_return_type_get(fid, EOLIAN_PROP_GET); + if (tp) + { + printf("%*sreturn type: <", nb_spaces + 5, ""); + database_type_print((Eolian_Type*)tp); + printf(">\n"); + } break; } case EOLIAN_PROP_SET: @@ -79,8 +95,13 @@ static Eina_Bool _function_print(const Eolian_Function *fid, int nb_spaces) if (str) printf("%*s<%s>\n", nb_spaces + 5, "", str); str = eolian_function_data_get(fid, EOLIAN_LEGACY_SET); if (str) printf("%*slegacy: <%s>\n", nb_spaces + 5, "", str); - str = eolian_function_data_get(fid, EOLIAN_PROP_SET_RETURN_TYPE); - if (str) printf("%*sreturn type: <%s>\n", nb_spaces + 5, "", str); + tp = eolian_function_return_type_get(fid, EOLIAN_PROP_SET); + if (tp) + { + printf("%*sreturn type: <", nb_spaces + 5, ""); + database_type_print((Eolian_Type*)tp); + printf(">\n"); + } break; } case EOLIAN_METHOD: @@ -90,8 +111,13 @@ static Eina_Bool _function_print(const Eolian_Function *fid, int nb_spaces) if (str) printf("%*s<%s>\n", nb_spaces + 5, "", str); str = eolian_function_data_get(fid, EOLIAN_LEGACY); if (str) printf("%*slegacy: <%s>\n", nb_spaces + 5, "", str); - str = eolian_function_data_get(fid, EOLIAN_METHOD_RETURN_TYPE); - if (str) printf("%*sreturn type: <%s>\n", nb_spaces + 5, "", str); + tp = eolian_function_return_type_get(fid, EOLIAN_METHOD); + if (tp) + { + printf("%*sreturn type: <", nb_spaces + 5, ""); + database_type_print((Eolian_Type*)tp); + printf(">\n"); + } if (fid->obj_is_const) printf("%*sobj const: \n", nb_spaces + 5, ""); break; } @@ -102,8 +128,13 @@ static Eina_Bool _function_print(const Eolian_Function *fid, int nb_spaces) if (str) printf("%*s<%s>\n", nb_spaces + 5, "", str); str = eolian_function_data_get(fid, EOLIAN_LEGACY); if (str) printf("%*slegacy: <%s>\n", nb_spaces + 5, "", str); - str = eolian_function_data_get(fid, EOLIAN_METHOD_RETURN_TYPE); - if (str) printf("%*sreturn type: <%s>\n", nb_spaces + 5, "", str); + tp = eolian_function_return_type_get(fid, EOLIAN_CTOR); + if (tp) + { + printf("%*sreturn type: <", nb_spaces + 5, ""); + database_type_print((Eolian_Type*)tp); + printf(">\n"); + } break; } default: diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index f208138682..24557d0eec 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h @@ -35,10 +35,6 @@ extern Eina_Prefix *_eolian_prefix; #define PROP_SET_RETURN_DFLT_VAL "property_set_return_dflt_val" #define METHOD_RETURN_DFLT_VAL "method_return_dflt_val" -#define EOLIAN_METHOD_RETURN_TYPE "method_return_type" -#define EOLIAN_PROP_GET_RETURN_TYPE "property_get_return_type" -#define EOLIAN_PROP_SET_RETURN_TYPE "property_set_return_type" - #define EOLIAN_METHOD_RETURN_COMMENT "method_return_comment" #define EOLIAN_PROP_GET_RETURN_COMMENT "property_get_return_comment" #define EOLIAN_PROP_SET_RETURN_COMMENT "property_set_return_comment"