Skip to content

Commit d08949f

Browse files
committed
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.
1 parent 0cb05e7 commit d08949f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/cpSpaceComponent.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,16 @@ cpBodyActivate(cpBody *body)
128128
cpAssertSoft(cpBodyGetType(root) == CP_BODY_TYPE_DYNAMIC, "Internal Error: Non-dynamic body component root detected.");
129129

130130
cpSpace *space = root->space;
131-
cpBody *body = root;
132-
while(body){
133-
cpBody *next = body->sleeping.next;
131+
cpBody *bodyA = root;
132+
while(bodyA){
133+
cpBody *next = bodyA->sleeping.next;
134134

135-
body->sleeping.idleTime = 0.0f;
136-
body->sleeping.root = NULL;
137-
body->sleeping.next = NULL;
138-
cpSpaceActivateBody(space, body);
135+
bodyA->sleeping.idleTime = 0.0f;
136+
bodyA->sleeping.root = NULL;
137+
bodyA->sleeping.next = NULL;
138+
cpSpaceActivateBody(space, bodyA);
139139

140-
body = next;
140+
bodyA = next;
141141
}
142142

143143
cpArrayDeleteObj(space->sleepingComponents, root);

0 commit comments

Comments
 (0)