You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/01/18 14:03:25 UTC
[nuttx] 02/02: mm/mempool/mempool_multiple.c: Remove void * arithmetic
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 5920a8b673d1be77b5f9b8e3e5c971b8cdd1ab80
Author: Jukka Laitinen <ju...@ssrc.tii.ae>
AuthorDate: Wed Jan 18 14:36:48 2023 +0400
mm/mempool/mempool_multiple.c: Remove void * arithmetic
Cast substraction arguments to FAR char *, which gives the same result as the
gcc extension on the original void * arithmetic.
Signed-off-by: Jukka Laitinen <ju...@ssrc.tii.ae>
---
mm/mempool/mempool_multiple.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/mempool/mempool_multiple.c b/mm/mempool/mempool_multiple.c
index 0ca738be06..afa6a5e979 100644
--- a/mm/mempool/mempool_multiple.c
+++ b/mm/mempool/mempool_multiple.c
@@ -220,7 +220,7 @@ mempool_multiple_get_dict(FAR struct mempool_multiple_s *mpool,
col = index - (row << mpool->dict_col_num_log2);
if (mpool->dict[row] == NULL ||
mpool->dict[row][col].addr != addr ||
- blk - addr >= mpool->dict[row][col].size)
+ (FAR char *)blk - (FAR char *)addr >= mpool->dict[row][col].size)
{
return NULL;
}