Skip to content

Commit 1db4260

Browse files
committed
Steve: fix warnings in /spine/
1 parent a4a5768 commit 1db4260

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

cocos/editor-support/spine/Animation.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,20 +604,21 @@ void spColorTimeline_setFrame (spColorTimeline* self, int frameIndex, float time
604604

605605
void _spAttachmentTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
606606
spEvent** firedEvents, int* eventsCount, float alpha, int setupPose, int mixingOut) {
607-
const char* attachmentName;
607+
608608
spAttachmentTimeline* self = (spAttachmentTimeline*)timeline;
609609
int frameIndex;
610610
spSlot* slot = skeleton->slots[self->slotIndex];
611611

612612
if (mixingOut && setupPose) {
613-
const char* attachmentName = slot->data->attachmentName;
614-
spSlot_setAttachment(slot, attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
613+
const char* attachmentName = slot->data->attachmentName;
614+
spSlot_setAttachment(slot,
615+
attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
615616
return;
616617
}
617618

618619
if (time < self->frames[0]) {
619620
if (setupPose) {
620-
attachmentName = slot->data->attachmentName;
621+
const char* attachmentName = slot->data->attachmentName;
621622
spSlot_setAttachment(skeleton->slots[self->slotIndex],
622623
attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
623624
}
@@ -629,7 +630,7 @@ void _spAttachmentTimeline_apply (const spTimeline* timeline, spSkeleton* skelet
629630
else
630631
frameIndex = binarySearch1(self->frames, self->framesCount, time) - 1;
631632

632-
attachmentName = self->attachmentNames[frameIndex];
633+
const char* attachmentName = self->attachmentNames[frameIndex];
633634
spSlot_setAttachment(skeleton->slots[self->slotIndex],
634635
attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
635636

cocos/editor-support/spine/IkConstraint.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ void spIkConstraint_apply2 (spBone* parent, spBone* child, float targetX, float
152152
float d = c1 * c1 - 4 * c2 * c0;
153153
float minAngle = 0, minDist = FLT_MAX, minX = 0, minY = 0;
154154
float maxAngle = 0, maxDist = 0, maxX = 0, maxY = 0;
155-
float x = l1 + a, dist = x * x, angle, y;
155+
//STEVE:
156+
x = l1 + a;
157+
float dist = x * x;
158+
float angle;
159+
//STEVE:float y;
156160
if (d >= 0) {
157161
float q = SQRT(d), r0, r1;
158162
if (c1 < 0) q = -q;

cocos/editor-support/spine/SkeletonBinary.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
290290
break;
291291
}
292292
default: {
293-
int i;
294293
for (i = 0; i < kv_size(timelines); ++i)
295294
spTimeline_dispose(kv_A(timelines, i));
296295
kv_destroy(timelines);

cocos/editor-support/spine/SkeletonJson.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -389,33 +389,33 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
389389

390390
for (valueMap = timelineMap->child, frameIndex = 0; valueMap; valueMap = valueMap->next, ++frameIndex) {
391391
Json* vertices = Json_getItem(valueMap, "vertices");
392-
float* deform;
392+
float* deform2;
393393
if (!vertices) {
394394
if (weighted) {
395-
deform = tempDeform;
396-
memset(deform, 0, sizeof(float) * deformLength);
395+
deform2 = tempDeform;
396+
memset(deform2, 0, sizeof(float) * deformLength);
397397
} else
398-
deform = attachment->vertices;
398+
deform2 = attachment->vertices;
399399
} else {
400400
int v, start = Json_getInt(valueMap, "offset", 0);
401401
Json* vertex;
402-
deform = tempDeform;
403-
memset(deform, 0, sizeof(float) * start);
402+
deform2 = tempDeform;
403+
memset(deform2, 0, sizeof(float) * start);
404404
if (self->scale == 1) {
405405
for (vertex = vertices->child, v = start; vertex; vertex = vertex->next, ++v)
406-
deform[v] = vertex->valueFloat;
406+
deform2[v] = vertex->valueFloat;
407407
} else {
408408
for (vertex = vertices->child, v = start; vertex; vertex = vertex->next, ++v)
409-
deform[v] = vertex->valueFloat * self->scale;
409+
deform2[v] = vertex->valueFloat * self->scale;
410410
}
411-
memset(deform + v, 0, sizeof(float) * (deformLength - v));
411+
memset(deform2 + v, 0, sizeof(float) * (deformLength - v));
412412
if (!weighted) {
413413
float* vertices = attachment->vertices;
414414
for (v = 0; v < deformLength; ++v)
415-
deform[v] += vertices[v];
415+
deform2[v] += vertices[v];
416416
}
417417
}
418-
spDeformTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), deform);
418+
spDeformTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), deform2);
419419
readCurve(valueMap, SUPER(timeline), frameIndex);
420420
}
421421
FREE(tempDeform);

0 commit comments

Comments
 (0)