A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cosmetics
[simgrid.git]
/
src
/
xbt
/
dynar.c
diff --git
a/src/xbt/dynar.c
b/src/xbt/dynar.c
index
446f26d
..
e289e65
100644
(file)
--- a/
src/xbt/dynar.c
+++ b/
src/xbt/dynar.c
@@
-335,6
+335,16
@@
XBT_INLINE unsigned long xbt_dynar_length(const xbt_dynar_t dynar)
return (dynar ? (unsigned long) dynar->used : (unsigned long) 0);
}
return (dynar ? (unsigned long) dynar->used : (unsigned long) 0);
}
+/**@brief check if a dynar is empty
+ *
+ *\param dynar the dynat we want to check
+ */
+
+XBT_INLINE int xbt_dynar_is_empty(const xbt_dynar_t dynar)
+{
+ return (xbt_dynar_length(dynar) == 0);
+}
+
/** @brief Retrieve a copy of the Nth element of a dynar.
*
* \param dynar information dealer
/** @brief Retrieve a copy of the Nth element of a dynar.
*
* \param dynar information dealer
@@
-520,7
+530,7
@@
xbt_dynar_remove_at(xbt_dynar_t const dynar,
*
* Raises not_found_error if not found.
*/
*
* Raises not_found_error if not found.
*/
-int xbt_dynar_search(xbt_dynar_t const dynar, void *const elem)
+
unsigned
int xbt_dynar_search(xbt_dynar_t const dynar, void *const elem)
{
unsigned long it;
{
unsigned long it;
@@
-692,7
+702,7
@@
XBT_INLINE void xbt_dynar_cursor_unlock(xbt_dynar_t dynar)
* Remark: if the elements stored in the dynar are structures, the compar_fn
* function has to retrieve the field to sort first.
*/
* Remark: if the elements stored in the dynar are structures, the compar_fn
* function has to retrieve the field to sort first.
*/
-XBT_INLINE void xbt_dynar_sort(xbt_dynar_t dynar,
__compar_fn
_t compar_fn){
+XBT_INLINE void xbt_dynar_sort(xbt_dynar_t dynar,
int_f_cpvoid_cpvoid
_t compar_fn){
_dynar_lock(dynar);
_dynar_lock(dynar);