diff options
| author | Jeffery Myers <[email protected]> | 2020-11-29 23:14:11 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-11-30 08:14:11 +0100 |
| commit | df249f5513465dfa2662fd566f79f5dfb23960eb (patch) | |
| tree | 98dd727ac5b72985177e7c5aa6a5f4f2d3cf5c48 /src/models.c | |
| parent | d43268b3175f63fad1bb6a7a146682f010de861f (diff) | |
| download | raylib-df249f5513465dfa2662fd566f79f5dfb23960eb.tar.gz raylib-df249f5513465dfa2662fd566f79f5dfb23960eb.zip | |
Fix typecast warnings in raylib code as reported by visual studio 2019 (#1443)
Diffstat (limited to 'src/models.c')
| -rw-r--r-- | src/models.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/models.c b/src/models.c index ab3ea7f7..04db669e 100644 --- a/src/models.c +++ b/src/models.c @@ -830,10 +830,10 @@ bool ExportMesh(Mesh mesh, const char *fileName) if (IsFileExtension(fileName, ".obj")) { // Estimated data size, it should be enough... - int dataSize = mesh.vertexCount/3*strlen("v 0000.00f 0000.00f 0000.00f") + - mesh.vertexCount/2*strlen("vt 0.000f 0.00f") + - mesh.vertexCount/3*strlen("vn 0.000f 0.00f 0.00f") + - mesh.triangleCount/3*strlen("f 00000/00000/00000 00000/00000/00000 00000/00000/00000"); + int dataSize = mesh.vertexCount/3* (int)strlen("v 0000.00f 0000.00f 0000.00f") + + mesh.vertexCount/2* (int)strlen("vt 0.000f 0.00f") + + mesh.vertexCount/3* (int)strlen("vn 0.000f 0.00f 0.00f") + + mesh.triangleCount/3* (int)strlen("f 00000/00000/00000 00000/00000/00000 00000/00000/00000"); // NOTE: Text data buffer size is estimated considering mesh data size char *txtData = (char *)RL_CALLOC(dataSize + 2000, sizeof(char)); @@ -2997,9 +2997,9 @@ static Model LoadOBJ(const char *fileName) // count the faces for each material int *matFaces = RL_CALLOC(meshCount, sizeof(int)); - for (int mi = 0; mi < meshCount; mi++) + for (unsigned int mi = 0; mi < meshCount; mi++) { - for (int fi = 0; fi < meshes[mi].length; fi++) + for (unsigned int fi = 0; fi < meshes[mi].length; fi++) { int idx = attrib.material_ids[meshes[mi].face_offset + fi]; if (idx == -1) idx = 0; // for no material face (which could be the whole model) |
