2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

lib/util: Change is_all_zeros and is_all_ones to take a void *.

is_all_zeros() and is_all_ones() operate on bytes, but just like with
memset, it is easier to use if the first argument is a void *.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jarno Rajahalme
2014-09-05 15:44:19 -07:00
parent 6d670e7f0d
commit 53cb9c3edc
4 changed files with 16 additions and 15 deletions

View File

@@ -1025,8 +1025,9 @@ const uint8_t count_1bits_8[256] = {
/* Returns true if the 'n' bytes starting at 'p' are zeros. */
bool
is_all_zeros(const uint8_t *p, size_t n)
is_all_zeros(const void *p_, size_t n)
{
const uint8_t *p = p_;
size_t i;
for (i = 0; i < n; i++) {
@@ -1039,8 +1040,9 @@ is_all_zeros(const uint8_t *p, size_t n)
/* Returns true if the 'n' bytes starting at 'p' are 0xff. */
bool
is_all_ones(const uint8_t *p, size_t n)
is_all_ones(const void *p_, size_t n)
{
const uint8_t *p = p_;
size_t i;
for (i = 0; i < n; i++) {