Commit Graph

611 Commits

Author SHA1 Message Date
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
nhmall
222b4c0023 don't break other ports use of tilemap.c
The modifications made for supporting monster-looking tiles
may not be supported on platforms other than windows yet.
2015-05-09 10:59:10 -04:00
nhmall
20069798d4 Merge branch 'master' into win32-x64-working 2015-05-07 04:52:30 -04:00
Sean Hunt
8c0c587fd7 Restore lost executable bits. 2015-05-06 23:23:48 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
nhmall
1ef94c890f Merge branch 'master' into win32-x64-working
Conflicts:
	include/hack.h
	win/X11/winmenu.c
	win/X11/winstat.c
2015-05-06 19:53:26 -04:00
Derek S. Ray
be98bca06d cherry-pick the YACC/LEX upgrades from elsewhere 2015-05-06 17:55:50 -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
nhmall
8ebf5b1759 Merge branch 'master' into win32-x64-working 2015-05-03 09:01:46 -04:00
PatR
fc567b5ce3 tiles lint
Several instances of "comparison between signed and unsigned".

  win/share/tiletext.c
  win/X11/tile2x11.c
2015-05-03 01:03:24 -07:00
PatR
4283bbde64 tiletxt lint
Use 'const' for string literals when compiling win/share/tilemap.c
with '-DTILETEXT' to generate util/tiletxt.o.
2015-05-02 19:44:35 -07:00
Dion Nicolaas
b6007ac59d BCC is more strict about not statements before parameter declarations 2015-05-02 13:48:44 +02:00
Alex Kompel
a75b84af77 win32_gui: fix text window background color 2015-04-29 12:27:01 -07:00
nhmall
fa238fad65 Merge branch 'master' into win32-x64-working 2015-04-26 08:39:18 -04:00
PatR
6386331148 'I' command support for BUCX
Allow the 'I' command to show inventory of known blessed items via
pseudo object classes B, C, U, and X.  That's instead of an showing
inventory of specific object class.  The two can't be combined
because 'I' operates on single character input.

I had to modify tty_yn_function to prevent it from forcing a BUCX
character into lower case (simply using lower case would cause a
conflict with 'u' and 'x' for inventory of shopping bill), and did
that by checking whether any of the acceptable response characters
are upper case.  Pretty straightforward and shouldn't impact any
other uses that don't specify upper case choices.

I did the same thing for X11.  Other interfaces most likely need
to do something similar.  If they don't, a response of 'B' or 'C'
(for menustyle:traditional or menustyle:combination) will simply
not work, without causing any problems, same as typing an invalid
choice, and 'U' or 'X' will give shop feedback instead of the
requested subset of inventory.

The Guidebook revisions are untested.
2015-04-26 03:20:58 -07:00
nhmall
03dc59b763 put back resource file 2015-04-22 22:05:23 -04:00
nhmall
f7b5d2f751 tiles weren't being copied to the binary directory
Changes to be committed:
	modified:   win/win32/vs2013/NetHackW.vcxproj
2015-04-22 20:28:46 -04:00
nhmall
98e691aa1d visual studio build fix
Changes to be committed:
	modified:   win/win32/vs2013/NetHack.vcxproj
	modified:   win/win32/vs2013/NetHackW.vcxproj
2015-04-22 19:56:05 -04:00
nhmall
aaca36a6d5 build both tty NetHack.exe and gui NetHackW.exe
Changes to be committed:
	modified:   include/config.h
	modified:   include/extern.h
	modified:   include/flag.h
	modified:   include/global.h
	modified:   include/ntconf.h
	modified:   include/wintty.h
	modified:   src/cmd.c
	modified:   src/files.c
	modified:   src/options.c
	modified:   sys/share/pcmain.c
	modified:   sys/share/pcsys.c
	modified:   sys/share/pcunix.c
	modified:   sys/winnt/Makefile.gcc
	modified:   sys/winnt/Makefile.msc
	modified:   sys/winnt/nttty.c
	new file:   sys/winnt/stubs.c
	modified:   sys/winnt/winnt.c
	modified:   util/makedefs.c
	modified:   win/tty/wintty.c

Adjust the code and the command line Makefile so that
you no longer have to choose whether to build the tty
version NetHack.exe, or the gui version NetHackW.exe.

Both will now be built in a single 'nmake install' pass.
2015-04-22 00:07:46 -04:00
nhmall
3969eb2af1 Merge branch 'master' into win32-x64-working
Conflicts:
	src/mon.c

 Changes to be committed:
	modified:   DEVEL/Developer.txt
	modified:   dat/endgame.des
	modified:   include/patchlevel.h
	modified:   include/you.h
	modified:   src/mon.c
	modified:   src/sounds.c
	modified:   src/spell.c
	modified:   src/vault.c
	modified:   win/share/tiletext.c
2015-04-21 06:39:52 -04:00
Alex Kompel
1e06a7c675 win32_gui: remove macros and functions that are unsupported by gcc 2015-04-19 16:34:22 -07:00
Alex Kompel
dc06a5dd90 win32_gui: fix some text window oddities like selecting text on focus 2015-04-19 16:32:31 -07:00
nhmall
09920871f2 invalid escape
Changes to be committed:
	modified:   win/share/tiletext.c
2015-04-19 18:56:49 -04:00
nhmall
4f86d74592 Merge branch 'master' into win32-x64-working 2015-04-19 17:18:43 -04:00
nhmall
0827c0df9d Update the tile RGB values and mappings
Changes to be committed:
	modified:   win/share/monsters.txt
	modified:   win/share/objects.txt
	modified:   win/share/other.txt
	modified:   win/share/tile2bmp.c
	modified:   win/share/tiletext.c
2015-04-19 17:17:03 -04:00
nhmall
59afa8f570 Merge branch 'master' into win32-x64-working 2015-04-19 13:47:09 -04:00
nhmall
56c4475c20 extend the tty statue patch to tiles
Changes to be committed:
	modified:   doc/fixes35.0
	modified:   win/share/gifread.c
	modified:   win/share/monsters.txt
	modified:   win/share/objects.txt
	modified:   win/share/other.txt
	modified:   win/share/tile2bmp.c
	modified:   win/share/tilemap.c

The tty code already had the statue patch included, where
statues are represented by stone versions similar in
appearance to their monster likeness.

This extends it to tiles.

A new pass through the monsters.txt file is done
in tile2bmp to include new modified tiles to the output
file that are gray-scaled versions for mapping to the
NetHack statue glyphs.
2015-04-19 13:31:59 -04:00
Alex Kompel
09d64059cb win32_gui: implement STATUS_VIA_WINDOWPORT and STATUS_HILITES 2015-04-17 22:14:04 -07:00
Dion Nicolaas
eb9f7b3177 typo in comment 2015-04-16 22:40:22 +02:00
Dion Nicolaas
0c4573d82a fix tile2bmp build under mingw. Provide alternatives for Microsoft-specific macros. Be consistent about slashes in gcc Makefile. Don't include shlwapi.h for any compiler. 2015-04-16 22:36:06 +02:00
Alex Kompel
c8679c8e0e win32_gui: encode copy-to-clipboard and save-to-file text in UTF-8 2015-04-15 22:13:10 -07:00
Derek S. Ray
7c644c1507 Merge branch 'win32-x64-working' of https://rodney.nethack.org:20040/git/NHsource into win32-x64-working
* 'win32-x64-working' of https://rodney.nethack.org:20040/git/NHsource: (27 commits)
  Makefile bit
  gcc Makefile updates for recent file additions
  ...

Conflicts:
	src/files.c
2015-04-15 18:30:13 -04:00
Derek S. Ray
df52ba17ec add debugger window support via _RPT*; add regex
currently it's locked behind _MSC_VER, but anything that runs on Win32
should be able to use those functions as long as it has something that
can pass as a debug window.

also, add a non-wildcard-accepting version of showdebug for the dumpit()
functions in dungeon.c and questpgr.c; this makes DEBUGFILES=* workable
without being excruciatingly painful
2015-04-15 18:19:16 -04:00
nhmall
3d3ee78a0b Merge branch 'master' into win32-x64-working
Conflicts:
	src/files.c
	src/potion.c
	sys/winnt/Makefile.msc

 Changes to be committed:
	modified:   .gitignore
	modified:   DEVEL/hooksdir/nhsub
	modified:   dat/.gitignore
	modified:   dat/opthelp
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
	modified:   doc/fixes35.0
	modified:   include/context.h
	modified:   include/decl.h
	modified:   include/extern.h
	modified:   include/flag.h
	modified:   include/hack.h
	modified:   include/patchlevel.h
	modified:   src/apply.c
	modified:   src/attrib.c
	modified:   src/decl.c
	modified:   src/do.c
	modified:   src/do_name.c
	modified:   src/dothrow.c
	modified:   src/eat.c
	modified:   src/files.c
	modified:   src/hack.c
	modified:   src/invent.c
	modified:   src/lock.c
	modified:   src/mklev.c
	modified:   src/mondata.c
	modified:   src/monmove.c
	modified:   src/music.c
	modified:   src/options.c
	modified:   src/potion.c
	modified:   src/pray.c
	modified:   src/sit.c
	modified:   src/sp_lev.c
	modified:   src/uhitm.c
	modified:   sys/share/posixregex.c
	modified:   sys/winnt/Makefile.msc
	modified:   util/.gitignore
	modified:   win/win32/vs2010/NetHackW.vcxproj
2015-04-14 18:23:48 -04:00
Alex Kompel
116a4147a7 win32_gui: follow-up bit on x64 patch (premature optimization) 2015-04-14 09:33:05 -07:00
Alex Kompel
62617092b5 win32_gui: gettting x64 build to work 2015-04-14 08:54:44 -07:00
Alex Kompel
3c6f01f022 win32_gui: couple of perm_invent tweaks 2015-04-13 23:47:42 -07:00
Alex Kompel
7eefb8a250 win32_gui: use AdjustWindowRect to get more accurate measurement of status window 2015-04-13 23:29:02 -07:00
Alex Kompel
16ffab2c3c win32-gui: use showdebug() to control nhtrace logging 2015-04-13 23:19:52 -07:00
Alex Kompel
261c128b84 win32-gui: fix menu item measuring bug (ever-increasing item height on window resize) 2015-04-12 17:47:42 -07:00
nhmall
ed783b9940 yet more integration bits (thanks to my typo) 2015-04-12 16:48:06 -04:00
nhmall
636da9887b more regex integration bits 2015-04-12 13:27:36 -04:00
nhmall
7e781d4013 Merge branch 'master' into win32-x64-working
Conflicts:
	include/config.h
	src/options.c
2015-04-12 11:58:14 -04:00
Derek S. Ray
38861c1e0d add cppregex.cpp to NetHackW so it'll link properly 2015-04-12 11:46:56 -04:00
nhmall
5905a17242 visual studio mods for tribute, sysconf
Changes to be committed:
	modified:   win/win32/mhmenu.h
	modified:   win/win32/vs2013/NetHack.vcxproj
	modified:   win/win32/vs2013/NetHackW.vcxproj
	modified:   win/win32/vs2013/dlb_main.vcxproj
2015-04-12 10:58:13 -04:00
nhmall
83a7513c13 Merge branch 'master' into win32-x64-working
Conflicts:
	src/do_name.c
	src/trap.c
	src/zap.c
	win/X11/winmenu.c
2015-04-12 10:35:00 -04:00
nhmall
7da3ed32e1 tribute post-merge smoothing
Changes to be committed:
	modified:   src/mon.c
	modified:   win/share/objects.txt
2015-04-12 10:31:26 -04:00
nhmall
11560933cc Merge branch 'master' into nhmall-booktribute
Conflicts:
	doc/fixes35.0
	include/extern.h
	src/mkobj.c
	src/mon.c
	src/objnam.c
	win/share/objects.txt
2015-04-12 10:02:17 -04:00
PatR
8b9ce73c31 revised menu searching
Convert search in tty menus from pmatch to case-insensitive pmatchi;
convert search in X11 menus from substring strstri to wildcard pmatchi.

tty bug:  if the menu is full screen, the search prompt and subsequent
user input clobbers the menu header.
2015-04-12 01:48:01 -07:00
nhmall
2cfa05cde1 Merge branch 'master' into win32-x64-working
Conflicts:
	include/config.h
	include/extern.h
	src/do.c
	src/files.c
	src/hack.c
	src/mkobj.c
	src/mon.c
	src/objnam.c
	src/vision.c
	sys/share/pcmain.c
	win/share/other.txt
	win/share/renumtiles.pl
2015-04-12 00:15:40 -04:00