draw: Fix MSVC warnings.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 29 May 2008 16:46:59 +0000 (01:46 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Mon, 2 Jun 2008 10:46:18 +0000 (19:46 +0900)
src/gallium/auxiliary/draw/draw_pipe.c
src/gallium/auxiliary/draw/draw_pt_decompose.h
src/gallium/auxiliary/draw/draw_pt_varray.c
src/gallium/auxiliary/draw/draw_vs.c
src/gallium/auxiliary/draw/draw_vs_aos.c
src/gallium/auxiliary/draw/draw_vs_aos_io.c

index 1d26706..3355c87 100644 (file)
@@ -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
 
index dccfde9..3fb0695 100644 (file)
@@ -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;
 
index 260f28f..f19e885 100644 (file)
@@ -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;
 }
 
 
index ce35112..979f986 100644 (file)
@@ -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);
 
index 725f36b..9e9f8ba 100644 (file)
@@ -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);
index 45e2092..b720185 100644 (file)
@@ -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);
 }