commit c994286e89e10ac7cbfbb9b78162a581328e4308
parent bb8cd691bb7aa4f8ab887fa0c5afe4b8d6998cc8
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 22 Feb 2024 09:24:09 +0100
Fix compiler warning "variable may be uninitialized"
A "switch" instruction did not explicitly address all cases by not
providing a default directive, even if the default should not occur.
This commit corrects this by fatalizing such a situation.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/sdis_scene_Xd.h b/src/sdis_scene_Xd.h
@@ -384,6 +384,7 @@ hit_shared_edge
case 0: bcoord0 = uv0[0]; break;
case 1: bcoord0 = uv0[1]; break;
case 2: bcoord0 = CLAMP(1.f - uv0[0] - uv0[1], 0.f, 1.f); break;
+ default: FATAL("Unreachable code\n"); break;
}
/* Retrieve the barycentric coordinate of the position on triangle 1
@@ -392,6 +393,7 @@ hit_shared_edge
case 0: bcoord1 = uv1[0]; break;
case 1: bcoord1 = uv1[1]; break;
case 2: bcoord1 = CLAMP(1.f - uv0[0] - uv0[1], 0.f, 1.f); break;
+ default: FATAL("Unreachable code\n"); break;
}
/* Check that the both positions lie on the shared vertex */