Browse Source

aga: Annotate unused return values

bfs_dequeue() and dfs_pop() discard the return values of lqueue_dequeue()
and lstack_pop() respectively.  This is correct, but causes warnings in
some compiler configurations (including the one currently used by
travis-ci.org).

Use the cast-to-void idiom to tell the compiler this is intentional.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
David Gibson 10 years ago
parent
commit
9840dbd3e1
2 changed files with 2 additions and 2 deletions
  1. 1 1
      ccan/aga/bfs.c
  2. 1 1
      ccan/aga/dfs.c

+ 1 - 1
ccan/aga/bfs.c

@@ -32,7 +32,7 @@ static struct aga_node *bfs_front(bfs_queue *queue)
 
 static void bfs_dequeue(bfs_queue *queue)
 {
-	lqueue_dequeue(queue);
+	(void) lqueue_dequeue(queue);
 }
 
 int aga_bfs_start(struct aga_graph *g)

+ 1 - 1
ccan/aga/dfs.c

@@ -27,7 +27,7 @@ static bool dfs_push(struct aga_graph *g, dfs_stack *stack,
 
 static void dfs_pop(dfs_stack *stack)
 {
-	lstack_pop(stack);
+	(void) lstack_pop(stack);
 }
 
 static struct aga_node *dfs_top(dfs_stack *stack)