Commit 07a67520 authored by Jim Bankoski's avatar Jim Bankoski Committed by Gerrit Code Review

inline vpx functions in headers to avoid unused function warning

Change-Id: I80284ae82915b9df56f7c5ef4953bd53e8cffd1f
parent f4529617
......@@ -15,6 +15,15 @@
/* get ptrdiff_t, size_t, wchar_t, NULL */
#include <stddef.h>
#if defined(_MSC_VER)
#define VPX_FORCE_INLINE __forceinline
#define VPX_INLINE __inline
#else
#define VPX_FORCE_INLINE __inline__ __attribute__(always_inline)
// TODO(jbb): Allow a way to force inline off for older compilers.
#define VPX_INLINE inline
#endif
#if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES)
typedef signed char int8_t;
typedef signed short int16_t;
......
......@@ -133,7 +133,7 @@ static unsigned MEM_VALUE_T mem_get_le32(const void *vmem) {
}
#define mem_get_s_generic(end,sz) \
static signed MEM_VALUE_T mem_get_s##end##sz(const void *vmem) {\
static VPX_INLINE signed MEM_VALUE_T mem_get_s##end##sz(const void *vmem) {\
const MAU_T *mem = (const MAU_T*)vmem;\
signed MEM_VALUE_T val = mem_get_##end##sz(mem);\
return (val << (MEM_VALUE_T_SZ_BITS - sz)) >> (MEM_VALUE_T_SZ_BITS - sz);\
......@@ -165,7 +165,7 @@ mem_get_s_generic(le, 32)
#undef mem_put_be16
#define mem_put_be16 mem_ops_wrap_symbol(mem_put_be16)
static void mem_put_be16(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_be16(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 8) & 0xff;
......@@ -174,7 +174,7 @@ static void mem_put_be16(void *vmem, MEM_VALUE_T val) {
#undef mem_put_be24
#define mem_put_be24 mem_ops_wrap_symbol(mem_put_be24)
static void mem_put_be24(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_be24(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 16) & 0xff;
......@@ -184,7 +184,7 @@ static void mem_put_be24(void *vmem, MEM_VALUE_T val) {
#undef mem_put_be32
#define mem_put_be32 mem_ops_wrap_symbol(mem_put_be32)
static void mem_put_be32(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_be32(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 24) & 0xff;
......@@ -195,7 +195,7 @@ static void mem_put_be32(void *vmem, MEM_VALUE_T val) {
#undef mem_put_le16
#define mem_put_le16 mem_ops_wrap_symbol(mem_put_le16)
static void mem_put_le16(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_le16(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 0) & 0xff;
......@@ -204,7 +204,7 @@ static void mem_put_le16(void *vmem, MEM_VALUE_T val) {
#undef mem_put_le24
#define mem_put_le24 mem_ops_wrap_symbol(mem_put_le24)
static void mem_put_le24(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_le24(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 0) & 0xff;
......@@ -214,7 +214,7 @@ static void mem_put_le24(void *vmem, MEM_VALUE_T val) {
#undef mem_put_le32
#define mem_put_le32 mem_ops_wrap_symbol(mem_put_le32)
static void mem_put_le32(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_le32(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 0) & 0xff;
......
......@@ -44,19 +44,22 @@
#define swap_endian_32_se(val,raw) swap_endian_32(val,raw)
#define mem_get_ne_aligned_generic(end,sz) \
static unsigned MEM_VALUE_T mem_get_##end##sz##_aligned(const void *vmem) {\
static VPX_INLINE unsigned MEM_VALUE_T \
mem_get_##end##sz##_aligned(const void *vmem) {\
const uint##sz##_t *mem = (const uint##sz##_t *)vmem;\
return *mem;\
}
#define mem_get_sne_aligned_generic(end,sz) \
static signed MEM_VALUE_T mem_get_s##end##sz##_aligned(const void *vmem) {\
static VPX_INLINE signed MEM_VALUE_T \
mem_get_s##end##sz##_aligned(const void *vmem) {\
const int##sz##_t *mem = (const int##sz##_t *)vmem;\
return *mem;\
}
#define mem_get_se_aligned_generic(end,sz) \
static unsigned MEM_VALUE_T mem_get_##end##sz##_aligned(const void *vmem) {\
static VPX_INLINE unsigned MEM_VALUE_T \
mem_get_##end##sz##_aligned(const void *vmem) {\
const uint##sz##_t *mem = (const uint##sz##_t *)vmem;\
unsigned MEM_VALUE_T val, raw = *mem;\
swap_endian_##sz(val,raw);\
......@@ -64,7 +67,8 @@
}
#define mem_get_sse_aligned_generic(end,sz) \
static signed MEM_VALUE_T mem_get_s##end##sz##_aligned(const void *vmem) {\
static VPX_INLINE signed MEM_VALUE_T \
mem_get_s##end##sz##_aligned(const void *vmem) {\
const int##sz##_t *mem = (const int##sz##_t *)vmem;\
unsigned MEM_VALUE_T val, raw = *mem;\
swap_endian_##sz##_se(val,raw);\
......@@ -72,13 +76,15 @@
}
#define mem_put_ne_aligned_generic(end,sz) \
static void mem_put_##end##sz##_aligned(void *vmem, MEM_VALUE_T val) {\
static VPX_INLINE void \
mem_put_##end##sz##_aligned(void *vmem, MEM_VALUE_T val) {\
uint##sz##_t *mem = (uint##sz##_t *)vmem;\
*mem = (uint##sz##_t)val;\
}
#define mem_put_se_aligned_generic(end,sz) \
static void mem_put_##end##sz##_aligned(void *vmem, MEM_VALUE_T val) {\
static VPX_INLINE void \
mem_put_##end##sz##_aligned(void *vmem, MEM_VALUE_T val) {\
uint##sz##_t *mem = (uint##sz##_t *)vmem, raw;\
swap_endian_##sz(raw,val);\
*mem = (uint##sz##_t)raw;\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment