JNI: fix error float argument to 'va_arg' is promotable

If the native method contains a jfloat parameter, I get
the warning/error:
 Second argument to 'va_arg' is of promotable type 'JNITypeForArg<float>'
(aka 'float'); this va_arg has undefined behavior because arguments will
be promoted to 'double'

Change-Id: I8e8ee256b9bea01585b5f70554ba2fc537e2c94d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Assam Boudjelthia 2023-10-17 14:35:19 +03:00
parent 38cc03c9af
commit a1b28bba9d

View File

@ -235,6 +235,7 @@ template <> struct PromotedType<signed char> { using Type = int; };
template <> struct PromotedType<unsigned char> { using Type = unsigned int; };
template <> struct PromotedType<short> { using Type = int; };
template <> struct PromotedType<unsigned short> { using Type = unsigned int; };
template <> struct PromotedType<float> { using Type = double; };
// Map any QJniObject type to jobject; that's what's on the va_list
template <typename Arg>