Moved or removed unused variables

Some variables were either unused or only used in certain contexts,
like debug or tracing, so these were either removed (when unused)
or moved to the right scope (when used conditionally).
Also fixed a string format warning and a missing case warning.

Change-Id: I2d130faa992b5dc06fb332d7404a8aebc7c121ef
Reviewed-on: https://swiftshader-review.googlesource.com/5462
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/compiler/debug.cpp b/src/OpenGL/compiler/debug.cpp
index b30632d..61943a3 100644
--- a/src/OpenGL/compiler/debug.cpp
+++ b/src/OpenGL/compiler/debug.cpp
@@ -22,8 +22,6 @@
 #include "InitializeParseContext.h"
 #include "ParseHelper.h"
 
-static const int kTraceBufferLen = 1024;
-
 #ifdef TRACE_ENABLED
 extern "C" {
 void Trace(const char *format, ...) {
@@ -31,6 +29,7 @@
 
 	TParseContext* parseContext = GetGlobalParseContext();
 	if (parseContext) {
+		const int kTraceBufferLen = 1024;
 		char buf[kTraceBufferLen];
 		va_list args;
 		va_start(args, format);