Commit Graph

39 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
Brett Nash 4efb9d70af Add ustr tests.
SVN revision: 50737
2010-08-02 09:43:51 +00:00
Carsten Haitzler ddc6ba2c2a uncrustify eina.
SVN revision: 50573
2010-07-28 02:37:05 +00:00
Tom Hacohen 6b69189efd Eina: Added ustringshare and binshare tests.
Fixed a small bug in binshare (in the length function).
Moved some debug messages around.

SVN revision: 50541
2010-07-27 11:43:37 +00:00
Cedric BAIL 9367b5f7c7 * eina: Add first version of a Quad Tree data type.
NOTE: consider the API experimental and subject to change.


SVN revision: 48424
2010-04-29 17:21:14 +00:00
Cedric BAIL 49c0a1e6e2 * eina: add tests for eina fixed point sin/cos functions.
SVN revision: 48423
2010-04-29 17:08:24 +00:00
Gustavo Sverzut Barbieri 08127ecc3e eina_str speedups.
* eina_str_split() now does the minimum number of passes and
   allocations. The first pass figures out the string size (strlen())
   and number of delimiters, so we can allocate the exact number of
   elements in array. The second repeats the loop copying elements to
   string and also setting them to the result array.

 * eina_str_split_full() is a variation of eina_str_split() that
   returns also the number of elements in array, in the case you need
   to pre-allocate another array to copy.

 * eina_strlen_bounded() is introduced to limit strlen() results, this
   is used in has_prefix and has_suffix, but possibly other use cases
   where string must be of a maximum size as we don't do useless
   iterations;



SVN revision: 46547
2010-02-27 03:42:27 +00:00
Sebastian Dransfeld 8f5d0ecfb4 Don't timeout
SVN revision: 46099
2010-02-11 21:30:57 +00:00
Sebastian Dransfeld 3d6a752111 Add simple test for strbuf
Need more

SVN revision: 46024
2010-02-09 21:05:47 +00:00
Jorge Luis Zapata Muga f3fb3dea17 + [Eina] API change. eina_module_list_flush() -> eina_module_list_free()
as we are on the modules context not the array.
  All the referenced projects are changed too. Remember that the list_free()
  already calls the unload() on each module so no need to call list_unload()



SVN revision: 44978
2010-01-08 12:22:23 +00:00
Rafael Antognolli 52de9e33cd Added the Eina_Tile_Grid_Slicer iterator.
This new iterator receives a rectangle as argument and tile_w X tile_h sized
tile, and slices the rectangle iterating over it on each iteration.



SVN revision: 42427
2009-09-11 23:51:47 +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 643958705b eina_matrixsparse: welcome sparse matrix implementation and tests.
Sparse Matrix was implemented and tested by Rafael Antognolli and
myself in order to implement optimized large sparse matrix walk in
some products, one of them WebKit-EFL optimizations.

We have done extensive tests, with good code coverage. Similar to
lists/inlists, we keep pointer to last known element and similar to
iterators we keep reference to last accessed row and cell inside
rows. This allows fast sequential access (for i... for j... m[i,j]),
that is our most common usage case.

Rows are kept in a list, with cells inside that row as another
list. It's not similar to most book implementations where cells keep
reference to their sibling cells in other rows as well, we opted to
not do that to save some pointers and make algorithms simpler, still
do great for our use case.

This code was developed on behalf of our client, that wants to remain
unnamed so far. Thanks client ;-)



SVN revision: 42243
2009-09-04 13:43:44 +00:00
dieb d7bbc05b12 Initial import of the new eina logging API.
* eina_error might be kept for error messages and codes, but it's logging API
  will be deprecated. For now, it's been kept for not breaking others code and
  for a smoother transition.
* Added test for new logging API, also demonstrates usage.


SVN revision: 41960
2009-08-24 21:43:48 +00:00
Gustavo Sverzut Barbieri f86aa350c6 allow limit tests to run.
eina_suite TEST1 TEST2 ... is your friend ;-)



SVN revision: 41624
2009-08-06 22:22:56 +00:00
Cedric BAIL b02de756a6 * eina: Rename eina_module_list_delete to eina_module_list_flush.
SVN revision: 41385
2009-07-17 11:13:38 +00:00
Cedric BAIL 3c2f745ab9 Fix wrong order and useless double include.
SVN revision: 38660
2009-01-20 15:40:36 +00:00
Cedric BAIL 437c220266 Add dladdr and env code for eina_module from Vincent Torri.
SVN revision: 37374
2008-11-01 15:39:53 +00:00
Cedric BAIL 72e45419ec Add Eina_Rectangle_Pool support. Typically help for font handling in OpenGL or
any case where you need to split a rectangle in many differents small rectangle.


SVN revision: 37252
2008-10-27 20:24:12 +00:00
Cedric BAIL 7c47066009 Change module API to use Eina_Array as we want to use mempool and module for Eina_List.
Fix at the same time a closing bug in eina_module.c.



SVN revision: 36312
2008-09-29 13:28:42 +00:00
Jorge Luis Zapata Muga 5ed8ea7e09 + Make the benchmark compile again
+ Remove unused code

SVN revision: 36213
2008-09-24 13:59:00 +00:00
Jorge Luis Zapata Muga c9f08f6124 New module API. Port this API to the mempool subsystem and the tests.
Now the modules can define a default function that will be called when the module is loaded and unloaded.

SVN revision: 36207
2008-09-24 12:55:31 +00:00
Cedric BAIL ad793833c6 Set module path for all tests.
SVN revision: 36079
2008-09-18 14:17:48 +00:00
Cedric BAIL c9ad936b24 Add mempool check.
SVN revision: 36053
2008-09-17 15:23:09 +00:00
Cedric BAIL 991867bd7b Share eina_benchmark to other libs also.
SVN revision: 35832
2008-09-04 15:06:26 +00:00
Cedric BAIL a257cf02f3 Add a routine to extract path information.
SVN revision: 35814
2008-09-03 14:40:12 +00:00
Cedric BAIL 357e2614e9 Activate rbtree now that it work correctly.
SVN revision: 35721
2008-08-28 16:36:18 +00:00
Cedric BAIL 394c787dde Add Red Black tree API. Right now only insertion, lookup and iterator work.
The current implementation choose to move the node allocation outside of eina
control like eina_inlist. They currently have the same memory footprint as
eina_inlist and the implementation of insertion and lookup are iterative
making it quite fast. This should make them a good competitor of eina_inlist
for eina_hash and eina_stringshare.



SVN revision: 35689
2008-08-27 10:07:12 +00:00
Cedric BAIL 4bc094c45a As we are heavy user of int to string and double to string in the EFL, provide a fast and portable one.
SVN revision: 35604
2008-08-21 14:20:41 +00:00
Cedric BAIL da8c3be66f Add a proposal for a module/plugins API that should match every requirement I
received. It's a little huge right now, but work quite nicely.

It support "static" module, version, recursive lookup and should be able to
replace the module/plugins support in evas and ecore.


SVN revision: 35534
2008-08-18 08:18:16 +00:00
Cedric BAIL 43cc2dca6f Add first try for an accessor and iterator API, comment welcome (lack inlist and list currently).
Rewrite EINA_ARRAY_ITER_NEXT, still fast, need one more parameter, but no more EINA_ARRAY_ITER_END.


SVN revision: 35438
2008-08-11 16:30: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
Cedric BAIL ddaa7d4d8f License changes (BSD -> LGPL)
SVN revision: 35360
2008-08-06 18:15:24 +00:00
Cedric BAIL ee86227bc6 Activate all tests.
SVN revision: 35357
2008-08-06 16:00:12 +00:00
Cedric BAIL ba49a3fee1 Cover lazy allocator at 100%. Add error checking capability.
SVN revision: 35320
2008-08-04 16:50:03 +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 280e9973e7 Add test for error and magic.
SVN revision: 35301
2008-08-01 14:27:01 +00:00
Cedric BAIL 1548221768 Add the beginning of a tests suite.
SVN revision: 35285
2008-08-01 12:22:31 +00:00