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 1d26706deee6a7b3f4f16c02940c3497fb27b446..3355c871ee310c2f97361f001017575225a9bc99 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 dccfde99dde39e835fd36a0d7e4fea6d41a90dfa..3fb0695687892abd977a43e800c7d800683a953e 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 260f28f2845d9209ae2c8ed9de86936c9a3b0606..f19e8850b3e0af537591286c4b1f4aa0177ed641 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 ce35112fc109e5ffb97e41e7e5815ea508abb091..979f9864fdb0b496b491fd64b3315d53b8386054 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 725f36b5025ff9c09fc808dda2cadee1bd96e244..9e9f8bac1e4b5ae6d26cfebd1fcce45f4378f843 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 45e209220924701575eb95b1e3e91f87383706d6..b720185709c08e7e8b3311b1b725fb44646f0e9d 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);
 }