Commit Graph

11 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
Carsten Haitzler ddc6ba2c2a uncrustify eina.
SVN revision: 50573
2010-07-28 02:37:05 +00:00
Gustavo Sverzut Barbieri 926789e247 fix warnings.
SVN revision: 46498
2010-02-26 00:38:35 +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 944be7e745 Bugfix eina_list_search_sorted_near_list() add sorted_insert.
eina_list_search_sorted_near_list() was broken and barfed at my face
during development of eina_list_sorted_insert(), so I rewrote it
following more traditional approach, also adding special cases for
head/tail remembering that random access in lists is not as fast as
array. I also simplified that code.

eina_list_sorted_insert() should be fast, O(log2 n) insert, with
special cases to insert already sorted arrays forwards or backwards,
however I believe that it's better to simply append/prepend in those
cases (if known).



SVN revision: 41625
2009-08-06 22:31:45 +00:00
Gustavo Sverzut Barbieri 638e79b91e smarter eina_list_merge(), more tests.
eina_list_merge() now fixes the smallest list segment, not always the
right. Before if we joined a list 1 to 1000 segments we'd fix all the
1000 instead of the single at left.

Tests to make sure both code paths are being executed.



SVN revision: 41622
2009-08-06 18:35:53 +00:00
Cedric BAIL 1950725606 Add merge function to list data type.
SVN revision: 36922
2008-10-21 11:28:38 +00:00
Cedric BAIL 9ffada517d Faster sort initialisation.
SVN revision: 36359
2008-09-30 14:16:18 +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 8b85ce70d4 Patch from quarium.
Add magic to array and list.

Need to patch autotools to generate something like eina_config.h.



SVN revision: 36256
2008-09-25 14:46:16 +00:00
Cedric BAIL f193096aa8 Add eina_list test suite. Cleanup list implementation and share out of memory error.
SVN revision: 35378
2008-08-07 13:09:09 +00:00