@@ -261,8 +261,9 @@ static int interlaced_line_index(int h, int y)
261261static int read_image_data (twin_gif_t * gif , int interlace )
262262{
263263 uint8_t sub_len , shift , byte ;
264- int init_key_size , key_size , table_t_is_full ;
265- int frm_off , frm_size , str_len , i , p , x , y ;
264+ int init_key_size , key_size ;
265+ bool is_table_full = false;
266+ int frm_off , frm_size , str_len = 0 , i , p , x , y ;
266267 uint16_t key , clear , stop ;
267268 int ret ;
268269 table_t * table_t ;
@@ -292,16 +293,16 @@ static int read_image_data(twin_gif_t *gif, int interlace)
292293 if (key == clear ) {
293294 key_size = init_key_size ;
294295 table_t -> n_entries = (1 << (key_size - 1 )) + 2 ;
295- table_t_is_full = 0 ;
296- } else if (!table_t_is_full ) {
296+ is_table_full = false ;
297+ } else if (!is_table_full ) {
297298 ret = add_entry_t (& table_t , str_len + 1 , key , entry_t .suffix );
298299 if (ret == -1 ) {
299300 free (table_t );
300301 return -1 ;
301302 }
302303 if (table_t -> n_entries == 0x1000 ) {
303304 ret = 0 ;
304- table_t_is_full = 1 ;
305+ is_table_full = true ;
305306 }
306307 }
307308 key = get_key (gif , key_size , & sub_len , & shift , & byte );
@@ -327,7 +328,7 @@ static int read_image_data(twin_gif_t *gif, int interlace)
327328 entry_t = table_t -> entries [entry_t .prefix ];
328329 }
329330 frm_off += str_len ;
330- if (key < table_t -> n_entries - 1 && !table_t_is_full )
331+ if (key < table_t -> n_entries - 1 && !is_table_full )
331332 table_t -> entries [table_t -> n_entries - 1 ].suffix = entry_t .suffix ;
332333 }
333334 free (table_t );
@@ -513,7 +514,7 @@ static void _twin_gif_render_frame(twin_gif_t *gif, uint8_t *buffer)
513514 render_frame_rect (gif , buffer );
514515}
515516
516- static int _twin_gif_is_bgcolor (twin_gif_t * gif , uint8_t color [ 3 ] )
517+ static int _twin_gif_is_bgcolor (const twin_gif_t * gif , const uint8_t * color )
517518{
518519 return !memcmp (& gif -> palette -> colors [gif -> bgindex * 3 ], color , 3 );
519520}
0 commit comments