diff options
author | José Fonseca <[email protected]> | 2009-03-25 20:56:34 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-03-25 21:01:49 +0000 |
commit | 079be0fd3f1d0f52f26a95756809ac4a2325ccb1 (patch) | |
tree | af5f0a06fc94e41717dcd67de2ebb885e389dae8 /src | |
parent | b3e03ede3eeb224a2c293ae924ffa58f1de7e84a (diff) |
draw: Use size_t (for x86_64).
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_vertex.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vertex.h b/src/gallium/auxiliary/draw/draw_vertex.h index c143cf23723..554f4ac3c18 100644 --- a/src/gallium/auxiliary/draw/draw_vertex.h +++ b/src/gallium/auxiliary/draw/draw_vertex.h @@ -87,18 +87,17 @@ struct vertex_info } attrib[PIPE_MAX_SHADER_INPUTS]; }; -static INLINE int +static INLINE size_t draw_vinfo_size( const struct vertex_info *a ) { - return ((const char *)&a->attrib[a->num_attribs] - - (const char *)a); + return offsetof(const struct vertex_info, attrib[a->num_attribs]); } static INLINE int draw_vinfo_compare( const struct vertex_info *a, const struct vertex_info *b ) { - unsigned sizea = draw_vinfo_size( a ); + size_t sizea = draw_vinfo_size( a ); return memcmp( a, b, sizea ); } @@ -106,7 +105,7 @@ static INLINE void draw_vinfo_copy( struct vertex_info *dst, const struct vertex_info *src ) { - unsigned size = draw_vinfo_size( src ); + size_t size = draw_vinfo_size( src ); memcpy( dst, src, size ); } |