Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit PR/53058: Nikhil Benesch: use correctly typed va...



details:   https://anonhg.NetBSD.org/src/rev/09ffcc0b7db0
branches:  trunk
changeset: 830142:09ffcc0b7db0
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 26 17:36:14 2018 +0000

description:
PR/53058: Nikhil Benesch: use correctly typed variables (wchar_t vs wint_t)
as parameters.

diffstat:

 lib/libedit/common.c |  12 +++++++-----
 lib/libedit/search.c |   8 +++++---
 2 files changed, 12 insertions(+), 8 deletions(-)

diffs (69 lines):

diff -r 37a9d7b21775 -r 09ffcc0b7db0 lib/libedit/common.c
--- a/lib/libedit/common.c      Mon Feb 26 15:11:12 2018 +0000
+++ b/lib/libedit/common.c      Mon Feb 26 17:36:14 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.47 2016/05/22 19:44:26 christos Exp $     */
+/*     $NetBSD: common.c,v 1.48 2018/02/26 17:36:14 christos Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)common.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: common.c,v 1.47 2016/05/22 19:44:26 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.48 2018/02/26 17:36:14 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -363,15 +363,17 @@
  *     [^V] [^V]
  */
 libedit_private el_action_t
-ed_quoted_insert(EditLine *el, wint_t c)
+/*ARGSUSED*/
+ed_quoted_insert(EditLine *el, wint_t c __attribute__((__unused__)))
 {
        int num;
+       wchar_t ch;
 
        tty_quotemode(el);
-       num = el_wgetc(el, &c);
+       num = el_wgetc(el, &ch);
        tty_noquotemode(el);
        if (num == 1)
-               return ed_insert(el, c);
+               return ed_insert(el, ch);
        else
                return ed_end_of_file(el, 0);
 }
diff -r 37a9d7b21775 -r 09ffcc0b7db0 lib/libedit/search.c
--- a/lib/libedit/search.c      Mon Feb 26 15:11:12 2018 +0000
+++ b/lib/libedit/search.c      Mon Feb 26 17:36:14 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: search.c,v 1.47 2016/05/09 21:46:56 christos Exp $     */
+/*     $NetBSD: search.c,v 1.48 2018/02/26 17:36:14 christos Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)search.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: search.c,v 1.47 2016/05/09 21:46:56 christos Exp $");
+__RCSID("$NetBSD: search.c,v 1.48 2018/02/26 17:36:14 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -603,8 +603,10 @@
                return CC_ERROR;
 
        if (ch == (wint_t)-1) {
-               if (el_wgetc(el, &ch) != 1)
+               wchar_t c;
+               if (el_wgetc(el, &c) != 1)
                        return ed_end_of_file(el, 0);
+               ch = c;
        }
 
        /* Save for ';' and ',' commands */



Home | Main Index | Thread Index | Old Index