Commit Graph

22 Commits

Author SHA1 Message Date
Cedric BAIL 17c820aef7 * eina: This initialisation is not needed, but will reduce llvm warning noise.
SVN revision: 42935
2009-10-07 12:06:52 +00:00
Iván Briano bbce7b5e0d Avoid clashes.
SVN revision: 42368
2009-09-09 15:53:50 +00:00
Iván Briano 555de0f914 Support EINA_INLIST to be anywhere in the struct with _FOREACH macros.
Fix pointer arithmetic with EINA_CONTAINER_GET.
Change Inlist test to have the int first and not assume a direct cast works.


SVN revision: 42366
2009-09-09 14:05:31 +00:00
Gustavo Sverzut Barbieri a6f46561e7 add missing stddef.h, required by offsetof()
SVN revision: 41327
2009-07-14 15:32:01 +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
Cedric BAIL c38a387a05 * eina: Patch from Albin Tonnerre that add a new accessor for Inlist container.
SVN revision: 40726
2009-05-18 14:49:57 +00:00
Gustavo Sverzut Barbieri 750bdfce3d inlist: add count.
SVN revision: 39465
2009-03-13 11:32:56 +00:00
Gustavo Sverzut Barbieri 27f001875b Fix EINA_INLIST_GET() macro.
now EINA_INLIST_GET(bla)->next will work, before it was like

 &bla->__in_list->next

which is wrong, since __in_list is not a pointer, rather the memory itself.



SVN revision: 39210
2009-02-25 16:24:00 +00:00
Gustavo Sverzut Barbieri ab95d9183d eina safety checks.
safety checks will report null pointers and other error conditions on
public api's and can be disabled by compile time check.

note that in order to have these checks working we need to make
EINA_ARG_NONNULL() void, otherwise GCC can remove these checks since
they're known to be false.

This commit also make two minor changes:

  * list and hash accessors and iterators are created even for empty
    entities. This is correct in my point of view since NULL should
    indicate error. Having these in were an optimziation, but not
    worth it, these are not the most common case and hitting this path
    is not of much cost.

 * unmarked some parameters as nonnull, mainly on list and inlist.



SVN revision: 38327
2008-12-26 18:31:14 +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
Gustavo Sverzut Barbieri 6203f4b6be do not segv on NULL inlist.
this was exposed by "make check", counter had no tests and it was failing.



SVN revision: 37957
2008-12-06 06:11:39 +00:00
Gustavo Sverzut Barbieri 72ae858dac fix _GET macros.
SVN revision: 37276
2008-10-28 16:37:32 +00:00
Cedric BAIL 68d377afe6 Rename EINA_INLIST_ITER_NEXT/EINA_INLIST_ITER_LAST to EINA_INLIST_FOREACH/
EINA_INLIST_REVERSE_FOREACH so it best match is behaviour. Asked by Gustavo.



SVN revision: 36928
2008-10-21 12:19:57 +00:00
Cedric BAIL 439401682d Reduce code size, and improve sort speed.
SVN revision: 36382
2008-10-01 16:30:30 +00:00
Cedric BAIL 8bda22fced Add some type checking to Inlined List.
SVN revision: 36084
2008-09-18 14:22:48 +00:00
Cedric BAIL bd76226a8f Expose Iterator/Accessor API for Inlist.
SVN revision: 35447
2008-08-12 16:02:09 +00:00
Cedric BAIL ddaa7d4d8f License changes (BSD -> LGPL)
SVN revision: 35360
2008-08-06 18:15:24 +00:00
Cedric BAIL ff9f4d3502 Cleanup headers.
SVN revision: 35349
2008-08-06 15:41:47 +00:00
Cedric BAIL 5f783f52d8 Add eina inlist tests suite, remove dead code and cleanup iterator.
SVN revision: 35302
2008-08-01 15:44:53 +00:00
Cedric BAIL a8aac59e01 Fix namespace.
SVN revision: 35268
2008-07-31 14:58:23 +00:00
Cedric BAIL 86f58ba639 Use only the needed headers per file and remove some warning.
SVN revision: 35253
2008-07-30 13:35:49 +00:00
Cedric BAIL a92e3d6c83 Adding turran work to unify EFL data types and functions.
SVN revision: 35248
2008-07-30 12:46:55 +00:00