Sun Nov 12 15:33:03 2017 UTC ()
_POSIX_VDISABLE exceeds CHAR_MAX. We thus need to cast it to CHAR_T for the
case where USE_WIDECHAR != "yes", i.e., CHAR_T is char.


(rin)
diff -r1.4 -r1.5 src/external/bsd/nvi/dist/cl/cl_funcs.c

cvs diff -r1.4 -r1.5 src/external/bsd/nvi/dist/cl/cl_funcs.c (expand / switch to unified diff)

--- src/external/bsd/nvi/dist/cl/cl_funcs.c 2014/01/26 21:43:45 1.4
+++ src/external/bsd/nvi/dist/cl/cl_funcs.c 2017/11/12 15:33:03 1.5
@@ -1,32 +1,32 @@ @@ -1,32 +1,32 @@
1/* $NetBSD: cl_funcs.c,v 1.4 2014/01/26 21:43:45 christos Exp $ */ 1/* $NetBSD: cl_funcs.c,v 1.5 2017/11/12 15:33:03 rin Exp $ */
2/*- 2/*-
3 * Copyright (c) 1993, 1994 3 * Copyright (c) 1993, 1994
4 * The Regents of the University of California. All rights reserved. 4 * The Regents of the University of California. All rights reserved.
5 * Copyright (c) 1993, 1994, 1995, 1996 5 * Copyright (c) 1993, 1994, 1995, 1996
6 * Keith Bostic. All rights reserved. 6 * Keith Bostic. All rights reserved.
7 * 7 *
8 * See the LICENSE file for redistribution information. 8 * See the LICENSE file for redistribution information.
9 */ 9 */
10 10
11#include "config.h" 11#include "config.h"
12 12
13#include <sys/cdefs.h> 13#include <sys/cdefs.h>
14#if 0 14#if 0
15#ifndef lint 15#ifndef lint
16static const char sccsid[] = "Id: cl_funcs.c,v 10.72 2002/03/02 23:18:33 skimo Exp (Berkeley) Date: 2002/03/02 23:18:33 "; 16static const char sccsid[] = "Id: cl_funcs.c,v 10.72 2002/03/02 23:18:33 skimo Exp (Berkeley) Date: 2002/03/02 23:18:33 ";
17#endif /* not lint */ 17#endif /* not lint */
18#else 18#else
19__RCSID("$NetBSD: cl_funcs.c,v 1.4 2014/01/26 21:43:45 christos Exp $"); 19__RCSID("$NetBSD: cl_funcs.c,v 1.5 2017/11/12 15:33:03 rin Exp $");
20#endif 20#endif
21 21
22#include <sys/types.h> 22#include <sys/types.h>
23#include <sys/queue.h> 23#include <sys/queue.h>
24#include <sys/time.h> 24#include <sys/time.h>
25 25
26#include <bitstring.h> 26#include <bitstring.h>
27#include <ctype.h> 27#include <ctype.h>
28#include <signal.h> 28#include <signal.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include <string.h> 31#include <string.h>
32#include <termios.h> 32#include <termios.h>
@@ -490,37 +490,41 @@ cl_insertln(SCR *sp) @@ -490,37 +490,41 @@ cl_insertln(SCR *sp)
490 */ 490 */
491int 491int
492cl_keyval(SCR *sp, scr_keyval_t val, CHAR_T *chp, int *dnep) 492cl_keyval(SCR *sp, scr_keyval_t val, CHAR_T *chp, int *dnep)
493{ 493{
494 CL_PRIVATE *clp; 494 CL_PRIVATE *clp;
495 495
496 /* 496 /*
497 * VEOF, VERASE and VKILL are required by POSIX 1003.1-1990, 497 * VEOF, VERASE and VKILL are required by POSIX 1003.1-1990,
498 * VWERASE is a 4BSD extension. 498 * VWERASE is a 4BSD extension.
499 */ 499 */
500 clp = CLP(sp); 500 clp = CLP(sp);
501 switch (val) { 501 switch (val) {
502 case KEY_VEOF: 502 case KEY_VEOF:
503 *dnep = (*chp = clp->orig.c_cc[VEOF]) == _POSIX_VDISABLE; 503 *dnep =
 504 (*chp = clp->orig.c_cc[VEOF]) == (CHAR_T)_POSIX_VDISABLE;
504 break; 505 break;
505 case KEY_VERASE: 506 case KEY_VERASE:
506 *dnep = (*chp = clp->orig.c_cc[VERASE]) == _POSIX_VDISABLE; 507 *dnep =
 508 (*chp = clp->orig.c_cc[VERASE]) == (CHAR_T)_POSIX_VDISABLE;
507 break; 509 break;
508 case KEY_VKILL: 510 case KEY_VKILL:
509 *dnep = (*chp = clp->orig.c_cc[VKILL]) == _POSIX_VDISABLE; 511 *dnep =
 512 (*chp = clp->orig.c_cc[VKILL]) == (CHAR_T)_POSIX_VDISABLE;
510 break; 513 break;
511#ifdef VWERASE 514#ifdef VWERASE
512 case KEY_VWERASE: 515 case KEY_VWERASE:
513 *dnep = (*chp = clp->orig.c_cc[VWERASE]) == _POSIX_VDISABLE; 516 *dnep =
 517 (*chp = clp->orig.c_cc[VWERASE]) == (CHAR_T)_POSIX_VDISABLE;
514 break; 518 break;
515#endif 519#endif
516 default: 520 default:
517 *dnep = 1; 521 *dnep = 1;
518 break; 522 break;
519 } 523 }
520 return (0); 524 return (0);
521} 525}
522 526
523/* 527/*
524 * cl_move -- 528 * cl_move --
525 * Move the cursor. 529 * Move the cursor.
526 * 530 *