Commit graph

294 commits

Author SHA1 Message Date
John "Elwin" Edwards
de0518b00e Remove old installation instructions. 2016-03-19 16:42:03 -04:00
John "Elwin" Edwards
2d4a66298a Fix some functions not returning the right type. 2016-03-19 16:18:58 -04:00
John "Elwin" Edwards
2e20820d1b README.txt: remove outdated information. 2016-03-12 14:36:25 -05:00
John "Elwin" Edwards
84db7dbc2a Super-Rogue: fix saving and restoring on Windows.
The problem turned out to be that the save file wasn't being deleted
because it was still open.
2016-03-12 14:29:07 -05:00
John "Elwin" Edwards
8df0a6308d Merge the GCC5 and build fix branches.
This fixes all warnings produced by GCC 5, except the ones related to
system functions.  Those could be fixed by including the proper headers,
but it would be better to replace the system-dependent code with
functions from mdport.c.
2016-03-11 19:47:52 -05:00
John "Elwin" Edwards
758c6b1bf0 arogue7, xrogue: improve the handling of the arguments to fuses.
fuse() now expects a pointer as the argument to a fuse function.  If
this is one of the functions that takes int, fuse() follows the pointer
and stores that value in the f_list slot, in the integer field of the
argument union.  When the fuse goes off, do_fuses() recognizes the
function and passes it the integer field instead of the pointer.

This has the disadvantage of hard-coding the functions that require int
in daemon.c, but since the int is copied into f_list, it no longer has
to be in static or global memory, which simplifies several files.
2016-03-11 17:40:00 -05:00
John "Elwin" Edwards
dafa5cc722 XRogue: fix some uses of entire structs instead of their members.
Some calls to runto() were given a pointer to the player struct instead
of to the player's coordinates.  A call to death() was passed a pointer
to a monster instead of the monster's type number.
2016-03-08 20:47:57 -05:00
John "Elwin" Edwards
e30aa0e491 Makefiles: don't rely on built-in implicit rules.
Not all make implementations will use CPPFLAGS when compiling C files.
2016-03-08 19:45:41 -05:00
John "Elwin" Edwards
e9c84b2637 XRogue: get rid of VOID as an alias for long.
Maybe some compilers in 1986 didn't handle void pointers well, but they
are no longer a concern.
2016-03-07 20:44:01 -05:00
John "Elwin" Edwards
090622896b Rogue V4: add two more function declarations.
Though it was called with different numbers of arguments, add_line()
does not need to be a variadic function.  Making the second argument
mandatory is a better solution.
2016-03-07 19:26:08 -05:00
John "Elwin" Edwards
a6c73eb65a Fix various overlooked causes of warnings.
GCC5 now produces under 300 lines of warnings, but the remaining ones
will require more complex solutions.
2016-03-06 21:02:59 -05:00
John "Elwin" Edwards
5cf0194676 Declare some function arguments as const.
Some functions, mostly in fight.c, declared variables as pointers to
const char but passed them to functions that took pointers to ordinary
char.  The strings did not actually get modified, so adding 'const' to
the function definitions removed the warnings.
2016-03-06 19:32:47 -05:00
John "Elwin" Edwards
fece552183 Don't force the use of GCC.
Due to incomplete autoconfiscation, most of the Makefiles ignored the
C compiler found by 'configure' and always used 'gcc'.
2016-03-06 17:09:17 -05:00
John "Elwin" Edwards
5738b681d8 Rogue V5: prevent error messages from 'make clean'.
Using 'rm -f' will not cause an error if the file to be removed is
already gone.
2016-03-06 17:03:47 -05:00
John "Elwin" Edwards
35bea2ba0d Use uniform return types for functions related to options.
Functions for printing options now return void.  Functions for setting
options now return int.  Argument types still vary, though converting
all the option pointers to void* would be possible.
2016-03-06 14:45:18 -05:00
John "Elwin" Edwards
0a354903e0 Daemons and fuses now return void.
Functions for starting and stopping daemons and fuses now expect the
type 'void (*func)()'.  Only a few functions in XRogue needed to be
modified to fit.  Determining the type of the argument is left for a
later date.

Building with GCC5 should now produce less than 200 lines of warnings
per game.
2016-03-05 20:49:37 -05:00
John "Elwin" Edwards
6dfde944f0 Rogue V4, V5: disable a cheat granting permanent monster detection.
In these two games, a potion of monster detection turns on the player's
SEEMONST flag.  A fuse is set to call turn_see() to turn the flag back
off.  But the save and restore functions do not recognize turn_see() and
fail to set the fuse up again.

When restoring, Rogue V4 merely sets the fuse's function to NULL and
leaves it burning.  When it goes off, a segfault results.  Rogue V5
clears all the fuse's fields, and the player retains the ability to see
all monsters on the level.

The save and restore code can now handle the fuse.  The function used is
a new wrapper, turn_see_off(), which should lead to less problems with
daemons being multiple incompatible types.

Also, Rogue V4 and Super-Rogue now properly clear unrecognized daemon
and fuse slots when restoring a saved game.
2016-03-05 12:10:20 -05:00
John "Elwin" Edwards
cfda1f88e8 Super-Rogue: begin fixing restore failures on Windows.
Start to solve the problem by calling md_init() to set _fmode.  Now
reading a savefile only triggers an error handler and causes an abort
instead of a crash.
2016-03-03 21:30:38 -05:00
John "Elwin" Edwards
8bf09d3064 Merge the GCC5 and build fix branches. 2016-03-02 21:28:34 -05:00
John "Elwin" Edwards
2853120387 XRogue: convert to ANSI-style function declarations. 2016-03-02 21:13:26 -05:00
John "Elwin" Edwards
f5c2898524 Makefile fixes related to installation.
'make install' and 'make uninstall' should now work correctly, placing
the documentation in the proper places.  Any directories needed will be
created.
2016-02-26 17:30:30 -05:00
John "Elwin" Edwards
c6f7d67623 Generate text documentation from the troff source files.
This is done by make, in the 'docs' target, which is now part of the
normal build process.

Unfortunately, not all the games include troff sources.  Getting decent
HTML output from groff is still a difficult process which will not be
attempted at this time.  There are a few bugs in the 'install' and
'uninstall' rules.

Not to mention that the documentation is sometimes inaccurate.
2016-02-21 20:47:12 -05:00
John "Elwin" Edwards
e8e6e604c3 Advanced Rogue 7: convert to ANSI-style function declarations.
Almost 1500 lines of compiler warnings remain, and the GCC developers
are already working on a new version with even more warnings turned on
by default.
2016-02-19 21:02:28 -05:00
John "Elwin" Edwards
eab5aa2ec4 Fix curses library detection.
A custom autoconf macro searched for the curses library, and provided an
option to use ncurses instead of a (presumably deficient) curses
implementation.  Unfortunately, some of the Makefiles ignored the
search's results.

Now that this is fixed, building against pdcurses should be easier too.
2016-02-12 15:12:37 -05:00
John "Elwin" Edwards
c4365554c4 Rogue V5: remove troublesome automatic platform detection.
configure.ac used AC_CANONICAL_SYSTEM to guess the GNU system
description triplets.  The target description was substituted into the
Makefile and formatted into the filename for the binary distribution
tarball.  But 'target' is only intended for cross-compilers.  'host_os'
might have been a better choice.

The tarball filename can still be changed manually, by running make with
an argument of 'DESTSYS=systemname'.

Cross-compiling may be more difficult now, but I am not certain that it
worked properly previously, and due to pending autoconf changes, it was
likely to break anyway.

The top-level config.guess and config.sub are no longer needed, but they
may reappear if better support for cross-compilation is added.
2016-02-12 14:25:47 -05:00
John "Elwin" Edwards
f38b2223c8 Advanced Rogue 5: convert to ANSI function declarations.
This still leaves over a thousand lines of warning messages, mostly
related to the return types of daemons and fuses.
2016-02-07 14:39:21 -05:00
John "Elwin" Edwards
59f448e92e Super-Rogue: convert to ANSI-style function declarations.
This fixes most of the build warnings.
2016-01-31 13:45:07 -05:00
John "Elwin" Edwards
0f87d5b4d8 rogue4: add more function declarations. 2016-01-28 18:55:47 -05:00
John "Elwin" Edwards
c1d6a6af6a rogue4: fix most GCC5 warnings.
Converting all function definitions to ANSI style accounts for most of
the change.  This has exposed other problems, such as daemons not
actually being their stated type, that will require more careful
solutions.
2016-01-27 19:41:05 -05:00
John "Elwin" Edwards
384386d71c rogue3, rogue5: fix all GCC5 warnings.
GCC5 enables more warnings by default, including pre-ANSI implicit
function definitions.  These two games now build cleanly, but the others
will require more effort.
2016-01-23 09:35:14 -05:00
John "Elwin" Edwards
b937606ef8 rogue5: fix 'make install'.
The location of install-sh was hardcoded, so installation has not worked
since that script was moved to the top directory in 78ca6502.
2016-01-22 21:16:54 -05:00
John "Elwin" Edwards
b731962f3b rogue3: replace alarm() calls with a portable function.
Calls to alarm() in main.c are replaced with md_start_checkout_timer(),
so the #ifdefs around nonportable code can be confined to mdport.c.
2016-01-22 19:19:48 -05:00
John "Elwin" Edwards
11f7731a3d Initialize some more pointers for the benefit of MSVC.
There should be no more errors with Visual Studio 2015, in Debug or
Release mode.
2016-01-21 21:10:23 -05:00
John "Elwin" Edwards
71bc6ff210 arogue5: fix a typo that broke compilation with GCC 5.
"msg" had been used instead of "msgw".  I'm not sure why neither GCC 4
nor MSVC caught this.
2016-01-17 18:59:50 -05:00
John "Elwin" Edwards
e1d228b946 Merge the MSVC branch. 2015-11-27 08:59:24 -05:00
John "Elwin" Edwards
231295a1ab Advanced Rogue 7: rename magic users to magicians.
Class names with spaces in them confuse anything that parses the
logfile.  The documentation does refer mostly to magicians.
2015-08-22 10:55:53 -04:00
John "Elwin" Edwards
d20fe81e22 Update the Visual Studio project files.
These files were produced by Visual Studio 2015 on Windows 8.1.
2015-08-18 13:23:56 -04:00
John "Elwin" Edwards
13f4a96d93 XRogue: fix md_htonl() and md_ntohl().
xcrypt requires them.  The implementations in state.c used htonl() and
ntohl(), which aren't available on Windows.  So the Advanced Rogue 7
versions were copied over.

This implementation could be problematic on other systems where
sizeof(long) == 8.  Maybe someday I can convert everything to C99 and
use stdint.h.
2015-08-13 17:17:40 -04:00
John "Elwin" Edwards
b2ebcf72c9 XRogue: add and use more md_ functions.
Portable md_fileno() and md_unlink() have been added to state.c.
2015-08-13 15:15:21 -04:00
John "Elwin" Edwards
7d750a4410 XRogue: fix some header includes. 2015-08-13 14:57:26 -04:00
John "Elwin" Edwards
50961af028 Permit not defining score and log files. 2015-08-13 07:47:01 -04:00
John "Elwin" Edwards
6813e9c5bf Advanced Rogue 7: add and use more md_ functions.
md_fileno() and md_fdopen() are now included.  I still hope to rewrite
everything to use FILE *'s.
2015-08-13 07:38:57 -04:00
John "Elwin" Edwards
916a683bf6 Advanced Rogue 7: remove some unused md_ functions.
md_hasclreol() and md_sleep() were not actually portable.  If they were
needed in the future, fixing them would be possible.
2015-08-12 17:03:15 -04:00
John "Elwin" Edwards
9c93a66db7 Fix some preprocessor directives.
Include process.h in the right place, and use the correct definition of
PATH_MAX, when compiling on Windows.
2015-08-12 16:56:19 -04:00
John "Elwin" Edwards
295a180ea1 Advanced Rogue 7: initialize multiple variables.
MSVC complained that they might be used uninitialized.  In some cases,
this might have been possible.

XRogue already has initializations for all these variables.
2015-08-12 15:42:02 -04:00
John "Elwin" Edwards
b41fb230b0 Advanced Rogue 5: remove an unneeded fstat() call.
The results of the call are no longer used to check for savefile
copying.
2015-08-11 16:19:04 -04:00
John "Elwin" Edwards
9ad85754bd Advanced Rogue 5: replace calls to unlink() with md_unlink(). 2015-08-11 16:12:09 -04:00
John "Elwin" Edwards
4381177d66 Advanced Rogue 5: rearrange some of mdport.c.
process.h is now included in the proper place for compiling with MSVC.

md_sleep() has been removed.  If it were used anywhere, it could have
been fixed by replacing _sleep() with Sleep().
2015-08-11 15:29:31 -04:00
John "Elwin" Edwards
47df21eb66 Advanced Rogue 5: add and use md_fdopen().
Portability is improved.
2015-08-11 15:15:09 -04:00
John "Elwin" Edwards
c0f3e1f004 Advanced Rogue 5: initialize some variables. 2015-08-11 13:13:08 -04:00