From e5d85962e3310171863e8ca2f5838880e3cc3342 Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Wed, 1 Jul 2020 10:10:21 -0700 Subject: fix integer promotion in logging. Integer promotion rules say that bitfields where all values can be represented in an int, get promoted to an int. Thus, the computation of these values in the multiplication is of base integer type. Compiling this library with debug asserts enabled (-UNDEBUG) currently fails as the format specifier is expecting long unsigned, and is provided an int. Bug: 160324350 Test: Build with -UNDEBUG. Change-Id: Ia8ab23d2cc6716fe87a36317b1a857981459c207 --- libs/binder/MemoryDealer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp index ebf91f925e..b46b3e88fc 100644 --- a/libs/binder/MemoryDealer.cpp +++ b/libs/binder/MemoryDealer.cpp @@ -387,7 +387,7 @@ SimpleBestFitAllocator::chunk_t* SimpleBestFitAllocator::dealloc(size_t start) while (cur) { if (cur->start == start) { LOG_FATAL_IF(cur->free, - "block at offset 0x%08lX of size 0x%08lX already freed", + "block at offset 0x%08lX of size 0x%08X already freed", cur->start*kMemoryAlign, cur->size*kMemoryAlign); // merge freed blocks together @@ -411,7 +411,7 @@ SimpleBestFitAllocator::chunk_t* SimpleBestFitAllocator::dealloc(size_t start) } #endif LOG_FATAL_IF(!freed->free, - "freed block at offset 0x%08lX of size 0x%08lX is not free!", + "freed block at offset 0x%08lX of size 0x%08X is not free!", freed->start * kMemoryAlign, freed->size * kMemoryAlign); return freed; -- cgit v1.2.3-59-g8ed1b