From: Jesse Gross Date: Sun, 12 Dec 2010 17:54:46 +0000 (-0800) Subject: pinsched: Avoid uninitialized variable warning. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2973b1a8b539e0f7fbd1f9fbb090b406484c1bb;p=openvswitch 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. --- diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c index dc835585..a307a075 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++;