Skip to content

Commit

Permalink
lib: Convert true/false values to bool
Browse files Browse the repository at this point in the history
route_maps are using some int's as true/false so
let's convert them over to a bool.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
  • Loading branch information
donaldsharp committed Apr 28, 2018
1 parent d90b2b7 commit e4694d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions lib/routemap.c
Expand Up @@ -722,7 +722,7 @@ static void route_map_delete(struct route_map *map)

/* Clear all dependencies */
route_map_clear_all_references(name);
map->deleted = 1;
map->deleted = true;
/* Execute deletion hook. */
if (route_map_master.delete_hook) {
(*route_map_master.delete_hook)(name);
Expand Down Expand Up @@ -762,19 +762,19 @@ int route_map_mark_updated(const char *name, int del_later)

map = route_map_lookup_by_name(name);

/* If we did not find the routemap with deleted=0 try again
* with deleted=1
/* If we did not find the routemap with deleted=false try again
* with deleted=true
*/
if (!map) {
memset(&tmp_map, 0, sizeof(struct route_map));
tmp_map.name = XSTRDUP(MTYPE_ROUTE_MAP_NAME, name);
tmp_map.deleted = 1;
tmp_map.deleted = true;
map = hash_lookup(route_map_master_hash, &tmp_map);
XFREE(MTYPE_ROUTE_MAP_NAME, tmp_map.name);
}

if (map) {
map->to_be_processed = 1;
map->to_be_processed = true;
ret = 0;
}

Expand All @@ -786,7 +786,7 @@ int route_map_clear_updated(struct route_map *map)
int ret = -1;

if (map) {
map->to_be_processed = 0;
map->to_be_processed = false;
if (map->deleted)
route_map_free_map(map);
}
Expand Down Expand Up @@ -2743,7 +2743,7 @@ void route_map_finish(void)
/* cleanup route_map */
while (route_map_master.head) {
struct route_map *map = route_map_master.head;
map->to_be_processed = 0;
map->to_be_processed = false;
route_map_delete(map);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/routemap.h
Expand Up @@ -158,8 +158,8 @@ struct route_map {
struct route_map *prev;

/* Maintain update info */
int to_be_processed; /* True if modification isn't acted on yet */
int deleted; /* If 1, then this node will be deleted */
bool to_be_processed; /* True if modification isn't acted on yet */
bool deleted; /* If 1, then this node will be deleted */

QOBJ_FIELDS
};
Expand Down

0 comments on commit e4694d0

Please sign in to comment.