summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2018-04-19 21:36:08 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-01 10:39:01 -0700
commit473ed10c0289a5106de02695302518632ae363f8 (patch)
tree8fe4826284935a707cf85ef084e5c45ebf138301 /src/lib/eina
parent550b14261ec5d50da46386a553d7a3a980a734f8 (diff)
eina: add an EINA_VALUE_TYPE_BOOL.
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_inline_value_util.x6
-rw-r--r--src/lib/eina/eina_value.c2
-rw-r--r--src/lib/eina/eina_value.h8
3 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/eina/eina_inline_value_util.x b/src/lib/eina/eina_inline_value_util.x
index c2d293e1e1..f755b4bf1c 100644
--- a/src/lib/eina/eina_inline_value_util.x
+++ b/src/lib/eina/eina_inline_value_util.x
@@ -330,7 +330,7 @@ eina_value_bool_new(Eina_Bool b)
330{ 330{
331 Eina_Value *v; 331 Eina_Value *v;
332 332
333 v = eina_value_new(EINA_VALUE_TYPE_UCHAR); 333 v = eina_value_new(EINA_VALUE_TYPE_BOOL);
334 if (v) eina_value_set(v, b); 334 if (v) eina_value_set(v, b);
335 return v; 335 return v;
336} 336}
@@ -602,7 +602,7 @@ eina_value_bool_init(Eina_Bool b)
602{ 602{
603 Eina_Value v = EINA_VALUE_EMPTY; 603 Eina_Value v = EINA_VALUE_EMPTY;
604 604
605 if (eina_value_setup(&v, EINA_VALUE_TYPE_UCHAR)) 605 if (eina_value_setup(&v, EINA_VALUE_TYPE_BOOL))
606 eina_value_set(&v, b); 606 eina_value_set(&v, b);
607 return v; 607 return v;
608} 608}
@@ -900,7 +900,7 @@ eina_value_bool_get(const Eina_Value *v, Eina_Bool *b)
900{ 900{
901 EINA_SAFETY_ON_NULL_RETURN_VAL(b, EINA_FALSE); 901 EINA_SAFETY_ON_NULL_RETURN_VAL(b, EINA_FALSE);
902 *b = EINA_FALSE; 902 *b = EINA_FALSE;
903 if (v && v->type == EINA_VALUE_TYPE_UCHAR) 903 if (v && v->type == EINA_VALUE_TYPE_BOOL)
904 return eina_value_get(v, b); 904 return eina_value_get(v, b);
905 return EINA_FALSE; 905 return EINA_FALSE;
906} 906}
diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c
index db581aec1a..cb5fbc11c4 100644
--- a/src/lib/eina/eina_value.c
+++ b/src/lib/eina/eina_value.c
@@ -5433,6 +5433,7 @@ eina_value_init(void)
5433 } 5433 }
5434 5434
5435 EINA_VALUE_TYPE_UCHAR = _EINA_VALUE_TYPE_BASICS + 0; 5435 EINA_VALUE_TYPE_UCHAR = _EINA_VALUE_TYPE_BASICS + 0;
5436 EINA_VALUE_TYPE_BOOL = EINA_VALUE_TYPE_UCHAR;
5436 EINA_VALUE_TYPE_USHORT = _EINA_VALUE_TYPE_BASICS + 1; 5437 EINA_VALUE_TYPE_USHORT = _EINA_VALUE_TYPE_BASICS + 1;
5437 EINA_VALUE_TYPE_UINT = _EINA_VALUE_TYPE_BASICS + 2; 5438 EINA_VALUE_TYPE_UINT = _EINA_VALUE_TYPE_BASICS + 2;
5438 EINA_VALUE_TYPE_ULONG = _EINA_VALUE_TYPE_BASICS + 3; 5439 EINA_VALUE_TYPE_ULONG = _EINA_VALUE_TYPE_BASICS + 3;
@@ -5534,6 +5535,7 @@ EAPI const Eina_Value_Type *_EINA_VALUE_TYPE_BASICS_END = NULL;
5534EAPI const Eina_Value_Type *EINA_VALUE_TYPE_VALUE = NULL; 5535EAPI const Eina_Value_Type *EINA_VALUE_TYPE_VALUE = NULL;
5535EAPI const Eina_Value_Type *EINA_VALUE_TYPE_ERROR = NULL; 5536EAPI const Eina_Value_Type *EINA_VALUE_TYPE_ERROR = NULL;
5536EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UCHAR = NULL; 5537EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UCHAR = NULL;
5538EAPI const Eina_Value_Type *EINA_VALUE_TYPE_BOOL = NULL;
5537EAPI const Eina_Value_Type *EINA_VALUE_TYPE_USHORT = NULL; 5539EAPI const Eina_Value_Type *EINA_VALUE_TYPE_USHORT = NULL;
5538EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UINT = NULL; 5540EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UINT = NULL;
5539EAPI const Eina_Value_Type *EINA_VALUE_TYPE_ULONG = NULL; 5541EAPI const Eina_Value_Type *EINA_VALUE_TYPE_ULONG = NULL;
diff --git a/src/lib/eina/eina_value.h b/src/lib/eina/eina_value.h
index 49d0700a61..6d8c9414f2 100644
--- a/src/lib/eina/eina_value.h
+++ b/src/lib/eina/eina_value.h
@@ -383,6 +383,14 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_VALUE;
383EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_UCHAR; 383EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_UCHAR;
384 384
385/** 385/**
386 * @var EINA_VALUE_TYPE_UCHAR
387 * manages unsigned char type.
388 *
389 * @since 1.21
390 */
391EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_BOOL;
392
393/**
386 * @var EINA_VALUE_TYPE_USHORT 394 * @var EINA_VALUE_TYPE_USHORT
387 * manages unsigned short type. 395 * manages unsigned short type.
388 * 396 *