diff options
| author | Ian Elliott <ian@LunarG.com> | 2015-02-18 12:38:04 -0700 |
|---|---|---|
| committer | Ian Elliott <ian@LunarG.com> | 2015-02-18 15:47:24 -0700 |
| commit | f5f63f827731faff2925537ddde65ff34af7ea89 (patch) | |
| tree | 2f9948892c93b03340fe536d41413da6b436ec85 /icd | |
| parent | 501349c19afe120602f4e68dda76d440e8614846 (diff) | |
| download | usermoji-f5f63f827731faff2925537ddde65ff34af7ea89.tar.xz | |
Win: Can now use "static inline" on Windows (i.e. no code mods).
Diffstat (limited to 'icd')
| -rw-r--r-- | icd/common/icd-format.h | 10 | ||||
| -rw-r--r-- | icd/common/icd-utils.h | 14 | ||||
| -rw-r--r-- | icd/nulldrv/nulldrv.h | 8 |
3 files changed, 12 insertions, 20 deletions
diff --git a/icd/common/icd-format.h b/icd/common/icd-format.h index 7aa50019..28c2dcae 100644 --- a/icd/common/icd-format.h +++ b/icd/common/icd-format.h @@ -31,14 +31,14 @@ #include <stdbool.h> #include "icd.h" -STATIC_INLINE bool icd_format_is_undef(XGL_FORMAT format) +static inline bool icd_format_is_undef(XGL_FORMAT format) { return (format == XGL_FMT_UNDEFINED); } bool icd_format_is_ds(XGL_FORMAT format); -STATIC_INLINE bool icd_format_is_color(XGL_FORMAT format) +static inline bool icd_format_is_color(XGL_FORMAT format) { return !(icd_format_is_undef(format) || icd_format_is_ds(format)); } @@ -53,13 +53,13 @@ bool icd_format_is_srgb(XGL_FORMAT format); bool icd_format_is_compressed(XGL_FORMAT format); -STATIC_INLINE int icd_format_get_block_width(XGL_FORMAT format) +static inline int icd_format_get_block_width(XGL_FORMAT format) { /* all compressed formats use 4x4 blocks */ return (icd_format_is_compressed(format)) ? 4 : 1; } -STATIC_INLINE bool icd_blend_mode_is_dual_src(XGL_BLEND mode) +static inline bool icd_blend_mode_is_dual_src(XGL_BLEND mode) { return (mode == XGL_BLEND_SRC1_COLOR) || (mode == XGL_BLEND_SRC1_ALPHA) || @@ -67,7 +67,7 @@ STATIC_INLINE bool icd_blend_mode_is_dual_src(XGL_BLEND mode) (mode == XGL_BLEND_ONE_MINUS_SRC1_ALPHA); } -STATIC_INLINE bool icd_pipeline_cb_att_needs_dual_source_blending(const XGL_PIPELINE_CB_ATTACHMENT_STATE *att) +static inline bool icd_pipeline_cb_att_needs_dual_source_blending(const XGL_PIPELINE_CB_ATTACHMENT_STATE *att) { if (icd_blend_mode_is_dual_src(att->srcBlendColor) || icd_blend_mode_is_dual_src(att->srcBlendAlpha) || diff --git a/icd/common/icd-utils.h b/icd/common/icd-utils.h index aad6c3e5..fa9c3237 100644 --- a/icd/common/icd-utils.h +++ b/icd/common/icd-utils.h @@ -65,12 +65,12 @@ /** * Return true if val is power of two, or zero. */ -STATIC_INLINE bool u_is_pow2(unsigned int val) +static inline bool u_is_pow2(unsigned int val) { return ((val & (val - 1)) == 0); } -STATIC_INLINE int u_ffs(int val) +static inline int u_ffs(int val) { #if defined(PLATFORM_LINUX) return ffs(val); @@ -79,18 +79,18 @@ STATIC_INLINE int u_ffs(int val) #endif } -STATIC_INLINE unsigned int u_align(unsigned int val, unsigned alignment) +static inline unsigned int u_align(unsigned int val, unsigned alignment) { assert(alignment && u_is_pow2(alignment)); return (val + alignment - 1) & ~(alignment - 1); } -STATIC_INLINE unsigned int u_minify(unsigned int val, unsigned level) +static inline unsigned int u_minify(unsigned int val, unsigned level) { return (val >> level) ? val >> level : 1; } -STATIC_INLINE uint32_t u_fui(float f) +static inline uint32_t u_fui(float f) { union { float f; @@ -100,7 +100,7 @@ STATIC_INLINE uint32_t u_fui(float f) return u.ui; } -STATIC_INLINE float u_uif(uint32_t ui) +static inline float u_uif(uint32_t ui) { union { float f; @@ -110,7 +110,7 @@ STATIC_INLINE float u_uif(uint32_t ui) return u.f; } -STATIC_INLINE int u_iround(float f) +static inline int u_iround(float f) { if (f >= 0.0f) return (int) (f + 0.5f); diff --git a/icd/nulldrv/nulldrv.h b/icd/nulldrv/nulldrv.h index b32cbb77..70168c3b 100644 --- a/icd/nulldrv/nulldrv.h +++ b/icd/nulldrv/nulldrv.h @@ -40,14 +40,6 @@ #include <xglWsiWinExt.h> #endif -#ifndef STATIC_INLINE -#if defined(PLATFORM_LINUX) -#define STATIC_INLINE static inline -#else -#define STATIC_INLINE static -#endif -#endif - #include "icd.h" #include "icd-alloc.h" |
