From 5ad16d203740f38312eb3684b3207352ffead95d Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Sun, 30 Nov 2003 11:51:09 +0000 Subject: [PATCH] make static table Fix templates not inlining with gcc Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1470 --- src/gui/render_normal.h | 6 +++--- src/gui/render_scale2x.h | 2 +- src/gui/render_templates.h | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gui/render_normal.h b/src/gui/render_normal.h index 1c87ade1..380fff5a 100644 --- a/src/gui/render_normal.h +++ b/src/gui/render_normal.h @@ -53,12 +53,12 @@ static void Normal(Bit8u * src,Bitu x,Bitu y,Bitu _dx,Bitu _dy) { } -RENDER_Part_Handler Normal_SINGLE_8[4]={ +static RENDER_Part_Handler Normal_SINGLE_8[4]={ Normal<8,8 ,false>,Normal<8,16,false>, Normal<8,24,false>,Normal<8,32,false>, }; -RENDER_Part_Handler Normal_DOUBLE_8[4]={ +static RENDER_Part_Handler Normal_DOUBLE_8[4]={ Normal<8,8 ,true>,Normal<8,16,true>, Normal<8,24,true>,Normal<8,32,true>, -}; \ No newline at end of file +}; diff --git a/src/gui/render_scale2x.h b/src/gui/render_scale2x.h index c48ddc19..fcbc16f7 100644 --- a/src/gui/render_scale2x.h +++ b/src/gui/render_scale2x.h @@ -69,7 +69,7 @@ static void AdvMame2x(Bit8u * src,Bitu x,Bitu y,Bitu _dx,Bitu _dy) { } -RENDER_Part_Handler AdvMame2x_8_Table[4]={ +static RENDER_Part_Handler AdvMame2x_8_Table[4]={ AdvMame2x<8,8>,AdvMame2x<8,16>,AdvMame2x<8,24>,AdvMame2x<8,32> }; diff --git a/src/gui/render_templates.h b/src/gui/render_templates.h index 3d903609..d5228cdb 100644 --- a/src/gui/render_templates.h +++ b/src/gui/render_templates.h @@ -1,5 +1,11 @@ -template -static INLINE void AddDst(Bit8u * & dst,Bitu val) { +#ifdef __GNUC__ +template static INLINE void AddDst(Bit8u * & dst,Bitu val) __attribute__ ((always_inline)); +template static INLINE Bitu LineSize(Bitu pixels) __attribute__ ((always_inline)); +template static INLINE Bitu LoadSrc(Bit8u * & src) __attribute__ ((always_inline)); +template static INLINE Bitu ConvBPP(Bitu val) __attribute__ ((always_inline)); +#endif + +template static INLINE void AddDst(Bit8u * & dst,Bitu val) { switch (dbpp) { case 8: *(Bit8u*)dst=val;dst+=1;break; case 16:*(Bit16u*)dst=val;dst+=2;break;