Rename terminate to nh_terminate so VS2015 can compile

This commit is contained in:
Pasi Kallinen
2017-08-19 14:10:29 +03:00
parent 9eae5a8c4b
commit 189809a55c
19 changed files with 35 additions and 35 deletions
+1 -1
View File
@@ -666,7 +666,7 @@ E void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2) NORETURN;
E void FDECL(done, (int)); E void FDECL(done, (int));
E void FDECL(container_contents, (struct obj *, BOOLEAN_P, E void FDECL(container_contents, (struct obj *, BOOLEAN_P,
BOOLEAN_P, BOOLEAN_P)); BOOLEAN_P, BOOLEAN_P));
E void FDECL(terminate, (int)) NORETURN; E void FDECL(nh_terminate, (int)) NORETURN;
E int NDECL(dovanquished); E int NDECL(dovanquished);
E int NDECL(num_genocides); E int NDECL(num_genocides);
E void FDECL(delayed_killer, (int, int, const char *)); E void FDECL(delayed_killer, (int, int, const char *));
+1 -1
View File
@@ -4965,7 +4965,7 @@ end_of_input()
if (iflags.window_inited) if (iflags.window_inited)
exit_nhwindows((char *) 0); exit_nhwindows((char *) 0);
clearlocks(); clearlocks();
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
/*NOTREACHED*/ /* not necessarily true for vms... */ /*NOTREACHED*/ /* not necessarily true for vms... */
return; return;
} }
+1 -1
View File
@@ -247,7 +247,7 @@ dlb *stream;
panic( panic(
"Premature EOF on dungeon description file!\r\nExpected %d bytes - got %d.", "Premature EOF on dungeon description file!\r\nExpected %d bytes - got %d.",
(size * nitems), (size * cnt)); (size * nitems), (size * cnt));
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
} }
} }
+3 -3
View File
@@ -1457,7 +1457,7 @@ int how;
raw_print(""); raw_print("");
raw_print(""); raw_print("");
} }
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
} }
void void
@@ -1532,7 +1532,7 @@ boolean identified, all_containers, reportempty;
/* should be called with either EXIT_SUCCESS or EXIT_FAILURE */ /* should be called with either EXIT_SUCCESS or EXIT_FAILURE */
void void
terminate(status) nh_terminate(status)
int status; int status;
{ {
program_state.in_moveloop = 0; /* won't be returning to normal play */ program_state.in_moveloop = 0; /* won't be returning to normal play */
@@ -1549,7 +1549,7 @@ int status;
#ifdef VMS #ifdef VMS
/* /*
* This is liable to draw a warning if compiled with gcc, but it's * This is liable to draw a warning if compiled with gcc, but it's
* more important to flag panic() -> really_done() -> terminate() * more important to flag panic() -> really_done() -> nh_terminate()
* as __noreturn__ then to avoid the warning. * as __noreturn__ then to avoid the warning.
*/ */
/* don't call exit() if already executing within an exit handler; /* don't call exit() if already executing within an exit handler;
+2 -2
View File
@@ -1205,7 +1205,7 @@ boolean uncomp;
if (freopen(filename, mode, stream) == (FILE *) 0) { if (freopen(filename, mode, stream) == (FILE *) 0) {
(void) fprintf(stderr, "freopen of %s for %scompress failed\n", (void) fprintf(stderr, "freopen of %s for %scompress failed\n",
filename, uncomp ? "un" : ""); filename, uncomp ? "un" : "");
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
} }
} }
@@ -1311,7 +1311,7 @@ boolean uncomp;
perror((char *) 0); perror((char *) 0);
(void) fprintf(stderr, "Exec to %scompress %s failed.\n", (void) fprintf(stderr, "Exec to %scompress %s failed.\n",
uncomp ? "un" : "", filename); uncomp ? "un" : "", filename);
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
} else if (f == -1) { } else if (f == -1) {
perror((char *) 0); perror((char *) 0);
pline("Fork to %scompress %s failed.", uncomp ? "un" : "", filename); pline("Fork to %scompress %s failed.", uncomp ? "un" : "", filename);
+1 -1
View File
@@ -641,7 +641,7 @@ struct obj *otmp UNUSED;
if (child(1)) { if (child(1)) {
(void) execl(mr, mr, (char *) 0); (void) execl(mr, mr, (char *) 0);
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
} }
#else #else
#ifndef AMS /* AMS mailboxes are directories */ #ifndef AMS /* AMS mailboxes are directories */
+1 -1
View File
@@ -641,7 +641,7 @@ initoptions()
/* ... and _must_ parse correctly. */ /* ... and _must_ parse correctly. */
if (!read_config_file(SYSCF_FILE, SET_IN_SYS)) { if (!read_config_file(SYSCF_FILE, SET_IN_SYS)) {
raw_printf("Error(s) found in SYSCF_FILE, quitting."); raw_printf("Error(s) found in SYSCF_FILE, quitting.");
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
} }
/* /*
* TODO [maybe]: parse the sysopt entries which are space-separated * TODO [maybe]: parse the sysopt entries which are space-separated
+1 -1
View File
@@ -469,7 +469,7 @@ const char *line;
(void) execv(args[0], (char *const *) args); (void) execv(args[0], (char *const *) args);
perror((char *) 0); perror((char *) 0);
(void) fprintf(stderr, "Exec to message handler %s failed.\n", env); (void) fprintf(stderr, "Exec to message handler %s failed.\n", env);
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
} else if (f > 0) { } else if (f > 0) {
int status; int status;
+1 -1
View File
@@ -744,7 +744,7 @@ xchar ltmp;
} }
#endif /* ?AMIGA */ #endif /* ?AMIGA */
pline("Be seeing you..."); pline("Be seeing you...");
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
} }
#endif /* MFLOPPY */ #endif /* MFLOPPY */
bufon(nfd); bufon(nfd);
+4 -4
View File
@@ -94,7 +94,7 @@ dosave()
/* make sure they see the Saving message */ /* make sure they see the Saving message */
display_nhwindow(WIN_MESSAGE, TRUE); display_nhwindow(WIN_MESSAGE, TRUE);
exit_nhwindows("Be seeing you..."); exit_nhwindows("Be seeing you...");
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
} else } else
(void) doredraw(); (void) doredraw();
} }
@@ -725,7 +725,7 @@ register unsigned num;
if (failed) { if (failed) {
#if defined(UNIX) || defined(VMS) || defined(__EMX__) #if defined(UNIX) || defined(VMS) || defined(__EMX__)
if (program_state.done_hup) if (program_state.done_hup)
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
else else
#endif #endif
panic("cannot write %u bytes to file #%d", num, fd); panic("cannot write %u bytes to file #%d", num, fd);
@@ -831,7 +831,7 @@ register int fd;
if (write(fd, outbuf, outbufp) != outbufp) { if (write(fd, outbuf, outbufp) != outbufp) {
#if defined(UNIX) || defined(VMS) || defined(__EMX__) #if defined(UNIX) || defined(VMS) || defined(__EMX__)
if (program_state.done_hup) if (program_state.done_hup)
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
else else
#endif #endif
zerocomp_bclose(fd); /* panic (outbufp != 0) */ zerocomp_bclose(fd); /* panic (outbufp != 0) */
@@ -857,7 +857,7 @@ register unsigned num;
if ((unsigned) write(fd, loc, num) != num) { if ((unsigned) write(fd, loc, num) != num) {
#if defined(UNIX) || defined(VMS) || defined(__EMX__) #if defined(UNIX) || defined(VMS) || defined(__EMX__)
if (program_state.done_hup) if (program_state.done_hup)
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
else else
#endif #endif
panic("cannot write %u bytes to file #%d", num, fd); panic("cannot write %u bytes to file #%d", num, fd);
+1 -1
View File
@@ -240,7 +240,7 @@ const char *s;
} }
if (windowprocs.win_raw_print == def_raw_print) if (windowprocs.win_raw_print == def_raw_print)
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
wait_synch(); wait_synch();
} }
+4 -4
View File
@@ -436,7 +436,7 @@ amii_askname()
if (*plname == '\33') { if (*plname == '\33') {
clearlocks(); clearlocks();
exit_nhwindows(NULL); exit_nhwindows(NULL);
terminate(0); nh_terminate(0);
} }
} }
@@ -543,7 +543,7 @@ amii_player_selection()
CloseShWindow( cwin ); CloseShWindow( cwin );
clearlocks(); clearlocks();
exit_nhwindows(NULL); exit_nhwindows(NULL);
terminate(0); nh_terminate(0);
} }
else else
DisplayBeep( NULL ); DisplayBeep( NULL );
@@ -573,7 +573,7 @@ amii_player_selection()
CloseShWindow( cwin ); CloseShWindow( cwin );
clearlocks(); clearlocks();
exit_nhwindows(NULL); exit_nhwindows(NULL);
terminate(0); nh_terminate(0);
break; break;
} }
} }
@@ -1368,7 +1368,7 @@ amii_player_selection()
free((genericptr_t) selected); free((genericptr_t) selected);
clearlocks(); clearlocks();
exit_nhwindows(NULL); exit_nhwindows(NULL);
terminate(0); nh_terminate(0);
/*NOTREACHED*/ /*NOTREACHED*/
return; return;
} }
+2 -2
View File
@@ -487,7 +487,7 @@ MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
hangup(1); hangup(1);
#else #else
dosave0(); dosave0();
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
#endif #endif
} }
return 0; return 0;
@@ -503,7 +503,7 @@ MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
free((PNHMainWindow) GetWindowLong(hWnd, GWL_USERDATA)); free((PNHMainWindow) GetWindowLong(hWnd, GWL_USERDATA));
SetWindowLong(hWnd, GWL_USERDATA, (LONG) 0); SetWindowLong(hWnd, GWL_USERDATA, (LONG) 0);
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
} break; } break;
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
+2 -2
View File
@@ -680,7 +680,7 @@ mswin_exit_nhwindows(const char *str)
// Don't do any of this (?) - exit_nhwindows does not terminate // Don't do any of this (?) - exit_nhwindows does not terminate
// the application // the application
// DestroyWindow(GetNHApp()->hMainWnd); // DestroyWindow(GetNHApp()->hMainWnd);
// terminate(EXIT_SUCCESS); // nh_terminate(EXIT_SUCCESS);
} }
/* Prepare the window to be suspended. */ /* Prepare the window to be suspended. */
@@ -1726,7 +1726,7 @@ bail(const char *mesg)
{ {
clearlocks(); clearlocks();
mswin_exit_nhwindows(mesg); mswin_exit_nhwindows(mesg);
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
/*NOTREACHED*/ /*NOTREACHED*/
} }
+2 -2
View File
@@ -4039,7 +4039,7 @@ void NetHackQtMainWindow::closeEvent(QCloseEvent* e)
if (dosave0()) { if (dosave0()) {
u.uhp = -1; u.uhp = -1;
NetHackQtBind::qt_exit_nhwindows(0); NetHackQtBind::qt_exit_nhwindows(0);
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
} }
break; break;
case 1: case 1:
@@ -4639,7 +4639,7 @@ void NetHackQtBind::qt_askname()
// Quit // Quit
clearlocks(); clearlocks();
qt_exit_nhwindows(0); qt_exit_nhwindows(0);
terminate(0); nh_terminate(0);
} }
void NetHackQtBind::qt_get_nh_event() void NetHackQtBind::qt_get_nh_event()
+4 -4
View File
@@ -370,7 +370,7 @@ X11_player_selection()
if (ps_selected == PS_QUIT || program_state.done_hup) { if (ps_selected == PS_QUIT || program_state.done_hup) {
clearlocks(); clearlocks();
X11_exit_nhwindows((char *) 0); X11_exit_nhwindows((char *) 0);
terminate(0); nh_terminate(0);
} else if (ps_selected == PS_RANDOM) { } else if (ps_selected == PS_RANDOM) {
flags.initrole = ROLE_RANDOM; flags.initrole = ROLE_RANDOM;
} else if (ps_selected < 0 || ps_selected >= num_roles) { } else if (ps_selected < 0 || ps_selected >= num_roles) {
@@ -439,7 +439,7 @@ X11_player_selection()
if (ps_selected == PS_QUIT || program_state.done_hup) { if (ps_selected == PS_QUIT || program_state.done_hup) {
clearlocks(); clearlocks();
X11_exit_nhwindows((char *) 0); X11_exit_nhwindows((char *) 0);
terminate(0); nh_terminate(0);
} else if (ps_selected == PS_RANDOM) { } else if (ps_selected == PS_RANDOM) {
flags.initrace = ROLE_RANDOM; flags.initrace = ROLE_RANDOM;
} else if (ps_selected < 0 || ps_selected >= num_races) { } else if (ps_selected < 0 || ps_selected >= num_races) {
@@ -507,7 +507,7 @@ X11_player_selection()
if (ps_selected == PS_QUIT || program_state.done_hup) { if (ps_selected == PS_QUIT || program_state.done_hup) {
clearlocks(); clearlocks();
X11_exit_nhwindows((char *) 0); X11_exit_nhwindows((char *) 0);
terminate(0); nh_terminate(0);
} else if (ps_selected == PS_RANDOM) { } else if (ps_selected == PS_RANDOM) {
flags.initgend = ROLE_RANDOM; flags.initgend = ROLE_RANDOM;
} else if (ps_selected < 0 || ps_selected >= num_gends) { } else if (ps_selected < 0 || ps_selected >= num_gends) {
@@ -573,7 +573,7 @@ X11_player_selection()
if (ps_selected == PS_QUIT || program_state.done_hup) { if (ps_selected == PS_QUIT || program_state.done_hup) {
clearlocks(); clearlocks();
X11_exit_nhwindows((char *) 0); X11_exit_nhwindows((char *) 0);
terminate(0); nh_terminate(0);
} else if (ps_selected == PS_RANDOM) { } else if (ps_selected == PS_RANDOM) {
flags.initalign = ROLE_RANDOM; flags.initalign = ROLE_RANDOM;
} else if (ps_selected < 0 || ps_selected >= num_algns) { } else if (ps_selected < 0 || ps_selected >= num_algns) {
+1 -1
View File
@@ -129,7 +129,7 @@ const char *mesg;
{ {
clearlocks(); clearlocks();
Gem_exit_nhwindows(mesg); Gem_exit_nhwindows(mesg);
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
/*NOTREACHED*/ /*NOTREACHED*/
} }
+2 -2
View File
@@ -221,7 +221,7 @@ const char *mesg;
{ {
clearlocks(); clearlocks();
tty_exit_nhwindows(mesg); tty_exit_nhwindows(mesg);
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
/*NOTREACHED*/ /*NOTREACHED*/
} }
@@ -2663,7 +2663,7 @@ boolean complain;
} }
if (complain) if (complain)
sleep(10); /* want to wait_synch() but stdin is gone */ sleep(10); /* want to wait_synch() but stdin is gone */
terminate(EXIT_FAILURE); nh_terminate(EXIT_FAILURE);
} }
(void) close(fd); (void) close(fd);
#ifdef notyet #ifdef notyet
+1 -1
View File
@@ -2067,7 +2067,7 @@ bail(const char *mesg)
{ {
clearlocks(); clearlocks();
mswin_exit_nhwindows(mesg); mswin_exit_nhwindows(mesg);
terminate(EXIT_SUCCESS); nh_terminate(EXIT_SUCCESS);
/*NOTREACHED*/ /*NOTREACHED*/
} }