Title: [273553] trunk/Source/WebCore
Revision
273553
Author
[email protected]
Date
2021-02-26 06:07:17 -0800 (Fri, 26 Feb 2021)

Log Message

Fix clang compilation error in PlatformXR::ViewData initialization
https://bugs.webkit.org/show_bug.cgi?id=222467

Patch by Imanol Fernandez <[email protected]> on 2021-02-26
Reviewed by Philippe Normand.

Mixture of designated and non-designated struct initializers is a C99 extension.
Switch to designated initializers to avoid compilation errors in compilers not
supporting the extension.

* Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::DummyInlineDevice::views const):
* platform/xr/openxr/PlatformXROpenXR.cpp:
(PlatformXR::OpenXRDevice::views const):
* testing/WebFakeXRDevice.cpp:
(WebCore::SimulatedXRDevice::views const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (273552 => 273553)


--- trunk/Source/WebCore/ChangeLog	2021-02-26 14:00:26 UTC (rev 273552)
+++ trunk/Source/WebCore/ChangeLog	2021-02-26 14:07:17 UTC (rev 273553)
@@ -1,3 +1,21 @@
+2021-02-26  Imanol Fernandez  <[email protected]>
+
+        Fix clang compilation error in PlatformXR::ViewData initialization
+        https://bugs.webkit.org/show_bug.cgi?id=222467
+
+        Reviewed by Philippe Normand.
+
+        Mixture of designated and non-designated struct initializers is a C99 extension.
+        Switch to designated initializers to avoid compilation errors in compilers not
+        supporting the extension.
+
+        * Modules/webxr/WebXRSystem.cpp:
+        (WebCore::WebXRSystem::DummyInlineDevice::views const):
+        * platform/xr/openxr/PlatformXROpenXR.cpp:
+        (PlatformXR::OpenXRDevice::views const):
+        * testing/WebFakeXRDevice.cpp:
+        (WebCore::SimulatedXRDevice::views const):
+
 2021-02-26  Youenn Fablet  <[email protected]>
 
         Add support for WebRTC priority

Modified: trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp (273552 => 273553)


--- trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp	2021-02-26 14:00:26 UTC (rev 273552)
+++ trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp	2021-02-26 14:07:17 UTC (rev 273553)
@@ -533,7 +533,7 @@
 
 Vector<PlatformXR::Device::ViewData> WebXRSystem::DummyInlineDevice::views(XRSessionMode) const
 {
-    return { { .active = true, PlatformXR::Eye::None } };
+    return { { .active = true, .eye = PlatformXR::Eye::None } };
 }
 
 

Modified: trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp (273552 => 273553)


--- trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp	2021-02-26 14:00:26 UTC (rev 273552)
+++ trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp	2021-02-26 14:07:17 UTC (rev 273553)
@@ -237,8 +237,8 @@
         views.append({ .active = true, .eye = Eye::None });
     else {
         ASSERT(configurationType == XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO);
-        views.append({ .active = true, Eye::Left });
-        views.append({ .active = true, Eye::Right });
+        views.append({ .active = true, .eye = Eye::Left });
+        views.append({ .active = true, .eye = Eye::Right });
     }
     return views;
 }

Modified: trunk/Source/WebCore/testing/WebFakeXRDevice.cpp (273552 => 273553)


--- trunk/Source/WebCore/testing/WebFakeXRDevice.cpp	2021-02-26 14:00:26 UTC (rev 273552)
+++ trunk/Source/WebCore/testing/WebFakeXRDevice.cpp	2021-02-26 14:07:17 UTC (rev 273553)
@@ -125,9 +125,9 @@
 Vector<PlatformXR::Device::ViewData> SimulatedXRDevice::views(PlatformXR::SessionMode mode) const
 {
     if (mode == PlatformXR::SessionMode::ImmersiveVr)
-        return { { .active = true, PlatformXR::Eye::Left }, { .active = true, PlatformXR::Eye::Right } };
+        return { { .active = true, .eye = PlatformXR::Eye::Left }, { .active = true, .eye = PlatformXR::Eye::Right } };
 
-    return { { .active = true, PlatformXR::Eye::None } };
+    return { { .active = true, .eye = PlatformXR::Eye::None } };
 }
 
 void SimulatedXRDevice::scheduleOnNextFrame(Function<void()>&& func)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to