pinsched: Avoid uninitialized variable warning.
authorJesse Gross <jesse@nicira.com>
Sun, 12 Dec 2010 17:54:46 +0000 (09:54 -0800)
committerJesse Gross <jesse@nicira.com>
Mon, 13 Dec 2010 19:07:15 +0000 (11:07 -0800)
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

index dc835585b93b3e0186b664c00cb3302d84219701..a307a0758dbaf535c47cb954128d894b90d107b9 100644 (file)
@@ -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++;