Commit Graph

1418 Commits

Author SHA1 Message Date
Wander Lairson Costa b767e28625 Protect EINA_(UN)LIKELY with parenthesis around the expr
Without it an expression like !EINA_LIKELY(a && b) expands
!a && b

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Differential Revision: https://phab.enlightenment.org/D12041
2020-07-03 18:17:29 +02:00
Lucas Cavalcante de Sousa a733f9c233 Native Windows: Eina: Resolve bad comparison while using windows strerror_s
`strerror_s` is the windows alternative of `strerror_r` used by EFL.

`strerror_s` never return the error code with the message as
`strerror_r` does, because of that, while comparing the first 14
characters of `Unknown error ` to the message from unknown code 4096
(`Unknown error`) they were accusing being different - in UNIX this
works because the message returned is `Unknown error 4096`.
This error was noticeable at `eina_error_test_failures` test case.

This Diff adds the error code to the message in case of an `Unknown
error`, making the windows implementation compliant with UNIX.

Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Reviewed-by: Wander Lairson Costa <wander.lairson@gmail.com>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12033
2020-06-26 17:17:13 +02:00
Vincent Torri cdaac43d3a Windows: fix eina_file_map_new()
the offset passed to MapViewOfFile() must be a multiple of the granularity.

https://docs.microsoft.com/en-us/windows/win32/memory/creating-a-view-within-a-file is taken as basis for this patch

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Reviewed-by: Wander Lairson Costa <wander.lairson@gmail.com>
Differential Revision: https://phab.enlightenment.org/D12031
2020-06-26 15:40:57 +02:00
Marcel Hollerbach 2dcb18acac eina_array: micro optimize eina_array_push
This commit does two things:
- Tell the compiler that it is unlikely that we need to grow, and that
  it is unlikely that data is NULL. Sometimes the if check for data
  would get dropped out by the compiler when it can be ensured that it is
  != NULL. However, if we for example efl_add something and eina_push
  the result, the condition would not be removed, as there is no assertion
  efl_add would be != NULL.

- Do not hide the array assignment in a branch, but make it the default
  branch, this way instruction cache caches the correct instruction, as
  branch prediction will now hopefully, due to the hinting, take the
  correct branch.

While benchmarking this here (simply in elementary_perf), this reduced
pipeline faults in eina_array_push quite a bit. (Btw. it is hard to track
*which* exact calls to eina_array_push do cause that, as mostly this API
gets inlined, so it was easier optimizing that, instead of the method
arround)

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11997
2020-06-25 09:03:09 +02:00
Elyes HAOUAS 032894a489 Get rid of trailing whitespaces (8 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12007
2020-06-23 10:30:16 +02:00
Ali Alzyod c501d09c3a eina_strbuf: introduce change last occurrence function
Reviewers: cedric, woohyun, bowonryu

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8757

Differential Revision: https://phab.enlightenment.org/D11990
2020-06-22 17:31:54 +09:00
Ali Alzyod 8f3be603c2 eina_strbuf: if readonly strbuf is malloc, then it will stop being readonly
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8757

Differential Revision: https://phab.enlightenment.org/D11992
2020-06-22 17:16:34 +09:00
Ali Alzyod 1a2811bae4 eina_strbuf_manage_new: update documentation
Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8757

Differential Revision: https://phab.enlightenment.org/D11991
2020-06-22 17:16:02 +09:00
Ali Alzyod 1bbd03b768 eina_strbuf: resolve segfault when replace used with read_only buffer
Summary: when eina_strbuf_replace is used by read_only buffer, this will cause segfault (access invalid memory)

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8757

Differential Revision: https://phab.enlightenment.org/D11989
2020-06-22 16:54:51 +09:00
Boris Faure abc146f37f eina_unicode: have explicit type conversions
Summary:
Found by running terminology's tests with UBSAN:
include/eina-1/eina/eina_inline_unicode.x:
runtime error: implicit conversion from type 'char' of value
-62 (8-bit, signed) to type 'unsigned char' changed the value to 194
(8-bit, unsigned)

Reviewers: #reviewers, vtorri

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11972
2020-06-20 11:37:56 +01:00
Vincent Torri f04316e3f0 meson: add Solaris support
Summary: Add Solaris support for meson

Test Plan: test on OpenIndiana

Reviewers: raster, bu5hm4n, stefan_schmidt

Reviewed By: raster, stefan_schmidt

Subscribers: alarcher, stefan_schmidt, bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11973
2020-06-18 14:36:48 +01:00
Daniel Kolesa e557869765 eina: only enable EINA_LOG_BACKTRACE when backtrace API is present
This prevents build breakage on platforms that either don't have
backtrace() or don't have the appropriate library for it installed.
2020-06-11 02:20:00 +02:00
Vincent Torri cfbdcdc9c8 Use extern after EAPI
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11961
2020-06-10 10:07:57 +02:00
Carsten Haitzler 0ab3575f70 eina - prefix - use smaller buffers for building strings
use less stack space but no features as buffers are big enough for all
content used or alloca'd now.
2020-06-09 10:16:24 +01:00
Carsten Haitzler 3f26662390 eina - abstratc content - smaller stack buffer for limited size string
no need for a 4k buffer when 128 bytes will be plenty - short string.
2020-06-09 10:16:24 +01:00
Marcel Hollerbach f6d20e1f96 build: make eina drag in the -lm flag
eina uses math.h we need to drag in this flag everywhere.

Differential Revision: https://phab.enlightenment.org/D11896
2020-05-28 13:03:39 +02:00
Marcel Hollerbach bb4d116534 build: rely on automatic pkg file generation for eina
this automatically brings it to efl-one, which makes this easier.

Differential Revision: https://phab.enlightenment.org/D11892
2020-05-28 12:52:58 +02:00
Marcel Hollerbach 0b08318117 build: add correct flags to efl-one.pc
they are required, and normally dragged in via eina.
2020-05-27 13:26:15 +02:00
Marcel Hollerbach 8e3606698e refactor build
libraries are split into deps, external deps, and pub deps.
Evas engines are refactored to use the predefined engine deps.

this is preparation work for efl-one.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11806
2020-05-27 11:06:46 +02:00
Stefan Schmidt 3ca9d72825 build: lib: harmonize the use of package_c_args in all libs
Add it to subprojects which are not using it and remove and old
ELEMENTARY_BUILD define we no longer use. This allows us to have a
central place in the main meson.build file to set this variable.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11854
2020-05-26 10:15:21 +02:00
Carsten Haitzler 3b39cb9472 eina - dont use SCHED_BATCH or SCHED_IDLE unless they are defined 2020-05-25 10:28:11 +01:00
Carsten Haitzler a555fbf769 ecore thread - feedback threads should not be background threads...
if try_no_queue is used - its a thread that clearly wantt to be out of
the queue to run on its own so probably wants to wake up accurately
and thus not be a backgroun rpriority task but and urgent one. ensure
we set up priority accordingly as we didn't before. this should fix
scheduling when under load for vsync

@fix
2020-05-23 09:34:57 +01:00
Carsten Haitzler 63b5d81983 Revert "Fix EAPI definition by defining EFL_BUILD for each built DLL"
This reverts commit 3ade45cbc8.
2020-05-18 11:13:59 +01:00
Vincent Torri 3ade45cbc8 Fix EAPI definition by defining EFL_BUILD for each built DLL
Summary: EAPI must be defined to dllexport when building DLL, and to dllimport when using these DLL. To achieve this, define EFL_BUILD for each library and module, and set DLL_EXPORT unconditionally. Static library are and will be not supported

Test Plan: compilation

Reviewers: zmike, raster, jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11834
2020-05-18 09:51:48 +01:00
Carsten Haitzler fe56edae3f systemd - make libsystemd use/supprot entirely runtime "dlopened"
so i've moved all systemd and elogind support to be runtime only with
dlopen (eina_module) of libsystemd.so.0 (or libelogind.so.0 for elput)
and finding of symbols manually at runtime (if the right code paths or
env vars are set), thus remvoing the need to decide at compile time if
efl needs systemd support or not as it no longer needs systemd
headers/libs at compile time and just at runtime. this simplifies
building a bit and makes efl more adaptive to the final target system
at runtime.
2020-05-18 09:36:55 +01:00
Mike Blumenkrantz ef3a09499f build: fix void* use in pointer maths
Summary:
void* is an invalid type for calculating pointer offsets, so ensure that
this is always cast to something else (e.g., char*) in the few cases
where it's been misused

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11816
2020-05-12 16:55:59 +02:00
Mike Blumenkrantz e0e1dc5f6f eina: resolve float comparison warnings
Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11786
2020-05-09 09:25:04 +01:00
Xavi Artigas 998dd2f616 doxygen docs: Put Eina XAttrs in their own group
To stop polluting the Eina Tools group.
2020-05-08 12:32:09 +02:00
Xavi Artigas 3cc754440e doxygen docs: Complete docs for Eina Thread 2020-05-08 12:32:09 +02:00
Xavi Artigas a80b1dca23 doxygen docs: Fix grouping mess in Eina Simple XML
Seriously, who came up with such convoluted doxygen code?
2020-05-08 12:32:09 +02:00
Xavi Artigas 78aa7a7467 doxygen docs: Complete docs for Eina Module
And fix yet another doxygen grouping mess
2020-05-08 12:32:09 +02:00
Xavi Artigas 2aae4a0c85 doxygen docs: Complete docs for Eina Log 2020-05-08 12:32:09 +02:00
Xavi Artigas 361aa83a17 doxygen docs: Complete docs for Eina CPU functions 2020-05-08 12:32:09 +02:00
Xavi Artigas 88d1c886bd doxygen docs: Complete docs for Eina_Rectangle 2020-05-08 12:32:09 +02:00
Vincent Torri d135957ffa Use __func__ C99 identifier instead of __FUNCTION__ compiler extension
Summary: see http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf section 6.4.2.2 page 52

Test Plan: compilation

Reviewers: raster, devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11785
2020-05-07 09:27:07 -04:00
Xavi Artigas e72912393e doxygen docs: add missing example references 2020-04-29 17:33:39 +02:00
Boris Faure 96c176d866 meson: allow debug-threads to be disabled in debug
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11756
2020-04-28 14:41:38 +02:00
Carsten Haitzler 56e2e21ae7 ecore_file - address issue about false positive of finding a file in ./
it may report an exe is installed if it happens to be in cwd but cwd
isnt in path. the "full/relative" path handling case mishandled this.
fixes T8678

@fix
2020-04-22 12:51:50 +01:00
Marcel Hollerbach 639b6d6ae3 eina: add new definitions to a old enum
this is sadly needed due to the fact that we have a .eo defnition in the
.eot file which contains the flags keyword.

Differential Revision: https://phab.enlightenment.org/D11739
2020-04-21 16:19:36 +02:00
Mike Blumenkrantz bc52776fd6 eina/value: use correct time types when comparing time types
these functions all expect struct timeval, as the name implies

../src/lib/eina/eina_value.c: In function ‘_eina_value_type_tm_compare’:
../src/lib/eina/eina_value.c:3358:19: warning: array subscript 1 is outside array bounds of ‘time_t[1]’ {aka ‘long int[1]’} [-Warray-bounds]
 3358 |    struct timeval ret = *input;
      |                   ^~~
../src/lib/eina/eina_value.c:3569:11: note: while referencing ‘ta’
 3569 |    time_t ta, tb;
      |           ^~
../src/lib/eina/eina_value.c:3358:19: warning: array subscript 1 is outside array bounds of ‘time_t[1]’ {aka ‘long int[1]’} [-Warray-bounds]
 3358 |    struct timeval ret = *input;
      |                   ^~~
../src/lib/eina/eina_value.c:3569:15: note: while referencing ‘tb’
 3569 |    time_t ta, tb;

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11715
2020-04-17 11:14:54 +02:00
Marcel Hollerbach 11da918983 Replace strncmp code
the structure "!strcmp(X, "foo", strlen("foo"))" is equal to
"eina_has_prefix(X, "foo")", and the later is nicer to read, hence this
replaces it.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11620
2020-04-03 14:51:11 +02:00
Xavi Artigas 3a480503f9 doxygen docs: Add _Eina_Version struct docs 2020-04-02 17:48:39 +02:00
Xavi Artigas 80acb33898 Eina: Remove eina_prime_table
This has been present since ancient times and no current uses have been detected.
It's an array containing SOME prime numbers without a terminator, so the caller
needs to know the array length in advance.
This does not look very useful (or usable) and therefore it has been decided in
public IRC session to send this thing to hell.
Witnesses: raster stefan_schmidt bu5hm4n
2020-03-27 13:33:04 +01:00
Xavi Artigas 0fa18c0866 doxygen docs: Add missing docs for core Eina types
Things like EINA_LIKELY or EAPI were undocumented...
2020-03-27 13:33:04 +01:00
Myoungwoon Roy, Kim 3feacb2b66 docs: Fix Eina Core Group
Summary: I had fixed unlinked Eina API group(eina_main, eina_types, hamster) from Eina nodes. Those APIs included into Core group before.

Test Plan: API reference documentation modification only

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11605
2020-03-27 10:19:54 +01:00
Xavi Artigas 50f83d5d3a doxygen docs: Fix several warnings in Eina files 2020-03-26 14:27:51 +01:00
Xavi Artigas c4fad77ae3 doxygen docs: Fix Eina Promises doc structure and links
Man, this was a tough one!
The content still needs work, but the structure makes a bit more sense now,
and there are no broken links, typos or doxygen warnings anymore.
2020-03-17 19:23:56 +01:00
Xavi Artigas d1c74afc40 doxygen docs: Create Eina Vector2 group in the right place
A couple members were outside the group and appeared in the
Eina Data Types page instead.
2020-03-17 19:23:56 +01:00
Xavi Artigas eb2971fd4c doxygen docs: Put quadtrees in their own group
To clean up the Eina Data Types page
2020-03-17 19:23:56 +01:00
Wonki Kim 770e3cae4a eina_file: fix a typo error
'sefl' is definitely a typo
this patch fixes it

Reviewed-by: Shinwoo Kim <cinoo.kim@samsung.com>
Differential Revision: https://phab.enlightenment.org/D11510
2020-03-17 10:29:45 +01:00