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>
syntax-check: enable more checks

View 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 \

View 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;
}

View 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)

View 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, \

View 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",

View 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,