aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2025-10-01 15:08:11 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2025-10-02 13:08:42 +0200
commit099b8b78144056875194908501a7296c251c12e9 (patch)
tree1cacdd451cb3f78bafef8ec543ad6ee2bf0a70f6
parentcc9db033a9b141dec84a965cf65f118b04b3e4b4 (diff)
libshiboken: Fix clazy warnings about too-large underlying types of enumerations
Use the types suggested by clang-tidy without the std-prefix as the headers are more C-ish. Change-Id: Icc7a3cbc2133f0073463505104f33ee78d589332 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/shiboken6/libshiboken/basewrapper.h2
-rw-r--r--sources/shiboken6/libshiboken/pep384impl.h2
-rw-r--r--sources/shiboken6/libshiboken/sbkconverter.h4
-rw-r--r--sources/shiboken6/libshiboken/sbkenum.h2
-rw-r--r--sources/shiboken6/libshiboken/shibokenbuffer.h2
5 files changed, 6 insertions, 6 deletions
diff --git a/sources/shiboken6/libshiboken/basewrapper.h b/sources/shiboken6/libshiboken/basewrapper.h
index 426298bcf..aa37e0cfd 100644
--- a/sources/shiboken6/libshiboken/basewrapper.h
+++ b/sources/shiboken6/libshiboken/basewrapper.h
@@ -215,7 +215,7 @@ LIBSHIBOKEN_API MultipleInheritanceInitFunction getMultipleInheritanceFunction(P
LIBSHIBOKEN_API void setDestructorFunction(PyTypeObject *self, ObjectDestructor func);
-enum WrapperFlags
+enum WrapperFlags : uint8_t
{
InnerClass = 0x1,
DeleteInMainThread = 0x2,
diff --git a/sources/shiboken6/libshiboken/pep384impl.h b/sources/shiboken6/libshiboken/pep384impl.h
index 18bbc4dfe..0e32ec0c8 100644
--- a/sources/shiboken6/libshiboken/pep384impl.h
+++ b/sources/shiboken6/libshiboken/pep384impl.h
@@ -245,7 +245,7 @@ LIBSHIBOKEN_API void *_PepUnicode_DATA(PyObject *str);
#else
-enum PepUnicode_Kind {
+enum PepUnicode_Kind : uint8_t {
#if PY_VERSION_HEX < 0x030C0000
PepUnicode_WCHAR_KIND = PyUnicode_WCHAR_KIND,
#endif
diff --git a/sources/shiboken6/libshiboken/sbkconverter.h b/sources/shiboken6/libshiboken/sbkconverter.h
index e774fa015..daaca446f 100644
--- a/sources/shiboken6/libshiboken/sbkconverter.h
+++ b/sources/shiboken6/libshiboken/sbkconverter.h
@@ -83,7 +83,7 @@ namespace Conversions {
class LIBSHIBOKEN_API SpecificConverter
{
public:
- enum Type
+ enum Type : uint8_t
{
InvalidConversion,
CopyConversion,
@@ -199,7 +199,7 @@ LIBSHIBOKEN_API PyObject *copyToPython(const SbkConverter *converter, const void
struct PythonToCppConversion
{
- enum Type {Invalid, Pointer, Value};
+ enum Type : uint8_t {Invalid, Pointer, Value};
operator bool() const { return type != Invalid; }
diff --git a/sources/shiboken6/libshiboken/sbkenum.h b/sources/shiboken6/libshiboken/sbkenum.h
index 8dcf5b700..18df4c472 100644
--- a/sources/shiboken6/libshiboken/sbkenum.h
+++ b/sources/shiboken6/libshiboken/sbkenum.h
@@ -36,7 +36,7 @@ LIBSHIBOKEN_API int enumIsFlag(PyObject *ob_enum);
namespace Shiboken::Enum {
-enum : int {
+enum : uint8_t {
ENOPT_OLD_ENUM = 0x00, // PySide 6.6: no longer supported
ENOPT_NEW_ENUM = 0x01,
ENOPT_INHERIT_INT = 0x02,
diff --git a/sources/shiboken6/libshiboken/shibokenbuffer.h b/sources/shiboken6/libshiboken/shibokenbuffer.h
index 068a5e9fd..a3e36adb5 100644
--- a/sources/shiboken6/libshiboken/shibokenbuffer.h
+++ b/sources/shiboken6/libshiboken/shibokenbuffer.h
@@ -9,7 +9,7 @@
namespace Shiboken::Buffer
{
- enum Type {
+ enum Type : uint8_t {
ReadOnly,
WriteOnly,
ReadWrite