Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit fix build error with SDEBUG, MAP_DEBUG, DEBUG_RE...



details:   https://anonhg.NetBSD.org/src/rev/768b776636f0
branches:  trunk
changeset: 850256:768b776636f0
user:      ryo <ryo%NetBSD.org@localhost>
date:      Mon Mar 30 06:54:37 2020 +0000

description:
fix build error with SDEBUG, MAP_DEBUG, DEBUG_REFRESH

diffstat:

 lib/libedit/common.c  |   8 ++++----
 lib/libedit/map.c     |  10 +++++-----
 lib/libedit/refresh.c |   5 +++--
 lib/libedit/search.c  |  17 +++++++++--------
 4 files changed, 21 insertions(+), 19 deletions(-)

diffs (148 lines):

diff -r c11c35ceb06b -r 768b776636f0 lib/libedit/common.c
--- a/lib/libedit/common.c      Mon Mar 30 03:02:41 2020 +0000
+++ b/lib/libedit/common.c      Mon Mar 30 06:54:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.48 2018/02/26 17:36:14 christos Exp $     */
+/*     $NetBSD: common.c,v 1.49 2020/03/30 06:54:37 ryo 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.48 2018/02/26 17:36:14 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.49 2020/03/30 06:54:37 ryo Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -658,7 +658,7 @@
 
        while (hp != NULL) {
 #ifdef SDEBUG
-               (void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
+               (void) fprintf(el->el_errfile, "Comparing with \"%ls\"\n", hp);
 #endif
                if ((wcsncmp(hp, el->el_line.buffer, (size_t)
                            (el->el_line.lastchar - el->el_line.buffer)) ||
@@ -713,7 +713,7 @@
 
        for (h = 1; h < el->el_history.eventno && hp; h++) {
 #ifdef SDEBUG
-               (void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
+               (void) fprintf(el->el_errfile, "Comparing with \"%ls\"\n", hp);
 #endif
                if ((wcsncmp(hp, el->el_line.buffer, (size_t)
                            (el->el_line.lastchar - el->el_line.buffer)) ||
diff -r c11c35ceb06b -r 768b776636f0 lib/libedit/map.c
--- a/lib/libedit/map.c Mon Mar 30 03:02:41 2020 +0000
+++ b/lib/libedit/map.c Mon Mar 30 06:54:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: map.c,v 1.52 2019/07/23 10:18:52 christos Exp $        */
+/*     $NetBSD: map.c,v 1.53 2020/03/30 06:54:37 ryo Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)map.c      8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: map.c,v 1.52 2019/07/23 10:18:52 christos Exp $");
+__RCSID("$NetBSD: map.c,v 1.53 2020/03/30 06:54:37 ryo Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -906,11 +906,11 @@
          */
 #ifdef MAP_DEBUG
        if (sizeof(el_map_emacs) != N_KEYS * sizeof(el_action_t))
-               EL_ABORT((el->errfile, "Emacs map incorrect\n"));
+               EL_ABORT((el->el_errfile, "Emacs map incorrect\n"));
        if (sizeof(el_map_vi_command) != N_KEYS * sizeof(el_action_t))
-               EL_ABORT((el->errfile, "Vi command map incorrect\n"));
+               EL_ABORT((el->el_errfile, "Vi command map incorrect\n"));
        if (sizeof(el_map_vi_insert) != N_KEYS * sizeof(el_action_t))
-               EL_ABORT((el->errfile, "Vi insert map incorrect\n"));
+               EL_ABORT((el->el_errfile, "Vi insert map incorrect\n"));
 #endif
 
        el->el_map.alt = el_calloc(N_KEYS, sizeof(*el->el_map.alt));
diff -r c11c35ceb06b -r 768b776636f0 lib/libedit/refresh.c
--- a/lib/libedit/refresh.c     Mon Mar 30 03:02:41 2020 +0000
+++ b/lib/libedit/refresh.c     Mon Mar 30 06:54:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refresh.c,v 1.56 2019/01/04 03:03:44 uwe Exp $ */
+/*     $NetBSD: refresh.c,v 1.57 2020/03/30 06:54:37 ryo 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.56 2019/01/04 03:03:44 uwe Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.57 2020/03/30 06:54:37 ryo Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -45,6 +45,7 @@
  * refresh.c: Lower level screen refreshing functions
  */
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
diff -r c11c35ceb06b -r 768b776636f0 lib/libedit/search.c
--- a/lib/libedit/search.c      Mon Mar 30 03:02:41 2020 +0000
+++ b/lib/libedit/search.c      Mon Mar 30 06:54:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: search.c,v 1.49 2019/07/23 10:18:52 christos Exp $     */
+/*     $NetBSD: search.c,v 1.50 2020/03/30 06:54:37 ryo 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.49 2019/07/23 10:18:52 christos Exp $");
+__RCSID("$NetBSD: search.c,v 1.50 2020/03/30 06:54:37 ryo Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -162,7 +162,7 @@
 c_hmatch(EditLine *el, const wchar_t *str)
 {
 #ifdef SDEBUG
-       (void) fprintf(el->el_errfile, "match `%s' with `%s'\n",
+       (void) fprintf(el->el_errfile, "match `%ls' with `%ls'\n",
            el->el_search.patbuf, str);
 #endif /* SDEBUG */
 
@@ -192,10 +192,10 @@
 #ifdef SDEBUG
        (void) fprintf(el->el_errfile, "\neventno = %d\n",
            el->el_history.eventno);
-       (void) fprintf(el->el_errfile, "patlen = %d\n", el->el_search.patlen);
-       (void) fprintf(el->el_errfile, "patbuf = \"%s\"\n",
+       (void) fprintf(el->el_errfile, "patlen = %ld\n", el->el_search.patlen);
+       (void) fprintf(el->el_errfile, "patbuf = \"%ls\"\n",
            el->el_search.patbuf);
-       (void) fprintf(el->el_errfile, "cursor %d lastchar %d\n",
+       (void) fprintf(el->el_errfile, "cursor %ld lastchar %ld\n",
            EL_CURSOR(el) - el->el_line.buffer,
            el->el_line.lastchar - el->el_line.buffer);
 #endif
@@ -573,8 +573,9 @@
 {
 
 #ifdef SDEBUG
-       (void) fprintf(el->el_errfile, "dir %d patlen %d patbuf %s\n",
-           c, el->el_search.patlen, ct_encode_string(el->el_search.patbuf));
+       static ct_buffer_t conv;
+       (void) fprintf(el->el_errfile, "dir %d patlen %ld patbuf %s\n",
+           c, el->el_search.patlen, ct_encode_string(el->el_search.patbuf, &conv));
 #endif
 
        el->el_state.lastcmd = (el_action_t) c; /* Hack to stop c_setpat */



Home | Main Index | Thread Index | Old Index