]> granicus.if.org Git - vim/commitdiff
patch 8.0.0777: compiler warnings with 64 bit compiler v8.0.0777
authorBram Moolenaar <Bram@vim.org>
Wed, 26 Jul 2017 19:29:34 +0000 (21:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 26 Jul 2017 19:29:34 +0000 (21:29 +0200)
Problem:    Compiler warnings with 64 bit compiler.
Solution:   Add type casts. (Mike Williams)

src/libvterm/src/pen.c
src/libvterm/src/state.c
src/terminal.c
src/version.c

index 81987f6bc17f156e154f6f03401d9784c3030e65..3c58c9cec9e0e678559c5bad9d1b06b25adc322e 100644 (file)
@@ -80,9 +80,9 @@ static int lookup_colour(const VTermState *state, int palette, const long args[]
     if(argcount < 3)
       return argcount;
 
-    col->red   = CSI_ARG(args[0]);
-    col->green = CSI_ARG(args[1]);
-    col->blue  = CSI_ARG(args[2]);
+    col->red   = (uint8_t)CSI_ARG(args[0]);
+    col->green = (uint8_t)CSI_ARG(args[1]);
+    col->blue  = (uint8_t)CSI_ARG(args[2]);
 
     return 3;
 
index 0c685309d0207bcb3ed6f8056f1574a12c1a3842..8f8909e2ff765d3a5b090bbf4d54aa7291f883c6 100644 (file)
@@ -258,7 +258,7 @@ static int on_text(const char bytes[], size_t len, void *user)
                              &state->encoding[state->gr_set];
 
   (*encoding->enc->decode)(encoding->enc, encoding->data,
-      codepoints, &npoints, state->gsingle_set ? 1 : len,
+      codepoints, &npoints, state->gsingle_set ? 1 : (int)len,
       bytes, &eaten, len);
 
   /* 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)
 #endif
 
   vterm_allocator_free(state->vt, codepoints);
-  return eaten;
+  return (int)eaten;
 }
 
 static int on_control(unsigned char control, void *user)
@@ -1680,7 +1680,7 @@ VTermState *vterm_obtain_state(VTerm *vt)
   state->lineinfo = vterm_allocator_malloc(state->vt, state->rows * sizeof(VTermLineInfo));
 
   state->encoding_utf8.enc = vterm_lookup_encoding(ENC_UTF8, 'u');
-  if(*state->encoding_utf8.enc->init)
+  if(*state->encoding_utf8.enc->init != NULL)
     (*state->encoding_utf8.enc->init)(state->encoding_utf8.enc, state->encoding_utf8.data);
 
   vterm_parser_set_callbacks(vt, &parser_callbacks, state);
index 9833a43b77611695e14133f38b0fa8554067a428..4cc755c0c357efe5d4d2faf9cad30365eb5e25e4 100644 (file)
@@ -35,6 +35,7 @@
  * TODO:
  * - include functions from #1871
  * - do not store terminal buffer in viminfo.  Or prefix term:// ?
+ * - Make CTRL-W . send CTRL-W to terminal?
  * - Add a scrollback buffer (contains lines to scroll off the top).
  *   Can use the buf_T lines, store attributes somewhere else?
  * - When the job ends:
@@ -204,7 +205,7 @@ ex_terminal(exarg_T *eap)
     {
        int     i;
        size_t  len = STRLEN(cmd) + 10;
-       char_u  *p = alloc(len);
+       char_u  *p = alloc((int)len);
 
        for (i = 1; p != NULL; ++i)
        {
@@ -301,7 +302,7 @@ term_write_job_output(term_T *term, char_u *msg, size_t len)
        {
            if (*p == NL)
                break;
-           p += utf_ptr2len_len(p, len - (p - msg));
+           p += utf_ptr2len_len(p, (int)(len - (p - msg)));
        }
        len_now = p - msg - done;
        vterm_input_write(vterm, (char *)msg + done, len_now);
@@ -453,7 +454,7 @@ term_convert_key(int c, char *buf)
        vterm_keyboard_unichar(vterm, c, mod);
 
     /* Read back the converted escape sequence. */
-    return vterm_output_read(vterm, buf, KEY_BUF_LEN);
+    return (int)vterm_output_read(vterm, buf, KEY_BUF_LEN);
 }
 
 /*
@@ -540,7 +541,7 @@ terminal_loop(void)
        if (len > 0)
            /* TODO: if FAIL is returned, stop? */
            channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
-                                                    (char_u *)buf, len, NULL);
+                                                    (char_u *)buf, (int)len, NULL);
     }
 }
 
@@ -1056,7 +1057,7 @@ term_get_status_text(term_T *term)
        else
            txt = (char_u *)_("finished");
        len = 9 + STRLEN(term->tl_buffer->b_fname) + STRLEN(txt);
-       term->tl_status_text = alloc(len);
+       term->tl_status_text = alloc((int)len);
        if (term->tl_status_text != NULL)
            vim_snprintf((char *)term->tl_status_text, len, "%s [%s]",
                                                term->tl_buffer->b_fname, txt);
index 530663ec0595818f36a0942fe7037e55c7be4cbf..fe82a368e46857af8315d574f25511c0f4507a24 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    777,
 /**/
     776,
 /**/