incorporate code review comment in embedded_test.function
This commit is contained in:
parent
663d4702c5
commit
d61a4384d8
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user