From e4007238635e38463762a126f371232863dd46a4 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 26 Feb 2015 22:48:32 -0500 Subject: [PATCH] undo a set of code reverts in last commit --- win/win32/mhmain.c | 3 ++- win/win32/mhsplash.c | 5 +++-- win/win32/mswproc.c | 41 +++++++++++++++-------------------------- win/win32/winMS.h | 2 +- 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/win/win32/mhmain.c b/win/win32/mhmain.c index 75afd874b..1f7f2e6cb 100644 --- a/win/win32/mhmain.c +++ b/win/win32/mhmain.c @@ -986,7 +986,8 @@ LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) NH_A2W( COPYRIGHT_BANNER_A "\n" COPYRIGHT_BANNER_B "\n" - COPYRIGHT_BANNER_C, + COPYRIGHT_BANNER_C "\n" + COPYRIGHT_BANNER_D, wbuf, BUFSZ ) ); diff --git a/win/win32/mhsplash.c b/win/win32/mhsplash.c index f0b21d7a6..1acab82eb 100644 --- a/win/win32/mhsplash.c +++ b/win/win32/mhsplash.c @@ -7,6 +7,7 @@ #include "mhsplash.h" #include "mhmsg.h" #include "mhfont.h" +#include "date.h" #include "patchlevel.h" #include "dlb.h" @@ -84,8 +85,8 @@ void mswin_display_splash_window (BOOL show_ver) clientrt.right - 2 * SPLASH_OFFSET_X, controlrt.bottom, TRUE); /* Fill the text control */ - Sprintf (buf, "%s\r\n%s\r\n%s\r\n\r\n", COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B, - COPYRIGHT_BANNER_C); + Sprintf (buf, "%s\r\n%s\r\n%s\r\n%s\r\n\r\n", COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B, + COPYRIGHT_BANNER_C, COPYRIGHT_BANNER_D); strsize = strlen(buf); if (show_ver) { diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 513729e43..3dd2a5528 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -28,7 +28,6 @@ #define LLEN 128 -extern const char *killed_by_prefix[]; extern winid WIN_STATUS; #ifdef _DEBUG @@ -135,6 +134,7 @@ struct window_procs mswin_procs = { genl_status_threshold, # endif #endif + genl_can_suspend_yes, }; @@ -216,7 +216,7 @@ void mswin_init_nhwindows(int* argc, char** argv) * write output to a window or stdout. stdout doesn't make sense on Windows * non-console applications */ - flags.toptenwin = 1; + iflags.toptenwin = 1; set_option_mod_status("toptenwin", SET_IN_FILE); set_option_mod_status("perm_invent", SET_IN_FILE); @@ -1773,16 +1773,17 @@ void mswin_end_screen() } /* -outrip(winid, int) +outrip(winid, int, when) -- The tombstone code. If you want the traditional code use genl_outrip for the value and check the #if in rip.c. */ #define STONE_LINE_LEN 16 -void mswin_outrip(winid wid, int how) +void mswin_outrip(winid wid, int how, time_t when) { char buf[BUFSZ]; + long year; - logDebug("mswin_outrip(%d)\n", wid, how); + logDebug("mswin_outrip(%d, %d, %ld)\n", wid, how, (long)when); if ((wid >= 0) && (wid < MAXWINDOWS) ) { DestroyWindow(GetNHApp()->windowlist[wid].win); GetNHApp()->windowlist[wid].win = mswin_init_RIP_window(); @@ -1805,26 +1806,14 @@ void mswin_outrip(winid wid, int how) putstr(wid, 0, buf); /* Put together death description */ - switch (killer.format) { - default: impossible("bad killer format?"); - case KILLED_BY_AN: - Strcpy(buf, killed_by_prefix[how]); - Strcat(buf, an(killer.name)); - break; - case KILLED_BY: - Strcpy(buf, killed_by_prefix[how]); - Strcat(buf, killer.name); - break; - case NO_KILLER_PREFIX: - Strcpy(buf, killer.name); - break; - } + formatkiller(buf, sizeof buf, how); /* Put death type on stone */ putstr(wid, 0, buf); /* Put year on stone */ - Sprintf(buf, "%4d", getyear()); + year = yyyymmdd(when) / 10000L; + Sprintf(buf, "%4ld", year); putstr(wid, 0, buf); mswin_finish_rip_text(wid); } @@ -2486,17 +2475,17 @@ static void mswin_color_from_string(char *colorstring, HBRUSH* brushptr, COLORRE if (*colorstring == '#') { if (strlen(++colorstring) != 6) return; - red_value = index(hexadecimals, tolower(*colorstring++)) - hexadecimals; + red_value = (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals); red_value *= 16; - red_value += index(hexadecimals, tolower(*colorstring++)) - hexadecimals; + red_value += (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals); - green_value = index(hexadecimals, tolower(*colorstring++)) - hexadecimals; + green_value = (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals); green_value *= 16; - green_value += index(hexadecimals, tolower(*colorstring++)) - hexadecimals; + green_value += (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals); - blue_value = index(hexadecimals, tolower(*colorstring++)) - hexadecimals; + blue_value = (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals); blue_value *= 16; - blue_value += index(hexadecimals, tolower(*colorstring++)) - hexadecimals; + blue_value += (int)(index(hexadecimals, tolower(*colorstring++)) - hexadecimals); *colorptr = RGB(red_value, green_value, blue_value); } else { diff --git a/win/win32/winMS.h b/win/win32/winMS.h index 50295afb5..1e1352670 100644 --- a/win/win32/winMS.h +++ b/win/win32/winMS.h @@ -158,7 +158,7 @@ void mswin_change_color(void); char *mswin_get_color_string(void); void mswin_start_screen(void); void mswin_end_screen(void); -void mswin_outrip(winid wid, int how); +void mswin_outrip(winid wid, int how, time_t when); void mswin_preference_update(const char *pref); char *mswin_getmsghistory(BOOLEAN_P init); void mswin_putmsghistory(const char * msg,BOOLEAN_P);