fix build error with SDEBUG, MAP_DEBUG, DEBUG_REFRESH

This commit is contained in:
ryo 2020-03-30 06:54:37 +00:00
parent d6d7dd9781
commit 1148c4261d
4 changed files with 21 additions and 19 deletions

View File

@ -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, wint_t c __attribute__((__unused__)))
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, wint_t c __attribute__((__unused__)))
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)) ||

View File

@ -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));

View File

@ -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/01/04 03:03:44 uwe Exp $");
* refresh.c: Lower level screen refreshing functions
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

View File

@ -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 */