draw: Avoid integer overflow converting pointers on 64bit archs.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 30 Dec 2008 20:10:24 +0000 (20:10 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 31 Dec 2008 13:02:06 +0000 (13:02 +0000)
Not really an error, as we only care for the lower 4 bits.

src/gallium/auxiliary/draw/draw_vs.c

index 7f305304ff7c656b14b7b7eb503e63cabaa16719..c057cd67fde6e6d90cc36f9a1972552c50f6eb27 100644 (file)
@@ -50,7 +50,7 @@ void draw_vs_set_constants( struct draw_context *draw,
                             const float (*constants)[4],
                             unsigned size )
 {
-   if (((unsigned)constants) & 0xf) {
+   if (((uintptr_t)constants) & 0xf) {
       if (size > draw->vs.const_storage_size) {
          if (draw->vs.aligned_constant_storage)
             align_free((void *)draw->vs.aligned_constant_storage);