Skip to content

Commit

Permalink
Fix Windows build and a number of warnings
Browse files Browse the repository at this point in the history
Missed in the "update patchlevel for 9.0" commit was the stupid version
hardcoding in the Windows nmake file, which broke the github windows
build.

While fixing that, I also fixed some warnings reported by the Windows
build, mostly "uninitialized" variables covered in program flow paths
which gcc is smart enough to conclude won't actually end up used
uninitialized but which the Windows compiler is not. No harm
initializing them.

Other reported warnings, I did not fix, either because it looks like
vanilla has already fixed these warnings or because if I changed them to
satisfy the Windows compiler, gcc started complaining.
  • Loading branch information
copperwater committed Jan 20, 2025
1 parent cc2b9ac commit 801e191
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ lock_action(void)
static int
picklock(void)
{
coordxy doorx = u.ux + u.dx, doory = u.uy + u.dy, behind_x, behind_y;
coordxy doorx = u.ux + u.dx, doory = u.uy + u.dy;
coordxy behind_x = u.ux, behind_y = u.uy;
boolean credit_card_slipped;

if (gx.xlock.box) {
Expand Down
4 changes: 2 additions & 2 deletions src/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1720,8 +1720,8 @@ checkfile(char *inp, struct permonst *pm, boolean user_typed_name,
}

/* database entry should exist, now find where it is */
long entry_offset, fseekoffset;
int entry_count;
long entry_offset = 0, fseekoffset;
int entry_count = 0;
int i;
if (found_in_file) {
/* skip over other possible matches for the info */
Expand Down
2 changes: 1 addition & 1 deletion src/pickup.c
Original file line number Diff line number Diff line change
Expand Up @@ -3532,7 +3532,7 @@ static boolean
select_transfer_container(void)
{
char n;
winid win;
winid win = WIN_ERR;
anything any = cg.zeroany;
menu_item *pick_list;
struct obj *otmp, *chosen = (struct obj *) 0;
Expand Down
2 changes: 1 addition & 1 deletion src/worn.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ update_mon_extrinsics(
boolean silently)
{
int unseen;
unsigned short mask;
unsigned short mask = 0;
struct obj *otmp;
int which = (int) armor_provides_extrinsic(obj),
altwhich = altprop(obj);
Expand Down
2 changes: 1 addition & 1 deletion sys/windows/Makefile.nmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ GIT_AVAILABLE=Y
#==============================================================================
#
# The version of the game this Makefile was designed for
NETHACK_VERSION="8.0.0"
NETHACK_VERSION="9.0.0"

# A brief version for use in macros
NHV=$(NETHACK_VERSION:.=)
Expand Down

0 comments on commit 801e191

Please sign in to comment.