Fix/disable annoying Visual C++ level 4 warnings. trunk
authorRyan C. Gordon <icculus@icculus.org>
Thu, 08 May 2008 00:42:50 -0400
branchtrunk
changeset 291 2453590bae1b
parent 290 8b7785e39736
child 292 f6c1a2ec6030
Fix/disable annoying Visual C++ level 4 warnings.
mojoshader.c
mojoshader_opengl.c
--- a/mojoshader.c	Wed May 07 23:50:59 2008 -0400
+++ b/mojoshader.c	Thu May 08 00:42:50 2008 -0400
@@ -57,6 +57,9 @@
 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 <stdint.h>
 typedef uint8_t uint8;
--- a/mojoshader_opengl.c	Wed May 07 23:50:59 2008 -0400
+++ b/mojoshader_opengl.c	Thu May 08 00:42:50 2008 -0400
@@ -32,6 +32,9 @@
 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 <stdint.h>
 typedef uint8_t uint8;
@@ -324,7 +327,11 @@
     #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)