From d08949f593d112bedd960376679b9c5336513372 Mon Sep 17 00:00:00 2001 From: Michael Aganier Date: Sat, 25 Sep 2021 06:31:53 -0400 Subject: [PATCH] Rename body local variable to fix shadow warning GCC gives me the warning "declaration shadows a local variable" because there's two 'body' variables in the function. This fixes the warning. --- src/cpSpaceComponent.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cpSpaceComponent.c b/src/cpSpaceComponent.c index 7b2d6069..d4955f72 100644 --- a/src/cpSpaceComponent.c +++ b/src/cpSpaceComponent.c @@ -128,16 +128,16 @@ cpBodyActivate(cpBody *body) cpAssertSoft(cpBodyGetType(root) == CP_BODY_TYPE_DYNAMIC, "Internal Error: Non-dynamic body component root detected."); cpSpace *space = root->space; - cpBody *body = root; - while(body){ - cpBody *next = body->sleeping.next; + cpBody *bodyA = root; + while(bodyA){ + cpBody *next = bodyA->sleeping.next; - body->sleeping.idleTime = 0.0f; - body->sleeping.root = NULL; - body->sleeping.next = NULL; - cpSpaceActivateBody(space, body); + bodyA->sleeping.idleTime = 0.0f; + bodyA->sleeping.root = NULL; + bodyA->sleeping.next = NULL; + cpSpaceActivateBody(space, bodyA); - body = next; + bodyA = next; } cpArrayDeleteObj(space->sleepingComponents, root);