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:
@@ -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++) {
|
||||
|
Reference in New Issue
Block a user