]> granicus.if.org Git - nethack/commitdiff
Rename terminate to nh_terminate so VS2015 can compile
authorPasi Kallinen <paxed@alt.org>
Sat, 19 Aug 2017 11:10:29 +0000 (14:10 +0300)
committerPasi Kallinen <paxed@alt.org>
Sat, 19 Aug 2017 11:10:29 +0000 (14:10 +0300)
19 files changed:
include/extern.h
src/cmd.c
src/dungeon.c
src/end.c
src/files.c
src/mail.c
src/options.c
src/pline.c
src/restore.c
src/save.c
src/windows.c
sys/amiga/winami.c
sys/wince/mhmain.c
sys/wince/mswproc.c
win/Qt/qt_win.cpp
win/X11/winmisc.c
win/gem/wingem.c
win/tty/wintty.c
win/win32/mswproc.c

index 1d44d0d37d1b901eb37eb32e79908c1771ec652e..18c3dabbc889b47fdff80057814283dc2011a0c0 100644 (file)
@@ -666,7 +666,7 @@ E void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2) NORETURN;
 E void FDECL(done, (int));
 E void FDECL(container_contents, (struct obj *, 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(num_genocides);
 E void FDECL(delayed_killer, (int, int, const char *));
index cd7faedc8884be92a9950502af403186f214b88f..7437242dddeed158dac95842565fdd59d0279bcc 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -4965,7 +4965,7 @@ end_of_input()
     if (iflags.window_inited)
         exit_nhwindows((char *) 0);
     clearlocks();
-    terminate(EXIT_SUCCESS);
+    nh_terminate(EXIT_SUCCESS);
     /*NOTREACHED*/ /* not necessarily true for vms... */
     return;
 }
index 5b5e7c3690143c0a6501c9ebbff661ac02b1e0d5..e9b6245b7b86c2f5a6268b93af03eaf7fe9fe25f 100644 (file)
@@ -247,7 +247,7 @@ dlb *stream;
         panic(
   "Premature EOF on dungeon description file!\r\nExpected %d bytes - got %d.",
               (size * nitems), (size * cnt));
-        terminate(EXIT_FAILURE);
+        nh_terminate(EXIT_FAILURE);
     }
 }
 
index b4f779cf2d6f3030914e5b935a8c4d6a3d123518..3344f577124020896e92bd2317abf22ea1950519 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -1457,7 +1457,7 @@ int how;
         raw_print("");
         raw_print("");
     }
-    terminate(EXIT_SUCCESS);
+    nh_terminate(EXIT_SUCCESS);
 }
 
 void
@@ -1532,7 +1532,7 @@ boolean identified, all_containers, reportempty;
 
 /* should be called with either EXIT_SUCCESS or EXIT_FAILURE */
 void
-terminate(status)
+nh_terminate(status)
 int status;
 {
     program_state.in_moveloop = 0; /* won't be returning to normal play */
@@ -1549,7 +1549,7 @@ int status;
 #ifdef VMS
     /*
      *  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.
      */
     /* don't call exit() if already executing within an exit handler;
index 49de94a36139161d6f415fe34bafd4440c28163c..1c55133cb5c82429f984d7fd44e18dd4dbe0c38b 100644 (file)
@@ -1205,7 +1205,7 @@ boolean uncomp;
     if (freopen(filename, mode, stream) == (FILE *) 0) {
         (void) fprintf(stderr, "freopen of %s for %scompress failed\n",
                        filename, uncomp ? "un" : "");
-        terminate(EXIT_FAILURE);
+        nh_terminate(EXIT_FAILURE);
     }
 }
 
@@ -1311,7 +1311,7 @@ boolean uncomp;
         perror((char *) 0);
         (void) fprintf(stderr, "Exec to %scompress %s failed.\n",
                        uncomp ? "un" : "", filename);
-        terminate(EXIT_FAILURE);
+        nh_terminate(EXIT_FAILURE);
     } else if (f == -1) {
         perror((char *) 0);
         pline("Fork to %scompress %s failed.", uncomp ? "un" : "", filename);
index 946f81634b6cca396319b9ca838e573f104c2890..9d8986db95e2252b383d23af723d5a1f003dcbaa 100644 (file)
@@ -641,7 +641,7 @@ struct obj *otmp UNUSED;
 
     if (child(1)) {
         (void) execl(mr, mr, (char *) 0);
-        terminate(EXIT_FAILURE);
+        nh_terminate(EXIT_FAILURE);
     }
 #else
 #ifndef AMS /* AMS mailboxes are directories */
index 0bfacc09d95180dbc39b2d77af3354cf9bab7505..0d9d81468349c3ca47461b29c4ea1deacd7fd4c3 100644 (file)
@@ -641,7 +641,7 @@ initoptions()
     /* ... and _must_ parse correctly. */
     if (!read_config_file(SYSCF_FILE, SET_IN_SYS)) {
         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
index 07e55e67934624c9ec9d815780f9bdf9044eb058..27027204256e6b4edd0bda79b3964169d7e98ed8 100644 (file)
@@ -469,7 +469,7 @@ const char *line;
         (void) execv(args[0], (char *const *) args);
         perror((char *) 0);
         (void) fprintf(stderr, "Exec to message handler %s failed.\n", env);
-        terminate(EXIT_FAILURE);
+        nh_terminate(EXIT_FAILURE);
     } else if (f > 0) {
         int status;
 
index 509ff6ed918c11ee4166a46d031bd33b54cc9ea5..7d83575dc62d1fc1b0c109d9308306ad71b5e82e 100644 (file)
@@ -744,7 +744,7 @@ xchar ltmp;
         }
 #endif /* ?AMIGA */
         pline("Be seeing you...");
-        terminate(EXIT_SUCCESS);
+        nh_terminate(EXIT_SUCCESS);
     }
 #endif /* MFLOPPY */
     bufon(nfd);
index 5270cc657af1bd2322b2e9aa807ec43cc9cdce1b..fdbe0a22c76b30209fe8658db99a5702552cde5b 100644 (file)
@@ -94,7 +94,7 @@ dosave()
             /* make sure they see the Saving message */
             display_nhwindow(WIN_MESSAGE, TRUE);
             exit_nhwindows("Be seeing you...");
-            terminate(EXIT_SUCCESS);
+            nh_terminate(EXIT_SUCCESS);
         } else
             (void) doredraw();
     }
@@ -725,7 +725,7 @@ register unsigned num;
     if (failed) {
 #if defined(UNIX) || defined(VMS) || defined(__EMX__)
         if (program_state.done_hup)
-            terminate(EXIT_FAILURE);
+            nh_terminate(EXIT_FAILURE);
         else
 #endif
             panic("cannot write %u bytes to file #%d", num, fd);
@@ -831,7 +831,7 @@ register int fd;
         if (write(fd, outbuf, outbufp) != outbufp) {
 #if defined(UNIX) || defined(VMS) || defined(__EMX__)
             if (program_state.done_hup)
-                terminate(EXIT_FAILURE);
+                nh_terminate(EXIT_FAILURE);
             else
 #endif
                 zerocomp_bclose(fd); /* panic (outbufp != 0) */
@@ -857,7 +857,7 @@ register unsigned num;
         if ((unsigned) write(fd, loc, num) != num) {
 #if defined(UNIX) || defined(VMS) || defined(__EMX__)
             if (program_state.done_hup)
-                terminate(EXIT_FAILURE);
+                nh_terminate(EXIT_FAILURE);
             else
 #endif
                 panic("cannot write %u bytes to file #%d", num, fd);
index 55678a0b45dfeea2b0e1439b86b92decf743d856..5328817c875de27153a4c9669b761e90d4787c05 100644 (file)
@@ -240,7 +240,7 @@ const char *s;
     }
 
     if (windowprocs.win_raw_print == def_raw_print)
-        terminate(EXIT_SUCCESS);
+        nh_terminate(EXIT_SUCCESS);
     wait_synch();
 }
 
index daabd859ddef1cfd714c3fb36250630ab8a5ec6b..58d4165da8c9a451d872c857ed761345f79dca7f 100644 (file)
@@ -436,7 +436,7 @@ amii_askname()
     if (*plname == '\33') {
         clearlocks();
         exit_nhwindows(NULL);
-        terminate(0);
+        nh_terminate(0);
     }
 }
 
@@ -543,7 +543,7 @@ amii_player_selection()
                CloseShWindow( cwin );
                clearlocks();
                exit_nhwindows(NULL);
-               terminate(0);
+               nh_terminate(0);
                }
                else
                    DisplayBeep( NULL );
@@ -573,7 +573,7 @@ amii_player_selection()
                CloseShWindow( cwin );
                clearlocks();
                exit_nhwindows(NULL);
-               terminate(0);
+               nh_terminate(0);
                break;
            }
        }
@@ -1368,7 +1368,7 @@ amii_player_selection()
                 free((genericptr_t) selected);
             clearlocks();
             exit_nhwindows(NULL);
-            terminate(0);
+            nh_terminate(0);
             /*NOTREACHED*/
             return;
         }
index 58af9f7ddbc5ca67f1e11b62a4aafa11d56c56bd..98abd0177c4fc7551d1d67695209f5b47e4f9e2b 100644 (file)
@@ -487,7 +487,7 @@ MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
         hangup(1);
 #else
         dosave0();
-        terminate(EXIT_SUCCESS);
+        nh_terminate(EXIT_SUCCESS);
 #endif
     }
         return 0;
@@ -503,7 +503,7 @@ MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
         free((PNHMainWindow) GetWindowLong(hWnd, GWL_USERDATA));
         SetWindowLong(hWnd, GWL_USERDATA, (LONG) 0);
 
-        terminate(EXIT_SUCCESS);
+        nh_terminate(EXIT_SUCCESS);
     } break;
 
     /*-----------------------------------------------------------------------*/
index 5a0ff989d1c8745873bf0e9d13f7a04d1a64c728..500306875aec303966c32038a4ae3f0059a59140 100644 (file)
@@ -680,7 +680,7 @@ mswin_exit_nhwindows(const char *str)
     // Don't do any of this (?) - exit_nhwindows does not terminate
     // the application
     // DestroyWindow(GetNHApp()->hMainWnd);
-    // terminate(EXIT_SUCCESS);
+    // nh_terminate(EXIT_SUCCESS);
 }
 
 /* Prepare the window to be suspended. */
@@ -1726,7 +1726,7 @@ bail(const char *mesg)
 {
     clearlocks();
     mswin_exit_nhwindows(mesg);
-    terminate(EXIT_SUCCESS);
+    nh_terminate(EXIT_SUCCESS);
     /*NOTREACHED*/
 }
 
index db995f7ea36b352888aa005158190fcf15a58f22..52c925ae63f033bc983185752c052d02259ba5f8 100644 (file)
@@ -4039,7 +4039,7 @@ void NetHackQtMainWindow::closeEvent(QCloseEvent* e)
                if (dosave0()) {
                    u.uhp = -1;
                    NetHackQtBind::qt_exit_nhwindows(0);
-                   terminate(EXIT_SUCCESS);
+                   nh_terminate(EXIT_SUCCESS);
                }
                break;
            case 1:
@@ -4639,7 +4639,7 @@ void NetHackQtBind::qt_askname()
     // Quit
     clearlocks();
     qt_exit_nhwindows(0);
-    terminate(0);
+    nh_terminate(0);
 }
 
 void NetHackQtBind::qt_get_nh_event()
index b96902588b36a25a278b77c7ea76a69a656d1ca2..7f71b0ca315d2cca862da16dd6fefd08d95a1e4c 100644 (file)
@@ -370,7 +370,7 @@ X11_player_selection()
         if (ps_selected == PS_QUIT || program_state.done_hup) {
             clearlocks();
             X11_exit_nhwindows((char *) 0);
-            terminate(0);
+            nh_terminate(0);
         } else if (ps_selected == PS_RANDOM) {
             flags.initrole = ROLE_RANDOM;
         } 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) {
                 clearlocks();
                 X11_exit_nhwindows((char *) 0);
-                terminate(0);
+                nh_terminate(0);
             } else if (ps_selected == PS_RANDOM) {
                 flags.initrace = ROLE_RANDOM;
             } 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) {
                 clearlocks();
                 X11_exit_nhwindows((char *) 0);
-                terminate(0);
+                nh_terminate(0);
             } else if (ps_selected == PS_RANDOM) {
                 flags.initgend = ROLE_RANDOM;
             } 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) {
                 clearlocks();
                 X11_exit_nhwindows((char *) 0);
-                terminate(0);
+                nh_terminate(0);
             } else if (ps_selected == PS_RANDOM) {
                 flags.initalign = ROLE_RANDOM;
             } else if (ps_selected < 0 || ps_selected >= num_algns) {
index 1d059eed00fdd86bcb4073f3be3481d07a391b20..72daffd14550a4fbd435b899f74f28cddc12034b 100644 (file)
@@ -129,7 +129,7 @@ const char *mesg;
 {
     clearlocks();
     Gem_exit_nhwindows(mesg);
-    terminate(EXIT_SUCCESS);
+    nh_terminate(EXIT_SUCCESS);
     /*NOTREACHED*/
 }
 
index 3ac407a5615d1c7ef895d5a902bfadb61fd4ef41..7e504d669960b8868c2f0ad49691a0df4f6e95df 100644 (file)
@@ -221,7 +221,7 @@ const char *mesg;
 {
     clearlocks();
     tty_exit_nhwindows(mesg);
-    terminate(EXIT_SUCCESS);
+    nh_terminate(EXIT_SUCCESS);
     /*NOTREACHED*/
 }
 
@@ -2663,7 +2663,7 @@ boolean complain;
             }
             if (complain)
                 sleep(10); /* want to wait_synch() but stdin is gone */
-            terminate(EXIT_FAILURE);
+            nh_terminate(EXIT_FAILURE);
         }
         (void) close(fd);
 #ifdef notyet
index fe3ce07b57e6aabf06fdf167599667956f8ea0e3..9f4e0103c3daf86d0a72eb2cb51667e4748f8b4e 100644 (file)
@@ -2067,7 +2067,7 @@ bail(const char *mesg)
 {
     clearlocks();
     mswin_exit_nhwindows(mesg);
-    terminate(EXIT_SUCCESS);
+    nh_terminate(EXIT_SUCCESS);
     /*NOTREACHED*/
 }