summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/pipebuffer/pb_buffer.h
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-07-02 12:22:51 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-07-02 12:29:07 +0900
commitea4ca10b1bec67c8a60db0e4e5581318ce9f62f9 (patch)
treedd815f4ea41b98cfba066a1aacc71da71a45e0f7 /src/gallium/auxiliary/pipebuffer/pb_buffer.h
parent66b48202c221a25f3980df8f443ce63c2fb4119f (diff)
pipebuffer: Verify usage flag consistency. Minor cleanups.
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer/pb_buffer.h')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
index 857ea53c78..83ea0be74b 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h
@@ -204,13 +204,24 @@ pb_reference(struct pb_buffer **dst,
/**
- * Utility function to check whether a requested alignment is consistent with
- * the provided alignment or not.
+ * Utility function to check whether the provided alignment is consistent with
+ * the requested or not.
*/
-static INLINE int
+static INLINE boolean
pb_check_alignment(size_t requested, size_t provided)
{
- return requested <= provided && (provided % requested) == 0;
+ return requested <= provided && (provided % requested) == 0 ? TRUE : FALSE;
+}
+
+
+/**
+ * Utility function to check whether the provided alignment is consistent with
+ * the requested or not.
+ */
+static INLINE boolean
+pb_check_usage(unsigned requested, unsigned provided)
+{
+ return (requested & provided) == provided ? TRUE : FALSE;
}