diff --git a/ChangeLog b/ChangeLog index 06fdab54e1cf8fe59c68230406252e99b3c0796c..78635bb64d2750ffaad85e6883ac017f711a8fd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue, 3 Feb 2009 14:06:06 +0100 Jim Meyering + + 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 syntax-check: enable more checks diff --git a/Makefile.cfg b/Makefile.cfg index 0c2b8101da73b84ce12314ff2388af7d1001a57c..b93d8dc4d3267a7823f1e3ffda35847e8e0fd13b 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -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 \ diff --git a/src/lxc_controller.c b/src/lxc_controller.c index e25fe76cd6b0a1ff711fbaeedd35d931d5888a47..58dfe023d8128331ededd556f7eb8749c4c66df8 100644 --- a/src/lxc_controller.c +++ b/src/lxc_controller.c @@ -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; } - diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c index 345dc40e1071c31d5fce3242b1256fdcf72c9b80..240de96848d31921fab586cd04cd2c7ab04e6b86 100644 --- a/src/storage_backend_fs.c +++ b/src/storage_backend_fs.c @@ -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) diff --git a/src/util.h b/src/util.h index e731ba49b451807017d7140983e5bf9771646149..c5532648b977129a1e645edf8bef2aa8e539da7c 100644 --- a/src/util.h +++ b/src/util.h @@ -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, \ diff --git a/src/xen_internal.c b/src/xen_internal.c index 9a7272fdb7c4a4143980cd09ece8a06aab24f2cf..0a01f5e07362ef6891553cc1f0e25cdd11f26d21 100644 --- a/src/xen_internal.c +++ b/src/xen_internal.c @@ -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", diff --git a/tests/qparamtest.c b/tests/qparamtest.c index f8f2d29d356f11da76550b506f80786933e8c7b9..a4ed1fb8a2e7831ee1796cab7022fb0a23e0bad2 100644 --- a/tests/qparamtest.c +++ b/tests/qparamtest.c @@ -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,