Commit Graph

17 Commits

Author SHA1 Message Date
Pasi Kallinen
53778ee507 Use single define for max message history
... instead of having every windowport define their own variant.
Affects tty, curses, X11, and Windows GUI.
2024-03-03 11:34:59 +02:00
RainRat
a3658f85ac fix typos 2024-02-28 20:15:56 -08:00
nhmall
688ac6ffbe remove register from variable declarations 2024-02-19 16:30:07 -05:00
nhmall
88f6df2d8b some tabs to spaces
cd src
    grep -P -n '\t' *.c | grep -v "1:"
    cd ../include
    grep -P -n '\t' *.h | grep -v "1:"
    cd ..

side note: win/Qt/*.cpp are full of tabs
2022-10-26 14:21:23 -04:00
nhmall
f963c5aca7 switch source tree from k&r to c99 2021-01-26 21:06:16 -05:00
nhmall
ac9ba38449 file header bump from "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:07:36 -04:00
Pasi Kallinen
b653d0d137 X11: Mouse wheel scrolling for message window 2018-10-21 19:30:05 +03:00
PatR
6d9ac874dd X11 scrolling message window
The scroll bar on the message window doesn't work for me, just like
the one on the extend commands menu.  Moving the pointer to it does
change the cursor, but neither trying to drag the slider nor clicking
above it will make it do anything.  However, at some point I managed
to accidentally scroll the message window, and new messages never
restored it to the unscrolled state.  New messages were hidden until
enough even newer ones had been delivered to push the hidden ones
into view.  So this adds key translations to scroll the message
window via the arrow keys.  Clicking on the scroll bar doesn't change
focus to the right place, so I have to click the text display area of
the message window.  That triggers a beep (I suspect it's interpreted
as an attempt to move the hero beyond the map.)  But then the messages
can be scrolled via the cursor keys.  Getting focus back to the map
seems tricky since doing it via pointer is interpreted as a travel
command.  Not quite optimal....

Anyway, being able to scroll the message window let me figure out how
to unscroll it when new messages are delivered.
2016-02-06 18:25:42 -08:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt
97d6fade74 Reformat all C files.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
2015-05-09 13:43:16 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
PatR
9de8b03c03 X11 lint suppression
Suppress close to 400 warnings generated by gcc on the win/X11/*.c code,
most due to -Wwrite-strings which makes string literals implicitly have
the 'const' attribute.  (Since modifying a string literal results in
undefined behavior, that is an appropriate check to have enabled, but
it can be troublesome since string literals have type 'char *' and code
that uses them that way is correct provided it avoids modifying them.)

 113  warning: initialization discards qualifiers from pointer target type
 127  warning: assignment discards qualifiers from pointer target type
  29  warning: passing argument discards qualifiers from pointer target type
 109  warning: unused parameter
  12  warning: comparison between signed and unsigned

The nhStr() hack casts to 'char *', explicitly removing 'const', for
situations where it isn't feasible to make code directly honor const.
The vast marjority of uses are for the second parameter to XtSetArg(),
which is a macro that actually performs an assignment with the second
argument rather than passing it in a function.  It takes values like
'XtNtop', which doesn't need to be altered (although in many places I
changed that to nhStr(XtNtop) for uniformity with the surrounding code,
and 'XtNbottom', which does need to have the extra const stripping to
avoid a warning.  Go figure.

The nhUse() hack actually uses its argument in a meaningless way if the
code is compiled with FORCE_ARG_USAGE defined.  When GCC_WARN is defined,
FORCE_ARG_USAGE will be enabled if it hasn't been already.  Example:

 /*ARGUSED*/
 int foo(arg)
   int arg;  /* not used */
 {
+  nhUse(arg);
   return 0;
 }

The extra line will expand to ';' when FORCE_ARG_USAGE is not defined
or too
   nhUse_dummy += (unsigned)arg;
when it is.  I figured direct assignment might lead to a different
warning by some compilers in a situation like
   nhUse(arg);
   nhUse(otherarg);
where the first assignment would be clobbered by the second, and using
bitwise operations or safer '+= (arg != 0)' would most likely generate
more non-useful code.  Some tweaking might turn out to be necessary.
2015-05-06 00:59:15 -07:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
keni
665dedc3de Add RCS version lines 2009-05-06 11:00:43 +00:00
nethack.allison
e9b022d579 housekeeping: mark trunk sources 3.5 (misc) 2005-01-02 17:21:18 +00:00
nethack.allison
742e1e8c90 3.3.2 to 3.4.0 2002-02-04 16:11:00 +00:00
jwalz
97746c89e6 *** empty log message *** 2002-01-05 21:06:03 +00:00