diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2018-04-18 15:49:14 -0700 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2018-05-01 10:39:01 -0700 |
commit | 550b14261ec5d50da46386a553d7a3a980a734f8 (patch) | |
tree | 15b40c4912778f47bce4b4a465df33642acf17b5 /src/lib/efl/interfaces/efl_model_common.c | |
parent | b30587f5b03f7acb8554b7e32fe94858e6566e0b (diff) |
efl: refactor model error creation.
Diffstat (limited to '')
-rw-r--r-- | src/lib/efl/interfaces/efl_model_common.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/lib/efl/interfaces/efl_model_common.c b/src/lib/efl/interfaces/efl_model_common.c index dabc388338..ecbbb59ecb 100644 --- a/src/lib/efl/interfaces/efl_model_common.c +++ b/src/lib/efl/interfaces/efl_model_common.c | |||
@@ -23,37 +23,25 @@ static const char EFL_MODEL_ERROR_PERMISSION_DENIED_STR[] = "Permission denied"; | |||
23 | static const char EFL_MODEL_ERROR_INCORRECT_VALUE_STR[] = "Incorrect value"; | 23 | static const char EFL_MODEL_ERROR_INCORRECT_VALUE_STR[] = "Incorrect value"; |
24 | static const char EFL_MODEL_ERROR_INVALID_OBJECT_STR[] = "Object is invalid"; | 24 | static const char EFL_MODEL_ERROR_INVALID_OBJECT_STR[] = "Object is invalid"; |
25 | 25 | ||
26 | #define _ERROR(Name) EFL_MODEL_ERROR_##Name = eina_error_msg_static_register(EFL_MODEL_ERROR_##Name##_STR); | ||
26 | 27 | ||
27 | EAPI int | 28 | EAPI int |
28 | efl_model_init(void) | 29 | efl_model_init(void) |
29 | { | 30 | { |
30 | EFL_MODEL_ERROR_INCORRECT_VALUE = eina_error_msg_static_register( | 31 | _ERROR(INCORRECT_VALUE); |
31 | EFL_MODEL_ERROR_INCORRECT_VALUE_STR); | 32 | _ERROR(UNKNOWN); |
32 | 33 | _ERROR(NOT_SUPPORTED); | |
33 | EFL_MODEL_ERROR_UNKNOWN = eina_error_msg_static_register( | 34 | _ERROR(NOT_FOUND); |
34 | EFL_MODEL_ERROR_UNKNOWN_STR); | 35 | _ERROR(READ_ONLY); |
35 | 36 | _ERROR(INIT_FAILED); | |
36 | EFL_MODEL_ERROR_NOT_SUPPORTED = eina_error_msg_static_register( | 37 | _ERROR(PERMISSION_DENIED); |
37 | EFL_MODEL_ERROR_NOT_SUPPORTED_STR); | 38 | _ERROR(INVALID_OBJECT); |
38 | |||
39 | EFL_MODEL_ERROR_NOT_FOUND = eina_error_msg_static_register( | ||
40 | EFL_MODEL_ERROR_NOT_FOUND_STR); | ||
41 | |||
42 | EFL_MODEL_ERROR_READ_ONLY = eina_error_msg_static_register( | ||
43 | EFL_MODEL_ERROR_READ_ONLY_STR); | ||
44 | |||
45 | EFL_MODEL_ERROR_INIT_FAILED = eina_error_msg_static_register( | ||
46 | EFL_MODEL_ERROR_INIT_FAILED_STR); | ||
47 | |||
48 | EFL_MODEL_ERROR_PERMISSION_DENIED = eina_error_msg_static_register( | ||
49 | EFL_MODEL_ERROR_PERMISSION_DENIED_STR); | ||
50 | |||
51 | EFL_MODEL_ERROR_INVALID_OBJECT = eina_error_msg_static_register( | ||
52 | EFL_MODEL_ERROR_INVALID_OBJECT_STR); | ||
53 | 39 | ||
54 | return EINA_TRUE; | 40 | return EINA_TRUE; |
55 | } | 41 | } |
56 | 42 | ||
43 | #undef _ERROR | ||
44 | |||
57 | EAPI void | 45 | EAPI void |
58 | _efl_model_properties_changed_internal(const Efl_Model *model, ...) | 46 | _efl_model_properties_changed_internal(const Efl_Model *model, ...) |
59 | { | 47 | { |