From ad69466fb482430cac886d7447f4245959f8c1d6 Mon Sep 17 00:00:00 2001 From: guishenking Date: Fri, 15 Aug 2025 20:22:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=91=A7=E6=AF=81fifo?= =?UTF-8?q?=E6=97=B6=E8=BF=94=E5=9B=9E=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/kfifo/kfifo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/kfifo/kfifo.c b/src/lib/kfifo/kfifo.c index 6fd955f..542b65f 100755 --- a/src/lib/kfifo/kfifo.c +++ b/src/lib/kfifo/kfifo.c @@ -107,7 +107,7 @@ bool kfifo_destroy(kfifo_t *fifo) { if (fifo) { if(fifo->pool == NULL) { free(fifo); // 如果 pool 已经是 NULL,直接释放 fifo - return false; // 如果 pool 已经是 NULL,直接返回 + return true; // 如果 pool 已经是 NULL,直接返回 } free(fifo->pool); fifo->pool = NULL; // 清空指针,避免悬挂指针 @@ -296,7 +296,6 @@ int kfifo_peek_seek(kfifo_t *fifo, const uint8_t **ptr, uint32_t seek) { return 0; } - // *ptr = &KFIFO_POOL_PTR(fifo)[kfifo_offset_seek_out(fifo, seek)]; *ptr = (uint8_t*)fifo->pool + kfifo_offset_seek_out(fifo, seek); if (kfifo_remain_out(fifo) > seek) { seek = kfifo_remain_seek_out(fifo, seek);