Commit Graph

23 Commits

Author SHA1 Message Date
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