gallium/util: fix undefined shift to the last bit in u_bit_scan
authorMarek Olšák <marek.olsak@amd.com>
Sat, 16 Apr 2016 00:09:55 +0000 (02:09 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 18 Apr 2016 17:51:24 +0000 (19:51 +0200)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/util/u_math.h

index 0a829158b11cd693131029465d9b31ee63e1d4b4..d983af332031369048f123e28e13b77dedb4741c 100644 (file)
@@ -489,7 +489,7 @@ static inline int
 u_bit_scan(unsigned *mask)
 {
    int i = ffs(*mask) - 1;
-   *mask &= ~(1 << i);
+   *mask &= ~(1u << i);
    return i;
 }