diff --git a/spine-c/spine-c/src/spine/SkeletonBinary.c b/spine-c/spine-c/src/spine/SkeletonBinary.c index a9c12d73e..ae2d43538 100644 --- a/spine-c/spine-c/src/spine/SkeletonBinary.c +++ b/spine-c/spine-c/src/spine/SkeletonBinary.c @@ -101,7 +101,7 @@ static int string_starts_with(const char *str, const char *needle) { static char *string_copy(const char *str) { if (str == NULL) return NULL; int len = strlen(str); - char *tmp = malloc(len + 1); + char *tmp = (char *)malloc(len + 1); strncpy(tmp, str, len); tmp[len] = '\0'; return tmp; @@ -614,7 +614,7 @@ static spAnimation *_spSkeletonBinary_readAnimation(spSkeletonBinary *self, cons spInheritTimeline *timeline = spInheritTimeline_create(frameCount, boneIndex); for (frame = 0; frame < frameCount; frame++) { float time = readFloat(input); - spInherit inherit = readByte(input); + spInherit inherit = (spInherit) readByte(input); spInheritTimeline_setFrame(timeline, frame, time, inherit); } spTimelineArray_add(timelines, SUPER(timeline)); @@ -1082,7 +1082,7 @@ spAttachment *spSkeletonBinary_readAttachment(spSkeletonBinary *self, _dataInput spSkeletonData *skeletonData, int /*bool*/ nonessential) { int flags = readByte(input); const char *name = (flags & 8) != 0 ? readStringRef(input, skeletonData) : attachmentName; - spAttachmentType type = (flags & 0x7); + spAttachmentType type = (spAttachmentType)(flags & 0x7); switch (type) { case SP_ATTACHMENT_REGION: { @@ -1420,7 +1420,7 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const data->shearX = readFloat(input); data->shearY = readFloat(input); data->length = readFloat(input) * self->scale; - data->inherit = readVarint(input, 1); + data->inherit = (spInherit)readVarint(input, 1); data->skinRequired = readBoolean(input); if (nonessential) { readColor(input, &data->color.r, &data->color.g, &data->color.b, &data->color.a); @@ -1542,9 +1542,9 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const data->bones[ii] = skeletonData->bones[readVarint(input, 1)]; data->target = skeletonData->slots[readVarint(input, 1)]; int flags = readByte(input); - data->positionMode = (flags & 1); - data->spacingMode = ((flags >> 1) & 3); - data->rotateMode = ((flags >> 3) & 3); + data->positionMode = (spPositionMode)(flags & 1); + data->spacingMode = (spSpacingMode)((flags >> 1) & 3); + data->rotateMode = (spRotateMode)((flags >> 3) & 3); if ((flags & 128) != 0) data->offsetRotation = readFloat(input); data->position = readFloat(input); if (data->positionMode == SP_POSITION_MODE_FIXED) data->position *= self->scale;