r600g: drop all use of unsigned long
authorDave Airlie <airlied@redhat.com>
Wed, 13 Oct 2010 01:08:44 +0000 (11:08 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 13 Oct 2010 05:55:48 +0000 (15:55 +1000)
this changes size on 32/64 bit so is definitely no what you want to use here.

src/gallium/drivers/r600/r600_resource.h
src/gallium/drivers/r600/r600_texture.c

index 2d7495e0fbba33e873cf683d1aa734663a0e6e87..ef484aba4a2fa10c9435a773c7c568e04bfc4d27 100644 (file)
@@ -49,12 +49,12 @@ struct r600_resource {
 
 struct r600_resource_texture {
        struct r600_resource            resource;
-       unsigned long                   offset[PIPE_MAX_TEXTURE_LEVELS];
-       unsigned long                   pitch_in_bytes[PIPE_MAX_TEXTURE_LEVELS];
-       unsigned long                   pitch_in_pixels[PIPE_MAX_TEXTURE_LEVELS];
-       unsigned long                   layer_size[PIPE_MAX_TEXTURE_LEVELS];
-       unsigned long                   pitch_override;
-       unsigned long                   size;
+       unsigned                        offset[PIPE_MAX_TEXTURE_LEVELS];
+       unsigned                        pitch_in_bytes[PIPE_MAX_TEXTURE_LEVELS];
+       unsigned                        pitch_in_pixels[PIPE_MAX_TEXTURE_LEVELS];
+       unsigned                        layer_size[PIPE_MAX_TEXTURE_LEVELS];
+       unsigned                        pitch_override;
+       unsigned                        size;
        unsigned                        tiled;
        unsigned                        array_mode;
        unsigned                        tile_type;
index 94886acc38e33c9c25c138e4851bebcee7aef133..22fe8bf0f39d9be9dfb737c94774f808e610e736 100644 (file)
@@ -72,11 +72,11 @@ static void r600_copy_into_tiled_texture(struct pipe_context *ctx, struct r600_t
        ctx->flush(ctx, 0, NULL);
 }
 
-static unsigned long r600_texture_get_offset(struct r600_resource_texture *rtex,
+static unsigned r600_texture_get_offset(struct r600_resource_texture *rtex,
                                        unsigned level, unsigned zslice,
                                        unsigned face)
 {
-       unsigned long offset = rtex->offset[level];
+       unsigned offset = rtex->offset[level];
 
        switch (rtex->resource.base.b.target) {
        case PIPE_TEXTURE_3D:
@@ -139,7 +139,7 @@ static void r600_setup_miptree(struct pipe_screen *screen,
        struct pipe_resource *ptex = &rtex->resource.base.b;
        struct radeon *radeon = (struct radeon *)screen->winsys;
        enum chip_class chipc = r600_get_family_class(radeon);
-       unsigned long pitch, size, layer_size, i, offset;
+       unsigned pitch, size, layer_size, i, offset;
        unsigned nblocksy;
 
        for (i = 0, offset = 0; i <= ptex->last_level; i++) {
@@ -238,7 +238,7 @@ static struct pipe_surface *r600_get_tex_surface(struct pipe_screen *screen,
 {
        struct r600_resource_texture *rtex = (struct r600_resource_texture*)texture;
        struct pipe_surface *surface = CALLOC_STRUCT(pipe_surface);
-       unsigned long offset;
+       unsigned offset;
 
        if (surface == NULL)
                return NULL;
@@ -427,7 +427,7 @@ void* r600_texture_transfer_map(struct pipe_context *ctx,
        struct r600_bo *bo;
        enum pipe_format format = transfer->resource->format;
        struct radeon *radeon = (struct radeon *)ctx->screen->winsys;
-       unsigned long offset = 0;
+       unsigned offset = 0;
        char *map;
 
        if (rtransfer->linear_texture) {