From a2973b1a8b539e0f7fbd1f9fbb090b406484c1bb Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Sun, 12 Dec 2010 09:54:46 -0800 Subject: [PATCH] pinsched: Avoid uninitialized variable warning. Some compilers warn about the variable 'n_longest' in drop_packet() being used uninitialized. This isn't actually possible but explicitly set it to zero to avoid spurious warnings. --- ofproto/pinsched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c index dc835585b..a307a0758 100644 --- a/ofproto/pinsched.c +++ b/ofproto/pinsched.c @@ -123,7 +123,7 @@ static void drop_packet(struct pinsched *ps) { struct pinqueue *longest; /* Queue currently selected as longest. */ - int n_longest; /* # of queues of same length as 'longest'. */ + int n_longest = 0; /* # of queues of same length as 'longest'. */ struct pinqueue *q; ps->n_queue_dropped++; -- 2.20.1