Commit aa1868c7 authored by Rémi Duraffort's avatar Rémi Duraffort

Fix sizeof mismatch (fix many cids)

parent 4658c81d
......@@ -92,9 +92,9 @@ static inline void *realloc_down( void *ptr, size_t size )
#define TAB_APPEND_CAST( cast, count, tab, p ) \
do { \
if( (count) > 0 ) \
(tab) = cast realloc( tab, sizeof( void ** ) * ( (count) + 1 ) ); \
(tab) = cast realloc( tab, sizeof( *(tab) ) * ( (count) + 1 ) ); \
else \
(tab) = cast malloc( sizeof( void ** ) ); \
(tab) = cast malloc( sizeof( *(tab) ) ); \
if( !(tab) ) abort(); \
(tab)[count] = (p); \
(count)++; \
......@@ -123,7 +123,7 @@ static inline void *realloc_down( void *ptr, size_t size )
{ \
memmove( ((void**)(tab) + i_index), \
((void**)(tab) + i_index+1), \
( (count) - i_index - 1 ) * sizeof( void* ) );\
( (count) - i_index - 1 ) * sizeof( *(tab) ) );\
} \
(count)--; \
if( (count) == 0 ) \
......@@ -136,9 +136,9 @@ static inline void *realloc_down( void *ptr, size_t size )
#define TAB_INSERT_CAST( cast, count, tab, p, index ) do { \
if( (count) > 0 ) \
(tab) = cast realloc( tab, sizeof( void ** ) * ( (count) + 1 ) ); \
(tab) = cast realloc( tab, sizeof( *(tab) ) * ( (count) + 1 ) ); \
else \
(tab) = cast malloc( sizeof( void ** ) ); \
(tab) = cast malloc( sizeof( *(tab) ) ); \
if( !(tab) ) abort(); \
if( (count) - (index) > 0 ) \
memmove( (void**)(tab) + (index) + 1, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment