tests: Remove write-only variables.
authorBen Pfaff <blp@nicira.com>
Wed, 10 Feb 2010 18:55:45 +0000 (10:55 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 11 Feb 2010 18:35:28 +0000 (10:35 -0800)
Found by Clang (http://clang-analyzer.llvm.org/).

tests/test-classifier.c
tests/test-vconn.c

index d36c8eb..010cdc6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2010 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -532,8 +532,8 @@ test_rule_replacement(void)
 
     for (wc_fields = 0; wc_fields < (1u << CLS_N_FIELDS); wc_fields++) {
         struct classifier cls;
-        struct test_rule *rule1, *tcls_rule1;
-        struct test_rule *rule2, *tcls_rule2;
+        struct test_rule *rule1;
+        struct test_rule *rule2;
         struct tcls tcls;
 
         rule1 = make_rule(wc_fields, OFP_DEFAULT_PRIORITY, UINT_MAX);
@@ -543,14 +543,14 @@ test_rule_replacement(void)
 
         classifier_init(&cls);
         tcls_init(&tcls);
-        tcls_rule1 = tcls_insert(&tcls, rule1);
+        tcls_insert(&tcls, rule1);
         assert(!classifier_insert(&cls, &rule1->cls_rule));
         check_tables(&cls, 1, 1, 1);
         compare_classifiers(&cls, &tcls);
         tcls_destroy(&tcls);
 
         tcls_init(&tcls);
-        tcls_rule2 = tcls_insert(&tcls, rule2);
+        tcls_insert(&tcls, rule2);
         assert(test_rule_from_cls_rule(
                    classifier_insert(&cls, &rule2->cls_rule)) == rule1);
         free(rule1);
index 4ce2f71..f12e378 100644 (file)
@@ -84,7 +84,7 @@ fpv_create(const char *type, struct fake_pvconn *fpv)
         CHECK_ERRNO(pstream_open(fpv->pvconn_name, &fpv->pstream), 0);
         free(bind_path);
     } else if (!strcmp(type, "tcp") || !strcmp(type, "ssl")) {
-        char *s, *method, *port, *save_ptr = NULL;
+        char *s, *port, *save_ptr = NULL;
         char *open_name;
 
         open_name = xasprintf("p%s:0:127.0.0.1", type);
@@ -92,7 +92,7 @@ fpv_create(const char *type, struct fake_pvconn *fpv)
 
         /* Extract bound port number from pstream name. */
         s = xstrdup(pstream_get_name(fpv->pstream));
-        method = strtok_r(s, ":", &save_ptr);
+        strtok_r(s, ":", &save_ptr);
         port = strtok_r(NULL, ":", &save_ptr);
 
         /* Save info. */