Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit Add casts to appease conversions between wchar_t...



details:   https://anonhg.NetBSD.org/src/rev/7e6f390b789d
branches:  trunk
changeset: 985820:7e6f390b789d
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 09 20:24:07 2021 +0000

description:
Add casts to appease conversions between wchar_t and wint_t

diffstat:

 lib/libedit/refresh.c  |  20 ++++++++++++--------
 lib/libedit/terminal.c |   7 ++++---
 2 files changed, 16 insertions(+), 11 deletions(-)

diffs (104 lines):

diff -r 5fc1c26396f8 -r 7e6f390b789d lib/libedit/refresh.c
--- a/lib/libedit/refresh.c     Thu Sep 09 15:00:01 2021 +0000
+++ b/lib/libedit/refresh.c     Thu Sep 09 20:24:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refresh.c,v 1.57 2020/03/30 06:54:37 ryo Exp $ */
+/*     $NetBSD: refresh.c,v 1.58 2021/09/09 20:24:07 christos Exp $    */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c  8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.57 2020/03/30 06:54:37 ryo Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.58 2021/09/09 20:24:07 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -105,7 +105,7 @@
         */
        if (el->el_refresh.r_cursor.v + 1 >= el->el_terminal.t_size.v) {
                int i, lins = el->el_terminal.t_size.v;
-               wchar_t *firstline = el->el_vdisplay[0];
+               wint_t *firstline = el->el_vdisplay[0];
 
                for(i = 1; i < lins; i++)
                        el->el_vdisplay[i - 1] = el->el_vdisplay[i];
@@ -334,7 +334,8 @@
        ELRE_DEBUG(1, (__F, "updating %d lines.\r\n", el->el_refresh.r_newcv));
        for (i = 0; i <= el->el_refresh.r_newcv; i++) {
                /* NOTE THAT re_update_line MAY CHANGE el_display[i] */
-               re_update_line(el, el->el_display[i], el->el_vdisplay[i], i);
+               re_update_line(el, (wchar_t *)el->el_display[i],
+                   (wchar_t *)el->el_vdisplay[i], i);
 
                /*
                 * Copy the new line to be the current one, and pad out with
@@ -343,7 +344,8 @@
                 * end of the screen line, it won't be a NUL or some old
                 * leftover stuff.
                 */
-               re__copy_and_pad(el->el_display[i], el->el_vdisplay[i],
+               re__copy_and_pad((wchar_t *)el->el_display[i],
+                   (wchar_t *)el->el_vdisplay[i],
                    (size_t) el->el_terminal.t_size.h);
        }
        ELRE_DEBUG(1, (__F,
@@ -355,7 +357,8 @@
                        terminal_move_to_line(el, i);
                        terminal_move_to_char(el, 0);
                         /* This wcslen should be safe even with MB_FILL_CHARs */
-                       terminal_clear_EOL(el, (int) wcslen(el->el_display[i]));
+                       terminal_clear_EOL(el,
+                           (int) wcslen((const wchar_t *)el->el_display[i]));
 #ifdef DEBUG_REFRESH
                        terminal_overwrite(el, L"C\b", 2);
 #endif /* DEBUG_REFRESH */
@@ -1091,7 +1094,7 @@
 static void
 re_fastputc(EditLine *el, wint_t c)
 {
-       wchar_t *lastline;
+       wint_t *lastline;
        int w;
 
        w = wcwidth(c);
@@ -1126,7 +1129,8 @@
                        el->el_cursor.v++;
                        lastline = el->el_display[++el->el_refresh.r_oldcv];
                }
-               re__copy_and_pad(lastline, L"", (size_t)el->el_terminal.t_size.h);
+               re__copy_and_pad((wchar_t *)lastline, L"",
+                   (size_t)el->el_terminal.t_size.h);
 
                if (EL_HAS_AUTO_MARGINS) {
                        if (EL_HAS_MAGIC_MARGINS) {
diff -r 5fc1c26396f8 -r 7e6f390b789d lib/libedit/terminal.c
--- a/lib/libedit/terminal.c    Thu Sep 09 15:00:01 2021 +0000
+++ b/lib/libedit/terminal.c    Thu Sep 09 20:24:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: terminal.c,v 1.43 2020/07/10 20:34:24 christos Exp $   */
+/*     $NetBSD: terminal.c,v 1.44 2021/09/09 20:24:07 christos Exp $   */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c     8.2 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: terminal.c,v 1.43 2020/07/10 20:34:24 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.44 2021/09/09 20:24:07 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -588,7 +588,8 @@
                                 * NOTE THAT terminal_overwrite() WILL CHANGE
                                 * el->el_cursor.h!!!
                                 */
-                               terminal_overwrite(el, &el->el_display[
+                               terminal_overwrite(el,
+                                   (wchar_t *)&el->el_display[
                                    el->el_cursor.v][el->el_cursor.h],
                                    (size_t)(where - el->el_cursor.h));
 



Home | Main Index | Thread Index | Old Index