From d9d93a845e3669eb7ab6b24b738552ab91afc1b7 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 18 Aug 2020 22:04:50 +0200 Subject: [PATCH] umm: fix pointer arithmetic warning --- armsrc/umm_malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/armsrc/umm_malloc.c b/armsrc/umm_malloc.c index 38006ace2..a8c17609c 100644 --- a/armsrc/umm_malloc.c +++ b/armsrc/umm_malloc.c @@ -300,7 +300,7 @@ static void umm_free_core( void *ptr ) { /* Figure out which block we're in. Note the use of truncated division... */ - c = (((void *)ptr)-(void *)(&(umm_heap[0])))/sizeof(umm_block); + c = (((unsigned char *)ptr)-(unsigned char *)(&(umm_heap[0])))/sizeof(umm_block); DBGLOG_DEBUG( "Freeing block %6i\n", c ); @@ -563,7 +563,7 @@ void *umm_realloc( void *ptr, size_t size ) { /* Figure out which block we're in. Note the use of truncated division... */ - c = (((void *)ptr)-(void *)(&(umm_heap[0])))/sizeof(umm_block); + c = (((unsigned char *)ptr)-(unsigned char *)(&(umm_heap[0])))/sizeof(umm_block); /* Figure out how big this block is ... the free bit is not set :-) */