Commit Graph

348 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri de8b6a7bbd fix possible errors with pointer/offset calculation.
it works on gcc, but maybe it would break in other compilers, so make
it safe.



SVN revision: 38302
2008-12-23 20:05:44 +00:00
Gustavo Sverzut Barbieri 7eb0826e29 remove dead stores and reduce some variable scope.
from clang report.


SVN revision: 38294
2008-12-23 19:17:55 +00:00
Cedric BAIL fb238897e5 Use float instead of double.
SVN revision: 38292
2008-12-23 17:23:35 +00:00
Cedric BAIL e006567cb0 Make it compile on Solaris.
SVN revision: 38290
2008-12-23 13:33:11 +00:00
Cedric BAIL 2c9ac0bd82 Remove now uneeded header.
SVN revision: 38289
2008-12-23 13:23:10 +00:00
Cedric BAIL 889d40abf8 Remove PATH_MAX use.
SVN revision: 38288
2008-12-23 13:12:06 +00:00
Cedric BAIL 6a87ca7590 Make code understandable by Visual Studio.
SVN revision: 38287
2008-12-23 10:04:46 +00:00
Cedric BAIL c8714d04cc Declaration should be done before any code.
SVN revision: 38286
2008-12-23 10:02:27 +00:00
Gustavo Sverzut Barbieri 765b770f82 oops, eina_stringshare_strlen() should never account '\0'.
SVN revision: 38260
2008-12-21 06:45:09 +00:00
Cedric BAIL 5383cabf2b Fix EINA_ARRAY_ITER_NEXT off by one bug. With this fix you can no longer push
NULL pointer inside an array.


SVN revision: 38232
2008-12-19 17:55:57 +00:00
Cedric BAIL 3d41b74146 Update ac_attribute macro and remove __UNUSED__ declaration from eina.
SVN revision: 38179
2008-12-17 13:03:00 +00:00
Cedric BAIL c80a55ee14 Add small bucket support.
SVN revision: 38168
2008-12-16 16:49:29 +00:00
Cedric BAIL 00b5758937 Add include to remove warning.
SVN revision: 38167
2008-12-16 16:49:00 +00:00
Cedric BAIL db11d16b7f Manipulating NULL iterator should be concidered as a defined behaviour as it
give the possibility to write small code like :

it = eina_hash_iterator_tuple_new(hash);
eina_iterator_foreach(it, do_something_cb, NULL);
eina_iterator_free(it);

If hash is empty, but valid it will return a NULL iterator for this
example.


SVN revision: 38104
2008-12-11 13:54:59 +00:00
Cedric BAIL b8d721ac05 If we set the data free callback of a hash, we expect it to be called when
calling all eina_hash_del functions.


SVN revision: 38102
2008-12-11 13:47:58 +00:00
Cedric BAIL 9b9f752379 Only allocate hash bucket when needed.
Make eina_hash_del_by_key really different from eina_hash_del.


SVN revision: 38064
2008-12-09 17:39:48 +00:00
Cedric BAIL 00e8fba9ba All eina_hash_find* functions should not report problem when hash or key is NULL.
SVN revision: 38059
2008-12-09 14:59:30 +00:00
Cedric BAIL 8ee267ec0d Remove uneeded included.
SVN revision: 38058
2008-12-09 14:30:54 +00:00
Cedric BAIL b0e1863871 eina_hash_find should not complain when hash or key is NULL.
SVN revision: 38057
2008-12-09 14:24:08 +00:00
Cedric BAIL 68cfd7839f Add a visual feedback to counte test.
SVN revision: 38056
2008-12-09 13:58:04 +00:00
Cedric BAIL 24c1995b68 Change eina_counter_dump to return a string so it could work easily on windows.
SVN revision: 38055
2008-12-09 13:55:10 +00:00
Cedric BAIL af30207725 eina_hash_del must honor the data parameter when the key is passed. Propagate
it correctly.


SVN revision: 38054
2008-12-09 13:52:09 +00:00
Cedric BAIL 273b7422d6 It's cleaner to first include private header as they could define macro
differently than public interface.


SVN revision: 38050
2008-12-09 13:06:17 +00:00
Cedric BAIL d19801f7c2 Prevent warning from Eina Magic when hash population is 0.
SVN revision: 38049
2008-12-09 13:05:33 +00:00
Cedric BAIL 55d9c97446 __UNUSED__ macro is not exported by eina.
SVN revision: 38045
2008-12-09 11:01:12 +00:00
Cedric BAIL 5358b1f84f Add integer and pointer hash table helper.
SVN revision: 38026
2008-12-08 17:31:55 +00:00
Cedric BAIL c7b0e0a6b3 Fix include related to previous Eina Magic patch.
SVN revision: 38017
2008-12-08 10:51:51 +00:00
Cedric BAIL 199f900908 Application and library using Eina Magic API should be able to decide if they
want to check magic or not. This should not be forced by Eina config.


SVN revision: 38014
2008-12-08 10:18:05 +00:00
Gustavo Sverzut Barbieri 8ea28f64b7 hash: better handling of NULL, add magic checking.
* evas: if we automatically destroy hash, check for NULL before
   handling it to eina api, which expect elements to be created with
   eina_hash_new() and thus will fail on NULL.
 * eina: add magic checking for eina_hash and eina_hash_iterator, this will
   help spot when NULL is used.
 * eina_hash_foreach: do not try to create the iterator if hash is NULL.



SVN revision: 37982
2008-12-07 13:28:29 +00:00
Gustavo Sverzut Barbieri b21c687f61 refactor eina_hash_del*, expose simpler functions and avoid GCC hack.
By using simpler functions for hash element deletion we can avoid the
hack to shut up GCC warking about hash_num not being used. As these
simple functions are more often needed than the catch-all, expose them
as well.



SVN revision: 37962
2008-12-06 06:58:56 +00:00
Gustavo Sverzut Barbieri 09924b54e5 Let valgrind help with EINA_MAGIC.
Keep EINA_MAGIC at the end of the structure (WHEN POSSIBLE! Watch out
flexible arrays like char str[] at the end!)

this way if parts use EINA_MAGIC and others do not, it will possible overflow and valgrind can help us.

WARNING: make uninstall before update! Then make clean and make install, check if everything is working with "make check".



SVN revision: 37961
2008-12-06 06:53: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
Gustavo Sverzut Barbieri 08832b519b grow array only when required, use step properly.
We need to grow when we reach total amount, not when current + step > total.



SVN revision: 37959
2008-12-06 06:13:55 +00:00
Gustavo Sverzut Barbieri 091741f861 Force dummy_symbol to be visible.
"make check" was failing with -fvisibility=hidden.



SVN revision: 37958
2008-12-06 06:12:30 +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 a00eaac6a6 Make it possible to create iterators outside Eina.
Many places in EFL we just create walk something, create a list with
walked data, return, then the user walks it again and then deletes
(which will walk again). For such cases it's way better to define
iterators or accessors.

I'm not moving any EFL code to it now, but if people are interested,
things like evas_render_method_list(), evas_font_available_list(),
evas_objects_at_xy_get(), evas_objects_in_rectangle_get(),
evas_object_smart_members_get() are good candidates. If the subject is
already using Eina list, then you can just use
eina_list_iterator_new() and return it, otherwise you can define your
own iterator, which is very easy.



SVN revision: 37956
2008-12-06 03:41:03 +00:00
Gustavo Sverzut Barbieri b023145eed shut up gcc warning, with comment.
SVN revision: 37953
2008-12-06 03:02:30 +00:00
Carsten Haitzler 84f8c174bf fix list accounting on sort! bad - how did this hide for so long?
SVN revision: 37951
2008-12-06 02:51:04 +00:00
Gustavo Sverzut Barbieri f8868ffa96 Fix namespace: Eina_Foreach -> Eina_Hash_Foreach.
SVN revision: 37950
2008-12-06 02:21:17 +00:00
Gustavo Sverzut Barbieri 03fca99e56 Add safe Eina list walk function.
SVN revision: 37949
2008-12-06 02:13:01 +00:00
Chidambar Zinnoury 5c2c6049f1 Use includedir instead of prefix/include to install Eina headers.
SVN revision: 37925
2008-12-04 16:25:40 +00:00
Cedric BAIL 9a5b397a3e Fix a little memory leak when iterating.
SVN revision: 37718
2008-11-20 13:26:18 +00:00
Cedric BAIL 5257321d9a Fix some constness.
SVN revision: 37576
2008-11-10 16:23:56 +00:00
Cedric BAIL aa82395cc1 Fix order of free during hash free.
SVN revision: 37572
2008-11-10 14:32:14 +00:00
Vincent Torri a00a2a3636 put static functions where they belong
SVN revision: 37552
2008-11-08 16:47:52 +00:00
Sebastian Dransfeld 4173b41de5 Add missing return value.
SVN revision: 37528
2008-11-07 06:50:45 +00:00
Cedric BAIL e8ed3963c8 Add eina_array_data_set.
SVN revision: 37475
2008-11-05 17:16:07 +00:00
Cedric BAIL e63dde947d Fix documentation.
SVN revision: 37474
2008-11-05 16:20:37 +00:00
Gustavo Sverzut Barbieri 9e80a086f6 Add and use eina_stringshare_ref().
This is a faster "add", if we know we're using a shared string we know
the node without any need to search it, just increment reference and
exit.



SVN revision: 37458
2008-11-04 16:25:12 +00:00
Vincent Torri c8e2f1f51f small doc fix
SVN revision: 37407
2008-11-02 09:41:14 +00:00