Remove INLINE, use inline instead

Similar to MESA recent change
macos/master
Marc-André Lureau 10 years ago committed by Dave Airlie
parent e4880f6bd3
commit cd69deebad
  1. 8
      src/gallium/auxiliary/cso_cache/cso_cache.c
  2. 4
      src/gallium/auxiliary/os/os_memory_aligned.h
  3. 2
      src/gallium/auxiliary/os/os_memory_stdc.h
  4. 2
      src/gallium/auxiliary/os/os_mman.h
  5. 32
      src/gallium/auxiliary/os/os_thread.h
  6. 4
      src/gallium/auxiliary/os/os_time.h
  7. 2
      src/gallium/auxiliary/tgsi/tgsi_info.c
  8. 2
      src/gallium/auxiliary/tgsi/tgsi_parse.c
  9. 2
      src/gallium/auxiliary/tgsi/tgsi_parse.h
  10. 2
      src/gallium/auxiliary/tgsi/tgsi_sanity.c
  11. 2
      src/gallium/auxiliary/tgsi/tgsi_strings.c
  12. 2
      src/gallium/auxiliary/tgsi/tgsi_ureg.c
  13. 104
      src/gallium/auxiliary/tgsi/tgsi_ureg.h
  14. 42
      src/gallium/auxiliary/util/u_atomic.h
  15. 6
      src/gallium/auxiliary/util/u_bitmask.c
  16. 10
      src/gallium/auxiliary/util/u_box.h
  17. 8
      src/gallium/auxiliary/util/u_cpu_detect.c
  18. 6
      src/gallium/auxiliary/util/u_debug.h
  19. 2
      src/gallium/auxiliary/util/u_debug_refcnt.h
  20. 12
      src/gallium/auxiliary/util/u_double_list.h
  21. 4
      src/gallium/auxiliary/util/u_dual_blend.h
  22. 64
      src/gallium/auxiliary/util/u_format.h
  23. 6
      src/gallium/auxiliary/util/u_format_pack.py
  24. 4
      src/gallium/auxiliary/util/u_half.h
  25. 6
      src/gallium/auxiliary/util/u_hash_table.c
  26. 64
      src/gallium/auxiliary/util/u_inlines.h
  27. 110
      src/gallium/auxiliary/util/u_math.h
  28. 2
      src/gallium/auxiliary/util/u_memory.h
  29. 4
      src/gallium/auxiliary/util/u_pack_color.h
  30. 16
      src/gallium/auxiliary/util/u_pointer.h
  31. 18
      src/gallium/auxiliary/util/u_prim.h
  32. 10
      src/gallium/auxiliary/util/u_rect.h
  33. 22
      src/gallium/auxiliary/util/u_string.h
  34. 17
      src/gallium/include/pipe/p_compiler.h
  35. 24
      src/vrend_renderer.c
  36. 2
      src/vrend_renderer.h

@ -80,7 +80,7 @@ unsigned cso_construct_key(void *item, int item_size)
return hash_key((item), item_size);
}
static INLINE struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_type type)
static inline struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_type type)
{
struct cso_hash *hash;
hash = sc->hashes[type];
@ -127,7 +127,7 @@ static void delete_velements(void *state, void *data)
FREE(state);
}
static INLINE void delete_cso(void *state, enum cso_cache_type type)
static inline void delete_cso(void *state, enum cso_cache_type type)
{
switch (type) {
case CSO_BLEND:
@ -152,7 +152,7 @@ static INLINE void delete_cso(void *state, enum cso_cache_type type)
}
static INLINE void sanitize_hash(struct cso_cache *sc,
static inline void sanitize_hash(struct cso_cache *sc,
struct cso_hash *hash,
enum cso_cache_type type,
int max_size)
@ -162,7 +162,7 @@ static INLINE void sanitize_hash(struct cso_cache *sc,
}
static INLINE void sanitize_cb(struct cso_hash *hash, enum cso_cache_type type,
static inline void sanitize_cb(struct cso_hash *hash, enum cso_cache_type type,
int max_size, void *user_data)
{
/* if we're approach the maximum size, remove fourth of the entries

@ -42,7 +42,7 @@
/**
* Return memory on given byte alignment
*/
static INLINE void *
static inline void *
os_malloc_aligned(size_t size, size_t alignment)
{
char *ptr, *buf;
@ -61,7 +61,7 @@ os_malloc_aligned(size_t size, size_t alignment)
/**
* Free memory returned by align_malloc().
*/
static INLINE void
static inline void
os_free_aligned(void *ptr)
{
if (ptr) {

@ -50,7 +50,7 @@
#if defined(HAVE_POSIX_MEMALIGN)
static INLINE void *
static inline void *
os_malloc_aligned(size_t size, size_t alignment)
{
void *ptr;

@ -61,7 +61,7 @@ extern "C" {
extern void *__mmap2(void *, size_t, int, int, int, size_t);
static INLINE void *os_mmap(void *addr, size_t length, int prot, int flags, int fd, loff_t offset)
static inline void *os_mmap(void *addr, size_t length, int prot, int flags, int fd, loff_t offset)
{
/* offset must be aligned to 4096 (not necessarily the page size) */
if (unlikely(offset & 4095)) {

@ -54,7 +54,7 @@ typedef thrd_t pipe_thread;
#define PIPE_THREAD_ROUTINE( name, param ) \
int name( void *param )
static INLINE pipe_thread pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), ), void *param )
static inline pipe_thread pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), ), void *param )
{
pipe_thread thread;
#ifdef HAVE_PTHREAD
@ -75,12 +75,12 @@ static INLINE pipe_thread pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), ),
return thread;
}
static INLINE int pipe_thread_wait( pipe_thread thread )
static inline int pipe_thread_wait( pipe_thread thread )
{
return thrd_join( thread, NULL );
}
static INLINE int pipe_thread_destroy( pipe_thread thread )
static inline int pipe_thread_destroy( pipe_thread thread )
{
return thrd_detach( thread );
}
@ -134,17 +134,17 @@ typedef cnd_t pipe_condvar;
typedef pthread_barrier_t pipe_barrier;
static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
{
pthread_barrier_init(barrier, NULL, count);
}
static INLINE void pipe_barrier_destroy(pipe_barrier *barrier)
static inline void pipe_barrier_destroy(pipe_barrier *barrier)
{
pthread_barrier_destroy(barrier);
}
static INLINE void pipe_barrier_wait(pipe_barrier *barrier)
static inline void pipe_barrier_wait(pipe_barrier *barrier)
{
pthread_barrier_wait(barrier);
}
@ -160,7 +160,7 @@ typedef struct {
pipe_condvar condvar;
} pipe_barrier;
static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
{
barrier->count = count;
barrier->waiters = 0;
@ -169,14 +169,14 @@ static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
pipe_condvar_init(barrier->condvar);
}
static INLINE void pipe_barrier_destroy(pipe_barrier *barrier)
static inline void pipe_barrier_destroy(pipe_barrier *barrier)
{
assert(barrier->waiters == 0);
pipe_mutex_destroy(barrier->mutex);
pipe_condvar_destroy(barrier->condvar);
}
static INLINE void pipe_barrier_wait(pipe_barrier *barrier)
static inline void pipe_barrier_wait(pipe_barrier *barrier)
{
pipe_mutex_lock(barrier->mutex);
@ -214,7 +214,7 @@ typedef struct
} pipe_semaphore;
static INLINE void
static inline void
pipe_semaphore_init(pipe_semaphore *sema, int init_val)
{
pipe_mutex_init(sema->mutex);
@ -222,7 +222,7 @@ pipe_semaphore_init(pipe_semaphore *sema, int init_val)
sema->counter = init_val;
}
static INLINE void
static inline void
pipe_semaphore_destroy(pipe_semaphore *sema)
{
pipe_mutex_destroy(sema->mutex);
@ -230,7 +230,7 @@ pipe_semaphore_destroy(pipe_semaphore *sema)
}
/** Signal/increment semaphore counter */
static INLINE void
static inline void
pipe_semaphore_signal(pipe_semaphore *sema)
{
pipe_mutex_lock(sema->mutex);
@ -240,7 +240,7 @@ pipe_semaphore_signal(pipe_semaphore *sema)
}
/** Wait for semaphore counter to be greater than zero */
static INLINE void
static inline void
pipe_semaphore_wait(pipe_semaphore *sema)
{
pipe_mutex_lock(sema->mutex);
@ -266,7 +266,7 @@ typedef struct {
#define PIPE_TSD_INIT_MAGIC 0xff8adc98
static INLINE void
static inline void
pipe_tsd_init(pipe_tsd *tsd)
{
if (tss_create(&tsd->key, NULL/*free*/) != 0) {
@ -275,7 +275,7 @@ pipe_tsd_init(pipe_tsd *tsd)
tsd->initMagic = PIPE_TSD_INIT_MAGIC;
}
static INLINE void *
static inline void *
pipe_tsd_get(pipe_tsd *tsd)
{
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
@ -284,7 +284,7 @@ pipe_tsd_get(pipe_tsd *tsd)
return tss_get(tsd->key);
}
static INLINE void
static inline void
pipe_tsd_set(pipe_tsd *tsd, void *value)
{
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {

@ -60,7 +60,7 @@ os_time_get_nano(void);
/*
* Get the current time in microseconds from an unknown base.
*/
static INLINE int64_t
static inline int64_t
os_time_get(void) {
return os_time_get_nano() / 1000;
}
@ -82,7 +82,7 @@ os_time_sleep(int64_t usecs);
*
* Returns true if the current time has elapsed beyond the specified interval.
*/
static INLINE boolean
static inline boolean
os_time_timeout(int64_t start,
int64_t end,
int64_t curr)

@ -285,7 +285,7 @@ tgsi_get_processor_name( uint processor )
*
* MOV and UCMP is special so return VOID
*/
static INLINE enum tgsi_opcode_type
static inline enum tgsi_opcode_type
tgsi_opcode_infer_type( uint opcode )
{
switch (opcode) {

@ -69,7 +69,7 @@ tgsi_parse_end_of_tokens(
* warnings. The warnings seem harmless on x86 but on PPC they cause
* real failures.
*/
static INLINE void
static inline void
copy_token(void *dst, const void *src)
{
memcpy(dst, src, 4);

@ -133,7 +133,7 @@ void
tgsi_parse_token(
struct tgsi_parse_context *ctx );
static INLINE unsigned
static inline unsigned
tgsi_num_tokens(const struct tgsi_token *tokens)
{
struct tgsi_header header;

@ -62,7 +62,7 @@ struct sanity_check_ctx
boolean print;
};
static INLINE unsigned
static inline unsigned
scan_register_key(const scan_register *reg)
{
unsigned key = reg->file;

@ -189,7 +189,7 @@ const char *tgsi_immediate_type_names[3] =
};
static INLINE void
static inline void
tgsi_strings_check(void)
{
STATIC_ASSERT(Elements(tgsi_semantic_names) == TGSI_SEMANTIC_COUNT);

@ -243,7 +243,7 @@ static union tgsi_any_token *retrieve_token( struct ureg_program *ureg,
static INLINE struct ureg_dst
static inline struct ureg_dst
ureg_dst_register( unsigned file,
unsigned index )
{

@ -130,7 +130,7 @@ ureg_destroy( struct ureg_program * );
/***********************************************************************
* Convenience routine:
*/
static INLINE void *
static inline void *
ureg_create_shader_with_so_and_destroy( struct ureg_program *p,
struct pipe_context *pipe,
const struct pipe_stream_output_info *so )
@ -140,7 +140,7 @@ ureg_create_shader_with_so_and_destroy( struct ureg_program *p,
return result;
}
static INLINE void *
static inline void *
ureg_create_shader_and_destroy( struct ureg_program *p,
struct pipe_context *pipe )
{
@ -168,7 +168,7 @@ ureg_DECL_fs_input_cyl_centroid(struct ureg_program *,
unsigned cylindrical_wrap,
unsigned interp_location);
static INLINE struct ureg_src
static inline struct ureg_src
ureg_DECL_fs_input_cyl(struct ureg_program *ureg,
unsigned semantic_name,
unsigned semantic_index,
@ -183,7 +183,7 @@ ureg_DECL_fs_input_cyl(struct ureg_program *ureg,
0);
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_DECL_fs_input(struct ureg_program *ureg,
unsigned semantic_name,
unsigned semantic_index,
@ -301,7 +301,7 @@ ureg_DECL_sampler_view(struct ureg_program *,
unsigned return_type_w );
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm4f( struct ureg_program *ureg,
float a, float b,
float c, float d)
@ -314,7 +314,7 @@ ureg_imm4f( struct ureg_program *ureg,
return ureg_DECL_immediate( ureg, v, 4 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm3f( struct ureg_program *ureg,
float a, float b,
float c)
@ -326,7 +326,7 @@ ureg_imm3f( struct ureg_program *ureg,
return ureg_DECL_immediate( ureg, v, 3 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm2f( struct ureg_program *ureg,
float a, float b)
{
@ -336,7 +336,7 @@ ureg_imm2f( struct ureg_program *ureg,
return ureg_DECL_immediate( ureg, v, 2 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm1f( struct ureg_program *ureg,
float a)
{
@ -345,7 +345,7 @@ ureg_imm1f( struct ureg_program *ureg,
return ureg_DECL_immediate( ureg, v, 1 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm4u( struct ureg_program *ureg,
unsigned a, unsigned b,
unsigned c, unsigned d)
@ -358,7 +358,7 @@ ureg_imm4u( struct ureg_program *ureg,
return ureg_DECL_immediate_uint( ureg, v, 4 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm3u( struct ureg_program *ureg,
unsigned a, unsigned b,
unsigned c)
@ -370,7 +370,7 @@ ureg_imm3u( struct ureg_program *ureg,
return ureg_DECL_immediate_uint( ureg, v, 3 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm2u( struct ureg_program *ureg,
unsigned a, unsigned b)
{
@ -380,14 +380,14 @@ ureg_imm2u( struct ureg_program *ureg,
return ureg_DECL_immediate_uint( ureg, v, 2 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm1u( struct ureg_program *ureg,
unsigned a)
{
return ureg_DECL_immediate_uint( ureg, &a, 1 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm4i( struct ureg_program *ureg,
int a, int b,
int c, int d)
@ -400,7 +400,7 @@ ureg_imm4i( struct ureg_program *ureg,
return ureg_DECL_immediate_int( ureg, v, 4 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm3i( struct ureg_program *ureg,
int a, int b,
int c)
@ -412,7 +412,7 @@ ureg_imm3i( struct ureg_program *ureg,
return ureg_DECL_immediate_int( ureg, v, 3 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm2i( struct ureg_program *ureg,
int a, int b)
{
@ -422,7 +422,7 @@ ureg_imm2i( struct ureg_program *ureg,
return ureg_DECL_immediate_int( ureg, v, 2 );
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_imm1i( struct ureg_program *ureg,
int a)
{
@ -432,7 +432,7 @@ ureg_imm1i( struct ureg_program *ureg,
/* Where the destination register has a valid file, but an empty
* writemask.
*/
static INLINE boolean
static inline boolean
ureg_dst_is_empty( struct ureg_dst dst )
{
return dst.File != TGSI_FILE_NULL &&
@ -546,7 +546,7 @@ ureg_fixup_insn_size(struct ureg_program *ureg,
#define OP00( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg ) \
static inline void ureg_##op( struct ureg_program *ureg ) \
{ \
unsigned opcode = TGSI_OPCODE_##op; \
struct ureg_emit_insn_result insn; \
@ -565,7 +565,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg ) \
}
#define OP01( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_src src ) \
{ \
unsigned opcode = TGSI_OPCODE_##op; \
@ -586,7 +586,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP00_LBL( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
unsigned *label_token ) \
{ \
unsigned opcode = TGSI_OPCODE_##op; \
@ -607,7 +607,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP01_LBL( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_src src, \
unsigned *label_token ) \
{ \
@ -630,7 +630,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP10( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst ) \
{ \
unsigned opcode = TGSI_OPCODE_##op; \
@ -654,7 +654,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
#define OP11( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
struct ureg_src src ) \
{ \
@ -679,7 +679,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP12( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
struct ureg_src src0, \
struct ureg_src src1 ) \
@ -706,7 +706,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP12_TEX( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
unsigned target, \
struct ureg_src src0, \
@ -735,7 +735,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP12_SAMPLE( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
struct ureg_src src0, \
struct ureg_src src1 ) \
@ -764,7 +764,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP13( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
struct ureg_src src0, \
struct ureg_src src1, \
@ -793,7 +793,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP13_SAMPLE( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
struct ureg_src src0, \
struct ureg_src src1, \
@ -824,7 +824,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP14_TEX( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
unsigned target, \
struct ureg_src src0, \
@ -857,7 +857,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP14_SAMPLE( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
struct ureg_src src0, \
struct ureg_src src1, \
@ -891,7 +891,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
#define OP14( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
struct ureg_src src0, \
struct ureg_src src1, \
@ -923,7 +923,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
#define OP15( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
struct ureg_src src0, \
struct ureg_src src1, \
@ -956,7 +956,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
}
#define OP15_SAMPLE( op ) \
static INLINE void ureg_##op( struct ureg_program *ureg, \
static inline void ureg_##op( struct ureg_program *ureg, \
struct ureg_dst dst, \
struct ureg_src src0, \
struct ureg_src src1, \
@ -999,7 +999,7 @@ static INLINE void ureg_##op( struct ureg_program *ureg, \
/***********************************************************************
* Inline helpers for manipulating register structs:
*/
static INLINE struct ureg_src
static inline struct ureg_src
ureg_negate( struct ureg_src reg )
{
assert(reg.File != TGSI_FILE_NULL);
@ -1007,7 +1007,7 @@ ureg_negate( struct ureg_src reg )
return reg;
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_abs( struct ureg_src reg )
{
assert(reg.File != TGSI_FILE_NULL);
@ -1016,7 +1016,7 @@ ureg_abs( struct ureg_src reg )
return reg;
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_swizzle( struct ureg_src reg,
int x, int y, int z, int w )
{
@ -1038,13 +1038,13 @@ ureg_swizzle( struct ureg_src reg,
return reg;
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_scalar( struct ureg_src reg, int x )
{
return ureg_swizzle(reg, x, x, x, x);
}
static INLINE struct ureg_dst
static inline struct ureg_dst
ureg_writemask( struct ureg_dst reg,
unsigned writemask )
{
@ -1053,7 +1053,7 @@ ureg_writemask( struct ureg_dst reg,
return reg;
}
static INLINE struct ureg_dst
static inline struct ureg_dst
ureg_saturate( struct ureg_dst reg )
{
assert(reg.File != TGSI_FILE_NULL);
@ -1061,7 +1061,7 @@ ureg_saturate( struct ureg_dst reg )
return reg;
}
static INLINE struct ureg_dst
static inline struct ureg_dst
ureg_predicate(struct ureg_dst reg,
boolean negate,
unsigned swizzle_x,
@ -1079,7 +1079,7 @@ ureg_predicate(struct ureg_dst reg,
return reg;
}
static INLINE struct ureg_dst
static inline struct ureg_dst
ureg_dst_indirect( struct ureg_dst reg, struct ureg_src addr )
{
assert(reg.File != TGSI_FILE_NULL);
@ -1091,7 +1091,7 @@ ureg_dst_indirect( struct ureg_dst reg, struct ureg_src addr )
return reg;
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_src_indirect( struct ureg_src reg, struct ureg_src addr )
{
assert(reg.File != TGSI_FILE_NULL);
@ -1103,7 +1103,7 @@ ureg_src_indirect( struct ureg_src reg, struct ureg_src addr )
return reg;
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_src_dimension( struct ureg_src reg, int index )
{
assert(reg.File != TGSI_FILE_NULL);
@ -1114,7 +1114,7 @@ ureg_src_dimension( struct ureg_src reg, int index )
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_src_dimension_indirect( struct ureg_src reg, struct ureg_src addr,
int index )
{
@ -1128,7 +1128,7 @@ ureg_src_dimension_indirect( struct ureg_src reg, struct ureg_src addr,
return reg;
}
static INLINE struct ureg_dst
static inline struct ureg_dst
ureg_dst_array_offset( struct ureg_dst reg, int offset )
{
assert(reg.File == TGSI_FILE_TEMPORARY);
@ -1136,7 +1136,7 @@ ureg_dst_array_offset( struct ureg_dst reg, int offset )
return reg;
}
static INLINE struct ureg_dst
static inline struct ureg_dst
ureg_dst( struct ureg_src src )
{
struct ureg_dst dst;
@ -1164,7 +1164,7 @@ ureg_dst( struct ureg_src src )
return dst;
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_src_register(unsigned file,
unsigned index)
{
@ -1193,7 +1193,7 @@ ureg_src_register(unsigned file,
return src;
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_src( struct ureg_dst dst )
{
struct ureg_src src;
@ -1223,7 +1223,7 @@ ureg_src( struct ureg_dst dst )
static INLINE struct ureg_dst
static inline struct ureg_dst
ureg_dst_undef( void )
{
struct ureg_dst dst;
@ -1247,7 +1247,7 @@ ureg_dst_undef( void )
return dst;
}
static INLINE struct ureg_src
static inline struct ureg_src
ureg_src_undef( void )
{
struct ureg_src src;
@ -1275,13 +1275,13 @@ ureg_src_undef( void )
return src;
}
static INLINE boolean
static inline boolean
ureg_src_is_undef( struct ureg_src src )
{
return src.File == TGSI_FILE_NULL;
}
static INLINE boolean
static inline boolean
ureg_dst_is_undef( struct ureg_dst dst )
{
return dst.File == TGSI_FILE_NULL;

@ -45,7 +45,7 @@ extern "C" {
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
static INLINE boolean
static inline boolean
p_atomic_dec_zero(int32_t *v)
{
unsigned char c;
@ -56,19 +56,19 @@ p_atomic_dec_zero(int32_t *v)
return c != 0;
}
static INLINE void
static inline void
p_atomic_inc(int32_t *v)
{
__asm__ __volatile__("lock; incl %0":"+m"(*v));
}
static INLINE void
static inline void
p_atomic_dec(int32_t *v)
{
__asm__ __volatile__("lock; decl %0":"+m"(*v));
}
static INLINE int32_t
static inline int32_t
p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
{
return __sync_val_compare_and_swap(v, old, _new);
@ -92,7 +92,7 @@ extern "C" {
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
static INLINE boolean
static inline boolean
p_atomic_dec_zero(int32_t *v)
{
unsigned char c;
@ -103,19 +103,19 @@ p_atomic_dec_zero(int32_t *v)
return c != 0;
}
static INLINE void
static inline void
p_atomic_inc(int32_t *v)
{
__asm__ __volatile__("lock; incl %0":"+m"(*v));
}
static INLINE void
static inline void
p_atomic_dec(int32_t *v)
{
__asm__ __volatile__("lock; decl %0":"+m"(*v));
}
static INLINE int32_t
static inline int32_t
p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
{
return __sync_val_compare_and_swap(v, old, _new);
@ -142,25 +142,25 @@ extern "C" {
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
static INLINE boolean
static inline boolean
p_atomic_dec_zero(int32_t *v)
{
return (__sync_sub_and_fetch(v, 1) == 0);
}
static INLINE void
static inline void
p_atomic_inc(int32_t *v)
{
(void) __sync_add_and_fetch(v, 1);
}
static INLINE void
static inline void
p_atomic_dec(int32_t *v)
{
(void) __sync_sub_and_fetch(v, 1);
}
static INLINE int32_t
static inline int32_t
p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
{
return __sync_val_compare_and_swap(v, old, _new);
@ -204,7 +204,7 @@ extern "C" {
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
static INLINE boolean
static inline boolean
p_atomic_dec_zero(int32_t *v)
{
unsigned char c;
@ -218,7 +218,7 @@ p_atomic_dec_zero(int32_t *v)
return c != 0;
}
static INLINE void
static inline void
p_atomic_inc(int32_t *v)
{
__asm {
@ -227,7 +227,7 @@ p_atomic_inc(int32_t *v)
}
}
static INLINE void
static inline void
p_atomic_dec(int32_t *v)
{
__asm {
@ -236,7 +236,7 @@ p_atomic_dec(int32_t *v)
}
}
static INLINE int32_t
static inline int32_t
p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
{
int32_t orig;
@ -276,25 +276,25 @@ extern "C" {
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
static INLINE boolean
static inline boolean
p_atomic_dec_zero(int32_t *v)
{
return _InterlockedDecrement((long *)v) == 0;
}
static INLINE void
static inline void
p_atomic_inc(int32_t *v)
{
_InterlockedIncrement((long *)v);
}
static INLINE void
static inline void
p_atomic_dec(int32_t *v)
{
_InterlockedDecrement((long *)v);
}
static INLINE int32_t
static inline int32_t
p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
{
return _InterlockedCompareExchange((long *)v, _new, old);
@ -319,7 +319,7 @@ extern "C" {
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
static INLINE boolean
static inline boolean
p_atomic_dec_zero(int32_t *v)
{
uint32_t n = atomic_dec_32_nv((uint32_t *) v);

@ -85,7 +85,7 @@ util_bitmask_create(void)
/**
* Resize the bitmask if necessary
*/
static INLINE boolean
static inline boolean
util_bitmask_resize(struct util_bitmask *bm,
unsigned minimum_index)
{
@ -131,7 +131,7 @@ util_bitmask_resize(struct util_bitmask *bm,
/**
* Lazily update the filled.
*/
static INLINE void
static inline void
util_bitmask_filled_set(struct util_bitmask *bm,
unsigned index)
{
@ -144,7 +144,7 @@ util_bitmask_filled_set(struct util_bitmask *bm,
}
}
static INLINE void
static inline void
util_bitmask_filled_unset(struct util_bitmask *bm,
unsigned index)
{

@ -3,7 +3,7 @@
#include "pipe/p_state.h"
static INLINE
static inline
void u_box_1d( unsigned x,
unsigned w,
struct pipe_box *box )
@ -16,7 +16,7 @@ void u_box_1d( unsigned x,
box->depth = 1;
}
static INLINE
static inline
void u_box_2d( unsigned x,
unsigned y,
unsigned w,
@ -31,7 +31,7 @@ void u_box_2d( unsigned x,
box->depth = 1;
}
static INLINE
static inline
void u_box_origin_2d( unsigned w,
unsigned h,
struct pipe_box *box )
@ -44,7 +44,7 @@ void u_box_origin_2d( unsigned w,
box->depth = 1;
}
static INLINE
static inline
void u_box_2d_zslice( unsigned x,
unsigned y,
unsigned z,
@ -60,7 +60,7 @@ void u_box_2d_zslice( unsigned x,
box->depth = 1;
}
static INLINE
static inline
void u_box_3d( unsigned x,
unsigned y,
unsigned z,

@ -179,7 +179,7 @@ static int has_cpuid(void)
* @sa cpuid.h included in gcc-4.3 onwards.
* @sa http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
*/
static INLINE void
static inline void
cpuid(uint32_t ax, uint32_t *p)
{
#if (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO)) && defined(PIPE_ARCH_X86)
@ -216,7 +216,7 @@ cpuid(uint32_t ax, uint32_t *p)
* @sa cpuid.h included in gcc-4.4 onwards.
* @sa http://msdn.microsoft.com/en-us/library/hskdteyh%28v=vs.90%29.aspx
*/
static INLINE void
static inline void
cpuid_count(uint32_t ax, uint32_t cx, uint32_t *p)
{
#if (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO)) && defined(PIPE_ARCH_X86)
@ -250,7 +250,7 @@ cpuid_count(uint32_t ax, uint32_t cx, uint32_t *p)
}
static INLINE uint64_t xgetbv(void)
static inline uint64_t xgetbv(void)
{
#if defined(PIPE_CC_GCC)
uint32_t eax, edx;
@ -272,7 +272,7 @@ static INLINE uint64_t xgetbv(void)
#if defined(PIPE_ARCH_X86)
static INLINE boolean sse2_has_daz(void)
static inline boolean sse2_has_daz(void)
{
struct {
uint32_t pad1[7];

@ -58,7 +58,7 @@ extern "C" {
void _debug_vprintf(const char *format, va_list ap);
static INLINE void
static inline void
_debug_printf(const char *format, ...)
{
va_list ap;
@ -78,10 +78,10 @@ _debug_printf(const char *format, ...)
* that is guaranteed to be printed in all platforms)
*/
#if !defined(PIPE_OS_HAIKU)
static INLINE void
static inline void
debug_printf(const char *format, ...) _util_printf_format(1,2);
static INLINE void
static inline void
debug_printf(const char *format, ...)
{
#ifdef DEBUG

@ -36,7 +36,7 @@ extern "C" {
typedef void (*debug_reference_descriptor)(char*, const struct pipe_reference*);
static INLINE void debug_reference(const struct pipe_reference* p, debug_reference_descriptor get_desc, int change)
static inline void debug_reference(const struct pipe_reference* p, debug_reference_descriptor get_desc, int change)
{
}

@ -48,13 +48,13 @@ struct list_head
struct list_head *next;
};
static INLINE void list_inithead(struct list_head *item)
static inline void list_inithead(struct list_head *item)
{
item->prev = item;
item->next = item;
}
static INLINE void list_add(struct list_head *item, struct list_head *list)
static inline void list_add(struct list_head *item, struct list_head *list)
{
item->prev = list;
item->next = list->next;
@ -62,7 +62,7 @@ static INLINE void list_add(struct list_head *item, struct list_head *list)
list->next = item;
}
static INLINE void list_addtail(struct list_head *item, struct list_head *list)
static inline void list_addtail(struct list_head *item, struct list_head *list)
{
item->next = list;
item->prev = list->prev;
@ -70,7 +70,7 @@ static INLINE void list_addtail(struct list_head *item, struct list_head *list)
list->prev = item;
}
static INLINE void list_replace(struct list_head *from, struct list_head *to)
static inline void list_replace(struct list_head *from, struct list_head *to)
{
to->prev = from->prev;
to->next = from->next;
@ -78,14 +78,14 @@ static INLINE void list_replace(struct list_head *from, struct list_head *to)
from->prev->next = to;
}
static INLINE void list_del(struct list_head *item)
static inline void list_del(struct list_head *item)
{
item->prev->next = item->next;
item->next->prev = item->prev;
item->prev = item->next = NULL;
}
static INLINE void list_delinit(struct list_head *item)
static inline void list_delinit(struct list_head *item)
{
item->prev->next = item->next;
item->next->prev = item->prev;

@ -3,7 +3,7 @@
#include "pipe/p_state.h"
static INLINE boolean util_blend_factor_is_dual_src(int factor)
static inline boolean util_blend_factor_is_dual_src(int factor)
{
return (factor == PIPE_BLENDFACTOR_SRC1_COLOR) ||
(factor == PIPE_BLENDFACTOR_SRC1_ALPHA) ||
@ -11,7 +11,7 @@ static INLINE boolean util_blend_factor_is_dual_src(int factor)
(factor == PIPE_BLENDFACTOR_INV_SRC1_ALPHA);
}
static INLINE boolean util_blend_state_is_dual(const struct pipe_blend_state *blend,
static inline boolean util_blend_state_is_dual(const struct pipe_blend_state *blend,
int index)
{
if (util_blend_factor_is_dual_src(blend->rt[index].rgb_src_factor) ||

@ -243,7 +243,7 @@ util_format_description(enum pipe_format format);
* Format query functions.
*/
static INLINE const char *
static inline const char *
util_format_name(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -256,7 +256,7 @@ util_format_name(enum pipe_format format)
return desc->name;
}
static INLINE const char *
static inline const char *
util_format_short_name(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -272,7 +272,7 @@ util_format_short_name(enum pipe_format format)
/**
* Whether this format is plain, see UTIL_FORMAT_LAYOUT_PLAIN for more info.
*/
static INLINE boolean
static inline boolean
util_format_is_plain(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -284,7 +284,7 @@ util_format_is_plain(enum pipe_format format)
return desc->layout == UTIL_FORMAT_LAYOUT_PLAIN ? TRUE : FALSE;
}
static INLINE boolean
static inline boolean
util_format_is_compressed(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -306,7 +306,7 @@ util_format_is_compressed(enum pipe_format format)
}
}
static INLINE boolean
static inline boolean
util_format_is_s3tc(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -319,28 +319,28 @@ util_format_is_s3tc(enum pipe_format format)
return desc->layout == UTIL_FORMAT_LAYOUT_S3TC ? TRUE : FALSE;
}
static INLINE boolean
static inline boolean
util_format_is_srgb(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
return desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB;
}
static INLINE boolean
static inline boolean
util_format_has_depth(const struct util_format_description *desc)
{
return desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS &&
desc->swizzle[0] != UTIL_FORMAT_SWIZZLE_NONE;
}
static INLINE boolean
static inline boolean
util_format_has_stencil(const struct util_format_description *desc)
{
return desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS &&
desc->swizzle[1] != UTIL_FORMAT_SWIZZLE_NONE;
}
static INLINE boolean
static inline boolean
util_format_is_depth_or_stencil(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -354,7 +354,7 @@ util_format_is_depth_or_stencil(enum pipe_format format)
util_format_has_stencil(desc);
}
static INLINE boolean
static inline boolean
util_format_is_depth_and_stencil(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -372,7 +372,7 @@ util_format_is_depth_and_stencil(enum pipe_format format)
/**
* Calculates the depth format type based upon the incoming format description.
*/
static INLINE unsigned
static inline unsigned
util_get_depth_format_type(const struct util_format_description *desc)
{
unsigned depth_channel = desc->swizzle[0];
@ -399,7 +399,7 @@ util_get_depth_format_mrd(const struct util_format_description *desc);
* Return whether this is an RGBA, Z, S, or combined ZS format.
* Useful for initializing pipe_blit_info::mask.
*/
static INLINE unsigned
static inline unsigned
util_format_get_mask(enum pipe_format format)
{
const struct util_format_description *desc =
@ -429,7 +429,7 @@ util_format_get_mask(enum pipe_format format)
*
* That is, the channels whose values are preserved.
*/
static INLINE unsigned
static inline unsigned
util_format_colormask(const struct util_format_description *desc)
{
unsigned colormask;
@ -461,7 +461,7 @@ util_format_colormask(const struct util_format_description *desc)
* @param desc a format description to check colormask with
* @param colormask a bit mask for channels, matches format of PIPE_MASK_RGBA
*/
static INLINE boolean
static inline boolean
util_format_colormask_full(const struct util_format_description *desc, unsigned colormask)
{
return (~colormask & util_format_colormask(desc)) == 0;
@ -527,7 +527,7 @@ util_format_is_supported(enum pipe_format format, unsigned bind);
*
* PIPE_FORMAT_?8?8?8?8_UNORM
*/
static INLINE boolean
static inline boolean
util_format_is_rgba8_variant(const struct util_format_description *desc)
{
unsigned chan;
@ -555,7 +555,7 @@ util_format_is_rgba8_variant(const struct util_format_description *desc)
/**
* Return total bits needed for the pixel format per block.
*/
static INLINE uint
static inline uint
util_format_get_blocksizebits(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -571,7 +571,7 @@ util_format_get_blocksizebits(enum pipe_format format)
/**
* Return bytes per block (not pixel) for the given format.
*/
static INLINE uint
static inline uint
util_format_get_blocksize(enum pipe_format format)
{
uint bits = util_format_get_blocksizebits(format);
@ -586,7 +586,7 @@ util_format_get_blocksize(enum pipe_format format)
return bytes;
}
static INLINE uint
static inline uint
util_format_get_blockwidth(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -599,7 +599,7 @@ util_format_get_blockwidth(enum pipe_format format)
return desc->block.width;
}
static INLINE uint
static inline uint
util_format_get_blockheight(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -612,7 +612,7 @@ util_format_get_blockheight(enum pipe_format format)
return desc->block.height;
}
static INLINE unsigned
static inline unsigned
util_format_get_nblocksx(enum pipe_format format,
unsigned x)
{
@ -620,7 +620,7 @@ util_format_get_nblocksx(enum pipe_format format,
return (x + blockwidth - 1) / blockwidth;
}
static INLINE unsigned
static inline unsigned
util_format_get_nblocksy(enum pipe_format format,
unsigned y)
{
@ -628,7 +628,7 @@ util_format_get_nblocksy(enum pipe_format format,
return (y + blockheight - 1) / blockheight;
}
static INLINE unsigned
static inline unsigned
util_format_get_nblocks(enum pipe_format format,
unsigned width,
unsigned height)
@ -636,14 +636,14 @@ util_format_get_nblocks(enum pipe_format format,
return util_format_get_nblocksx(format, width) * util_format_get_nblocksy(format, height);
}
static INLINE size_t
static inline size_t
util_format_get_stride(enum pipe_format format,
unsigned width)
{
return util_format_get_nblocksx(format, width) * util_format_get_blocksize(format);
}
static INLINE size_t
static inline size_t
util_format_get_2d_size(enum pipe_format format,
size_t stride,
unsigned height)
@ -651,7 +651,7 @@ util_format_get_2d_size(enum pipe_format format,
return util_format_get_nblocksy(format, height) * stride;
}
static INLINE uint
static inline uint
util_format_get_component_bits(enum pipe_format format,
enum util_format_colorspace colorspace,
uint component)
@ -698,7 +698,7 @@ util_format_get_component_bits(enum pipe_format format,
* Given a linear RGB colorspace format, return the corresponding SRGB
* format, or PIPE_FORMAT_NONE if none.
*/
static INLINE enum pipe_format
static inline enum pipe_format
util_format_srgb(enum pipe_format format)
{
if (util_format_is_srgb(format))
@ -748,7 +748,7 @@ util_format_srgb(enum pipe_format format)
* Given an sRGB format, return the corresponding linear colorspace format.
* For non sRGB formats, return the format unchanged.
*/
static INLINE enum pipe_format
static inline enum pipe_format
util_format_linear(enum pipe_format format)
{
switch (format) {
@ -795,7 +795,7 @@ util_format_linear(enum pipe_format format)
* Given a depth-stencil format, return the corresponding stencil-only format.
* For stencil-only formats, return the format unchanged.
*/
static INLINE enum pipe_format
static inline enum pipe_format
util_format_stencil_only(enum pipe_format format)
{
switch (format) {
@ -824,7 +824,7 @@ util_format_stencil_only(enum pipe_format format)
* Converts PIPE_FORMAT_*I* to PIPE_FORMAT_*R*.
* This is identity for non-intensity formats.
*/
static INLINE enum pipe_format
static inline enum pipe_format
util_format_intensity_to_red(enum pipe_format format)
{
switch (format) {
@ -862,7 +862,7 @@ util_format_intensity_to_red(enum pipe_format format)
* Converts PIPE_FORMAT_*L* to PIPE_FORMAT_*R*.
* This is identity for non-luminance formats.
*/
static INLINE enum pipe_format
static inline enum pipe_format
util_format_luminance_to_red(enum pipe_format format)
{
switch (format) {
@ -940,7 +940,7 @@ util_format_luminance_to_red(enum pipe_format format)
* Return the number of components stored.
* Formats with block size != 1x1 will always have 1 component (the block).
*/
static INLINE unsigned
static inline unsigned
util_format_get_nr_components(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
@ -951,7 +951,7 @@ util_format_get_nr_components(enum pipe_format format)
* Return the index of the first non-void channel
* -1 if no non-void channels
*/
static INLINE int
static inline int
util_format_get_first_non_void_channel(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);

@ -616,7 +616,7 @@ def generate_format_unpack(format, dst_channel, dst_native_type, dst_suffix):
name = format.short_name()
print 'static INLINE void'
print 'static inline void'
print 'util_format_%s_unpack_%s(%s *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)' % (name, dst_suffix, dst_native_type)
print '{'
@ -645,7 +645,7 @@ def generate_format_pack(format, src_channel, src_native_type, src_suffix):
name = format.short_name()
print 'static INLINE void'
print 'static inline void'
print 'util_format_%s_pack_%s(uint8_t *dst_row, unsigned dst_stride, const %s *src_row, unsigned src_stride, unsigned width, unsigned height)' % (name, src_suffix, src_native_type)
print '{'
@ -674,7 +674,7 @@ def generate_format_fetch(format, dst_channel, dst_native_type, dst_suffix):
name = format.short_name()
print 'static INLINE void'
print 'static inline void'
print 'util_format_%s_fetch_%s(%s *dst, const uint8_t *src, unsigned i, unsigned j)' % (name, dst_suffix, dst_native_type)
print '{'

@ -43,7 +43,7 @@ extern "C" {
* https://gist.github.com/2144712
*/
static INLINE uint16_t
static inline uint16_t
util_float_to_half(float f)
{
uint32_t sign_mask = 0x80000000;
@ -96,7 +96,7 @@ util_float_to_half(float f)
return f16;
}
static INLINE float
static inline float
util_half_to_float(uint16_t f16)
{
union fi infnan;

@ -68,7 +68,7 @@ struct util_hash_table_item
};
static INLINE struct util_hash_table_item *
static inline struct util_hash_table_item *
util_hash_table_item(struct cso_hash_iter iter)
{
return (struct util_hash_table_item *)cso_hash_iter_data(iter);
@ -98,7 +98,7 @@ util_hash_table_create(unsigned (*hash)(void *key),
}
static INLINE struct cso_hash_iter
static inline struct cso_hash_iter
util_hash_table_find_iter(struct util_hash_table *ht,
void *key,
unsigned key_hash)
@ -118,7 +118,7 @@ util_hash_table_find_iter(struct util_hash_table *ht,
}
static INLINE struct util_hash_table_item *
static inline struct util_hash_table_item *
util_hash_table_find_item(struct util_hash_table *ht,
void *key,
unsigned key_hash)

@ -51,13 +51,13 @@ extern "C" {
*/
static INLINE void
static inline void
pipe_reference_init(struct pipe_reference *reference, unsigned count)
{
p_atomic_set(&reference->count, count);
}
static INLINE boolean
static inline boolean
pipe_is_referenced(struct pipe_reference *reference)
{
return p_atomic_read(&reference->count) != 0;
@ -69,7 +69,7 @@ pipe_is_referenced(struct pipe_reference *reference)
* Both 'ptr' and 'reference' may be NULL.
* \return TRUE if the object's refcount hits zero and should be destroyed.
*/
static INLINE boolean
static inline boolean
pipe_reference_described(struct pipe_reference *ptr,
struct pipe_reference *reference,
debug_reference_descriptor get_desc)
@ -96,14 +96,14 @@ pipe_reference_described(struct pipe_reference *ptr,
return destroy;
}
static INLINE boolean
static inline boolean
pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference)
{
return pipe_reference_described(ptr, reference,
(debug_reference_descriptor)debug_describe_reference);
}
static INLINE void
static inline void
pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
{
struct pipe_surface *old_surf = *ptr;
@ -120,7 +120,7 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
* of using a deleted context's surface_destroy() method when freeing a surface
* that's shared by multiple contexts.
*/
static INLINE void
static inline void
pipe_surface_release(struct pipe_context *pipe, struct pipe_surface **ptr)
{
if (pipe_reference_described(&(*ptr)->reference, NULL,
@ -130,7 +130,7 @@ pipe_surface_release(struct pipe_context *pipe, struct pipe_surface **ptr)
}
static INLINE void
static inline void
pipe_resource_reference(struct pipe_resource **ptr, struct pipe_resource *tex)
{
struct pipe_resource *old_tex = *ptr;
@ -141,7 +141,7 @@ pipe_resource_reference(struct pipe_resource **ptr, struct pipe_resource *tex)
*ptr = tex;
}
static INLINE void
static inline void
pipe_sampler_view_reference(struct pipe_sampler_view **ptr, struct pipe_sampler_view *view)
{
struct pipe_sampler_view *old_view = *ptr;
@ -158,7 +158,7 @@ pipe_sampler_view_reference(struct pipe_sampler_view **ptr, struct pipe_sampler_
* work-around for fixing a dangling context pointer problem when textures
* are shared by multiple contexts. XXX fix this someday.
*/
static INLINE void
static inline void
pipe_sampler_view_release(struct pipe_context *ctx,
struct pipe_sampler_view **ptr)
{
@ -174,7 +174,7 @@ pipe_sampler_view_release(struct pipe_context *ctx,
}
static INLINE void
static inline void
pipe_so_target_reference(struct pipe_stream_output_target **ptr,
struct pipe_stream_output_target *target)
{
@ -186,7 +186,7 @@ pipe_so_target_reference(struct pipe_stream_output_target **ptr,
*ptr = target;
}
static INLINE void
static inline void
pipe_surface_reset(struct pipe_context *ctx, struct pipe_surface* ps,
struct pipe_resource *pt, unsigned level, unsigned layer)
{
@ -199,7 +199,7 @@ pipe_surface_reset(struct pipe_context *ctx, struct pipe_surface* ps,
ps->context = ctx;
}
static INLINE void
static inline void
pipe_surface_init(struct pipe_context *ctx, struct pipe_surface* ps,
struct pipe_resource *pt, unsigned level, unsigned layer)
{
@ -209,7 +209,7 @@ pipe_surface_init(struct pipe_context *ctx, struct pipe_surface* ps,
}
/* Return true if the surfaces are equal. */
static INLINE boolean
static inline boolean
pipe_surface_equal(struct pipe_surface *s1, struct pipe_surface *s2)
{
return s1->texture == s2->texture &&
@ -233,7 +233,7 @@ pipe_surface_equal(struct pipe_surface *s1, struct pipe_surface *s2)
* \param bind bitmask of PIPE_BIND_x flags
* \param usage bitmask of PIPE_USAGE_x flags
*/
static INLINE struct pipe_resource *
static inline struct pipe_resource *
pipe_buffer_create( struct pipe_screen *screen,
unsigned bind,
unsigned usage,
@ -261,7 +261,7 @@ pipe_buffer_create( struct pipe_screen *screen,
* \param access bitmask of PIPE_TRANSFER_x flags
* \param transfer returns a transfer object
*/
static INLINE void *
static inline void *
pipe_buffer_map_range(struct pipe_context *pipe,
struct pipe_resource *buffer,
unsigned offset,
@ -292,7 +292,7 @@ pipe_buffer_map_range(struct pipe_context *pipe,
* \param access bitmask of PIPE_TRANSFER_x flags
* \param transfer returns a transfer object
*/
static INLINE void *
static inline void *
pipe_buffer_map(struct pipe_context *pipe,
struct pipe_resource *buffer,
unsigned access,
@ -302,14 +302,14 @@ pipe_buffer_map(struct pipe_context *pipe,
}
static INLINE void
static inline void
pipe_buffer_unmap(struct pipe_context *pipe,
struct pipe_transfer *transfer)
{
pipe->transfer_unmap(pipe, transfer);
}
static INLINE void
static inline void
pipe_buffer_flush_mapped_range(struct pipe_context *pipe,
struct pipe_transfer *transfer,
unsigned offset,
@ -333,7 +333,7 @@ pipe_buffer_flush_mapped_range(struct pipe_context *pipe,
pipe->transfer_flush_region(pipe, transfer, &box);
}
static INLINE void
static inline void
pipe_buffer_write(struct pipe_context *pipe,
struct pipe_resource *buf,
unsigned offset,
@ -367,7 +367,7 @@ pipe_buffer_write(struct pipe_context *pipe,
* We can avoid GPU/CPU synchronization when writing range that has never
* been written before.
*/
static INLINE void
static inline void
pipe_buffer_write_nooverlap(struct pipe_context *pipe,
struct pipe_resource *buf,
unsigned offset, unsigned size,
@ -393,7 +393,7 @@ pipe_buffer_write_nooverlap(struct pipe_context *pipe,
* \param bind bitmask of PIPE_BIND_x flags
* \param usage bitmask of PIPE_USAGE_x flags
*/
static INLINE struct pipe_resource *
static inline struct pipe_resource *
pipe_buffer_create_with_data(struct pipe_context *pipe,
unsigned bind,
unsigned usage,
@ -406,7 +406,7 @@ pipe_buffer_create_with_data(struct pipe_context *pipe,
return res;
}
static INLINE void
static inline void
pipe_buffer_read(struct pipe_context *pipe,
struct pipe_resource *buf,
unsigned offset,
@ -433,7 +433,7 @@ pipe_buffer_read(struct pipe_context *pipe,
* Map a resource for reading/writing.
* \param access bitmask of PIPE_TRANSFER_x flags
*/
static INLINE void *
static inline void *
pipe_transfer_map(struct pipe_context *context,
struct pipe_resource *resource,
unsigned level, unsigned layer,
@ -456,7 +456,7 @@ pipe_transfer_map(struct pipe_context *context,
* Map a 3D (texture) resource for reading/writing.
* \param access bitmask of PIPE_TRANSFER_x flags
*/
static INLINE void *
static inline void *
pipe_transfer_map_3d(struct pipe_context *context,
struct pipe_resource *resource,
unsigned level,
@ -474,14 +474,14 @@ pipe_transfer_map_3d(struct pipe_context *context,
&box, transfer);
}
static INLINE void
static inline void
pipe_transfer_unmap( struct pipe_context *context,
struct pipe_transfer *transfer )
{
context->transfer_unmap( context, transfer );
}
static INLINE void
static inline void
pipe_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
struct pipe_resource *buf)
{
@ -502,7 +502,7 @@ pipe_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
* Get the polygon offset enable/disable flag for the given polygon fill mode.
* \param fill_mode one of PIPE_POLYGON_MODE_POINT/LINE/FILL
*/
static INLINE boolean
static inline boolean
util_get_offset(const struct pipe_rasterizer_state *templ,
unsigned fill_mode)
{
@ -519,7 +519,7 @@ util_get_offset(const struct pipe_rasterizer_state *templ,
}
}
static INLINE float
static inline float
util_get_min_point_size(const struct pipe_rasterizer_state *state)
{
/* The point size should be clamped to this value at the rasterizer stage.
@ -529,7 +529,7 @@ util_get_min_point_size(const struct pipe_rasterizer_state *state)
!state->multisample ? 1.0f : 0.0f;
}
static INLINE void
static inline void
util_query_clear_result(union pipe_query_result *result, unsigned type)
{
switch (type) {
@ -560,7 +560,7 @@ util_query_clear_result(union pipe_query_result *result, unsigned type)
}
/** Convert PIPE_TEXTURE_x to TGSI_TEXTURE_x */
static INLINE unsigned
static inline unsigned
util_pipe_tex_to_tgsi_tex(enum pipe_texture_target pipe_tex_target,
unsigned nr_samples)
{
@ -602,7 +602,7 @@ util_pipe_tex_to_tgsi_tex(enum pipe_texture_target pipe_tex_target,
}
static INLINE void
static inline void
util_copy_constant_buffer(struct pipe_constant_buffer *dst,
const struct pipe_constant_buffer *src)
{
@ -620,7 +620,7 @@ util_copy_constant_buffer(struct pipe_constant_buffer *dst,
}
}
static INLINE unsigned
static inline unsigned
util_max_layer(const struct pipe_resource *r, unsigned level)
{
switch (r->target) {

@ -65,42 +65,42 @@ extern "C" {
#if _MSC_VER < 1400 && !defined(__cplusplus)
static INLINE float cosf( float f )
static inline float cosf( float f )
{
return (float) cos( (double) f );
}
static INLINE float sinf( float f )
static inline float sinf( float f )
{
return (float) sin( (double) f );
}
static INLINE float ceilf( float f )
static inline float ceilf( float f )
{
return (float) ceil( (double) f );
}
static INLINE float floorf( float f )
static inline float floorf( float f )
{
return (float) floor( (double) f );
}
static INLINE float powf( float f, float g )
static inline float powf( float f, float g )
{
return (float) pow( (double) f, (double) g );
}
static INLINE float sqrtf( float f )
static inline float sqrtf( float f )
{
return (float) sqrt( (double) f );
}
static INLINE float fabsf( float f )
static inline float fabsf( float f )
{
return (float) fabs( (double) f );
}
static INLINE float logf( float f )
static inline float logf( float f )
{
return (float) log( (double) f );
}
@ -119,19 +119,19 @@ static INLINE float logf( float f )
#endif /* _MSC_VER < 1400 && !defined(__cplusplus) */
#if _MSC_VER < 1800
static INLINE double log2( double x )
static inline double log2( double x )
{
const double invln2 = 1.442695041;
return log( x ) * invln2;
}
static INLINE double
static inline double
round(double x)
{
return x >= 0.0 ? floor(x + 0.5) : ceil(x - 0.5);
}
static INLINE float
static inline float
roundf(float x)
{
return x >= 0.0f ? floorf(x + 0.5f) : ceilf(x - 0.5f);
@ -150,7 +150,7 @@ roundf(float x)
#if __STDC_VERSION__ < 199901L && (!defined(__cplusplus) || defined(_MSC_VER))
static INLINE long int
static inline long int
lrint(double d)
{
long int rounded = (long int)(d + 0.5);
@ -163,7 +163,7 @@ lrint(double d)
return rounded;
}
static INLINE long int
static inline long int
lrintf(float f)
{
long int rounded = (long int)(f + 0.5f);
@ -176,7 +176,7 @@ lrintf(float f)
return rounded;
}
static INLINE long long int
static inline long long int
llrint(double d)
{
long long int rounded = (long long int)(d + 0.5);
@ -189,7 +189,7 @@ llrint(double d)
return rounded;
}
static INLINE long long int
static inline long long int
llrintf(float f)
{
long long int rounded = (long long int)(f + 0.5f);
@ -235,7 +235,7 @@ union di {
/**
* Extract the IEEE float32 exponent.
*/
static INLINE signed
static inline signed
util_get_float32_exponent(float x) {
union fi f;
@ -254,7 +254,7 @@ util_get_float32_exponent(float x) {
* Compute exp2(ipart) with i << ipart
* Compute exp2(fpart) with lookup table.
*/
static INLINE float
static inline float
util_fast_exp2(float x)
{
int32_t ipart;
@ -285,7 +285,7 @@ util_fast_exp2(float x)
/**
* Fast approximation to exp(x).
*/
static INLINE float
static inline float
util_fast_exp(float x)
{
const float k = 1.44269f; /* = log2(e) */
@ -304,7 +304,7 @@ extern float log2_table[LOG2_TABLE_SIZE];
/**
* Fast approximation to log2(x).
*/
static INLINE float
static inline float
util_fast_log2(float x)
{
union fi num;
@ -320,7 +320,7 @@ util_fast_log2(float x)
/**
* Fast approximation to x^y.
*/
static INLINE float
static inline float
util_fast_pow(float x, float y)
{
return util_fast_exp2(util_fast_log2(x) * y);
@ -328,7 +328,7 @@ util_fast_pow(float x, float y)
#endif
/* Note that this counts zero as a power of two.
*/
static INLINE boolean
static inline boolean
util_is_power_of_two( unsigned v )
{
return (v & (v-1)) == 0;
@ -338,7 +338,7 @@ util_is_power_of_two( unsigned v )
/**
* Floor(x), returned as int.
*/
static INLINE int
static inline int
util_ifloor(float f)
{
int ai, bi;
@ -355,7 +355,7 @@ util_ifloor(float f)
/**
* Round float to nearest int.
*/
static INLINE int
static inline int
util_iround(float f)
{
#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)
@ -381,7 +381,7 @@ util_iround(float f)
/**
* Approximate floating point comparison
*/
static INLINE boolean
static inline boolean
util_is_approx(float a, float b, float tol)
{
return fabs(b - a) <= tol;
@ -400,7 +400,7 @@ util_is_approx(float a, float b, float tol)
/**
* Single-float
*/
static INLINE boolean
static inline boolean
util_is_inf_or_nan(float x)
{
union fi tmp;
@ -409,7 +409,7 @@ util_is_inf_or_nan(float x)
}
static INLINE boolean
static inline boolean
util_is_nan(float x)
{
union fi tmp;
@ -418,7 +418,7 @@ util_is_nan(float x)
}
static INLINE int
static inline int
util_inf_sign(float x)
{
union fi tmp;
@ -434,7 +434,7 @@ util_inf_sign(float x)
/**
* Double-float
*/
static INLINE boolean
static inline boolean
util_is_double_inf_or_nan(double x)
{
union di tmp;
@ -443,7 +443,7 @@ util_is_double_inf_or_nan(double x)
}
static INLINE boolean
static inline boolean
util_is_double_nan(double x)
{
union di tmp;
@ -452,7 +452,7 @@ util_is_double_nan(double x)
}
static INLINE int
static inline int
util_double_inf_sign(double x)
{
union di tmp;
@ -468,21 +468,21 @@ util_double_inf_sign(double x)
/**
* Half-float
*/
static INLINE boolean
static inline boolean
util_is_half_inf_or_nan(int16_t x)
{
return (x & 0x7c00) == 0x7c00;
}
static INLINE boolean
static inline boolean
util_is_half_nan(int16_t x)
{
return (x & 0x7fff) > 0x7c00;
}
static INLINE int
static inline int
util_half_inf_sign(int16_t x)
{
if ((x & 0x7fff) != 0x7c00) {
@ -503,7 +503,7 @@ util_half_inf_sign(int16_t x)
#if defined(_MSC_VER) && _MSC_VER >= 1300 && (_M_IX86 || _M_AMD64 || _M_IA64)
unsigned char _BitScanForward(unsigned long* Index, unsigned long Mask);
#pragma intrinsic(_BitScanForward)
static INLINE
static inline
unsigned long ffs( unsigned long u )
{
unsigned long i;
@ -513,7 +513,7 @@ unsigned long ffs( unsigned long u )
return 0;
}
#elif defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)
static INLINE
static inline
unsigned ffs( unsigned u )
{
unsigned i;
@ -538,7 +538,7 @@ unsigned ffs( unsigned u )
* Find last bit set in a word. The least significant bit is 1.
* Return 0 if no bits are set.
*/
static INLINE unsigned util_last_bit(unsigned u)
static inline unsigned util_last_bit(unsigned u)
{
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304)
return u == 0 ? 0 : 32 - __builtin_clz(u);
@ -557,7 +557,7 @@ static INLINE unsigned util_last_bit(unsigned u)
* significant bit is 1.
* Return 0 if no bits are set.
*/
static INLINE unsigned util_last_bit_signed(int i)
static inline unsigned util_last_bit_signed(int i)
{
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407)
return 31 - __builtin_clrsb(i);
@ -577,7 +577,7 @@ static INLINE unsigned util_last_bit_signed(int i)
* }
*
*/
static INLINE int u_bit_scan(unsigned *mask)
static inline int u_bit_scan(unsigned *mask)
{
int i = ffs(*mask) - 1;
*mask &= ~(1 << i);
@ -588,7 +588,7 @@ static INLINE int u_bit_scan(unsigned *mask)
/**
* Return float bits.
*/
static INLINE unsigned
static inline unsigned
fui( float f )
{
union fi fi;
@ -601,7 +601,7 @@ fui( float f )
* Convert ubyte to float in [0, 1].
* XXX a 256-entry lookup table would be slightly faster.
*/
static INLINE float
static inline float
ubyte_to_float(ubyte ub)
{
return (float) ub * (1.0f / 255.0f);
@ -611,7 +611,7 @@ ubyte_to_float(ubyte ub)
/**
* Convert float in [0,1] to ubyte in [0,255] with clamping.
*/
static INLINE ubyte
static inline ubyte
float_to_ubyte(float f)
{
union fi tmp;
@ -629,13 +629,13 @@ float_to_ubyte(float f)
}
}
static INLINE float
static inline float
byte_to_float_tex(int8_t b)
{
return (b == -128) ? -1.0F : b * 1.0F / 127.0F;
}
static INLINE int8_t
static inline int8_t
float_to_byte_tex(float f)
{
return (int8_t) (127.0F * f);
@ -644,7 +644,7 @@ float_to_byte_tex(float f)
/**
* Calc log base 2
*/
static INLINE unsigned
static inline unsigned
util_logbase2(unsigned n)
{
#if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 304)
@ -664,7 +664,7 @@ util_logbase2(unsigned n)
/**
* Returns the smallest power of two >= x
*/
static INLINE unsigned
static inline unsigned
util_next_power_of_two(unsigned x)
{
#if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 304)
@ -696,7 +696,7 @@ util_next_power_of_two(unsigned x)
/**
* Return number of bits set in n.
*/
static INLINE unsigned
static inline unsigned
util_bitcount(unsigned n)
{
#if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 304)
@ -721,7 +721,7 @@ util_bitcount(unsigned n)
* Algorithm taken from:
* http://stackoverflow.com/questions/9144800/c-reverse-bits-in-unsigned-integer
*/
static INLINE unsigned
static inline unsigned
util_bitreverse(unsigned n)
{
n = ((n >> 1) & 0x55555555u) | ((n & 0x55555555u) << 1);
@ -753,7 +753,7 @@ util_bitreverse(unsigned n)
/**
* Reverse byte order of a 32 bit word.
*/
static INLINE uint32_t
static inline uint32_t
util_bswap32(uint32_t n)
{
/* We need the gcc version checks for non-autoconf build system */
@ -770,7 +770,7 @@ util_bswap32(uint32_t n)
/**
* Reverse byte order of a 64bit word.
*/
static INLINE uint64_t
static inline uint64_t
util_bswap64(uint64_t n)
{
#if defined(HAVE___BUILTIN_BSWAP64)
@ -785,7 +785,7 @@ util_bswap64(uint64_t n)
/**
* Reverse byte order of a 16 bit word.
*/
static INLINE uint16_t
static inline uint16_t
util_bswap16(uint16_t n)
{
return (n >> 8) |
@ -812,7 +812,7 @@ util_bswap16(uint16_t n)
/**
* Align a value, only works pot alignemnts.
*/
static INLINE int
static inline int
align(int value, int alignment)
{
return (value + alignment - 1) & ~(alignment - 1);
@ -821,7 +821,7 @@ align(int value, int alignment)
/**
* Works like align but on npot alignments.
*/
static INLINE size_t
static inline size_t
util_align_npot(size_t value, size_t alignment)
{
if (value % alignment)
@ -829,7 +829,7 @@ util_align_npot(size_t value, size_t alignment)
return value;
}
static INLINE unsigned
static inline unsigned
u_minify(unsigned value, unsigned levels)
{
return MAX2(1, value >> levels);
@ -862,12 +862,12 @@ do { \
#endif
static INLINE uint32_t util_unsigned_fixed(float value, unsigned frac_bits)
static inline uint32_t util_unsigned_fixed(float value, unsigned frac_bits)
{
return value < 0 ? 0 : (uint32_t)(value * (1<<frac_bits));
}
static INLINE int32_t util_signed_fixed(float value, unsigned frac_bits)
static inline int32_t util_signed_fixed(float value, unsigned frac_bits)
{
return (int32_t)(value * (1<<frac_bits));
}

@ -67,7 +67,7 @@ extern "C" {
/**
* Duplicate a block of memory.
*/
static INLINE void *
static inline void *
mem_dup(const void *src, uint size)
{
void *dup = MALLOC(size);

@ -60,7 +60,7 @@ union util_color {
/**
* Pack 4 ubytes into a 4-byte word
*/
static INLINE unsigned
static inline unsigned
pack_ub4(ubyte b0, ubyte b1, ubyte b2, ubyte b3)
{
return ((((unsigned int)b0) << 0) |
@ -73,7 +73,7 @@ pack_ub4(ubyte b0, ubyte b1, ubyte b2, ubyte b3)
/**
* Pack/convert 4 floats into one 4-byte word.
*/
static INLINE unsigned
static inline unsigned
pack_ui32_float4(float a, float b, float c, float d)
{
return pack_ub4( float_to_ubyte(a),

@ -34,7 +34,7 @@
extern "C" {
#endif
static INLINE intptr_t
static inline intptr_t
pointer_to_intptr( const void *p )
{
union {
@ -45,7 +45,7 @@ pointer_to_intptr( const void *p )
return pi.i;
}
static INLINE void *
static inline void *
intptr_to_pointer( intptr_t i )
{
union {
@ -56,7 +56,7 @@ intptr_to_pointer( intptr_t i )
return pi.p;
}
static INLINE uintptr_t
static inline uintptr_t
pointer_to_uintptr( const void *ptr )
{
union {
@ -67,7 +67,7 @@ pointer_to_uintptr( const void *ptr )
return pu.u;
}
static INLINE void *
static inline void *
uintptr_to_pointer( uintptr_t u )
{
union {
@ -81,7 +81,7 @@ uintptr_to_pointer( uintptr_t u )
/**
* Return a pointer aligned to next multiple of N bytes.
*/
static INLINE void *
static inline void *
align_pointer( const void *unaligned, uintptr_t alignment )
{
uintptr_t aligned = (pointer_to_uintptr( unaligned ) + alignment - 1) & ~(alignment - 1);
@ -92,7 +92,7 @@ align_pointer( const void *unaligned, uintptr_t alignment )
/**
* Return a pointer aligned to next multiple of 16 bytes.
*/
static INLINE void *
static inline void *
align16( void *unaligned )
{
return align_pointer( unaligned, 16 );
@ -100,7 +100,7 @@ align16( void *unaligned )
typedef void (*func_pointer)(void);
static INLINE func_pointer
static inline func_pointer
pointer_to_func( void *p )
{
union {
@ -111,7 +111,7 @@ pointer_to_func( void *p )
return pf.f;
}
static INLINE void *
static inline void *
func_to_pointer( func_pointer f )
{
union {

@ -46,7 +46,7 @@ struct u_prim_vertex_count {
* Decompose a primitive that is a loop, a strip, or a fan. Return the
* original primitive if it is already decomposed.
*/
static INLINE unsigned
static inline unsigned
u_decomposed_prim(unsigned prim)
{
switch (prim) {
@ -71,7 +71,7 @@ u_decomposed_prim(unsigned prim)
* Reduce a primitive to one of PIPE_PRIM_POINTS, PIPE_PRIM_LINES, and
* PIPE_PRIM_TRIANGLES.
*/
static INLINE unsigned
static inline unsigned
u_reduced_prim(unsigned prim)
{
switch (prim) {
@ -91,7 +91,7 @@ u_reduced_prim(unsigned prim)
/**
* Re-assemble a primitive to remove its adjacency.
*/
static INLINE unsigned
static inline unsigned
u_assembled_prim(unsigned prim)
{
switch (prim) {
@ -113,7 +113,7 @@ u_assembled_prim(unsigned prim)
* source file, it will increase the size of the binary slightly more than
* expected because of the use of a table.
*/
static INLINE const struct u_prim_vertex_count *
static inline const struct u_prim_vertex_count *
u_prim_vertex_count(unsigned prim)
{
static const struct u_prim_vertex_count prim_table[PIPE_PRIM_MAX] = {
@ -136,7 +136,7 @@ u_prim_vertex_count(unsigned prim)
return (likely(prim < PIPE_PRIM_MAX)) ? &prim_table[prim] : NULL;
}
static INLINE boolean u_validate_pipe_prim( unsigned pipe_prim, unsigned nr )
static inline boolean u_validate_pipe_prim( unsigned pipe_prim, unsigned nr )
{
const struct u_prim_vertex_count *count = u_prim_vertex_count(pipe_prim);
@ -144,7 +144,7 @@ static INLINE boolean u_validate_pipe_prim( unsigned pipe_prim, unsigned nr )
}
static INLINE boolean u_trim_pipe_prim( unsigned pipe_prim, unsigned *nr )
static inline boolean u_trim_pipe_prim( unsigned pipe_prim, unsigned *nr )
{
const struct u_prim_vertex_count *count = u_prim_vertex_count(pipe_prim);
@ -159,7 +159,7 @@ static INLINE boolean u_trim_pipe_prim( unsigned pipe_prim, unsigned *nr )
}
}
static INLINE unsigned
static inline unsigned
u_vertices_per_prim(int primitive)
{
switch(primitive) {
@ -201,7 +201,7 @@ u_vertices_per_prim(int primitive)
* statistics depend on knowing the exact number of decomposed
* primitives for a set of vertices.
*/
static INLINE unsigned
static inline unsigned
u_decomposed_prims_for_vertices(int primitive, int vertices)
{
switch (primitive) {
@ -248,7 +248,7 @@ u_decomposed_prims_for_vertices(int primitive, int vertices)
* count. Each quad is treated as two triangles. Polygons are treated as
* triangle fans.
*/
static INLINE unsigned
static inline unsigned
u_reduced_prims_for_vertices(int primitive, int vertices)
{
switch (primitive) {

@ -43,7 +43,7 @@ struct u_rect {
/* Do two rectangles intersect?
*/
static INLINE boolean
static inline boolean
u_rect_test_intersection(const struct u_rect *a,
const struct u_rect *b)
{
@ -55,7 +55,7 @@ u_rect_test_intersection(const struct u_rect *a,
/* Find the intersection of two rectangles known to intersect.
*/
static INLINE void
static inline void
u_rect_find_intersection(const struct u_rect *a,
struct u_rect *b)
{
@ -68,13 +68,13 @@ u_rect_find_intersection(const struct u_rect *a,
}
static INLINE int
static inline int
u_rect_area(const struct u_rect *r)
{
return (r->x1 - r->x0) * (r->y1 - r->y0);
}
static INLINE void
static inline void
u_rect_possible_intersection(const struct u_rect *a,
struct u_rect *b)
{
@ -88,7 +88,7 @@ u_rect_possible_intersection(const struct u_rect *a,
/* Set @d to a rectangle that covers both @a and @b.
*/
static INLINE void
static inline void
u_rect_union(struct u_rect *d, const struct u_rect *a, const struct u_rect *b)
{
d->x0 = MIN2(a->x0, b->x0);

@ -54,7 +54,7 @@ extern "C" {
#else
static INLINE char *
static inline char *
util_strchrnul(const char *s, char c)
{
for (; *s && *s != c; ++s);
@ -69,13 +69,13 @@ util_strchrnul(const char *s, char c)
int util_vsnprintf(char *, size_t, const char *, va_list);
int util_snprintf(char *str, size_t size, const char *format, ...);
static INLINE void
static inline void
util_vsprintf(char *str, const char *format, va_list ap)
{
util_vsnprintf(str, (size_t)-1, format, ap);
}
static INLINE void
static inline void
util_sprintf(char *str, const char *format, ...)
{
va_list ap;
@ -84,7 +84,7 @@ util_sprintf(char *str, const char *format, ...)
va_end(ap);
}
static INLINE char *
static inline char *
util_strchr(const char *s, char c)
{
char *p = util_strchrnul(s, c);
@ -92,7 +92,7 @@ util_strchr(const char *s, char c)
return *p ? p : NULL;
}
static INLINE char*
static inline char*
util_strncat(char *dst, const char *src, size_t n)
{
char *p = dst + strlen(dst);
@ -106,7 +106,7 @@ util_strncat(char *dst, const char *src, size_t n)
return dst;
}
static INLINE int
static inline int
util_strcmp(const char *s1, const char *s2)
{
unsigned char u1, u2;
@ -122,7 +122,7 @@ util_strcmp(const char *s1, const char *s2)
return 0;
}
static INLINE int
static inline int
util_strncmp(const char *s1, const char *s2, size_t n)
{
unsigned char u1, u2;
@ -138,7 +138,7 @@ util_strncmp(const char *s1, const char *s2, size_t n)
return 0;
}
static INLINE char *
static inline char *
util_strstr(const char *haystack, const char *needle)
{
const char *p = haystack;
@ -152,7 +152,7 @@ util_strstr(const char *haystack, const char *needle)
return NULL;
}
static INLINE void *
static inline void *
util_memmove(void *dest, const void *src, size_t n)
{
char *p = (char *)dest;
@ -199,7 +199,7 @@ struct util_strbuf
};
static INLINE void
static inline void
util_strbuf_init(struct util_strbuf *sbuf, char *str, size_t size)
{
sbuf->str = str;
@ -209,7 +209,7 @@ util_strbuf_init(struct util_strbuf *sbuf, char *str, size_t size)
}
static INLINE void
static inline void
util_strbuf_printf(struct util_strbuf *sbuf, const char *format, ...)
{
if(sbuf->left > 1) {

@ -91,23 +91,6 @@ typedef unsigned char boolean;
#endif
#endif
/* XXX: Use standard `inline` keyword instead */
#ifndef INLINE
# define INLINE inline
#endif
/* Forced function inlining */
#ifndef ALWAYS_INLINE
# ifdef __GNUC__
# define ALWAYS_INLINE inline __attribute__((always_inline))
# elif defined(_MSC_VER)
# define ALWAYS_INLINE __forceinline
# else
# define ALWAYS_INLINE INLINE
# endif
#endif
/* Function visibility */
#ifndef PUBLIC
# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))

@ -364,16 +364,16 @@ void vrend_update_stencil_state(struct vrend_context *ctx);
static struct vrend_format_table tex_conv_table[VIRGL_FORMAT_MAX];
static INLINE boolean vrend_format_can_sample(enum virgl_formats format)
static inline boolean vrend_format_can_sample(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VREND_BIND_SAMPLER;
}
static INLINE boolean vrend_format_can_render(enum virgl_formats format)
static inline boolean vrend_format_can_render(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VREND_BIND_RENDER;
}
static INLINE boolean vrend_format_is_ds(enum virgl_formats format)
static inline boolean vrend_format_is_ds(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VREND_BIND_DEPTHSTENCIL;
}
@ -422,7 +422,7 @@ static void __report_core_warn(const char *fname, struct vrend_context *ctx, enu
fprintf(stderr,"%s: core profile violation reported %d \"%s\" %s %d\n", fname, ctx->ctx_id, ctx->debug_name, vrend_core_profile_warn_strings[error], value);
}
#define report_core_warn(ctx, error, value) __report_core_warn(__func__, ctx, error, value)
static INLINE boolean should_invert_viewport(struct vrend_context *ctx)
static inline boolean should_invert_viewport(struct vrend_context *ctx)
{
/* if we have a negative viewport then gallium wanted to invert it,
however since we are rendering to GL FBOs we need to invert it
@ -438,7 +438,7 @@ static void vrend_destroy_surface(struct vrend_surface *surf)
free(surf);
}
static INLINE void
static inline void
vrend_surface_reference(struct vrend_surface **ptr, struct vrend_surface *surf)
{
struct vrend_surface *old_surf = *ptr;
@ -454,7 +454,7 @@ static void vrend_destroy_sampler_view(struct vrend_sampler_view *samp)
free(samp);
}
static INLINE void
static inline void
vrend_sampler_view_reference(struct vrend_sampler_view **ptr, struct vrend_sampler_view *view)
{
struct vrend_sampler_view *old_view = *ptr;
@ -470,7 +470,7 @@ static void vrend_destroy_so_target(struct vrend_so_target *target)
free(target);
}
static INLINE void
static inline void
vrend_so_target_reference(struct vrend_so_target **ptr, struct vrend_so_target *target)
{
struct vrend_so_target *old_target = *ptr;
@ -529,7 +529,7 @@ static boolean vrend_compile_shader(struct vrend_context *ctx,
return TRUE;
}
static INLINE void
static inline void
vrend_shader_state_reference(struct vrend_shader_selector **ptr, struct vrend_shader_selector *shader)
{
struct vrend_shader_selector *old_shader = *ptr;
@ -1684,7 +1684,7 @@ static void vrend_destroy_shader_object(void *obj_ptr)
vrend_shader_state_reference(&state, NULL);
}
static INLINE void vrend_fill_shader_key(struct vrend_context *ctx,
static inline void vrend_fill_shader_key(struct vrend_context *ctx,
struct vrend_shader_key *key)
{
if (use_core_profile == 1) {
@ -1718,7 +1718,7 @@ static INLINE void vrend_fill_shader_key(struct vrend_context *ctx,
key->gs_present = true;
}
static INLINE int conv_shader_type(int type)
static inline int conv_shader_type(int type)
{
switch (type) {
case PIPE_SHADER_VERTEX: return GL_VERTEX_SHADER;
@ -2464,13 +2464,13 @@ translate_stencil_op(GLuint op)
#undef CASE
}
static INLINE boolean is_dst_blend(int blend_factor)
static inline boolean is_dst_blend(int blend_factor)
{
return (blend_factor == PIPE_BLENDFACTOR_DST_ALPHA ||
blend_factor == PIPE_BLENDFACTOR_INV_DST_ALPHA);
}
static INLINE int conv_dst_blend(int blend_factor)
static inline int conv_dst_blend(int blend_factor)
{
if (blend_factor == PIPE_BLENDFACTOR_DST_ALPHA)
return PIPE_BLENDFACTOR_ONE;

@ -324,7 +324,7 @@ void vrend_renderer_resource_detach_iov(int res_handle,
int *num_iovs_p);
void vrend_renderer_resource_destroy(struct vrend_resource *res, bool remove);
static INLINE void
static inline void
vrend_resource_reference(struct vrend_resource **ptr, struct vrend_resource *tex)
{
struct vrend_resource *old_tex = *ptr;

Loading…
Cancel
Save