@@ -2220,8 +2220,8 @@ static int cap_trie_add(const char *cap, uint16_t key, uint8_t mod) {
2220
2220
if (!next ) {
2221
2221
// We need to add a new child to node
2222
2222
node -> nchildren += 1 ;
2223
- node -> children =
2224
- tb_realloc ( node -> children , sizeof (* node ) * node -> nchildren );
2223
+ node -> children = ( struct cap_trie_t * ) tb_realloc ( node -> children ,
2224
+ sizeof (* node ) * node -> nchildren );
2225
2225
if (!node -> children ) {
2226
2226
return TB_ERR_MEM ;
2227
2227
}
@@ -2361,7 +2361,7 @@ static int update_term_size_via_esc(void) {
2361
2361
#define TB_RESIZE_FALLBACK_MS 1000
2362
2362
#endif
2363
2363
2364
- char * move_and_report = "\x1b[9999;9999H\x1b[6n" ;
2364
+ char move_and_report [] = "\x1b[9999;9999H\x1b[6n" ;
2365
2365
ssize_t write_rv =
2366
2366
write (global .wfd , move_and_report , strlen (move_and_report ));
2367
2367
if (write_rv != (ssize_t )strlen (move_and_report )) {
@@ -2430,7 +2430,10 @@ static int tb_deinit(void) {
2430
2430
}
2431
2431
}
2432
2432
2433
- sigaction (SIGWINCH , & (struct sigaction ){.sa_handler = SIG_DFL }, NULL );
2433
+ struct sigaction sa ;
2434
+ memset (& sa , 0 , sizeof (sa ));
2435
+ sa .sa_handler = SIG_DFL ;
2436
+ sigaction (SIGWINCH , & sa , NULL );
2434
2437
if (global .resize_pipefd [0 ] >= 0 ) close (global .resize_pipefd [0 ]);
2435
2438
if (global .resize_pipefd [1 ] >= 0 ) close (global .resize_pipefd [1 ]);
2436
2439
@@ -2537,7 +2540,7 @@ static int read_terminfo_path(const char *path) {
2537
2540
}
2538
2541
2539
2542
size_t fsize = st .st_size ;
2540
- char * data = tb_malloc (fsize );
2543
+ char * data = ( char * ) tb_malloc (fsize );
2541
2544
if (!data ) {
2542
2545
fclose (fp );
2543
2546
return TB_ERR ;
@@ -2848,7 +2851,7 @@ static int extract_esc_cap(struct tb_event *event) {
2848
2851
static int extract_esc_mouse (struct tb_event * event ) {
2849
2852
struct bytebuf_t * in = & global .in ;
2850
2853
2851
- enum type { TYPE_VT200 = 0 , TYPE_1006 , TYPE_1015 , TYPE_MAX };
2854
+ enum { TYPE_VT200 = 0 , TYPE_1006 , TYPE_1015 , TYPE_MAX };
2852
2855
2853
2856
const char * cmp [TYPE_MAX ] = {//
2854
2857
// X10 mouse encoding, the simplest one
@@ -2860,7 +2863,7 @@ static int extract_esc_mouse(struct tb_event *event) {
2860
2863
// urxvt: \x1b [ Cb ; Cx ; Cy M
2861
2864
[TYPE_1015 ] = "\x1b[" };
2862
2865
2863
- enum type type = 0 ;
2866
+ int type = 0 ;
2864
2867
int ret = TB_ERR ;
2865
2868
2866
2869
// Unrolled at compile-time (probably)
@@ -3358,7 +3361,7 @@ static int cell_free(struct tb_cell *cell) {
3358
3361
}
3359
3362
3360
3363
static int cellbuf_init (struct cellbuf_t * c , int w , int h ) {
3361
- c -> cells = tb_malloc (sizeof (struct tb_cell ) * w * h );
3364
+ c -> cells = ( struct tb_cell * ) tb_malloc (sizeof (struct tb_cell ) * w * h );
3362
3365
if (!c -> cells ) {
3363
3366
return TB_ERR_MEM ;
3364
3367
}
@@ -3491,9 +3494,9 @@ static int bytebuf_reserve(struct bytebuf_t *b, size_t sz) {
3491
3494
}
3492
3495
char * newbuf ;
3493
3496
if (b -> buf ) {
3494
- newbuf = tb_realloc (b -> buf , newcap );
3497
+ newbuf = ( char * ) tb_realloc (b -> buf , newcap );
3495
3498
} else {
3496
- newbuf = tb_malloc (newcap );
3499
+ newbuf = ( char * ) tb_malloc (newcap );
3497
3500
}
3498
3501
if (!newbuf ) {
3499
3502
return TB_ERR_MEM ;
0 commit comments