VPP-189 Tweak hash_foreach_pair to avoid static warning 44/2144/5
authorChris Luke <chrisy@flirble.org>
Sat, 30 Jul 2016 19:05:07 +0000 (15:05 -0400)
committerDave Barach <openvpp@barachs.net>
Wed, 31 Aug 2016 12:57:33 +0000 (12:57 +0000)
commit5cdaf6358266eb883a2e48239a83e9f56c3c5bad
tree6583d27668c10948640d225df4a64b43d341f325
parent54ccf2261cb1f4afd966b7b1e92689183cb17836
VPP-189 Tweak hash_foreach_pair to avoid static warning

Coverity doesn't like when an incrementing pointer is taken from
the address of a singleton; it cries that this is a potential
buffer overrun.

Since the cases of this in hash_foreach_pair are based on items
from a simple union used just to have different types point to
the same location it's a simple matter of using the pointer to
that location directly. Since we then aren't using the members
of the union, we can change that to an opaque pointer (void *).

This accounts for >60 issues in Coverity.

Whilst here, convert some useful existing comments into a docblock.

Change-Id: I114183ab7d7948d4a6a703451417f79fa37634eb
Signed-off-by: Chris Luke <chrisy@flirble.org>
vppinfra/vppinfra/hash.h