Evas: fix use of __always_inline__ attribute

Fix multiple storage bug.
 * __forceinline is the equivalent of __always_inline__ on Windows. It has
   'extern' as storage, so static must not be used with it
 * use __always_inline__ and not always_inline as attribute value instead.
   No need to add storage class with __always_inline__ too.
 * static inline is fine


SVN revision: 64767
This commit is contained in:
Vincent Torri 2011-11-05 16:51:13 +00:00
parent 14cfa65bd9
commit 3de60c77b4
12 changed files with 67 additions and 40 deletions

View File

@ -58,20 +58,47 @@ dnl call AC_DEFINE for alway_inline if __attribute__((always_inline)) is availab
AC_DEFUN([EFL_ATTRIBUTE_ALWAYS_INLINE],
[
AC_MSG_CHECKING([for __attribute__ ((always_inline))])
have_attribute_forceinline="no"
AC_MSG_CHECKING([for __forceinline])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
__attribute__((always_inline)) inline void foo(void) {}
#include <windows.h>
__forceinline void foo(void) {}
]],
[[
]])],
[have_attribute_always_inline="yes"],
[
have_attribute_always_inline="yes"
have_attribute_forceinline="yes"
],
[have_attribute_always_inline="no"])
AC_MSG_RESULT([${have_attribute_always_inline}])
if test "x${have_attribute_always_inline}" = "xno" ; then
AC_MSG_CHECKING([for __attribute__ ((always_inline))])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
__attribute__((always_inline)) inline void foo(void) {}
]],
[[
]])],
[have_attribute_always_inline="yes"],
[have_attribute_always_inline="no"])
AC_MSG_RESULT([${have_attribute_always_inline}])
fi
if test "x${have_attribute_always_inline}" = "xyes" ; then
AC_DEFINE([EFL_ALWAYS_INLINE], [__attribute__ ((always_inline)) inline], [Macro declaring a function to always be inlined.])
if test "x${have_attribute_forceinline}" = "xyes" ; then
AC_DEFINE([EFL_ALWAYS_INLINE], [__forceinline], [Macro declaring a function to always be inlined.])
else
AC_DEFINE([EFL_ALWAYS_INLINE], [__attribute__ ((always_inline)) inline], [Macro declaring a function to always be inlined.])
fi
else
AC_DEFINE([EFL_ALWAYS_INLINE], [inline], [Macro declaring a function to always be inlined.])
fi

View File

@ -138,7 +138,7 @@ static const DATA8 dither_table[S16_DM_SIZE][S16_DM_SIZE] =
{ 51, 14, 61, 29, 59, 20, 55, 31, 0, 49, 11, 60, 3, 26, 22, 56, 0, 40, 12, 43, 41, 8, 36, 0, 17, 57, 24, 2, 46, 26, 61, 18, 0, 38, 12, 59, 6, 49, 3, 57, 19, 63, 5, 33, 18, 54, 28, 56, 0, 43, 26, 46, 63, 27, 56, 22, 27, 54, 38, 28, 63, 24, 10, 45, 0, 31, 42, 21, 12, 25, 44, 49, 59, 6, 26, 50, 3, 34, 27, 59, 0, 35, 62, 16, 4, 58, 47, 0, 43, 24, 37, 2, 54, 20, 46, 31, 0, 56, 34, 5, 55, 45, 60, 37, 0, 40, 10, 38, 63, 46, 15, 20, 0, 53, 21, 62, 30, 11, 24, 27, 40, 0, 57, 26, 3, 45, 27, 35 }
};
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_convert_from_rgba_pt(const DATA32 *src, DATA16 *dst, DATA8 *alpha,
const int x, const int y)
{
@ -228,7 +228,7 @@ evas_common_soft16_image_convert_from_rgba(Soft16_Image *im, const DATA32 *src)
_soft16_convert_from_rgba_scanline(sp, dp, ap, y, im->cache_entry.w);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_convert_from_rgb_pt(const DATA32 *src, DATA16 *dst,
const int x, const int y)
{

View File

@ -1,6 +1,6 @@
#include "evas_common_soft16.h"
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_glyph_pt_mask_solid_solid(DATA16 *dst,
const DATA16 rgb565,
const DATA32 rgb565_unpack,
@ -49,7 +49,7 @@ _glyph_scanline_mask_solid_solid(DATA16 *dst,
_glyph_pt_mask_solid_solid(start, rgb565, rgb565_unpack, mask);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_glyph_pt_mask_transp_solid(DATA16 *dst,
DATA32 rgb565_unpack,
DATA8 alpha,

View File

@ -281,7 +281,7 @@ _soft16_line_45deg(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int
}
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_line_aliased_pt(DATA16 *dst_itr, DATA16 rgb565, DATA32 rgb565_unpack, DATA8 alpha)
{
if (alpha == 32)

View File

@ -15,7 +15,7 @@
* Regular blend operations
*/
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_blend_transp_solid(DATA16 *p_dst, DATA16 src, DATA8 alpha)
{
if (alpha == 31) *p_dst = src;
@ -30,7 +30,7 @@ _soft16_pt_blend_transp_solid(DATA16 *p_dst, DATA16 src, DATA8 alpha)
}
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_blend_solid_solid(DATA16 *p_dst, DATA16 src)
{
*p_dst = src;
@ -40,7 +40,7 @@ _soft16_pt_blend_solid_solid(DATA16 *p_dst, DATA16 src)
* Blend operations taking an extra alpha (fade in, out)
*/
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_blend_transp_solid_mul_alpha(DATA16 *p_dst, DATA16 src, DATA8 alpha, DATA8 rel_alpha)
{
DATA32 a, b;
@ -57,7 +57,7 @@ _soft16_pt_blend_transp_solid_mul_alpha(DATA16 *p_dst, DATA16 src, DATA8 alpha,
*p_dst = RGB_565_PACK(b);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_blend_solid_solid_mul_alpha(DATA16 *p_dst, DATA16 src, DATA8 rel_alpha)
{
DATA32 a, b;
@ -71,7 +71,7 @@ _soft16_pt_blend_solid_solid_mul_alpha(DATA16 *p_dst, DATA16 src, DATA8 rel_alph
* Blend operations with extra alpha and multiply color
*/
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_blend_transp_solid_mul_color_transp(DATA16 *p_dst, DATA16 src, DATA8 alpha, DATA8 rel_alpha, DATA16 r, DATA16 g, DATA16 b)
{
DATA32 rgb, d;
@ -93,7 +93,7 @@ _soft16_pt_blend_transp_solid_mul_color_transp(DATA16 *p_dst, DATA16 src, DATA8
*p_dst = RGB_565_PACK(d);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_blend_solid_solid_mul_color_transp(DATA16 *p_dst, DATA16 src, DATA8 rel_alpha, DATA16 r, DATA16 g, DATA16 b)
{
int r1, g1, b1;
@ -113,7 +113,7 @@ _soft16_pt_blend_solid_solid_mul_color_transp(DATA16 *p_dst, DATA16 src, DATA8 r
* Blend operations with extra multiply color
*/
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_blend_transp_solid_mul_color_solid(DATA16 *p_dst, DATA16 src, DATA8 alpha, DATA8 r, DATA8 g, DATA8 b)
{
int r1, g1, b1;
@ -136,7 +136,7 @@ _soft16_pt_blend_transp_solid_mul_color_solid(DATA16 *p_dst, DATA16 src, DATA8 a
}
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_blend_solid_solid_mul_color_solid(DATA16 *p_dst, DATA16 src, DATA16 r, DATA16 g, DATA16 b)
{
int r1, g1, b1;

View File

@ -10,7 +10,7 @@
* _soft16_scanline_<description>_<src>_<dst>[_<modifier>]()
*
****************************************************************************/
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_fill_solid_solid(DATA16 *dst, DATA16 rgb565)
{
*dst = rgb565;
@ -52,7 +52,7 @@ _soft16_scanline_fill_solid_solid(DATA16 *dst, int size, DATA16 rgb565)
*start = rgb565;
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft16_pt_fill_transp_solid(DATA16 *dst, DATA32 rgb565_unpack, DATA8 alpha)
{
DATA32 d;

View File

@ -1,6 +1,6 @@
#include "evas_common_soft8.h"
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_convert_from_rgba_pt(const DATA32 * src, DATA8 * dst, DATA8 * alpha)
{
if (A_VAL(src) == 0)
@ -56,7 +56,7 @@ evas_common_soft8_image_convert_from_rgba(Soft8_Image * im, const DATA32 * src)
_soft8_convert_from_rgba_scanline(sp, dp, ap, im->cache_entry.w);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_convert_from_rgb_pt(const DATA32 * src, DATA8 * dst)
{
*dst = GRY_8_FROM_RGB(src);

View File

@ -1,7 +1,7 @@
#include "evas_common_soft8.h"
#include "evas_soft8_scanline_blend.c"
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_glyph_pt_mask_solid_solid(DATA8 * dst, const DATA8 gry8, const DATA8 * mask)
{
DATA8 alpha = *mask;
@ -41,7 +41,7 @@ _glyph_scanline_mask_solid_solid(DATA8 * dst,
_glyph_pt_mask_solid_solid(start, gry8, mask);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_glyph_pt_mask_transp_solid(DATA8 * dst,
DATA8 gry8, DATA8 alpha, const DATA8 * mask)
{

View File

@ -265,7 +265,7 @@ _soft8_line_45deg(Soft8_Image * dst, RGBA_Draw_Context * dc, int x0, int y0,
}
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_line_aliased_pt(DATA8 * dst_itr, DATA8 gry8, DATA8 alpha)
{
if (alpha == 32)

View File

@ -11,7 +11,7 @@
*
****************************************************************************/
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_pt_blend_transp_solid(DATA8 * p_dst, DATA8 src, DATA8 alpha)
{
if (alpha == 0xff)
@ -82,7 +82,7 @@ _soft8_scanline_blend_transp_solid(DATA8 * src, DATA8 * alpha, DATA8 * dst,
_soft8_pt_blend_transp_solid(start, *src, *alpha);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_pt_blend_solid_solid(DATA8 * p_dst, DATA8 src)
{
*p_dst = src;
@ -173,7 +173,7 @@ _soft8_scanline_blend_transp_solid_mul_alpha(DATA8 * src, DATA8 * alpha,
_soft8_pt_blend_transp_solid_mul_alpha(start, *src, *alpha, rel_alpha);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_pt_blend_solid_solid_mul_alpha(DATA8 * p_dst, DATA8 src, DATA8 rel_alpha)
{
*p_dst = GRY_8_BLEND_UNMUL(src, *p_dst, rel_alpha);
@ -209,7 +209,7 @@ _soft8_scanline_blend_solid_solid_mul_alpha(DATA8 * src, DATA8 * dst, int size,
* Blend operations with extra alpha and multiply color
*/
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_pt_blend_transp_solid_mul_color_transp(DATA8 * p_dst, DATA8 src,
DATA8 alpha, DATA8 rel_alpha,
DATA8 r, DATA8 g, DATA8 b)
@ -289,7 +289,7 @@ _soft8_scanline_blend_transp_solid_mul_color_transp(DATA8 * src, DATA8 * alpha,
(start, *src, *alpha, rel_alpha, r, g, b);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_pt_blend_solid_solid_mul_color_transp(DATA8 * p_dst, DATA8 src,
DATA8 rel_alpha, DATA8 r, DATA8 g,
DATA8 b)
@ -329,7 +329,7 @@ _soft8_scanline_blend_solid_solid_mul_color_transp(DATA8 * src, DATA8 * dst,
/***********************************************************************
* Blend operations with extra multiply color
*/
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_pt_blend_transp_solid_mul_color_solid(DATA8 * p_dst, DATA8 src,
DATA8 alpha, DATA8 r, DATA8 g,
DATA8 b)
@ -411,7 +411,7 @@ _soft8_scanline_blend_transp_solid_mul_color_solid(DATA8 * src, DATA8 * alpha,
(start, *src, *alpha, r, g, b);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_pt_blend_solid_solid_mul_color_solid(DATA8 * p_dst, DATA8 src, DATA8 r,
DATA8 g, DATA8 b)
{

View File

@ -10,19 +10,19 @@
* _soft8_scanline_<description>_<src>_<dst>[_<modifier>]()
*
****************************************************************************/
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_pt_fill_solid_solid(DATA8 * dst, DATA8 gry8)
{
*dst = gry8;
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_scanline_fill_solid_solid(DATA8 * dst, int size, DATA8 gry8)
{
memset(dst, gry8, size);
}
static EFL_ALWAYS_INLINE void
EFL_ALWAYS_INLINE void
_soft8_pt_fill_transp_solid(DATA8 * dst, DATA8 gry8, DATA8 alpha)
{
*dst = GRY_8_BLEND(gry8, *dst, alpha);

View File

@ -200,7 +200,7 @@ static __m128i RGB_MASK_SSE3;
static __m128i ALPHA_SSE3;
static EFL_ALWAYS_INLINE __m128i
EFL_ALWAYS_INLINE __m128i
mul_256_sse3(__m128i a, __m128i c) {
/* prepare alpha for word multiplication */
@ -228,7 +228,7 @@ mul_256_sse3(__m128i a, __m128i c) {
return _mm_add_epi32(c0, c1);
}
static EFL_ALWAYS_INLINE __m128i
EFL_ALWAYS_INLINE __m128i
sub4_alpha_sse3(__m128i c) {
__m128i c0 = c;
@ -237,7 +237,7 @@ sub4_alpha_sse3(__m128i c) {
return _mm_sub_epi32(ALPHA_SSE3, c0);
}
static EFL_ALWAYS_INLINE __m128i
EFL_ALWAYS_INLINE __m128i
interp4_256_sse3(__m128i a, __m128i c0, __m128i c1)
{
const __m128i zero = _mm_setzero_si128();
@ -289,7 +289,7 @@ interp4_256_sse3(__m128i a, __m128i c0, __m128i c1)
return (__m128i) _mm_shuffle_ps( (__m128)cl_sub, (__m128)ch_sub, 0x44);
}
static EFL_ALWAYS_INLINE __m128i
EFL_ALWAYS_INLINE __m128i
mul_sym_sse3(__m128i a, __m128i c) {
/* Prepare alpha for word mult */
@ -318,7 +318,7 @@ mul_sym_sse3(__m128i a, __m128i c) {
return _mm_add_epi32(c0, c1);
}
static EFL_ALWAYS_INLINE __m128i
EFL_ALWAYS_INLINE __m128i
mul4_sym_sse3(__m128i x, __m128i y) {
const __m128i zero = _mm_setzero_si128();
@ -341,7 +341,7 @@ mul4_sym_sse3(__m128i x, __m128i y) {
return _mm_packus_epi16(r_l, r_h);
}
static EFL_ALWAYS_INLINE __m128i
EFL_ALWAYS_INLINE __m128i
mul3_sym_sse3(__m128i x, __m128i y) {
__m128i res = mul4_sym_sse3(x, y);