Commit MetaInfo

Revisionfad06bd7c13d3acc6969e45cf2d0015ee3e7cf3f (tree)
Time2019-12-08 04:15:05
AuthorSHIRAKATA Kentaro <argrath@ub32...>
CommiterSHIRAKATA Kentaro

Log Message

reduce unused functions

Change Summary

Incremental Difference

--- a/sys/winnt/nttty.c
+++ b/sys/winnt/nttty.c
@@ -92,7 +92,9 @@ int FDECL(process_keystroke,
9292 static void NDECL(init_ttycolor);
9393 static void NDECL(really_move_cursor);
9494 static void NDECL(check_and_set_font);
95+#if 0 /*JP*/
9596 static boolean NDECL(check_font_widths);
97+#endif
9698 static void NDECL(set_known_good_console_font);
9799 static void NDECL(restore_original_console_font);
98100 extern void NDECL(safe_routines);
@@ -713,7 +715,11 @@ char ch;
713715 BACKGROUND_INTENSITY : FOREGROUND_INTENSITY;
714716
715717 cell.attribute = console.attr;
718+#if 0 /*JP*/
716719 cell.character = (console.has_unicode ? console.cpMap[ch] : ch);
720+#else
721+ cell.character = ch;
722+#endif
717723 #if 1 /*JP*//*常に1バイト文字*/
718724 cell.iskanji = 0;
719725 #endif
@@ -758,7 +764,11 @@ int in_ch;
758764 cell_t cell;
759765
760766 cell.attribute = console.attr;
767+#if 0 /*JP*/
761768 cell.character = (console.has_unicode ? cp437[ch] : ch);
769+#else
770+ cell.character = ch;
771+#endif
762772 #if 1 /*JP*//*常に1バイト文字*/
763773 cell.iskanji = 0;
764774 #endif
@@ -1660,6 +1670,7 @@ check_and_set_font()
16601670 #endif
16611671 }
16621672
1673+#if 0 /*JP*/
16631674 /* check_font_widths returns TRUE if all glyphs in current console font
16641675 * fit within the width of a single console cell.
16651676 */
@@ -1759,6 +1770,7 @@ clean_up:
17591770
17601771 return all_glyphs_fit;
17611772 }
1773+#endif
17621774
17631775 /* set_known_good_console_font sets the code page and font used by the console
17641776 * to settings know to work well with NetHack. It also saves the original
@@ -1810,6 +1822,7 @@ restore_original_console_font()
18101822 }
18111823 }
18121824
1825+#if 0 /*JP*/
18131826 /* set_cp_map() creates a mapping of every possible character of a code
18141827 * page to its corresponding WCHAR. This is necessary due to the high
18151828 * cost of making calls to MultiByteToWideChar() for every character we
@@ -1840,6 +1853,7 @@ void set_cp_map()
18401853
18411854 }
18421855 }
1856+#endif
18431857
18441858 #if 0
18451859 /* early_raw_print() is used during early game intialization prior to the
@@ -2002,7 +2016,9 @@ void nethack_enter_nttty()
20022016
20032017 /* check the font before we capture the code page map */
20042018 check_and_set_font();
2019+#if 0 /*JP*/
20052020 set_cp_map();
2021+#endif
20062022
20072023 /* Set console mode */
20082024 DWORD cmode, mask;
--- a/sys/winnt/winnt.c
+++ b/sys/winnt/winnt.c
@@ -608,6 +608,7 @@ winos_ascii_to_wide(const unsigned char c)
608608 return cp437[c];
609609 }
610610
611+#if 0 /*JP*/
611612 BOOL winos_font_support_cp437(HFONT hFont)
612613 {
613614 BOOL allFound = FALSE;
@@ -643,6 +644,7 @@ BOOL winos_font_support_cp437(HFONT hFont)
643644
644645 return allFound;
645646 }
647+#endif
646648
647649 int
648650 windows_early_options(window_opt)
--- a/sys/winnt/winos.h
+++ b/sys/winnt/winos.h
@@ -7,7 +7,9 @@
77
88 #include "win32api.h"
99
10+#if 0 /*JP*/
1011 extern const WCHAR cp437[256];
12+#endif
1113
1214 WCHAR *
1315 winos_ascii_to_wide_str(const unsigned char * src, WCHAR * dst, size_t dstLength);
@@ -15,6 +17,8 @@ winos_ascii_to_wide_str(const unsigned char * src, WCHAR * dst, size_t dstLength
1517 WCHAR
1618 winos_ascii_to_wide(const unsigned char c);
1719
20+#if 0 /*JP*/
1821 BOOL winos_font_support_cp437(HFONT hFont);
22+#endif
1923
2024 #endif // WINOS_H
--- a/win/win32/mhfont.c
+++ b/win/win32/mhfont.c
@@ -45,6 +45,7 @@ mswin_create_splashfont(HWND hWnd)
4545 return font;
4646 }
4747
48+#if 0 /*JP*/
4849 BOOL
4950 mswin_font_supports_unicode(HFONT hFont)
5051 {
@@ -54,6 +55,7 @@ mswin_font_supports_unicode(HFONT hFont)
5455
5556 return FALSE;
5657 }
58+#endif
5759
5860 /* create font based on window type, charater attributes and
5961 window device context */
@@ -203,7 +205,9 @@ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace)
203205
204206 font_table[font_index].code = NHFONT_CODE(win_type, attr);
205207 font_table[font_index].hFont = fnt;
208+#if 0 /*JP*/
206209 font_table[font_index].supportsUnicode = winos_font_support_cp437(fnt);
210+#endif
207211
208212 HGDIOBJ savedFont = SelectObject(hdc, fnt);
209213 SIZE size;
--- a/win/win32/mhfont.h
+++ b/win/win32/mhfont.h
@@ -15,12 +15,16 @@
1515 typedef struct cached_font {
1616 int code;
1717 HFONT hFont;
18+#if 0 /*JP*/
1819 BOOL supportsUnicode;
20+#endif
1921 int width;
2022 int height;
2123 } cached_font;
2224
25+#if 0 /*JP*/
2326 BOOL mswin_font_supports_unicode(HFONT hFont);
27+#endif
2428 cached_font * mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace);
2529 HFONT mswin_create_splashfont(HWND hWnd);
2630 UINT mswin_charset(void);
--- a/win/win32/mhmap.c
+++ b/win/win32/mhmap.c
@@ -49,7 +49,9 @@ typedef struct mswin_nethack_map_window {
4949 POINT map_orig; /* map origin point */
5050
5151 HFONT hMapFont; /* font for ASCII mode */
52+#if 0 /*JP*/
5253 boolean bUnicodeFont; /* font supports unicode page 437 */
54+#endif
5355
5456 int tileWidth; /* width of tile in pixels at 96 dpi */
5557 int tileHeight; /* height of tile in pixels at 96 dpi */
@@ -249,7 +251,9 @@ mswin_map_stretch(HWND hWnd, LPSIZE map_size, BOOL redraw)
249251
250252 data->hMapFont = font;
251253
254+#if 0 /*JP*/
252255 data->bUnicodeFont = winos_font_support_cp437(data->hMapFont);
256+#endif
253257
254258 // set tile size to match font metrics
255259
@@ -922,6 +926,7 @@ paintGlyph(PNHMapWindow data, int i, int j, RECT * rect)
922926 OldFg = SetTextColor(data->backBufferDC, nhcolor_to_RGB(color));
923927 }
924928 #endif
929+#if 0 /*JP*/
925930 if (data->bUnicodeFont) {
926931 wch = winos_ascii_to_wide(ch);
927932 if (wch == 0x2591 || wch == 0x2592) {
@@ -941,6 +946,9 @@ paintGlyph(PNHMapWindow data, int i, int j, RECT * rect)
941946 | DT_SINGLELINE);
942947 }
943948 } else {
949+#else
950+ {
951+#endif
944952 DrawTextA(data->backBufferDC, &ch, 1, rect,
945953 DT_CENTER | DT_VCENTER | DT_NOPREFIX
946954 | DT_SINGLELINE);
--- a/win/win32/mhstatus.c
+++ b/win/win32/mhstatus.c
@@ -273,7 +273,9 @@ static LRESULT
273273 onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
274274 {
275275 SIZE sz;
276+#if 0 /*JP*/
276277 WCHAR wbuf[BUFSZ];
278+#endif
277279 RECT rt;
278280 PAINTSTRUCT ps;
279281 PNHStatusWindow data;
Show on old repository browser