]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: enable redundant-const check
authorJim Meyering <meyering@redhat.com>
Tue, 3 Feb 2009 13:08:59 +0000 (13:08 +0000)
committerJim Meyering <meyering@redhat.com>
Tue, 3 Feb 2009 13:08:59 +0000 (13:08 +0000)
* Makefile.cfg (local-checks-to-skip): Remove sc_redundant_const.
* src/lxc_controller.c: Remove redundant "const"(s).
* src/storage_backend_fs.c: Likewise.
* src/util.h: Likewise.
* src/xen_internal.c: Likewise.
* tests/qparamtest.c: Likewise.

ChangeLog
Makefile.cfg
src/lxc_controller.c
src/storage_backend_fs.c
src/util.h
src/xen_internal.c
tests/qparamtest.c

index 06fdab54e1cf8fe59c68230406252e99b3c0796c..78635bb64d2750ffaad85e6883ac017f711a8fd6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue, 3 Feb 2009 14:06:06 +0100 Jim Meyering <meyering@redhat.com>
+
+       build: enable redundant-const check
+       * Makefile.cfg (local-checks-to-skip): Remove sc_redundant_const.
+       * src/lxc_controller.c: Remove redundant "const"(s).
+       * src/storage_backend_fs.c: Likewise.
+       * src/util.h: Likewise.
+       * src/xen_internal.c: Likewise.
+       * tests/qparamtest.c: Likewise.
+
 Tue, 3 Feb 2009 14:06:06 +0100 Jim Meyering <meyering@redhat.com>
 
        syntax-check: enable more checks
index 0c2b8101da73b84ce12314ff2388af7d1001a57c..b93d8dc4d3267a7823f1e3ffda35847e8e0fd13b 100644 (file)
@@ -46,7 +46,6 @@ local-checks-to-skip =                        \
   sc_prohibit_quote_without_use                \
   sc_prohibit_quotearg_without_use     \
   sc_prohibit_stat_st_blocks           \
-  sc_redundant_const                   \
   sc_root_tests                                \
   sc_space_tab                         \
   sc_sun_os_names                      \
index e25fe76cd6b0a1ff711fbaeedd35d931d5888a47..58dfe023d8128331ededd556f7eb8749c4c66df8 100644 (file)
@@ -507,7 +507,7 @@ int main(int argc, char *argv[])
     virDomainDefPtr def = NULL;
     char *configFile = NULL;
     char *sockpath = NULL;
-    const struct option const options[] = {
+    const struct option options[] = {
         { "background", 0, NULL, 'b' },
         { "name",   1, NULL, 'n' },
         { "veth",   1, NULL, 'v' },
@@ -662,4 +662,3 @@ cleanup:
 
     return rc;
 }
-
index 345dc40e1071c31d5fce3242b1256fdcf72c9b80..240de96848d31921fab586cd04cd2c7ab04e6b86 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * storage_backend_fs.c: storage backend for FS and directory handling
  *
- * Copyright (C) 2007-2008 Red Hat, Inc.
+ * Copyright (C) 2007-2009 Red Hat, Inc.
  * Copyright (C) 2007-2008 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -84,7 +84,7 @@ struct FileTypeInfo {
     int (*getBackingStore)(virConnectPtr conn, char **res,
                            const unsigned char *buf, size_t buf_size);
 };
-const struct FileTypeInfo const fileTypeInfo[] = {
+struct FileTypeInfo const fileTypeInfo[] = {
     /* Bochs */
     /* XXX Untested
     { VIR_STORAGE_VOL_BOCHS, "Bochs Virtual HD Image", NULL,
@@ -1020,7 +1020,7 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn,
          * Need to add in progress bars & bg thread somehow */
         if (vol->allocation) {
             unsigned long long remain = vol->allocation;
-            static const char const zeros[4096];
+            static char const zeros[4096];
             while (remain) {
                 int bytes = sizeof(zeros);
                 if (bytes > remain)
index e731ba49b451807017d7140983e5bf9771646149..c5532648b977129a1e645edf8bef2aa8e539da7c 100644 (file)
@@ -143,7 +143,7 @@ const char *virEnumToString(const char *const*types,
                             int type);
 
 #define VIR_ENUM_IMPL(name, lastVal, ...)                               \
-    static const char const *name ## TypeList[] = { __VA_ARGS__ };      \
+    static const char *const name ## TypeList[] = { __VA_ARGS__ };      \
     extern int (* name ## Verify (void)) [verify_true (ARRAY_CARDINALITY(name ## TypeList) == lastVal)]; \
     const char *name ## TypeToString(int type) {                        \
         return virEnumToString(name ## TypeList,                        \
index 9a7272fdb7c4a4143980cd09ece8a06aab24f2cf..0a01f5e07362ef6891553cc1f0e25cdd11f26d21 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * xen_internal.c: direct access to Xen hypervisor level
  *
- * Copyright (C) 2005, 2006, 2007, 2008 Red Hat, Inc.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
  *
  * See COPYING.LIB for the License of this software
  *
@@ -2178,7 +2178,7 @@ xenHypervisorBuildCapabilities(virConnectPtr conn,
 
     for (i = 0; i < nr_guest_archs; ++i) {
         virCapsGuestPtr guest;
-        const char const *machines[] = { guest_archs[i].hvm ? "xenfv" : "xenpv" };
+        char const *const machines[] = {guest_archs[i].hvm ? "xenfv" : "xenpv"};
 
         if ((guest = virCapabilitiesAddGuest(caps,
                                              guest_archs[i].hvm ? "hvm" : "xen",
index f8f2d29d356f11da76550b506f80786933e8c7b9..a4ed1fb8a2e7831ee1796cab7022fb0a23e0bad2 100644 (file)
@@ -175,12 +175,12 @@ fail:
     return ret;
 }
 
-static const struct qparamParseDataEntry const params1[] = { { "foo", "one" }, { "bar", "two" } };
-static const struct qparamParseDataEntry const params2[] = { { "foo", "one" }, { "foo", "two" } };
-static const struct qparamParseDataEntry const params3[] = { { "foo", "&one" }, { "bar", "&two" } };
-static const struct qparamParseDataEntry const params4[] = { { "foo", "" } };
-static const struct qparamParseDataEntry const params5[] = { { "foo", "one two" } };
-static const struct qparamParseDataEntry const params6[] = { { "foo", "one" } };
+static const struct qparamParseDataEntry params1[] = { { "foo", "one" }, { "bar", "two" } };
+static const struct qparamParseDataEntry params2[] = { { "foo", "one" }, { "foo", "two" } };
+static const struct qparamParseDataEntry params3[] = { { "foo", "&one" }, { "bar", "&two" } };
+static const struct qparamParseDataEntry params4[] = { { "foo", "" } };
+static const struct qparamParseDataEntry params5[] = { { "foo", "one two" } };
+static const struct qparamParseDataEntry params6[] = { { "foo", "one" } };
 
 static int
 mymain(int argc ATTRIBUTE_UNUSED,