summaryrefslogtreecommitdiff
path: root/kmscube/cube-gbm.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-09-13 18:27:14 +0300
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-12-18 12:23:57 +0200
commit00a14befa954162723142571caf301f9679c6059 (patch)
treee330184402e465e1bbb13037ee9409a7dd518bf0 /kmscube/cube-gbm.cpp
parent0271a62e676d50940ec5f86d94cf66629894c25f (diff)
fix: Resolve variable shadowing warnings
This commit addresses cppcheck warnings about local variables that shadow outer function names (shadowFunction). Variable shadowing can make code confusing and error-prone as it's unclear which variable is being referenced. Changes made: - kmscube/cube-egl.cpp: Renamed 'config' to 'cfg' in loop to avoid shadowing the config() member function - kmscube/cube-gbm.cpp: Renamed 'width' and 'height' local variables to 'bo_width' and 'bo_height' to avoid shadowing width() and height() member functions These changes improve code clarity and eliminate potential confusion about variable scope and naming.
Diffstat (limited to 'kmscube/cube-gbm.cpp')
-rw-r--r--kmscube/cube-gbm.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/kmscube/cube-gbm.cpp b/kmscube/cube-gbm.cpp
index 5b0715a..f18ae60 100644
--- a/kmscube/cube-gbm.cpp
+++ b/kmscube/cube-gbm.cpp
@@ -129,8 +129,8 @@ public:
if (fb)
return fb;
- uint32_t width = gbm_bo_get_width(bo);
- uint32_t height = gbm_bo_get_height(bo);
+ uint32_t bo_width = gbm_bo_get_width(bo);
+ uint32_t bo_height = gbm_bo_get_height(bo);
uint32_t stride = gbm_bo_get_stride(bo);
uint32_t handle = gbm_bo_get_handle(bo).u32;
PixelFormat format = fourcc_to_pixel_format(gbm_bo_get_format(bo));
@@ -139,7 +139,7 @@ public:
vector<uint32_t> strides{ stride };
vector<uint32_t> offsets{ 0 };
- fb = new ExtFramebuffer(card, width, height, format, handles, strides, offsets);
+ fb = new ExtFramebuffer(card, bo_width, bo_height, format, handles, strides, offsets);
gbm_bo_set_user_data(bo, fb, drm_fb_destroy_callback);