]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.2 - patch 20210327
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 28 Mar 2021 00:52:50 +0000 (00:52 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 28 Mar 2021 00:52:50 +0000 (00:52 +0000)
+ build-fixes for Solaris10 /bin/sh
+ fix some cppcheck warnings, mostly style, in ncurses test-programs,
  form and menu libraries.

61 files changed:
NEWS
VERSION
dist.mk
doc/html/man/adacurses6-config.1.html
doc/html/man/captoinfo.1m.html
doc/html/man/clear.1.html
doc/html/man/curs_extend.3x.html
doc/html/man/curs_terminfo.3x.html
doc/html/man/form.3x.html
doc/html/man/infocmp.1m.html
doc/html/man/infotocap.1m.html
doc/html/man/menu.3x.html
doc/html/man/ncurses.3x.html
doc/html/man/ncurses6-config.1.html
doc/html/man/panel.3x.html
doc/html/man/tabs.1.html
doc/html/man/terminfo.5.html
doc/html/man/tic.1m.html
doc/html/man/toe.1m.html
doc/html/man/tput.1.html
doc/html/man/tset.1.html
form/fld_def.c
form/frm_data.c
form/frm_def.c
form/frm_driver.c
form/frm_req_name.c
form/fty_enum.c
form/fty_generic.c
form/fty_int.c
form/fty_ipv4.c
form/fty_num.c
menu/m_cursor.c
menu/m_driver.c
menu/m_format.c
menu/m_global.c
menu/m_item_top.c
menu/m_item_val.c
menu/m_post.c
menu/m_req_name.c
misc/Makefile.in
misc/gen-pkgconfig.in
misc/ncurses-config.in
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
test/dup_field.c
test/list_keys.c
test/move_field.c
test/picsmap.c
test/redraw.c
test/savescreen.c
test/test_add_wchstr.c
test/test_sgr.c
test/testcurs.c
test/view.c
test/xmas.c

diff --git a/NEWS b/NEWS
index be1fdd8d3f02f33bec79ae7fe031f141733572f5..b754d3e6ea61125c69fa046ffe9416d5b42b237e 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.3645 2021/03/23 00:12:19 tom Exp $
+-- $Id: NEWS,v 1.3647 2021/03/27 23:40:15 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,11 @@ 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.
 
+20210327
+       + build-fixes for Solaris10 /bin/sh
+       + fix some cppcheck warnings, mostly style, in ncurses test-programs,
+         form and menu libraries.
+
 20210323
        + add configure option --enable-stdnoreturn, making the _Noreturn
          keyword optional to ease transition (prompted by report by
diff --git a/VERSION b/VERSION
index 978d369009bab26c9dbe099c9a6552f98b8f505c..06e2a2ed7d8bfe0b3d9dd8ce25491b4ad13e7cd3 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.2     20210323
+5:0:10 6.2     20210327
diff --git a/dist.mk b/dist.mk
index d5313adb738cdf77f7a61850254185b806693601..ff3d7a90a168347a1f2ef40df21ab69ecc2e0b1c 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.1406 2021/03/23 07:36:24 tom Exp $
+# $Id: dist.mk,v 1.1407 2021/03/27 09:43:25 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 = 2
-NCURSES_PATCH = 20210323
+NCURSES_PATCH = 20210327
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index ec3b1b7b5ab3ab3785a226b40765e1eb4530ad4c..22edfc0b1426585022e2967c5010cec631013a74 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 
index b4fe523ef8f65c4a875a14c1de50d796fbb8d540..e11d2dfb1e8f8effd5c7c77532ba3f050f8c9300 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 15d8ad5c39e3c9a162abe2292c96043939e3b5e5..93d937c6409e8be16c0523ffd7ab3e2db1ae5d70 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 
index f1645a31be495260282dc451c519ab547f15cac9..214e61bdaf66857b3a6b442c0fe28208d3779745 100644 (file)
@@ -1,6 +1,6 @@
 <!-- 
   ****************************************************************************
-  * Copyright 2018,2020 Thomas E. Dickey                                     *
+  * Copyright 2018-2020,2021 Thomas E. Dickey                                *
   * Copyright 1999-2010,2016 Free Software Foundation, Inc.                  *
   *                                                                          *
   * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -28,7 +28,7 @@
   * authorization.                                                           *
   ****************************************************************************
   * Author: Thomas E. Dickey 1999-on
-  * @Id: curs_extend.3x,v 1.24 2020/10/24 09:37:07 tom Exp @
+  * @Id: curs_extend.3x,v 1.26 2021/03/13 13:43:05 tom Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
@@ -65,7 +65,9 @@
 
 </PRE><H3><a name="h3-curses_version">curses_version</a></H3><PRE>
        Use <STRONG>curses_version</STRONG> to get the version number, including patch level  of
-       the library, e.g., <STRONG>5.0.19991023</STRONG>
+       the library, prefixed by "ncurses", e.g.,
+
+              <STRONG>ncurses</STRONG> <STRONG>5.0.19991023</STRONG>
 
 
 </PRE><H3><a name="h3-use_extended_names">use_extended_names</a></H3><PRE>
index 3c8da425172f50bff6cdbc383b838b27ff454b4f..efa8ab9f3a164e506444e6be71bf2d5bdf4122a3 100644 (file)
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_terminfo.3x,v 1.72 2021/01/02 23:50:04 tom Exp @
+  * @Id: curs_terminfo.3x,v 1.74 2021/03/06 16:05:19 tom Exp @
   * ***************************************************************************
   * ***************************************************************************
   * ***************************************************************************
        <STRONG>o</STRONG>   Aside from the <STRONG>set_attributes</STRONG> (<STRONG>sgr</STRONG>) capability, most terminal capa-
            bilities require no more than one or two parameters.
 
+       <STRONG>o</STRONG>   Padding  information  is  ignored  by  <STRONG>tparm</STRONG>;  it is interpreted by
+           <STRONG>tputs</STRONG>.
+
+       <STRONG>o</STRONG>   The capability string is  null-terminated.   Use  "\200"  where  an
+           ASCII NUL is needed in the output.
+
        <STRONG>tiparm</STRONG>  is  a  newer  form of <STRONG>tparm</STRONG> which uses <EM>&lt;stdarg.h&gt;</EM> rather than a
        fixed-parameter list.  Its numeric parameters are integers (int) rather
        than longs.
 
 
 </PRE><H3><a name="h3-Output-Functions">Output Functions</a></H3><PRE>
-       The  <STRONG>tputs</STRONG>  routine  applies  padding information to the string <EM>str</EM> and
-       outputs it:
+       The  <STRONG>tputs</STRONG>  routine  applies padding information (i.e., by interpreting
+       marker embedded in the terminfo capability such as  "$&lt;5&gt;"  as  5  mil-
+       liseconds) to the string <EM>str</EM> and outputs it:
 
-       <STRONG>o</STRONG>   The <EM>str</EM> parameter must be a terminfo string variable or the  return
+       <STRONG>o</STRONG>   The  <EM>str</EM> parameter must be a terminfo string variable or the return
            value from <STRONG>tparm</STRONG>, <STRONG>tiparm</STRONG>, <STRONG>tgetstr</STRONG>, or <STRONG>tgoto</STRONG>.
 
-           The  <STRONG>tgetstr</STRONG> and <STRONG>tgoto</STRONG> functions are part of the <EM>termcap</EM> interface,
-           which happens to share this function name with the <EM>terminfo</EM>  inter-
+           The <STRONG>tgetstr</STRONG> and <STRONG>tgoto</STRONG> functions are part of the <EM>termcap</EM>  interface,
+           which  happens to share this function name with the <EM>terminfo</EM> inter-
            face.
 
        <STRONG>o</STRONG>   <EM>affcnt</EM> is the number of lines affected, or 1 if not applicable.
 
-       <STRONG>o</STRONG>   <EM>putc</EM>  is a <STRONG>putchar</STRONG>-like routine to which the characters are passed,
+       <STRONG>o</STRONG>   <EM>putc</EM> is a <STRONG>putchar</STRONG>-like routine to which the characters are  passed,
            one at a time.
 
-       The <STRONG>putp</STRONG> routine calls <STRONG>tputs(</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>putchar)</STRONG>.  The output of <STRONG>putp</STRONG>  al-
+       The  <STRONG>putp</STRONG> routine calls <STRONG>tputs(</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>putchar)</STRONG>.  The output of <STRONG>putp</STRONG> al-
        ways goes to <STRONG>stdout</STRONG>, rather than the <EM>filedes</EM> specified in <STRONG>setupterm</STRONG>.
 
-       The  <STRONG>vidputs</STRONG>  routine  displays the string on the terminal in the video
+       The <STRONG>vidputs</STRONG> routine displays the string on the terminal  in  the  video
        attribute mode <EM>attrs</EM>, which is any combination of the attributes listed
-       in  <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>.   The characters are passed to the <STRONG>putchar</STRONG>-like routine
+       in <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>.  The characters are passed to the  <STRONG>putchar</STRONG>-like  routine
        <EM>putc</EM>.
 
        The <STRONG>vidattr</STRONG> routine is like the <STRONG>vidputs</STRONG> routine, except that it outputs
        through <STRONG>putchar</STRONG>.
 
-       The  <STRONG>vid_attr</STRONG>  and <STRONG>vid_puts</STRONG> routines correspond to vidattr and vidputs,
-       respectively.  They use a set of arguments for representing  the  video
+       The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines correspond to vidattr  and  vidputs,
+       respectively.   They  use a set of arguments for representing the video
        attributes plus color, i.e.,
 
        <STRONG>o</STRONG>   <EM>attrs</EM> of type <STRONG>attr_t</STRONG> for the attributes and
 
        <STRONG>o</STRONG>   <EM>pair</EM> of type <STRONG>short</STRONG> for the color-pair number.
 
-       The  <STRONG>vid_attr</STRONG>  and  <STRONG>vid_puts</STRONG> routines are designed to use the attribute
+       The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines are designed to  use  the  attribute
        constants with the <EM>WA</EM><STRONG>_</STRONG> prefix.
 
-       X/Open Curses reserves the <EM>opts</EM> argument for future  use,  saying  that
-       applications  must provide a null pointer for that argument.  As an ex-
-       tension, this implementation allows <EM>opts</EM> to be used  as  a  pointer  to
+       X/Open  Curses  reserves  the <EM>opts</EM> argument for future use, saying that
+       applications must provide a null pointer for that argument.  As an  ex-
+       tension,  this  implementation  allows  <EM>opts</EM> to be used as a pointer to
        <STRONG>int</STRONG>, which overrides the <EM>pair</EM> (<STRONG>short</STRONG>) argument.
 
-       The  <STRONG>mvcur</STRONG>  routine  provides low-level cursor motion.  It takes effect
+       The <STRONG>mvcur</STRONG> routine provides low-level cursor motion.   It  takes  effect
        immediately (rather than at the next refresh).
 
        While <STRONG>putp</STRONG> and <STRONG>mvcur</STRONG> are low-level functions which do not use the high-
 
 
 </PRE><H3><a name="h3-Terminal-Capability-Functions">Terminal Capability Functions</a></H3><PRE>
-       The <STRONG>tigetflag</STRONG>, <STRONG>tigetnum</STRONG> and <STRONG>tigetstr</STRONG> routines return the value  of  the
-       capability  corresponding  to the <STRONG>terminfo</STRONG> <EM>capname</EM> passed to them, such
-       as <STRONG>xenl</STRONG>.  The <EM>capname</EM> for each capability is given in the table  column
+       The  <STRONG>tigetflag</STRONG>,  <STRONG>tigetnum</STRONG> and <STRONG>tigetstr</STRONG> routines return the value of the
+       capability corresponding to the <STRONG>terminfo</STRONG> <EM>capname</EM> passed to  them,  such
+       as  <STRONG>xenl</STRONG>.  The <EM>capname</EM> for each capability is given in the table column
        entitled <EM>capname</EM> code in the capabilities section of <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
        These routines return special values to denote errors.
 
 
 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
-       Routines  that  return  an integer return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> (SVr4
-       only specifies "an integer value other than <STRONG>ERR</STRONG>") upon successful  com-
+       Routines that return an integer return <STRONG>ERR</STRONG> upon failure  and  <STRONG>OK</STRONG>  (SVr4
+       only  specifies "an integer value other than <STRONG>ERR</STRONG>") upon successful com-
        pletion, unless otherwise noted in the preceding routine descriptions.
 
        Routines that return pointers always return <STRONG>NULL</STRONG> on error.
                ditions are documented above.
 
           <STRONG>tputs</STRONG>
-               returns an error if the string parameter is null.  It does  not
-               detect  I/O errors: X/Open states that <STRONG>tputs</STRONG> ignores the return
+               returns  an error if the string parameter is null.  It does not
+               detect I/O errors: X/Open states that <STRONG>tputs</STRONG> ignores the  return
                value of the output function <EM>putc</EM>.
 
 
 </PRE><H3><a name="h3-Compatibility-macros">Compatibility macros</a></H3><PRE>
-       This implementation provides a few macros for compatibility  with  sys-
+       This  implementation  provides a few macros for compatibility with sys-
        tems  before  SVr4  (see  <STRONG>HISTORY</STRONG>).   Those  include  <STRONG>crmode</STRONG>,  <STRONG>fixterm</STRONG>,
        <STRONG>gettmode</STRONG>, <STRONG>nocrmode</STRONG>, <STRONG>resetterm</STRONG>, <STRONG>saveterm</STRONG>, and <STRONG>setterm</STRONG>.
 
-       In SVr4, those are found in <STRONG>&lt;curses.h&gt;</STRONG>, but  except  for  <STRONG>setterm</STRONG>,  are
+       In  SVr4,  those  are  found in <STRONG>&lt;curses.h&gt;</STRONG>, but except for <STRONG>setterm</STRONG>, are
        likewise macros.  The one function, <STRONG>setterm</STRONG>, is mentioned in the manual
-       page.  The manual page notes that the <STRONG>setterm</STRONG> routine was  replaced  by
+       page.   The  manual page notes that the <STRONG>setterm</STRONG> routine was replaced by
        <STRONG>setupterm</STRONG>, stating that the call:
 
              <STRONG>setupterm(</STRONG><EM>term</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>(int</STRONG> <STRONG>*)0)</STRONG>
 
        provides the same functionality as <STRONG>setterm(</STRONG><EM>term</EM><STRONG>)</STRONG>, and is not recommend-
-       ed for new programs.  This implementation provides each of  those  sym-
+       ed  for  new programs.  This implementation provides each of those sym-
        bols as macros for BSD compatibility,
 
 
 
        <STRONG>Function</STRONG>    <STRONG>Description</STRONG>
        ------------------------------------------------------------
-
        fixterm     restore tty to "in curses" state
        gettmode    establish current tty modes
        mvcur       low level cursor motion
-       putp        utility function that uses <STRONG>tputs</STRONG> to send  char-
+       putp        utility  function that uses <STRONG>tputs</STRONG> to send char-
                    acters via <STRONG>putchar</STRONG>.
        resetterm   set tty modes to "out of curses" state
        resetty     reset tty flags to stored value
        tparm       instantiate a string expression with parameters
        tputs       apply padding information to a string
        vidattr     like <STRONG>vidputs</STRONG>, but outputs through <STRONG>putchar</STRONG>
-       vidputs     output  a string to put terminal in a specified
+       vidputs     output a string to put terminal in a  specified
                    video attribute mode
 
-       The programming manual also mentioned functions  provided  for  termcap
+       The  programming  manual  also mentioned functions provided for termcap
        compatibility (commenting that they "may go away at a later date"):
 
        <STRONG>Function</STRONG>   <STRONG>Description</STRONG>
        tputs      apply padding to capability, calling
                   a function to put characters
 
-       Early terminfo programs obtained capability values  from  the  <STRONG>TERMINAL</STRONG>
+       Early  terminfo  programs  obtained capability values from the <STRONG>TERMINAL</STRONG>
        structure initialized by <STRONG>setupterm</STRONG>.
 
-       SVr3  extended terminfo by adding functions to retrieve capability val-
+       SVr3 extended terminfo by adding functions to retrieve capability  val-
        ues (like the termcap interface), and reusing tgoto and tputs:
 
        <STRONG>Function</STRONG>    <STRONG>Description</STRONG>
        tigetnum    get numeric entry for given <EM>id</EM>
        tigetstr    get string entry for given <EM>id</EM>
 
-       SVr3 also replaced several of the SVr2 terminfo functions which had  no
+       SVr3  also replaced several of the SVr2 terminfo functions which had no
        counterpart in the termcap interface, documenting them as obsolete:
 
        <STRONG>Function</STRONG>    <STRONG>Replaced</STRONG> <STRONG>by</STRONG>
        saveterm    def_prog_mode
        setterm     setupterm
 
-       SVr3  kept  the  <STRONG>mvcur</STRONG>, <STRONG>vidattr</STRONG> and <STRONG>vidputs</STRONG> functions, along with <STRONG>putp</STRONG>,
-       <STRONG>tparm</STRONG> and <STRONG>tputs</STRONG>.  The latter were needed to support padding,  and  han-
-       dling  functions  such as <STRONG>vidattr</STRONG> (which used more than the two parame-
+       SVr3 kept the <STRONG>mvcur</STRONG>, <STRONG>vidattr</STRONG> and <STRONG>vidputs</STRONG> functions,  along  with  <STRONG>putp</STRONG>,
+       <STRONG>tparm</STRONG>  and  <STRONG>tputs</STRONG>.  The latter were needed to support padding, and han-
+       dling functions such as <STRONG>vidattr</STRONG> (which used more than the  two  parame-
        ters supported by <STRONG>tgoto</STRONG>).
 
-       SVr3 introduced the functions for switching between  terminal  descrip-
-       tions,  e.g.,  <STRONG>set_curterm</STRONG>.  The various global variables such as <STRONG>bool-</STRONG>
+       SVr3  introduced  the functions for switching between terminal descrip-
+       tions, e.g., <STRONG>set_curterm</STRONG>.  The various global variables such  as  <STRONG>bool-</STRONG>
        <STRONG>names</STRONG> were mentioned in the programming manual at this point.
 
        SVr4 added the <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> functions.
 </PRE><H3><a name="h3-Legacy-functions">Legacy functions</a></H3><PRE>
        X/Open notes that <STRONG>vidattr</STRONG> and <STRONG>vidputs</STRONG> may be macros.
 
-       The function <STRONG>setterm</STRONG> is not described by X/Open and must be  considered
+       The  function <STRONG>setterm</STRONG> is not described by X/Open and must be considered
        non-portable.  All other functions are as described by X/Open.
 
 
 </PRE><H3><a name="h3-Legacy-data">Legacy data</a></H3><PRE>
-       <STRONG>setupterm</STRONG>  copies  the terminal name to the array <STRONG>ttytype</STRONG>.  This is not
+       <STRONG>setupterm</STRONG> copies the terminal name to the array <STRONG>ttytype</STRONG>.  This  is  not
        part of X/Open Curses, but is assumed by some applications.
 
-       Other implementions may not declare the capability name  arrays.   Some
+       Other  implementions  may not declare the capability name arrays.  Some
        provide them without declaring them.  X/Open does not specify them.
 
        Extended terminal capability names, e.g., as defined by <STRONG>tic</STRONG> <STRONG>-x</STRONG>, are not
 
 
 </PRE><H3><a name="h3-Output-buffering">Output buffering</a></H3><PRE>
-       Older versions of <STRONG>ncurses</STRONG> assumed that the file  descriptor  passed  to
+       Older  versions  of  <STRONG>ncurses</STRONG> assumed that the file descriptor passed to
        <STRONG>setupterm</STRONG> from <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG> uses buffered I/O, and would write to
-       the corresponding stream.  In addition to the limitation that the  ter-
-       minal  was  left in block-buffered mode on exit (like System V curses),
-       it was problematic because <STRONG>ncurses</STRONG> did not  allow  a  reliable  way  to
+       the  corresponding stream.  In addition to the limitation that the ter-
+       minal was left in block-buffered mode on exit (like System  V  curses),
+       it  was  problematic  because  <STRONG>ncurses</STRONG>  did not allow a reliable way to
        cleanup on receiving SIGTSTP.
 
-       The  current version (ncurses6) uses output buffers managed directly by
+       The current version (ncurses6) uses output buffers managed directly  by
        <STRONG>ncurses</STRONG>.  Some of the low-level functions described in this manual page
        write to the standard output.  They are not signal-safe.  The high-lev-
        el functions in <STRONG>ncurses</STRONG> use alternate versions of these functions using
 
 </PRE><H3><a name="h3-Function-prototypes">Function prototypes</a></H3><PRE>
        The X/Open Curses prototypes are based on the SVr4 curses header decla-
-       rations, which were defined at the same time the C language  was  first
+       rations,  which  were defined at the same time the C language was first
        standardized in the late 1980s.
 
-       <STRONG>o</STRONG>   X/Open  Curses  uses  <STRONG>const</STRONG>  less  effectively  than a later design
-           might, in some cases applying it needlessly to values  are  already
-           constant,  and  in most cases overlooking parameters which normally
-           would use <STRONG>const</STRONG>.  Using constant parameters for functions which  do
+       <STRONG>o</STRONG>   X/Open Curses uses <STRONG>const</STRONG>  less  effectively  than  a  later  design
+           might,  in  some cases applying it needlessly to values are already
+           constant, and in most cases overlooking parameters  which  normally
+           would  use <STRONG>const</STRONG>.  Using constant parameters for functions which do
            not use <STRONG>const</STRONG> may prevent the program from compiling.  On the other
            hand, <EM>writable</EM> <EM>strings</EM> are an obsolescent feature.
 
-           As an extension, this implementation can be  configured  to  change
-           the  function prototypes to use the <STRONG>const</STRONG> keyword.  The ncurses ABI
+           As  an  extension,  this implementation can be configured to change
+           the function prototypes to use the <STRONG>const</STRONG> keyword.  The ncurses  ABI
            6 enables this feature by default.
 
-       <STRONG>o</STRONG>   X/Open Curses prototypes <STRONG>tparm</STRONG> with a fixed number  of  parameters,
+       <STRONG>o</STRONG>   X/Open  Curses  prototypes <STRONG>tparm</STRONG> with a fixed number of parameters,
            rather than a variable argument list.
 
-           This  implementation uses a variable argument list, but can be con-
-           figured to use the  fixed-parameter  list.   Portable  applications
-           should  provide  9 parameters after the format; zeroes are fine for
+           This implementation uses a variable argument list, but can be  con-
+           figured  to  use  the  fixed-parameter list.  Portable applications
+           should provide 9 parameters after the format; zeroes are  fine  for
            this purpose.
 
-           In response to review comments by Thomas E. Dickey,  X/Open  Curses
+           In  response  to review comments by Thomas E. Dickey, X/Open Curses
            Issue 7 proposed the <STRONG>tiparm</STRONG> function in mid-2009.
 
 
 </PRE><H3><a name="h3-Special-TERM-treatment">Special TERM treatment</a></H3><PRE>
        If configured to use the terminal-driver, e.g., for the MinGW port,
 
-       <STRONG>o</STRONG>   <STRONG>setupterm</STRONG>  interprets  a missing/empty TERM variable as the special
+       <STRONG>o</STRONG>   <STRONG>setupterm</STRONG> interprets a missing/empty TERM variable as  the  special
            value "unknown".
 
-       <STRONG>o</STRONG>   <STRONG>setupterm</STRONG> allows explicit use of the the windows console driver  by
-           checking  if $TERM is set to "#win32con" or an abbreviation of that
+       <STRONG>o</STRONG>   <STRONG>setupterm</STRONG>  allows explicit use of the the windows console driver by
+           checking if $TERM is set to "#win32con" or an abbreviation of  that
            string.
 
 
 </PRE><H3><a name="h3-Other-portability-issues">Other portability issues</a></H3><PRE>
-       In System V Release 4, <STRONG>set_curterm</STRONG> has an <STRONG>int</STRONG> return type  and  returns
+       In  System  V Release 4, <STRONG>set_curterm</STRONG> has an <STRONG>int</STRONG> return type and returns
        <STRONG>OK</STRONG> or <STRONG>ERR</STRONG>.  We have chosen to implement the X/Open Curses semantics.
 
-       In  System  V  Release  4, the third argument of <STRONG>tputs</STRONG> has the type <STRONG>int</STRONG>
+       In System V Release 4, the third argument of <STRONG>tputs</STRONG>  has  the  type  <STRONG>int</STRONG>
        <STRONG>(*putc)(char)</STRONG>.
 
-       At least one implementation of X/Open Curses (Solaris) returns a  value
-       other  than  <STRONG>OK</STRONG>/<STRONG>ERR</STRONG> from <STRONG>tputs</STRONG>.  That returns the length of the string,
+       At  least one implementation of X/Open Curses (Solaris) returns a value
+       other than <STRONG>OK</STRONG>/<STRONG>ERR</STRONG> from <STRONG>tputs</STRONG>.  That returns the length of  the  string,
        and does no error-checking.
 
-       X/Open notes that after calling <STRONG>mvcur</STRONG>, the curses state may  not  match
+       X/Open  notes  that after calling <STRONG>mvcur</STRONG>, the curses state may not match
        the actual terminal state, and that an application should touch and re-
        fresh the window before resuming normal curses calls.  Both <STRONG>ncurses</STRONG> and
-       System  V  Release 4 curses implement <STRONG>mvcur</STRONG> using the SCREEN data allo-
-       cated in either <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>.  So though it is  documented  as  a
-       terminfo  function, <STRONG>mvcur</STRONG> is really a curses function which is not well
+       System V Release 4 curses implement <STRONG>mvcur</STRONG> using the SCREEN  data  allo-
+       cated  in  either  <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>.  So though it is documented as a
+       terminfo function, <STRONG>mvcur</STRONG> is really a curses function which is not  well
        specified.
 
-       X/Open states that the old location must be given for <STRONG>mvcur</STRONG>.  This  im-
-       plementation  allows  the caller to use -1's for the old ordinates.  In
+       X/Open  states that the old location must be given for <STRONG>mvcur</STRONG>.  This im-
+       plementation allows the caller to use -1's for the old  ordinates.   In
        that case, the old location is unknown.
 
 
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,   <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>,   <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>,    <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>,
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,    <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>,   <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>,   <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>,
        <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>, <STRONG>putc(3)</STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
 
index 8b10dfa52660663fe2f5b3354ea354816963743d..4a54b35082c59ea876cc224bc0a65ca49726488d 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names  begin  "form_"  for  detailed
        descriptions of the entry points.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 
index c0ab7629e1b7cbc1948ad1a4a39eebeef61b279c..27ff2d79a14524db602bcfe63a6cc669d98d1cbe 100644 (file)
 
        https://invisible-island.net/ncurses/tctest.html
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 2af6ac13821b1602d005dc42ae33e7d08a3a0d9c..3de0ce64ea134419e082bb1774aaa5288fe14467 100644 (file)
@@ -91,7 +91,7 @@
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 6961b2b19314cf937e61e36125f8ec0f1c902913..71e7fcf368c9d8e5bf450c8d4d6f0ff3f0a6365f 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names  begin  "menu_"  for  detailed
        descriptions of the entry points.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 
index 64cc934b441d0d0d218496f5128454a01c50003f..a8ddba0628a7c93a4f8cf6bb2a668549c3a380b7 100644 (file)
@@ -60,7 +60,7 @@
        method of updating  character  screens  with  reasonable  optimization.
        This  implementation  is  "new  curses"  (ncurses)  and is the approved
        replacement for 4.4BSD classic curses,  which  has  been  discontinued.
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
        The  <STRONG>ncurses</STRONG>  library emulates the curses library of System V Release 4
        UNIX, and XPG4 (X/Open Portability Guide) curses  (also  known  as  XSI
index e2678b28eb2612c88a2b7955364f851b1b99edc1..a7ecd69cc1a8db7ada11d6a23ccb358a2b6d2b3c 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 
index df93d91550dbefed743d89a351663f564c3cfb18..c1f088fe1691e95e797c861334bf1864e4e1477d 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 34dc416ead2ea03553a8f4449d94edb87f31bc88..6bb91b0c1584d96e71447a1aa89df1ab91e51a29 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 
index 0e5deb267a7aaf00ffee73879a5be8d0596414a0..5aff20e553c39719d128c9000680e0320bca7679 100644 (file)
        have, by specifying how to perform screen operations, and by specifying
        padding requirements and initialization sequences.
 
-       This manual describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This manual describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 </PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
index cf74b772d248d67f6a90cb04967899221950dab4..a94fa807023a2247b4b39b1ea2cc0e02ec242554 100644 (file)
        <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,   <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,   <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,   <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,   <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
        <STRONG><A HREF="term.5.html">term(5)</A></STRONG>.  <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.  <STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index aa8d8b0edb10152692d8eecbf45e06bea9acb63e..febe3b5ff3321147c346c677564531457150393c 100644 (file)
        <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,   <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,   <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,   <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>,   <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
        <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 
index ffb131c62ab79d19743da8c0c7866f550ae25893..73498f9b5db7f5fff5b80c1a6db625650c27d2eb 100644 (file)
@@ -1,7 +1,7 @@
 <!-- 
   * t
   ****************************************************************************
-  * Copyright 2018,2020 Thomas E. Dickey                                     *
+  * Copyright 2018-2020,2021 Thomas E. Dickey                                *
   * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
   *                                                                          *
   * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: tput.1,v 1.65 2020/12/19 22:17:47 tom Exp @
+  * @Id: tput.1,v 1.66 2021/03/06 15:56:23 tom Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
            2010,  NetBSD's  <STRONG>tput</STRONG>  uses  terminfo names.  Before that, it (like
            FreeBSD) recognized termcap names.
 
+           Beginning in 2021, FreeBSD uses the ncurses  <STRONG>tput</STRONG>,  configured  for
+           both terminfo (tested first) and termcap (as a fallback).
+
        Because (apparently) <EM>all</EM> of the certified Unix systems support the full
-       set  of  capability names, the reasoning for documenting only a few may
+       set of capability names, the reasoning for documenting only a  few  may
        not be apparent.
 
-       <STRONG>o</STRONG>   X/Open Curses Issue 7 documents <STRONG>tput</STRONG> differently, with <EM>capname</EM>  and
+       <STRONG>o</STRONG>   X/Open  Curses Issue 7 documents <STRONG>tput</STRONG> differently, with <EM>capname</EM> and
            the other features used in this implementation.
 
-       <STRONG>o</STRONG>   That  is,  there  are  two standards for <STRONG>tput</STRONG>: POSIX (a subset) and
-           X/Open Curses (the full implementation).  POSIX documents a  subset
-           to  avoid  the  complication  of  including  X/Open  Curses and the
+       <STRONG>o</STRONG>   That is, there are two standards for <STRONG>tput</STRONG>:  POSIX  (a  subset)  and
+           X/Open  Curses (the full implementation).  POSIX documents a subset
+           to avoid the  complication  of  including  X/Open  Curses  and  the
            terminal capabilities database.
 
-       <STRONG>o</STRONG>   While it is certainly possible to  write  a  <STRONG>tput</STRONG>  program  without
-           using   curses,   none   of   the   systems  which  have  a  curses
-           implementation provide a <STRONG>tput</STRONG> utility which does  not  provide  the
+       <STRONG>o</STRONG>   While  it  is  certainly  possible  to write a <STRONG>tput</STRONG> program without
+           using  curses,  none  of  the   systems   which   have   a   curses
+           implementation  provide  a  <STRONG>tput</STRONG> utility which does not provide the
            <EM>capname</EM> feature.
 
        X/Open  Curses  Issue  7  (2009)  is  the  first  version  to  document
        utilities.  However that part of X/Open Curses does not follow existing
        practice (i.e., Unix features documented in SVID 3):
 
-       <STRONG>o</STRONG>   It  assigns exit code 4 to "invalid operand", which may be the same
-           as <EM>unknown</EM> <EM>capability</EM>.  For instance, the source code for  Solaris'
+       <STRONG>o</STRONG>   It assigns exit code 4 to "invalid operand", which may be the  same
+           as  <EM>unknown</EM> <EM>capability</EM>.  For instance, the source code for Solaris'
            xcurses uses the term "invalid" in this case.
 
-       <STRONG>o</STRONG>   It  assigns  exit  code  255  to  a  numeric  variable  that is not
+       <STRONG>o</STRONG>   It assigns exit  code  255  to  a  numeric  variable  that  is  not
            specified in the terminfo database.  That likely is a documentation
-           error,  confusing  the  <STRONG>-1</STRONG>  written  to  the standard output for an
+           error, confusing the <STRONG>-1</STRONG> written  to  the  standard  output  for  an
            absent or cancelled numeric value versus an (unsigned) exit code.
 
-       The various Unix systems (AIX, HPUX, Solaris) use the  same  exit-codes
+       The  various  Unix systems (AIX, HPUX, Solaris) use the same exit-codes
        as ncurses.
 
        NetBSD curses documents different exit codes which do not correspond to
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 
index 471e05307aaf8bd4059c6b3ffe2823f006525a46..921815c044ba4150e31ae3f073c27e5ba04362be 100644 (file)
        <STRONG>csh(1)</STRONG>,   <STRONG>sh(1)</STRONG>,   <STRONG>stty(1)</STRONG>,   <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>,  <STRONG>tty(4)</STRONG>,  <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>,
        <STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
 
 
 
index de664eb5f8035460faf298f0268400c2b63f2624..51bdc648580043f01a1c4da5b1fd06714642b519 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2014 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -33,7 +33,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_def.c,v 1.43 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.44 2021/03/27 23:49:53 tom Exp $")
 
 /* this can't be readonly */
 static FIELD default_field =
@@ -86,14 +86,13 @@ FORM_EXPORT(TypeArgument *)
 _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err)
 {
   TypeArgument *res = (TypeArgument *)0;
-  TypeArgument *p;
 
   if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
     {
       assert(err != 0 && ap != (va_list *)0);
       if ((typ->status & _LINKED_TYPE) != 0)
        {
-         p = typeMalloc(TypeArgument, 1);
+         TypeArgument *p = typeMalloc(TypeArgument, 1);
 
          if (p != 0)
            {
@@ -134,14 +133,13 @@ FORM_EXPORT(TypeArgument *)
 _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err)
 {
   TypeArgument *res = (TypeArgument *)0;
-  TypeArgument *p;
 
   if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
     {
       assert(err != 0 && argp != 0);
       if ((typ->status & _LINKED_TYPE) != 0)
        {
-         p = typeMalloc(TypeArgument, 1);
+         TypeArgument *p = typeMalloc(TypeArgument, 1);
 
          if (p != 0)
            {
index 0856afb845e2d21d06ab7e8dd4a0c03e41a7e80c..3054192281174d1cbead83569067bb17086c761b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2013 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -33,7 +33,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_data.c,v 1.19 2020/12/11 23:20:37 tom Exp $")
+MODULE_ID("$Id: frm_data.c,v 1.20 2021/03/27 23:49:58 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -150,12 +150,11 @@ data_ahead(const FORM *form)
 
       if (Single_Line_Field(field))
        {
-         int check_len;
-
          pos = form->begincol + field->cols;
          while (pos < field->dcols)
            {
-             check_len = field->dcols - pos;
+             int check_len = field->dcols - pos;
+
              if (check_len >= field->cols)
                check_len = field->cols;
              cursor_moved = TRUE;
index 89ae4ec39c54ef5f70857098c3c412aa895a0fa7..a9f21f28a94464662904124db1e8bc8ee5fd6d2f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -33,7 +33,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_def.c,v 1.29 2020/12/11 23:47:16 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.30 2021/03/27 23:49:58 tom Exp $")
 
 /* this can't be readonly */
 static FORM default_form =
@@ -158,7 +158,6 @@ Connect_Fields(FORM *form, FIELD **fields)
 {
   int field_cnt, j;
   int page_nr;
-  int maximum_row_in_field, maximum_col_in_field;
   _PAGE *pg;
 
   T((T_CALLED("Connect_Fields(%p,%p)"), (void *)form, (void *)fields));
@@ -199,6 +198,9 @@ Connect_Fields(FORM *form, FIELD **fields)
      size of the form */
   for (j = 0; j < field_cnt; j++)
     {
+      int maximum_row_in_field;
+      int maximum_col_in_field;
+
       if (j == 0)
        pg->pmin = (short)j;
       else
index ad82643ed2f7c1cfbd86e512f629f9d7cc3fed4a..2e7b7b9237cb5c57110d72207a990f040450c819 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -33,7 +33,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_driver.c,v 1.133 2020/12/12 00:36:42 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.134 2021/03/27 23:49:58 tom Exp $")
 
 /*----------------------------------------------------------------------------
   This is the core module of the form library. It contains the majority
@@ -217,10 +217,10 @@ static FIELD_CELL myZEROS;
 static void
 check_pos(FORM *form, int lineno)
 {
-  int y, x;
-
   if (form && form->w)
     {
+      int y, x;
+
       getyx(form->w, y, x);
       if (y != form->currow || x != form->curcol)
        {
@@ -265,10 +265,11 @@ static int
 wide_winsnstr(WINDOW *w, const cchar_t *s, int n)
 {
   int code = ERR;
-  int y, x;
 
   while (n-- > 0)
     {
+      int y, x;
+
       getyx(w, y, x);
       if ((code = wins_wch(w, s++)) != OK)
        break;
@@ -511,7 +512,6 @@ Buffer_To_Window(const FIELD *field, WINDOW *win)
 {
   int width, height;
   int y, x;
-  int len;
   int row;
   FIELD_CELL *pBuffer;
 
@@ -525,6 +525,8 @@ Buffer_To_Window(const FIELD *field, WINDOW *win)
        row < height;
        row++, pBuffer += width)
     {
+      int len;
+
       if ((len = (int)(After_End_Of_Data(pBuffer, width) - pBuffer)) > 0)
        {
          wmove(win, row, 0);
@@ -706,8 +708,6 @@ Field_Grown(FIELD *field, int amount)
           * realloc().
           */
          int i, j;
-         FIELD_CELL *old_bp;
-         FIELD_CELL *new_bp;
 
          result = TRUE;        /* allow sharing of recovery on failure */
 
@@ -715,8 +715,9 @@ Field_Grown(FIELD *field, int amount)
          field->buf = newbuf;
          for (i = 0; i <= field->nbuf; i++)
            {
-             new_bp = Address_Of_Nth_Buffer(field, i);
-             old_bp = oldbuf + i * (1 + old_buflen);
+             FIELD_CELL *new_bp = Address_Of_Nth_Buffer(field, i);
+             FIELD_CELL *old_bp = oldbuf + i * (1 + old_buflen);
+
              for (j = 0; j < old_buflen; ++j)
                new_bp[j] = old_bp[j];
              while (j < new_buflen)
@@ -917,11 +918,12 @@ _nc_Refresh_Current_Field(FORM *form)
       else
        {
          /* A multi-line, i.e. vertical scrolling field */
-         int row_after_bottom, first_modified_row, first_unmodified_row;
+         int first_modified_row, first_unmodified_row;
 
          if (field->drows > field->rows)
            {
-             row_after_bottom = form->toprow + field->rows;
+             int row_after_bottom = form->toprow + field->rows;
+
              if (form->currow < form->toprow)
                {
                  form->toprow = form->currow;
@@ -1005,7 +1007,6 @@ Perform_Justification(FIELD *field, WINDOW *win)
 {
   FIELD_CELL *bp;
   int len;
-  int col = 0;
 
   bp = (Field_Has_Option(field, O_NO_LEFT_STRIP)
        ? field->buf
@@ -1014,6 +1015,8 @@ Perform_Justification(FIELD *field, WINDOW *win)
 
   if (len > 0)
     {
+      int col = 0;
+
       assert(win && (field->drows == 1));
 
       if (field->cols - len >= 0)
@@ -1240,7 +1243,6 @@ Synchronize_Linked_Fields(FIELD *field)
 {
   FIELD *linked_field;
   int res = E_OK;
-  int syncres;
 
   if (!field)
     return (E_BAD_ARGUMENT);
@@ -1252,6 +1254,8 @@ Synchronize_Linked_Fields(FIELD *field)
        (linked_field != field) && (linked_field != 0);
        linked_field = linked_field->link)
     {
+      int syncres;
+
       if (((syncres = Synchronize_Field(linked_field)) != E_OK) &&
          (res == E_OK))
        res = syncres;
@@ -1276,7 +1280,6 @@ _nc_Synchronize_Attributes(FIELD *field)
 {
   FORM *form;
   int res = E_OK;
-  WINDOW *formwin;
 
   T((T_CALLED("_nc_Synchronize_Attributes(%p)"), (void *)field));
 
@@ -1303,7 +1306,8 @@ _nc_Synchronize_Attributes(FIELD *field)
            }
          else
            {
-             formwin = Get_Form_Window(form);
+             WINDOW *formwin = Get_Form_Window(form);
+
              copywin(form->w, formwin,
                      0, 0,
                      field->frow, field->fcol,
@@ -2422,7 +2426,6 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
   int datalen = (int)(After_End_Of_Data(bp, field->dcols) - bp);
   int freelen = field->dcols - datalen;
   int requiredlen = len + 1;
-  FIELD_CELL *split;
   int result = E_REQUEST_DENIED;
 
   if (freelen >= requiredlen)
@@ -2431,7 +2434,7 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
       myINSNSTR(form->w, txt, len);
       wmove(form->w, row, len);
       myINSNSTR(form->w, &myBLANK, 1);
-      return E_OK;
+      result = E_OK;
     }
   else
     {
@@ -2447,6 +2450,8 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
 
       if (row < (field->drows - 1))
        {
+         FIELD_CELL *split;
+
          split =
            After_Last_Whitespace_Character(bp,
                                            (int)(Get_Start_Of_Data(bp
@@ -2470,8 +2475,8 @@ Insert_String(FORM *form, int row, FIELD_CELL *txt, int len)
              return E_OK;
            }
        }
-      return (result);
     }
+  return (result);
 }
 
 /*---------------------------------------------------------------------------
@@ -4474,14 +4479,13 @@ form_driver(FORM *form, int c)
                }
              else if (wenclose(sub, event.y, event.x))
                {               /* Inside the area we try to find the hit item */
-                 int i;
-
                  ry = event.y;
                  rx = event.x;
                  if (wmouse_trafo(sub, &ry, &rx, FALSE))
                    {
                      int min_field = form->page[form->curpage].pmin;
                      int max_field = form->page[form->curpage].pmax;
+                     int i;
 
                      for (i = min_field; i <= max_field; ++i)
                        {
@@ -4676,14 +4680,13 @@ form_driver_w(FORM *form, int type, wchar_t c)
                }
              else if (wenclose(sub, event.y, event.x))
                {               /* Inside the area we try to find the hit item */
-                 int i;
-
                  ry = event.y;
                  rx = event.x;
                  if (wmouse_trafo(sub, &ry, &rx, FALSE))
                    {
                      int min_field = form->page[form->curpage].pmin;
                      int max_field = form->page[form->curpage].pmax;
+                     int i;
 
                      for (i = min_field; i <= max_field; ++i)
                        {
index 27d4696619f4c07c07447b3646993e8f30ef99d8..a805faa7d8cbd019347f8e703dbeb336d5b7cdf3 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2015 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_req_name.c,v 1.21 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: frm_req_name.c,v 1.22 2021/03/27 23:49:58 tom Exp $")
 
 #define DATA(s) { s }
 
@@ -150,12 +150,13 @@ form_request_by_name(const char *str)
      to run sequentially through it.
    */
   size_t i = 0;
-  char buf[16];                        /* longest name is 10 chars */
 
   T((T_CALLED("form_request_by_name(%s)"), _nc_visbuf(str)));
 
   if (str != 0 && (i = strlen(str)) != 0)
     {
+      char buf[16];            /* longest name is 10 chars */
+
       if (i > sizeof(buf) - 2)
        i = sizeof(buf) - 2;
       memcpy(buf, str, i);
index 62242b56b42fe459d6c285ced3207b50c5426e99..c3a27ffa76e87979ab432ccea9da40649978eadd 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2009,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_enum.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_enum.c,v 1.32 2021/03/27 23:49:53 tom Exp $")
 
 typedef struct
   {
@@ -77,7 +77,6 @@ Generic_Enum_Type(void *arg)
          int cnt = 0;
          char **kp = (char **)0;
          char **kwds = (char **)0;
-         char **kptarget;
          int ccase, cunique;
 
          T((T_CREATE("enumARG %p"), (void *)argp));
@@ -96,6 +95,8 @@ Generic_Enum_Type(void *arg)
 
          if (cnt > 0)
            {
+             char **kptarget;
+
              /* We copy the keywords, because we can't rely on the fact
                 that the caller doesn't relocate or free the memory used
                 for the keywords (maybe he has GC)
@@ -292,10 +293,11 @@ Check_Enum_Field(FIELD *field, const void *argp)
   bool unique = ((const enumARG *)argp)->checkunique;
   unsigned char *bp = (unsigned char *)field_buffer(field, 0);
   char *s, *t, *p;
-  int res;
 
   while (kwds && (s = (*kwds++)))
     {
+      int res;
+
       if ((res = Compare((unsigned char *)s, bp, ccase)) != NOMATCH)
        {
          p = t = s;            /* t is at least a partial match */
index 3672d658cb31b2d4d2f53866d466727d75b106fd..301c80a1f07aa6befea5810b96554bfaba915817 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey                                     *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2008-2012,2016 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_generic.c,v 1.14 2020/12/12 17:27:44 tom Exp $")
+MODULE_ID("$Id: fty_generic.c,v 1.15 2021/03/27 23:49:53 tom Exp $")
 
 /*
  * This is not a full implementation of a field type, but adds some
@@ -282,7 +282,7 @@ _nc_form_cursor(const FORM *form, int *pRow, int *pCol)
   int code = E_SYSTEM_ERROR;
   WINDOW *res = (WINDOW *)0;
 
-  if (!(form == 0 || pRow == 0 || pCol == 0))
+  if (form != 0 && pRow != 0 && pCol != 0)
     {
       *pRow = form->currow;
       *pCol = form->curcol;
index d06ab8b6f389921c5539167e7af298429cf2fbc3..70fe97d0356b5dbc136ca812937a6868e8836eab 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_int.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_int.c,v 1.32 2021/03/27 23:49:58 tom Exp $")
 
 #if USE_WIDEC_SUPPORT
 #define isDigit(c) (iswdigit((wint_t)(c)) || isdigit(UChar(c)))
@@ -170,11 +170,9 @@ Check_This_Field(FIELD *field, const void *argp)
   int prec = argi->precision;
   unsigned char *bp = (unsigned char *)field_buffer(field, 0);
   char *s = (char *)bp;
-  long val;
-  char buf[100];
   bool result = FALSE;
 
-  while (*bp && *bp == ' ')
+  while (*bp == ' ')
     bp++;
   if (*bp)
     {
@@ -183,13 +181,14 @@ Check_This_Field(FIELD *field, const void *argp)
 #if USE_WIDEC_SUPPORT
       if (*bp)
        {
-         bool blank = FALSE;
          int len;
-         int n;
          wchar_t *list = _nc_Widen_String((char *)bp, &len);
 
          if (list != 0)
            {
+             bool blank = FALSE;
+             int n;
+
              result = TRUE;
              for (n = 0; n < len; ++n)
                {
@@ -227,7 +226,8 @@ Check_This_Field(FIELD *field, const void *argp)
 #endif
       if (result)
        {
-         val = atol(s);
+         long val = atol(s);
+
          if (low < high)
            {
              if (val < low || val > high)
@@ -235,6 +235,8 @@ Check_This_Field(FIELD *field, const void *argp)
            }
          if (result)
            {
+             char buf[100];
+
              _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
                          "%.*ld", (prec > 0 ? prec : 0), val);
              set_field_buffer(field, 0, buf);
index d79683de68d3fc27099a2f50f23a5948e95c40e5..53f941b9d054a88927d48579062f04b85bdc45ff 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2006,2009 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_ipv4.c,v 1.14 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_ipv4.c,v 1.15 2021/03/27 23:49:53 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -53,7 +53,7 @@ Check_IPV4_Field(FIELD *field, const void *argp GCC_UNUSED)
 {
   char *bp = field_buffer(field, 0);
   int num = 0, len;
-  unsigned int d1, d2, d3, d4;
+  unsigned int d1 = 0, d2 = 0, d3 = 0, d4 = 0;
 
   if (isdigit(UChar(*bp)))     /* Must start with digit */
     {
index 9eafaecb726cd39cc5abc92d75c7369016317e98..34cef6364bdb7bd2537365380dfd1b01a0d17ceb 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey                                     *
+ * Copyright 2019-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -35,7 +35,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_num.c,v 1.36 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_num.c,v 1.37 2021/03/27 23:49:58 tom Exp $")
 
 #if HAVE_LOCALE_H
 #include <locale.h>
@@ -188,12 +188,10 @@ Check_This_Field(FIELD *field, const void *argp)
   int prec = argn->precision;
   unsigned char *bp = (unsigned char *)field_buffer(field, 0);
   char *s = (char *)bp;
-  double val = 0.0;
   struct lconv *L = argn->L;
-  char buf[64];
   bool result = FALSE;
 
-  while (*bp && *bp == ' ')
+  while (*bp == ' ')
     bp++;
   if (*bp)
     {
@@ -202,14 +200,15 @@ Check_This_Field(FIELD *field, const void *argp)
 #if USE_WIDEC_SUPPORT
       if (*bp)
        {
-         bool blank = FALSE;
-         int state = 0;
          int len;
-         int n;
          wchar_t *list = _nc_Widen_String((char *)bp, &len);
 
          if (list != 0)
            {
+             bool blank = FALSE;
+             int state = 0;
+             int n;
+
              result = TRUE;
              for (n = 0; n < len; ++n)
                {
@@ -265,7 +264,8 @@ Check_This_Field(FIELD *field, const void *argp)
 #endif
       if (result)
        {
-         val = atof(s);
+         double val = atof(s);
+
          if (low < high)
            {
              if (val < low || val > high)
@@ -273,6 +273,8 @@ Check_This_Field(FIELD *field, const void *argp)
            }
          if (result)
            {
+             char buf[64];
+
              _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
                          "%.*f", (prec > 0 ? prec : 0), val);
              set_field_buffer(field, 0, buf);
index 8cf15ce513358e9b0265450d405dffff390fa5e3..b9b301d3eb908105397fee7f47b439bee48eac80 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2009,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_cursor.c,v 1.25 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.26 2021/03/27 23:46:29 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -83,7 +83,6 @@ _nc_menu_cursor_pos(const MENU *menu, const ITEM *item, int *pY, int *pX)
 MENU_EXPORT(int)
 pos_menu_cursor(const MENU *menu)
 {
-  WINDOW *win, *sub;
   int x = 0, y = 0;
   int err = _nc_menu_cursor_pos(menu, (ITEM *)0, &y, &x);
 
@@ -91,8 +90,9 @@ pos_menu_cursor(const MENU *menu)
 
   if (E_OK == err)
     {
-      win = Get_Menu_UserWin(menu);
-      sub = menu->usersub ? menu->usersub : win;
+      WINDOW *win = Get_Menu_UserWin(menu);
+      WINDOW *sub = menu->usersub ? menu->usersub : win;
+
       assert(win && sub);
 
       if ((menu->opt & O_SHOWMATCH) && (menu->pindex > 0))
index b1d7c3541b53c84d0fd4abf55b6546351610cc8d..cf2ef2fe05c63864855d382dff372fb91fefed21 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2016 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_driver.c,v 1.36 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.37 2021/03/27 23:46:29 tom Exp $")
 
 /* Macros */
 
@@ -220,7 +220,7 @@ menu_driver(MENU *menu, int c)
 
   int result = E_OK;
   ITEM *item;
-  int my_top_row, rdiff;
+  int my_top_row;
 
   T((T_CALLED("menu_driver(%p,%d)"), (void *)menu, c));
 
@@ -239,6 +239,8 @@ menu_driver(MENU *menu, int c)
 
   if ((c > KEY_MAX) && (c <= MAX_MENU_COMMAND))
     {
+      int rdiff;
+
       if (!((c == REQ_BACK_PATTERN)
            || (c == REQ_NEXT_MATCH) || (c == REQ_PREV_MATCH)))
        {
@@ -489,16 +491,20 @@ menu_driver(MENU *menu, int c)
                    }
                  else if (wenclose(sub, event.y, event.x))
                    {           /* Inside the area we try to find the hit item */
-                     int i, x, y, err;
+                     int x, y;
 
                      ry = event.y;
                      rx = event.x;
                      if (wmouse_trafo(sub, &ry, &rx, FALSE))
                        {
+                         int i;
+
                          for (i = 0; i < menu->nitems; i++)
                            {
-                             err = _nc_menu_cursor_pos(menu, menu->items[i],
-                                                       &y, &x);
+                             int err = _nc_menu_cursor_pos(menu,
+                                                           menu->items[i],
+                                                           &y, &x);
+
                              if (E_OK == err)
                                {
                                  if ((ry == y) &&
index 848de0b21118e80d2cb3f3d7f52bed234c1dd474..65adfc6bfcb0827b4263340f49e2507073e7cc3e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_format.c,v 1.21 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_format.c,v 1.22 2021/03/27 23:46:29 tom Exp $")
 
 #define minimum(a,b) ((a)<(b) ? (a): (b))
 
@@ -59,7 +59,6 @@ MODULE_ID("$Id: m_format.c,v 1.21 2020/12/12 00:38:02 tom Exp $")
 MENU_EXPORT(int)
 set_menu_format(MENU *menu, int rows, int cols)
 {
-  int total_rows, total_cols;
 
   T((T_CALLED("set_menu_format(%p,%d,%d)"), (void *)menu, rows, cols));
 
@@ -68,6 +67,8 @@ set_menu_format(MENU *menu, int rows, int cols)
 
   if (menu)
     {
+      int total_rows, total_cols;
+
       if (menu->status & _POSTED)
        RETURN(E_POSTED);
 
index 2e5211468a86e80f420f0c8c26f23fc296a3452d..4ec08c5288ff932b4cd8ae458c1e463e52007bb2 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2014 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_global.c,v 1.32 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.33 2021/03/27 23:46:29 tom Exp $")
 
 static char mark[] = "-";
 /* *INDENT-OFF* */
@@ -113,12 +113,12 @@ ComputeMaximum_NameDesc_Lengths(MENU *menu)
   unsigned MaximumNameLength = 0;
   unsigned MaximumDescriptionLength = 0;
   ITEM **items;
-  unsigned check;
 
   assert(menu && menu->items);
   for (items = menu->items; *items; items++)
     {
-      check = (unsigned)_nc_Calculate_Text_Width(&((*items)->name));
+      unsigned check = (unsigned)_nc_Calculate_Text_Width(&((*items)->name));
+
       if (check > MaximumNameLength)
        MaximumNameLength = check;
 
@@ -174,11 +174,12 @@ ResetConnectionInfo(MENU *menu, ITEM **items)
 MENU_EXPORT(bool)
 _nc_Connect_Items(MENU *menu, ITEM **items)
 {
-  ITEM **item;
   unsigned int ItemCount = 0;
 
   if (menu && items)
     {
+      ITEM **item;
+
       for (item = items; *item; item++)
        {
          if ((*item)->imenu)
@@ -292,23 +293,19 @@ static int
 calculate_actual_width(MENU *menu, bool name)
 {
   int width = 0;
-  int check = 0;
-  ITEM **items;
 
   assert(menu && menu->items);
 
   if (menu->items != 0)
     {
+      ITEM **items;
+
       for (items = menu->items; *items; items++)
        {
-         if (name)
-           {
-             check = _nc_Calculate_Text_Width(&((*items)->name));
-           }
-         else
-           {
-             check = _nc_Calculate_Text_Width(&((*items)->description));
-           }
+         int check = (name
+                      ? _nc_Calculate_Text_Width(&((*items)->name))
+                      : _nc_Calculate_Text_Width(&((*items)->description)));
+
          if (check > width)
            width = check;
        }
@@ -381,7 +378,7 @@ _nc_Link_Items(MENU *menu)
 {
   if (menu && menu->items && *(menu->items))
     {
-      int i, j;
+      int i;
       ITEM *item;
       int Number_Of_Items = menu->nitems;
       int col = 0, row = 0;
@@ -444,6 +441,7 @@ _nc_Link_Items(MENU *menu)
       else
        {
          int Number_Of_Rows = menu->rows;
+         int j;
 
          for (j = 0; j < Number_Of_Items; j++)
            {
@@ -506,12 +504,12 @@ _nc_Link_Items(MENU *menu)
 MENU_EXPORT(void)
 _nc_Show_Menu(const MENU *menu)
 {
-  WINDOW *win;
-  int maxy, maxx;
-
   assert(menu);
   if ((menu->status & _POSTED) && !(menu->status & _IN_DRIVER))
     {
+      WINDOW *win;
+      int maxy, maxx;
+
       /* adjust the internal subwindow to start on the current top */
       assert(menu->sub);
       mvderwin(menu->sub, menu->spc_rows * menu->toprow, 0);
@@ -549,13 +547,13 @@ _nc_New_TopRow_and_CurrentItem(
                                int new_toprow,
                                ITEM *new_current_item)
 {
-  ITEM *cur_item;
-  bool mterm_called = FALSE;
-  bool iterm_called = FALSE;
-
   assert(menu);
   if (menu->status & _POSTED)
     {
+      ITEM *cur_item;
+      bool mterm_called = FALSE;
+      bool iterm_called = FALSE;
+
       if (new_current_item != menu->curitem)
        {
          Call_Hook(menu, itemterm);
index ee0d17b43dd55c16fca16d918dde8a3ea6f45d27..6518d545028b6df5768188932dfbbca91af2c55b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2004,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_top.c,v 1.14 2020/12/12 00:38:08 tom Exp $")
+MODULE_ID("$Id: m_item_top.c,v 1.15 2021/03/27 23:46:29 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -53,8 +53,6 @@ MODULE_ID("$Id: m_item_top.c,v 1.14 2020/12/12 00:38:08 tom Exp $")
 MENU_EXPORT(int)
 set_top_row(MENU *menu, int row)
 {
-  ITEM *item;
-
   T((T_CALLED("set_top_row(%p,%d)"), (void *)menu, row));
 
   if (menu)
@@ -72,6 +70,8 @@ set_top_row(MENU *menu, int row)
 
   if (row != menu->toprow)
     {
+      ITEM *item;
+
       if (menu->status & _LINK_NEEDED)
        _nc_Link_Items(menu);
 
index a5c38e2716dce68d552535c0e6c8e177b73e186f..455987ffdb41d104e6823ca11639c867286c259b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2004,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_val.c,v 1.18 2020/12/12 00:38:08 tom Exp $")
+MODULE_ID("$Id: m_item_val.c,v 1.19 2021/03/27 23:46:29 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -56,12 +56,10 @@ MODULE_ID("$Id: m_item_val.c,v 1.18 2020/12/12 00:38:08 tom Exp $")
 MENU_EXPORT(int)
 set_item_value(ITEM *item, bool value)
 {
-  MENU *menu;
-
   T((T_CALLED("set_item_value(%p,%d)"), (void *)item, value));
   if (item)
     {
-      menu = item->imenu;
+      MENU *menu = item->imenu;
 
       if ((!(item->opt & O_SELECTABLE)) ||
          (menu && (menu->opt & O_ONEVALUE)))
index bfc633164b499c803a964a33f0dc771a8042d795..b4b1bc14eb77fc32cb3c72425dd3b116b146333c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_post.c,v 1.34 2020/12/12 00:38:14 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.35 2021/03/27 23:46:29 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -58,7 +58,6 @@ _nc_Post_Item(const MENU *menu, const ITEM *item)
   int count = 0;
   bool isfore = FALSE, isback = FALSE, isgrey = FALSE;
   int name_len;
-  int desc_len;
 
   assert(menu->win);
 
@@ -132,6 +131,7 @@ _nc_Post_Item(const MENU *menu, const ITEM *item)
     {
       int m = menu->spc_desc / 2;
       int cy = -1, cx = -1;
+      int desc_len;
 
       for (ch = ' ', i = 0; i < menu->spc_desc; i++)
        {
@@ -201,7 +201,7 @@ MENU_EXPORT(void)
 _nc_Draw_Menu(const MENU *menu)
 {
   ITEM *item = menu->items[0];
-  ITEM *lasthor, *lastvert;
+  ITEM *lastvert;
   ITEM *hitem;
   int y = 0;
   chtype s_bkgd;
@@ -217,6 +217,8 @@ _nc_Draw_Menu(const MENU *menu)
 
   do
     {
+      ITEM *lasthor;
+
       wmove(menu->win, y, 0);
 
       hitem = item;
@@ -283,7 +285,6 @@ post_menu(MENU *menu)
 
   if (menu->items && *(menu->items))
     {
-      int y;
       int h = 1 + menu->spc_rows * (menu->rows - 1);
 
       WINDOW *win = Get_Menu_Window(menu);
@@ -291,7 +292,8 @@ post_menu(MENU *menu)
 
       if ((menu->win = newpad(h, menu->width)))
        {
-         y = (maxy >= h) ? h : maxy;
+         int y = (maxy >= h) ? h : maxy;
+
          if (y >= menu->height)
            y = menu->height;
          if (!(menu->sub = subpad(menu->win, y, menu->width, 0, 0)))
index 7d1e7bf5d1065ff3161e31c6983cea86b09bfd4a..3bc0995624174eac2a0b4c21283d6ac970f81b11 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2012,2015 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_req_name.c,v 1.25 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_req_name.c,v 1.26 2021/03/27 23:46:29 tom Exp $")
 
 #define DATA(s) { s }
 
@@ -103,12 +103,13 @@ menu_request_by_name(const char *str)
      to run sequentially through it.
    */
   size_t i = 0;
-  char buf[16];
 
   T((T_CALLED("menu_request_by_name(%s)"), _nc_visbuf(str)));
 
   if (str != 0 && (i = strlen(str)) != 0)
     {
+      char buf[16];
+
       if (i > sizeof(buf) - 2)
        i = sizeof(buf) - 2;
       memcpy(buf, str, i);
index 3999a4e9bd1bdf07327c2fecdace9ca23d43c65e..6060067ed4ad349042f4b4bd13d51969cb1439f2 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.74 2021/01/23 20:42:08 tom Exp $
+# $Id: Makefile.in,v 1.75 2021/03/27 20:39:59 tom Exp $
 ##############################################################################
 # Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 1998-2016,2017 Free Software Foundation, Inc.                    #
@@ -132,7 +132,7 @@ install.libs :: $(DESTDIR)$(bindir) ncurses-config
 @MAKE_PC_FILES@install \
 @MAKE_PC_FILES@install.libs :: pc-files
 @MAKE_PC_FILES@        @$(SHELL) -c 'case "x$(DESTDIR)$(PKG_CONFIG_LIBDIR)" in \
-@MAKE_PC_FILES@                (x/*) \
+@MAKE_PC_FILES@                x/*) \
 @MAKE_PC_FILES@                        mkdir -p $(DESTDIR)$(PKG_CONFIG_LIBDIR); \
 @MAKE_PC_FILES@                        for name in $(PC_FILES); do \
 @MAKE_PC_FILES@                                test -f $$name || continue; \
@@ -140,7 +140,7 @@ install.libs :: $(DESTDIR)$(bindir) ncurses-config
 @MAKE_PC_FILES@                                $(INSTALL_DATA) $$name $(DESTDIR)$(PKG_CONFIG_LIBDIR)/$$name; \
 @MAKE_PC_FILES@                        done \
 @MAKE_PC_FILES@                        ;; \
-@MAKE_PC_FILES@                (*) \
+@MAKE_PC_FILES@                *) \
 @MAKE_PC_FILES@                        echo "...skip actual install: no destination was given" ; \
 @MAKE_PC_FILES@                        ;; \
 @MAKE_PC_FILES@                esac'
@@ -177,7 +177,7 @@ uninstall.data :
 uninstall.libs :
        -rm -f $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
 @MAKE_PC_FILES@        @$(SHELL) -c 'case x$(DESTDIR)$(PKG_CONFIG_LIBDIR) in \
-@MAKE_PC_FILES@        (x/*) \
+@MAKE_PC_FILES@        x/*) \
 @MAKE_PC_FILES@                for name in $(PC_FILES); do \
 @MAKE_PC_FILES@                        test -f $$name || continue; \
 @MAKE_PC_FILES@                        echo uninstalling $$name; \
index 5a71ab0203c67098db6a9f68685e6f7fc797df11..1fc0a02093a624f348bda6b9158a88dd92b34a0e 100644 (file)
@@ -1,5 +1,5 @@
 #!@SHELL@
-# $Id: gen-pkgconfig.in,v 1.49 2021/01/24 00:35:28 tom Exp $
+# $Id: gen-pkgconfig.in,v 1.50 2021/03/27 20:26:16 tom Exp $
 ##############################################################################
 # Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 2009-2015,2018 Free Software Foundation, Inc.                    #
@@ -96,7 +96,7 @@ do
                continue
                ;;
        -L*)
-               lib_check=${opt##-L} 
+               lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
                [ -d "$lib_check" ] || continue
                case "$lib_check" in
                @LD_SEARCHPATH@) # skip standard libdir
index eae39a516ff3bbd9f99723939434023d8eaa1bc2..f4fd4101aaba0ebe72af96b07234724cc52bd5a4 100644 (file)
@@ -1,5 +1,5 @@
 #!@SHELL@
-# $Id: ncurses-config.in,v 1.46 2021/01/23 23:47:46 tom Exp $
+# $Id: ncurses-config.in,v 1.47 2021/03/27 20:26:04 tom Exp $
 ##############################################################################
 # Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 2006-2015,2017 Free Software Foundation, Inc.                    #
@@ -111,7 +111,7 @@ do
                continue
                ;;
        -L*)
-               lib_check=${opt##-L} 
+               lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
                [ -d "$lib_check" ] || continue
                case "$lib_check" in
                @LD_SEARCHPATH@) # skip standard libdir
index c9371a9931c122d9f9edb70ffd38a2161c8eff59..beee9ddd1f4fb1e4597045821e307b5c52c56896 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210323) unstable; urgency=low
+ncurses6 (6.2+20210327) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 22 Mar 2021 20:10:24 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 27 Mar 2021 05:43:25 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index c9371a9931c122d9f9edb70ffd38a2161c8eff59..beee9ddd1f4fb1e4597045821e307b5c52c56896 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210323) unstable; urgency=low
+ncurses6 (6.2+20210327) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 22 Mar 2021 20:10:24 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 27 Mar 2021 05:43:25 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index fe1bd7116b963f8237b710337f4571feeafddf26..74094970631e7a80d618593eb0989fa0ef04667b 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210323) unstable; urgency=low
+ncurses6 (6.2+20210327) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 22 Mar 2021 20:10:24 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 27 Mar 2021 05:43:25 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index bbe68f5f35253a395c6dff38448b1ca46032828d..9f01c9cb273c9ae5e7b9538f1a791c85c2eba8ca 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.449 2021/03/23 07:36:24 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.450 2021/03/27 09:43:25 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 "2"\r
 !define VERSION_YYYY  "2021"\r
-!define VERSION_MMDD  "0323"\r
+!define VERSION_MMDD  "0327"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index e3bd1d4e27e8e01dccabf89813cb38b21b7fa057..d92819d51e6e4ee84b9bdb0b858910fa8a8eb120 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.2
-Release: 20210323
+Release: 20210327
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 9c689985e9312970d6adf2575b8160154b0fc8b5..ac73b8aada5d341fce33399346753030b113caa1 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.2
-Release: 20210323
+Release: 20210327
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 8b82bae8bd2241cc91d74bfe8f31a897b0725f68..0b931621d2756ea2b40480b3f5a7dfe13d6db6fc 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.2
-Release: 20210323
+Release: 20210327
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index f38e8c71454feb1ef6f01ee69ff296263cfb2c8d..9472e5f569aaafd491724cea0bf2271adb02a49f 100644 (file)
@@ -40,7 +40,7 @@
 #include "termsort.c"          /* this C file is generated */
 #include <parametrized.h>      /* so is this */
 
-MODULE_ID("$Id: dump_entry.c,v 1.182 2021/03/20 16:08:32 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.183 2021/03/28 00:09:49 tom Exp $")
 
 #define DISCARD(string) string = ABSENT_STRING
 #define PRINTF (void) printf
@@ -526,13 +526,13 @@ fill_spaces(const char *src)
     size_t size = strlen(fill);
     char *result = 0;
     int pass;
-    int s, d;
+    size_t s, d;
     for (pass = 0; pass < 2; ++pass) {
        for (s = d = 0; src[s] != '\0'; ++s) {
            if (src[s] == ' ') {
                if (pass) {
                    _nc_STRCPY(&result[d], fill, need + 1 - d);
-                   d += (int) size;
+                   d += size;
                } else {
                    need += size;
                }
index 5ca67f0b0f5a9922d55046a8613c9fe4c12edd6e..eb87c90c559e9918d9542b0c2db0993a091e0648 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: dup_field.c,v 1.1 2020/03/21 19:28:36 tom Exp $
+ * $Id: dup_field.c,v 1.2 2021/03/27 23:41:57 tom Exp $
  *
  * Demonstrate move_field().
  */
@@ -42,7 +42,6 @@
 
 static char empty[] = "";
 static FIELD *all_fields[100];
-
 /* *INDENT-OFF* */
 static struct {
     int code;
@@ -213,7 +212,6 @@ my_edit_field(FORM *form, int *result)
     int status;
     FIELD *before;
     unsigned n;
-    int length;
     int before_row;
     int before_col;
     int before_off = offset_in_field(form);
@@ -239,8 +237,8 @@ my_edit_field(FORM *form, int *result)
 
     if (status == E_OK) {
        bool modified = TRUE;
+       int length = buffer_length(before);
 
-       length = buffer_length(before);
        if (length < before_off)
            length = before_off;
        switch (*result) {
index cdad60e928b6a92a9a77ce4cce74e9d3ff53234f..e3077de4de3c8e2c31bd2baf699f36cae7871f9f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2016,2017 Free Software Foundation, Inc.                       *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: list_keys.c,v 1.26 2020/02/02 23:34:34 tom Exp $
+ * $Id: list_keys.c,v 1.27 2021/03/27 23:41:21 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -240,7 +240,7 @@ modified_key(const char *name)
        map |= (bit1 << 1) | (bit2 >> 1);
        _nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
                    "%sF%d", modifiers[map][(unsigned) f_opt], 1 + key);
-    } else if (sscanf(name, "k%[A-Z]%d%c", buffer, &value, &chr) == 2 &&
+    } else if (sscanf(name, "k%80[A-Z]%d%c", buffer, &value, &chr) == 2 &&
               (value > 1 &&
                value <= 8) &&
               (!strcmp(buffer, "UP") ||
@@ -255,7 +255,7 @@ modified_key(const char *name)
                !strcmp(buffer, "PRV"))) {
        _nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
                    "%sk%s", modifiers[value - 1][(unsigned) f_opt], buffer);
-    } else if (sscanf(name, "k%[A-Z]%c", buffer, &chr) == 1 &&
+    } else if (sscanf(name, "k%80[A-Z]%c", buffer, &chr) == 1 &&
               (!strcmp(buffer, "UP") ||
                !strcmp(buffer, "DN"))) {
        _nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
index 8344c56f8c14ed62ea273024fe3e9048fcfe07cf..5e7fc82e3904ace6694ce2f7a2c67065420a9369 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: move_field.c,v 1.7 2020/05/09 12:52:00 tom Exp $
+ * $Id: move_field.c,v 1.8 2021/03/27 23:41:57 tom Exp $
  *
  * Demonstrate move_field().
  */
@@ -41,7 +41,7 @@
 #ifdef HAVE_NETBSD_FORM_H
 #define form_field_row(field) (field)->form_row
 #define form_field_col(field) (field)->form_col
-#else  /* e.g., SVr4, ncurses */
+#else /* e.g., SVr4, ncurses */
 #define form_field_row(field) (field)->frow
 #define form_field_col(field) (field)->fcol
 #endif
@@ -51,7 +51,6 @@
 
 static char empty[] = "";
 static FIELD *all_fields[100];
-
 /* *INDENT-OFF* */
 static struct {
     int code;
@@ -196,7 +195,6 @@ my_edit_field(FORM *form, int *result)
     int status;
     FIELD *before;
     unsigned n;
-    int length;
     int before_row;
     int before_col;
     int before_off = offset_in_field(form);
@@ -222,8 +220,8 @@ my_edit_field(FORM *form, int *result)
 
     if (status == E_OK) {
        bool modified = TRUE;
+       int length = buffer_length(before);
 
-       length = buffer_length(before);
        if (length < before_off)
            length = before_off;
        switch (*result) {
@@ -316,10 +314,10 @@ do_demo(FORM *form)
        size_t needed = (size_t) count;
        FIELD **old_fields = copy_fields(form_fields(form), needed);
        FIELD **new_fields = copy_fields(form_fields(form), needed);
-       int ch;
 
        if (old_fields != NULL && new_fields != NULL) {
            bool found = FALSE;
+           int ch;
 
            /* TODO: move the label too, in parallel with the editing field */
 
@@ -338,7 +336,6 @@ do_demo(FORM *form)
                getyx(stdscr, currow, curcol);
 
                show_status(form, my_field);
-               ch = '?';
                while ((ch = wgetch(form_win(form))) != DO_DEMO) {
                    int field_y = form_field_row(my_field);
                    int field_x = form_field_col(my_field);
index ecd70fbeb41be87cc1b28291968f17bfef936ceb..1aaa5af9d45d6152496ad48a467ca946332056d4 100644 (file)
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: picsmap.c,v 1.136 2021/03/20 16:08:22 tom Exp $
+ * $Id: picsmap.c,v 1.137 2021/03/27 22:52:16 tom Exp $
  *
  * Author: Thomas E. Dickey
  *
@@ -1015,7 +1015,7 @@ parse_xbm(char **data)
        case 0:
        case 1:
        case 2:
-           if (sscanf(s, "#define %s %d%c", buf, &num, &ch) >= 2) {
+           if (sscanf(s, "#define %1024s %d%c", buf, &num, &ch) >= 2) {
                if ((t = strstr(buf, "_width")) != 0) {
                    state |= 1;
                    result->wide = (short) bytes_of(num);
@@ -1036,7 +1036,7 @@ parse_xbm(char **data)
            }
            break;
        case 3:
-           if (sscanf(s, "static char %[^_ ]_bits[]%c", buf, &ch) >= 1) {
+           if (sscanf(s, "static char %1024[^_ ]_bits[]%c", buf, &ch) >= 1) {
                if (strcmp(result->name, buf)) {
                    goto finish;
                }
index 569c2769a98dda0a005b63dc4ea0689676728abd..1a2a29c7cf25e4956315a32144aab34340563854 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 2006-2012,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: redraw.c,v 1.11 2020/02/02 23:34:34 tom Exp $
+ * $Id: redraw.c,v 1.12 2021/03/27 23:41:21 tom Exp $
  *
  * Demonstrate the redrawwin() and wredrawln() functions.
  * Thomas Dickey - 2006/11/4
@@ -82,7 +82,6 @@ test_redraw(WINDOW *win)
     WINDOW *win1;
     WINDOW *win2;
     bool done = FALSE;
-    int ch, y, x;
     int max_y, max_x;
     int beg_y, beg_x;
 
@@ -92,8 +91,11 @@ test_redraw(WINDOW *win)
     keypad(win, TRUE);
     getmaxyx(win, max_y, max_x);
     getbegyx(win, beg_y, beg_x);
+
     while (!done) {
-       ch = wgetch(win);
+       int ch = wgetch(win);
+       int y, x;
+
        getyx(win, y, x);
        switch (ch) {
        case 'q':
index da00d7534dc45ec365ddaa95b1c30dfd0dfba474..4c767a5251104fb232e4906e4bb19f32b713451e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2006-2017,2018 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: savescreen.c,v 1.57 2020/02/02 23:34:34 tom Exp $
+ * $Id: savescreen.c,v 1.58 2021/03/27 23:41:21 tom Exp $
  *
  * Demonstrate save/restore functions from the curses library.
  * Thomas Dickey - 2007/7/14
@@ -86,9 +86,9 @@ setup_next(void)
 static void
 cleanup(char *files[])
 {
-    int n;
-
     if (!keep_dumps) {
+       int n;
+
        for (n = 0; files[n] != 0; ++n) {
            unlink(files[n]);
        }
@@ -169,7 +169,6 @@ dump_screen(char **files, int color, int which, int last, bool use_colors)
 {
 #if USE_WIDEC_SUPPORT
     cchar_t mycc;
-    int myxx;
 #endif
     char *filename = files[which];
     bool dumped = FALSE;
@@ -198,7 +197,7 @@ dump_screen(char **files, int color, int which, int last, bool use_colors)
                    wmove(stdscr, cy, cx);
 #if USE_WIDEC_SUPPORT
                    if (win_wch(curscr, &mycc) != ERR) {
-                       myxx = wcwidth(BaseChar(mycc));
+                       int myxx = wcwidth(BaseChar(mycc));
                        if (myxx > 0) {
                            wadd_wchnstr(stdscr, &mycc, 1);
                            cx += (myxx - 1);
@@ -285,14 +284,9 @@ main(int argc, char *argv[])
     char **files;
     char *fill_by = 0;
 #if USE_WIDEC_SUPPORT
-    int r, g, b;
-    int cube = 0;
-    int cube0 = 16;
-    int cube1;
     cchar_t mycc;
     static const wchar_t mywc[2] =
     {L'#', 0};
-    bool using_rgb = FALSE;
 #endif
 
     setlocale(LC_ALL, "");
@@ -332,6 +326,9 @@ main(int argc, char *argv[])
     curs_set(0);
 
     if (has_colors() && (start_color() == OK) && COLORS >= MAX_ANSI) {
+#if USE_WIDEC_SUPPORT
+       bool using_rgb = FALSE;
+#endif
        static const struct {
            int fg, bg;
        } table[MAX_ANSI] = {
@@ -378,13 +375,13 @@ main(int argc, char *argv[])
                    int r_delta = (r_max / cols);
                    int g_delta = (g_max / cols);
                    int row = 0;
+                   int b = 0;
 
-                   b = 0;
                    using_rgb = TRUE;
                    while (row++ < rows) {
                        int col = 0;
-                       r = 0;
-                       g = g_max;
+                       int r = 0;
+                       int g = g_max;
                        while (col++ < cols) {
                            int color = (((r * (g_max + 1)) + g) * (b_max + 1)
                                         + b + MAX_ANSI);
@@ -404,6 +401,9 @@ main(int argc, char *argv[])
 #endif
        }
        if ((fill_by == 0) && !replaying) {
+#if USE_WIDEC_SUPPORT
+           int cube = 0;
+#endif
            /*
             * Originally (before wide-characters) ncurses supported 16 colors.
             */
@@ -428,8 +428,9 @@ main(int argc, char *argv[])
                cube = 6;
            }
            if (cube != 0) {
-               cube0 = 16;
-               cube1 = cube0 + (cube * cube * cube);
+               int r, g, b;
+               int cube0 = 16;
+               int cube1 = cube0 + (cube * cube * cube);
 
                addch('\n');
                printw("Color cube, %dx%dx%d:\n", cube, cube, cube);
@@ -460,7 +461,6 @@ main(int argc, char *argv[])
                int cols = COLS - 1;
                int row = 0;
 
-               b = 0;
                pair = MAX_ANSI;
                while (row++ < rows) {
                    int col = 0;
index e2c8b6677faa3513ae537fc5f0e7de45d7eaf818..a7ada59ec9c9b9f55e9e9d916fa0ac708698401c 100644 (file)
@@ -1,6 +1,6 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                               *
- * Copyright 2009-2016,2017 Free Software Foundation, Inc.                       *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
+ * Copyright 2009-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * 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 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_add_wchstr.c,v 1.27 2020/02/02 23:34:34 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.28 2021/03/27 23:41:34 tom Exp $
  *
  * Demonstrate the waddwchstr() and wadd_wch functions.
  * Thomas Dickey - 2009/9/12
@@ -132,9 +132,10 @@ ChWLen(const wchar_t *source)
     if (!pass_ctls) {
        size_t adjust = 0;
        size_t n;
-       const char *s;
 
        for (n = 0; n < result; ++n) {
+           const char *s;
+
            if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) {
                adjust += (strlen(s) - 1);
            }
index 3d72e990034400d6840f7f3a12c1defaba3c27e8..33564adb2a51805784181cf6e98a57669476aae0 100644 (file)
@@ -30,7 +30,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: test_sgr.c,v 1.16 2021/03/20 16:04:31 tom Exp $
+ * $Id: test_sgr.c,v 1.17 2021/03/27 22:43:36 tom Exp $
  *
  * A simple demo of the sgr/sgr0 terminal capabilities.
  */
@@ -116,7 +116,7 @@ next_dbitem(void)
            db_item++;
        }
     }
-    printf("** %s\n", result);
+    printf("** %s\n", result ? result : "<null>");
     return result;
 }
 
index f9762b0b328a848550631c63c7eec48d4c4b3f4f..2e01415933e5fee4f51b486c6c6685fd974a1588 100644 (file)
@@ -6,7 +6,7 @@
  *  wrs(5/28/93) -- modified to be consistent (perform identically) with either
  *                  PDCurses or under Unix System V, R4
  *
- * $Id: testcurs.c,v 1.55 2019/12/14 23:25:29 tom Exp $
+ * $Id: testcurs.c,v 1.56 2021/03/27 22:39:50 tom Exp $
  */
 
 #include <test.priv.h>
@@ -160,7 +160,7 @@ inputTest(WINDOW *win)
 {
     int answered;
     int repeat;
-    int w, h, bx, by, sw, sh, i, c, num;
+    int w, h, bx, by, sw, sh, i, num;
     char buffer[80];
     WINDOW *subWin;
     wclear(win);
@@ -238,6 +238,8 @@ inputTest(WINDOW *win)
 #endif
 
     for (;;) {
+       int c;
+
        wmove(win, 3, 5);
        c = wgetch(win);
        wclrtobot(win);
@@ -355,7 +357,6 @@ inputTest(WINDOW *win)
 static void
 outputTest(WINDOW *win)
 {
-    WINDOW *win1;
     char Buffer[80];
     chtype ch;
     int by, bx;
@@ -395,7 +396,7 @@ outputTest(WINDOW *win)
        MvWAddStr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS");
        Continue(win);
     } else {
-       win1 = newwin(10, 50, 14, 25);
+       WINDOW *win1 = newwin(10, 50, 14, 25);
        if (win1 == NULL) {
            endwin();
            return;
@@ -589,9 +590,11 @@ resizeTest(WINDOW *dummy GCC_UNUSED)
 static void
 padTest(WINDOW *dummy GCC_UNUSED)
 {
-    WINDOW *pad, *spad;
+    WINDOW *pad;
 
     if ((pad = newpad(50, 100)) != 0) {
+       WINDOW *spad;
+
        wattron(pad, A_REVERSE);
        MvWAddStr(pad, 5, 2, "This is a new pad");
        (void) wattrset(pad, A_NORMAL);
@@ -679,7 +682,6 @@ main(
        char *argv[]GCC_UNUSED)
 {
     WINDOW *win;
-    int key;
     int old_option = (-1);
     int new_option = 0;
     bool quit = FALSE;
@@ -695,7 +697,10 @@ main(
 
     erase();
     display_menu(old_option, new_option);
+
     for (;;) {
+       int key;
+
 #ifdef A_COLOR
        if (has_colors()) {
            init_pair(1, COLOR_WHITE, COLOR_BLUE);
index 6beadc265a8f1bae896e7f7a54e85414cff8c4f0..30a9c7ffddc8fb2fede6bc5803aaead2baee0766 100644 (file)
@@ -52,7 +52,7 @@
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
- * $Id: view.c,v 1.139 2021/03/20 16:04:20 tom Exp $
+ * $Id: view.c,v 1.140 2021/03/27 22:42:22 tom Exp $
  */
 
 #include <test.priv.h>
@@ -92,12 +92,10 @@ static int
 ch_len(NCURSES_CH_T *src)
 {
     int result = 0;
-#if USE_WIDEC_SUPPORT
-    int count;
-#endif
 
 #if USE_WIDEC_SUPPORT
     for (;;) {
+       int count;
        TEST_CCHAR(src, count, {
            int len = wcwidth(test_wch[0]);
            result += (len > 0) ? len : 1;
@@ -136,7 +134,6 @@ show_all(const char *tag)
     int i;
     int digits;
     char temp[BUFSIZ];
-    NCURSES_CH_T *s;
     time_t this_time;
 
     for (digits = 1, i = num_lines; i > 0; i /= 10) {
@@ -161,8 +158,10 @@ show_all(const char *tag)
 
     scrollok(stdscr, FALSE);   /* prevent screen from moving */
     for (i = 1; i < LINES; i++) {
+       NCURSES_CH_T *s;
        int len;
        int actual = (int) (lptr + i - vec_lines);
+
        if (actual > num_lines) {
            if (i < LINES - 1) {
                int y, x;
@@ -189,8 +188,11 @@ show_all(const char *tag)
             */
            {
                int j;
-               int width = 1, count;
+               int width = 1;
+
                for (j = actual = 0; j < shift; ++j) {
+                   int count;
+
                    TEST_CCHAR(s + j, count, {
                        width = wcwidth(test_wch[0]);
                    }
index e157a7cb69a6648baf0e726cbd8f88e5a70885b6..678c9e172e564ed3baa1a7e609e4d6456c9233d7 100644 (file)
@@ -92,7 +92,7 @@
 /******************************************************************************/
 
 /*
- * $Id: xmas.c,v 1.35 2021/03/20 16:15:31 tom Exp $
+ * $Id: xmas.c,v 1.36 2021/03/27 22:40:53 tom Exp $
  */
 #include <test.priv.h>
 
@@ -500,9 +500,6 @@ reindeer(void)
     y_pos = 0;
 
     for (x_pos = 70; x_pos > 62; x_pos--) {
-       if (x_pos < 62) {
-           y_pos = 1;
-       }
        for (looper = 0; looper < 4; looper++) {
            MvWAddCh(dotdeer0, y_pos, x_pos, (chtype) '.');
            wrefresh(dotdeer0);