Module Name:    src
Committed By:   ryo
Date:           Mon Mar 30 06:54:37 UTC 2020

Modified Files:
        src/lib/libedit: common.c map.c refresh.c search.c

Log Message:
fix build error with SDEBUG, MAP_DEBUG, DEBUG_REFRESH


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/lib/libedit/common.c
cvs rdiff -u -r1.52 -r1.53 src/lib/libedit/map.c
cvs rdiff -u -r1.56 -r1.57 src/lib/libedit/refresh.c
cvs rdiff -u -r1.49 -r1.50 src/lib/libedit/search.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/common.c
diff -u src/lib/libedit/common.c:1.48 src/lib/libedit/common.c:1.49
--- src/lib/libedit/common.c:1.48	Mon Feb 26 17:36:14 2018
+++ src/lib/libedit/common.c	Mon Mar 30 06:54:37 2020
@@ -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 @@ ed_search_prev_history(EditLine *el, win
 
 	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 @@ ed_search_next_history(EditLine *el, win
 
 	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)) ||

Index: src/lib/libedit/map.c
diff -u src/lib/libedit/map.c:1.52 src/lib/libedit/map.c:1.53
--- src/lib/libedit/map.c:1.52	Tue Jul 23 10:18:52 2019
+++ src/lib/libedit/map.c	Mon Mar 30 06:54:37 2020
@@ -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 @@ map_init(EditLine *el)
          */
 #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));

Index: src/lib/libedit/refresh.c
diff -u src/lib/libedit/refresh.c:1.56 src/lib/libedit/refresh.c:1.57
--- src/lib/libedit/refresh.c:1.56	Fri Jan  4 03:03:44 2019
+++ src/lib/libedit/refresh.c	Mon Mar 30 06:54:37 2020
@@ -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 @@ __RCSID("$NetBSD: refresh.c,v 1.56 2019/
  * refresh.c: Lower level screen refreshing functions
  */
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 

Index: src/lib/libedit/search.c
diff -u src/lib/libedit/search.c:1.49 src/lib/libedit/search.c:1.50
--- src/lib/libedit/search.c:1.49	Tue Jul 23 10:18:52 2019
+++ src/lib/libedit/search.c	Mon Mar 30 06:54:37 2020
@@ -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 @@ libedit_private int
 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 @@ c_setpat(EditLine *el)
 #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 @@ cv_repeat_srch(EditLine *el, wint_t c)
 {
 
 #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 */

Reply via email to