From d8905afd5d375db9ec847986c08ea60140863588 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Fri, 17 Jun 2022 18:51:55 +0200 Subject: [PATCH] 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 --- demos/gears.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/demos/gears.c b/demos/gears.c index 29ecb6cd..4850f1b9 100644 --- a/demos/gears.c +++ b/demos/gears.c @@ -456,13 +456,8 @@ static void cxg_mesh_create(ID3D12Device *device, float inner_radius, float oute float r0, r1, r2; float angle, da; - if (!(vertices = calloc(tooth_count, 12 * sizeof(*vertices)))) - return; - if (!(faces = calloc(tooth_count, 20 * sizeof(*faces)))) - { - free(vertices); - return; - } + vertices = calloc(tooth_count, 12 * sizeof(*vertices)); + faces = calloc(tooth_count, 20 * sizeof(*faces)); r0 = inner_radius; r1 = outer_radius - tooth_depth / 2.0f;