[Mesa-dev] [PATCH 1/2] mesa: minor fix-ups for _mesa_validate_sync()

Brian Paul brianp at vmware.com
Sat Sep 14 09:16:38 PDT 2013


Return bool instead of int.  Const-qualify the syncObj.  Add some comments.
---
 src/mesa/main/syncobj.c |   12 ++++++++++--
 src/mesa/main/syncobj.h |    5 +++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c
index 987d4f5..27867a1 100644
--- a/src/mesa/main/syncobj.c
+++ b/src/mesa/main/syncobj.c
@@ -161,8 +161,16 @@ _mesa_free_sync_data(struct gl_context *ctx)
 }
 
 
-int
-_mesa_validate_sync(struct gl_context *ctx, struct gl_sync_object *syncObj)
+/**
+ * Check if the given sync object is:
+ *  - non-null
+ *  - not in sync objects hash table
+ *  - type is GL_SYNC_FENCE
+ *  - not marked as deleted
+ */
+bool
+_mesa_validate_sync(struct gl_context *ctx,
+                    const struct gl_sync_object *syncObj)
 {
    return (syncObj != NULL)
       && _mesa_set_search(ctx->Shared->SyncObjects,
diff --git a/src/mesa/main/syncobj.h b/src/mesa/main/syncobj.h
index 025a9b1..5d510e8 100644
--- a/src/mesa/main/syncobj.h
+++ b/src/mesa/main/syncobj.h
@@ -53,8 +53,9 @@ _mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj);
 extern void
 _mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj);
 
-extern int
-_mesa_validate_sync(struct gl_context *ctx, struct gl_sync_object *syncObj);
+extern bool
+_mesa_validate_sync(struct gl_context *ctx,
+                    const struct gl_sync_object *syncObj);
 
 extern GLboolean GLAPIENTRY
 _mesa_IsSync(GLsync sync);
-- 
1.7.10.4



More information about the mesa-dev mailing list