[PATCH 1/5] conf: changing all the "enum" structures into typedef's in "src/conf/" directory.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In "src/conf/" there are many enumeration (enum) structures like "src/util" directory. Sometimes, it's better using a typedef for variable types, function types and other usages. Other enumeration and folders will be changed to typedef's in the future.
Most of the files changed in this commit included CPU (cpu_conf) enum structures.

Signed-off-by: Julio Faracco <jcfaracco@xxxxxxxxx>
---
 src/conf/cpu_conf.c    |    2 +-
 src/conf/cpu_conf.h    |   22 +++++++++++-----------
 src/conf/device_conf.h |    4 ++--
 src/cpu/cpu_powerpc.c  |    2 +-
 src/cpu/cpu_x86.c      |    4 ++--
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index a8b1b03..ebdaa19 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -176,7 +176,7 @@ virCPUDefCopy(const virCPUDef *cpu)
 virCPUDefPtr
 virCPUDefParseXML(xmlNodePtr node,
                   xmlXPathContextPtr ctxt,
-                  enum virCPUType mode)
+                  virCPUType mode)
 {
     virCPUDefPtr def;
     xmlNodePtr *nodes = NULL;
diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index dbe7103..8c932ce 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -32,46 +32,46 @@
 
 # define VIR_CPU_VENDOR_ID_LENGTH 12
 
-enum virCPUType {
+typedef enum {
     VIR_CPU_TYPE_HOST,
     VIR_CPU_TYPE_GUEST,
     VIR_CPU_TYPE_AUTO,
 
     VIR_CPU_TYPE_LAST
-};
+} virCPUType;
 
 VIR_ENUM_DECL(virCPU)
 
-enum virCPUMode {
+typedef enum {
     VIR_CPU_MODE_CUSTOM,
     VIR_CPU_MODE_HOST_MODEL,
     VIR_CPU_MODE_HOST_PASSTHROUGH,
 
     VIR_CPU_MODE_LAST
-};
+} virCPUMode;
 
 VIR_ENUM_DECL(virCPUMode)
 
-enum virCPUMatch {
+typedef enum {
     VIR_CPU_MATCH_MINIMUM,
     VIR_CPU_MATCH_EXACT,
     VIR_CPU_MATCH_STRICT,
 
     VIR_CPU_MATCH_LAST
-};
+} virCPUMatch;
 
 VIR_ENUM_DECL(virCPUMatch)
 
-enum virCPUFallback {
+typedef enum {
     VIR_CPU_FALLBACK_ALLOW,
     VIR_CPU_FALLBACK_FORBID,
 
     VIR_CPU_FALLBACK_LAST
-};
+} virCPUFallback;
 
 VIR_ENUM_DECL(virCPUFallback)
 
-enum virCPUFeaturePolicy {
+typedef enum {
     VIR_CPU_FEATURE_FORCE,
     VIR_CPU_FEATURE_REQUIRE,
     VIR_CPU_FEATURE_OPTIONAL,
@@ -79,7 +79,7 @@ enum virCPUFeaturePolicy {
     VIR_CPU_FEATURE_FORBID,
 
     VIR_CPU_FEATURE_LAST
-};
+} virCPUFeaturePolicy;
 
 VIR_ENUM_DECL(virCPUFeaturePolicy)
 
@@ -140,7 +140,7 @@ virCPUDefCopy(const virCPUDef *cpu);
 virCPUDefPtr
 virCPUDefParseXML(xmlNodePtr node,
                   xmlXPathContextPtr ctxt,
-                  enum virCPUType mode);
+                  virCPUType mode);
 
 bool
 virCPUDefIsEqual(virCPUDefPtr src,
diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h
index 7986ca6..d66afd2 100644
--- a/src/conf/device_conf.h
+++ b/src/conf/device_conf.h
@@ -32,13 +32,13 @@
 # include "virthread.h"
 # include "virbuffer.h"
 
-enum virDeviceAddressPCIMulti {
+typedef enum {
     VIR_DEVICE_ADDRESS_PCI_MULTI_DEFAULT = 0,
     VIR_DEVICE_ADDRESS_PCI_MULTI_ON,
     VIR_DEVICE_ADDRESS_PCI_MULTI_OFF,
 
     VIR_DEVICE_ADDRESS_PCI_MULTI_LAST
-};
+} virDeviceAddressPCIMulti;
 
 typedef struct _virDevicePCIAddress virDevicePCIAddress;
 typedef virDevicePCIAddress *virDevicePCIAddressPtr;
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index 3b868bb..372272f 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -534,7 +534,7 @@ static int
 ppcUpdate(virCPUDefPtr guest,
           const virCPUDef *host)
 {
-    switch ((enum virCPUMode) guest->mode) {
+    switch ((virCPUMode) guest->mode) {
     case VIR_CPU_MODE_HOST_MODEL:
     case VIR_CPU_MODE_HOST_PASSTHROUGH:
         guest->match = VIR_CPU_MATCH_EXACT;
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 7328582..06fbfba 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1615,7 +1615,7 @@ x86DecodeCPUData(virCPUDefPtr cpu,
 static virCPUx86Data *
 x86EncodePolicy(const virCPUDef *cpu,
                 const struct x86_map *map,
-                enum virCPUFeaturePolicy policy)
+                virCPUFeaturePolicy policy)
 {
     struct x86_model *model;
     virCPUx86Data *data = NULL;
@@ -2045,7 +2045,7 @@ static int
 x86Update(virCPUDefPtr guest,
           const virCPUDef *host)
 {
-    switch ((enum virCPUMode) guest->mode) {
+    switch ((virCPUMode) guest->mode) {
     case VIR_CPU_MODE_CUSTOM:
         return x86UpdateCustom(guest, host);
 
-- 
1.7.10.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]