nv50: remove a few cases of directly casting struct pipe_context
authorMaarten Maathuis <madman2003@gmail.com>
Mon, 17 Aug 2009 12:45:50 +0000 (14:45 +0200)
committerMaarten Maathuis <madman2003@gmail.com>
Mon, 17 Aug 2009 16:48:14 +0000 (18:48 +0200)
src/gallium/drivers/nv50/nv50_context.c
src/gallium/drivers/nv50/nv50_surface.c

index 48f36d6a8b5e2e499a832ab2d307b0ad24b23676..6e8f4f9750dbaf5a88efa620c5355629d59131ab 100644 (file)
@@ -47,7 +47,7 @@ nv50_flush(struct pipe_context *pipe, unsigned flags,
 static void
 nv50_destroy(struct pipe_context *pipe)
 {
-       struct nv50_context *nv50 = (struct nv50_context *)pipe;
+       struct nv50_context *nv50 = nv50_context(pipe);
 
        draw_destroy(nv50->draw);
        FREE(nv50);
index 31c36a12b73319273a4878b90eff30ec1550ceac..edaf4b055a17b8c31532ae329114a95188fe754e 100644 (file)
@@ -144,7 +144,7 @@ nv50_surface_copy(struct pipe_context *pipe,
                  struct pipe_surface *src, unsigned srcx, unsigned srcy,
                  unsigned width, unsigned height)
 {
-       struct nv50_context *nv50 = (struct nv50_context *)pipe;
+       struct nv50_context *nv50 = nv50_context(pipe);
        struct nv50_screen *screen = nv50->screen;
 
        assert(src->format == dest->format);
@@ -158,7 +158,7 @@ nv50_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
                  unsigned destx, unsigned desty, unsigned width,
                  unsigned height, unsigned value)
 {
-       struct nv50_context *nv50 = (struct nv50_context *)pipe;
+       struct nv50_context *nv50 = nv50_context(pipe);
        struct nv50_screen *screen = nv50->screen;
        struct nouveau_channel *chan = screen->eng2d->channel;
        struct nouveau_grobj *eng2d = screen->eng2d;