From 5b86ae60fe339ae0b813d16ec328a68ccb2b9514 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 30 May 2008 01:46:59 +0900 Subject: draw: Fix MSVC warnings. --- src/gallium/auxiliary/draw/draw_pipe.c | 3 ++- src/gallium/auxiliary/draw/draw_pt_decompose.h | 6 +++--- src/gallium/auxiliary/draw/draw_pt_varray.c | 4 ++-- src/gallium/auxiliary/draw/draw_vs.c | 6 +++--- src/gallium/auxiliary/draw/draw_vs_aos.c | 4 ++-- src/gallium/auxiliary/draw/draw_vs_aos_io.c | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe.c b/src/gallium/auxiliary/draw/draw_pipe.c index 1d26706dee..3355c871ee 100644 --- a/src/gallium/auxiliary/draw/draw_pipe.c +++ b/src/gallium/auxiliary/draw/draw_pipe.c @@ -255,7 +255,8 @@ void draw_pipeline_run( struct draw_context *draw, char *verts = (char *)vertices; \ boolean flatfirst = (draw->rasterizer->flatshade && \ draw->rasterizer->flatshade_first); \ - unsigned i, flags + unsigned i; \ + ushort flags #define FLUSH diff --git a/src/gallium/auxiliary/draw/draw_pt_decompose.h b/src/gallium/auxiliary/draw/draw_pt_decompose.h index dccfde99dd..3fb0695687 100644 --- a/src/gallium/auxiliary/draw/draw_pt_decompose.h +++ b/src/gallium/auxiliary/draw/draw_pt_decompose.h @@ -118,9 +118,9 @@ static void FUNC( ARGS, /* These bitflags look a little odd because we submit the * vertices as (1,2,0) to satisfy flatshade requirements. */ - const unsigned edge_first = DRAW_PIPE_EDGE_FLAG_2; - const unsigned edge_middle = DRAW_PIPE_EDGE_FLAG_0; - const unsigned edge_last = DRAW_PIPE_EDGE_FLAG_1; + const ushort edge_first = DRAW_PIPE_EDGE_FLAG_2; + const ushort edge_middle = DRAW_PIPE_EDGE_FLAG_0; + const ushort edge_last = DRAW_PIPE_EDGE_FLAG_1; flags = DRAW_PIPE_RESET_STIPPLE | edge_first | edge_middle; diff --git a/src/gallium/auxiliary/draw/draw_pt_varray.c b/src/gallium/auxiliary/draw/draw_pt_varray.c index 260f28f284..f19e8850b3 100644 --- a/src/gallium/auxiliary/draw/draw_pt_varray.c +++ b/src/gallium/auxiliary/draw/draw_pt_varray.c @@ -109,9 +109,9 @@ static INLINE void fetch_init(struct varray_frontend *varray, static INLINE void add_draw_el(struct varray_frontend *varray, - int idx) + unsigned idx) { - varray->draw_elts[varray->draw_count++] = idx; + varray->draw_elts[varray->draw_count++] = (ushort)idx; } diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c index ce35112fc1..979f9864fd 100644 --- a/src/gallium/auxiliary/draw/draw_vs.c +++ b/src/gallium/auxiliary/draw/draw_vs.c @@ -49,10 +49,10 @@ void draw_vs_set_constants( struct draw_context *draw, if (((unsigned)constants) & 0xf) { if (size > draw->vs.const_storage_size) { if (draw->vs.aligned_constant_storage) - align_free(draw->vs.aligned_constant_storage); + align_free((void *)draw->vs.aligned_constant_storage); draw->vs.aligned_constant_storage = align_malloc( size, 16 ); } - memcpy( draw->vs.aligned_constant_storage, + memcpy( (void*)draw->vs.aligned_constant_storage, constants, size ); constants = draw->vs.aligned_constant_storage; @@ -174,7 +174,7 @@ draw_vs_destroy( struct draw_context *draw ) draw_vs_aos_machine_destroy(draw->vs.aos_machine); if (draw->vs.aligned_constant_storage) - align_free(draw->vs.aligned_constant_storage); + align_free((void*)draw->vs.aligned_constant_storage); tgsi_exec_machine_free_data(&draw->vs.machine); diff --git a/src/gallium/auxiliary/draw/draw_vs_aos.c b/src/gallium/auxiliary/draw/draw_vs_aos.c index 725f36b502..9e9f8bac1e 100644 --- a/src/gallium/auxiliary/draw/draw_vs_aos.c +++ b/src/gallium/auxiliary/draw/draw_vs_aos.c @@ -492,7 +492,7 @@ static struct x86_reg fetch_src( struct aos_compilation *cp, src->SrcRegister.File, src->SrcRegister.Index); unsigned i; - unsigned swz = 0; + ubyte swz = 0; unsigned negs = 0; unsigned abs = 0; @@ -704,7 +704,7 @@ static void store_dest( struct aos_compilation *cp, static void inject_scalar( struct aos_compilation *cp, struct x86_reg dst, struct x86_reg result, - unsigned swizzle ) + ubyte swizzle ) { sse_shufps(cp->func, dst, dst, swizzle); sse_movss(cp->func, dst, result); diff --git a/src/gallium/auxiliary/draw/draw_vs_aos_io.c b/src/gallium/auxiliary/draw/draw_vs_aos_io.c index 45e2092209..b720185709 100644 --- a/src/gallium/auxiliary/draw/draw_vs_aos_io.c +++ b/src/gallium/auxiliary/draw/draw_vs_aos_io.c @@ -118,7 +118,7 @@ static void get_src_ptr( struct aos_compilation *cp, static void emit_swizzle( struct aos_compilation *cp, struct x86_reg dest, struct x86_reg src, - unsigned shuffle ) + ubyte shuffle ) { sse_shufps(cp->func, dest, src, shuffle); } -- cgit v1.2.3