summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-03-05 13:33:44 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-05-01 10:39:01 -0700
commit5bfdc435c77cf5768437d7a42323e97f601ffa38 (patch)
tree8b78bd2c4130b6e5201253334a5de02a7979b431 /src
parent5b4d64ac13073a2c16fa3d75a009a2d30e449a7b (diff)
eina: improve EINA_VALUE_ARRAY_FOREACH to not systematically require &.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eina/eina_value.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/lib/eina/eina_value.h b/src/lib/eina/eina_value.h
index f413a73d94..49d0700a61 100644
--- a/src/lib/eina/eina_value.h
+++ b/src/lib/eina/eina_value.h
@@ -1828,6 +1828,7 @@ static inline Eina_Bool eina_value_array_value_get(const Eina_Value *src,
1828/** 1828/**
1829 * @def EINA_VALUE_ARRAY_FOREACH 1829 * @def EINA_VALUE_ARRAY_FOREACH
1830 * @brief Definition for the macro to iterate over an array contained in an Eina_Value. 1830 * @brief Definition for the macro to iterate over an array contained in an Eina_Value.
1831 * @since 1.21
1831 * 1832 *
1832 * @param array The list to iterate over. 1833 * @param array The list to iterate over.
1833 * @param length Contain the length of the array 1834 * @param length Contain the length of the array
@@ -1843,21 +1844,16 @@ static inline Eina_Bool eina_value_array_value_get(const Eina_Value *src,
1843 * Eina_Value array; 1844 * Eina_Value array;
1844 * Eina_Error err; 1845 * Eina_Error err;
1845 * unsigned int i, len; 1846 * unsigned int i, len;
1846 * Eina_Value v = EINA_VALUE_EMPTY;
1847 * 1847 *
1848 * // array is already filled, 1848 * // array is already filled with EINA_VALUE_TYPE_ERROR,
1849 * // its elements are unknown, 1849 * // its elements are unknown,
1850 * // EINA_VALUE_ARRAY_FOREACH will be used to check if there is no error 1850 * // EINA_VALUE_ARRAY_FOREACH will be used to check if there is no error
1851 * 1851 *
1852 * 1852 *
1853 * EINA_VALUE_ARRAY_FOREACH(&array, len, i, &v) 1853 * EINA_VALUE_ARRAY_FOREACH(&array, len, i, err)
1854 * { 1854 * {
1855 * if (v.type == EINA_VALUE_TYPE_ERROR) 1855 * eina_value_get(&v, &err);
1856 * { 1856 * fprintf(stderr, "Something has gone wrong: %s at index: %i\n", eina_error_msg_get(err), i);
1857 * eina_value_get(&v, &err);
1858 * fprintf(stderr, "Something has gone wrong: %s at index: %i\n", eina_error_msg_get(err), i);
1859 * abort();
1860 * }
1861 * } 1857 * }
1862 * @endcode 1858 * @endcode
1863 * 1859 *
@@ -1866,10 +1862,10 @@ static inline Eina_Bool eina_value_array_value_get(const Eina_Value *src,
1866#define EINA_VALUE_ARRAY_FOREACH(Array, Length, It, Value) \ 1862#define EINA_VALUE_ARRAY_FOREACH(Array, Length, It, Value) \
1867 for (Length = eina_value_array_count(Array), \ 1863 for (Length = eina_value_array_count(Array), \
1868 It = 0, \ 1864 It = 0, \
1869 eina_value_array_get(Array, It, Value); \ 1865 eina_value_array_get(Array, It, &Value); \
1870 It < Length; \ 1866 It < Length; \
1871 It++, \ 1867 It++, \
1872 eina_value_array_get(Array, It, Value)) 1868 eina_value_array_get(Array, It, &Value))
1873 1869
1874/** 1870/**
1875 * @} 1871 * @}