Title: [231796] trunk/Source/WebCore
- Revision
- 231796
- Author
- [email protected]
- Date
- 2018-05-15 03:24:24 -0700 (Tue, 15 May 2018)
Log Message
Fix -Wreturn-std-move warnings in WebKit found by new clang compiler
<https://webkit.org/b/185621>
Reviewed by Youenn Fablet.
Fix warnings like the following:
In file included from DerivedSources/WebCore/unified-sources/UnifiedSource139.cpp:5:
./Modules/mediastream/PeerConnectionBackend.cpp:412:16: error: local variable 'sdp' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
return sdp;
^~~
./Modules/mediastream/PeerConnectionBackend.cpp:412:16: note: call 'std::move' explicitly to avoid copying
return sdp;
^~~
std::move(sdp)
1 error generated.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::filterSDP const):
* accessibility/AccessibilityObject.cpp:
(WebCore::rangeClosestToRange):
* bindings/js/JSDOMConvertSequences.h:
(WebCore::Detail::GenericSequenceConverter::convert):
(WebCore::Detail::NumericSequenceConverter::convertArray):
* bindings/js/JSDOMConvertStrings.cpp:
(WebCore::stringToByteString):
(WebCore::stringToUSVString):
- Use WTFMove() in return statements to fix the warnings.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (231795 => 231796)
--- trunk/Source/WebCore/ChangeLog 2018-05-15 09:50:07 UTC (rev 231795)
+++ trunk/Source/WebCore/ChangeLog 2018-05-15 10:24:24 UTC (rev 231796)
@@ -1,3 +1,34 @@
+2018-05-15 David Kilzer <[email protected]>
+
+ Fix -Wreturn-std-move warnings in WebKit found by new clang compiler
+ <https://webkit.org/b/185621>
+
+ Reviewed by Youenn Fablet.
+
+ Fix warnings like the following:
+
+ In file included from DerivedSources/WebCore/unified-sources/UnifiedSource139.cpp:5:
+ ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: error: local variable 'sdp' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
+ return sdp;
+ ^~~
+ ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: note: call 'std::move' explicitly to avoid copying
+ return sdp;
+ ^~~
+ std::move(sdp)
+ 1 error generated.
+
+ * Modules/mediastream/PeerConnectionBackend.cpp:
+ (WebCore::PeerConnectionBackend::filterSDP const):
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::rangeClosestToRange):
+ * bindings/js/JSDOMConvertSequences.h:
+ (WebCore::Detail::GenericSequenceConverter::convert):
+ (WebCore::Detail::NumericSequenceConverter::convertArray):
+ * bindings/js/JSDOMConvertStrings.cpp:
+ (WebCore::stringToByteString):
+ (WebCore::stringToUSVString):
+ - Use WTFMove() in return statements to fix the warnings.
+
2018-05-14 Dean Jackson <[email protected]>
Download and present System Preview
Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp (231795 => 231796)
--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp 2018-05-15 09:50:07 UTC (rev 231795)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp 2018-05-15 10:24:24 UTC (rev 231796)
@@ -409,7 +409,7 @@
String PeerConnectionBackend::filterSDP(String&& sdp) const
{
if (!m_shouldFilterICECandidates)
- return sdp;
+ return WTFMove(sdp);
StringBuilder filteredSDP;
sdp.split('\n', false, [&filteredSDP](StringView line) {
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (231795 => 231796)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2018-05-15 09:50:07 UTC (rev 231795)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2018-05-15 10:24:24 UTC (rev 231796)
@@ -731,9 +731,9 @@
if (!afterRange && !beforeRange)
return nullptr;
if (afterRange && !beforeRange)
- return afterRange;
+ return WTFMove(afterRange);
if (!afterRange && beforeRange)
- return beforeRange;
+ return WTFMove(beforeRange);
unsigned positionsToAfterRange = Position::positionCountBetweenPositions(afterRange->startPosition(), referenceRange->endPosition());
unsigned positionsToBeforeRange = Position::positionCountBetweenPositions(beforeRange->endPosition(), referenceRange->startPosition());
Modified: trunk/Source/WebCore/bindings/js/JSDOMConvertSequences.h (231795 => 231796)
--- trunk/Source/WebCore/bindings/js/JSDOMConvertSequences.h 2018-05-15 09:50:07 UTC (rev 231795)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvertSequences.h 2018-05-15 10:24:24 UTC (rev 231796)
@@ -57,7 +57,7 @@
return;
result.append(WTFMove(convertedValue));
});
- return result;
+ return WTFMove(result);
}
static ReturnType convert(JSC::ExecState& state, JSC::JSObject* object, JSC::JSValue method)
@@ -75,7 +75,7 @@
return;
result.append(WTFMove(convertedValue));
});
- return result;
+ return WTFMove(result);
}
};
@@ -99,7 +99,7 @@
else
result.uncheckedAppend(indexValue.asInt32());
}
- return result;
+ return WTFMove(result);
}
ASSERT(indexingType == JSC::DoubleShape);
@@ -114,7 +114,7 @@
result.uncheckedAppend(convertedValue);
}
}
- return result;
+ return WTFMove(result);
}
static ReturnType convert(JSC::ExecState& state, JSC::JSValue value)
Modified: trunk/Source/WebCore/bindings/js/JSDOMConvertStrings.cpp (231795 => 231796)
--- trunk/Source/WebCore/bindings/js/JSDOMConvertStrings.cpp 2018-05-15 09:50:07 UTC (rev 231795)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvertStrings.cpp 2018-05-15 10:24:24 UTC (rev 231796)
@@ -39,7 +39,7 @@
return { };
}
- return string;
+ return WTFMove(string);
}
String identifierToByteString(ExecState& state, const Identifier& identifier)
@@ -78,7 +78,7 @@
{
// Fast path for the case where there are no unpaired surrogates.
if (!hasUnpairedSurrogate(string))
- return string;
+ return WTFMove(string);
// Slow path: http://heycam.github.io/webidl/#dfn-obtain-unicode
// Replaces unpaired surrogates with the replacement character.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes