Cleanup: Compilation warnings

Mainly -Wset-but-unused-variable.
Makes default compilation on macOS way less noisy.

Differential Revision: https://developer.blender.org/D14357
This commit is contained in:
2022-03-16 10:57:19 +01:00
parent 2252bc6a55
commit c3ecfdf40b
23 changed files with 51 additions and 90 deletions

View File

@@ -8,6 +8,7 @@
* shader files.
*/
#include <iomanip>
#include <iostream>
#include "BLI_map.hh"
@@ -136,15 +137,14 @@ struct GPUSource {
int64_t line_end = input.find("\n", offset);
int64_t line_start = input.rfind("\n", offset) + 1;
int64_t char_number = offset - line_start + 1;
char line_prefix[16] = "";
SNPRINTF(line_prefix, "%5ld | ", line_number);
/* TODO Use clog. */
std::cout << fullpath << ":" << line_number << ":" << char_number;
std::cout << " error: " << message << "\n";
std::cout << line_prefix << input.substr(line_start, line_end - line_start) << "\n";
std::cout << std::setw(5) << line_number << " | "
<< input.substr(line_start, line_end - line_start) << "\n";
std::cout << " | ";
for (int64_t i = 0; i < char_number - 1; i++) {
std::cout << " ";
@@ -361,6 +361,7 @@ void gpu_shader_dependency_init()
errors += value->init_dependencies(*g_sources);
}
BLI_assert_msg(errors == 0, "Dependency errors detected: Aborting");
UNUSED_VARS_NDEBUG(errors);
}
void gpu_shader_dependency_exit()