Browse files

Comment-out unused operations in rinq.c (so it's clear these aren't t…

…ested)
  • Loading branch information...
1 parent f74c685 commit ebe173089b0180ab726bf7b571978381fe4de176 @stash committed Apr 11, 2011
Showing with 38 additions and 33 deletions.
  1. +38 −33 rinq.c
View
71 rinq.c
@@ -23,20 +23,22 @@ struct rinq {
(x_)->next = (x_)->prev = (x_); \
} while(0)
-static void
-rinq_unshift(struct rinq **head, void *ref)
-{
- struct rinq *x;
- RINQ_NEW(x,ref);
-
- if ((*head) != NULL) {
- x->next = (*head)->next;
- x->prev = (*head);
- x->next->prev = x->prev->next = x;
- }
- (*head) = x;
-}
+// INLINE_UNLESS_DEBUG
+// static void
+// rinq_unshift(struct rinq **head, void *ref)
+// {
+// struct rinq *x;
+// RINQ_NEW(x,ref);
+//
+// if ((*head) != NULL) {
+// x->next = (*head)->next;
+// x->prev = (*head);
+// x->next->prev = x->prev->next = x;
+// }
+// (*head) = x;
+// }
+INLINE_UNLESS_DEBUG
static void
rinq_push (struct rinq **head, void *ref)
{
@@ -54,28 +56,31 @@ rinq_push (struct rinq **head, void *ref)
}
// remove element from tail of rinq
-static void *
-rinq_pop (struct rinq **head) {
- void *ref;
- struct rinq *x;
-
- if ((*head) == NULL) return NULL;
-
- if (RINQ_IS_DETACHED((*head))) {
- x = (*head);
- (*head) = NULL;
- }
- else {
- x = (*head)->prev;
- RINQ_DETACH(x);
- }
-
- ref = x->ref;
- free(x);
- return ref;
-}
+// not actually used
+// INLINE_UNLESS_DEBUG
+// static void *
+// rinq_pop (struct rinq **head) {
+// void *ref;
+// struct rinq *x;
+//
+// if ((*head) == NULL) return NULL;
+//
+// if (RINQ_IS_DETACHED((*head))) {
+// x = (*head);
+// (*head) = NULL;
+// }
+// else {
+// x = (*head)->prev;
+// RINQ_DETACH(x);
+// }
+//
+// ref = x->ref;
+// free(x);
+// return ref;
+// }
// remove element from head of rinq
+INLINE_UNLESS_DEBUG
static void *
rinq_shift (struct rinq **head) {
void *ref;

0 comments on commit ebe1730

Please sign in to comment.