demos: Don't pretend to handle allocation failure.

This function doesn't indicate failure and the possibility of a return
causes -Wmaybe-uninitialized warnings.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
This commit is contained in:
Georg Lehmann 2022-06-17 18:51:55 +02:00 committed by Hans-Kristian Arntzen
parent de5b751468
commit d8905afd5d
1 changed files with 2 additions and 7 deletions

View File

@ -456,13 +456,8 @@ static void cxg_mesh_create(ID3D12Device *device, float inner_radius, float oute
float r0, r1, r2; float r0, r1, r2;
float angle, da; float angle, da;
if (!(vertices = calloc(tooth_count, 12 * sizeof(*vertices)))) vertices = calloc(tooth_count, 12 * sizeof(*vertices));
return; faces = calloc(tooth_count, 20 * sizeof(*faces));
if (!(faces = calloc(tooth_count, 20 * sizeof(*faces))))
{
free(vertices);
return;
}
r0 = inner_radius; r0 = inner_radius;
r1 = outer_radius - tooth_depth / 2.0f; r1 = outer_radius - tooth_depth / 2.0f;