Commit e52eb9b1 authored by Daniel Kamil Kozar's avatar Daniel Kamil Kozar Committed by Jean-Paul Saman

replace array filling with a function

Signed-off-by: default avatarJean-Paul Saman <jpsaman@videolan.org>
parent be76a781
...@@ -129,6 +129,11 @@ ...@@ -129,6 +129,11 @@
#define BOZO_init_array(len_name) \ #define BOZO_init_array(len_name) \
s_decoded.len_name = 0; s_decoded.len_name = 0;
static void BOZO_fill_array(void *a, size_t len)
{
for(size_t i = 0 ; i < len ; ++i) ((uint8_t*)a)[i] = rand();
}
#define BOZO_begin_array(name, len_name, min_size) \ #define BOZO_begin_array(name, len_name, min_size) \
if(!i_err) \ if(!i_err) \
{ \ { \
...@@ -136,8 +141,7 @@ ...@@ -136,8 +141,7 @@
i_loop_count = min_size; \ i_loop_count = min_size; \
do \ do \
{ \ { \
for(size_t i = 0 ; i < sizeof(s_decoded.name) ; ++i) \ BOZO_fill_array(s_decoded.name, sizeof(s_decoded.name)); \
((uint8_t*)s_decoded.name)[i] = rand(); \
s_decoded.len_name = i_loop_count; s_decoded.len_name = i_loop_count;
#define BOZO_end_array(name, max_len) \ #define BOZO_end_array(name, max_len) \
......
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