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

[libvirt] [PATCH] headers: Remove unnecessary keyword extern from function declaration



Usage of this keyword in front of function declaration that is exported via a
header file is unnecessary, since internally, this has been the default for most
compilers for quite some time.

Signed-off-by: Erik Skultety <eskultet redhat com>
---
 src/conf/capabilities.h           | 28 +++++++-------
 src/cpu/cpu.h                     | 24 ++++++------
 src/cpu/cpu_map.h                 |  2 +-
 src/lxc/lxc_fuse.h                |  6 +--
 src/util/virhashcode.h            |  2 +-
 src/util/virlog.h                 | 78 +++++++++++++++++++--------------------
 src/util/virstats.h               |  4 +-
 src/xen/block_stats.h             |  4 +-
 src/xen/xen_driver.h              |  2 +-
 src/xenapi/xenapi_driver.h        |  2 +-
 tools/virt-host-validate-common.h | 62 +++++++++++++++----------------
 tools/virt-host-validate-lxc.h    |  2 +-
 tools/virt-host-validate-qemu.h   |  2 +-
 13 files changed, 109 insertions(+), 109 deletions(-)

diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index 2767f48..cfdc34a 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -204,27 +204,27 @@ struct _virCapsDomainData {
 };
 
 
-extern virCapsPtr
+virCapsPtr
 virCapabilitiesNew(virArch hostarch,
                    bool offlineMigrate,
                    bool liveMigrate);
 
-extern void
+void
 virCapabilitiesFreeNUMAInfo(virCapsPtr caps);
 
-extern int
+int
 virCapabilitiesAddHostFeature(virCapsPtr caps,
                               const char *name);
 
-extern int
+int
 virCapabilitiesAddHostMigrateTransport(virCapsPtr caps,
                                        const char *name);
 
-extern int
+int
 virCapabilitiesSetNetPrefix(virCapsPtr caps,
                             const char *prefix);
 
-extern int
+int
 virCapabilitiesAddHostNUMACell(virCapsPtr caps,
                                int num,
                                unsigned long long mem,
@@ -236,19 +236,19 @@ virCapabilitiesAddHostNUMACell(virCapsPtr caps,
                                virCapsHostNUMACellPageInfoPtr pageinfo);
 
 
-extern int
+int
 virCapabilitiesSetHostCPU(virCapsPtr caps,
                           virCPUDefPtr cpu);
 
 
-extern virCapsGuestMachinePtr *
+virCapsGuestMachinePtr *
 virCapabilitiesAllocMachines(const char *const *names,
                              int nnames);
-extern void
+void
 virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines,
                             int nmachines);
 
-extern virCapsGuestPtr
+virCapsGuestPtr
 virCapabilitiesAddGuest(virCapsPtr caps,
                         int ostype,
                         virArch arch,
@@ -257,7 +257,7 @@ virCapabilitiesAddGuest(virCapsPtr caps,
                         int nmachines,
                         virCapsGuestMachinePtr *machines);
 
-extern virCapsGuestDomainPtr
+virCapsGuestDomainPtr
 virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
                               int hvtype,
                               const char *emulator,
@@ -265,13 +265,13 @@ virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
                               int nmachines,
                               virCapsGuestMachinePtr *machines);
 
-extern virCapsGuestFeaturePtr
+virCapsGuestFeaturePtr
 virCapabilitiesAddGuestFeature(virCapsGuestPtr guest,
                                const char *name,
                                bool defaultOn,
                                bool toggle);
 
-extern int
+int
 virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModelPtr secmodel,
                                         const char *type,
                                         const char *label);
@@ -288,7 +288,7 @@ void
 virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPUPtr cpu,
                                             size_t ncpus);
 
-extern char *
+char *
 virCapabilitiesFormatXML(virCapsPtr caps);
 
 virBitmapPtr virCapabilitiesGetCpusForNodemask(virCapsPtr caps,
diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h
index 7375876..f15dc16 100644
--- a/src/cpu/cpu.h
+++ b/src/cpu/cpu.h
@@ -122,19 +122,19 @@ struct cpuArchDriver {
 };
 
 
-extern virCPUCompareResult
+virCPUCompareResult
 cpuCompareXML(virCPUDefPtr host,
               const char *xml,
               bool failIncompatible)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 
-extern virCPUCompareResult
+virCPUCompareResult
 cpuCompare  (virCPUDefPtr host,
              virCPUDefPtr cpu,
              bool failIncompatible)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 
-extern int
+int
 cpuDecode   (virCPUDefPtr cpu,
              const virCPUData *data,
              const char **models,
@@ -142,7 +142,7 @@ cpuDecode   (virCPUDefPtr cpu,
              const char *preferred)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 
-extern int
+int
 cpuEncode   (virArch arch,
              const virCPUDef *cpu,
              virCPUDataPtr *forced,
@@ -153,27 +153,27 @@ cpuEncode   (virArch arch,
              virCPUDataPtr *vendor)
     ATTRIBUTE_NONNULL(2);
 
-extern void
+void
 cpuDataFree (virCPUDataPtr data);
 
-extern virCPUDataPtr
+virCPUDataPtr
 cpuNodeData (virArch arch);
 
-extern virCPUCompareResult
+virCPUCompareResult
 cpuGuestData(virCPUDefPtr host,
              virCPUDefPtr guest,
              virCPUDataPtr *data,
              char **msg)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 
-extern char *
+char *
 cpuBaselineXML(const char **xmlCPUs,
                unsigned int ncpus,
                const char **models,
                unsigned int nmodels,
                unsigned int flags);
 
-extern virCPUDefPtr
+virCPUDefPtr
 cpuBaseline (virCPUDefPtr *cpus,
              unsigned int ncpus,
              const char **models,
@@ -181,12 +181,12 @@ cpuBaseline (virCPUDefPtr *cpus,
              unsigned int flags)
     ATTRIBUTE_NONNULL(1);
 
-extern int
+int
 cpuUpdate   (virCPUDefPtr guest,
              const virCPUDef *host)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 
-extern int
+int
 cpuHasFeature(const virCPUData *data,
               const char *feature)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
@@ -198,7 +198,7 @@ cpuModelIsAllowed(const char *model,
                   unsigned int nmodels)
     ATTRIBUTE_NONNULL(1);
 
-extern int
+int
 cpuGetModels(const char *arch, char ***models)
     ATTRIBUTE_NONNULL(1);
 
diff --git a/src/cpu/cpu_map.h b/src/cpu/cpu_map.h
index fcd6c34..6b476fd 100644
--- a/src/cpu/cpu_map.h
+++ b/src/cpu/cpu_map.h
@@ -43,7 +43,7 @@ typedef int
                         xmlXPathContextPtr ctxt,
                         void *data);
 
-extern int
+int
 cpuMapLoad(const char *arch,
            cpuMapLoadCallback cb,
            void *data);
diff --git a/src/lxc/lxc_fuse.h b/src/lxc/lxc_fuse.h
index d60492b..38bbe22 100644
--- a/src/lxc/lxc_fuse.h
+++ b/src/lxc/lxc_fuse.h
@@ -57,8 +57,8 @@ struct virLXCFuse {
 };
 typedef struct virLXCFuse *virLXCFusePtr;
 
-extern int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def);
-extern int lxcStartFuse(virLXCFusePtr f);
-extern void lxcFreeFuse(virLXCFusePtr *f);
+int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def);
+int lxcStartFuse(virLXCFusePtr f);
+void lxcFreeFuse(virLXCFusePtr *f);
 
 #endif /* LXC_FUSE_H */
diff --git a/src/util/virhashcode.h b/src/util/virhashcode.h
index 09e6eeb..7732f81 100644
--- a/src/util/virhashcode.h
+++ b/src/util/virhashcode.h
@@ -30,6 +30,6 @@
 
 # include "internal.h"
 
-extern uint32_t virHashCodeGen(const void *key, size_t len, uint32_t seed);
+uint32_t virHashCodeGen(const void *key, size_t len, uint32_t seed);
 
 #endif /* __VIR_HASH_CODE_H__ */
diff --git a/src/util/virlog.h b/src/util/virlog.h
index b5056f5..3ad00d4 100644
--- a/src/util/virlog.h
+++ b/src/util/virlog.h
@@ -170,50 +170,50 @@ typedef enum {
     VIR_LOG_STACK_TRACE = (1 << 0),
 } virLogFlags;
 
-extern int virLogGetNbFilters(void);
-extern int virLogGetNbOutputs(void);
-extern char *virLogGetFilters(void);
-extern char *virLogGetOutputs(void);
-extern virLogPriority virLogGetDefaultPriority(void);
-extern int virLogSetDefaultPriority(virLogPriority priority);
-extern void virLogSetFromEnv(void);
-extern int virLogDefineFilter(const char *match,
-                              virLogPriority priority,
-                              unsigned int flags);
-extern int virLogDefineOutput(virLogOutputFunc f,
-                              virLogCloseFunc c,
-                              void *data,
-                              virLogPriority priority,
-                              virLogDestination dest,
-                              const char *name,
-                              unsigned int flags);
+int virLogGetNbFilters(void);
+int virLogGetNbOutputs(void);
+char *virLogGetFilters(void);
+char *virLogGetOutputs(void);
+virLogPriority virLogGetDefaultPriority(void);
+int virLogSetDefaultPriority(virLogPriority priority);
+void virLogSetFromEnv(void);
+int virLogDefineFilter(const char *match,
+                       virLogPriority priority,
+                       unsigned int flags);
+int virLogDefineOutput(virLogOutputFunc f,
+                       virLogCloseFunc c,
+                       void *data,
+                       virLogPriority priority,
+                       virLogDestination dest,
+                       const char *name,
+                       unsigned int flags);
 
 /*
  * Internal logging API
  */
 
-extern void virLogLock(void);
-extern void virLogUnlock(void);
-extern int virLogReset(void);
-extern int virLogParseDefaultPriority(const char *priority);
-extern int virLogParseFilters(const char *filters);
-extern int virLogParseOutputs(const char *output);
-extern int virLogPriorityFromSyslog(int priority);
-extern void virLogMessage(virLogSourcePtr source,
-                          virLogPriority priority,
-                          const char *filename,
-                          int linenr,
-                          const char *funcname,
-                          virLogMetadataPtr metadata,
-                          const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(7, 8);
-extern void virLogVMessage(virLogSourcePtr source,
-                           virLogPriority priority,
-                           const char *filename,
-                           int linenr,
-                           const char *funcname,
-                           virLogMetadataPtr metadata,
-                           const char *fmt,
-                           va_list vargs) ATTRIBUTE_FMT_PRINTF(7, 0);
+void virLogLock(void);
+void virLogUnlock(void);
+int virLogReset(void);
+int virLogParseDefaultPriority(const char *priority);
+int virLogParseFilters(const char *filters);
+int virLogParseOutputs(const char *output);
+int virLogPriorityFromSyslog(int priority);
+void virLogMessage(virLogSourcePtr source,
+                   virLogPriority priority,
+                   const char *filename,
+                   int linenr,
+                   const char *funcname,
+                   virLogMetadataPtr metadata,
+                   const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(7, 8);
+void virLogVMessage(virLogSourcePtr source,
+                    virLogPriority priority,
+                    const char *filename,
+                    int linenr,
+                    const char *funcname,
+                    virLogMetadataPtr metadata,
+                    const char *fmt,
+                    va_list vargs) ATTRIBUTE_FMT_PRINTF(7, 0);
 
 bool virLogProbablyLogMessage(const char *str);
 
diff --git a/src/util/virstats.h b/src/util/virstats.h
index d2c6b64..69f4cf1 100644
--- a/src/util/virstats.h
+++ b/src/util/virstats.h
@@ -25,7 +25,7 @@
 
 # include "internal.h"
 
-extern int virNetInterfaceStats(const char *path,
-                                virDomainInterfaceStatsPtr stats);
+int virNetInterfaceStats(const char *path,
+                         virDomainInterfaceStatsPtr stats);
 
 #endif /* __STATS_LINUX_H__ */
diff --git a/src/xen/block_stats.h b/src/xen/block_stats.h
index 6cc9959..b9c5ad6 100644
--- a/src/xen/block_stats.h
+++ b/src/xen/block_stats.h
@@ -27,11 +27,11 @@
 
 #  include "xen_driver.h"
 
-extern int xenLinuxDomainBlockStats (xenUnifiedPrivatePtr priv,
+int xenLinuxDomainBlockStats (xenUnifiedPrivatePtr priv,
                                      virDomainDefPtr def, const char *path,
                                      virDomainBlockStatsPtr stats);
 
-extern int xenLinuxDomainDeviceID(int domid, const char *dev);
+int xenLinuxDomainDeviceID(int domid, const char *dev);
 
 # endif /* __linux__ */
 
diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h
index 5d50a90..8578324 100644
--- a/src/xen/xen_driver.h
+++ b/src/xen/xen_driver.h
@@ -51,7 +51,7 @@
 #  define MAX_VIRT_CPUS XEN_LEGACY_MAX_VCPUS
 # endif
 
-extern int xenRegister (void);
+int xenRegister (void);
 
 # define XEN_UNIFIED_HYPERVISOR_OFFSET 0
 # define XEN_UNIFIED_XEND_OFFSET 1
diff --git a/src/xenapi/xenapi_driver.h b/src/xenapi/xenapi_driver.h
index 0925731..1051997 100644
--- a/src/xenapi/xenapi_driver.h
+++ b/src/xenapi/xenapi_driver.h
@@ -23,6 +23,6 @@
 #ifndef __VIR_XENAPI_PRIV_H__
 # define __VIR_XENAPI_PRIV_H__
 
-extern int xenapiRegister(void);
+int xenapiRegister(void);
 
 #endif /* __VIR_XENAPI_PRIV_H__ */
diff --git a/tools/virt-host-validate-common.h b/tools/virt-host-validate-common.h
index c14e922..b6fe17d 100644
--- a/tools/virt-host-validate-common.h
+++ b/tools/virt-host-validate-common.h
@@ -44,45 +44,45 @@ typedef enum {
 
 VIR_ENUM_DECL(virHostValidateCPUFlag);
 
-extern void virHostMsgSetQuiet(bool quietFlag);
+void virHostMsgSetQuiet(bool quietFlag);
 
-extern void virHostMsgCheck(const char *prefix,
-                            const char *format,
-                            ...) ATTRIBUTE_FMT_PRINTF(2, 3);
+void virHostMsgCheck(const char *prefix,
+                     const char *format,
+                     ...) ATTRIBUTE_FMT_PRINTF(2, 3);
 
-extern void virHostMsgPass(void);
-extern void virHostMsgFail(virHostValidateLevel level,
-                           const char *format,
-                           ...) ATTRIBUTE_FMT_PRINTF(2, 3);
+void virHostMsgPass(void);
+void virHostMsgFail(virHostValidateLevel level,
+                    const char *format,
+                    ...) ATTRIBUTE_FMT_PRINTF(2, 3);
 
-extern int virHostValidateDeviceExists(const char *hvname,
-                                       const char *dev_name,
-                                       virHostValidateLevel level,
-                                       const char *hint);
+int virHostValidateDeviceExists(const char *hvname,
+                                const char *dev_name,
+                                virHostValidateLevel level,
+                                const char *hint);
 
-extern int virHostValidateDeviceAccessible(const char *hvname,
-                                           const char *dev_name,
-                                           virHostValidateLevel level,
-                                           const char *hint);
+int virHostValidateDeviceAccessible(const char *hvname,
+                                    const char *dev_name,
+                                    virHostValidateLevel level,
+                                    const char *hint);
 
-extern virBitmapPtr virHostValidateGetCPUFlags(void);
+virBitmapPtr virHostValidateGetCPUFlags(void);
 
-extern int virHostValidateLinuxKernel(const char *hvname,
-                                      int version,
-                                      virHostValidateLevel level,
-                                      const char *hint);
+int virHostValidateLinuxKernel(const char *hvname,
+                               int version,
+                               virHostValidateLevel level,
+                               const char *hint);
 
-extern int virHostValidateNamespace(const char *hvname,
-                                    const char *ns_name,
-                                    virHostValidateLevel level,
-                                    const char *hint);
+int virHostValidateNamespace(const char *hvname,
+                             const char *ns_name,
+                             virHostValidateLevel level,
+                             const char *hint);
 
-extern int virHostValidateCGroupController(const char *hvname,
-                                           const char *cg_name,
-                                           virHostValidateLevel level,
-                                           const char *config_name);
+int virHostValidateCGroupController(const char *hvname,
+                                    const char *cg_name,
+                                    virHostValidateLevel level,
+                                    const char *config_name);
 
-extern int virHostValidateIOMMU(const char *hvname,
-                                virHostValidateLevel level);
+int virHostValidateIOMMU(const char *hvname,
+                         virHostValidateLevel level);
 
 #endif /* __VIRT_HOST_VALIDATE_COMMON_H__ */
diff --git a/tools/virt-host-validate-lxc.h b/tools/virt-host-validate-lxc.h
index 6f1b3e6..17b02a3 100644
--- a/tools/virt-host-validate-lxc.h
+++ b/tools/virt-host-validate-lxc.h
@@ -22,6 +22,6 @@
 #ifndef __VIRT_HOST_VALIDATE_LXC_H__
 # define __VIRT_HOST_VALIDATE_LXC_H__
 
-extern int virHostValidateLXC(void);
+int virHostValidateLXC(void);
 
 #endif /* __VIRT_HOST_VALIDATE_LXC_H__ */
diff --git a/tools/virt-host-validate-qemu.h b/tools/virt-host-validate-qemu.h
index 01d72bb..8a0ce46 100644
--- a/tools/virt-host-validate-qemu.h
+++ b/tools/virt-host-validate-qemu.h
@@ -22,6 +22,6 @@
 #ifndef __VIRT_HOST_VALIDATE_QEMU_H__
 # define __VIRT_HOST_VALIDATE_QEMU_H__
 
-extern int virHostValidateQEMU(void);
+int virHostValidateQEMU(void);
 
 #endif /* __VIRT_HOST_VALIDATE_QEMU_H__ */
-- 
2.5.5


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