Mercurial > vim
comparison src/terminal.c @ 11790:4dfebc1b2674 v8.0.0777
patch 8.0.0777: compiler warnings with 64 bit compiler
commit https://github.com/vim/vim/commit/a1b5b0928118b135f9917679c0da28175c845140
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 26 21:29:34 2017 +0200
patch 8.0.0777: compiler warnings with 64 bit compiler
Problem: Compiler warnings with 64 bit compiler.
Solution: Add type casts. (Mike Williams)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 26 Jul 2017 21:30:04 +0200 |
parents | 98154b91e43a |
children | 4bc1f94afc34 |
comparison
equal
deleted
inserted
replaced
11789:48600c3e7e94 | 11790:4dfebc1b2674 |
---|---|
33 * while, if the terminal window is visible, the screen contents is drawn. | 33 * while, if the terminal window is visible, the screen contents is drawn. |
34 * | 34 * |
35 * TODO: | 35 * TODO: |
36 * - include functions from #1871 | 36 * - include functions from #1871 |
37 * - do not store terminal buffer in viminfo. Or prefix term:// ? | 37 * - do not store terminal buffer in viminfo. Or prefix term:// ? |
38 * - Make CTRL-W . send CTRL-W to terminal? | |
38 * - Add a scrollback buffer (contains lines to scroll off the top). | 39 * - Add a scrollback buffer (contains lines to scroll off the top). |
39 * Can use the buf_T lines, store attributes somewhere else? | 40 * Can use the buf_T lines, store attributes somewhere else? |
40 * - When the job ends: | 41 * - When the job ends: |
41 * - Write "-- JOB ENDED --" in the terminal. | 42 * - Write "-- JOB ENDED --" in the terminal. |
42 * - Put the terminal contents in the scrollback buffer. | 43 * - Put the terminal contents in the scrollback buffer. |
202 curbuf->b_ffname = vim_strsave(cmd); | 203 curbuf->b_ffname = vim_strsave(cmd); |
203 else | 204 else |
204 { | 205 { |
205 int i; | 206 int i; |
206 size_t len = STRLEN(cmd) + 10; | 207 size_t len = STRLEN(cmd) + 10; |
207 char_u *p = alloc(len); | 208 char_u *p = alloc((int)len); |
208 | 209 |
209 for (i = 1; p != NULL; ++i) | 210 for (i = 1; p != NULL; ++i) |
210 { | 211 { |
211 vim_snprintf((char *)p, len, "%s (%d)", cmd, i); | 212 vim_snprintf((char *)p, len, "%s (%d)", cmd, i); |
212 if (buflist_findname(p) == NULL) | 213 if (buflist_findname(p) == NULL) |
299 { | 300 { |
300 for (p = msg + done; p < msg + len; ) | 301 for (p = msg + done; p < msg + len; ) |
301 { | 302 { |
302 if (*p == NL) | 303 if (*p == NL) |
303 break; | 304 break; |
304 p += utf_ptr2len_len(p, len - (p - msg)); | 305 p += utf_ptr2len_len(p, (int)(len - (p - msg))); |
305 } | 306 } |
306 len_now = p - msg - done; | 307 len_now = p - msg - done; |
307 vterm_input_write(vterm, (char *)msg + done, len_now); | 308 vterm_input_write(vterm, (char *)msg + done, len_now); |
308 if (p < msg + len && *p == NL) | 309 if (p < msg + len && *p == NL) |
309 { | 310 { |
451 else | 452 else |
452 /* Normal character, let vterm convert it. */ | 453 /* Normal character, let vterm convert it. */ |
453 vterm_keyboard_unichar(vterm, c, mod); | 454 vterm_keyboard_unichar(vterm, c, mod); |
454 | 455 |
455 /* Read back the converted escape sequence. */ | 456 /* 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); |
457 } | 458 } |
458 | 459 |
459 /* | 460 /* |
460 * Wait for input and send it to the job. | 461 * Wait for input and send it to the job. |
461 * Return when the start of a CTRL-W command is typed or anything else that | 462 * Return when the start of a CTRL-W command is typed or anything else that |
538 /* Convert the typed key to a sequence of bytes for the job. */ | 539 /* Convert the typed key to a sequence of bytes for the job. */ |
539 len = term_convert_key(c, buf); | 540 len = term_convert_key(c, buf); |
540 if (len > 0) | 541 if (len > 0) |
541 /* TODO: if FAIL is returned, stop? */ | 542 /* TODO: if FAIL is returned, stop? */ |
542 channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN, | 543 channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN, |
543 (char_u *)buf, len, NULL); | 544 (char_u *)buf, (int)len, NULL); |
544 } | 545 } |
545 } | 546 } |
546 | 547 |
547 /* | 548 /* |
548 * Called when a job has finished. | 549 * Called when a job has finished. |
1054 else if (term_job_running(term)) | 1055 else if (term_job_running(term)) |
1055 txt = (char_u *)_("running"); | 1056 txt = (char_u *)_("running"); |
1056 else | 1057 else |
1057 txt = (char_u *)_("finished"); | 1058 txt = (char_u *)_("finished"); |
1058 len = 9 + STRLEN(term->tl_buffer->b_fname) + STRLEN(txt); | 1059 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); |
1060 if (term->tl_status_text != NULL) | 1061 if (term->tl_status_text != NULL) |
1061 vim_snprintf((char *)term->tl_status_text, len, "%s [%s]", | 1062 vim_snprintf((char *)term->tl_status_text, len, "%s [%s]", |
1062 term->tl_buffer->b_fname, txt); | 1063 term->tl_buffer->b_fname, txt); |
1063 } | 1064 } |
1064 return term->tl_status_text; | 1065 return term->tl_status_text; |