Mesa (10.6): t_dd_dmatmp: Clean up improper code formatting from previous patch

Emil Velikov evelikov at kemper.freedesktop.org
Thu Oct 1 09:28:56 UTC 2015


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Sep 14 11:46:50 2015 -0700

t_dd_dmatmp: Clean up improper code formatting from previous patch

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Cc: "10.6 11.0" <mesa-stable at lists.freedesktop.org>
(cherry picked from commit fad8d54de7e7f908cb0d06f0b54af8440e689928)

---

 src/mesa/tnl_dd/t_dd_dmatmp.h |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
index 9a660e3..f9e3ce6 100644
--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
+++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
@@ -214,10 +214,7 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
 
       INIT( GL_LINE_STRIP );
 
-      if (flags & PRIM_BEGIN)
-	 j = 0;
-      else
-	 j = 1;
+      j = (flags & PRIM_BEGIN) ? 0 : 1;
 
       /* Ensure last vertex won't wrap buffers:
        */
@@ -234,7 +231,7 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
 	    nr = MIN2( currentsz, count - j );
 
 	    if (j + nr >= count &&
-		0 < count - 1 &&
+		count > 1 &&
 		(flags & PRIM_END)) 
 	    {
 	       void *tmp;
@@ -250,7 +247,7 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
 	 }
 
       }
-      else if (1 < count && (flags & PRIM_END)) {
+      else if (count > 1 && (flags & PRIM_END)) {
 	 void *tmp;
 	 tmp = ALLOC_VERTS(2);
 	 tmp = TAG(emit_verts)( ctx, start+1, 1, tmp );
@@ -798,10 +795,7 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
       FLUSH();
       ELT_INIT( GL_LINE_STRIP );
 
-      if (flags & PRIM_BEGIN)
-	 j = 0;
-      else
-	 j = 1;
+      j = (flags & PRIM_BEGIN) ? 0 : 1;
 
       currentsz = GET_CURRENT_VB_MAX_ELTS();
       if (currentsz < 8) {
@@ -818,7 +812,7 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
 	    nr = MIN2( currentsz, count - j );
 
 	    if (j + nr >= count &&
-		0 < count - 1 &&
+		count > 1 &&
 		(flags & PRIM_END)) 
 	    {
 	       void *tmp;
@@ -834,7 +828,7 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
 	 }
 
       }
-      else if (1 < count && (flags & PRIM_END)) {
+      else if (count > 1 && (flags & PRIM_END)) {
 	 void *tmp;
 	 tmp = ALLOC_ELTS(2);
 	 tmp = TAG(emit_elts)( ctx, elts+start+1, 1, tmp );




More information about the mesa-commit mailing list