From 81d8dd0eb29da478413c7973d986df56e9d6f728 Mon Sep 17 00:00:00 2001 From: Donald Alan Morrison Date: Mon, 20 Aug 2012 18:30:12 -0700 Subject: [PATCH] Silenced a false-positive warning from the LLVM Static Analyzer with initialization. The warning is caused because the code has a series of if statements not chained with else clauses -- code that works as-is, but scares the SA. Probably not worth the effort to refactor...the optimizing compiler probably removes a temporary variable. --- cocos2dx/kazmath/src/ray2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cocos2dx/kazmath/src/ray2.c b/cocos2dx/kazmath/src/ray2.c index 7710f41ad1..7db8171165 100644 --- a/cocos2dx/kazmath/src/ray2.c +++ b/cocos2dx/kazmath/src/ray2.c @@ -119,8 +119,7 @@ void calculate_line_normal(kmVec2 p1, kmVec2 p2, kmVec2* normal_out) { kmBool kmRay2IntersectTriangle(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, const kmVec2* p3, kmVec2* intersection, kmVec2* normal_out) { kmVec2 intersect; - kmVec2 final_intersect; - kmVec2 normal; + kmVec2 final_intersect = {.x = 0, .y = 0}, normal = {.x = 0, .y = 0}; // Silencing LLVM SA kmScalar distance = 10000.0f; kmBool intersected = KM_FALSE;