mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-01 01:13:23 +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
|
* 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;
|
return *list == (void *) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ void btstack_linked_list_iterator_init(btstack_linked_list_iterator_t * it, btst
|
|||||||
it->curr = * head;
|
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);
|
// 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){
|
if (!it->advance_on_next){
|
||||||
return it->curr != NULL;
|
return it->curr != NULL;
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
#ifndef BTSTACK_LINKED_LIST_H
|
#ifndef BTSTACK_LINKED_LIST_H
|
||||||
#define BTSTACK_LINKED_LIST_H
|
#define BTSTACK_LINKED_LIST_H
|
||||||
|
|
||||||
|
#include "btstack_bool.h"
|
||||||
|
|
||||||
#if defined __cplusplus
|
#if defined __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -66,7 +68,7 @@ typedef struct {
|
|||||||
* @param list
|
* @param list
|
||||||
* @returns true if list is empty
|
* @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.
|
* @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
|
* @param it iterator context
|
||||||
* @returns true if next element is available
|
* @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
|
* @brief Get next list eleemnt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user