Commit a2a1a580 authored by Ilia Mirkin's avatar Ilia Mirkin
Browse files

gallium: replace INLINE with inline



Generated by running:
git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g'
git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g'
git checkout src/gallium/state_trackers/clover/Doxyfile

and manual edits to
src/gallium/include/pipe/p_compiler.h
src/gallium/README.portability

to remove mentions of the inline define.
Signed-off-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
Acked-by: default avatarMarek Olšák <marek.olsak@amd.com>
parent 958b5c31
......@@ -13,8 +13,6 @@ headers in general, should strictly follow these guidelines to ensure
* Include the p_compiler.h.
* Don't use the 'inline' keyword, use the INLINE macro in p_compiler.h instead.
* Cast explicitly when converting to integer types of smaller sizes.
* Cast explicitly when converting between float, double and integral types.
......
......@@ -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
......
......@@ -192,7 +192,7 @@ static boolean delete_vertex_elements(struct cso_context *ctx,
}
static INLINE boolean delete_cso(struct cso_context *ctx,
static inline boolean delete_cso(struct cso_context *ctx,
void *state, enum cso_cache_type type)
{
switch (type) {
......@@ -213,7 +213,7 @@ static INLINE boolean delete_cso(struct cso_context *ctx,
return FALSE;
}
static INLINE void
static inline void
sanitize_hash(struct cso_hash *hash, enum cso_cache_type type,
int max_size, void *user_data)
{
......@@ -921,14 +921,14 @@ void cso_restore_tesseval_shader(struct cso_context *ctx)
/* clip state */
static INLINE void
static inline void
clip_state_cpy(struct pipe_clip_state *dst,
const struct pipe_clip_state *src)
{
memcpy(dst->ucp, src->ucp, sizeof(dst->ucp));
}
static INLINE int
static inline int
clip_state_cmp(const struct pipe_clip_state *a,
const struct pipe_clip_state *b)
{
......
......@@ -45,7 +45,7 @@
/* fixme: move it from here */
#define MAX_PRIMITIVES 64
static INLINE int
static inline int
draw_gs_get_input_index(int semantic, int index,
const struct tgsi_shader_info *input_info)
{
......@@ -66,7 +66,7 @@ draw_gs_get_input_index(int semantic, int index,
* the number of elements in the SOA vector. This ensures that the
* throughput is optimized for the given vector instruction set.
*/
static INLINE boolean
static inline boolean
draw_gs_should_flush(struct draw_geometry_shader *shader)
{
return (shader->fetched_prim_count == shader->vector_length);
......
......@@ -72,7 +72,7 @@ struct draw_gs_llvm_iface {
LLVMValueRef input;
};
static INLINE const struct draw_gs_llvm_iface *
static inline const struct draw_gs_llvm_iface *
draw_gs_llvm_iface(const struct lp_build_tgsi_gs_iface *iface)
{
return (const struct draw_gs_llvm_iface *)iface;
......
......@@ -350,7 +350,7 @@ struct draw_gs_llvm_variant_key
PIPE_MAX_SHADER_SAMPLER_VIEWS * sizeof(struct draw_sampler_static_state))
static INLINE size_t
static inline size_t
draw_llvm_variant_key_size(unsigned nr_vertex_elements,
unsigned nr_samplers)
{
......@@ -360,7 +360,7 @@ draw_llvm_variant_key_size(unsigned nr_vertex_elements,
}
static INLINE size_t
static inline size_t
draw_gs_llvm_variant_key_size(unsigned nr_samplers)
{
return (sizeof(struct draw_gs_llvm_variant_key) +
......@@ -368,7 +368,7 @@ draw_gs_llvm_variant_key_size(unsigned nr_samplers)
}
static INLINE struct draw_sampler_static_state *
static inline struct draw_sampler_static_state *
draw_llvm_variant_key_samplers(struct draw_llvm_variant_key *key)
{
return (struct draw_sampler_static_state *)
......@@ -476,13 +476,13 @@ struct draw_llvm {
};
static INLINE struct llvm_vertex_shader *
static inline struct llvm_vertex_shader *
llvm_vertex_shader(struct draw_vertex_shader *vs)
{
return (struct llvm_vertex_shader *)vs;
}
static INLINE struct llvm_geometry_shader *
static inline struct llvm_geometry_shader *
llvm_geometry_shader(struct draw_geometry_shader *gs)
{
return (struct llvm_geometry_shader *)gs;
......
......@@ -115,7 +115,7 @@ void draw_unfilled_prepare_outputs(struct draw_context *context,
* \param idx index into stage's tmp[] array to put the copy (dest)
* \return pointer to the copied vertex
*/
static INLINE struct vertex_header *
static inline struct vertex_header *
dup_vert( struct draw_stage *stage,
const struct vertex_header *vert,
unsigned idx )
......
......@@ -511,7 +511,7 @@ bind_aaline_fragment_shader(struct aaline_stage *aaline)
static INLINE struct aaline_stage *
static inline struct aaline_stage *
aaline_stage( struct draw_stage *stage )
{
return (struct aaline_stage *) stage;
......
......@@ -427,7 +427,7 @@ bind_aapoint_fragment_shader(struct aapoint_stage *aapoint)
static INLINE struct aapoint_stage *
static inline struct aapoint_stage *
aapoint_stage( struct draw_stage *stage )
{
return (struct aapoint_stage *) stage;
......
......@@ -70,12 +70,12 @@ struct clip_stage {
/** Cast wrapper */
static INLINE struct clip_stage *clip_stage( struct draw_stage *stage )
static inline struct clip_stage *clip_stage( struct draw_stage *stage )
{
return (struct clip_stage *)stage;
}
static INLINE unsigned
static inline unsigned
draw_viewport_index(struct draw_context *draw,
const struct vertex_header *leading_vertex)
{
......@@ -210,7 +210,7 @@ static void interp( const struct clip_stage *clip,
* true, otherwise returns false.
* Triangle is considered null/empty if it's area is qual to zero.
*/
static INLINE boolean
static inline boolean
is_tri_null(struct draw_context *draw, const struct prim_header *header)
{
const unsigned pos_attr = draw_current_shader_position_output(draw);
......@@ -322,7 +322,7 @@ static void emit_poly( struct draw_stage *stage,
}
static INLINE float
static inline float
dot4(const float *a, const float *b)
{
return (a[0] * b[0] +
......@@ -336,7 +336,7 @@ dot4(const float *a, const float *b)
* it first checks if the shader provided a clip distance, otherwise
* it works out the value using the clipvertex
*/
static INLINE float getclipdist(const struct clip_stage *clipper,
static inline float getclipdist(const struct clip_stage *clipper,
struct vertex_header *vert,
int plane_idx)
{
......
......@@ -46,12 +46,12 @@ struct cull_stage {
};
static INLINE struct cull_stage *cull_stage( struct draw_stage *stage )
static inline struct cull_stage *cull_stage( struct draw_stage *stage )
{
return (struct cull_stage *)stage;
}
static INLINE boolean
static inline boolean
cull_distance_is_out(float dist)
{
return (dist < 0.0f) || util_is_inf_or_nan(dist);
......
......@@ -47,7 +47,7 @@ struct flat_stage
};
static INLINE struct flat_stage *
static inline struct flat_stage *
flat_stage(struct draw_stage *stage)
{
return (struct flat_stage *) stage;
......@@ -55,7 +55,7 @@ flat_stage(struct draw_stage *stage)
/** Copy all the constant attributes from 'src' vertex to 'dst' vertex */
static INLINE void copy_flats( struct draw_stage *stage,
static inline void copy_flats( struct draw_stage *stage,
struct vertex_header *dst,
const struct vertex_header *src )
{
......@@ -70,7 +70,7 @@ static INLINE void copy_flats( struct draw_stage *stage,
/** Copy all the color attributes from src vertex to dst0 & dst1 vertices */
static INLINE void copy_flats2( struct draw_stage *stage,
static inline void copy_flats2( struct draw_stage *stage,
struct vertex_header *dst0,
struct vertex_header *dst1,
const struct vertex_header *src )
......
......@@ -49,7 +49,7 @@ struct offset_stage {
static INLINE struct offset_stage *offset_stage( struct draw_stage *stage )
static inline struct offset_stage *offset_stage( struct draw_stage *stage )
{
return (struct offset_stage *) stage;
}
......
......@@ -462,7 +462,7 @@ bind_pstip_fragment_shader(struct pstip_stage *pstip)
}
static INLINE struct pstip_stage *
static inline struct pstip_stage *
pstip_stage( struct draw_stage *stage )
{
return (struct pstip_stage *) stage;
......
......@@ -53,7 +53,7 @@ struct stipple_stage {
};
static INLINE struct stipple_stage *
static inline struct stipple_stage *
stipple_stage(struct draw_stage *stage)
{
return (struct stipple_stage *) stage;
......@@ -108,7 +108,7 @@ emit_segment(struct draw_stage *stage, struct prim_header *header,
}
static INLINE unsigned
static inline unsigned
stipple_test(int counter, ushort pattern, int factor)
{
int b = (counter / factor) & 0xf;
......
......@@ -43,7 +43,7 @@ struct twoside_stage {
};
static INLINE struct twoside_stage *twoside_stage( struct draw_stage *stage )
static inline struct twoside_stage *twoside_stage( struct draw_stage *stage )
{
return (struct twoside_stage *)stage;
}
......@@ -51,7 +51,7 @@ static INLINE struct twoside_stage *twoside_stage( struct draw_stage *stage )
/**
* Copy back color(s) to front color(s).
*/
static INLINE struct vertex_header *
static inline struct vertex_header *
copy_bfc( struct twoside_stage *twoside,
const struct vertex_header *v,
unsigned idx )
......
......@@ -53,7 +53,7 @@ struct unfilled_stage {
};
static INLINE struct unfilled_stage *unfilled_stage( struct draw_stage *stage )
static inline struct unfilled_stage *unfilled_stage( struct draw_stage *stage )
{
return (struct unfilled_stage *)stage;
}
......
......@@ -85,7 +85,7 @@ struct vbuf_stage {
/**
* Basically a cast wrapper.
*/
static INLINE struct vbuf_stage *
static inline struct vbuf_stage *
vbuf_stage( struct draw_stage *stage )
{
assert(stage);
......@@ -97,7 +97,7 @@ static void vbuf_flush_vertices( struct vbuf_stage *vbuf );
static void vbuf_alloc_vertices( struct vbuf_stage *vbuf );
static INLINE boolean
static inline boolean
overflow( void *map, void *ptr, unsigned bytes, unsigned bufsz )
{
unsigned long used = (unsigned long) ((char *)ptr - (char *)map);
......@@ -105,7 +105,7 @@ overflow( void *map, void *ptr, unsigned bytes, unsigned bufsz )
}
static INLINE void
static inline void
check_space( struct vbuf_stage *vbuf, unsigned nr )
{
if (vbuf->nr_vertices + nr > vbuf->max_vertices ||
......@@ -126,7 +126,7 @@ check_space( struct vbuf_stage *vbuf, unsigned nr )
* have a couple of slots at the beginning (1-dword header, 4-dword
* clip pos) that we ignore here. We only use the vertex->data[] fields.
*/
static INLINE ushort
static inline ushort
emit_vertex( struct vbuf_stage *vbuf,
struct vertex_header *vertex )
{
......
......@@ -45,7 +45,7 @@ struct wideline_stage {
static INLINE struct wideline_stage *wideline_stage( struct draw_stage *stage )
static inline struct wideline_stage *wideline_stage( struct draw_stage *stage )
{
return (struct wideline_stage *)stage;
}
......
......@@ -83,7 +83,7 @@ struct widepoint_stage {
static INLINE struct widepoint_stage *
static inline struct widepoint_stage *
widepoint_stage( struct draw_stage *stage )
{
return (struct widepoint_stage *)stage;
......
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