Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses This is a mess; always define MB_LEN_MAX so bo...



details:   https://anonhg.NetBSD.org/src/rev/21c8a02bcf1a
branches:  trunk
changeset: 1022944:21c8a02bcf1a
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Aug 15 12:39:39 2021 +0000

description:
This is a mess; always define MB_LEN_MAX so both the regular and libhack
version of curses compiles. Really we should not be defining MB_LEN_MAX here,
and include <limits.h> in curses_private.h to get it.

diffstat:

 lib/libcurses/curses_private.h |  10 ++++++++--
 lib/libcurses/slk.c            |   5 ++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 506cfb8339f9 -r 21c8a02bcf1a lib/libcurses/curses_private.h
--- a/lib/libcurses/curses_private.h    Sun Aug 15 12:16:02 2021 +0000
+++ b/lib/libcurses/curses_private.h    Sun Aug 15 12:39:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: curses_private.h,v 1.73 2020/03/15 01:12:47 uwe Exp $  */
+/*     $NetBSD: curses_private.h,v 1.74 2021/08/15 12:39:39 christos Exp $     */
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -299,8 +299,14 @@
        bool             slk_hidden;
        struct __slk_label *slk_labels;
 
+/*
+ * XXX: This conflicts with the value in <limits.h> (32)
+ * which should be used here instead of defining a different value,
+ * but I am not changing it because it is also used in the WCOL()
+ * macro and I don't understand the effects of it.
+ */
+#define MB_LEN_MAX 8
 #ifdef HAVE_WCHAR
-#define MB_LEN_MAX 8
 #define MAX_CBUF_SIZE MB_LEN_MAX
        int             cbuf_head;              /* header to cbuf */
        int             cbuf_tail;              /* tail to cbuf */
diff -r 506cfb8339f9 -r 21c8a02bcf1a lib/libcurses/slk.c
--- a/lib/libcurses/slk.c       Sun Aug 15 12:16:02 2021 +0000
+++ b/lib/libcurses/slk.c       Sun Aug 15 12:39:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $        */
+/*     $NetBSD: slk.c,v 1.14 2021/08/15 12:39:39 christos Exp $        */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,13 +31,12 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.13 2021/08/15 11:54:12 christos Exp $");
+__RCSID("$NetBSD: slk.c,v 1.14 2021/08/15 12:39:39 christos Exp $");
 #endif                         /* not lint */
 
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
-#include <limits.h>
 #ifdef HAVE_WCHAR
 #include <wctype.h>
 #endif



Home | Main Index | Thread Index | Old Index