From a874f28c9acd6139fef5984dbfc65f35dbdc9c67 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 8 May 2008 00:42:50 -0400 Subject: [PATCH] Fix/disable annoying Visual C++ level 4 warnings. --HG-- branch : trunk --- mojoshader.c | 3 +++ mojoshader_opengl.c | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mojoshader.c b/mojoshader.c index cd867fb3..e993f371 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -57,6 +57,9 @@ typedef unsigned int uint; // this is a printf() helper. don't use for code. typedef unsigned __int8 uint8; typedef unsigned __int32 uint32; typedef unsigned __int32 int32; +// Warning Level 4 considered harmful. :) +#pragma warning(disable: 4100) // "unreferenced formal parameter" +#pragma warning(disable: 4389) // "signed/unsigned mismatch" #else #include typedef uint8_t uint8; diff --git a/mojoshader_opengl.c b/mojoshader_opengl.c index 40427d7f..c48933ba 100644 --- a/mojoshader_opengl.c +++ b/mojoshader_opengl.c @@ -32,6 +32,9 @@ typedef unsigned int uint; // this is a printf() helper. don't use for code. typedef unsigned __int8 uint8; typedef unsigned __int32 uint32; typedef unsigned __int32 int32; +// Warning Level 4 considered harmful. :) +#pragma warning(disable: 4100) // "unreferenced formal parameter" +#pragma warning(disable: 4389) // "signed/unsigned mismatch" #else #include typedef uint8_t uint8; @@ -324,7 +327,11 @@ static int valid_profile(const char *profile) #define MUST_HAVE(p, x) \ if (!ctx->have_##x) { set_error(#p " profile needs " #x); return 0; } - if (0) {} + if (profile == NULL) + { + set_error("NULL profile"); + return 0; + } // if #if SUPPORT_PROFILE_GLSL else if (strcmp(profile, MOJOSHADER_PROFILE_GLSL) == 0)