diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index ff09dc8..d3f971a 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -59,6 +59,7 @@ else() -Wall -Werror -Wextra + -Wshadow -ftemplate-backtrace-limit=0 ) diff --git a/example/main.cpp b/example/main.cpp index c918473..64f11c4 100644 --- a/example/main.cpp +++ b/example/main.cpp @@ -88,7 +88,7 @@ int main() { int some_medadata = 0; public: - my_rect(const rect_type& rect) : rect(rect) { (void)some_medadata; } + my_rect(const rect_type& rect_) : rect(rect_) { (void)some_medadata; } /* You need to provide these two member getters. diff --git a/src/rectpack2D/best_bin_finder.h b/src/rectpack2D/best_bin_finder.h index 3a5655d..dfd8e80 100644 --- a/src/rectpack2D/best_bin_finder.h +++ b/src/rectpack2D/best_bin_finder.h @@ -10,7 +10,7 @@ namespace rectpack2D { T first; T second; public: - span(T first, T second) : first(first), second(second) {} + span(T first_, T second_) : first(first_), second(second_) {} T begin() const { return first; @@ -183,12 +183,12 @@ namespace rectpack2D { ) { const auto try_pack = [&]( const bin_dimension tried_dimension, - const rect_wh starting_bin + const rect_wh candidate_starting_bin ) { return best_packing_for_ordering_impl( root, std::forward(ordering), - starting_bin, + candidate_starting_bin, discard_step, tried_dimension ); @@ -202,7 +202,7 @@ namespace rectpack2D { auto best_bin = std::get(best_result); - auto trial = [&](const bin_dimension tried_dimension) { + auto try_dimension = [&](const bin_dimension tried_dimension) { const auto trial = try_pack(tried_dimension, best_bin); if (const auto better = std::get_if(&trial)) { @@ -210,8 +210,8 @@ namespace rectpack2D { } }; - trial(bin_dimension::WIDTH); - trial(bin_dimension::HEIGHT); + try_dimension(bin_dimension::WIDTH); + try_dimension(bin_dimension::HEIGHT); return best_bin; } diff --git a/src/rectpack2D/rect_structs.h b/src/rectpack2D/rect_structs.h index b4d55a7..b3d1927 100644 --- a/src/rectpack2D/rect_structs.h +++ b/src/rectpack2D/rect_structs.h @@ -6,7 +6,7 @@ namespace rectpack2D { struct rect_wh { rect_wh() : w(0), h(0) {} - rect_wh(const int w, const int h) : w(w), h(h) {} + rect_wh(const int w_, const int h_) : w(w_), h(h_) {} int w; int h; @@ -41,7 +41,7 @@ namespace rectpack2D { int h; rect_xywh() : x(0), y(0), w(0), h(0) {} - rect_xywh(const int x, const int y, const int w, const int h) : x(x), y(y), w(w), h(h) {} + rect_xywh(const int x_, const int y_, const int w_, const int h_) : x(x_), y(y_), w(w_), h(h_) {} int area() const { return w * h; } int perimeter() const { return 2 * w + 2 * h; } @@ -67,7 +67,7 @@ namespace rectpack2D { bool flipped; rect_xywhf() : x(0), y(0), w(0), h(0), flipped(false) {} - rect_xywhf(const int x, const int y, const int w, const int h, const bool flipped) : x(x), y(y), w(flipped ? h : w), h(flipped ? w : h), flipped(flipped) {} + rect_xywhf(const int x_, const int y_, const int w_, const int h_, const bool flipped_) : x(x_), y(y_), w(flipped_ ? h_ : w_), h(flipped_ ? w_ : h_), flipped(flipped_) {} rect_xywhf(const rect_xywh& b) : rect_xywhf(b.x, b.y, b.w, b.h, false) {} int area() const { return w * h; }