- Revision
- 223212
- Author
- [email protected]
- Date
- 2017-10-11 16:26:13 -0700 (Wed, 11 Oct 2017)
Log Message
Part 2: Fix -Wcast-qual and -Wunused-lambda-capture warnings in WebCore with new clang compiler
<https://webkit.org/b/178036>
<rdar://problem/33667497>
Reviewed by Chris Dumez.
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doRemove):
- Change ASSERT() to ASSERT_UNUSED() to suppress warnings about
unused lambda capture for 'cacheIdentifier' in Release builds.
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::classForIsA): Change C-style cast
into reinterpret_cast and const_cast to go from CFTypeRef to
ObjcClass*.
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::castDataArgumentToCCRSACryptorCreateFromDataIfNeeded):
Add. Introduce method to add a required const_cast for older
OSes since the signature of CCRSACryptorCreateFromData() changed
in iOS 11 & High Sierra.
(WebCore::CryptoKeyRSA::create): Use
castDataArgumentToCCRSACryptorCreateFromDataIfNeeded().
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
Remove unused lambda capture for 'status'.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (223211 => 223212)
--- trunk/Source/WebCore/ChangeLog 2017-10-11 22:21:58 UTC (rev 223211)
+++ trunk/Source/WebCore/ChangeLog 2017-10-11 23:26:13 UTC (rev 223212)
@@ -1,3 +1,30 @@
+2017-10-11 David Kilzer <[email protected]>
+
+ Part 2: Fix -Wcast-qual and -Wunused-lambda-capture warnings in WebCore with new clang compiler
+ <https://webkit.org/b/178036>
+ <rdar://problem/33667497>
+
+ Reviewed by Chris Dumez.
+
+ * Modules/cache/WorkerCacheStorageConnection.cpp:
+ (WebCore::WorkerCacheStorageConnection::doRemove):
+ - Change ASSERT() to ASSERT_UNUSED() to suppress warnings about
+ unused lambda capture for 'cacheIdentifier' in Release builds.
+ * bridge/objc/objc_class.mm:
+ (JSC::Bindings::ObjcClass::classForIsA): Change C-style cast
+ into reinterpret_cast and const_cast to go from CFTypeRef to
+ ObjcClass*.
+ * crypto/mac/CryptoKeyRSAMac.cpp:
+ (WebCore::castDataArgumentToCCRSACryptorCreateFromDataIfNeeded):
+ Add. Introduce method to add a required const_cast for older
+ OSes since the signature of CCRSACryptorCreateFromData() changed
+ in iOS 11 & High Sierra.
+ (WebCore::CryptoKeyRSA::create): Use
+ castDataArgumentToCCRSACryptorCreateFromDataIfNeeded().
+ * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
+ (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
+ Remove unused lambda capture for 'status'.
+
2017-10-11 Chris Dumez <[email protected]>
[Geolocation] Expose Coordinates.floorLevel
Modified: trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp (223211 => 223212)
--- trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp 2017-10-11 22:21:58 UTC (rev 223211)
+++ trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp 2017-10-11 23:26:13 UTC (rev 223212)
@@ -136,7 +136,7 @@
ASSERT(m_mainThreadConnection);
m_mainThreadConnection->remove(cacheIdentifier, [this, protectedThis = WTFMove(protectedThis), requestIdentifier, cacheIdentifier](const CacheIdentifierOrError& result) mutable {
- ASSERT(!result.hasValue() || result.value().identifier == cacheIdentifier);
+ ASSERT_UNUSED(cacheIdentifier, !result.hasValue() || result.value().identifier == cacheIdentifier);
m_proxy.postTaskForModeToWorkerGlobalScope([this, protectedThis = WTFMove(protectedThis), requestIdentifier, result](ScriptExecutionContext& context) mutable {
ASSERT_UNUSED(context, context.isWorkerGlobalScope());
removeCompleted(requestIdentifier, result);
Modified: trunk/Source/WebCore/bridge/objc/objc_class.mm (223211 => 223212)
--- trunk/Source/WebCore/bridge/objc/objc_class.mm 2017-10-11 22:21:58 UTC (rev 223211)
+++ trunk/Source/WebCore/bridge/objc/objc_class.mm 2017-10-11 23:26:13 UTC (rev 223212)
@@ -50,7 +50,7 @@
{
_createClassesByIsAIfNecessary();
- ObjcClass* aClass = (ObjcClass*)CFDictionaryGetValue(classesByIsA, isa);
+ ObjcClass* aClass = reinterpret_cast<ObjcClass*>(const_cast<void*>(CFDictionaryGetValue(classesByIsA, isa)));
if (!aClass) {
aClass = new ObjcClass(isa);
CFDictionaryAddValue(classesByIsA, isa, aClass);
Modified: trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp (223211 => 223212)
--- trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp 2017-10-11 22:21:58 UTC (rev 223211)
+++ trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp 2017-10-11 23:26:13 UTC (rev 223212)
@@ -41,6 +41,18 @@
namespace WebCore {
+#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300)
+inline uint8_t* castDataArgumentToCCRSACryptorCreateFromDataIfNeeded(const uint8_t* value)
+{
+ return const_cast<uint8_t*>(value);
+}
+#else
+inline const uint8_t* castDataArgumentToCCRSACryptorCreateFromDataIfNeeded(const uint8_t* value)
+{
+ return value;
+}
+#endif
+
// OID rsaEncryption: 1.2.840.113549.1.1.1. Per https://tools.ietf.org/html/rfc3279#section-2.3.1
static const unsigned char RSAOIDHeader[] = {0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00};
@@ -136,10 +148,10 @@
// See <rdar://problem/15452324>.
CCCryptorStatus status = CCRSACryptorCreateFromData(
keyData.type() == CryptoKeyRSAComponents::Type::Public ? ccRSAKeyPublic : ccRSAKeyPrivate,
- (uint8_t*)keyData.modulus().data(), keyData.modulus().size(),
- (uint8_t*)keyData.exponent().data(), keyData.exponent().size(),
- (uint8_t*)keyData.firstPrimeInfo().primeFactor.data(), keyData.firstPrimeInfo().primeFactor.size(),
- (uint8_t*)keyData.secondPrimeInfo().primeFactor.data(), keyData.secondPrimeInfo().primeFactor.size(),
+ castDataArgumentToCCRSACryptorCreateFromDataIfNeeded(keyData.modulus().data()), keyData.modulus().size(),
+ castDataArgumentToCCRSACryptorCreateFromDataIfNeeded(keyData.exponent().data()), keyData.exponent().size(),
+ castDataArgumentToCCRSACryptorCreateFromDataIfNeeded(keyData.firstPrimeInfo().primeFactor.data()), keyData.firstPrimeInfo().primeFactor.size(),
+ castDataArgumentToCCRSACryptorCreateFromDataIfNeeded(keyData.secondPrimeInfo().primeFactor.data()), keyData.secondPrimeInfo().primeFactor.size(),
&cryptor);
if (status) {
Modified: trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm (223211 => 223212)
--- trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm 2017-10-11 22:21:58 UTC (rev 223211)
+++ trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm 2017-10-11 23:26:13 UTC (rev 223212)
@@ -313,8 +313,7 @@
return;
}
- dispatch_async(m_enqueingQueue.get(), [protectedThis = makeRefPtr(this), status, imageSampleBuffer = adoptCF(rawImageSampleBuffer), infoFlags, displaying] {
- UNUSED_PARAM(infoFlags);
+ dispatch_async(m_enqueingQueue.get(), [protectedThis = makeRefPtr(this), imageSampleBuffer = adoptCF(rawImageSampleBuffer), displaying] {
protectedThis->enqueueDecodedSample(imageSampleBuffer.get(), displaying);
});
}