diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/eina/src/lib/eina_magic.c | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to '')
-rw-r--r-- | libraries/eina/src/lib/eina_magic.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libraries/eina/src/lib/eina_magic.c b/libraries/eina/src/lib/eina_magic.c index 1adde92..d1f71cc 100644 --- a/libraries/eina/src/lib/eina_magic.c +++ b/libraries/eina/src/lib/eina_magic.c | |||
@@ -79,7 +79,7 @@ _eina_magic_strings_sort_cmp(const void *p1, const void *p2) | |||
79 | static int | 79 | static int |
80 | _eina_magic_strings_find_cmp(const void *p1, const void *p2) | 80 | _eina_magic_strings_find_cmp(const void *p1, const void *p2) |
81 | { | 81 | { |
82 | Eina_Magic a = (Eina_Magic)p1; | 82 | Eina_Magic a = (Eina_Magic)(size_t)p1; |
83 | const Eina_Magic_String *b = p2; | 83 | const Eina_Magic_String *b = p2; |
84 | return a - b->magic; | 84 | return a - b->magic; |
85 | } | 85 | } |
@@ -129,6 +129,10 @@ _eina_magic_strings_alloc(void) | |||
129 | * Global * | 129 | * Global * |
130 | *============================================================================*/ | 130 | *============================================================================*/ |
131 | 131 | ||
132 | EAPI Eina_Error EINA_ERROR_MAGIC_FAILED = 0; | ||
133 | |||
134 | static const char EINA_ERROR_MAGIC_FAILED_STR[] = "Magic check failed."; | ||
135 | |||
132 | /** | 136 | /** |
133 | * @internal | 137 | * @internal |
134 | * @brief Initialize the magic string module. | 138 | * @brief Initialize the magic string module. |
@@ -150,6 +154,8 @@ eina_magic_string_init(void) | |||
150 | EINA_LOG_ERR("Could not register log domain: eina_magic_string"); | 154 | EINA_LOG_ERR("Could not register log domain: eina_magic_string"); |
151 | return EINA_FALSE; | 155 | return EINA_FALSE; |
152 | } | 156 | } |
157 | EINA_ERROR_MAGIC_FAILED = eina_error_msg_static_register( | ||
158 | EINA_ERROR_MAGIC_FAILED_STR); | ||
153 | 159 | ||
154 | return EINA_TRUE; | 160 | return EINA_TRUE; |
155 | } | 161 | } |
@@ -206,7 +212,7 @@ eina_magic_string_get(Eina_Magic magic) | |||
206 | _eina_magic_strings_dirty = 0; | 212 | _eina_magic_strings_dirty = 0; |
207 | } | 213 | } |
208 | 214 | ||
209 | ems = bsearch((void *)magic, _eina_magic_strings, | 215 | ems = bsearch((void *)(size_t)magic, _eina_magic_strings, |
210 | _eina_magic_strings_count, sizeof(Eina_Magic_String), | 216 | _eina_magic_strings_count, sizeof(Eina_Magic_String), |
211 | _eina_magic_strings_find_cmp); | 217 | _eina_magic_strings_find_cmp); |
212 | if (ems) | 218 | if (ems) |
@@ -271,6 +277,7 @@ eina_magic_fail(void *d, | |||
271 | const char *fnc, | 277 | const char *fnc, |
272 | int line) | 278 | int line) |
273 | { | 279 | { |
280 | eina_error_set(EINA_ERROR_MAGIC_FAILED); | ||
274 | if (!d) | 281 | if (!d) |
275 | eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, | 282 | eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, |
276 | file, fnc, line, | 283 | file, fnc, line, |