aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-02-11 14:57:55 -0800
committerEric Anholt <[email protected]>2015-02-20 11:36:34 -0800
commit8aa381e3cd848f051931f86af5fdcd59921916ee (patch)
treeace239c760e8bf9839157bc302c4ae9ae5b2e7b1
parent41b1882ed45f0fcb827a178cb3f7143fcaa8c4d9 (diff)
mesa: Make bitset.h not rely on Mesa-specific types and functions.
Note that we can't use u_math.h's align() because it's a function instead of a macro, while BITSET_DECLARE needs a constant expression for nouveau's usage in global declarations. v2: Stick some parens around the bits macro argument usage (review by Jose). Reviewed-by: Jose Fonseca <[email protected]>
-rw-r--r--src/mesa/main/bitset.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/main/bitset.h b/src/mesa/main/bitset.h
index 2558da49a6a..17c5d5d252a 100644
--- a/src/mesa/main/bitset.h
+++ b/src/mesa/main/bitset.h
@@ -31,19 +31,18 @@
#ifndef BITSET_H
#define BITSET_H
-#include "imports.h"
-#include "macros.h"
+#include "util/u_math.h"
/****************************************************************************
* generic bitset implementation
*/
-#define BITSET_WORD GLuint
+#define BITSET_WORD unsigned int
#define BITSET_WORDBITS (sizeof (BITSET_WORD) * 8)
/* bitset declarations
*/
-#define BITSET_WORDS(bits) (ALIGN(bits, BITSET_WORDBITS) / BITSET_WORDBITS)
+#define BITSET_WORDS(bits) (((bits) + BITSET_WORDBITS - 1) / BITSET_WORDBITS)
#define BITSET_DECLARE(name, bits) BITSET_WORD name[BITSET_WORDS(bits)]
/* bitset operations