mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-09-21 13:34:59 +02:00
Make DEBUG_SMARTLIST work
svn:r10721
This commit is contained in:
parent
ea1348360e
commit
adff891463
@ -55,22 +55,24 @@ void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2);
|
|||||||
#ifdef DEBUG_SMARTLIST
|
#ifdef DEBUG_SMARTLIST
|
||||||
/** Return the number of items in sl.
|
/** Return the number of items in sl.
|
||||||
*/
|
*/
|
||||||
extern INLINE int smartlist_len(const smartlist_t *sl) ATTR_PURE {
|
extern INLINE int smartlist_len(const smartlist_t *sl) ATTR_PURE;
|
||||||
|
extern INLINE int smartlist_len(const smartlist_t *sl) {
|
||||||
tor_assert(sl);
|
tor_assert(sl);
|
||||||
return (sl)->num_used;
|
return (sl)->num_used;
|
||||||
}
|
}
|
||||||
/** Return the <b>idx</b>th element of sl.
|
/** Return the <b>idx</b>th element of sl.
|
||||||
*/
|
*/
|
||||||
extern INLINE void *smartlist_get(const smartlist_t *sl, int idx) ATTR_PURE {
|
extern INLINE void *smartlist_get(const smartlist_t *sl, int idx) ATTR_PURE;
|
||||||
|
extern INLINE void *smartlist_get(const smartlist_t *sl, int idx) {
|
||||||
tor_assert(sl);
|
tor_assert(sl);
|
||||||
tor_assert(idx>=0);
|
tor_assert(idx>=0);
|
||||||
tor_assert(sl->num_used < idx);
|
tor_assert(sl->num_used > idx);
|
||||||
return sl->list[idx];
|
return sl->list[idx];
|
||||||
}
|
}
|
||||||
extern INLINE void smartlist_set(smartlist_t *sl, int idx, void *val) {
|
extern INLINE void smartlist_set(smartlist_t *sl, int idx, void *val) {
|
||||||
tor_assert(sl);
|
tor_assert(sl);
|
||||||
tor_assert(idx>=0);
|
tor_assert(idx>=0);
|
||||||
tor_assert(sl->num_used < idx);
|
tor_assert(sl->num_used > idx);
|
||||||
sl->list[idx] = val;
|
sl->list[idx] = val;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user