| Age | Commit message (Collapse) | Author |
|
We can use std::format() and a custom print() wrapper with C++20. When
moving to C++23, we can drop the wrapper.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
This commit addresses cppcheck warnings about member variables that are
not properly initialized in constructors (uninitMemberVar). Uninitialized
member variables can lead to undefined behavior and unpredictable program
execution, making this a critical bug fix.
Changes made:
- kmscube/cube-gles2.cpp: Initialize m_width and m_height to 0 in GlScene
constructor to prevent undefined behavior when these values are used
- utils/kmstest.cpp: Initialize m_frame_num and m_flip_count to 0 in
FlipState constructor to ensure proper frame counting behavior
These fixes prevent potential crashes and ensure deterministic behavior
by providing proper initial values for all member variables.
|
|
This commit addresses cppcheck warnings about constructors with single
arguments that are not marked as explicit (noExplicitConstructor).
Single-argument constructors can perform implicit type conversions which
may lead to unexpected behavior and bugs. Marking them as explicit prevents
these implicit conversions and makes the code more predictable.
Changes made:
- kmscube/cube-egl.h: Added explicit keyword to EglState constructor
- kmscube/cube-gbm.cpp: Added explicit keyword to GbmDevice constructor
These changes improve type safety by requiring explicit construction calls
and preventing unintended implicit conversions.
|
|
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.
|
|
This commit addresses cppcheck warnings about C-style casts (cstyleCast)
by replacing them with appropriate C++ casts. C-style casts are considered
dangerous because they can perform unsafe conversions without compile-time
type checking, while C++ casts are more explicit and type-safe.
Changes made:
- static_cast for safe type conversions (e.g., void* to struct*)
- reinterpret_cast for pointer type conversions (e.g., uint8_t* to char*)
- Combined static_cast and reinterpret_cast for integer-to-pointer conversions
Fixed files:
- kmscube/cube-gles2.cpp: GLvoid* casts for OpenGL vertex attribute pointers
- kmscube/cube-wl.cpp: Wayland interface pointer casts
- kmscube/cube-x11.cpp: X11 window handle conversion
- utils/fbtest.cpp: mmap return value cast
- utils/kmstest.cpp: Framebuffer pointer arithmetic
- utils/kmsview.cpp: Framebuffer memory mapping cast
|
|
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Implement matching GBM buffer format to EGL NATIVE_VISUAL_ID.
eglChooseConfig cannot match on NATIVE_VISUAL_ID, but GBM/EGL
requires matching formats. Similar logic is implemented in
kmscube code in match_config_to_visual.
X11, Wayland and Null cube demos remain unchanged.
Tested on Raspi-4 and VirtualBox/Ubuntu
|
|
|
|
Add summary print for meson configuration.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
|
|
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
This was the only C file in the project, so now we're "pure" c++.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|