Eric Blake b43efdaa13 maint: avoid 'const fooPtr' in hashes
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can).  But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).

Fix up virhash to provide a const-correct interface: all actions
that don't modify the table take a const table.  Note that in
one case (virHashSearch), we actually strip const away - we aren't
modifying the contents of the table, so much as associated data
for ensuring that the code uses the table correctly (if this were
C++, it would be a case for the 'mutable' keyword).

* src/util/virhash.h (virHashKeyComparator, virHashEqual): Use
intended type.
(virHashSize, virHashTableSize, virHashLookup, virHashSearch):
Make const-correct.
* src/util/virhash.c (virHashEqualData, virHashEqual)
(virHashLookup, virHashSize, virHashTableSize, virHashSearch)
(virHashComputeKey): Fix fallout.
* src/conf/nwfilter_params.c
(virNWFilterFormatParameterNameSorter): Likewise.
* src/nwfilter/nwfilter_ebiptables_driver.c
(ebiptablesFilterOrderSort): Likewise.
* tests/virhashtest.c (testHashGetItemsCompKey)
(testHashGetItemsCompValue): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-14 11:40:24 -06:00
..
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-14 10:31:01 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-07-29 13:09:39 -06:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-03-19 13:13:28 -06:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-14 10:31:01 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00
2013-10-08 12:39:30 +01:00