Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package nethack for openSUSE:Factory checked 
in at 2025-07-09 17:27:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nethack (Old)
 and      /work/SRC/openSUSE:Factory/.nethack.new.7373 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nethack"

Wed Jul  9 17:27:49 2025 rev:8 rq:1291315 version:3.4.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/nethack/nethack.changes  2025-03-17 
22:23:14.732650901 +0100
+++ /work/SRC/openSUSE:Factory/.nethack.new.7373/nethack.changes        
2025-07-09 17:28:22.103449184 +0200
@@ -1,0 +2,34 @@
+Tue Jul  8 14:08:40 UTC 2025 - Thomas Zimmermann <tzimmerm...@suse.com>
+
+- Add nethack-WINCHAIN-a-framework-allowing-multiple-processors-be.patch:
+  Define preprocessor token UNUSED to mark unused variables. (boo#1245527)
+
+- Add nethack-address-H4266-build-problem-with-clang-Modules.patch: Fix
+  passing an incorrect function signature for signal handling.
+
+  allmain.c: In function ‘newgame’:
+  allmain.c:507:31: error: passing argument 2 of ‘signal’ from incompatible 
pointer type [-Wincompatible-pointer-types]
+  507 |         (void) signal(SIGINT, (SIG_RET_TYPE) done1);
+      |                               ^~~~~~~~~~~~~~~~~~~~
+      |                               |
+      |                               void (*)(void)
+
+  The patch from upstream changes a number of things for OSX support,
+  but we only take the fixes to signal handling. (boo#1245527)
+
+- Add nethack-tty-xputc.patch: tputs() wants a callback that returns
+  an integer. Backport upstream fix. (boo#1245527)
+
+- Add nethack-gcc15-1.patch: Adopt upstream fix for NetHack 3.6 to
+  the code base to make it build with Gcc 15. Reference avalable at
+  https://nethack.org/v367/bugmore/gcc15-1.diff. (boo#1245527)
+
+- Refresh patches on top of upstream backports.
+
+-------------------------------------------------------------------
+Tue Jul  8 07:30:28 UTC 2025 - Thomas Zimmermann <tzimmerm...@suse.com>
+
+- Start listing patches specific to openSUSE at offset 50. This leaves
+  room for backports in the range below.
+
+-------------------------------------------------------------------

New:
----
  nethack-WINCHAIN-a-framework-allowing-multiple-processors-be.patch
  nethack-address-H4266-build-problem-with-clang-Modules.patch
  nethack-gcc15-1.patch
  nethack-tty-xputc.patch

----------(New B)----------
  New:
- Add nethack-WINCHAIN-a-framework-allowing-multiple-processors-be.patch:
  Define preprocessor token UNUSED to mark unused variables. (boo#1245527)
  New:
- Add nethack-address-H4266-build-problem-with-clang-Modules.patch: Fix
  passing an incorrect function signature for signal handling.
  New:
- Add nethack-gcc15-1.patch: Adopt upstream fix for NetHack 3.6 to
  the code base to make it build with Gcc 15. Reference avalable at
  New:
- Add nethack-tty-xputc.patch: tputs() wants a callback that returns
  an integer. Backport upstream fix. (boo#1245527)
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nethack.spec ++++++
--- /var/tmp/diff_new_pack.kKBZNk/_old  2025-07-09 17:28:22.967485236 +0200
+++ /var/tmp/diff_new_pack.kKBZNk/_new  2025-07-09 17:28:22.967485236 +0200
@@ -27,18 +27,26 @@
 Source1:        nethack-rpmlintrc
 # PATCH-FIX-UPSTREAM nethack-escapes-revamp.patch boo#1239138
 Patch0:         nethack-escapes-revamp.patch
+# PATCH-FIX-UPSTREAM 
nethack-WINCHAIN-a-framework-allowing-multiple-processors-be.patch boo#1245527
+Patch1:         
nethack-WINCHAIN-a-framework-allowing-multiple-processors-be.patch
+# PATCH-FIX-UPSTREAM 
nethack-address-H4266-build-problem-with-clang-Modules.patch boo#1245527
+Patch2:         nethack-address-H4266-build-problem-with-clang-Modules.patch
+# PATCH-FIX-UPSTREAM nethack-tty-xputc.patch boo#1245527
+Patch3:         nethack-tty-xputc.patch
+# PATCH-FIX-UPSTREAM nethack-gcc15-1.patch boo#1245527
+Patch4:         nethack-gcc15-1.patch
 # PATCH-FIX-OPENSUSE nethack-config.patch Adapt build to openSUSE systems
-Patch1:         nethack-config.patch
+Patch50:        nethack-config.patch
 # PATCH-FIX-OPENSUSE nethack-decl.patch Do not redeclare system interfaces
-Patch2:         nethack-decl.patch
+Patch51:        nethack-decl.patch
 # PATCH-FIX-OPENSUSE nethack-escape-char.patch
-Patch3:         nethack-escape-char.patch
+Patch52:        nethack-escape-char.patch
 # PATCH-FIX-OPENSUSE nethack-secure.patch Handle SECURE in recover utility
-Patch4:         nethack-secure.patch
+Patch53:        nethack-secure.patch
 # PATCH-FIX-OPENSUSE nethack-gzip.patch Use gzip compression
-Patch5:         nethack-gzip.patch
+Patch54:        nethack-gzip.patch
 # PATCH-FIX-OPENSUSE nethack-reproducible.patch boo#1047218
-Patch6:         nethack-reproducible.patch
+Patch55:        nethack-reproducible.patch
 BuildRequires:  bison
 BuildRequires:  fdupes
 BuildRequires:  flex
@@ -58,14 +66,18 @@
 This package contains the text interface.
 
 %prep
-%setup -q
+%setup
 %patch -P0
-%patch -P1
-%patch -P2
-%patch -P3
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
 %patch -P4
-%patch -P5
-%patch -P6 -p1
+%patch -P50
+%patch -P51
+%patch -P52
+%patch -P53
+%patch -P54
+%patch -P55 -p1
 
 %build
 # copy Makefiles and add optimization flags

++++++ nethack-WINCHAIN-a-framework-allowing-multiple-processors-be.patch ++++++
>From 7f6ee2f7598029570bb1cc671d51d67de7e0cfa6 Mon Sep 17 00:00:00 2001
From: keni <keni>
Date: Wed, 11 Jan 2012 18:23:35 +0000
Subject: [PATCH] WINCHAIN - a framework allowing multiple processors between
 core and winport This is the code I built trying to figure out the large
 window size issue. It completely compiles out if not needed (see -DWINCHAIN
 in hints/macos10.7) and except for one call during setup has zero overhead if
 compiled in and not used.  See window.doc for more info.

Defs for UNUSED parms.  I know this has been controversial, so use is isolated
to the chain code and windows.c (where it shouldn't be intrusive and saves about
50 warnings).

Hints file for 10.7, but the build process still needs to be migrated from
the branch.

Backporting notes:
- Only take UNUSED from upstream

---
 include/tradstdc.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Index: nethack-3.4.3/include/tradstdc.h
===================================================================
--- nethack-3.4.3.orig/include/tradstdc.h
+++ nethack-3.4.3/include/tradstdc.h
@@ -263,11 +263,18 @@ typedef genericptr genericptr_t;  /* (voi
  */
 #ifdef __GNUC__
 # if __GNUC__ >= 2
-#define PRINTF_F(f,v) __attribute__ ((format (printf, f, v)))
+#  define PRINTF_F(f,v) __attribute__ ((format (printf, f, v)))
+# endif
+# if __GNUC__ >= 3
+#  define UNUSED __attribute__ ((unused))
 # endif
 #endif
+
 #ifndef PRINTF_F
-#define PRINTF_F(f,v)
+# define PRINTF_F(f,v)
+#endif
+#ifndef UNUSED
+# define UNUSED
 #endif
 
 #endif /* TRADSTDC_H */

++++++ nethack-address-H4266-build-problem-with-clang-Modules.patch ++++++
>From 7a5fb72787412a9989b3ca80b529688265331bc8 Mon Sep 17 00:00:00 2001
From: PatR <ran...@nethack.org>
Date: Wed, 2 Mar 2016 00:37:56 -0800
Subject: address #H4266 - build problem with clang Modules

Report states that using OSX Xcode IDE results in use of 'clang
Modules', whatever those are, and role.c's 'filter' struct ends up
conflicting with a function declared by <curses.h> (or possibly
<ncurses.h> since one includes the other).  src/role.c does not
include <curses.h>, so this smacks of the problems caused by using
precompiled headers on pre-OSX Mac.

Instead of trying to import nethack into Xcode, I temporarily
inserted '#include <curses.h>' at the end of unixconf.h.  gcc did
complain about 'filter' in role.c (but not in invent.c, despite
-Wshadow), and then complained about termcap.c using TRUE when it
wasn't defined (after in had been #undef'd, where there's a comment
stating that it won't be used in the rest of that file), and also
complained about static function winch() in wintty.c conflicting
with external winch() in curses.

This renames 'filter' and 'winch()' to things that won't conflict.
Also, our winch() is a signal handler but had the wrong signature
for one.  And the troublesome use of TRUE was in code that was
supposed to be dealing with int rather than boolean.

Backporting notes:
- only take changes to winch()

---
 doc/fixes36.1     |  2 ++
 src/invent.c      | 10 +++++-----
 src/role.c        | 44 ++++++++++++++++++++++----------------------
 win/tty/termcap.c | 14 ++++++++------
 win/tty/wintty.c  | 22 +++++++++++++++++-----
 5 files changed, 54 insertions(+), 38 deletions(-)

Index: nethack-3.4.3/win/tty/wintty.c
===================================================================
--- nethack-3.4.3.orig/win/tty/wintty.c
+++ nethack-3.4.3/win/tty/wintty.c
@@ -198,8 +198,21 @@ const char *mesg;
 }
 
 #if defined(SIGWINCH) && defined(CLIPPING)
+STATIC_DCL void FDECL(winch_handler, (int));
+
+    /*
+     * This really ought to just set a flag like the hangup handler does,
+     * then check the flag at "safe" times, in case the signal arrives
+     * while something fragile is executing.  Better to have a brief period
+     * where display updates don't fit the new size than for tty internals
+     * to become corrupted.
+     *
+     * 'winch_seen' has been "notyet" for a long time....
+     */
+/*ARGUSED*/
 STATIC_OVL void
-winch()
+winch_handler(sig_unused) /* signal handler is called with at least 1 arg */
+int sig_unused UNUSED;
 {
     int oldLI = LI, oldCO = CO, i;
     register struct WinDesc *cw;
@@ -298,7 +311,7 @@ char** argv;
     ttyDisplay->lastwin = WIN_ERR;
 
 #if defined(SIGWINCH) && defined(CLIPPING)
-    (void) signal(SIGWINCH, winch);
+    (void) signal(SIGWINCH, (SIG_RET_TYPE) winch_handler);
 #endif
 
     /* add one a space forward menu command alias */

++++++ nethack-config.patch ++++++
--- /var/tmp/diff_new_pack.kKBZNk/_old  2025-07-09 17:28:23.015487239 +0200
+++ /var/tmp/diff_new_pack.kKBZNk/_new  2025-07-09 17:28:23.019487406 +0200
@@ -141,18 +141,16 @@
 ===================================================================
 --- sys/unix/Makefile.src.orig
 +++ sys/unix/Makefile.src
-@@ -124,8 +124,8 @@ SYSOBJ = ioctl.o unixmain.o unixtty.o un
- 
- # flags for Linux
+@@ -126,6 +126,8 @@ SYSOBJ = ioctl.o unixmain.o unixtty.o un
  #   compile normally
--# CFLAGS = -O2 -fomit-frame-pointer -I../include
--# LFLAGS = -L/usr/X11R6/lib
-+CFLAGS = -O2 -fomit-frame-pointer -I../include
+ # CFLAGS = -O2 -fomit-frame-pointer -I../include -Wno-old-style-definition 
-Wno-unused-result -Wno-format-overflow
+ # LFLAGS = -L/usr/X11R6/lib
++CFLAGS = -O2 -fomit-frame-pointer -I../include -Wno-old-style-definition 
-Wno-unused-result -Wno-format-overflow
 +LFLAGS = -L/usr/X11R6/lib
  #   OR compile backwards compatible a.out format
  # CFLAGS = -O2 -b i486-linuxaout -fomit-frame-pointer -I../include
  # LFLAGS = -b i486-linuxaout -L/usr/X11R6/lib
-@@ -151,8 +151,8 @@ GNOMEINC=-I/usr/lib/glib/include -I/usr/
+@@ -151,8 +153,8 @@ GNOMEINC=-I/usr/lib/glib/include -I/usr/
  # flags for debugging:
  # CFLAGS = -g -I../include
  
@@ -163,7 +161,7 @@
  
  # The Qt and Be window systems are written in C++, while the rest of
  # NetHack is standard C.  If using Qt, uncomment the LINK line here to get
-@@ -230,8 +230,8 @@ WINOBJ = $(WINTTYOBJ)
+@@ -230,8 +232,8 @@ WINOBJ = $(WINTTYOBJ)
  # WINTTYLIB = -ltermcap
  # WINTTYLIB = -lcurses
  # WINTTYLIB = -lcurses16

++++++ nethack-decl.patch ++++++
--- /var/tmp/diff_new_pack.kKBZNk/_old  2025-07-09 17:28:23.035488074 +0200
+++ /var/tmp/diff_new_pack.kKBZNk/_new  2025-07-09 17:28:23.039488241 +0200
@@ -1,15 +1,8 @@
---- include/system.h
+Index: include/system.h
+===================================================================
+--- include/system.h.orig
 +++ include/system.h
-@@ -87,14 +87,18 @@
- #  endif
- # endif
- #else
-+# ifndef __GLIBC__
- E long lrand48();
- E void srand48();
-+# endif
- #endif /* BSD || ULTRIX || RANDOM */
- 
+@@ -100,7 +100,9 @@ E void srand48();
  #if !defined(BSD) || defined(ultrix)
                        /* real BSD wants all these to return int */
  # ifndef MICRO
@@ -19,7 +12,7 @@
  # endif /* MICRO */
  /* compensate for some CSet/2 bogosities */
  # if defined(OS2_CSET2) && defined(OS2_CSET2_VER_2)
-@@ -113,7 +117,9 @@
+@@ -119,7 +121,9 @@ E void FDECL(exit, (int));
  # if defined(__STDC__) || !defined(FLEX_SCANNER)
  #  ifndef OS2_CSET2
  #   ifndef MONITOR_HEAP
@@ -29,7 +22,7 @@
  #   endif
  #  endif
  # endif
-@@ -346,26 +352,34 @@
+@@ -353,27 +357,35 @@ E char *FDECL(memset, (char*,int,int));
  E void sleep();
  #endif
  #if defined(ULTRIX) || defined(SYSV)
@@ -40,6 +33,7 @@
  #if defined(HPUX)
  E unsigned int FDECL(sleep, (unsigned int));
  #endif
+ #endif
  #ifdef VMS
 +# ifndef __GLIBC__
  E int FDECL(sleep, (unsigned));
@@ -64,7 +58,7 @@
  #  ifdef VMS
  E pid_t NDECL(getppid);
  #  endif
-@@ -476,9 +490,11 @@
+@@ -484,9 +496,11 @@ E  char *sprintf();
  #  if !defined(SVR4) && !defined(apollo)
  #   if !(defined(ULTRIX_PROTO) && defined(__GNUC__))
  #    if !(defined(SUNOS4) && defined(__STDC__)) /* Solaris unbundled cc (acc) 
*/

++++++ nethack-gcc15-1.patch ++++++
Index: include/system.h
===================================================================
--- include/system.h.orig
+++ include/system.h
@@ -57,7 +57,11 @@ typedef long off_t;
 #endif
 #ifndef SIG_RET_TYPE
 # if defined(NHSTDC) || defined(POSIX_TYPES) || defined(OS2) || defined(__DECC)
-#  define SIG_RET_TYPE void (*)()
+#  if defined(__GLIBC__) && defined(__GNUC__)
+#   define SIG_RET_TYPE __sighandler_t
+#  else
+#   define SIG_RET_TYPE void (*)()
+#  endif
 # endif
 #endif
 #ifndef SIG_RET_TYPE
@@ -87,8 +91,10 @@ E int FDECL(srandom, (unsigned int));
 #  endif
 # endif
 #else
+#ifndef __GLIBC__
 E long lrand48();
 E void srand48();
+#endif
 #endif /* BSD || ULTRIX || RANDOM */
 
 #if !defined(BSD) || defined(ultrix)
@@ -342,6 +348,7 @@ E char *FDECL(memset, (char*,int,int));
 # endif /* TOS */
 #endif /* MICRO */
 
+#ifndef __GLIBC__
 #if defined(BSD) && defined(ultrix)    /* i.e., old versions of Ultrix */
 E void sleep();
 #endif
@@ -351,6 +358,7 @@ E unsigned sleep();
 #if defined(HPUX)
 E unsigned int FDECL(sleep, (unsigned int));
 #endif
+#endif
 #ifdef VMS
 E int FDECL(sleep, (unsigned));
 #endif
@@ -501,7 +509,11 @@ E char *FDECL(tgoto, (const char *,int,i
 #else
 # if ! (defined(HPUX) && defined(_POSIX_SOURCE))
 E int FDECL(tgetent, (char *,const char *));
+#if !(defined(__GLIBC__) && defined(__GNUC__))
 E void FDECL(tputs, (const char *,int,int (*)()));
+#else
+E int tputs(const char *, int, int (*)(int));
+#endif
 # endif
 E int FDECL(tgetnum, (const char *));
 E int FDECL(tgetflag, (const char *));
Index: sys/unix/Makefile.src
===================================================================
--- sys/unix/Makefile.src.orig
+++ sys/unix/Makefile.src
@@ -124,7 +124,7 @@ SYSOBJ = ioctl.o unixmain.o unixtty.o un
 
 # flags for Linux
 #   compile normally
-# CFLAGS = -O2 -fomit-frame-pointer -I../include
+# CFLAGS = -O2 -fomit-frame-pointer -I../include -Wno-old-style-definition 
-Wno-unused-result -Wno-format-overflow
 # LFLAGS = -L/usr/X11R6/lib
 #   OR compile backwards compatible a.out format
 # CFLAGS = -O2 -b i486-linuxaout -fomit-frame-pointer -I../include

++++++ nethack-tty-xputc.patch ++++++
>From 0d76f68f2c233c18eebf16d6e5f2afce2f7c0726 Mon Sep 17 00:00:00 2001
From: PatR <ran...@nethack.org>
Date: Sat, 5 Oct 2019 16:49:34 -0700
Subject: tty xputc()

Another part of github issue 227.  Casting a function pointer when
passing it to another function is iffy when lying about the return
type.  tputs() expects a routine which returns int, so give it one.
Other xputc() usage is equivalent to putchar(), so define xputc()
with the same function signature as that has.

The tputs() declarations in system.h should probably be changed
(third argument is a function which takes an int rather than
unspecified parameters) but I've left them alone.  I made that change
to tputs() in sys/share/tclib.c though.

NT and MSDOS changes are untested.  tclib.c compiles ok with clang-
as-gcc on OSX but hasn't been tested with the port that uses it (VMS).
---
 include/wintty.h  | 11 +-------
 sys/msdos/video.c | 13 ++++++----
 sys/share/tclib.c |  9 ++++---
 sys/winnt/nttty.c | 10 +++++---
 sys/winnt/stubs.c |  6 ++---
 win/tty/termcap.c | 64 +++++++++++++++++++++++------------------------
 6 files changed, 54 insertions(+), 59 deletions(-)

Index: nethack-3.4.3/include/wintty.h
===================================================================
--- nethack-3.4.3.orig/include/wintty.h
+++ nethack-3.4.3/include/wintty.h
@@ -99,16 +99,7 @@ E void FDECL(tty_startup,(int*, int*));
 #ifndef NO_TERMS
 E void NDECL(tty_shutdown);
 #endif
-#if defined(apollo)
-/* Apollos don't widen old-style function definitions properly -- they try to
- * be smart and use the prototype, or some such strangeness.  So we have to
- * define UNWIDENDED_PROTOTYPES (in tradstdc.h), which makes CHAR_P below a
- * char.  But the tputs termcap call was compiled as if xputc's argument
- * actually would be expanded. So here, we have to make an exception. */
-E void FDECL(xputc, (int));
-#else
-E void FDECL(xputc, (CHAR_P));
-#endif
+E int FDECL(xputc, (int));
 E void FDECL(xputs, (const char *));
 #if defined(SCREEN_VGA) || defined(SCREEN_8514)
 E void FDECL(xputg, (int, int, unsigned));
Index: nethack-3.4.3/sys/msdos/video.c
===================================================================
--- nethack-3.4.3.orig/sys/msdos/video.c
+++ nethack-3.4.3/sys/msdos/video.c
@@ -565,9 +565,10 @@ const char *s;
        }
 }
 
-void
-xputc(ch)      /* write out character (and attribute) */
-char ch;
+/* same signature as 'putchar()' with potential failure result ignored */
+int
+xputc(ch) /* write out character (and attribute) */
+int ch;
 {
        int i;
        char attribute;
@@ -583,16 +584,17 @@ char ch;
                vga_xputc(ch,attribute);
 #  endif /*SCREEN_VGA*/
        }
+       return 0;
 }
 
-void
-xputg(glyphnum,ch,special)     /* write out a glyph picture at current 
location */
+/* write out a glyph picture at current location */
+void xputg(glyphnum, ch, special)
 int glyphnum;
 int ch;
 unsigned special;
 {
        if (!iflags.grmode || !iflags.tile_view) {
-               xputc((char)ch);
+               (void) xputc((char) ch);
 #  ifdef SCREEN_VGA
        } else {
                vga_xputg(glyphnum, ch, special);
Index: nethack-3.4.3/sys/share/tclib.c
===================================================================
--- nethack-3.4.3.orig/sys/share/tclib.c
+++ nethack-3.4.3/sys/share/tclib.c
@@ -27,7 +27,7 @@ int   FDECL(tgetnum,  (const char *));
 char *FDECL(tgetstr,  (const char *,char **));
 char *FDECL(tgoto,    (const char *,int,int));
 char *FDECL(tparam,   (const char *,char *,int,int,int,int,int));
-void  FDECL(tputs,    (const char *,int,int (*)()));
+void FDECL(tputs, (const char *, int, int (*)(int)));
 
 /* local support data */
 static char *tc_entry;
@@ -431,9 +431,10 @@ tparam(ctl, buf, buflen, row, col, row2,
 /* send a string to the terminal, possibly padded with trailing NULs */
 void
 tputs( string, range, output_func )
-const char *string;    /* characters to output */
-int range;             /* number of lines affected, used for `*' delays */
-int (*output_func)();  /* actual output routine; return value ignored */
+const char *string; /* characters to output */
+int range;          /* number of lines affected, used for `*' delays */
+int FDECL((*output_func),(int)); /* actual output routine;
+                                  * return value ignored */
 {
     register int c, num = 0;
     register const char *p = string;
Index: nethack-3.4.3/sys/winnt/nttty.c
===================================================================
--- nethack-3.4.3.orig/sys/winnt/nttty.c
+++ nethack-3.4.3/sys/winnt/nttty.c
@@ -435,13 +435,15 @@ char ch;
        }
 }
 
-void
+/* same signature as 'putchar()' with potential failure result ignored */
+int
 xputc(ch)
-char ch;
+int ch;
 {
        cursor.X = ttyDisplay->curx;
        cursor.Y = ttyDisplay->cury;
-       xputc_core(ch);
+       xputc_core((char) ch);
+       return 0;
 }
 
 void
@@ -449,7 +451,7 @@ xputs(s)
 const char *s;
 {
        int k;
-       int slen = strlen(s);
+       int slen = (int) strlen(s);
 
        if (ttyDisplay) {
                cursor.X = ttyDisplay->curx;
Index: nethack-3.4.3/win/tty/termcap.c
===================================================================
--- nethack-3.4.3.orig/win/tty/termcap.c
+++ nethack-3.4.3/win/tty/termcap.c
@@ -492,11 +492,11 @@ tty_end_screen()
 #endif /* OVLB */
 
 #ifdef OVL0
-/* Note to OVLx tinkerers.  The placement of this overlay controls the location
-   of the function xputc().  This function is not currently in trampoli.[ch]
-   files for what is deemed to be performance reasons.  If this define is moved
-   and or xputc() is taken out of the ROOT overlay, then action must be taken
-   in trampoli.[ch]. */
+/* Note to OVLx tinkerers.  The placement of this overlay controls the
+   location of the function xputc().  This function is not currently in
+   trampoli.[ch] files for what is deemed to be performance reasons.  If
+   this define is moved and or xputc() is taken out of the ROOT overlay,
+   then action must be taken in trampoli.[ch]. */
 
 void
 nocmov(x, y)
@@ -524,7 +524,7 @@ int x,y;
                        cmov(x, y);
                } else {
                        while((int) ttyDisplay->cury < y) {
-                               xputc('\n');
+                               (void) xputc('\n');
                                ttyDisplay->curx = 0;
                                ttyDisplay->cury++;
                        }
@@ -554,16 +554,27 @@ register int x, y;
        ttyDisplay->curx = x;
 }
 
-/* See note at OVLx ifdef above.   xputc() is a special function. */
-void
+/* See note above.  xputc() is a special function for overlays. */
+int
 xputc(c)
-#if defined(apollo)
-int c;
-#else
-char c;
-#endif
+int c; /* actually char, but explicitly specify its widened type */
 {
-       (void) putchar(c);
+       /*
+        * Note:  xputc() as a direct all to putchar() doesn't make any
+        * sense _if_ putchar() is a function.  But if it is a macro, an
+        * overlay configuration would want to avoid hidden code bloat
+        * from multiple putchar() expansions.  And it gets passed as an
+        * argument to tputs() so we have to guarantee an actual function
+        * (while possibly lacking ANSI's (func) syntax to override macro).
+        *
+        * xputc() used to be declared as 'void xputc(c) char c; {}' but
+        * avoiding the proper type 'int' just to avoid (void) casts when
+        * ignoring the result can't have been sufficent reason to add it.
+        * It also had '#if apollo' conditional to have the arg be int.
+        * Matching putchar()'s declaration and using explicit casts where
+        * warranted is more robust, so we're just a jacket around that.
+        */
+       return putchar(c);
 }
 
 void
@@ -573,11 +584,7 @@ const char *s;
 # ifndef TERMLIB
        (void) fputs(s, stdout);
 # else
-#  if defined(NHSTDC) || defined(ULTRIX_PROTO)
-       tputs(s, 1, (int (*)())xputc);
-#  else
        tputs(s, 1, xputc);
-#  endif
 # endif
 }
 
@@ -592,7 +599,7 @@ cl_end()
                register int cx = ttyDisplay->curx+1;
 
                while(cx < CO) {
-                       xputc(' ');
+                       (void) xputc(' ');
                        cx++;
                }
                tty_curs(BASE_WINDOW, (int)ttyDisplay->curx+1,
@@ -747,25 +754,18 @@ tty_delay_output()
        /* BUG: if the padding character is visible, as it is on the 5620
           then this looks terrible. */
        if(flags.null)
+               tputs(
 # ifdef TERMINFO
-               /* cbosgd!cbcephus!pds for SYS V R2 */
-#  ifdef NHSTDC
-               tputs("$<50>", 1, (int (*)())xputc);
-#  else
-               tputs("$<50>", 1, xputc);
-#  endif
-# else
-#  if defined(NHSTDC) || defined(ULTRIX_PROTO)
-               tputs("50", 1, (int (*)())xputc);
+                   "$<50>",
 #  else
-               tputs("50", 1, xputc);
-#  endif
+                   "50",
 # endif
+                   1, xputc);
 
        else if(ospeed > 0 && ospeed < SIZE(tmspc10) && nh_CM) {
                /* delay by sending cm(here) an appropriate number of times */
-               register int cmlen = strlen(tgoto(nh_CM, ttyDisplay->curx,
-                                                       ttyDisplay->cury));
+               register int cmlen =
+                       (int) strlen(tgoto(nh_CM, ttyDisplay->curx, 
ttyDisplay->cury));
                register int i = 500 + tmspc10[ospeed]/2;
 
                while(i > 0) {
@@ -789,7 +789,7 @@ cl_eos()                    /* free after Robert Viduya *
                register int cy = ttyDisplay->cury+1;
                while(cy <= LI-2) {
                        cl_end();
-                       xputc('\n');
+                       (void) xputc('\n');
                        cy++;
                }
                cl_end();

Reply via email to