[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r10721: Make DEBUG_SMARTLIST work (tor/trunk/src/common)
Author: weasel
Date: 2007-07-02 13:48:56 -0400 (Mon, 02 Jul 2007)
New Revision: 10721
Modified:
tor/trunk/src/common/container.h
Log:
Make DEBUG_SMARTLIST work
Modified: tor/trunk/src/common/container.h
===================================================================
--- tor/trunk/src/common/container.h 2007-07-02 15:13:52 UTC (rev 10720)
+++ tor/trunk/src/common/container.h 2007-07-02 17:48:56 UTC (rev 10721)
@@ -55,22 +55,24 @@
#ifdef DEBUG_SMARTLIST
/** 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);
return (sl)->num_used;
}
/** 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(idx>=0);
- tor_assert(sl->num_used < idx);
+ tor_assert(sl->num_used > idx);
return sl->list[idx];
}
extern INLINE void smartlist_set(smartlist_t *sl, int idx, void *val) {
tor_assert(sl);
tor_assert(idx>=0);
- tor_assert(sl->num_used < idx);
+ tor_assert(sl->num_used > idx);
sl->list[idx] = val;
}
#else