NEWS ? ChangeLog ? Vincent
On Tue, Jan 10, 2012 at 12:13 AM, Enlightenment SVN <[email protected]> wrote: > Log: > Add eina_array_count(), deprecate eina_array_count_get(). > > This makes the API more uniform. > > > > Author: barbieri > Date: 2012-01-09 15:13:06 -0800 (Mon, 09 Jan 2012) > New Revision: 67001 > Trac: http://trac.enlightenment.org/e/changeset/67001 > > Modified: > trunk/eina/src/include/eina_array.h > trunk/eina/src/include/eina_inline_array.x trunk/eina/src/lib/eina_array.c > > Modified: trunk/eina/src/include/eina_array.h > =================================================================== > --- trunk/eina/src/include/eina_array.h 2012-01-09 18:21:54 UTC (rev 67000) > +++ trunk/eina/src/include/eina_array.h 2012-01-09 23:13:06 UTC (rev 67001) > @@ -351,7 +351,8 @@ > static inline void eina_array_data_set(const Eina_Array *array, > unsigned int idx, > const void *data) > EINA_ARG_NONNULL(1); > -static inline unsigned int eina_array_count_get(const Eina_Array *array) > EINA_ARG_NONNULL(1); > +static inline unsigned int eina_array_count_get(const Eina_Array *array) > EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_DEPRECATED; > +static inline unsigned int eina_array_count(const Eina_Array *array) > EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; > > /** > * @brief Returned a new iterator associated to an array. > @@ -429,7 +430,7 @@ > */ > #define EINA_ARRAY_ITER_NEXT(array, index, item, iterator) \ > for (index = 0, iterator = (array)->data; \ > - (index < eina_array_count_get(array)) && ((item = *((iterator)++))); \ > + (index < eina_array_count(array)) && ((item = *((iterator)++))); \ > ++(index)) > > #include "eina_inline_array.x" > > Modified: trunk/eina/src/include/eina_inline_array.x > =================================================================== > --- trunk/eina/src/include/eina_inline_array.x 2012-01-09 18:21:54 UTC (rev > 67000) > +++ trunk/eina/src/include/eina_inline_array.x 2012-01-09 23:13:06 UTC (rev > 67001) > @@ -128,6 +128,8 @@ > * This function returns the number of elements in @p array. For > * performance reasons, there is no check of @p array. If it is > * @c NULL or invalid, the program may crash. > + * > + * @deprecated use eina_array_count() > */ > static inline unsigned int > eina_array_count_get(const Eina_Array *array) > @@ -135,6 +137,22 @@ > return array->count; > } > > +/** > + * @brief Return the number of elements in an array. > + * > + * @param array The array. > + * @return The number of elements. > + * > + * This function returns the number of elements in @p array. For > + * performance reasons, there is no check of @p array. If it is > + * @c NULL or invalid, the program may crash. > + */ > +static inline unsigned int > +eina_array_count(const Eina_Array *array) > +{ > + return array->count; > +} > + > static inline Eina_Bool > eina_array_foreach(Eina_Array *array, Eina_Each_Cb cb, void *fdata) > { > > Modified: trunk/eina/src/lib/eina_array.c > =================================================================== > --- trunk/eina/src/lib/eina_array.c 2012-01-09 18:21:54 UTC (rev 67000) > +++ trunk/eina/src/lib/eina_array.c 2012-01-09 23:13:06 UTC (rev 67001) > @@ -119,7 +119,7 @@ > { > EINA_MAGIC_CHECK_ARRAY_ITERATOR(it, EINA_FALSE); > > - if (!(it->index < eina_array_count_get(it->array))) > + if (!(it->index < eina_array_count(it->array))) > return EINA_FALSE; > > if (data) > @@ -150,7 +150,7 @@ > { > EINA_MAGIC_CHECK_ARRAY_ACCESSOR(it, EINA_FALSE); > > - if (!(idx < eina_array_count_get(it->array))) > + if (!(idx < eina_array_count(it->array))) > return EINA_FALSE; > > if (data) > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > enlightenment-svn mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn ------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
