Cedric BAIL
da559ee5d0
eina: use portable infrastructure to detect page size.
2013-11-10 09:26:12 +01:00
Cedric BAIL
ecaca1d365
eina: detect page size in a portable way.
2013-11-10 09:25:16 +01:00
Cedric BAIL
81d2dc2681
eina: let's try to reduce the covered 64bits system.
2013-11-09 15:26:24 +01:00
Cedric Bail
e6c4bcc57d
eina: let pass the right size.
2013-11-09 20:43:20 +09:00
Cedric Bail
44f539e1a3
eina: fix eina_hash_int64 on Windows system.
2013-11-09 20:07:27 +09:00
Cedric Bail
926f4c5e84
efl: detect 64 bits correctly.
2013-11-09 19:48:31 +09:00
Ryuan Choi
ec1ba32690
eina: Avoid increasing required alignment of target type warning on ARM in Eina_Hash.
...
Summary:
When building applications with -Wcast-align on ARM, there are following warnings.
increases required alignment of target type warnings. This impact eina_hash_murmur3.
Reviewers: cedric, seoz
Reviewed By: cedric
CC: cedric
Differential Revision: https://phab.enlightenment.org/D317
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-11-05 15:45:56 +09:00
Carsten Haitzler
b07c0a76ce
alpha1 release autofoo/build tree work to pass distcheck and actually work
2013-11-04 18:33:35 +09:00
Cedric Bail
613947ac0d
eina: make eina_cow_free reset the pointer to the default read only value.
2013-11-04 12:45:25 +09:00
Cedric Bail
687e4ae744
eina: roll const into Eina_File API.
...
Note that eina_file_dup is const from the caller perspective as it
will return a fresh "non const" Eina_File that it will be able to
manipulate as it like.
2013-11-04 11:26:59 +09:00
Carsten Haitzler
9337af1187
eina thread - make note about valgrind complaint that is bogus
2013-11-03 20:51:41 +09:00
Jérémy Zurcher
1eb85fe746
fix raster's typo
2013-10-30 22:41:13 +01:00
Cedric Bail
e35c7b19fb
eina: long forgotten function in Eina_File for Windows.
2013-10-28 19:47:40 +09:00
Cedric Bail
570ce667f3
eina: fix API as we don't and never will touch memory for write in that function.
2013-10-28 18:32:40 +09:00
Cedric Bail
60a34c1cd0
eina: avoid possible race condition when unreffing an Eina_File.
2013-10-28 18:32:40 +09:00
Cedric Bail
91e76f791d
eina: honor string length in eina_tmpstr_add_length.
2013-10-16 18:56:32 +09:00
Cedric Bail
46447c95aa
eina: just for a little bit of better portability.
2013-10-16 16:54:36 +09:00
Sebastian Dransfeld
0b26b1bd89
eina: And guard the right function with umask
...
Thanks Cedric.
2013-10-16 04:56:51 +02:00
Sebastian Dransfeld
7576ff00f3
Set secure file permissions for temporary file
...
From glibc mkstemp man page:
In glibc versions 2.06 and earlier, the file is created with
permissions 0666, that is, read and write for all users. This old
behavior may be a security risk, especially since other UNIX flavors
use 0600, and somebody might overlook this detail when porting
programs. POSIX.1-2008 adds a requirement that the file be created
with mode 0600.
More generally, the POSIX specification of mkstemp() does not say
anything about file modes, so the application should make sure its
file mode creation mask (see umask(2)) is set appropriately before
calling mkstemp() (and mkostemp()).
And:
http://cwe.mitre.org/data/definitions/377.html
2013-10-16 04:28:53 +02:00
Carsten Haitzler
f93329d119
Revert "eina: fix CID 1106340: Logically dead code (DEADCODE) reported by coverity."
...
This reverts commit 1c1b48ca64
.
this commit is causing all sorts of hell and crashes, hangs and what
not. like:
Thread 1 (Thread 0x7feb7389e780 (LWP 7149)):
No symbol table info available.
No symbol table info available.
at lib/eina/eina_inlist.c:422
l = 0xf38a50
__FUNCTION__ = "eina_inlist_demote"
#3 0x00007feb6a809867 in
_eina_chained_mempool_alloc_in (
pool=pool@entry=0x8650a0, p=p@entry=0xf38a50)
at modules/eina/mp/chained_pool/eina_chained_mempool.c:197
mem = 0xf3a690
#4 0x00007feb6a809dff in eina_chained_mempool_malloc
(data=0x8650a0,
size=<optimized out>)
at modules/eina/mp/chained_pool/eina_chained_mempool.c:300
pool = 0x8650a0
p = 0xf38a50
mem = <optimized out>
#5 0x00007feb6a7e451f in
eina_mempool_malloc (size=40, mp=<optimized out>)
at lib/eina/eina_inline_mempool.x:103
No locals.
#6 _eina_list_mempool_list_new (list=0x7feb5402a510)
at lib/eina/eina_list.c:199
No locals.
#7 eina_list_append (list=0x7feb5402a510, data=0xf41720)
at lib/eina/eina_list.c:534
l = <optimized out>
__FUNCTION__ = "eina_list_append"
#8 0x0000000000445d1a in
e_bindings_signal_add (ctxt=<optimized out>,
sig=0x947e6c "mouse,clicked,[12]", src=0x92248c "e.event.close",
mod=E_BINDING_MODIFIER_NONE, any_mod=1, action=0x93479c
"window_close",
params=0x0) at e_bindings.c:1036
binding = 0xf41720
#9 0x00000000004469d4 in e_bindings_init () at
e_bindings.c:68
ebs = 0x947df0
ebm = <optimized out>
ebw = <optimized out>
ebe = <optimized out>
ebk = <optimized out>
eba = <optimized out>
l = 0x9532e0
#10
0x0000000000437516 in main (argc=<optimized out>, argv=<optimized out>)
at e_main.c:941
safe_mode = 0 '\000'
after_restart = 1 '\001'
waslocked = 0 '\000'
t = <optimized out>
tstart = <optimized out>
s = <optimized out>
buff =
"1381800872.3", '\000' <repeats 19 times>
action = {__sigaction_handler = {
sa_handler = 0x4fca00 <e_sigabrt_act>,
sa_sigaction = 0x4fca00
<e_sigabrt_act>}, sa_mask = {__val = {
0 <repeats 16 times>}}, sa_flags = -1073741820,
sa_restorer = 0x0}
__FUNCTION__ = "main"
Detaching from program:
/usr/local/bin/enlightenment, process 7149
2013-10-15 10:42:26 +09:00
Cedric BAIL
1c1b48ca64
eina: fix CID 1106340: Logically dead code (DEADCODE) reported by coverity.
2013-10-14 13:32:46 +02:00
Cedric Bail
68a4e85483
eina: that stuff was just for adding a bug in fact.
2013-10-11 17:30:35 +09:00
Carsten Haitzler
69e27abdc3
eina - and e3fl in general - stop using eina_error_get/set - useless really
2013-10-11 16:50:40 +09:00
Cedric Bail
0aa77d7dde
eina: use Eina_Spinlock in Eina_Stringshare instead of Eina_Lock.
2013-10-11 11:08:17 +09:00
Cedric Bail
82d86ea42d
eina: use Eina_Spinlock for Eina_Log.
2013-10-11 11:08:17 +09:00
Cedric Bail
1b07350a46
eina: add Eina_Spinlock API.
2013-10-11 11:08:17 +09:00
Cedric Bail
fe25608edd
eina: handle more compiler strangeness for bswap.
...
So current order is :
- __builtin_bswap*() for compiler that provide it
- _byteswap_*() for MSVC
- bswap_*() for older Linux and some BSD
- own C code when everything else fall appart.
The reason for this order is that the builtin will always generate
the best assembly possible. On my system bswap_*() are not changing
in all version to the best solution as they are almost equivalent to
the C macro.
2013-10-04 12:49:02 +09:00
Cedric Bail
d52f825de6
eina: in case of an error we should exit not continue and manipulate dead data.
...
This should fix a warning catched by LLVM/Clang.
2013-10-04 10:56:05 +09:00
ChunEon Park
18be4c50d9
eina/eina_file - fix eina_file_map_lines() to not drop of one character in the last line.
2013-10-04 01:58:35 +09:00
Cedric Bail
ff3d2a68d5
eina: add infrastructure to handle more CPU and compiler builtin information.
2013-10-02 20:54:50 +09:00
Tom Hacohen
de6f57fac0
Eina inlist: Removed redundant if in EINA_INLIST_FOREACH_SAFE.
...
If it is not NULL, so will EINA_INLIST_GET. As that returns a pointer to an
area after it.
2013-09-30 14:28:38 +01:00
Cedric Bail
295babadb1
eina: check if the complete hash match before checking if the key match during children walk.
...
This give an interesting +15% for all Eina_Hash user whatever hash function they use. The inlined
djb2 is still the fastest one and all other give very close result.
This idea was given by Lucas De Marchi's blog :
http://www.politreco.com/2013/09/optimizing-hash-table-with-kmod-as-testbed/
I do believe that rolling a crc32 implementation as a hash function should give interesting result
in our test.
2013-09-26 15:51:25 +09:00
Lucas De Marchi
ad76ce025c
Revert "eina: add functions to alloc strings from a printf fmt"
...
This reverts commit b5fce696c7
and fixes
to NEWS and @since that came later.
These functions are pretty trivial and their functionality can be
obtained with asprintf() and snprintf. The first is not available only
on windows, but there's an implementation for that one on Evil, that
should be used instead.
2013-09-25 22:51:03 -03:00
Tae-Hwan Kim
54551defa6
eina: add EINA_INLIST_REVERSE_FOREACH_FROM.
2013-09-25 18:29:23 +09:00
Cedric Bail
a7fe49139d
eina: fix @since to be a proper revision number.
2013-09-24 15:03:24 +09:00
Jorge Zapata
b5fce696c7
eina: add functions to alloc strings from a printf fmt
2013-09-24 12:20:27 +09:00
Jorge Zapata
b98ee971f3
eina: add a substraction in rectangles and more helpers
...
Also add functions to cut a rectangle in the different
lengths/coordinates.
Add helper macros to printf a rectangle
2013-09-24 12:20:27 +09:00
Jorge Zapata
538821f09d
eina: add double_from/to and helper defines in f16p16
2013-09-24 12:20:27 +09:00
Carsten Haitzler
c1556b7112
eina - remove deadlock from share-common + remove extra lock/unlock
2013-09-08 10:03:35 +09:00
Carsten Haitzler
f2885306dc
eina - stringshare - strlen already would deal with optimization cases
2013-09-05 12:46:06 +09:00
Cedric Bail
d7c8d221b0
eina: forgotten lock, thanks coverity.
2013-09-03 12:58:51 +09:00
Cedric Bail
caf934e005
eina: don't try close dummy handle.
2013-09-02 12:33:21 +09:00
Cedric Bail
64823141f6
eina: fix typo and use the right refcount.
2013-09-02 11:16:59 +09:00
Jean-Philippe Andre
deacfdce24
eina: Fix invalid check on Eina_File::global_map
...
global_map is set to MAP_FAILED in case of error after mmap.
So, it is initialized to MAP_FAILED and considered valid
otherwise.
So, we don't want to set the map to NULL or even check again NULL.
2013-08-27 17:31:12 +09:00
Daniel Juyung Seo
a7399da8f6
Eina.h: bump up year.
2013-08-20 03:11:48 +09:00
Cedric Bail
d72239a118
eina: remove a warning.
2013-08-12 12:11:56 +09:00
Cedric Bail
861823848a
eina: change eina_file_virtualize to be able to provide a fake name.
2013-08-09 20:50:54 +09:00
Carsten Haitzler
fb3159c48e
eina module - minor addition ot allowing lazy loading if env var set
2013-08-08 20:18:08 +09:00
Cedric Bail
464c58a1c9
eina: another fix for windows build.
2013-08-08 17:17:58 +09:00
Cedric Bail
c4beec0127
eina: fix compilation of Eina_File on windows.
2013-08-08 17:05:14 +09:00
Carsten Haitzler
bdb19cd974
eina-file - adapt to bsd version of MADV_REMOVE
2013-08-06 16:13:03 +09:00
Cedric Bail
c90179ce86
eina: fix build on FreeBSD.
2013-08-06 15:44:22 +09:00
Chris Michael
a97f3c0b9b
Fix eina_file_virtual_map_new function (/me glares at Frenchie).
...
- Spank Cedric !!!!!
NB: How about we actually fill in "map" after allocation ??
NB: Previously we would malloc "map" and immediately exit without
filling it in, without adding it to the hash....nothing. Just allocate
and get out. Bad Frenchie !!!
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 13:01:52 +01:00
Cedric Bail
4dd259f3b1
eina: add eina_file_refresh().
2013-07-31 17:16:40 +09:00
Cedric Bail
f2de8970a1
eina: add support for in memory only Eina_File.
2013-07-31 11:51:51 +09:00
Cedric Bail
fa57dd8b2a
eina: seems like all the compiler we support do support __typeof__.
2013-07-29 16:28:07 +09:00
Ryuan Choi
f6ba1f69e7
eina: use __typeof__ for public headers to build applications with c++0x.
2013-07-26 14:00:16 +09:00
Carsten Haitzler
a8e80514dc
fix clang bad free complaint to deal with data magic value
2013-07-16 18:11:50 +09:00
Cedric Bail
9d2249c1a8
eina: fix Eina_Log restart.
2013-07-15 17:04:34 +09:00
Daniel Juyung Seo
fe914c069c
eina_stringshare.h: added more description to eina_stringshare_add_length().
2013-07-15 13:39:57 +09:00
Cedric Bail
f07d4c17e9
eina: add eina_tiler_empty.
2013-07-11 14:01:06 +09:00
Cedric Bail
5479da04b6
eina: Eina_Tiler formatting.
2013-07-11 14:01:06 +09:00
Cedric Bail
d2b94729bc
eina: don't insert the same rectangle multiple time in a row.
2013-07-11 14:01:06 +09:00
Cedric Bail
2e347b5e22
eina: let's not complain for nothing.
2013-07-11 14:01:06 +09:00
Chris Michael
a144495daa
Initialize 'd' to -1 so we can check on 'end' if it needs closing
...
Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-07-08 16:05:12 +01:00
Chris Michael
2aa12782b6
If we open a file for copying, then we should also Close that file
...
when the copy is done.
NB: Fixes Coverity CID1039181
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 11:13:56 +01:00
Mike Blumenkrantz
b8e16b8f4a
+eina_tiler_area_size_get
...
also fix docs for eina_tiler_area_size_set
2013-07-08 09:08:04 +01:00
Carsten Haitzler
d15d86e26f
eina: add eina_file_map_populate()
2013-07-06 22:01:23 +09:00
Cedric Bail
0453cd16b4
eina: revert that simplification as compiler are now to dumb to handle it.
2013-07-05 14:59:43 +09:00
Cedric Bail
f825bebcdb
eina: improve Eina_Tiler to be in par with Evas_Tilebuf.
2013-07-04 13:02:48 +09:00
Stefan Schmidt
9c1ed31c76
eina_list: Avoid NULL pointer deref in eina_list_shuffle.
...
If we have a valid but empty, n = 0, list we never enter the loop
and shuffled_last might still be NULL. Avoid this case by checking
explicitly for n = 0 before.
2013-06-25 15:18:33 +01:00
Sebastian Dransfeld
336f6ec328
efl: formatting
2013-06-20 13:28:18 +02:00
Sebastian Dransfeld
068f1ddc62
efl: formatting
2013-06-20 13:08:36 +02:00
Jérémy Zurcher
0baf4b3561
eina_str_split_full_helper: indent
2013-06-12 23:34:40 +02:00
Jérémy Zurcher
bc182253a7
eina_str_split_full_helper: check params, set NULL at the end of token array
2013-06-12 23:34:40 +02:00
Boris Faure
e0372fc54d
eina_log: screen-256color also support colors
2013-06-09 15:50:11 +02:00
Boris Faure
55b66a93d7
eina-log: xterm-256 (or terminology someday…) supports colors
2013-06-08 21:07:22 +02:00
Cedric Bail
06cd16548c
eina: add eina_file_dup.
2013-06-04 15:04:19 +09:00
Mike Blumenkrantz
29a4edb274
improve eina_str_convert_len docs
2013-05-30 07:41:55 +01:00
Mike Blumenkrantz
37aa26b977
add eina_str_convert_len() for converting from encodings which contain '\0' characters
...
eina_str_convert() is GUARANTEED to break when doing any such encoding (eg. UTF16->UTF8). I don't know who added the original function, but this is very bad, and we should almost certainly deprecate eina_str_convert() so people are not surprised when they are unable to convert strings as expected.
2013-05-29 13:46:11 +01:00
Daniel Juyung Seo
3c9856f9e0
eina_list.h: fixed documentation source formatting while reading the code.
2013-05-23 20:26:48 +09:00
Daniel Willmann
5f1614e1d5
eina_fp: Fix eina_f32p32_mul rounding issues
...
Previous multiplication just truncated the fraction part to 16 bits. If
we round properly we can actually increase accuracy a bit.
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
2013-05-17 17:15:27 +01:00
Cedric Bail
2c8ff31788
eina: add EINA_INLIST_FREE.
2013-05-09 09:57:19 +09:00
Daniel Juyung Seo
c886845a1b
eina_str.c: fixed formatting.
2013-05-08 20:53:45 +09:00
Galatsanos 'godfath3r' Panagiotis
c8b9e0540b
eina: fix a clang warning in eina_cow.
...
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-05-08 18:17:00 +09:00
Cedric Bail
674f612c3b
eina: more meaningful message.
2013-05-08 18:17:00 +09:00
Cedric Bail
574e9015f1
eina: whitespace--;
2013-05-08 18:17:00 +09:00
Daniel Juyung Seo
436d63e01a
eina_unicode.H: be nice. add more documentation for deprecated api.
2013-04-20 19:01:02 +09:00
Cedric Bail
495088caf4
eina: make eina_mempool_alignof a little bit faster.
2013-04-11 18:07:09 +09:00
Cedric Bail
9547166878
eina: little speed improvement by reducing chance to call function.
2013-04-11 18:07:09 +09:00
Jérémy Zurcher
2036f7d344
eina: add eina_inlist_first and eina_inlist_last
...
- both as static inline functions
- test added in eina_inlist_simple
2013-04-09 12:03:05 +02:00
Jérémy Zurcher
1231faf8d9
eina_inlist: fix eina_inlist_sort doc
2013-04-05 23:58:46 +02:00
Cedric Bail
dd4a5215d7
eina: add some more debug information.
2013-04-04 23:50:18 +09:00
Cedric BAIL
a11fe38afc
eina: remove the most costly boolean ever.
...
We did use this 'begin' boolean to make eina_hash always allocate only
once per item it push in the hash. This boolean was alone at the end of
a structure. It would have costed us 4bytes on 32bits system and 8bytes
on 64bits. Removing it make elemines consume 100KB less on 32bits system.
We may have a speed impact on hash insertion here, but I don't think we
do use eina_hash_add and friends in any hot path, at the moment. If that
was the case there would be some way to mitigate this, just not worth it
at the moment.
2013-04-04 11:22:43 +09:00
Cedric BAIL
7ebe7373e6
eina: make it possible to disable Eina_Cow GC at instantiation time.
2013-04-02 17:11:05 +09:00
Cedric BAIL
7e004cea85
eina: let's not run the GC on memcpy things.
2013-04-02 13:41:47 +09:00
Daniel Juyung Seo
b8395bd119
eina_stringshare.h: more acurate documentation for Eina_Stringshare.
2013-04-01 20:57:57 +09:00
Cedric BAIL
78984b9e7a
eina: correctly remove reference from hash and make cow garbage collector work.
2013-04-01 18:38:24 +09:00
Cedric Bail
5da94cfc89
eina: add <errno.h> for build on Win32.
2013-03-30 18:20:19 +09:00
Cedric BAIL
ad406d7353
eina: use a global variable to hold the same string accross other library.
2013-03-29 11:44:48 +09:00