Commit Graph

45 Commits

Author SHA1 Message Date
Vincent Torri f7c560c311 replace hton and ntoh family functions with ones defined in eina
Summary: This fixes especially the execution of edje_cc on Windows

Test Plan: execution of edje_cc

Reviewers: cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7834
2019-02-01 14:25:35 +00:00
Derek Foreman dd206b4897 eet: Remove unused code
This stuff has been unused for years, so instead of fixing it up, remove
it.

Differential Revision: https://phab.enlightenment.org/D7283

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
2018-11-16 12:16:07 -06:00
Derek Foreman 2464cf6648 eet: Remove pointer deduplication
After my previous changes, the only thing left that's adding duplicate
pointers should be string allocations, either direct (which have no free)
or stringshare which need to be "freed" for each duplicate as it's a
refcounting mechanism.

This speeds up parsing the theme file modestly (10ms faster launching
elementary_test for me), and should also prevent leaking every
stringshare that's on the freelist if an eet load fails.

I would not be at all surprised if there are still bugs in the fail path,
but I hope this at least mitigates failure tracking's impact on successful
parse times.

Differential Revision: https://phab.enlightenment.org/D7282

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
2018-11-16 12:16:07 -06:00
Derek Foreman a9f1b588b1 eet: Demystify some typecasts
Simplify some confusing typecasts.  There may be more around.

No functional change.

Differential Revision: https://phab.enlightenment.org/D7281

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
2018-11-16 12:16:07 -06:00
Derek Foreman 1e498286d9 eet: Stop freeing allocated memory in descriptor_decode
There are other paths that free this memory, so it ends up freed by the
EET_G_UNKNOWN_NESTED path, yet remains on the list.

It makes more sense to have all the callers deal with this memory.

Differential Revision: https://phab.enlightenment.org/D7280

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
2018-11-16 12:16:07 -06:00
Derek Foreman 5889307f4c eet: Don't add duplicate hashes to eet freelist
The eet freelist code de-duplicates pointers, so passing duplicates is
just fine, however it does waste time doing the de-dup.

We know when we have a duplicate anyway, so save the time.

Differential Revision: https://phab.enlightenment.org/D7279

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
2018-11-16 12:16:07 -06:00
Derek Foreman cd44bdeac6 eet: Don't add duplicate lists to eet freelist
The eet freelist code de-duplicates pointers, so passing duplicates is
just fine, however it does waste time doing the de-dup.

We know when we have a duplicate anyway, so save the time.

Differential Revision: https://phab.enlightenment.org/D7278

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
2018-11-16 12:16:07 -06:00
Carsten Haitzler 03a919d6e0 eet data - if xwarning about possibly uninit var 2018-11-09 11:43:59 +00:00
Mike Blumenkrantz 25e6b218db eet: handle decode failures as errors in variant decoding
Summary:
all other null returns of _eet_data_descriptor_decode() are treated as
fatal errors when decoding, and failure to do so in this case guarantees
errors later due to incomplete decoding

@fix

ref T5379
Depends on D6293

Reviewers: devilhorns, ManMower

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T5379

Differential Revision: https://phab.enlightenment.org/D6294
2018-06-15 16:34:39 -04:00
Mike Blumenkrantz 4631d4ce7e eet: print errors any time an error occurs while decoding
Summary:
catching these errors was super annoying since the codebase is mostly
comprised of goto statements, so this should make future debugging easier
Depends on D6292

Reviewers: devilhorns, ManMower

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6293
2018-06-15 16:34:32 -04:00
Mike Blumenkrantz c74d964afa eet: add #if 0 around macro which will cause compile errors if used
Summary:
this macro wraps a function which is also inside an #if 0 block,
so it's best not to leave it where someone might try to use it

no functional changes

Reviewers: devilhorns, ManMower

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6292
2018-06-15 16:34:00 -04:00
Carsten Haitzler e46a2f95a8 eet - check for null edd's and don't decode junk data
in the process of fixing a bug in elm config i found the eet will
decode junk data with a null edd. check for these where it was missing
and return null so it's easier to see a problem. not really a fix as
it's invalid use of the api, but it's nicer to debug...
2018-05-27 17:10:19 +09:00
Ross Vandegrift 71e5c74eb6 efl: drop deprecated Encoding key from desktop files
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>
2017-12-13 10:27:48 -08:00
Carsten Haitzler f6638432d3 eet data - fix checking return value of eina_value_pset like elsewhere
eina_value_pset() return is checked pretty much everywhere except
here. this addresses that inconsistency. this fixes CID 1367487
2017-02-08 21:19:39 +09:00
Artem Popov 30693b8487 eet: add checking on null to eet_data_write_cipher and EINA_ARG_NONNULL to dump API @fix
Summary:
add checking on null to eet_data_write_cipher and EINA_ARG_NONNULL to eet_data_dump*
and eet_data_test_dump* API

Reviewers: NikaWhite, myoungwoon, cedric

Reviewed By: cedric

Subscribers: jpeg, t.naumenko

Differential Revision: https://phab.enlightenment.org/D4433

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-28 11:35:27 -08:00
Artem Popov 0b6e04d94f eet: add NULL-check to eet_connection_empty API to avoid segfault
@fix

Summary:
Only eet_connection_empty hasn't checking on NULL and try to read from field of object.
Add NULL-check for connection and return result of empty connection.

Reviewers: jpeg, cedric, myoungwoon

Subscribers: t.naumenko, NikaWhite

Differential Revision: https://phab.enlightenment.org/D4399

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-16 15:30:44 -08:00
Daniel Zaoui ee5a1d28f1 Eet: initialize descriptor class correctly 2016-11-14 13:24:32 +02:00
Jean-Philippe Andre 1b6825d3fe edje: Fix coverity warning
CID 1355234 Logically dead code

The indicated dead code may have performed some action;
that action will never occur.
In eet_data_descriptor_element_add: Code can never be
reached because of a logical contradiction (CWE-561)

Solution: use explicit range within valid values with <= and >=
rather than excluded values with > and <
2016-07-13 15:44:58 +09:00
Jee-Yong Um 557381a070 eet: add a helper to setup hash with generic value storage
Summary:
add a macro to setup eet_data_descriptor for hash with
generic value storage.

Test Plan: make check (test case is included in eet test suite)

Reviewers: cedric, raster

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3925

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-05-10 16:36:22 -07:00
Jean-Philippe Andre bd32015dfc Eet: Fail gracefully on invalid input
Consider infinity and NaN as invalid input for
put_float and put_double, since the underlying convert
function can't process them.

This fixes potential errors with incomplete / invalid evas 3d models
2015-12-29 16:19:02 +09:00
Jean-Philippe Andre b54fe3fe61 Edje data: Fix memory leak in nested data descriptors 2015-11-18 11:48:44 +09:00
Srivardhan Hebbar 71e68dcca6 eet: handling memory leak on realloc fail.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D3208

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-22 12:25:39 -07:00
Carsten Haitzler d40de658a2 eet - fix unused pointer
fix CID 1039489
2014-08-27 16:58:37 +09:00
Carsten Haitzler 190b404be2 eet - remove useless if at free 2014-08-27 12:11:11 +09:00
Carsten Haitzler d5e11fe840 eet - remove unused return val from decode
fixes CID 1039490
2014-08-25 13:03:50 +09:00
Felipe Magno de Almeida ab3eb4b2d3 eet-cxx: add implementation for eet C++.
Usage example:

  struct type
  {
    int foo;
    float bar;
  };

  type t0;

  auto descriptor = make_descriptor("type", &type::ofo, &type::bar);

  eet_data_write(file, descriptor.native_handle(), "type", &t0, false);

  std::unique_ptr<type> p = read_by_ptr(file, "type", descriptor);
  type t = read(file, "type", descriptor);

@feature

Reviewers: cedric, smohanty

Reviewed By: cedric

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D659

Signed-off-by: Cedric BAIL <cedric.bail@free.fr>
2014-04-01 22:00:13 +09:00
Gustavo Sverzut Barbieri f2a1f14abd eet: fix tokenizer's escape logic.
Tokenizer's approach of looking back is horrible and breaks the
following simple case (bug I had that lead to this patch):

          "string\\"

As the parser would get the end quote and check the previous character
if it was a backslash and it was, but it was not escaping the quote,
but being escaped by the previous backslash.

The best approach is to first check for escape and then go to
quote. Escape is simple and only the following byte, so we enter
escape, process the byte and then are back to regular mode (be it
quote or unquote).

Added testcase so we avoid breaking it again.

@bugfix cherry-pick
2014-03-13 22:08:44 -03:00
Gustavo Sverzut Barbieri 0d1d51f64e eet_data: guarantee double-word alignment for temporary stack buffer.
The code was giving enough memory to store doubles and longs, but they
could be unaligned as "unsigned char" allows 1-byte alignment, while
double may require 8 bytes.

By specifying the array as "long long" we force certain alignment in a
platform independent way. As this array is small enough and
short-lived, the number of items were not changed, this results in
more bytes on the stack but it shouldn't matter.
2014-01-20 21:44:42 -02:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00
Carsten Haitzler f0ba71314e eet data encode - dont free data if its not separately allocated
in one case data is not separately allocated but is part of the
Eet_Variant_Unknow struct where it is allocated as extra space on the
end of the data blob. in this case don't free it, otherwise do (pass
in true) as before. this should fix CID 1039728
2013-12-11 20:44:51 +09:00
Christophe Sadoine 6853dbcf23 eet: Adding EET_DATA_DESCRIPTOR_ADD_MAPPING_BASIC to add a basic type to a union.
I added EET_DATA_DESCRIPTOR_ADD_MAPPING_BASIC because I need basic types in unions, and EET_DATA_DESCRIPTOR_ADD_MAPPING is only for structs.
I also modified the example with a float and a string.

Reviewers: cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D313

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-11-04 15:35:41 +09:00
Cedric Bail c718a41728 eet: log size of subtype added to an Eet_Data_Descriptor.
This is really useful to track down a leak of a memory piece allocated by an
eet_data function. If you know the size of the leaked structure (valgrind
give you the total allocated size and the number of structure in it, so you
need to divide before having the right number), you just need to do :
EINA_LOG_LEVELS=eet:3 my_app 2>&1 | grep the_size

And there will be very few line matching reducing what you should be looking at.
2013-10-11 14:43:35 +09:00
Christophe Sadoine 87b17f1ce9 eet: added EET_DATA_DESCRIPTOR_ADD_SUB_NESTED(). 2013-09-24 15:10:44 +09:00
Carsten Haitzler aaf5a55319 fir clang nonnull complaint 2013-07-16 16:55:03 +09:00
Cedric Bail dd4a641bab eet: quick fix for windows. 2013-07-16 16:20:50 +09:00
Cedric Bail d9aa0fccd9 eet: add support for EET_T_VALUE.
Add the moment, it only support simple type. Need iterator for more
complex type. It also expect a pointer to an Eina_Value and not directly
an Eina_Value, let me know if you prefer the opposite and maybe I
should rename it EET_T_PVALUE.
2013-07-15 17:04:34 +09:00
Chris Michael e28f298dbd Fix memleak reported by Coverity: If we error out because we have a
hash with no key, then free the previously allocated data_stream.

NB: Fixes Coverity CID1039262

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 11:34:58 +01:00
Sebastian Dransfeld 336f6ec328 efl: formatting 2013-06-20 13:28:18 +02:00
Cedric Bail 3fe8098e9c include some header files conditionally add specific test for fcntl 2013-03-11 10:34:47 +09:00
Mike Blumenkrantz f9d80e493a add eet_data_descriptor_name_get()
SVN revision: 83546
2013-02-01 10:59:23 +00:00
Lucas De Marchi 06ff74834f efl: remove checks for socket.h, net/*, arpa/*
SVN revision: 82585
2013-01-10 20:26:02 +00:00
Vincent Torri 7fe3d35994 merge: __UNUSED__ --> EINA_UNUSED and some fixes in eo.
SVN revision: 77542
2012-10-05 20:09:47 +00:00
Daniel Juyung Seo 91f0f4ee8e backport r77494 and r77495.
SVN revision: 77498
2012-10-05 06:35:06 +00:00
Carsten Haitzler e0e6fd9201 port null check over to efl tree.
SVN revision: 77118
2012-09-27 03:56:20 +00:00
Vincent Torri 8abaff3bdf merge: add eet
SVN revision: 76768
2012-09-17 16:35:38 +00:00