Commit 03fe1079 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

block_Realloc(): cast to block_sys_t after check

There are no real functional changes Here. But it is cleaner not to
cast to block_sys_t if the block is not a block_sys_t block (i.e.
was not allocated by block_Alloc()).
parent 2c2b4687
...@@ -139,7 +139,6 @@ block_t *block_Alloc( size_t i_size ) ...@@ -139,7 +139,6 @@ block_t *block_Alloc( size_t i_size )
block_t *block_Realloc( block_t *p_block, ssize_t i_prebody, size_t i_body ) block_t *block_Realloc( block_t *p_block, ssize_t i_prebody, size_t i_body )
{ {
block_sys_t *p_sys = (block_sys_t *)p_block;
size_t requested = i_prebody + i_body; size_t requested = i_prebody + i_body;
/* Corner case: empty block requested */ /* Corner case: empty block requested */
...@@ -159,9 +158,9 @@ block_t *block_Realloc( block_t *p_block, ssize_t i_prebody, size_t i_body ) ...@@ -159,9 +158,9 @@ block_t *block_Realloc( block_t *p_block, ssize_t i_prebody, size_t i_body )
return NULL; return NULL;
p_block = p_dup; p_block = p_dup;
p_sys = (block_sys_t *)p_block;
} }
block_sys_t *p_sys = (block_sys_t *)p_block;
uint8_t *p_start = p_sys->p_allocated_buffer; uint8_t *p_start = p_sys->p_allocated_buffer;
uint8_t *p_end = p_sys->p_allocated_buffer + p_sys->i_allocated_buffer; uint8_t *p_end = p_sys->p_allocated_buffer + p_sys->i_allocated_buffer;
......
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