]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.4 - patch 20230527
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 27 May 2023 22:35:09 +0000 (22:35 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 27 May 2023 22:35:09 +0000 (22:35 +0000)
+ fixes for compiler warnings/cppcheck.

36 files changed:
NEWS
VERSION
dist.mk
ncurses/base/lib_mouse.c
ncurses/base/lib_refresh.c
ncurses/curses.priv.h
ncurses/tinfo/alloc_ttype.c
ncurses/tinfo/comp_parse.c
ncurses/tinfo/comp_scan.c
ncurses/tinfo/entries.c
ncurses/tinfo/lib_termcap.c
ncurses/tinfo/strings.c
ncurses/tinfo/write_entry.c
ncurses/trace/visbuf.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec
progs/dump_entry.c
progs/infocmp.c
progs/tabs.c
progs/tic.c
test/bs.c
test/demo_forms.c
test/demo_menus.c
test/demo_termcap.c
test/demo_terminfo.c
test/echochar.c
test/movewindow.c
test/ncurses.c
test/test_addwstr.c
test/test_delwin.c
test/test_sgr.c

diff --git a/NEWS b/NEWS
index 9eeeb5727b7495090cf99dad22cbe750591c75e2..81a433adc7db151b0192f0ef4f29bb4c4ef101c4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3955 2023/05/20 18:39:29 tom Exp $
+-- $Id: NEWS,v 1.3957 2023/05/27 20:09:50 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,9 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20230527
+       + fixes for compiler warnings/cppcheck.
+
 20230520
        + fixes for compiler warnings in MinGW environments.
 
diff --git a/VERSION b/VERSION
index 8a66af02c33fea2ddfede417b1259a338fd2d022..122a064f8ce9fac32fdcd91a5f4da1e06949c066 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.4     20230520
+5:0:10 6.4     20230527
diff --git a/dist.mk b/dist.mk
index 6bfa61d43480e19cef4a6c9cdaa61d282203efb9..82a2f1c552274a25044378f45754d43ac9a076b5 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1545 2023/05/20 14:39:41 tom Exp $
+# $Id: dist.mk,v 1.1546 2023/05/27 09:18:04 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -38,7 +38,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 4
-NCURSES_PATCH = 20230520
+NCURSES_PATCH = 20230527
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 319a276ae5e582396ff84822685efe5e338c9c7b..b35ac75005a6fc4fb3ea4362d07caa06b139222e 100644 (file)
@@ -85,7 +85,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.198 2023/03/25 23:27:28 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.199 2023/05/27 20:13:10 tom Exp $")
 
 #include <tic.h>
 
@@ -776,7 +776,7 @@ _nc_mouse_init(SCREEN *sp)
 {
     bool result = FALSE;
 
-    T((T_CALLED("_nc_mouse_init(%p)"), sp));
+    T((T_CALLED("_nc_mouse_init(%p)"), (void *)sp));
 
     if (sp != 0) {
        if (!sp->_mouse_initialized) {
index 4579cbf81162053c2a8284120e4c85cf2afc9000..bcaa4624b8a938fe6f3f12924a2ae8d3580e9844 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey                                     *
+ * Copyright 2020-2021,2023 Thomas E. Dickey                                *
  * Copyright 1998-2010,2011 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -43,7 +43,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_refresh.c,v 1.47 2021/11/06 22:22:03 tom Exp $")
+MODULE_ID("$Id: lib_refresh.c,v 1.48 2023/05/27 20:13:10 tom Exp $")
 
 NCURSES_EXPORT(int)
 wrefresh(WINDOW *win)
@@ -208,7 +208,6 @@ wnoutrefresh(WINDOW *win)
            });
 
            if_WIDEC({
-               static cchar_t blank = BLANK;
                int last_dst = begx + ((last_src < win->_maxx)
                                       ? last_src
                                       : win->_maxx);
@@ -254,6 +253,7 @@ wnoutrefresh(WINDOW *win)
                 */
                if (fix_left < dst_col || fix_right > last_dst) {
                    for (j = fix_left; j <= fix_right; ++j) {
+                       static cchar_t blank = BLANK;
                        nline->text[j] = blank;
                        CHANGED_CELL(nline, j);
                    }
index 5531c0640468aa689c735838be26cf806e1554b5..2c8729949280f7c163cd038e2629e7bab091e641 100644 (file)
@@ -35,7 +35,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.666 2023/05/20 18:20:39 tom Exp $
+ * $Id: curses.priv.h,v 1.667 2023/05/27 20:13:10 tom Exp $
  *
  *     curses.priv.h
  *
@@ -2080,7 +2080,7 @@ typedef struct {
 /* strings.c */
 extern NCURSES_EXPORT(string_desc *) _nc_str_init (string_desc *, char *, size_t);
 extern NCURSES_EXPORT(string_desc *) _nc_str_null (string_desc *, size_t);
-extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc *, string_desc *);
+extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc *, const string_desc *);
 extern NCURSES_EXPORT(bool) _nc_safe_strcat (string_desc *, const char *);
 extern NCURSES_EXPORT(bool) _nc_safe_strcpy (string_desc *, const char *);
 
@@ -2121,7 +2121,7 @@ extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE2
 extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE2 *);
 extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, int, int);
 extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *));
-extern NCURSES_EXPORT(int) _nc_trans_string (char *, char *);
+extern NCURSES_EXPORT(int) _nc_trans_string (char *, const char *);
 extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE2 *const);
 extern NCURSES_EXPORT(void) _nc_do_color (int, int, int, NCURSES_OUTC);
 extern NCURSES_EXPORT(void) _nc_flush (void);
@@ -2170,7 +2170,7 @@ extern NCURSES_EXPORT(void) _nc_comp_userdefs_leaks(void);
 extern NCURSES_EXPORT(void) _nc_db_iterator_leaks(void);
 extern NCURSES_EXPORT(void) _nc_keyname_leaks(void);
 extern NCURSES_EXPORT(void) _nc_names_leaks(void);
-extern NCURSES_EXPORT(void) _nc_tgetent_leak(TERMINAL *);
+extern NCURSES_EXPORT(void) _nc_tgetent_leak(const TERMINAL *);
 extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);
 #endif
 
index 36085e474f5cdb0351bd1b2af0057e39a3fad256..ff32770d032db1b7b103eaf3ee6f70f1d8e3e737 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: alloc_ttype.c,v 1.48 2023/04/22 15:50:28 tom Exp $")
+MODULE_ID("$Id: alloc_ttype.c,v 1.49 2023/05/27 20:13:10 tom Exp $")
 
 #if NCURSES_XNAMES
 /*
@@ -378,8 +378,8 @@ adjust_cancels(TERMTYPE2 *to, TERMTYPE2 *from)
     int j, k;
 
     DEBUG(3, (T_CALLED("adjust_cancels(%s), from(%s)"),
-             to ? NonNull(to->term_names) : "?",
-             from ? NonNull(from->term_names) : "?"));
+             NonNull(to->term_names),
+             NonNull(from->term_names)));
     for (j = first; j < last;) {
        char *name = to->ext_Names[j];
        int j_str = to->num_Strings - first - to->ext_Strings;
index 74fba109d7c7bf5c2377d474b455153bf48abfd9..4244df4efed8f84a2c7d4c79a0b8245069387a80 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: comp_parse.c,v 1.132 2023/05/20 18:08:48 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.133 2023/05/27 20:13:10 tom Exp $")
 
 static void sanity_check2(TERMTYPE2 *, bool);
 NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
@@ -264,8 +264,9 @@ _nc_read_entry_source(FILE *fp, char *buf,
 
     if (_nc_tail) {
        /* set up the head pointer */
-       for (_nc_head = _nc_tail; _nc_head->last; _nc_head = _nc_head->last)
-           continue;
+       for (_nc_head = _nc_tail; _nc_head->last; _nc_head = _nc_head->last) {
+           /* EMPTY */ ;
+       }
 
        DEBUG(2, ("head = %s", _nc_head->tterm.term_names));
        DEBUG(2, ("tail = %s", _nc_tail->tterm.term_names));
index c4b077de0046fa72e721e3ca4f415fa51a7bcdb2..3ba0835e2fb807aed6d27d6e9a2625c909d76f55 100644 (file)
@@ -51,7 +51,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: comp_scan.c,v 1.121 2023/05/20 18:33:33 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.122 2023/05/27 20:13:10 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -328,9 +328,11 @@ end_of_stream(void)
 static NCURSES_INLINE int
 eat_escaped_newline(int ch)
 {
-    if (ch == '\\')
-       while ((ch = next_char()) == '\n' || iswhite(ch))
-           continue;
+    if (ch == '\\') {
+       while ((ch = next_char()) == '\n' || iswhite(ch)) {
+           /* EMPTY */ ;
+       }
+    }
     return ch;
 }
 
@@ -434,7 +436,6 @@ _nc_get_token(bool silent)
     while ((ch = next_char()) == '\n' || iswhite(ch)) {
        if (ch == '\n')
            had_newline = TRUE;
-       continue;
     }
 
     ch = eat_escaped_newline(ch);
@@ -459,8 +460,9 @@ _nc_get_token(bool silent)
            dot_flag = TRUE;
            DEBUG(8, ("dot-flag set"));
 
-           while ((ch = next_char()) == '.' || iswhite(ch))
-               continue;
+           while ((ch = next_char()) == '.' || iswhite(ch)) {
+               /* EMPTY */ ;
+           }
        }
 
        if (ch == EOF) {
@@ -601,8 +603,9 @@ _nc_get_token(bool silent)
                /* throw away trailing /, *$/ */
                for (--tok_ptr;
                     iswhite(*tok_ptr) || *tok_ptr == ',';
-                    tok_ptr--)
-                   continue;
+                    tok_ptr--) {
+                   /* EMPTY */ ;
+               }
                tok_ptr[1] = '\0';
            }
 
@@ -831,7 +834,7 @@ _nc_get_token(bool silent)
  */
 
 NCURSES_EXPORT(int)
-_nc_trans_string(char *ptr, char *last)
+_nc_trans_string(char *ptr, const char *const last)
 {
     int count = 0;
     int number = 0;
index 8c5e10c00e705a631136a95315a238306279506c..f47fd3fe9eff7d6ef0a4e7b84256374310bf8b54 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019-2021,2022 Thomas E. Dickey                                *
+ * Copyright 2019-2022,2023 Thomas E. Dickey                                *
  * Copyright 2006-2012,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: entries.c,v 1.34 2022/08/13 16:57:35 tom Exp $")
+MODULE_ID("$Id: entries.c,v 1.35 2023/05/27 20:13:10 tom Exp $")
 
 /****************************************************************************
  *
@@ -65,7 +65,7 @@ NCURSES_EXPORT_VAR(ENTRY *) _nc_head = 0;
 NCURSES_EXPORT_VAR(ENTRY *) _nc_tail = 0;
 
 static ENTRY *
-_nc_delink_entry(ENTRY * headp, TERMTYPE2 *tterm)
+_nc_delink_entry(ENTRY * headp, const TERMTYPE2 *const tterm)
 /* delink the allocated storage for the given list entry */
 {
     ENTRY *ep, *last;
index 5ce43a3c48908f1d2a9a21d210059ae1f3d01be6..2ece985914e982f6e0db11bf52a775707cfa6340 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey                                     *
+ * Copyright 2018-2020,2023 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -49,7 +49,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_termcap.c,v 1.88 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_termcap.c,v 1.89 2023/05/27 20:13:10 tom Exp $")
 
 NCURSES_EXPORT_VAR(char *) UP = 0;
 NCURSES_EXPORT_VAR(char *) BC = 0;
@@ -399,7 +399,7 @@ tgetstr(const char *id, char **area)
 #undef CacheInx
 #define CacheInx num
 NCURSES_EXPORT(void)
-_nc_tgetent_leak(TERMINAL *termp)
+_nc_tgetent_leak(const TERMINAL *const termp)
 {
     if (termp != 0) {
        int num;
index a1d8beb63f31e6db47f6e6c6b58df25588b93acc..03f59c24e9adb7346f27bc614d105b381dd8c458 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2023 Thomas E. Dickey                                     *
  * Copyright 2000-2012,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 #include <curses.priv.h>
 #include <tic.h>
 
-MODULE_ID("$Id: strings.c,v 1.10 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: strings.c,v 1.11 2023/05/27 20:13:10 tom Exp $")
 
 /****************************************************************************
  * Useful string functions (especially for mvcur)
@@ -95,7 +95,7 @@ _nc_str_null(string_desc * dst, size_t len)
  * Copy a descriptor
  */
 NCURSES_EXPORT(string_desc *)
-_nc_str_copy(string_desc * dst, string_desc * src)
+_nc_str_copy(string_desc * dst, const string_desc * const src)
 {
     *dst = *src;
     return dst;
index 156ce7442eb26b90b9ed28a3026c4951a4ddd6e3..9de7336462dc1c0581b38c1c1e534875fc12be32 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: write_entry.c,v 1.126 2023/04/29 20:30:57 tom Exp $")
+MODULE_ID("$Id: write_entry.c,v 1.127 2023/05/27 20:13:10 tom Exp $")
 
 #if 1
 #define TRACE_OUT(p) DEBUG(2, p)
@@ -128,18 +128,16 @@ check_writeable(int code)
     char dir[sizeof(LEAF_FMT)];
     char *s = 0;
 
-    if (code == 0 || (s = (strchr) (dirnames, code)) == 0)
+    if (code == 0 || (s = (strchr) (dirnames, code)) == 0) {
        _nc_err_abort("Illegal terminfo subdirectory \"" LEAF_FMT "\"", code);
-
-    if (verified[s - dirnames])
-       return;
-
-    _nc_SPRINTF(dir, _nc_SLIMIT(sizeof(dir)) LEAF_FMT, code);
-    if (make_db_root(dir) < 0) {
-       _nc_err_abort("%s/%s: permission denied", _nc_tic_dir(0), dir);
+    } else if (!verified[s - dirnames]) {
+       _nc_SPRINTF(dir, _nc_SLIMIT(sizeof(dir)) LEAF_FMT, code);
+       if (make_db_root(dir) < 0) {
+           _nc_err_abort("%s/%s: permission denied", _nc_tic_dir(0), dir);
+       } else {
+           verified[s - dirnames] = TRUE;
+       }
     }
-
-    verified[s - dirnames] = TRUE;
 }
 #endif /* !USE_HASHED_DB */
 
@@ -333,8 +331,9 @@ _nc_write_entry(TERMTYPE2 *const tp)
     if (ptr != name_list) {
        *ptr = '\0';
 
-       for (ptr = name_list; *ptr != '\0' && *ptr != '|'; ptr++)
-           continue;
+       for (ptr = name_list; *ptr != '\0' && *ptr != '|'; ptr++) {
+           /* EMPTY */ ;
+       }
 
        if (*ptr == '\0')
            other_names = ptr;
index aca8affc4fa1b11a27dbcb37873b6e3f1e4bd83d..590e42306f5163acfceb0c0baa2959006b309520 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2019-2021,2023 Thomas E. Dickey                                *
  * Copyright 2001-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -43,7 +43,7 @@
 #include <tic.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: visbuf.c,v 1.53 2021/02/27 20:07:57 tom Exp $")
+MODULE_ID("$Id: visbuf.c,v 1.54 2023/05/27 20:13:10 tom Exp $")
 
 #define NUM_VISBUFS 4
 
@@ -67,7 +67,9 @@ static const char r_brace[] = StringOf(R_BRACE);
 static char *
 _nc_vischar(char *tp, unsigned c LIMIT_ARG)
 {
-    if (c == '"' || c == '\\') {
+    if (tp == NULL) {
+       return NULL;
+    } else if (c == '"' || c == '\\') {
        *tp++ = '\\';
        *tp++ = (char) c;
     } else if (is7bits((int) c) && (isgraph((int) c) || c == ' ')) {
index 8714f5544a0cdadc46d93a571cfd0a511740436e..6c037cd77c93bcb3953ba56dc245a59c32c6aef9 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.4+20230520) unstable; urgency=low
+ncurses6 (6.4+20230527) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 20 May 2023 10:39:41 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 27 May 2023 05:18:04 -0400
 
 ncurses6 (5.9+20131005) unstable; urgency=low
 
index 8714f5544a0cdadc46d93a571cfd0a511740436e..6c037cd77c93bcb3953ba56dc245a59c32c6aef9 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.4+20230520) unstable; urgency=low
+ncurses6 (6.4+20230527) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 20 May 2023 10:39:41 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 27 May 2023 05:18:04 -0400
 
 ncurses6 (5.9+20131005) unstable; urgency=low
 
index 6ac66463577512e3c1f758e737730c69ae133225..cbf3ddf781fdc7b5a2c69dd7601a474647455766 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.4+20230520) unstable; urgency=low
+ncurses6 (6.4+20230527) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 20 May 2023 10:39:41 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 27 May 2023 05:18:04 -0400
 
 ncurses6 (5.9+20120608) unstable; urgency=low
 
index 1ecb27bf25beeb86fa76a915d27dacc2c65b67fc..75cc1d876d9b33c52b7fa3e0f4bc629d4da7b07b 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.585 2023/05/20 14:39:41 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.586 2023/05/27 09:18:04 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "4"\r
 !define VERSION_YYYY  "2023"\r
-!define VERSION_MMDD  "0520"\r
+!define VERSION_MMDD  "0527"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index ae1fe3186446435f82a85cbb48a792af1839f42c..edf5918357d339080b454164d489099693740733 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.4
-Release: 20230520
+Release: 20230527
 License: X11
 Group: Development/Libraries
 URL: https://invisible-island.net/ncurses/
index 7ad1c6baf8c4e307bf95667cc338edd5e56a6e51..f4b2e559a6cd4ae804aa260bdfc7c924a318da41 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.4
-Release: 20230520
+Release: 20230527
 License: X11
 Group: Development/Libraries
 URL: https://invisible-island.net/ncurses/
index 13baeff8609de9f3192ff8bce2ea89cc97b936e3..b218ea6b2c5f9b6a0e99fb171da712f25889f7c4 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.4
-Release: 20230520
+Release: 20230527
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index aad715b9c8d0a1362d401c5d2cbfd47bebfdd202..be332d2e7765c28cd4082329bff1620c19dfd704 100644 (file)
@@ -40,7 +40,7 @@
 #include <termsort.h>          /* this C file is generated */
 #include <parametrized.h>      /* so is this */
 
-MODULE_ID("$Id: dump_entry.c,v 1.195 2023/01/21 21:25:21 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.196 2023/05/27 20:13:10 tom Exp $")
 
 #define DISCARD(string) string = ABSENT_STRING
 #define PRINTF (void) printf
@@ -1311,7 +1311,7 @@ fmt_entry(TERMTYPE2 *tterm,
 }
 
 static bool
-kill_string(TERMTYPE2 *tterm, char *cap)
+kill_string(TERMTYPE2 *tterm, const char *const cap)
 {
     unsigned n;
     for (n = 0; n < NUM_STRINGS(tterm); ++n) {
@@ -1693,7 +1693,7 @@ show_entry(void)
                outbuf.used = (size_t) j;
            } else if (!infodump && ch == '\\') {
                outbuf.used = (size_t) j;
-           } else if (ch == delim && (j == 0 || outbuf.text[j - 1] != '\\')) {
+           } else if (ch == delim && (outbuf.text[j - 1] != '\\')) {
                outbuf.used = (size_t) (j + 1);
            } else {
                break;
index 171d794dc21902a1610c3f860e24b53484d6cec2..ec5e07650dd43e1bf766e3e164e8d0a0ba77b1ed 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020-2021,2022 Thomas E. Dickey                                *
+ * Copyright 2020-2022,2023 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -43,7 +43,7 @@
 
 #include <dump_entry.h>
 
-MODULE_ID("$Id: infocmp.c,v 1.156 2022/09/24 10:13:06 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.157 2023/05/27 20:13:10 tom Exp $")
 
 #define MAX_STRING     1024    /* maximum formatted string */
 
@@ -158,7 +158,7 @@ no_numeric(int value)
 }
 
 static bool
-no_string(char *value)
+no_string(const char *const value)
 {
     bool result = (value == ABSENT_STRING);
     if (!strcmp(s_absent, s_cancel))
index 7378d116f70c8f48c90df1357a6aa49f036bd771..c852eb858f5c80d97db25c996f24369250c95acf 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020-2021,2022 Thomas E. Dickey                                *
+ * Copyright 2020-2022,2023 Thomas E. Dickey                                *
  * Copyright 2008-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -39,7 +39,7 @@
 #include <progs.priv.h>
 #include <tty_settings.h>
 
-MODULE_ID("$Id: tabs.c,v 1.51 2022/02/26 22:44:44 tom Exp $")
+MODULE_ID("$Id: tabs.c,v 1.52 2023/05/27 20:13:10 tom Exp $")
 
 static GCC_NORETURN void usage(void);
 
@@ -183,7 +183,7 @@ decode_tabs(const char *tab_list, int margin)
 }
 
 static void
-print_ruler(int *tab_list, const char *new_line)
+print_ruler(const int *const tab_list, const char *new_line)
 {
     int last = 0;
     int n;
@@ -649,7 +649,7 @@ main(int argc, char *argv[])
            /* set tty modes to -ocrnl to allow \r */
            if (isatty(STDOUT_FILENO)) {
                TTY new_settings = tty_settings;
-               new_settings.c_oflag &= (unsigned)~OCRNL;
+               new_settings.c_oflag &= (unsigned) ~OCRNL;
                update_tty_settings(&tty_settings, &new_settings);
                change_tty = TRUE;
                new_line = "\r\n";
index 7ae616777db9ec89ac07b238eb9db7ccc5fb81ee..d8052648feb4ce4f9f8946a7184e85b208ea57ed 100644 (file)
@@ -49,7 +49,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.321 2023/04/08 15:51:57 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.322 2023/05/27 20:13:10 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -1169,6 +1169,7 @@ check_acs(TERMTYPE2 *tp)
        char *q;
 
        memset(mapped, 0, sizeof(mapped));
+       memset(missing, 0, sizeof(missing));
        for (p = acs_chars; *p != '\0'; p += 2) {
            if (p[1] == '\0') {
                _nc_warning("acsc has odd number of characters");
@@ -1350,8 +1351,7 @@ check_ansi_cursor(char *list[4])
     for (j = 0; j < 4; ++j) {
        skip[j] = FALSE;
        for (k = 0; k < j; ++k) {
-           if (j != k
-               && !strcmp(list[j], list[k])) {
+           if (!strcmp(list[j], list[k])) {
                char *value = _nc_tic_expand(list[k], TRUE, 0);
                _nc_warning("repeated cursor control %s", value);
                repeated = TRUE;
@@ -2440,60 +2440,63 @@ static void
 check_infotocap(TERMTYPE2 *tp, int i, const char *value)
 {
     const char *name = ExtStrname(tp, i, strnames);
-    int params = ((i < (int) SIZEOF(parametrized))
-                 ? parametrized[i]
-                 : ((*value == 'k')
-                    ? 0
-                    : has_params(value, FALSE)));
     char *ti_value = NULL;
-    char *tc_value;
-    bool embedded;
 
     assert(SIZEOF(parametrized) == STRCOUNT);
     if (!VALID_STRING(value) || (ti_value = strdup(value)) == NULL) {
        _nc_warning("tic-expansion of %s failed", name);
-    } else if ((tc_value = _nc_infotocap(name, ti_value, params)) == ABSENT_STRING) {
-       _nc_warning("tic-conversion of %s failed", name);
-    } else if (params > 0) {
-       int limit = 5;
-       int count;
-       bool first = TRUE;
-
-       if (!strcmp(name, "setf")
-           || !strcmp(name, "setb")
-           || !strcmp(name, "setaf")
-           || !strcmp(name, "setab")) {
-           if ((limit = max_colors) > 256)
-               limit = 256;
-       }
-       for (count = 0; count < limit; ++count) {
-           char *ti_check = check_1_infotocap(name, ti_value, count);
-           char *tc_check = check_1_infotocap(name, tc_value, count);
-
-           if (strcmp(ti_check, tc_check)) {
-               if (first) {
-                   fprintf(stderr, "check_infotocap(%s)\n", name);
-                   fprintf(stderr, "...ti '%s'\n", _nc_visbuf2(0, ti_value));
-                   fprintf(stderr, "...tc '%s'\n", _nc_visbuf2(0, tc_value));
-                   first = FALSE;
+    } else {
+       char *tc_value;
+       bool embedded;
+       int params = ((i < (int) SIZEOF(parametrized))
+                     ? parametrized[i]
+                     : ((*value == 'k')
+                        ? 0
+                        : has_params(value, FALSE)));
+
+       if ((tc_value = _nc_infotocap(name, ti_value, params)) == ABSENT_STRING) {
+           _nc_warning("tic-conversion of %s failed", name);
+       } else if (params > 0) {
+           int limit = 5;
+           int count;
+           bool first = TRUE;
+
+           if (!strcmp(name, "setf")
+               || !strcmp(name, "setb")
+               || !strcmp(name, "setaf")
+               || !strcmp(name, "setab")) {
+               if ((limit = max_colors) > 256)
+                   limit = 256;
+           }
+           for (count = 0; count < limit; ++count) {
+               char *ti_check = check_1_infotocap(name, ti_value, count);
+               char *tc_check = check_1_infotocap(name, tc_value, count);
+
+               if (strcmp(ti_check, tc_check)) {
+                   if (first) {
+                       fprintf(stderr, "check_infotocap(%s)\n", name);
+                       fprintf(stderr, "...ti '%s'\n", _nc_visbuf2(0, ti_value));
+                       fprintf(stderr, "...tc '%s'\n", _nc_visbuf2(0, tc_value));
+                       first = FALSE;
+                   }
+                   _nc_warning("tparm-conversion of %s(%d) differs between\n\tterminfo %s\n\ttermcap  %s",
+                               name, count,
+                               _nc_visbuf2(0, ti_check),
+                               _nc_visbuf2(1, tc_check));
                }
-               _nc_warning("tparm-conversion of %s(%d) differs between\n\tterminfo %s\n\ttermcap  %s",
-                           name, count,
-                           _nc_visbuf2(0, ti_check),
-                           _nc_visbuf2(1, tc_check));
+               free(ti_check);
+               free(tc_check);
+           }
+       } else if (params == 0 && !same_ti_tc(ti_value, tc_value, &embedded)) {
+           if (embedded) {
+               _nc_warning("termcap equivalent of %s cannot use embedded delay", name);
+           } else {
+               _nc_warning("tic-conversion of %s changed value\n\tfrom %s\n\tto   %s",
+                           name, ti_value, tc_value);
            }
-           free(ti_check);
-           free(tc_check);
-       }
-    } else if (params == 0 && !same_ti_tc(ti_value, tc_value, &embedded)) {
-       if (embedded) {
-           _nc_warning("termcap equivalent of %s cannot use embedded delay", name);
-       } else {
-           _nc_warning("tic-conversion of %s changed value\n\tfrom %s\n\tto   %s",
-                       name, ti_value, tc_value);
        }
+       free(ti_value);
     }
-    free(ti_value);
 }
 
 static char *
index 3e77331710d46ce4bee78982b4fafd79f50baf2e..c7569cf207fd6a9c79de9814b03642f493464c8a 100644 (file)
--- a/test/bs.c
+++ b/test/bs.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey                                *
+ * Copyright 2018-2022,2023 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
  * v2.0 featuring strict ANSI/POSIX conformance, November 1993.
  * v2.1 with ncurses mouse support, September 1995
  *
- * $Id: bs.c,v 1.78 2022/12/11 00:18:37 tom Exp $
+ * $Id: bs.c,v 1.79 2023/05/27 20:13:10 tom Exp $
  */
 
 #include <test.priv.h>
@@ -898,8 +898,9 @@ sgetc(const char *s)
            ch = toupper(ch);
        if (is_QUIT(ch))
            uninitgame(0);
-       for (s1 = s; *s1 && ch != *s1; ++s1)
-           continue;
+       for (s1 = s; *s1 && ch != *s1; ++s1) {
+           /* EMPTY */ ;
+       }
        if (*s1) {
            AddCh(ch);
            (void) refresh();
@@ -1270,8 +1271,9 @@ main(int argc, char *argv[])
                    }
                }
            } else
-               while ((turn ? cputurn() : plyturn()) && awinna() == -1)
-                   continue;
+               while ((turn ? cputurn() : plyturn()) && awinna() == -1) {
+                   /* EMPTY */ ;
+               }
            turn = OTHER;
        }
     } while
index 8e831255822b58aac3f0a9e7200855b188a5337b..61c4cc7200a68a5210e5795fe221ed2fc5ffd8bc 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2020,2022 Thomas E. Dickey                                *
+ * Copyright 2018-2022,2023 Thomas E. Dickey                                *
  * Copyright 2003-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_forms.c,v 1.61 2022/12/04 00:40:11 tom Exp $
+ * $Id: demo_forms.c,v 1.62 2023/05/27 20:13:10 tom Exp $
  *
  * Demonstrate a variety of functions from the form library.
  * Thomas Dickey - 2003/4/26
@@ -242,7 +242,7 @@ show_insert_mode(bool insert_mode)
 #define O_SELECTABLE (O_ACTIVE | O_VISIBLE)
 
 static FIELD *
-another_field(FORM *form, FIELD *field)
+another_field(FORM *form, const FIELD *const field)
 {
     FIELD **f = form_fields(form);
     FIELD *result = 0;
index ab3880cb64f196c17c0f32de9768bb0a0fdc9ba6..7b0bf30316e558f6aa6b88559feb6b3e092b1548 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019-2021,2022 Thomas E. Dickey                                *
+ * Copyright 2019-2022,2023 Thomas E. Dickey                                *
  * Copyright 2003-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_menus.c,v 1.79 2022/12/04 00:40:11 tom Exp $
+ * $Id: demo_menus.c,v 1.80 2023/05/27 20:13:10 tom Exp $
  *
  * Demonstrate a variety of functions from the menu library.
  * Thomas Dickey - 2005/4/9
@@ -925,7 +925,6 @@ perform_menus(void)
        }
        if (code == E_REQUEST_DENIED)
            beep();
-       continue;
     }
 }
 
index 468bd976da83e49503ca3fd6480b00da287b0a18..6e2aba7006798265886ac215f5642da343b72107 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019-2021,2022 Thomas E. Dickey                                *
+ * Copyright 2019-2022,2023 Thomas E. Dickey                                *
  * Copyright 2005-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -30,7 +30,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_termcap.c,v 1.64 2022/12/10 23:22:09 tom Exp $
+ * $Id: demo_termcap.c,v 1.65 2023/05/27 20:13:10 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
@@ -105,7 +105,7 @@ static long total_s_values;
 #define EachCapName(n) n = 33; n < 127; ++n
 
 static char *
-make_dbitem(char *p, char *q)
+make_dbitem(const char *const p, const char *const q)
 {
     size_t need = strlen(e_opt) + 2 + (size_t) (p - q);
     char *result = malloc(need);
@@ -404,7 +404,8 @@ typedef enum {
 static void
 parse_description(const char *input_name)
 {
-    static char empty[1];
+    static char empty[1] =
+    {0};
 
     FILE *fp;
     struct stat sb;
@@ -437,11 +438,13 @@ parse_description(const char *input_name)
        failed("cannot allocate memory for input-file");
     }
 
-    if ((fp = fopen(input_name, "r")) == 0)
+    if ((fp = fopen(input_name, "r")) == 0) {
        failed("cannot open input-file");
-    len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
-    my_blob[sb.st_size] = '\0';
-    fclose(fp);
+    } else {
+       len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
+       my_blob[sb.st_size] = '\0';
+       fclose(fp);
+    }
 
     /*
      * First, get rid of comments and escaped newlines, as well as repeated
index 1b2d426ca718c1d0cbf04f7f3b1f4e61b3120655..5e78015c36e0d45709a2fcda7fbc8546e57434c0 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019-2021,2022 Thomas E. Dickey                                *
+ * Copyright 2019-2022,2023 Thomas E. Dickey                                *
  * Copyright 2009-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -30,7 +30,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_terminfo.c,v 1.56 2022/12/10 23:22:09 tom Exp $
+ * $Id: demo_terminfo.c,v 1.57 2023/05/27 20:13:10 tom Exp $
  *
  * A simple demo of the terminfo interface.
  */
@@ -96,7 +96,7 @@ static long total_s_values;
 #define FNAME(type) "%s %-*s = ", #type, f_opt ? 24 : FCOLS
 
 static char *
-make_dbitem(char *p, char *q)
+make_dbitem(const char *const p, const char *const q)
 {
     size_t need = strlen(e_opt) + 2 + (size_t) (p - q);
     char *result = malloc(need);
@@ -430,7 +430,8 @@ typedef enum {
 static void
 parse_description(const char *input_name)
 {
-    static char empty[1];
+    static char empty[1] =
+    {0};
 
     FILE *fp;
     struct stat sb;
@@ -463,11 +464,13 @@ parse_description(const char *input_name)
        failed("cannot allocate memory for input-file");
     }
 
-    if ((fp = fopen(input_name, "r")) == 0)
+    if ((fp = fopen(input_name, "r")) == 0) {
        failed("cannot open input-file");
-    len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
-    my_blob[sb.st_size] = '\0';
-    fclose(fp);
+    } else {
+       len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
+       my_blob[sb.st_size] = '\0';
+       fclose(fp);
+    }
 
     /*
      * First, get rid of comments and escaped newlines, as well as repeated
index 1d9815744b73f28e53621dc64ba9e62763d05dc3..08497069419a50c0b5923f0a87079a8c45794c4a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019-2020,2022 Thomas E. Dickey                                *
+ * Copyright 2019-2022,2023 Thomas E. Dickey                                *
  * Copyright 2006-2014,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: echochar.c,v 1.25 2022/12/10 22:28:50 tom Exp $
+ * $Id: echochar.c,v 1.26 2023/05/27 20:13:10 tom Exp $
  *
  * Demonstrate the echochar function (compare to dots.c).
  * Thomas Dickey - 2006/11/4
@@ -65,7 +65,7 @@ ranf(void)
 }
 
 static void
-set_color(char *my_pairs, int fg, int bg)
+set_color(const char *const my_pairs, int fg, int bg)
 {
     int pair = (fg * COLORS) + bg;
     if (pair < COLOR_PAIRS) {
index 7fe7329f967cf5aeb3fd095cea929bb3bcfaaf10..07797ca67b9ef7ce3937c770d96f42dd9f277f82 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey                                *
+ * Copyright 2018-2022,2023 Thomas E. Dickey                                *
  * Copyright 2006-2013,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: movewindow.c,v 1.53 2022/12/10 23:31:31 tom Exp $
+ * $Id: movewindow.c,v 1.54 2023/05/27 20:13:10 tom Exp $
  *
  * Demonstrate move functions for windows and derived windows from the curses
  * library.
@@ -324,6 +324,7 @@ add_window(WINDOW *parent, WINDOW *child)
        all_windows = typeRealloc(FRAME, need, all_windows);
        if (!all_windows)
            failed("add_window");
+       have = need;
     }
     all_windows[num_windows].parent = parent;
     all_windows[num_windows].child = child;
@@ -331,7 +332,7 @@ add_window(WINDOW *parent, WINDOW *child)
 }
 
 static int
-window2num(WINDOW *win)
+window2num(const WINDOW *const win)
 {
     int n;
     int result = -1;
@@ -407,7 +408,7 @@ prev_window(WINDOW *win)
 }
 
 static void
-recur_move_window(WINDOW *parent, int dy, int dx)
+recur_move_window(const WINDOW *const parent, int dy, int dx)
 {
     unsigned n;
 
index fed8b9bef27810bd023c2f2d0a114dec7978ecce..a402c4c51fffb53f8bdf462adad9e3507fd14d8d 100644 (file)
@@ -41,7 +41,7 @@ AUTHOR
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
            Thomas E. Dickey (beginning revision 1.27 in 1996).
 
-$Id: ncurses.c,v 1.534 2023/02/25 19:30:27 tom Exp $
+$Id: ncurses.c,v 1.535 2023/05/27 20:13:10 tom Exp $
 
 ***************************************************************************/
 
@@ -770,7 +770,7 @@ slk_repaint(void)
  * Resize both and paint the box in the parent.
  */
 static void
-resize_boxes(unsigned level, WINDOW *win)
+resize_boxes(unsigned level, const WINDOW *const win)
 {
     unsigned n;
     int base = 5;
@@ -1012,7 +1012,7 @@ getch_test(bool recur GCC_UNUSED)
  */
 #if defined(KEY_RESIZE) && HAVE_WRESIZE
 static void
-resize_wide_boxes(unsigned level, WINDOW *win)
+resize_wide_boxes(unsigned level, const WINDOW *const win)
 {
     unsigned n;
     int base = 5;
@@ -6161,7 +6161,6 @@ menu_test(bool recur GCC_UNUSED)
            break;
        if (c == E_REQUEST_DENIED)
            beep();
-       continue;
     }
 
     MvPrintw(LINES - 2, 0,
@@ -6329,8 +6328,9 @@ trace_set(bool recur GCC_UNUSED)
            set_item_value(*ip, TRUE);
     }
 
-    while (run_trace_menu(m))
-       continue;
+    while (run_trace_menu(m)) {
+       /* EMPTY */ ;
+    }
 
     newtrace = 0;
     for (ip = menu_items(m); *ip; ip++)
index aa7bf85746aeb1e6a85ecadb501be277b4ce5ad9..9e51f49df1490172fb174508c81772710f3dc061 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020,2022 Thomas E. Dickey                                     *
+ * Copyright 2020-2022,2023 Thomas E. Dickey                                *
  * Copyright 2009-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_addwstr.c,v 1.21 2022/12/10 22:28:50 tom Exp $
+ * $Id: test_addwstr.c,v 1.22 2023/05/27 20:13:10 tom Exp $
  *
  * Demonstrate the waddwstr() and wadd_wch functions.
  * Thomas Dickey - 2009/9/12
@@ -114,7 +114,7 @@ legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length)
 }
 
 static int
-ColOf(wchar_t *buffer, int length, int margin)
+ColOf(const wchar_t *const buffer, int length, int margin)
 {
     int n;
     int result;
index 7a8742518dca194c955653de414a5fae3b303aff..09ef5c538e4e2103157354ece6cb358541fd02c2 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2022 Thomas E. Dickey                                          *
+ * Copyright 2022,2023 Thomas E. Dickey                                     *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -27,7 +27,7 @@
  ****************************************************************************/
 
 /*
- * $Id: test_delwin.c,v 1.4 2022/12/10 22:14:07 tom Exp $
+ * $Id: test_delwin.c,v 1.5 2023/05/27 20:34:51 tom Exp $
  */
 #include <test.priv.h>
 
@@ -123,7 +123,7 @@ main(int argc, char **argv)
 
     show_rc("Deleted parent",
            "should fail, it still has a subwindow",
-           rc = delwin(parent));
+           delwin(parent));
     next_step(stdscr);
     show_rc("Deleted child1",
            "should succeed",
index dbd1caf17504d4712a86e1c7a77b87e6d870ced4..8763dca3cd34156f91addef70624f4bfc154dd2a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019-2021,2022 Thomas E. Dickey                                *
+ * Copyright 2019-2022,2023 Thomas E. Dickey                                *
  * Copyright 2015-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -30,7 +30,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: test_sgr.c,v 1.21 2022/12/10 23:23:27 tom Exp $
+ * $Id: test_sgr.c,v 1.22 2023/05/27 20:13:10 tom Exp $
  *
  * A simple demo of the sgr/sgr0 terminal capabilities.
  */
@@ -61,7 +61,7 @@ static int db_item;
 static long total_values;
 
 static char *
-make_dbitem(char *p, char *q)
+make_dbitem(const char *const p, const char *const q)
 {
     size_t need = strlen(e_opt) + 2 + (size_t) (p - q);
     char *result = malloc(need);