Mesa (master): mesa: Remove deleteFlag pattern from container objects.

Timothy Arceri tarceri at kemper.freedesktop.org
Sat Apr 22 00:06:12 UTC 2017


Module: Mesa
Branch: master
Commit: ef6af0d5f7b59bd567c65a41165c321e43de6353
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef6af0d5f7b59bd567c65a41165c321e43de6353

Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Apr  5 14:29:00 2017 +1000

mesa: Remove deleteFlag pattern from container objects.

This pattern was only useful when we used mutex locks, which the previous
commit removed.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

---

 src/mesa/main/arrayobj.c    | 4 +---
 src/mesa/main/pipelineobj.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 9f4477e45b..24555d9c7a 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -188,14 +188,12 @@ _mesa_reference_vao_(struct gl_context *ctx,
 
    if (*ptr) {
       /* Unreference the old array object */
-      GLboolean deleteFlag = GL_FALSE;
       struct gl_vertex_array_object *oldObj = *ptr;
 
       assert(oldObj->RefCount > 0);
       oldObj->RefCount--;
-      deleteFlag = (oldObj->RefCount == 0);
 
-      if (deleteFlag)
+      if (oldObj->RefCount == 0)
          _mesa_delete_vao(ctx, oldObj);
 
       *ptr = NULL;
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index a0fa55a85c..9a852be092 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -184,14 +184,12 @@ _mesa_reference_pipeline_object_(struct gl_context *ctx,
 
    if (*ptr) {
       /* Unreference the old pipeline object */
-      GLboolean deleteFlag = GL_FALSE;
       struct gl_pipeline_object *oldObj = *ptr;
 
       assert(oldObj->RefCount > 0);
       oldObj->RefCount--;
-      deleteFlag = (oldObj->RefCount == 0);
 
-      if (deleteFlag) {
+      if (oldObj->RefCount == 0) {
          _mesa_delete_pipeline_object(ctx, oldObj);
       }
 




More information about the mesa-commit mailing list