[asterisk-commits] russell: branch russell/heap r176215 - in /team/russell/heap: include/asteris...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Feb 16 15:06:44 CST 2009
Author: russell
Date: Mon Feb 16 15:06:43 2009
New Revision: 176215
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=176215
Log:
Various improvements from kevin's code review
Modified:
team/russell/heap/include/asterisk/heap.h
team/russell/heap/main/heap.c
team/russell/heap/main/sched.c
Modified: team/russell/heap/include/asterisk/heap.h
URL: http://svn.digium.com/svn-view/asterisk/team/russell/heap/include/asterisk/heap.h?view=diff&rev=176215&r1=176214&r2=176215
==============================================================================
--- team/russell/heap/include/asterisk/heap.h (original)
+++ team/russell/heap/include/asterisk/heap.h Mon Feb 16 15:06:43 2009
@@ -149,7 +149,7 @@
* \param index index of the element to return. The first element is at index 1,
* and the last element is at the index == the size of the heap.
*
- * \return an element at the specified index on the heap. This element will _not_
+ * \return an element at the specified index on the heap. This element will \b not
* be removed before being returned.
*
* \note If this function is being used in combination with ast_heap_size() for
@@ -211,7 +211,7 @@
* \retval non-zero failure
*
* \note This function is mostly for debugging purposes. It traverses an existing
- * heap and verifies that every node is >= its children.
+ * heap and verifies that every node is properly placed relative to its children.
*/
int ast_heap_verify(struct ast_heap *h);
Modified: team/russell/heap/main/heap.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/heap/main/heap.c?view=diff&rev=176215&r1=176214&r2=176215
==============================================================================
--- team/russell/heap/main/heap.c (original)
+++ team/russell/heap/main/heap.c Mon Feb 16 15:06:43 2009
@@ -62,7 +62,7 @@
static inline ssize_t get_index(struct ast_heap *h, void *elm)
{
- size_t *index;
+ ssize_t *index;
if (h->index_offset < 0) {
return -1;
@@ -230,7 +230,7 @@
}
ret = heap_get(h, index);
- heap_set(h, index, heap_get(h, h->cur_len--));
+ heap_set(h, index, heap_get(h, (h->cur_len)--));
max_heapify(h, index);
Modified: team/russell/heap/main/sched.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/heap/main/sched.c?view=diff&rev=176215&r1=176214&r2=176215
==============================================================================
--- team/russell/heap/main/sched.c (original)
+++ team/russell/heap/main/sched.c Mon Feb 16 15:06:43 2009
@@ -233,10 +233,7 @@
static int sched_time_cmp(void *a, void *b)
{
- struct sched *as = a;
- struct sched *bs = b;
-
- return ast_tvcmp(bs->when, as->when);
+ return ast_tvcmp(((struct sched *) a)->when, ((struct sched *) b)->when);
}
struct sched_context *sched_context_create(void)
More information about the asterisk-commits
mailing list