diff options
author | Tom Hacohen <tom@stosb.com> | 2012-08-23 14:24:32 +0000 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2012-08-23 14:24:32 +0000 |
commit | ef5e9f83ab29485d88d49ae7360a16d00dbdd139 (patch) | |
tree | fd27297fb906f1e1c809a1bbff76378510f7d66e /legacy/eobj | |
parent | fabeecd5ea8446866bf43b7c4c1ff2cf4ad0dc44 (diff) |
Eo: Remove volatile from the GCC issue workaround.
It seems that just setting to a temp var is enough to make GCC not
optimise it out. It seems GCC's problem is with the void cast.
Also, fixed another place that had the same issue.
SVN revision: 75624
Diffstat (limited to 'legacy/eobj')
-rw-r--r-- | legacy/eobj/src/lib/Eo.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/legacy/eobj/src/lib/Eo.h b/legacy/eobj/src/lib/Eo.h index f2a425b0f5..08f0a1aa0a 100644 --- a/legacy/eobj/src/lib/Eo.h +++ b/legacy/eobj/src/lib/Eo.h | |||
@@ -191,6 +191,7 @@ typedef struct _Eo_Event_Description Eo_Event_Description; | |||
191 | EAPI const Eo_Class * \ | 191 | EAPI const Eo_Class * \ |
192 | class_get_func_name(void) \ | 192 | class_get_func_name(void) \ |
193 | { \ | 193 | { \ |
194 | const Eo_Class *_tmp_parent_class; \ | ||
194 | static volatile char lk_init = 0; \ | 195 | static volatile char lk_init = 0; \ |
195 | static Eina_Lock _my_lock; \ | 196 | static Eina_Lock _my_lock; \ |
196 | static const Eo_Class * volatile _my_class = NULL; \ | 197 | static const Eo_Class * volatile _my_class = NULL; \ |
@@ -209,8 +210,8 @@ class_get_func_name(void) \ | |||
209 | return _my_class; \ | 210 | return _my_class; \ |
210 | } \ | 211 | } \ |
211 | eina_lock_release(&_eo_class_creation_lock); \ | 212 | eina_lock_release(&_eo_class_creation_lock); \ |
212 | (void) parent_class; \ | 213 | _tmp_parent_class = parent_class; \ |
213 | _my_class = eo_class_new(class_desc, parent_class, __VA_ARGS__); \ | 214 | _my_class = eo_class_new(class_desc, _tmp_parent_class, __VA_ARGS__); \ |
214 | eina_lock_release(&_my_lock); \ | 215 | eina_lock_release(&_my_lock); \ |
215 | \ | 216 | \ |
216 | eina_lock_take(&_eo_class_creation_lock); \ | 217 | eina_lock_take(&_eo_class_creation_lock); \ |
@@ -559,11 +560,13 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line); | |||
559 | * @param parent the parent to set to the object. | 560 | * @param parent the parent to set to the object. |
560 | * @param ... The ops to run. | 561 | * @param ... The ops to run. |
561 | * @return An handle to the new object on success, NULL otherwise. | 562 | * @return An handle to the new object on success, NULL otherwise. |
563 | * | ||
564 | * @see #eo_add_custom | ||
562 | */ | 565 | */ |
563 | #define eo_add(klass, parent, ...) \ | 566 | #define eo_add(klass, parent, ...) \ |
564 | ({ \ | 567 | ({ \ |
565 | volatile const Eo_Class *_tmp_klass = klass; \ | 568 | const Eo_Class *_tmp_klass = klass; \ |
566 | eo_add_internal((const Eo_Class *) _tmp_klass, parent, eo_constructor(), ## __VA_ARGS__, EO_NOOP); \ | 569 | eo_add_internal(_tmp_klass, parent, eo_constructor(), ## __VA_ARGS__, EO_NOOP); \ |
567 | }) | 570 | }) |
568 | 571 | ||
569 | /** | 572 | /** |
@@ -573,11 +576,13 @@ EAPI void eo_error_set_internal(const Eo *obj, const char *file, int line); | |||
573 | * @param parent the parent to set to the object. | 576 | * @param parent the parent to set to the object. |
574 | * @param ... The ops to run. With the constructor being first. | 577 | * @param ... The ops to run. With the constructor being first. |
575 | * @return An handle to the new object on success, NULL otherwise. | 578 | * @return An handle to the new object on success, NULL otherwise. |
579 | * | ||
580 | * @see #eo_add | ||
576 | */ | 581 | */ |
577 | #define eo_add_custom(klass, parent, ...) \ | 582 | #define eo_add_custom(klass, parent, ...) \ |
578 | ({ \ | 583 | ({ \ |
579 | volatile const Eo_Class *_tmp_klass = klass; \ | 584 | const Eo_Class *_tmp_klass = klass; \ |
580 | eo_add_internal((const Eo_Class *) _tmp_klass, parent, ## __VA_ARGS__, EO_NOOP); \ | 585 | eo_add_internal(_tmp_klass, parent, ## __VA_ARGS__, EO_NOOP); \ |
581 | }) | 586 | }) |
582 | 587 | ||
583 | /** | 588 | /** |