From: Shawn Rutledge Date: Tue, 15 Apr 2014 08:44:35 +0000 (+0200) Subject: QML: fix clang warnings about unused return values X-Git-Tag: v5.3.99+beta1~451 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d0ba990931203dadaa500a86e32bc355c0d9225;p=platform%2Fupstream%2Fqtdeclarative.git QML: fix clang warnings about unused return values For example calling toRect() and throwing it away caused this warning error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result] Change-Id: I849088d052d21402a5f50cfe9d1305c3e1d91244 Reviewed-by: Simon Hausmann --- diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index 39a6c77..0920b44 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -2069,7 +2069,7 @@ bool QQmlPropertyValidator::validateLiteralBinding(QQmlPropertyCache *propertyCa #endif // QT_NO_DATESTRING case QVariant::Point: { bool ok = false; - QQmlStringConverters::pointFFromString(binding->valueAsString(&qmlUnit->header), &ok).toPoint(); + QQmlStringConverters::pointFFromString(binding->valueAsString(&qmlUnit->header), &ok); if (!ok) { recordError(binding->valueLocation, tr("Invalid property assignment: point expected")); return false; @@ -2087,7 +2087,7 @@ bool QQmlPropertyValidator::validateLiteralBinding(QQmlPropertyCache *propertyCa break; case QVariant::Size: { bool ok = false; - QQmlStringConverters::sizeFFromString(binding->valueAsString(&qmlUnit->header), &ok).toSize(); + QQmlStringConverters::sizeFFromString(binding->valueAsString(&qmlUnit->header), &ok); if (!ok) { recordError(binding->valueLocation, tr("Invalid property assignment: size expected")); return false; @@ -2105,7 +2105,7 @@ bool QQmlPropertyValidator::validateLiteralBinding(QQmlPropertyCache *propertyCa break; case QVariant::Rect: { bool ok = false; - QQmlStringConverters::rectFFromString(binding->valueAsString(&qmlUnit->header), &ok).toRect(); + QQmlStringConverters::rectFFromString(binding->valueAsString(&qmlUnit->header), &ok); if (!ok) { recordError(binding->valueLocation, tr("Invalid property assignment: rect expected")); return false;