From d61a4384d84a0b82e17dbe209d1788b04ff8a647 Mon Sep 17 00:00:00 2001 From: Azim Khan Date: Fri, 7 Jul 2017 16:17:27 +0100 Subject: [PATCH] incorporate code review comment in embedded_test.function --- tests/suites/embedded_test.function | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/suites/embedded_test.function b/tests/suites/embedded_test.function index 312cf9125..3f1e77add 100644 --- a/tests/suites/embedded_test.function +++ b/tests/suites/embedded_test.function @@ -13,12 +13,12 @@ */ #define INCR_ASSERT(p, start, len, step) do \ { \ - assert( p >= start ); \ - assert( sizeof( *p ) == sizeof( *start ) ); \ + assert( ( p ) >= ( start ) ); \ + assert( sizeof( *( p ) ) == sizeof( *( start ) ) ); \ /* <= is checked to support use inside a loop where \ pointer is incremented after reading data. */ \ - assert( (uint32_t)( (p - start) + step ) <= len ); \ - p += step; \ + assert( (uint32_t)( ( ( p ) - ( start ) ) + step ) <= len );\ + ( p ) += step; \ } \ while( 0 ) @@ -33,7 +33,7 @@ while( 0 ) */ #define ALIGN_32BIT(p, start, len) do \ { \ - uint32_t align = ( - (uintptr_t)p ) % 4; \ + uint32_t align = ( - (uintptr_t)( p ) ) % 4;\ INCR_ASSERT(p, start, len, align); \ } \ while( 0 )