Commit Graph

23 Commits

Author SHA1 Message Date
Lucas De Marchi 5a8a8c9014 Convert (hopefully) all comparisons to NULL
Apply badzero.cocci, badnull.coci and badnull2.cocci

This should convert all cases where there's a comparison to NULL to simpler
forms. This patch applies the following transformations:

code before patch               ||code after patch
===============================================================

return a == NULL;                 return !a;

return a != NULL;                 return !!a;

func(a == NULL);                  func(!a);

func(a != NULL);                  func(!!a);

b = a == NULL;                    b = !a;

b = a != NULL;                    b = !!a;

b = a == NULL ? c : d;            b = !a ? c : d;

b = a != NULL ? c : d;            b = a ? c : d;


other cases:

a == NULL                         !a
a != NULL                         a




SVN revision: 51487
2010-08-21 13:52:25 +00:00
Cedric BAIL e6f9cee051 * eina: fix structure content to be more futur proof and reduce
risk of ABI breakage.


SVN revision: 51390
2010-08-19 12:02:28 +00:00
Carsten Haitzler bed21c315d errrr... hmmm why did this change?
SVN revision: 50574
2010-07-28 02:48:11 +00:00
Carsten Haitzler ddc6ba2c2a uncrustify eina.
SVN revision: 50573
2010-07-28 02:37:05 +00:00
Christopher Michael 029111a9b8 Use different variable names. This was giving "shadowed declarations"
warnings during compile.



SVN revision: 45527
2010-01-24 19:51:22 +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
Vincent Torri 72b87160a2 * add eina_config.h in all source files. Fix linking with Visual Studio
* move eina_private.h and eina_safety_checks.h just after eina_config.h


SVN revision: 42077
2009-08-28 12:03:34 +00:00
Gustavo Sverzut Barbieri a772d03b40 inlist: docs, docs docs
SVN revision: 41328
2009-07-14 15:32:21 +00:00
Gustavo Sverzut Barbieri 9af4d08f79 one more safety check: do not remove element if it's not in any list.
This is the best we can do, but what should be done is to check if
element is really from that list.



SVN revision: 41326
2009-07-14 14:00:59 +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
Gustavo Sverzut Barbieri 750bdfce3d inlist: add count.
SVN revision: 39465
2009-03-13 11:32:56 +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 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
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
Vincent Torri b73180cd01 * add array doc
* eina_array_push() returns now a bool
 * fix compilation


SVN revision: 35871
2008-09-07 19:12:49 +00:00
Vincent Torri dafd079639 * move standard header files from eina_private.h to source files
* minor formatting


SVN revision: 35705
2008-08-28 07:46:42 +00:00
Cedric BAIL a7aaf30440 Merge common code.
SVN revision: 35455
2008-08-13 09:21:33 +00:00
Cedric BAIL d299b79375 Add Inlist Iterator.
SVN revision: 35445
2008-08-12 15:58:41 +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
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