Skip to content

Commit a1b5b09

Browse files
committed
patch 8.0.0777: compiler warnings with 64 bit compiler
Problem: Compiler warnings with 64 bit compiler. Solution: Add type casts. (Mike Williams)
1 parent f0a521f commit a1b5b09

4 files changed

Lines changed: 14 additions & 11 deletions

File tree

src/libvterm/src/pen.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ static int lookup_colour(const VTermState *state, int palette, const long args[]
8080
if(argcount < 3)
8181
return argcount;
8282

83-
col->red = CSI_ARG(args[0]);
84-
col->green = CSI_ARG(args[1]);
85-
col->blue = CSI_ARG(args[2]);
83+
col->red = (uint8_t)CSI_ARG(args[0]);
84+
col->green = (uint8_t)CSI_ARG(args[1]);
85+
col->blue = (uint8_t)CSI_ARG(args[2]);
8686

8787
return 3;
8888

src/libvterm/src/state.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static int on_text(const char bytes[], size_t len, void *user)
258258
&state->encoding[state->gr_set];
259259

260260
(*encoding->enc->decode)(encoding->enc, encoding->data,
261-
codepoints, &npoints, state->gsingle_set ? 1 : len,
261+
codepoints, &npoints, state->gsingle_set ? 1 : (int)len,
262262
bytes, &eaten, len);
263263

264264
/* There's a chance an encoding (e.g. UTF-8) hasn't found enough bytes yet
@@ -411,7 +411,7 @@ static int on_text(const char bytes[], size_t len, void *user)
411411
#endif
412412

413413
vterm_allocator_free(state->vt, codepoints);
414-
return eaten;
414+
return (int)eaten;
415415
}
416416

417417
static int on_control(unsigned char control, void *user)
@@ -1680,7 +1680,7 @@ VTermState *vterm_obtain_state(VTerm *vt)
16801680
state->lineinfo = vterm_allocator_malloc(state->vt, state->rows * sizeof(VTermLineInfo));
16811681

16821682
state->encoding_utf8.enc = vterm_lookup_encoding(ENC_UTF8, 'u');
1683-
if(*state->encoding_utf8.enc->init)
1683+
if(*state->encoding_utf8.enc->init != NULL)
16841684
(*state->encoding_utf8.enc->init)(state->encoding_utf8.enc, state->encoding_utf8.data);
16851685

16861686
vterm_parser_set_callbacks(vt, &parser_callbacks, state);

src/terminal.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* TODO:
3636
* - include functions from #1871
3737
* - do not store terminal buffer in viminfo. Or prefix term:// ?
38+
* - Make CTRL-W . send CTRL-W to terminal?
3839
* - Add a scrollback buffer (contains lines to scroll off the top).
3940
* Can use the buf_T lines, store attributes somewhere else?
4041
* - When the job ends:
@@ -204,7 +205,7 @@ ex_terminal(exarg_T *eap)
204205
{
205206
int i;
206207
size_t len = STRLEN(cmd) + 10;
207-
char_u *p = alloc(len);
208+
char_u *p = alloc((int)len);
208209

209210
for (i = 1; p != NULL; ++i)
210211
{
@@ -301,7 +302,7 @@ term_write_job_output(term_T *term, char_u *msg, size_t len)
301302
{
302303
if (*p == NL)
303304
break;
304-
p += utf_ptr2len_len(p, len - (p - msg));
305+
p += utf_ptr2len_len(p, (int)(len - (p - msg)));
305306
}
306307
len_now = p - msg - done;
307308
vterm_input_write(vterm, (char *)msg + done, len_now);
@@ -453,7 +454,7 @@ term_convert_key(int c, char *buf)
453454
vterm_keyboard_unichar(vterm, c, mod);
454455

455456
/* Read back the converted escape sequence. */
456-
return vterm_output_read(vterm, buf, KEY_BUF_LEN);
457+
return (int)vterm_output_read(vterm, buf, KEY_BUF_LEN);
457458
}
458459

459460
/*
@@ -540,7 +541,7 @@ terminal_loop(void)
540541
if (len > 0)
541542
/* TODO: if FAIL is returned, stop? */
542543
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
543-
(char_u *)buf, len, NULL);
544+
(char_u *)buf, (int)len, NULL);
544545
}
545546
}
546547

@@ -1056,7 +1057,7 @@ term_get_status_text(term_T *term)
10561057
else
10571058
txt = (char_u *)_("finished");
10581059
len = 9 + STRLEN(term->tl_buffer->b_fname) + STRLEN(txt);
1059-
term->tl_status_text = alloc(len);
1060+
term->tl_status_text = alloc((int)len);
10601061
if (term->tl_status_text != NULL)
10611062
vim_snprintf((char *)term->tl_status_text, len, "%s [%s]",
10621063
term->tl_buffer->b_fname, txt);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
777,
772774
/**/
773775
776,
774776
/**/

0 commit comments

Comments
 (0)