Title: [278458] trunk/Source
Revision
278458
Author
[email protected]
Date
2021-06-04 08:03:00 -0700 (Fri, 04 Jun 2021)

Log Message

Fix more GCC warnings
https://bugs.webkit.org/show_bug.cgi?id=226193

Patch by Michael Catanzaro <[email protected]> on 2021-06-04
Reviewed by Adrian Perez de Castro.

Source/_javascript_Core:

Fix -Wreturn-type warnings due to missing RELEASE_ASSERT_NOT_REACHED() where expected.

* jit/JITPlan.cpp:
(JSC::JITPlan::tier const):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):

Source/WebCore:

Fix -Wunused-parameter warnings. Also, fix a -Wredundant-move warning.

* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::createFromCSSText):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContextCairo::getCTM const):
(WebCore::GraphicsContextCairo::roundToDevicePixels):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::supportsGLX const):

Source/WebKit:

Remove redundant WTFMove that's triggering GCC's -Wredundant-move.

* Platform/IPC/ArgumentCoder.h:
(IPC::ArgumentCoder::decode):

Source/WTF:

Add missing static_cast<void*> required to suppress GCC's -Wclass-memaccess warning when
intentionally not running constructors/destructors. There's already a static_assert to
ensure this is safe, which is better than usual for us.

* wtf/SmallSet.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (278457 => 278458)


--- trunk/Source/_javascript_Core/ChangeLog	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-06-04 15:03:00 UTC (rev 278458)
@@ -1,3 +1,17 @@
+2021-06-04  Michael Catanzaro  <[email protected]>
+
+        Fix more GCC warnings
+        https://bugs.webkit.org/show_bug.cgi?id=226193
+
+        Reviewed by Adrian Perez de Castro.
+
+        Fix -Wreturn-type warnings due to missing RELEASE_ASSERT_NOT_REACHED() where expected.
+
+        * jit/JITPlan.cpp:
+        (JSC::JITPlan::tier const):
+        * jit/ThunkGenerators.cpp:
+        (JSC::virtualThunkFor):
+
 2021-06-03  Ross Kirsling  <[email protected]>
 
         [JSC] Implement JIT ICs for InByVal

Modified: trunk/Source/_javascript_Core/jit/JITPlan.cpp (278457 => 278458)


--- trunk/Source/_javascript_Core/jit/JITPlan.cpp	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/_javascript_Core/jit/JITPlan.cpp	2021-06-04 15:03:00 UTC (rev 278458)
@@ -82,6 +82,7 @@
     case JITCompilationMode::FTLForOSREntry:
         return Tier::FTL;
     }
+    RELEASE_ASSERT_NOT_REACHED();
 }
 
 JITCompilationKey JITPlan::key()

Modified: trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp (278457 => 278458)


--- trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp	2021-06-04 15:03:00 UTC (rev 278458)
@@ -388,6 +388,7 @@
                 return virtualThunkForConstructCall;
             return virtualThunkForConstructConstruct;
         }
+        RELEASE_ASSERT_NOT_REACHED();
     };
     return vm.getCTIStub(generator()).retagged<JITStubRoutinePtrTag>();
 }

Modified: trunk/Source/WTF/ChangeLog (278457 => 278458)


--- trunk/Source/WTF/ChangeLog	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/WTF/ChangeLog	2021-06-04 15:03:00 UTC (rev 278458)
@@ -1,3 +1,16 @@
+2021-06-04  Michael Catanzaro  <[email protected]>
+
+        Fix more GCC warnings
+        https://bugs.webkit.org/show_bug.cgi?id=226193
+
+        Reviewed by Adrian Perez de Castro.
+
+        Add missing static_cast<void*> required to suppress GCC's -Wclass-memaccess warning when
+        intentionally not running constructors/destructors. There's already a static_assert to
+        ensure this is safe, which is better than usual for us.
+
+        * wtf/SmallSet.h:
+
 2021-06-03  Chris Dumez  <[email protected]>
 
         Unreviewed build fix after r277881.

Modified: trunk/Source/WTF/wtf/SmallSet.h (278457 => 278458)


--- trunk/Source/WTF/wtf/SmallSet.h	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/WTF/wtf/SmallSet.h	2021-06-04 15:03:00 UTC (rev 278458)
@@ -67,7 +67,7 @@
 
     SmallSet(SmallSet&& other)
     {
-        memcpy(this, &other, sizeof(SmallSet));
+        memcpy(static_cast<void*>(this), static_cast<void*>(&other), sizeof(SmallSet));
         other.initialize();
     }
 
@@ -225,7 +225,7 @@
     {
         m_size = 0;
         m_capacity = SmallArraySize;
-        memset(m_inline.smallStorage, -1, sizeof(T) * SmallArraySize);
+        memset(static_cast<void*>(m_inline.smallStorage), -1, sizeof(T) * SmallArraySize);
         ASSERT(isSmall());
     }
 
@@ -252,7 +252,7 @@
         T* oldBuffer = wasSmall ? m_inline.smallStorage : m_inline.buffer;
         unsigned oldCapacity = m_capacity;
         T* newBuffer = static_cast<T*>(SmallSetMalloc::malloc(allocationSize));
-        memset(newBuffer, -1, allocationSize);
+        memset(static_cast<void*>(newBuffer), -1, allocationSize);
         m_capacity = size;
 
         for (unsigned i = 0; i < oldCapacity; i++) {

Modified: trunk/Source/WebCore/ChangeLog (278457 => 278458)


--- trunk/Source/WebCore/ChangeLog	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/WebCore/ChangeLog	2021-06-04 15:03:00 UTC (rev 278458)
@@ -1,3 +1,20 @@
+2021-06-04  Michael Catanzaro  <[email protected]>
+
+        Fix more GCC warnings
+        https://bugs.webkit.org/show_bug.cgi?id=226193
+
+        Reviewed by Adrian Perez de Castro.
+
+        Fix -Wunused-parameter warnings. Also, fix a -Wredundant-move warning.
+
+        * platform/animation/TimingFunction.cpp:
+        (WebCore::TimingFunction::createFromCSSText):
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:
+        (WebCore::GraphicsContextCairo::getCTM const):
+        (WebCore::GraphicsContextCairo::roundToDevicePixels):
+        * platform/graphics/x11/PlatformDisplayX11.cpp:
+        (WebCore::PlatformDisplayX11::supportsGLX const):
+
 2021-06-04  Chris Dumez  <[email protected]>
 
         Rename MainThreadGenericEventQueue to EventLoopEventQueue

Modified: trunk/Source/WebCore/platform/animation/TimingFunction.cpp (278457 => 278458)


--- trunk/Source/WebCore/platform/animation/TimingFunction.cpp	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/WebCore/platform/animation/TimingFunction.cpp	2021-06-04 15:03:00 UTC (rev 278458)
@@ -149,7 +149,7 @@
     properties->parseDeclaration(makeString("animation-timing-function:", cssText), CSSParserContext(HTMLStandardMode));
     if (auto value = properties->getPropertyCSSValue(CSSPropertyAnimationTimingFunction)) {
         if (auto function = createFromCSSValue(*value))
-            return WTFMove(function);
+            return function;
     }
     return Exception { TypeError };
 }

Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp (278457 => 278458)


--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp	2021-06-04 15:03:00 UTC (rev 278458)
@@ -89,6 +89,7 @@
 
 AffineTransform GraphicsContextCairo::getCTM(IncludeDeviceScale includeScale) const
 {
+    UNUSED_PARAM(includeScale);
     return Cairo::State::getCTM(*platformContext());
 }
 
@@ -251,6 +252,7 @@
 
 FloatRect GraphicsContextCairo::roundToDevicePixels(const FloatRect& rect, RoundingMode roundingMode)
 {
+    UNUSED_PARAM(roundingMode);
     return Cairo::State::roundToDevicePixels(*platformContext(), rect);
 }
 

Modified: trunk/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp (278457 => 278458)


--- trunk/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp	2021-06-04 15:03:00 UTC (rev 278458)
@@ -150,6 +150,7 @@
     glxErrorBase = m_glxErrorBase;
     return m_supportsGLX.value();
 #else
+    UNUSED_PARAM(glxErrorBase);
     return false;
 #endif
 }

Modified: trunk/Source/WebKit/ChangeLog (278457 => 278458)


--- trunk/Source/WebKit/ChangeLog	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/WebKit/ChangeLog	2021-06-04 15:03:00 UTC (rev 278458)
@@ -1,3 +1,15 @@
+2021-06-04  Michael Catanzaro  <[email protected]>
+
+        Fix more GCC warnings
+        https://bugs.webkit.org/show_bug.cgi?id=226193
+
+        Reviewed by Adrian Perez de Castro.
+
+        Remove redundant WTFMove that's triggering GCC's -Wredundant-move.
+
+        * Platform/IPC/ArgumentCoder.h:
+        (IPC::ArgumentCoder::decode):
+
 2021-06-04  Jan-Michael Brummer  <[email protected]>
 
         [GTK][WPE] Expose setCORSDisablingPatterns

Modified: trunk/Source/WebKit/Platform/IPC/ArgumentCoder.h (278457 => 278458)


--- trunk/Source/WebKit/Platform/IPC/ArgumentCoder.h	2021-06-04 14:48:12 UTC (rev 278457)
+++ trunk/Source/WebKit/Platform/IPC/ArgumentCoder.h	2021-06-04 15:03:00 UTC (rev 278458)
@@ -55,7 +55,7 @@
         else {
             T t;
             if (T::decode(decoder, t))
-                return WTFMove(t);
+                return t;
             return std::nullopt;
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to