mesa: tidy up init_matrix_stack()
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 10 Sep 2018 10:41:27 +0000 (20:41 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 10 Sep 2018 23:26:04 +0000 (09:26 +1000)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
src/mesa/main/matrix.c

index 83f081e88e5d37c59c9962e037a2994d7af77121..8065a83705c4d601ce306a93e5bcc5bfb8961614 100644 (file)
@@ -657,20 +657,16 @@ void _mesa_update_modelview_project( struct gl_context *ctx, GLuint new_state )
  * _math_matrix_ctr() for each element to initialize it.
  */
 static void
-init_matrix_stack( struct gl_matrix_stack *stack,
-                   GLuint maxDepth, GLuint dirtyFlag )
+init_matrix_stack(struct gl_matrix_stack *stack,
+                  GLuint maxDepth, GLuint dirtyFlag)
 {
-   GLuint i;
-
    stack->Depth = 0;
    stack->MaxDepth = maxDepth;
    stack->DirtyFlag = dirtyFlag;
    /* The stack will be dynamically resized at glPushMatrix() time */
    stack->Stack = calloc(1, sizeof(GLmatrix));
    stack->StackSize = 1;
-   for (i = 0; i < stack->StackSize; i++) {
-      _math_matrix_ctr(&stack->Stack[i]);
-   }
+   _math_matrix_ctr(&stack->Stack[0]);
    stack->Top = stack->Stack;
 }