mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
Remove bogus const annotations to hash iterator
Most of the hash iterators need to modify either payload of data args. The const annotation prevents this. * src/util/hash.h, src/util/hash.c: Remove const-ness from virHashForEach/Iterator * src/xen/xm_internal.c: Remove bogus casts
This commit is contained in:
parent
de2b252df5
commit
cf577653dc
@ -482,7 +482,7 @@ virHashRemoveEntry(virHashTablePtr table, const char *name,
|
|||||||
*
|
*
|
||||||
* Returns number of items iterated over upon completion, -1 on failure
|
* Returns number of items iterated over upon completion, -1 on failure
|
||||||
*/
|
*/
|
||||||
int virHashForEach(virHashTablePtr table, virHashIterator iter, const void *data) {
|
int virHashForEach(virHashTablePtr table, virHashIterator iter, void *data) {
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
|
|
||||||
if (table == NULL || iter == NULL)
|
if (table == NULL || iter == NULL)
|
||||||
|
@ -38,7 +38,7 @@ typedef void (*virHashDeallocator) (void *payload, const char *name);
|
|||||||
*
|
*
|
||||||
* Callback to process a hash entry during iteration
|
* Callback to process a hash entry during iteration
|
||||||
*/
|
*/
|
||||||
typedef void (*virHashIterator) (const void *payload, const char *name, const void *data);
|
typedef void (*virHashIterator) (void *payload, const char *name, void *data);
|
||||||
/**
|
/**
|
||||||
* virHashSearcher
|
* virHashSearcher
|
||||||
* @payload: the data in the hash
|
* @payload: the data in the hash
|
||||||
@ -82,7 +82,7 @@ void *virHashLookup(virHashTablePtr table, const char *name);
|
|||||||
/*
|
/*
|
||||||
* Iterators
|
* Iterators
|
||||||
*/
|
*/
|
||||||
int virHashForEach(virHashTablePtr table, virHashIterator iter, const void *data);
|
int virHashForEach(virHashTablePtr table, virHashIterator iter, void *data);
|
||||||
int virHashRemoveSet(virHashTablePtr table, virHashSearcher iter, virHashDeallocator f, const void *data);
|
int virHashRemoveSet(virHashTablePtr table, virHashSearcher iter, virHashDeallocator f, const void *data);
|
||||||
void *virHashSearch(virHashTablePtr table, virHashSearcher iter, const void *data);
|
void *virHashSearch(virHashTablePtr table, virHashSearcher iter, const void *data);
|
||||||
|
|
||||||
|
@ -2750,8 +2750,8 @@ struct xenXMListIteratorContext {
|
|||||||
char ** names;
|
char ** names;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void xenXMListIterator(const void *payload ATTRIBUTE_UNUSED, const char *name, const void *data) {
|
static void xenXMListIterator(void *payload ATTRIBUTE_UNUSED, const char *name, void *data) {
|
||||||
struct xenXMListIteratorContext *ctx = (struct xenXMListIteratorContext *)data;
|
struct xenXMListIteratorContext *ctx = data;
|
||||||
virDomainPtr dom = NULL;
|
virDomainPtr dom = NULL;
|
||||||
|
|
||||||
if (ctx->count == ctx->max)
|
if (ctx->count == ctx->max)
|
||||||
|
Loading…
Reference in New Issue
Block a user