]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix gcc 4.6 warnings
authorChristophe Fergeau <cfergeau@redhat.com>
Thu, 14 Apr 2011 09:22:35 +0000 (11:22 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 14 Apr 2011 17:09:12 +0000 (19:09 +0200)
gcc 4.6 warns when a variable is initialized but isn't used afterwards:

vmware/vmware_driver.c:449:18: warning: variable 'vmxPath' set but not used [-Wunused-but-set-variable]

This patch fixes these warnings. There are still 2 offending files:

- vbox_tmpl.c: the variable is used inside an #ifdef and is assigned several
  times outside of #ifdef. Fixing the warning would have required wrapping
  all the assignment inside #ifdef which hurts readability.

vbox/vbox_tmpl.c: In function 'vboxAttachDrives':
vbox/vbox_tmpl.c:3918:22: warning: variable 'accessMode' set but not used [-Wunused-but-set-variable]

- esx_vi_types.generated.c: the name implies it's generated code and I
  didn't want to dive into the code generator

esx/esx_vi_types.generated.c: In function 'esxVI_FileQueryFlags_Free':
esx/esx_vi_types.generated.c:1203:3: warning: variable 'item' set but not used [-Wunused-but-set-variable]

.mailmap
AUTHORS
src/nwfilter/nwfilter_ebiptables_driver.c
src/util/logging.c
src/vmware/vmware_driver.c

index 88dd435b16f296f857148e6d85c3f78e09da1d1a..8f37f7800bc4345fdbabb622d1ea0239545026d7 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -14,3 +14,4 @@
 <jclift@redhat.com> <justin@salasaga.org>
 <berrange@redhat.com> <dan@berrange.com>
 <soren@linux2go.dk> <soren@canonical.com>
+<cfergeau@redhat.com> <teuf@gnome.org>
diff --git a/AUTHORS b/AUTHORS
index 821cd396166ad359918d95f47f4a8eb1fd83edca..fded3757ab77812a341f71dfb8ea222ca2244183 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -156,7 +156,7 @@ Patches have also been contributed by:
   Zdenek Styblik       <stybla@turnovfree.net>
   Gui Jianfeng         <guijianfeng@cn.fujitsu.com>
   Michal Novotny       <minovotn@redhat.com>
-  Christophe Fergeau   <teuf@gnome.org>
+  Christophe Fergeau   <cfergeau@redhat.com>
   Markus Groß          <gross@univention.de>
   Phil Petty           <phpetty@cisco.com>
   Taku Izumi           <izumi.taku@jp.fujitsu.com>
index 6c9c470c41f12bdb1f9a4a87db024127e557575b..977f74b3f5f46101277a1bf0304a5f564848e690 100644 (file)
@@ -1634,7 +1634,7 @@ iptablesCreateRuleInstanceStateCtrl(virNWFilterDefPtr nwfilter,
                                     bool isIPv6)
 {
     int rc;
-    int directionIn = 0, directionOut = 0;
+    int directionIn = 0;
     char chainPrefix[2];
     bool maySkipICMP, inout = false;
     char *matchState = NULL;
@@ -1643,9 +1643,8 @@ iptablesCreateRuleInstanceStateCtrl(virNWFilterDefPtr nwfilter,
     if ((rule->tt == VIR_NWFILTER_RULE_DIRECTION_IN) ||
         (rule->tt == VIR_NWFILTER_RULE_DIRECTION_INOUT)) {
         directionIn = 1;
-        directionOut = inout = (rule->tt == VIR_NWFILTER_RULE_DIRECTION_INOUT);
-    } else
-        directionOut = 1;
+        inout = (rule->tt == VIR_NWFILTER_RULE_DIRECTION_INOUT);
+    }
 
     chainPrefix[0] = 'F';
 
index 9d187523ce703552eca5e53b790bda8f1df4c44b..bb3ba13aa971eb8df312b7abc9261fcd6450611a 100644 (file)
@@ -389,7 +389,7 @@ static void virLogDumpAllFD(const char *msg, int len) {
 void
 virLogEmergencyDumpAll(int signum) {
     int len;
-    int oldLogStart, oldLogLen, oldLogEnd;
+    int oldLogStart, oldLogLen;
 
     switch (signum) {
 #ifdef SIGFPE
@@ -444,7 +444,6 @@ virLogEmergencyDumpAll(int signum) {
      * so it's best to reset it first.
      */
     oldLogStart = virLogStart;
-    oldLogEnd = virLogEnd;
     oldLogLen = virLogLen;
     virLogEnd = 0;
     virLogLen = 0;
index b5e416be2cb0e931266b4455d73a482fa8fc2853..bbfb1a47a2a821e9ac2a3ce6fd4846d8b94ceaec 100644 (file)
@@ -467,7 +467,7 @@ vmwareDomainReboot(virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED)
     }
 
     vmwareSetSentinal(cmd, vmw_types[driver->type]);
-    vmwareSetSentinal(cmd, ((vmwareDomainPtr) vm->privateData)->vmxPath);
+    vmwareSetSentinal(cmd, vmxPath);
 
 
     if (vm->state != VIR_DOMAIN_RUNNING) {