summaryrefslogtreecommitdiff
path: root/utils/kmsview.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-09-13 18:40:03 +0300
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-12-18 12:23:57 +0200
commit48a3b80996d0dce7e472318c2090e5f4df901567 (patch)
treef01973c440bf4a5a8c86c3d2a1ed141daaaf3868 /utils/kmsview.cpp
parent65b0414775f0674cfb9aff0863a5be8c0d72dfaa (diff)
fix: Correct printf format specifiers for unsigned integers
This commit addresses cppcheck warnings about mismatched printf format specifiers (invalidPrintfArgType_sint). The format specifiers %i and %d expect signed integers (int) but the variables being passed are unsigned integers (uint32_t, unsigned). This mismatch can lead to undefined behavior and incorrect output formatting. Changes made: - utils/kmstouch.cpp: Changed %i to %u for event code formatting - utils/kmstouch.cpp: Changed %d to %u for event type and property type formatting - utils/kmsview.cpp: Changed %d to %u for frame number formatting These fixes ensure proper type safety in printf formatting and prevent potential undefined behavior when printing unsigned integer values.
Diffstat (limited to 'utils/kmsview.cpp')
-rw-r--r--utils/kmsview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/kmsview.cpp b/utils/kmsview.cpp
index 4b60bb8..7cee024 100644
--- a/utils/kmsview.cpp
+++ b/utils/kmsview.cpp
@@ -99,7 +99,7 @@ int main(int argc, char** argv)
printf("file size %u, frame size %u, frames %u\n", fsize, frame_size, num_frames);
for (unsigned i = 0; i < num_frames; ++i) {
- printf("frame %d", i);
+ printf("frame %u", i);
fflush(stdout);
read_frame(is, fb, crtc, plane);
if (!time) {