diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2018-05-10 16:42:08 -0700 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2018-05-22 16:55:08 -0700 |
commit | 1034c5bcad260ca920be4b02b9b9c2e71923fa5d (patch) | |
tree | f3f57821ec8dd85386eeaaf8970dcd3b1d2a9ab5 | |
parent | 72ae1afab3ef6c046aef60c5e64df0215ba05187 (diff) | |
download | efl-1034c5bcad260ca920be4b02b9b9c2e71923fa5d.tar.gz |
eina: make it possible to return an EINA_VALUE_EMPTY by just requesting a new value of type NULL.
-rw-r--r-- | src/lib/eina/eina_value.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c index ddb02af48d..dbf6f48d9c 100644 --- a/src/lib/eina/eina_value.c +++ b/src/lib/eina/eina_value.c @@ -5589,6 +5589,13 @@ eina_value_new(const Eina_Value_Type *type) { Eina_Value *value = eina_mempool_malloc(_eina_value_mp, sizeof(Eina_Value)); if (!value) return NULL; + if (!type) + { + const Eina_Value empty = EINA_VALUE_EMPTY; + + memcpy(value, &empty, sizeof (empty)); + return value; + } if (!eina_value_setup(value, type)) { eina_mempool_free(_eina_value_mp, value); |