draw: use a cast wrapper
authorBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 17:57:09 +0000 (11:57 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 21:25:50 +0000 (15:25 -0600)
src/gallium/auxiliary/draw/draw_vs_aos.c

index 9b1cd1c978f07c702d000acd5ea7fc615625f75e..19f49e34c8bd5a9f7683131110d2a6f8c34a62af 100644 (file)
@@ -2089,6 +2089,13 @@ static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient,
 }
 
 
+/** cast wrapper */
+static INLINE struct draw_vs_varient_aos_sse *
+draw_vs_varient_aos_sse(struct draw_vs_varient *varient)
+{
+   return (struct draw_vs_varient_aos_sse *) varient;
+}
+
 
 static void vaos_set_buffer( struct draw_vs_varient *varient,
                              unsigned buf,
@@ -2096,7 +2103,7 @@ static void vaos_set_buffer( struct draw_vs_varient *varient,
                              unsigned stride,
                              unsigned max_stride)
 {
-   struct draw_vs_varient_aos_sse *vaos = (struct draw_vs_varient_aos_sse *)varient;
+   struct draw_vs_varient_aos_sse *vaos = draw_vs_varient_aos_sse(varient);
 
    if (buf < vaos->nr_vb) {
       vaos->buffer[buf].base_ptr = (char *)ptr;
@@ -2113,7 +2120,7 @@ static void PIPE_CDECL vaos_run_elts( struct draw_vs_varient *varient,
                                       unsigned count,
                                       void *output_buffer )
 {
-   struct draw_vs_varient_aos_sse *vaos = (struct draw_vs_varient_aos_sse *)varient;
+   struct draw_vs_varient_aos_sse *vaos = draw_vs_varient_aos_sse(varient);
    struct aos_machine *machine = vaos->draw->vs.aos_machine;
    unsigned i;
 
@@ -2137,7 +2144,7 @@ static void PIPE_CDECL vaos_run_linear( struct draw_vs_varient *varient,
                                         unsigned count,
                                         void *output_buffer )
 {
-   struct draw_vs_varient_aos_sse *vaos = (struct draw_vs_varient_aos_sse *)varient;
+   struct draw_vs_varient_aos_sse *vaos = draw_vs_varient_aos_sse(varient);
    struct aos_machine *machine = vaos->draw->vs.aos_machine;
    unsigned i;
 
@@ -2166,7 +2173,7 @@ static void PIPE_CDECL vaos_run_linear( struct draw_vs_varient *varient,
 
 static void vaos_destroy( struct draw_vs_varient *varient )
 {
-   struct draw_vs_varient_aos_sse *vaos = (struct draw_vs_varient_aos_sse *)varient;
+   struct draw_vs_varient_aos_sse *vaos = draw_vs_varient_aos_sse(varient);
 
    FREE( vaos->buffer );