[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.
This commit is contained in:
Martin Gräßlin 2016-11-08 12:29:32 +01:00
parent ccdcb43680
commit 40ae294abd

View file

@ -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()) {