1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

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.
This commit is contained in:
Jim Meyering 2009-02-03 13:08:59 +00:00
parent 08f87e3d03
commit dff2114795
7 changed files with 23 additions and 15 deletions

View File

@ -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> Tue, 3 Feb 2009 14:06:06 +0100 Jim Meyering <meyering@redhat.com>
syntax-check: enable more checks syntax-check: enable more checks

View File

@ -46,7 +46,6 @@ local-checks-to-skip = \
sc_prohibit_quote_without_use \ sc_prohibit_quote_without_use \
sc_prohibit_quotearg_without_use \ sc_prohibit_quotearg_without_use \
sc_prohibit_stat_st_blocks \ sc_prohibit_stat_st_blocks \
sc_redundant_const \
sc_root_tests \ sc_root_tests \
sc_space_tab \ sc_space_tab \
sc_sun_os_names \ sc_sun_os_names \

View File

@ -507,7 +507,7 @@ int main(int argc, char *argv[])
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
char *configFile = NULL; char *configFile = NULL;
char *sockpath = NULL; char *sockpath = NULL;
const struct option const options[] = { const struct option options[] = {
{ "background", 0, NULL, 'b' }, { "background", 0, NULL, 'b' },
{ "name", 1, NULL, 'n' }, { "name", 1, NULL, 'n' },
{ "veth", 1, NULL, 'v' }, { "veth", 1, NULL, 'v' },
@ -662,4 +662,3 @@ cleanup:
return rc; return rc;
} }

View File

@ -1,7 +1,7 @@
/* /*
* storage_backend_fs.c: storage backend for FS and directory handling * 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 * Copyright (C) 2007-2008 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -84,7 +84,7 @@ struct FileTypeInfo {
int (*getBackingStore)(virConnectPtr conn, char **res, int (*getBackingStore)(virConnectPtr conn, char **res,
const unsigned char *buf, size_t buf_size); const unsigned char *buf, size_t buf_size);
}; };
const struct FileTypeInfo const fileTypeInfo[] = { struct FileTypeInfo const fileTypeInfo[] = {
/* Bochs */ /* Bochs */
/* XXX Untested /* XXX Untested
{ VIR_STORAGE_VOL_BOCHS, "Bochs Virtual HD Image", NULL, { 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 */ * Need to add in progress bars & bg thread somehow */
if (vol->allocation) { if (vol->allocation) {
unsigned long long remain = vol->allocation; unsigned long long remain = vol->allocation;
static const char const zeros[4096]; static char const zeros[4096];
while (remain) { while (remain) {
int bytes = sizeof(zeros); int bytes = sizeof(zeros);
if (bytes > remain) if (bytes > remain)

View File

@ -143,7 +143,7 @@ const char *virEnumToString(const char *const*types,
int type); int type);
#define VIR_ENUM_IMPL(name, lastVal, ...) \ #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)]; \ extern int (* name ## Verify (void)) [verify_true (ARRAY_CARDINALITY(name ## TypeList) == lastVal)]; \
const char *name ## TypeToString(int type) { \ const char *name ## TypeToString(int type) { \
return virEnumToString(name ## TypeList, \ return virEnumToString(name ## TypeList, \

View File

@ -1,7 +1,7 @@
/* /*
* xen_internal.c: direct access to Xen hypervisor level * 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 * See COPYING.LIB for the License of this software
* *
@ -2178,7 +2178,7 @@ xenHypervisorBuildCapabilities(virConnectPtr conn,
for (i = 0; i < nr_guest_archs; ++i) { for (i = 0; i < nr_guest_archs; ++i) {
virCapsGuestPtr guest; 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, if ((guest = virCapabilitiesAddGuest(caps,
guest_archs[i].hvm ? "hvm" : "xen", guest_archs[i].hvm ? "hvm" : "xen",

View File

@ -175,12 +175,12 @@ fail:
return ret; return ret;
} }
static const struct qparamParseDataEntry const params1[] = { { "foo", "one" }, { "bar", "two" } }; static const struct qparamParseDataEntry params1[] = { { "foo", "one" }, { "bar", "two" } };
static const struct qparamParseDataEntry const params2[] = { { "foo", "one" }, { "foo", "two" } }; static const struct qparamParseDataEntry params2[] = { { "foo", "one" }, { "foo", "two" } };
static const struct qparamParseDataEntry const params3[] = { { "foo", "&one" }, { "bar", "&two" } }; static const struct qparamParseDataEntry params3[] = { { "foo", "&one" }, { "bar", "&two" } };
static const struct qparamParseDataEntry const params4[] = { { "foo", "" } }; static const struct qparamParseDataEntry params4[] = { { "foo", "" } };
static const struct qparamParseDataEntry const params5[] = { { "foo", "one two" } }; static const struct qparamParseDataEntry params5[] = { { "foo", "one two" } };
static const struct qparamParseDataEntry const params6[] = { { "foo", "one" } }; static const struct qparamParseDataEntry params6[] = { { "foo", "one" } };
static int static int
mymain(int argc ATTRIBUTE_UNUSED, mymain(int argc ATTRIBUTE_UNUSED,