[c] Fixed warnings, closes #1267.

This commit is contained in:
badlogic 2019-01-28 11:43:31 +01:00
parent 8fe981cfe1
commit eff518faf7
4 changed files with 9 additions and 11 deletions

View File

@ -812,7 +812,7 @@ void _spAttachmentTimeline_apply (const spTimeline* timeline, spSkeleton* skelet
spSlot* slot = skeleton->slots[self->slotIndex];
if (direction == SP_MIX_DIRECTION_OUT && blend == SP_MIX_BLEND_SETUP) {
const char* attachmentName = slot->data->attachmentName;
attachmentName = slot->data->attachmentName;
spSlot_setAttachment(slot, attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
return;
}

View File

@ -83,7 +83,7 @@ void spIkConstraint_apply1 (spBone* bone, float targetX, float targetY, int /*bo
sy = bone->ascaleY;
if (compress || stretch) {
float b = bone->data->length * sx, dd = SQRT(tx * tx + ty * ty);
if ((compress && dd < b) || (stretch && dd > b) && (b > 0.0001f)) {
if ((compress && dd < b) || ((stretch && dd > b) && (b > 0.0001f))) {
s = (dd / b - 1) * alpha + 1;
sx *= s;
if (uniform) sy *= s;

View File

@ -122,8 +122,8 @@ void spPathConstraint_apply (spPathConstraint* self) {
spaces[++i] = 0;
} else if (percentSpacing) {
if (scale) {
float x = setupLength * bone->a, y = setupLength * bone->c;
float length = SQRT(x * x + y * y);
x = setupLength * bone->a, y = setupLength * bone->c;
length = SQRT(x * x + y * y);
lengths[i] = length;
}
spaces[++i] = spacing;

View File

@ -308,9 +308,8 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
break;
}
default: {
int i;
for (i = 0; i < timelines->size; ++i)
spTimeline_dispose(timelines->items[i]);
for (iii = 0; iii < timelines->size; ++iii)
spTimeline_dispose(timelines->items[iii]);
spTimelineArray_dispose(timelines);
_spSkeletonBinary_setError(self, "Invalid timeline type for a slot: ", skeletonData->slots[slotIndex]->name);
return 0;
@ -371,9 +370,8 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
break;
}
default: {
int i;
for (i = 0; i < timelines->size; ++i)
spTimeline_dispose(timelines->items[i]);
for (iii = 0; iii < timelines->size; ++iii)
spTimeline_dispose(timelines->items[iii]);
spTimelineArray_dispose(timelines);
_spSkeletonBinary_setError(self, "Invalid timeline type for a bone: ", skeletonData->bones[boneIndex]->name);
return 0;
@ -650,7 +648,7 @@ static void _readVertices(spSkeletonBinary* self, _dataInput* input, spVertexAtt
attachment->bonesCount = 0;
attachment->bones = 0;
spFloatArray_dispose(weights);
spFloatArray_dispose(bones);
spIntArray_dispose(bones);
return;
}