Commit Graph

15 Commits

Author SHA1 Message Date
Cedric BAIL 49cb141f10 * eina_magic: Test suite now work when magic debug is disabled.
SVN revision: 42150
2009-09-01 12:17:13 +00:00
Vincent Torri 7a3b2110bf * more doc
* check the returned value of eina_error_init() in eina_module_init()


SVN revision: 41218
2009-06-28 06:29:11 +00:00
Vincent Torri 9110d8d574 fix a bit the documentation, but there are still
a lot of doc to write...


SVN revision: 41164
2009-06-22 20:03:58 +00:00
Vincent Torri 5bd14d2a05 * modify the way eina_config.h is built (see eina_config.h.in
and configure.ac)
 * include eina_config.h explicitely in files where the macros
   of eina_config.h are used
 * define eina_magic_string_init()  and eina_magic_string_shutdown()
   even when the mugle option is set (magic disabled)
 * formatting and fix in configure.ac


SVN revision: 40962
2009-06-08 08:27:33 +00:00
Gustavo Sverzut Barbieri b0ee5696a6 eina gets lots of gcc attributes to its api.
this should help with optimizations and code correctness, please see
"info gcc" for detailed explanation on these.

if you experience some functions not working as expected, please
double check if they're not marked with EINA_PURE or EINA_CONST, maybe
I misused them. Remove the macro and try again.

brief explanation:

 * EINA_WARN_UNUSED_RESULT: if you forgot to use the return of some
   function, it will emit a warning (and -Werror will make it an
   error). This way it will be harder to miss the attribution
   "l = eina_list_append(l, v)".

 * EINA_ARG_NONNULL(index, index...): if you give it an explicit NULL
   argument, or some tool (ie: clang) finds it could get a NULL but
   this is not accepted by API, then a warning will be emitted.  This
   will help those that still use eina_hash_add() as if it is
   evas_hash_add().

 * EINA_MALLOC: any non-NULL pointer it returns cannot alias any other
   pointer valid when function returns.

 * EINA_PURE: function have no effects other than the return and this
   return just depend on parameters and/or globals. You might call
   this function in a loop a thousand times and it will return the
   same value, thus you may move this function outside the loop and
   remove it.

 * EINA_CONST: stricter version of EINA_PURE, it will not check for
   global parameters, that is, you cannot consider pointer
   arguments. Use it for math things like "int sqrt(int)".

 * EINA_PRINTF(fmt, arg): will check format parameter specified in
   position "fmt" and passed arguments starting at position "arg", it
   will check for things like giving integers where short or strings
   were expected.

 * EINA_SCANF(fmt, arg): similar to eina_printf().

 * EINA_FORMAT(fmt): for use with things like dgettext(), it will get
   a printf-like format string and modifies it.

Please review and test it with your software, make sure you make clean
before you install the new version so it has any effect.

If you find some functions are missing EINA_WARN_UNUSED_RESULT and
EINA_ARG_NONNULL or others, please add them.



SVN revision: 38323
2008-12-26 13:17:51 +00:00
Cedric BAIL 199f900908 Application and library using Eina Magic API should be able to decide if they
want to check magic or not. This should not be forced by Eina config.


SVN revision: 38014
2008-12-08 10:18:05 +00:00
Gustavo Sverzut Barbieri 5939d76d9c Fix couple of issues with MAGIC handling.
eina_magic.h MUST include eina_config.h, otherwise it will not
consider EINA_MAGIC stuff. Worse than that, some files were including
that directly and were considering EINA_MAGIC attribute even if the
file that alloc'ed the memory were not!

Also add missing EINA_MAGIC_SET() to iterators and accessors.



SVN revision: 37960
2008-12-06 06:17:11 +00:00
Gustavo Sverzut Barbieri a00eaac6a6 Make it possible to create iterators outside Eina.
Many places in EFL we just create walk something, create a list with
walked data, return, then the user walks it again and then deletes
(which will walk again). For such cases it's way better to define
iterators or accessors.

I'm not moving any EFL code to it now, but if people are interested,
things like evas_render_method_list(), evas_font_available_list(),
evas_objects_at_xy_get(), evas_objects_in_rectangle_get(),
evas_object_smart_members_get() are good candidates. If the subject is
already using Eina list, then you can just use
eina_list_iterator_new() and return it, otherwise you can define your
own iterator, which is very easy.



SVN revision: 37956
2008-12-06 03:41:03 +00:00
Cedric BAIL a61ba1c35a Fix some warning.
SVN revision: 36563
2008-10-10 09:33:40 +00:00
Cedric BAIL 6f5b3584dd Store build information inside eina_config.h, and fix magic use.
SVN revision: 36263
2008-09-26 11:41:55 +00:00
Cedric BAIL 040e5573d9 Patch from Arnaud de Turckheim "quarium" <quarium@gmail.com>.
Use magic inside stringshare without slowdown of benchmark.
Fix magic when not in DEBUG mode.



SVN revision: 36246
2008-09-25 09:02:41 +00:00
Cedric BAIL ddaa7d4d8f License changes (BSD -> LGPL)
SVN revision: 35360
2008-08-06 18:15:24 +00:00
Cedric BAIL bf68fa183c Fix macro.
SVN revision: 35299
2008-08-01 14:25:20 +00:00
Cedric BAIL 9321fbbfdc Fix a typo.
SVN revision: 35276
2008-07-31 16:58:22 +00:00
Cedric BAIL e04f59c7b0 Export a magic API.
SVN revision: 35270
2008-07-31 15:08:19 +00:00