Fix miscellaneous build warnings
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jun 2019 03:14:20 +0000 (03:14 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jun 2019 03:14:20 +0000 (03:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198544

Reviewed by Don Olmstead.

Source/JavaScriptCore:

Silence -Wclass-memaccess warning in this dangerous code.

* wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::Instance):

Source/WebCore:

Carefully silence -Wsign-compare warnings.

* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::compile):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
* xml/XSLStyleSheetLibxslt.cpp:
(WebCore::XSLStyleSheet::parseString):

Source/WebKit:

Carefully silence -Wsign-compare warnings.

* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::readOrMakeSalt):

Tools:

When converting to PRIVATE include directories, we accidentally dropped SYSTEM here. The
naming convention used here is a bit confusing: the *_SYSTEM_INCLUDE_DIRECTORIES actually
uses both SYSTEM and PRIVATE. We should probably clarify this.

* TestWebKitAPI/PlatformGTK.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246095 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/WasmInstance.cpp
Source/WebCore/ChangeLog
Source/WebCore/contentextensions/DFABytecodeCompiler.cpp
Source/WebCore/inspector/InspectorCanvas.cpp
Source/WebCore/xml/XSLStyleSheetLibxslt.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/PlatformGTK.cmake

index 521baaa..9157c54 100644 (file)
@@ -1,3 +1,15 @@
+2019-06-04  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix miscellaneous build warnings
+        https://bugs.webkit.org/show_bug.cgi?id=198544
+
+        Reviewed by Don Olmstead.
+
+        Silence -Wclass-memaccess warning in this dangerous code.
+
+        * wasm/WasmInstance.cpp:
+        (JSC::Wasm::Instance::Instance):
+
 2019-06-04  Yusuke Suzuki  <ysuzuki@apple.com>
 
         Unreviewed, update exception scope for putByIndexBeyondVectorLength
index a5e0fcd..3705996 100644 (file)
@@ -55,7 +55,7 @@ Instance::Instance(Context* context, Ref<Module>&& module, EntryFrame** pointerT
 {
     for (unsigned i = 0; i < m_numImportFunctions; ++i)
         new (importFunctionInfo(i)) ImportFunctionInfo();
-    memset(m_globals.get(), 0, globalMemoryByteSize(m_module.get()));
+    memset(static_cast<void*>(m_globals.get()), 0, globalMemoryByteSize(m_module.get()));
     for (unsigned i = 0; i < m_module->moduleInformation().globals.size(); ++i) {
         if (m_module.get().moduleInformation().globals[i].type == Anyref)
             m_globalsToMark.set(i);
index c9b595b..d6f7a00 100644 (file)
@@ -1,3 +1,19 @@
+2019-06-04  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix miscellaneous build warnings
+        https://bugs.webkit.org/show_bug.cgi?id=198544
+
+        Reviewed by Don Olmstead.
+
+        Carefully silence -Wsign-compare warnings.
+
+        * contentextensions/DFABytecodeCompiler.cpp:
+        (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
+        * inspector/InspectorCanvas.cpp:
+        (WebCore::InspectorCanvas::indexForData):
+        * xml/XSLStyleSheetLibxslt.cpp:
+        (WebCore::XSLStyleSheet::parseString):
+
 2019-06-04  Keith Rollin  <krollin@apple.com>
 
         Fix 64-bit vs 32-bit mismatch in ISOFairPlayStreamingPsshBox.cpp
index c961051..2b04b22 100644 (file)
@@ -461,7 +461,7 @@ void DFABytecodeCompiler::compile()
     // Link.
     for (const auto& linkRecord : m_linkRecords) {
         uint32_t destination = m_nodeStartOffsets[linkRecord.destinationNodeIndex];
-        RELEASE_ASSERT(destination < std::numeric_limits<int32_t>::max());
+        RELEASE_ASSERT(destination < static_cast<uint32_t>(std::numeric_limits<int32_t>::max()));
         int32_t distance = destination - linkRecord.instructionLocation;
         ASSERT(abs(distance) <= abs(linkRecord.longestPossibleJump));
         
index 8782753..4b22d5d 100644 (file)
@@ -432,7 +432,7 @@ int InspectorCanvas::indexForData(DuplicateDataVariant data)
         return false;
     });
     if (index != notFound) {
-        ASSERT(index < std::numeric_limits<int>::max());
+        ASSERT(index < static_cast<size_t>(std::numeric_limits<int>::max()));
         return static_cast<int>(index);
     }
 
@@ -526,7 +526,7 @@ int InspectorCanvas::indexForData(DuplicateDataVariant data)
         index = m_indexedDuplicateData.size() - 1;
     }
 
-    ASSERT(index < std::numeric_limits<int>::max());
+    ASSERT(index < static_cast<size_t>(std::numeric_limits<int>::max()));
     return static_cast<int>(index);
 }
 
index 6698878..ec2c6ae 100644 (file)
@@ -145,7 +145,7 @@ bool XSLStyleSheet::parseString(const String& string)
     const char* buffer = reinterpret_cast<const char*>(upconvertedCharacters.get());
     Checked<unsigned, RecordOverflow> unsignedSize = string.length();
     unsignedSize *= sizeof(UChar);
-    if (unsignedSize.hasOverflowed() || unsignedSize.unsafeGet() > std::numeric_limits<int>::max())
+    if (unsignedSize.hasOverflowed() || unsignedSize.unsafeGet() > static_cast<unsigned>(std::numeric_limits<int>::max()))
         return false;
 
     int size = static_cast<int>(unsignedSize.unsafeGet());
index f238efd..eed9dcf 100644 (file)
@@ -1,3 +1,15 @@
+2019-06-04  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix miscellaneous build warnings
+        https://bugs.webkit.org/show_bug.cgi?id=198544
+
+        Reviewed by Don Olmstead.
+
+        Carefully silence -Wsign-compare warnings.
+
+        * NetworkProcess/cache/NetworkCacheData.cpp:
+        (WebKit::NetworkCache::readOrMakeSalt):
+
 2019-06-04  Youenn Fablet  <youenn@apple.com>
 
         getUserMedia requests should be processed sequentially in UIProcess
index ae0c66d..24a5e4e 100644 (file)
@@ -183,12 +183,12 @@ Optional<Salt> readOrMakeSalt(const String& path)
     Salt salt;
     auto bytesRead = read(fd, salt.data(), salt.size());
     close(fd);
-    if (bytesRead != salt.size()) {
+    if (bytesRead != static_cast<ssize_t>(salt.size())) {
         salt = makeSalt();
 
         unlink(cpath.data());
         fd = open(cpath.data(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
-        bool success = write(fd, salt.data(), salt.size()) == salt.size();
+        bool success = write(fd, salt.data(), salt.size()) == static_cast<ssize_t>(salt.size());
         close(fd);
         if (!success)
             return { };
index 899b82c..413d4f5 100644 (file)
@@ -1,3 +1,16 @@
+2019-06-04  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix miscellaneous build warnings
+        https://bugs.webkit.org/show_bug.cgi?id=198544
+
+        Reviewed by Don Olmstead.
+
+        When converting to PRIVATE include directories, we accidentally dropped SYSTEM here. The
+        naming convention used here is a bit confusing: the *_SYSTEM_INCLUDE_DIRECTORIES actually
+        uses both SYSTEM and PRIVATE. We should probably clarify this.
+
+        * TestWebKitAPI/PlatformGTK.cmake:
+
 2019-06-04  Youenn Fablet  <youenn@apple.com>
 
         getUserMedia requests should be processed sequentially in UIProcess
index ba90917..7c31cad 100644 (file)
@@ -99,11 +99,14 @@ set(TestJSC_SOURCES
     Tests/JavaScriptCore/glib/TestJSC.cpp
 )
 
+set(TestJSC_SYSTEM_INCLUDE_DIRECTORIES
+    ${GLIB_INCLUDE_DIRS}
+    ${GTK3_INCLUDE_DIRS}
+)
+
 set(TestJSC_PRIVATE_INCLUDE_DIRECTORIES
     ${CMAKE_BINARY_DIR}
     ${TESTWEBKITAPI_DIR}
-    ${GLIB_INCLUDE_DIRS}
-    ${GTK3_INCLUDE_DIRS}
     ${THIRDPARTY_DIR}/gtest/include
     ${FORWARDING_HEADERS_DIR}
     ${FORWARDING_HEADERS_DIR}/JavaScriptCore