Ver Fonte

Add some explicit casts to spine

James Urquhart há 11 anos atrás
pai
commit
039f5b1754

+ 3 - 3
engine/source/spine/Atlas.c

@@ -137,7 +137,7 @@ static int readTuple (const char* end, Str tuple[]) {
 }
 }
 
 
 static char* mallocString (Str* str) {
 static char* mallocString (Str* str) {
-	int length = str->end - str->begin;
+	int length = (int)(str->end - str->begin);
 	char* string = MALLOC(char, length + 1);
 	char* string = MALLOC(char, length + 1);
 	memcpy(string, str->begin, length);
 	memcpy(string, str->begin, length);
 	string[length] = '\0';
 	string[length] = '\0';
@@ -145,7 +145,7 @@ static char* mallocString (Str* str) {
 }
 }
 
 
 static int indexOf (const char** array, int count, Str* str) {
 static int indexOf (const char** array, int count, Str* str) {
-	int length = str->end - str->begin;
+	int length = (int)(str->end - str->begin);
 	int i;
 	int i;
 	for (i = count - 1; i >= 0; i--)
 	for (i = count - 1; i >= 0; i--)
 		if (strncmp(array[i], str->begin, length) == 0) return i;
 		if (strncmp(array[i], str->begin, length) == 0) return i;
@@ -172,7 +172,7 @@ static const char* textureFilterNames[] = {"Nearest", "Linear", "MipMap", "MipMa
 spAtlas* spAtlas_readAtlas (const char* begin, int length, const char* dir) {
 spAtlas* spAtlas_readAtlas (const char* begin, int length, const char* dir) {
 	int count;
 	int count;
 	const char* end = begin + length;
 	const char* end = begin + length;
-	int dirLength = strlen(dir);
+	int dirLength = (int)strlen(dir);
 	int needsSlash = dirLength > 0 && dir[dirLength - 1] != '/' && dir[dirLength - 1] != '\\';
 	int needsSlash = dirLength > 0 && dir[dirLength - 1] != '/' && dir[dirLength - 1] != '\\';
 
 
 	spAtlas* self = NEW(spAtlas);
 	spAtlas* self = NEW(spAtlas);

+ 1 - 1
engine/source/spine/SkeletonJson.c

@@ -63,7 +63,7 @@ void _spSkeletonJson_setError (spSkeletonJson* self, Json* root, const char* val
 	int length;
 	int length;
 	FREE(self->error);
 	FREE(self->error);
 	strcpy(message, value1);
 	strcpy(message, value1);
-	length = strlen(value1);
+	length = (int)strlen(value1);
 	if (value2) strncat(message + length, value2, 256 - length);
 	if (value2) strncat(message + length, value2, 256 - length);
 	MALLOC_STR(self->error, message);
 	MALLOC_STR(self->error, message);
 	if (root) Json_dispose(root);
 	if (root) Json_dispose(root);

+ 1 - 1
engine/source/spine/extension.c

@@ -57,7 +57,7 @@ char* _readFile (const char* path, int* length) {
 	if (!file) return 0;
 	if (!file) return 0;
 
 
 	fseek(file, 0, SEEK_END);
 	fseek(file, 0, SEEK_END);
-	*length = ftell(file);
+	*length = (int)ftell(file);
 	fseek(file, 0, SEEK_SET);
 	fseek(file, 0, SEEK_SET);
 
 
 	data = MALLOC(char, *length);
 	data = MALLOC(char, *length);