mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-28 16:11:24 +00:00
linked_list: use bool return type
This commit is contained in:
parent
1c4468cf9f
commit
8b2bf72f1c
@ -51,7 +51,7 @@
|
||||
/**
|
||||
* tests if list is empty
|
||||
*/
|
||||
int btstack_linked_list_empty(btstack_linked_list_t * list){
|
||||
bool btstack_linked_list_empty(btstack_linked_list_t * list){
|
||||
return *list == (void *) 0;
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ void btstack_linked_list_iterator_init(btstack_linked_list_iterator_t * it, btst
|
||||
it->curr = * head;
|
||||
}
|
||||
|
||||
int btstack_linked_list_iterator_has_next(btstack_linked_list_iterator_t * it){
|
||||
bool btstack_linked_list_iterator_has_next(btstack_linked_list_iterator_t * it){
|
||||
// log_info("btstack_linked_list_iterator_has_next: advance on next %u, it->prev %p, it->curr %p", it->advance_on_next, it->prev, it->curr);
|
||||
if (!it->advance_on_next){
|
||||
return it->curr != NULL;
|
||||
|
@ -42,6 +42,8 @@
|
||||
#ifndef BTSTACK_LINKED_LIST_H
|
||||
#define BTSTACK_LINKED_LIST_H
|
||||
|
||||
#include "btstack_bool.h"
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -66,7 +68,7 @@ typedef struct {
|
||||
* @param list
|
||||
* @returns true if list is empty
|
||||
*/
|
||||
int btstack_linked_list_empty(btstack_linked_list_t * list);
|
||||
bool btstack_linked_list_empty(btstack_linked_list_t * list);
|
||||
|
||||
/**
|
||||
* @brief Add item to list as first element.
|
||||
@ -132,7 +134,7 @@ void btstack_linked_list_iterator_init(btstack_linked_list_iterator_t * it, btst
|
||||
* @param it iterator context
|
||||
* @returns true if next element is available
|
||||
*/
|
||||
int btstack_linked_list_iterator_has_next(btstack_linked_list_iterator_t * it);
|
||||
bool btstack_linked_list_iterator_has_next(btstack_linked_list_iterator_t * it);
|
||||
|
||||
/**
|
||||
* @brief Get next list eleemnt
|
||||
|
Loading…
x
Reference in New Issue
Block a user