Skip to content

Commit

Permalink
Rename body local variable to fix shadow warning
Browse files Browse the repository at this point in the history
GCC gives me the warning "declaration shadows a local variable" because
there's two 'body' variables in the function. This fixes the warning.
  • Loading branch information
aganm committed Dec 16, 2021
1 parent 0cb05e7 commit d08949f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/cpSpaceComponent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d08949f

Please sign in to comment.