فهرست منبع

[c] Fixed warnings, closes #1267.

badlogic 6 سال پیش
والد
کامیت
eff518faf7

+ 1 - 1
spine-c/spine-c/src/spine/Animation.c

@@ -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;
 	}

+ 1 - 1
spine-c/spine-c/src/spine/IkConstraint.c

@@ -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;

+ 2 - 2
spine-c/spine-c/src/spine/PathConstraint.c

@@ -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;

+ 5 - 7
spine-c/spine-c/src/spine/SkeletonBinary.c

@@ -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;
 	}