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 ) ...@@ -92,9 +92,9 @@ static inline void *realloc_down( void *ptr, size_t size )
#define TAB_APPEND_CAST( cast, count, tab, p ) \ #define TAB_APPEND_CAST( cast, count, tab, p ) \
do { \ do { \
if( (count) > 0 ) \ if( (count) > 0 ) \
(tab) = cast realloc( tab, sizeof( void ** ) * ( (count) + 1 ) ); \ (tab) = cast realloc( tab, sizeof( *(tab) ) * ( (count) + 1 ) ); \
else \ else \
(tab) = cast malloc( sizeof( void ** ) ); \ (tab) = cast malloc( sizeof( *(tab) ) ); \
if( !(tab) ) abort(); \ if( !(tab) ) abort(); \
(tab)[count] = (p); \ (tab)[count] = (p); \
(count)++; \ (count)++; \
...@@ -123,7 +123,7 @@ static inline void *realloc_down( void *ptr, size_t size ) ...@@ -123,7 +123,7 @@ static inline void *realloc_down( void *ptr, size_t size )
{ \ { \
memmove( ((void**)(tab) + i_index), \ memmove( ((void**)(tab) + i_index), \
((void**)(tab) + i_index+1), \ ((void**)(tab) + i_index+1), \
( (count) - i_index - 1 ) * sizeof( void* ) );\ ( (count) - i_index - 1 ) * sizeof( *(tab) ) );\
} \ } \
(count)--; \ (count)--; \
if( (count) == 0 ) \ if( (count) == 0 ) \
...@@ -136,9 +136,9 @@ static inline void *realloc_down( void *ptr, size_t size ) ...@@ -136,9 +136,9 @@ static inline void *realloc_down( void *ptr, size_t size )
#define TAB_INSERT_CAST( cast, count, tab, p, index ) do { \ #define TAB_INSERT_CAST( cast, count, tab, p, index ) do { \
if( (count) > 0 ) \ if( (count) > 0 ) \
(tab) = cast realloc( tab, sizeof( void ** ) * ( (count) + 1 ) ); \ (tab) = cast realloc( tab, sizeof( *(tab) ) * ( (count) + 1 ) ); \
else \ else \
(tab) = cast malloc( sizeof( void ** ) ); \ (tab) = cast malloc( sizeof( *(tab) ) ); \
if( !(tab) ) abort(); \ if( !(tab) ) abort(); \
if( (count) - (index) > 0 ) \ if( (count) - (index) > 0 ) \
memmove( (void**)(tab) + (index) + 1, \ 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