summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/nv40/nv40_query.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-01-16 13:41:50 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-01-16 13:45:31 +1100
commite0e9326bdadb268dbb5eeedb14404ac2f48c103e (patch)
treecad1807addb4f13a50785dadc9f49854e94e0436 /src/mesa/pipe/nv40/nv40_query.c
parentbc1ca3793d661de343b956d66ef70605d7de2dbb (diff)
nv40: stronger type safety
Diffstat (limited to 'src/mesa/pipe/nv40/nv40_query.c')
-rw-r--r--src/mesa/pipe/nv40/nv40_query.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/pipe/nv40/nv40_query.c b/src/mesa/pipe/nv40/nv40_query.c
index ea30d3ede8..06f41fe84f 100644
--- a/src/mesa/pipe/nv40/nv40_query.c
+++ b/src/mesa/pipe/nv40/nv40_query.c
@@ -8,7 +8,12 @@ struct nv40_query {
boolean ready;
uint64_t result;
};
-#define nv40_query(o) ((struct nv40_query *)(o))
+
+static inline struct nv40_query *
+nv40_query(struct pipe_query *pipe)
+{
+ return (struct nv40_query *)pipe;
+}
static struct pipe_query *
nv40_query_create(struct pipe_context *pipe, unsigned query_type)
@@ -55,7 +60,7 @@ nv40_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
static void
nv40_query_end(struct pipe_context *pipe, struct pipe_query *pq)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_query *q = nv40_query(pq);
BEGIN_RING(curie, NV40TCL_QUERY_GET, 1);
@@ -66,9 +71,9 @@ nv40_query_end(struct pipe_context *pipe, struct pipe_query *pq)
static boolean
nv40_query_result(struct pipe_context *pipe, struct pipe_query *pq,
- boolean wait, uint64_t *result)
+ boolean wait, uint64 *result)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_query *q = nv40_query(pq);
struct nouveau_winsys *nvws = nv40->nvws;