Summary:
Adds documentation about internals of a couple functions and cleans up
some stray doxygen tags.
Reviewers: cedric
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6039
Summary:
Adds documentation for several routines, fixes some incorrect
documentation, cleans up grammar throughout, corrects a few remaining
spelling errors.
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D6021
Summary:
vsnprintf() returns "The number of characters that would have been written if n had been sufficiently large",
so if this is larger than the requested length, we pass the requested length to eina_stringshare_add_length,
to avoid reading uninitialised memory.
Fix T6903
Reviewers: zmike
Subscribers: cedric
Maniphest Tasks: T6903
Differential Revision: https://phab.enlightenment.org/D6011
Summary:
Revise wording of a few parameters, improve consistency of punctuation
and documentation body placement.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5918
Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Revises some descriptions, polishes wording, makes punctuation and
formatting more consistent, and straightens out some convoluted grammar
here and there.
There are a few places where the parameter documentation was incorrectly
cut-and-pasted from other routines, so this is fixed. Also, in
eina_matrixsparse_iterator_new() the docs say the elements are not
returned sequentially, but from the context and code I think it meant to
say they're not _consecutive_.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5924
Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
By default all Pthread are cancellable. This leads to strange behavior that
happen during shutdown and hasn't been figured out. Most likely fix for T6622.
Summary:
This copyedits the descriptions for several _add and _free APIs.
Phrasing is made a bit more concise, without losing the meaning, and
made more consistent so the distinctive differences between the routines
are easier to spot. Some paragraph spacing is added for clarity, for
similar reasons.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5851
Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Improve the verbage in the doxygen comments. Refer to the value being
changed as the 'previous' rather than the 'old' value, to be more
precise. Drop the phrase 'keeping API sane' as it is unnecessary and
is an odd thing to say. Try to avoid referring to 'your program' as we
shouldn't assume the reader's situation.
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D5834
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
'thiz' is not commonly used in EFL, more commonly used is a word or
abbreviation that is descriptive of the object being used ('hash' for
Eina_Hashes, 'str' for Eina_Strings, 'array' for Eina_Arrays, etc.)
Follow this convention by using 'rect' (as used already in various
places) instead of 'thiz' or 'r'.
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D5836
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
For all routines that can return NULL on error, mention this in the
function's @return docs. In cases where a small number of situations
result in this return, move the docs to the @return; in other cases just
state the NULL return briefly and leave the elaboration in the body.
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D5837
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
so the MAIN loop is actually an efl.app object. which inherits from
efl.loop. the idea is that other loops in threads will not be efl.app
objects. thread on the creator side return an efl.thread object.
inside the thread, like the mainloop, there is now an efl.appthread
object that is for all non-main-loop threads.
every thread (main loop or child) when it spawns a thread is the
parent. there are i/o pipes from parnet to child and back. so parents
are generally expected to, if they want to talk to child thread, so
use the efl.io interfaces on efl.thread, and the main loop's elf.app
class allows you to talk to stdio back to the parent process like the
efl.appthread does the same using the efl.io interfaces to talk to its
parent app or appthread. it's symmetrical
no tests here - sure. i have been holding off on tests until things
settle. that's why i haven't done them yet. those will come back in a
subsequent commit
for really quick examples on using this see:
https://phab.enlightenment.org/F2983118https://phab.enlightenment.org/F2983142
they are just my test code for this.
Please see this design document:
https://phab.enlightenment.org/w/efl-loops-threads/
Summary:
Adds missing @param docs and fixes an incorrectly documented one.
Clarifies difference between 'length' and 'position', specifying the
latter is a number between 0.0 and 1.0. Improves verbage here and there
for grammatical correctness and internal consistency.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5780
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
These routines all have slight permutations of the same basic note, but
are each formatted a bit differently. Fix that and a few punctuation
irregularities.
Similarly for a couple @warnings, and escalate one @note to a @warning
since what it describes might be a security issue so deserves
highlighting.
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5779
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
The eina_matrix3_compose and eina_matrix3_multiply API's are
mathematically identical (even though the implementations are
reversed... weird), except that the latter also includes a fastpath for
identity matrices.
Having two functionally equivalent APIs is redundant, so ideally one or
the other would be dropped. But in order avoid API breakage, just have
one routine wrapper the other and eliminate the internal redundancy.
(Note that the parameter signatures of the two routines are different -
eina_matrix3_compose() takes the two input matrices first, and the
output matrix last, while eina_matrix3_multiply() takes the parameters
in the reverse order. This inconsistency in the API style could result
in accidentally erroneous usage and would be an argument for deprecation
of one of the two APIs.)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewers: cedric
Reviewed By: cedric
Differential Revision: https://phab.enlightenment.org/D5806
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Summary:
Some spelling/punctuation/grammar/formatting fixes to make the
rectangles doxygen more consistent. Simplify wording in several places,
including removing redundant documentation of return values. Reword the
rectangle cutting API's to be more clearly worded. Make clearer mention
of parameters that get changed by the function call, and ones that
allocate memory.
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5785
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
docs say return true on succesas, false on failure. adding a rect we
already added is not a failur. it's an optimization to a NOP. so fix.
this was brought up by and fixes T6669 ... but in the opposite way.
Summary:
Corrects some grammatical errors, and rephrases wording of some passages
for better clarity. Also fix a few doxygen formatting inconsistencies.
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5764
The documentation for these functions claims that passing a NULL array
results in doing nothing - that should also include logging nothing.
EINA_SAFETY_ON_NULL_RETURN() logs an ERR message and should be reserved
for usage when NULL is not actually a valid state.
Additionally, it's entirely possible to turn off EINA_SAFETY_CHECKS, at
which point these functions would stop behaving as the documentation
says they do. Not great.
Summary:
Ensure @return defines error returns consistently. In several cases the
errors were explained in the body but not mentioned in the @return docs.
Drop redundant return value documentation for clarity. Some routines
were defining the return values both in @return and in the doxygen body.
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5756
Summary:
The Eina_Matrix_Type enum is returned by eina_matrix4_type_get and
eina_matrix2_type_get; it is not Matrix3-specific. Update doxygen
accordingly.
Reviewers: devilhorns
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5744
Summary:
This fixes some typos and misspellings, massages grammar in a few
places, tidys up a little whitespace, and fixes incorrect docs in a spot
or two.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5745
Summary:
ecore_evas: remove debug
eina: unregister log level when done with
Fixes a constant memory leak.
eina: introduce EINA_HOT and EINA_COLD
These attributes respectivelly expand to __attribute__ ((hot)) and
__attribute__ ((cold)) when available. They allow to mark functions are
being hot/cold (frequently used or not) as well as to qualify labels
within a function (likely/unlikely branches).
eo: speed-up generated calls by removing call cache
The call cache needed to by thread-local, to avoid concurrency issues.
Problem with TLS is that is adds an extra overhead, which appears to be
greater than the optimization the cache provides.
Op is naturally atomic, because it is an unsigned integer. As such, it
cannot be tempered with while another thread is reading it. When
entering the generated function, the first operation done is reading
'op'. If we have concurrency, we will have access sequences returning
either EFL_NOOP or a VALID op, because 'op' is not set until the very
end of the function, when everything has been computed. As such, we now
use the 'op' atomic integer to instore a lock-free/wait-free mechanism,
which allows to drop the TLS nature of the cache, speeding up the access
to the cache, and therefore making functions execute faster.
We don't test anymore the generation count. This can be put as a
limitation. If means that if you call efl_object_shutdown() and
re-initialize it later with different data, opcodes will be invalid.
I am not sure there is any usecase for this to ever happen.
We could move all the caches in a dedicated section, that can be
overwritten after a call to efl_object_shutdown(), but I am not sure it
will be very portable.
Benchmark: mean over 3 executions of
ELM_TEST_AUTOBOUNCE=100 time elementary_test -to genlist
```
BEFORE AFTER
------------------------------------------------------------
time (ns) 11114111647.0 9147676220.0
frames 2872.3333333333335 2904.6666666666665
time per frame (ns) 3869364.6666666665 3149535.3333333335
user time (s) 11.096666666666666 9.22
cpu (%) 22.666666666666668 18.333333333333332
```
Ref T6580
Reviewers: raster, cedric
Subscribers: cedric, jpeg
Maniphest Tasks: T6580
Differential Revision: https://phab.enlightenment.org/D5738
we can't sensibly use things like massif to track memory if we bypass
itr with mmaping -1 fd anonymous memory... so if built with valgrind
support and running under valgrind, use malloc/calloc and free so
these tools actually do something useful for these bits of memory.
so xine module plus 2 eina dbug threads didnt set up signal
blocking/masks correctly. xine use ssigprocmask not pthread_sigmask
and the other 2 didnt even bother at all. fix this so these threads
all block most of these commnly caught signals so these threads never
get them
elsewhere in efl we moved to pthread_sigmask but eina debug didn't, so
mirror the changes here too. at this point in time when we are
initting eina debug this shouldnt really matter much as we're single
threaded until this pthread_Create is called. after that tough...
we're not. signals + threads is a nightmare though... horrible
horrible...
also eina_procmis was not threadsafe so cannto use loops in different
threads at all until this was made safe. needed to disable the old
ecore_event using code in for ecore futures and create a new efl loop
message future and handler instead ... but now a quick experiment with
multiple loops in 10 threads plus mainloop have timers at least work.
i need to test more like fd handlers etc etc. but it's a step.
This has been bugging me for some time but now we are triggering new errors internally
this is appearing to end users for problems they did not cause.
Additionally I was able to improve a couple of the errors by copying the
explanation from code comments into the error message.
Shorter error logs now too :)
Under some circumstances, eina crashes when attempting to display the
backtrace, because dladdr() may yield a dli_fname that is NULL. This is
especially annoying in realease, when the backtrace is shown by default
when CRI/ERR are thrown.
@fix
Efl.Future is an EO object which means even cancelling Efl.Future
objects requires EO. So this should be done before shutting down EO,
otherwise everything fails badly.
I believe Efl.Future is going to disappear soon, but the problem will
remain: if any promise/future uses EO or anything else outside of Eina
(so, basically anything) then it needs to be canceled before shutting
down the above layers. This is the same situation as with ecore events,
for which we've introduced ecore_event_type_flush.
Ping @cedric
Summary:
The Encoding key is no longer required, all desktop files are assumed to
be UTF-8 encoded. See details at:
https://standards.freedesktop.org/desktop-entry-spec/1.1/apc.html
Fix various typos and misspellings
lintian, Debian's package checker, uses strings to check for common typos
in compiled binaries. This change fixes the ones it identified in 1.20.6.
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5584
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
As the filename is now a stringshare, also make sure virtual
files use stringshares for the filename! Also when unmapping
we still need to test whether it is copied or not as unmap
will break on less tolerant architectures.
@fix T6449
valgrind does complain about this. i'm not sure it matters but it's
safer to 0 it out in case some field is being used that we don't think
is being used that we didn't set.
Summary:
In eina_log_level_check's annotation, parameter description is missing,
so warning is occurred on doxygen
Test Plan: API Doxygen Revision
Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho
Differential Revision: https://phab.enlightenment.org/D5375
Summary: Space character is located in wrong position, so it occur doxygen warning
Test Plan: API Doxygen Revision
Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho
Differential Revision: https://phab.enlightenment.org/D5374
Before this patch, the key would always be zero and the hash would solely
rely on the rbtree to be efficient. This improve the situation by using the pointer
as the key during hash computation.
Summary:
Some parameter's name are different in annotations and statements,
so it occurs doxygen warning.
To fix it, rename that parameters.
Test Plan: API Doxygen Revision
Reviewers: raster, cedric, jpeg, myoungwoon, Jaehyun_Cho
Differential Revision: https://phab.enlightenment.org/D5327
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Putting local variable "d" under preprocessor flag "EINA_SAFETY_CHECKS" to avoid below warning, if "EINA_SAFETY_CHECKS" is disabled.
1. local variable "d" is assigned but not used.
2. If warning 1 is resolved then variable "d" will be unused.
Reviewers: raster, cedric
Reviewed By: cedric
Subscribers: jpeg, rajeshps
Differential Revision: https://phab.enlightenment.org/D5321
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary: Unsigned integer should not be compared less than zero.
Test Plan: NA
Reviewers: cedric
Subscribers: shilpasingh, jpeg
Differential Revision: https://phab.enlightenment.org/D5274
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
eina_strbuf_append_strftime()
eina_strbuf_insert_strftime()
eina_strbuf_prepend_strftime() - macro
We need these functions for implementing generic format function
interface especially for calander.
Ref T6204
Summary:
Unsigned integer should not be compared to less than zero
@fix
Test Plan: NA
Reviewers: cedric
Reviewed By: cedric
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D5269
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Test Plan: run on XP
Reviewers: jpeg, cedric, ajwillia.ms
Reviewed By: ajwillia.ms
Subscribers: ajwillia.ms
Differential Revision: https://phab.enlightenment.org/D5245
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.
But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.
Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).
@feature
This makes sure that the call to madvise is safe. On Linux it's not too
much of an issue as checks are made inside madvise, and the worst that
can happen is an error is returned (EINVAL). Not great.
But if MAP_POPULATE is not present, as is the case on *BSD, then the
internal function _eina_file_map_populate() is used for the populate
rule. In that case actual data is read and we should make sure not to
trigger a segfault or bus error.
Also, this makes sure that in case of HugeTLB we actually populate all
pages, rather than one page out of 8 (we were jumping by 16Mb instead of
2Mb).
Note: Can we get the size of a HugeTLB at runtime? We're assuming 2Mb
which might very well not be the case!
See: https://wiki.debian.org/Hugepages
Tested by disabling MAP_POPULATE and observing crashes :)
@fix
Summary:
The code in eina_debug.c requires the eina_swapX() functions on big endian platforms, so include the required header.
Test Plan: Do build on big endian platform like ppc64 or s390x.
Subscribers: kubu, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5158
Well... that's just embarassing... semaphore_destroy() actually takes
the mach task as its first parameter, not the second. This core
amazingly worked very fine on macOS earlier than Sierra.
Fixes T5245
This is a helper that creates a promise, then a future and immediately
resolves the promise, this will let the future be dispatched as usual,
from a clean main loop context.
restrict mapping /dev/zero to only eina files having a sigbus
reported. the mmap was before all our file access used eina_file i
think thus the raw mmap of it. now walk all eina files and find the
candidate and only then if it exists flag is as having a faulty i/o
backing and map the zerto pages then return, otherwise call abort.
more restricted mapping and perhaps a fix for not trapping non-efl
issues.
@fix
since we have a sigbusd handler that flags an eina file with io errors
it has to walk the file cache and every file... taking locks. if those
locks were taking already in the current thread the sighandler was
called in... we'd deadlock. since this basicallly never happens (when
do we see i/o errors really? not much)... we never saw this as it'd
also reauire this race condition to happen too. but it is a problem
waiting to happen. this fixes that by moving to recrusive locks.
@fix
These helpers are similar to eina_value_X_new(), however do not
allocate the Eina_Value, rather return it.
These are useful when the value struct storage was already there but
needs to be initialized in a single line, like as stack variables or
when returning a value.
these utilities are very useful, but names became too long. Since they
do not conflict with anything else, shorten them.
Since they were available before as inline function, provide a macro
to rename them for old source that's compiled against newer library.
EINA_VALUE_EMPTY is basically a zeroed Eina_Value, handy for declaring
and returning.
To cope with the rest of efl, free/del/flush on NULL shouldn't
complain, so flusing an empty value should be quiet.
When a virtualized file is created the file->global_map will not
point to a mmapped region, thus it's not safe to use munmap() during
the file cleanup. Only use munmap() if the file is backed by a FD.
Fixes: T5234.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
bad endian... code... see the comment in the src about why i think
this is bad as obviously the buffer pointed to is a 64bit type always
that is a pointer to something...
no point - all we are doing is having a final fallback of any tag that
starts with ! that isnt a special one like !DOCTYPE, !-- comment and
![CDATA stuff... analysers dont like these pointless calls.
found by PVS studio
this actually wasn't a bug that would cause a crash. cloning an array
access would fail as the magic check would find its an accessor not an
array. indeed a bug... but we never used this anywhere i can find.
this was cast to the correct func ptr callabck in the accessor struct
as the clone method though.. thus everyhting was happy with it
seemingly.
found by PVS studio
@fix
This fixes a crash in make check when --profile=dev is explicitely
enabled. eina_list_init() is called by the standard eina_init() loop
and by eina_debug_init() as well.
Honestly I'm not sure why it doesn't crash for other people as
well...
The crash was in eolian_suite during the second eina_init (called
from eolian_init).
Summary:
This was causing problems on non-Linux architectures as eina_file_real_close unmapped not mapped data. Added a "copied" flag to Eina_File which is set on eina_file_virtualize (on copied data), and tested for when eina_file_real_close does the unmap. I'm surprised Linux allowed this. Certainly all of the BSDs crashed with the previous behaviour.
@fix T5479
Test Plan: Example inlcude Rage and Enlightenment Thumb on BSD systems which use eina_file_virtualize with emotion to obtain album artwork.
Reviewers: raster, cedric, jpeg
Reviewed By: jpeg
Maniphest Tasks: T5479
Differential Revision: https://phab.enlightenment.org/D5006
so we copy data to an UNALINED memory address (just after whatever
string we packed on the end of the eina file struct header). this is
bad. especially for non-intel architectures. this forces a 16 byte
alignment which should cover us.
@fix
I'm not sure about the rest of this code, so it's possible that
the index is increased even if it shouldn't. But I've observed
a crash at this line, apparently when reaching the end pointer.
There was trouble with Homebrew's CI to build EFL on a macOS < 10.12
which uses a 10.12 SDK. See PR #13252 on github, Homebrew/homebrew-core
for details.
@fix
The opcodes registration request is sent directly in case the connection
is already made. Otherwise, the request is waiting for the connection to
be made by the dedicated thread (not the main loop).
That's why the request can be sent by the two different threads at the
same time, leading to send it twice. It means a callback for an opcode
would be invoked twice everytime a request with this opcode is received.
This patch fixes it by checking if the request has already been sent.
GCC has started introducing a detection for series of case in a switch statement
without break for each case. We do use that trick a lot to reduce our code base.
Even if in most case we have documented this so that people using coverity don't
try to fix it. Now with GCC we need to silence it properly to avoid future
problem.
Eina Debug is a new layer aimed for EFL debugging. It offers scalability
by allowing registration of operations not specific to EFL core.
The protocol is simple and the APIs try to provide as much
functionalities/freedom as possible.
Summary:
Escaping is not happening whenever any escapable characters is coming after
'\t' or '\n'. It will also fix invalid read of 1 byte which happens for string where
last charachter is '\t' or '\n' like "eina\t".
Test Plan:
Take a string like "eina\t ". Observe space which is followed by tab is not getting
escaped.
Signed-off-by: Prasoon Singh <prasoon.16@samsung.com>
Reviewers: shilpasingh, rajeshps, govi, cedric
Reviewed By: shilpasingh
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4847
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
since this code's creation it seems that the internal int size was set to use
short in order to micro-optimize memory usage, while the api function parameters
used Eina_Rectangle which had a larger int size. when initializing the internal
rect struct, this would lead to overflows which resulted in broken tilers which
returned iterators with no valid rects after having valid rects added
test case: run weston-subsurfaces
@fix
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.
CID 1361219
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.
CID 1361220
Summary:
There should be reallocation +1 (for last '\0') and also
checking >0, not !=0, because of getxattr can return -1 in case of error
@fix
Reviewers: cedric, raster, NikaWhite, jpeg
Reviewed By: NikaWhite
Subscribers: myoungwoon
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D4734
The eina_(rw)_slice_startswith functions both incorrectly describe how
the 'prefix' parameter is used, so fix those also
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
eina_(rw)_slice_startswith functions both incorrectly describe the
return value as 'slice ends with', when clearly the function is used
to find if a slice 'starts with' a prefix
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: CreateFileMapping return handle. The handle before use is always closed. This handle can be immediately closed after use.
Reviewers: cedric, raster, vtorri, rimmed, an.kroitor, FurryMyad, NikaWhite
Reviewed By: raster
Subscribers: artem.popov, cedric, jpeg
Tags: #windows
Differential Revision: https://phab.enlightenment.org/D4699
Summary:
The usage of the macro EINA_MAGIC_CHECK_LIST can
lead (in some cases) to leaks.
Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
Reviewers: jpeg
Reviewed By: jpeg
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4679
Summary: I had fixed some typos and some wrong expressions, such as capital letters, singular, and orders of groups in Eina API reference doxygen.
Test Plan: Doxygen Revision
Reviewers: stefan, cedric, raster, Jaehyun_Cho, jpeg
Reviewed By: jpeg
Subscribers: conr2d
Differential Revision: https://phab.enlightenment.org/D4674
If HAVE_GETPWENT isn't defined - the closing brace was missed.
Also prevent situation when strdup() tried to duplicate NULL
pointer, because that could cause segfault.
@fix
It was only defined in the c file. Without any documentation, since tag, etc.
tests/eina/eina_test_file.c:855:4: warning: implicit declaration of function ‘eina_file_unlink’
[-Wimplicit-function-declaration]
we really can't do much here but our direct casting causes warnings in
apps or anyone using this macro so keep things silent as our pointer
tricks are actually ok but the compiler can't figure it out.
if setuod we dont want to trust HOME environ at all and get it from
passwd file... also we dont want to keep re-getting too... so store
statically as well as tmp.
this also kind of helps CID 1366469
we set stack var to 0 even if evlog was off and thus didn't use it.
this cleans up the evlog func a bit and also moves locking until later
so it's locked for the minimum period to punt something into the log
buffer. it's an improvement, but no bug fix.
If we're not logging events this generates a lot of wasted system
calls. They probably don't amount to much, but it's trivial to
get rid of them, and they make a mess when logging with strace.
This is now used by ENABLE_SYSTEMD and ENABLE_VALGRIND, which moves to
"common.cmake" since they are shared among multiple libraries.
With that I found that LINK_FLAGS is indeed a string, not a CMake List
(space separated, not ";"), then fix that so compilation actually works.
make FUNC_CHECK(), TYPE_CHECK() and HEADER_CHECK() more general and
they can be set to a scope, like "eina", then all symbols are prefixed
with that. The scope is created with CHECK_INIT(), and
EFL_HEADER_CHECKS_FINALIZE() will finish that.
This makes it possible for cmake/config/eina.cmake +
cmake/post/eina.cmake to add stuff to the generated file, better than
hand edit the template.
CHECK_APPEND_DEFINE(name val) is now the base to add symbols to the
generated file in the current scope.
Then convert cmake/config/eina.cmake to use that and match the
autotools values (were a bit off).
This exposed enabling valgrind was broken due incorrect pkg-config
usage with cmake (it's not obvious), it was using just the libraries,
while LDFLAGS are needed to get -L/usr/lib/valgrind. Then also convert
to CFLAGS provided by pkg-config and make that automatic for
PKG_CONFIG_REQUIRES and PKG_CONFIG_REQUIRES_PRIVATE.
Also, eina-mempool modules use valgrind and must use that now that's
propagating correctly.
For one-source directories, be smart and just define SOURCES to that,
will reduce the number of too-simplistic CMakeLists.txt in our tree.
This also fixes problems with libraries, they should be private, not
public. So specify both kinds as different variables.
Stick to one target per directory and remove prefix from variables,
makes it cleaner and easier to use.
Document variables used and use a more consistent name that matches
CMake properties.