[PATCH:libXfont 5/5] Don't build unused code in bitmapfunc.c if all bitmap formats are disabled

Alan Coopersmith alan.coopersmith at oracle.com
Fri May 16 16:21:20 PDT 2014


If the only bitmaps we support are builtins, don't need the code to
register all the bitmap font file handlers.

Fixes gcc warnings:
bitmapfunc.c:110:1: warning: 'BitmapOpenBitmap' defined but not used [-Wunused-function]
 BitmapOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
 ^
bitmapfunc.c:155:1: warning: 'BitmapGetInfoBitmap' defined but not used [-Wunused-function]
 BitmapGetInfoBitmap (FontPathElementPtr fpe, FontInfoPtr pFontInfo,
 ^

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 src/bitmap/bitmapfunc.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/bitmap/bitmapfunc.c b/src/bitmap/bitmapfunc.c
index d942b42..8c6b3d8 100644
--- a/src/bitmap/bitmapfunc.c
+++ b/src/bitmap/bitmapfunc.c
@@ -35,10 +35,17 @@ in this Software without prior written authorization from The Open Group.
 #include <X11/fonts/fntfilst.h>
 #include <X11/fonts/bitmap.h>
 #include <X11/fonts/fontutil.h>
+#if XFONT_BDFFORMAT
 #include <X11/fonts/bdfint.h>
+#endif
+#if XFONT_PCFFORMAT
 #include <X11/fonts/pcf.h>
+#endif
+#if XFONT_SNFFORMAT
 #include "snfstr.h"
+#endif
 
+#if XFONT_PCFFORMAT || XFONT_SNFFORMAT || XFONT_BDFFORMAT
 typedef struct _BitmapFileFunctions {
     int         (*ReadFont) (FontPtr /* pFont */, FontFilePtr /* file */,
 			     int /* bit */, int /* byte */,
@@ -236,3 +243,11 @@ BitmapGetRenderIndex(FontRendererPtr renderer)
 {
     return renderer - renderers;
 }
+
+#else
+void
+BitmapRegisterFontFileFunctions (void)
+{
+    /* nothing to do */
+}
+#endif /* XFONT_PCFFORMAT || XFONT_SNFFORMAT || XFONT_BDFFORMAT */
-- 
1.7.9.2



More information about the xorg-devel mailing list