From d067681928ce7bdc99d2e32ffc5f488de1245e6e Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 27 May 2021 13:32:03 +0200 Subject: [PATCH] avdtp: use bool for request_can_send_now --- src/classic/avdtp.c | 5 ++--- src/classic/avdtp.h | 2 +- src/classic/avdtp_util.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/classic/avdtp.c b/src/classic/avdtp.c index ae4708ed4..dd4c64861 100644 --- a/src/classic/avdtp.c +++ b/src/classic/avdtp.c @@ -471,11 +471,10 @@ static void avdtp_handle_can_send_now(uint16_t l2cap_cid) { if (stream_endpoint != NULL) { log_debug("call avdtp_initiator_stream_config_subsm_handle_can_send_now_stream_endpoint %p", stream_endpoint); if (stream_endpoint->request_can_send_now) { - stream_endpoint->request_can_send_now = 0; + stream_endpoint->request_can_send_now = false; avdtp_initiator_stream_config_subsm_handle_can_send_now_stream_endpoint(stream_endpoint); } - bool more_to_send = stream_endpoint->request_can_send_now != 0; - if (more_to_send){ + if (stream_endpoint->request_can_send_now){ l2cap_request_can_send_now_event(l2cap_cid); } } diff --git a/src/classic/avdtp.h b/src/classic/avdtp.h index 0a2a2792f..5050484cc 100644 --- a/src/classic/avdtp.h +++ b/src/classic/avdtp.h @@ -592,7 +592,7 @@ typedef struct avdtp_stream_endpoint { uint8_t media_connect; uint8_t start_stream; uint8_t close_stream; - uint8_t request_can_send_now; + bool request_can_send_now; uint8_t abort_stream; uint8_t suspend_stream; uint16_t sequence_number; diff --git a/src/classic/avdtp_util.c b/src/classic/avdtp_util.c index 006a18863..4cb6bbc2f 100644 --- a/src/classic/avdtp_util.c +++ b/src/classic/avdtp_util.c @@ -134,7 +134,7 @@ void avdtp_reset_stream_endpoint(avdtp_stream_endpoint_t * stream_endpoint){ stream_endpoint->media_connect = 0; stream_endpoint->start_stream = 0; stream_endpoint->close_stream = 0; - stream_endpoint->request_can_send_now = 0; + stream_endpoint->request_can_send_now = false; stream_endpoint->abort_stream = 0; stream_endpoint->suspend_stream = 0; stream_endpoint->sequence_number = 0;