Commit Graph

12 Commits

Author SHA1 Message Date
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 d909319998 tests: explain some errors messages are expected and check for safety checks.
Many people try "make check" and then complain they have some error
messages, but they are actually expected... but even for the
experienced is hard to know whenever it was expected or not, so
explicitly say that.

Also check if safety checks are enabled or not before doing "break"
tests, otherwise we'll end with segfaults and tests failing. (I have
not tested with them disabled, but should be okay).



SVN revision: 42360
2009-09-09 01:53:40 +00:00
Gustavo Sverzut Barbieri 93b28743c5 remove warnings from tests.
SVN revision: 42359
2009-09-09 01:41:29 +00:00
Gustavo Sverzut Barbieri e4af7c100c EINA API BREAK: no more individual modules init/shutdown.
Being able to indivually initialize individual modules was initially
"good", but at end it's putting complexities on users that would try
to "optimize" by doing just what they used, but in the end most people
would get them wrong, users would have to do lots of code and etc. At
the end it does not worth.

Most module init just register handful errors and log domains, so are
cheap. The exception is mempool users, that would dlopen() stuff, but
people that are concerned (embedded) can just compile those statically
in eina.

Since at the end any real application would use most of modules, we
actually end saving lots of function calls that would do nothing other
than increment a global counter.

I also did the init/shutdown use an array, making it easier to
maintain. The inital dependencies were analysed by a script I wrote, I
hope it's all right.

Please fix any breakages you find!



SVN revision: 42300
2009-09-06 22:21:56 +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 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
Vincent Torri e88e4d5fb5 * fix warning in tests
* add config.h when needed
 * remove result/ dir before launching benchmark


SVN revision: 36321
2008-09-29 19:20:16 +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 e360e1b2b9 Cleanup.
SVN revision: 35446
2008-08-12 16:01:10 +00:00
Cedric BAIL ddaa7d4d8f License changes (BSD -> LGPL)
SVN revision: 35360
2008-08-06 18:15:24 +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