forked from enlightenment/efl
add EINA_VALUE_EMPTY, allow flushing empty values.
EINA_VALUE_EMPTY is basically a zeroed Eina_Value, handy for declaring and returning. To cope with the rest of efl, free/del/flush on NULL shouldn't complain, so flusing an empty value should be quiet.
This commit is contained in:
parent
95f59ecd51
commit
4da53492ae
|
@ -136,6 +136,7 @@ eina_value_flush(Eina_Value *value)
|
|||
const Eina_Value_Type *type;
|
||||
void *mem;
|
||||
|
||||
if (!value || !value->type) return;
|
||||
EINA_VALUE_TYPE_CHECK_RETURN(value);
|
||||
|
||||
type = value->type;
|
||||
|
|
|
@ -304,6 +304,16 @@
|
|||
*/
|
||||
typedef struct _Eina_Value Eina_Value;
|
||||
|
||||
/**
|
||||
* @def EINA_VALUE_EMPTY
|
||||
*
|
||||
* This is simply a value with all memory zeroed. It may be used
|
||||
* to safely initialize or return a value without a type.
|
||||
*
|
||||
* @since 1.21
|
||||
*/
|
||||
#define EINA_VALUE_EMPTY ((Eina_Value){ 0 })
|
||||
|
||||
/**
|
||||
* @typedef Eina_Value_Type
|
||||
* Describes the data contained by the value.
|
||||
|
|
Loading…
Reference in New Issue