summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-09-13 17:43:53 +0300
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-12-18 12:23:57 +0200
commitd785a753f9406bf74150e038ccf58b8b40eea932 (patch)
tree8d2804c452b7564e70a07d9797d41a705132452f
parent9c67dae2d2e6f977e7dc8c5ed070e2bc07383c8a (diff)
fix: Resolve variable shadowing warnings
Fix cppcheck shadowVariable and shadowArgument warnings by renaming local variables to avoid conflicts: - Rename 'ob' to 'prop' in property creation loop in card.cpp - Rename loop variable 'y_offset' to 'y_off' in conv-yuv-semiplanar.h - Rename local 'y' to 'y_val' in SMPTE pattern generator in testpat.cpp - Rename 'is_last' to 'child_is_last' in entry printing in kmsprint.cpp These changes eliminate naming conflicts while preserving functionality and improving code clarity.
-rw-r--r--kms++/src/card.cpp6
-rw-r--r--kms++util/src/conv-yuv-semiplanar.h6
-rw-r--r--kms++util/src/testpat.cpp4
-rw-r--r--utils/kmsprint.cpp4
4 files changed, 10 insertions, 10 deletions
diff --git a/kms++/src/card.cpp b/kms++/src/card.cpp
index c26e4f2..f67f8f8 100644
--- a/kms++/src/card.cpp
+++ b/kms++/src/card.cpp
@@ -269,9 +269,9 @@ void Card::setup()
uint32_t prop_id = props->props[i];
if (m_obmap.find(prop_id) == m_obmap.end()) {
- auto ob = new Property(*this, prop_id);
- m_obmap[prop_id] = ob;
- m_properties.push_back(ob);
+ auto prop = new Property(*this, prop_id);
+ m_obmap[prop_id] = prop;
+ m_properties.push_back(prop);
}
}
diff --git a/kms++util/src/conv-yuv-semiplanar.h b/kms++util/src/conv-yuv-semiplanar.h
index 3c4eec2..f9d771d 100644
--- a/kms++util/src/conv-yuv-semiplanar.h
+++ b/kms++util/src/conv-yuv-semiplanar.h
@@ -121,10 +121,10 @@ public:
if (y_offset == 0) {
// Fill line buffers
- for (size_t y_offset = 0; y_offset < v_sub; y_offset++) {
- auto line = md::submdspan(linebuf, y_offset, md::full_extent);
+ for (size_t y_off = 0; y_off < v_sub; y_off++) {
+ auto line = md::submdspan(linebuf, y_off, md::full_extent);
std::span<YUV16> span(line.data_handle(), line.size());
- generate_line(y_src + y_offset, span);
+ generate_line(y_src + y_off, span);
}
}
diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp
index 7984de8..1edf978 100644
--- a/kms++util/src/testpat.cpp
+++ b/kms++util/src/testpat.cpp
@@ -201,8 +201,8 @@ static YUV16 get_smpte_pixel(size_t w, size_t h, size_t x, size_t y)
const size_t ramp_width = a - 2 * d;
const size_t ramp_x = x - d;
- uint16_t y = 256 + (3760 - 256) * ramp_x / ramp_width;
- return YUV16::from_12(y, 2048, 2048);
+ uint16_t y_val = 256 + (3760 - 256) * ramp_x / ramp_width;
+ return YUV16::from_12(y_val, 2048, 2048);
}
// Pattern 4 (PLUGE)
diff --git a/utils/kmsprint.cpp b/utils/kmsprint.cpp
index 71bcb70..e51de93 100644
--- a/utils/kmsprint.cpp
+++ b/utils/kmsprint.cpp
@@ -330,9 +330,9 @@ static void print_entry(const Entry& e, const string& prefix, bool is_child, boo
}
for (const Entry& child : e.children) {
- bool is_last = &child == &e.children.back();
+ bool child_is_last = &child == &e.children.back();
- print_entry(child, prefix2, true, is_last);
+ print_entry(child, prefix2, true, child_is_last);
}
}