OSDN Git Service

reduce unused functions
authorSHIRAKATA Kentaro <argrath@ub32.org>
Sun, 23 Jun 2019 21:31:42 +0000 (06:31 +0900)
committerSHIRAKATA Kentaro <argrath@ub32.org>
Sat, 7 Dec 2019 19:15:05 +0000 (04:15 +0900)
sys/winnt/nttty.c
sys/winnt/winnt.c
sys/winnt/winos.h
win/win32/mhfont.c
win/win32/mhfont.h
win/win32/mhmap.c
win/win32/mhstatus.c

index 28fff8c..51b41c7 100644 (file)
@@ -92,7 +92,9 @@ int FDECL(process_keystroke,
 static void NDECL(init_ttycolor);
 static void NDECL(really_move_cursor);
 static void NDECL(check_and_set_font);
+#if 0 /*JP*/
 static boolean NDECL(check_font_widths);
+#endif
 static void NDECL(set_known_good_console_font);
 static void NDECL(restore_original_console_font);
 extern void NDECL(safe_routines);
@@ -713,7 +715,11 @@ char ch;
                                 BACKGROUND_INTENSITY : FOREGROUND_INTENSITY;
 
         cell.attribute = console.attr;
+#if 0 /*JP*/
         cell.character = (console.has_unicode ? console.cpMap[ch] : ch);
+#else
+        cell.character = ch;
+#endif
 #if 1 /*JP*//*\8fí\82É1\83o\83C\83g\95\8e\9a*/
         cell.iskanji = 0;
 #endif
@@ -758,7 +764,11 @@ int in_ch;
     cell_t cell;
 
     cell.attribute = console.attr;
+#if 0 /*JP*/
     cell.character = (console.has_unicode ? cp437[ch] : ch);
+#else
+    cell.character = ch;
+#endif
 #if 1 /*JP*//*\8fí\82É1\83o\83C\83g\95\8e\9a*/
     cell.iskanji = 0;
 #endif
@@ -1660,6 +1670,7 @@ check_and_set_font()
 #endif
 }
 
+#if 0 /*JP*/
 /* check_font_widths returns TRUE if all glyphs in current console font
  * fit within the width of a single console cell.
  */
@@ -1759,6 +1770,7 @@ clean_up:
 
     return all_glyphs_fit;
 }
+#endif
 
 /* set_known_good_console_font sets the code page and font used by the console
  * to settings know to work well with NetHack.  It also saves the original
@@ -1810,6 +1822,7 @@ restore_original_console_font()
     }
 }
 
+#if 0 /*JP*/
 /* set_cp_map() creates a mapping of every possible character of a code
  * page to its corresponding WCHAR.  This is necessary due to the high
  * cost of making calls to MultiByteToWideChar() for every character we
@@ -1840,6 +1853,7 @@ void set_cp_map()
 
     }
 }
+#endif
 
 #if 0
 /* early_raw_print() is used during early game intialization prior to the
@@ -2002,7 +2016,9 @@ void nethack_enter_nttty()
 
     /* check the font before we capture the code page map */
     check_and_set_font();
+#if 0 /*JP*/
     set_cp_map();
+#endif
 
     /* Set console mode */
     DWORD cmode, mask;
index e89005a..de82f9e 100644 (file)
@@ -608,6 +608,7 @@ winos_ascii_to_wide(const unsigned char c)
     return cp437[c];
 }
 
+#if 0 /*JP*/
 BOOL winos_font_support_cp437(HFONT hFont)
 {
     BOOL allFound = FALSE;
@@ -643,6 +644,7 @@ BOOL winos_font_support_cp437(HFONT hFont)
 
     return allFound;
 }
+#endif
 
 int
 windows_early_options(window_opt)
index 39a4b40..741be59 100644 (file)
@@ -7,7 +7,9 @@
 
 #include "win32api.h"
 
+#if 0 /*JP*/
 extern const WCHAR cp437[256];
+#endif
 
 WCHAR *
 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
 WCHAR
 winos_ascii_to_wide(const unsigned char c);
 
+#if 0 /*JP*/
 BOOL winos_font_support_cp437(HFONT hFont);
+#endif
 
 #endif // WINOS_H
index 18e0908..475122b 100644 (file)
@@ -45,6 +45,7 @@ mswin_create_splashfont(HWND hWnd)
     return font;
 }
 
+#if 0 /*JP*/
 BOOL 
 mswin_font_supports_unicode(HFONT hFont)
 {
@@ -54,6 +55,7 @@ mswin_font_supports_unicode(HFONT hFont)
 
     return FALSE;
 }
+#endif
 
 /* create font based on window type, charater attributes and
    window device context */
@@ -203,7 +205,9 @@ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace)
 
     font_table[font_index].code = NHFONT_CODE(win_type, attr);
     font_table[font_index].hFont = fnt;
+#if 0 /*JP*/
     font_table[font_index].supportsUnicode = winos_font_support_cp437(fnt);
+#endif
 
     HGDIOBJ savedFont = SelectObject(hdc, fnt);
     SIZE size;
index 9402d54..d43cc56 100644 (file)
 typedef struct cached_font {
     int code;
     HFONT hFont;
+#if 0 /*JP*/
     BOOL supportsUnicode;
+#endif
     int width;
     int height;
 } cached_font;
 
+#if 0 /*JP*/
 BOOL mswin_font_supports_unicode(HFONT hFont);
+#endif
 cached_font * mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace);
 HFONT mswin_create_splashfont(HWND hWnd);
 UINT mswin_charset(void);
index 18bca25..ec4ac76 100644 (file)
@@ -49,7 +49,9 @@ typedef struct mswin_nethack_map_window {
     POINT map_orig;             /* map origin point */
 
     HFONT hMapFont;             /* font for ASCII mode */
+#if 0 /*JP*/
     boolean bUnicodeFont;       /* font supports unicode page 437 */
+#endif
 
     int tileWidth;              /* width of tile in pixels at 96 dpi */
     int tileHeight;             /* height of tile in pixels at 96 dpi */
@@ -249,7 +251,9 @@ mswin_map_stretch(HWND hWnd, LPSIZE map_size, BOOL redraw)
 
         data->hMapFont = font;
 
+#if 0 /*JP*/
         data->bUnicodeFont = winos_font_support_cp437(data->hMapFont);
+#endif
 
         // set tile size to match font metrics
 
@@ -922,6 +926,7 @@ paintGlyph(PNHMapWindow data, int i, int j, RECT * rect)
             OldFg = SetTextColor(data->backBufferDC, nhcolor_to_RGB(color));
         }
     #endif
+#if 0 /*JP*/
         if (data->bUnicodeFont) {
             wch = winos_ascii_to_wide(ch);
             if (wch == 0x2591 || wch == 0x2592) {
@@ -941,6 +946,9 @@ paintGlyph(PNHMapWindow data, int i, int j, RECT * rect)
                     | DT_SINGLELINE);
             }
         } else {
+#else
+        {
+#endif
             DrawTextA(data->backBufferDC, &ch, 1, rect,
                         DT_CENTER | DT_VCENTER | DT_NOPREFIX
                             | DT_SINGLELINE);
index fd44c85..e61c321 100644 (file)
@@ -273,7 +273,9 @@ static LRESULT
 onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
 {
     SIZE sz;
+#if 0 /*JP*/
     WCHAR wbuf[BUFSZ];
+#endif
     RECT rt;
     PAINTSTRUCT ps;
     PNHStatusWindow data;