Browse Source

void casts prevent removing logger calls

Kajetan Johannes Hammerle 2 years ago
parent
commit
25066d5c6a
2 changed files with 5 additions and 4 deletions
  1. 4 4
      utils/Logger.h
  2. 1 0
      wrapper/GL.cpp

+ 4 - 4
utils/Logger.h

@@ -14,7 +14,7 @@ namespace Logger {
         std::cout << "\33[1;31m[ERROR] " << (text) << "\33[39;49m\n";          \
     }
 #else
-#define LOG_ERROR(text) (void)text;
+#define LOG_ERROR(text)
 #endif
 
 #if LOG_LEVEL >= 2
@@ -23,7 +23,7 @@ namespace Logger {
         std::cout << "\33[1;33m[WARNING] " << (text) << "\33[39;49m\n";        \
     }
 #else
-#define LOG_WARNING(text) (void)text;
+#define LOG_WARNING(text)
 #endif
 
 #if LOG_LEVEL >= 3
@@ -32,7 +32,7 @@ namespace Logger {
         std::cout << "\33[1;37m[INFO] " << (text) << "\33[39;49m\n";           \
     }
 #else
-#define LOG_INFO(text) (void)text;
+#define LOG_INFO(text)
 #endif
 
 #if LOG_LEVEL >= 4
@@ -41,7 +41,7 @@ namespace Logger {
         std::cout << "\33[1;32m[DEBUG] " << (text) << "\33[39;49m\n";          \
     }
 #else
-#define LOG_DEBUG(text) (void)text;
+#define LOG_DEBUG(text)
 #endif
 
 #endif

+ 1 - 0
wrapper/GL.cpp

@@ -110,6 +110,7 @@ GL::TextureFormat GL::TextureFormat::unknown() {
 bool GL::printError(const char* message) {
     GLenum error = glGetError();
     if(error != GL_NO_ERROR) {
+        (void)message;
         LOG_ERROR(StringBuffer<100>(message).append(": ").append(error));
         return true;
     }