2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

Replace most uses of assert by ovs_assert.

This is a straight search-and-replace, except that I also removed #include
<assert.h> from each file where there were no assert calls left.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
Ben Pfaff
2012-11-06 13:14:55 -08:00
parent 4749f73d12
commit cb22974d77
85 changed files with 393 additions and 545 deletions

View File

@@ -16,7 +16,6 @@
#include <config.h>
#include "shash.h"
#include <assert.h>
#include "hash.h"
static struct shash_node *shash_find__(const struct shash *,
@@ -145,7 +144,7 @@ void
shash_add_assert(struct shash *sh, const char *name, const void *data)
{
bool added OVS_UNUSED = shash_add_once(sh, name, data);
assert(added);
ovs_assert(added);
}
/* Searches for 'name' in 'sh'. If it does not already exist, adds it along
@@ -242,7 +241,7 @@ void *
shash_find_and_delete_assert(struct shash *sh, const char *name)
{
void *data = shash_find_and_delete(sh, name);
assert(data != NULL);
ovs_assert(data != NULL);
return data;
}
@@ -277,7 +276,7 @@ shash_sort(const struct shash *sh)
SHASH_FOR_EACH (node, sh) {
nodes[i++] = node;
}
assert(i == n);
ovs_assert(i == n);
qsort(nodes, n, sizeof *nodes, compare_nodes_by_name);