From 40ae294abd93a6686b5ba9454e119d8351d7238b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 8 Nov 2016 12:29:32 +0100 Subject: [PATCH] [tools/generate] Wrap wl_fixed request args in wl_fixed_from_double We pass a qreal to the wl_fixed and for that need to wrap it in wl_fixed_from_double. --- src/wayland/tools/generator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wayland/tools/generator.cpp b/src/wayland/tools/generator.cpp index 663ea8165e..099f680904 100644 --- a/src/wayland/tools/generator.cpp +++ b/src/wayland/tools/generator.cpp @@ -1304,7 +1304,11 @@ void Generator::generateClientCppRequests(const Interface &interface) requestArguments.append(QStringLiteral(", *%1").arg(toCamelCase(a.name()))); } else { arguments.append(QStringLiteral("%1 %2").arg(a.typeAsQt()).arg(toCamelCase(a.name()))); - requestArguments.append(QStringLiteral(", %1").arg(toCamelCase(a.name()))); + QString arg = toCamelCase(a.name()); + if (a.type() == Argument::Type::Fixed) { + arg = QStringLiteral("wl_fixed_from_double(%1)").arg(arg); + } + requestArguments.append(QStringLiteral(", %1").arg(arg)); } } if (factored.isEmpty()) {