From 449a83eae82d2faabeae63c3f7eb84055e1ac66e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 7 Feb 2014 15:57:54 -0500 Subject: [PATCH] Static analysis fix. --- mojoshader_opengl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mojoshader_opengl.c b/mojoshader_opengl.c index 2c5c9a0d..1d4b1d58 100644 --- a/mojoshader_opengl.c +++ b/mojoshader_opengl.c @@ -285,13 +285,21 @@ static inline int macosx_version_atleast(int x, int y, int z) if (!checked) { - SInt32 ver, major, minor, patch; + SInt32 ver = 0; + SInt32 major = 0; + SInt32 minor = 0; + SInt32 patch = 0; int convert = 0; if (Gestalt(gestaltSystemVersion, &ver) != noErr) + { ver = 0x1000; // oh well. + convert = 1; // split (ver) into (major),(minor),(patch). + } else if (ver < 0x1030) + { convert = 1; // split (ver) into (major),(minor),(patch). + } else { // presumably this won't fail. But if it does, we'll just use the