From 120705742e445cfe56a0d48755a3fe8bca9af332 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Thu, 6 Sep 2018 16:13:22 +0800 Subject: [PATCH] cleanup and remove unused code --- include/gdi.h | 18 ------------------ src/font/bitmapfont.c | 18 ++++++++---------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/include/gdi.h b/include/gdi.h index a0d7392f..fd2c9842 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -8551,24 +8551,6 @@ MG_EXPORT BOOL GUIAPI AddGlyphsToBMPFont (DEVFONT* dev_font, BITMAP* glyph_bmp, */ MG_EXPORT void GUIAPI DestroyBMPFont (DEVFONT* dev_font); -#ifdef _DEBUG -/* - * Dump avl tree info - */ -void dump_tree (DEVFONT *dev_font); - -/* - * look up a node in bitmap font avl tree. - */ -int avl_look_up (DEVFONT *dev_font, char *start_mchar, int n); - -/* - * destroy bitmap font avl tree. - */ -void destroy_avl_tree (DEVFONT *dev_font); - -#endif /* end of _DEBUG */ - #endif /* end of _MGFONT_BMPF */ /** diff --git a/src/font/bitmapfont.c b/src/font/bitmapfont.c index a2e26862..2a7ca0c9 100644 --- a/src/font/bitmapfont.c +++ b/src/font/bitmapfont.c @@ -66,7 +66,7 @@ static int def_glyph_width = 8; /* default bitmap glyph */ static unsigned char def_glyph [] = {0}; -#define DEFGLYPHWIDTH 8; +#define DEFGLYPHWIDTH 8 /*** tree ops ***/ @@ -595,10 +595,9 @@ void DestroyBMPFont (DEVFONT* dev_font) return; } -#ifdef _DEBUG +#if 0 -static int -print_tree_struct ( GLYPHTREENODE *node) +static int print_tree_struct ( GLYPHTREENODE *node) { if (node == NULL) @@ -621,8 +620,7 @@ print_tree_struct ( GLYPHTREENODE *node) return 0; } - -void dump_tree (DEVFONT *dev_font) +static void dump_tree (DEVFONT *dev_font) { if (dev_font == NULL || dev_font->data == NULL || @@ -636,7 +634,7 @@ void dump_tree (DEVFONT *dev_font) _MG_PRINTF ("\n"); } -int avl_look_up (DEVFONT *dev_font, char *start_mchar, int n) +static int avl_look_up (DEVFONT *dev_font, char *start_mchar, int n) { GLYPHTREENODE *p; int offset; @@ -659,7 +657,7 @@ int avl_look_up (DEVFONT *dev_font, char *start_mchar, int n) return 0; } -void destroy_avl_tree (DEVFONT *dev_font) +static void destroy_avl_tree (DEVFONT *dev_font) { if (dev_font && ((BMPFONTINFO *)dev_font->data)->tree != NULL) { @@ -670,7 +668,7 @@ void destroy_avl_tree (DEVFONT *dev_font) } } -void draw_root_bmp (HDC hdc, DEVFONT *dev_font) +static void draw_root_bmp (HDC hdc, DEVFONT *dev_font) { GLYPHTREENODE *root = ((BMPFONTINFO *)dev_font->data)->tree; @@ -681,7 +679,7 @@ void draw_root_bmp (HDC hdc, DEVFONT *dev_font) FillBoxWithBitmap (hdc, 0, 400, 0, 0, root->data); } -#endif /* End of _DEBUG */ +#endif #endif /* End of _MGFONT_BMPF */