@@ -261,8 +261,9 @@ static int interlaced_line_index(int h, int y)
261
261
static int read_image_data (twin_gif_t * gif , int interlace )
262
262
{
263
263
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 ;
266
267
uint16_t key , clear , stop ;
267
268
int ret ;
268
269
table_t * table_t ;
@@ -292,16 +293,16 @@ static int read_image_data(twin_gif_t *gif, int interlace)
292
293
if (key == clear ) {
293
294
key_size = init_key_size ;
294
295
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 ) {
297
298
ret = add_entry_t (& table_t , str_len + 1 , key , entry_t .suffix );
298
299
if (ret == -1 ) {
299
300
free (table_t );
300
301
return -1 ;
301
302
}
302
303
if (table_t -> n_entries == 0x1000 ) {
303
304
ret = 0 ;
304
- table_t_is_full = 1 ;
305
+ is_table_full = true ;
305
306
}
306
307
}
307
308
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)
327
328
entry_t = table_t -> entries [entry_t .prefix ];
328
329
}
329
330
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 )
331
332
table_t -> entries [table_t -> n_entries - 1 ].suffix = entry_t .suffix ;
332
333
}
333
334
free (table_t );
@@ -513,7 +514,7 @@ static void _twin_gif_render_frame(twin_gif_t *gif, uint8_t *buffer)
513
514
render_frame_rect (gif , buffer );
514
515
}
515
516
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 )
517
518
{
518
519
return !memcmp (& gif -> palette -> colors [gif -> bgindex * 3 ], color , 3 );
519
520
}
0 commit comments