More compiler warnings

pull/3580/head
Matt Pharr 2021-01-12 08:16:08 -08:00
parent 1fd8646b7a
commit 09c5564d5b
2 changed files with 4 additions and 11 deletions

View File

@ -836,7 +836,7 @@ void PbrtExporter::WriteMesh(aiMesh* mesh) {
auto face = mesh->mFaces[i]; auto face = mesh->mFaces[i];
if (face.mNumIndices != 3) throw DeadlyExportError("oh no not a tri!"); if (face.mNumIndices != 3) throw DeadlyExportError("oh no not a tri!");
for (int j = 0; j < face.mNumIndices; j++) { for (unsigned int j = 0; j < face.mNumIndices; j++) {
mOutput << face.mIndices[j] << " "; mOutput << face.mIndices[j] << " ";
} }
if ((i % 7) == 6) mOutput << "\n "; if ((i % 7) == 6) mOutput << "\n ";

View File

@ -6775,8 +6775,6 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
stbi_uc *two_back = 0; stbi_uc *two_back = 0;
stbi__gif g; stbi__gif g;
int stride; int stride;
int out_size;
int delays_size;
memset(&g, 0, sizeof(g)); memset(&g, 0, sizeof(g));
if (delays) { if (delays) {
*delays = 0; *delays = 0;
@ -6793,7 +6791,7 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
stride = g.w * g.h * 4; stride = g.w * g.h * 4;
if (out) { if (out) {
void *tmp = (stbi_uc*) STBI_REALLOC_SIZED( out, out_size, layers * stride ); void *tmp = (stbi_uc*) STBI_REALLOC( out, layers * stride );
if (NULL == tmp) { if (NULL == tmp) {
STBI_FREE(g.out); STBI_FREE(g.out);
STBI_FREE(g.history); STBI_FREE(g.history);
@ -6802,21 +6800,16 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
} }
else { else {
out = (stbi_uc*) tmp; out = (stbi_uc*) tmp;
out_size = layers * stride;
} }
if (delays) { if (delays) {
*delays = (int*) STBI_REALLOC_SIZED( *delays, delays_size, sizeof(int) * layers ); *delays = (int*) STBI_REALLOC( *delays, sizeof(int) * layers );
delays_size = layers * sizeof(int);
} }
} else { } else {
out = (stbi_uc*)stbi__malloc( layers * stride ); out = (stbi_uc*)stbi__malloc( layers * stride );
out_size = layers * stride;
if (delays) { if (delays) {
*delays = (int*) stbi__malloc( layers * sizeof(int) ); *delays = (int*) stbi__malloc( layers * sizeof(int) );
delays_size = layers * sizeof(int); }
} else
delays_size = 0;
} }
memcpy( out + ((layers - 1) * stride), u, stride ); memcpy( out + ((layers - 1) * stride), u, stride );
if (layers >= 2) { if (layers >= 2) {