From 48ee14c64e7f2f89e102f3d3cfe87008abb3cfb3 Mon Sep 17 00:00:00 2001 From: Matthias Moulin Date: Wed, 14 Nov 2018 21:20:27 +0100 Subject: [PATCH 1/2] C4703 workaround for msvc++ `error C4703: potentially uninitialized local pointer variable 'pcFirstFrame'` in debug mode --- code/MDLLoader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/MDLLoader.cpp b/code/MDLLoader.cpp index dfe1c1311..791a3bc67 100644 --- a/code/MDLLoader.cpp +++ b/code/MDLLoader.cpp @@ -413,8 +413,9 @@ void MDLImporter::InternReadFile_Quake1() { #if 1 // FIXME: the cast is wrong and cause a warning on clang 5.0 - // disable thi code for now, fix it later + // disable this code for now, fix it later ai_assert(false && "Bad pointer cast"); + pcFirstFrame = NULL; #else BE_NCONST MDL::GroupFrame* pcFrames2 = (BE_NCONST MDL::GroupFrame*)pcFrames; pcFirstFrame = (BE_NCONST MDL::SimpleFrame*)(&pcFrames2->time + pcFrames->type); From 0535b2890833314f09fe48a7159b4dd970c05860 Mon Sep 17 00:00:00 2001 From: Matthias Moulin Date: Fri, 16 Nov 2018 12:17:12 +0100 Subject: [PATCH 2/2] nullptr instead of NULL --- code/MDLLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/MDLLoader.cpp b/code/MDLLoader.cpp index 791a3bc67..eb067a1c9 100644 --- a/code/MDLLoader.cpp +++ b/code/MDLLoader.cpp @@ -415,7 +415,7 @@ void MDLImporter::InternReadFile_Quake1() { // FIXME: the cast is wrong and cause a warning on clang 5.0 // disable this code for now, fix it later ai_assert(false && "Bad pointer cast"); - pcFirstFrame = NULL; + pcFirstFrame = nullptr; // Workaround: msvc++ C4703 error #else BE_NCONST MDL::GroupFrame* pcFrames2 = (BE_NCONST MDL::GroupFrame*)pcFrames; pcFirstFrame = (BE_NCONST MDL::SimpleFrame*)(&pcFrames2->time + pcFrames->type);