Title: [287268] trunk/Source/WebCore
Revision
287268
Author
[email protected]
Date
2021-12-20 11:54:43 -0800 (Mon, 20 Dec 2021)

Log Message

[Win] MSVC reports "DragImageCairoWin.cpp(142): error C2362: initialization of 'cr' is skipped by 'goto exit'" with /std:c++20
https://bugs.webkit.org/show_bug.cgi?id=234505

Reviewed by Don Olmstead.

* platform/win/DragImageCairoWin.cpp:
(WebCore::scaleDragImage):
Reimplemented without goto statements.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287267 => 287268)


--- trunk/Source/WebCore/ChangeLog	2021-12-20 19:03:36 UTC (rev 287267)
+++ trunk/Source/WebCore/ChangeLog	2021-12-20 19:54:43 UTC (rev 287268)
@@ -1,3 +1,14 @@
+2021-12-20  Fujii Hironori  <[email protected]>
+
+        [Win] MSVC reports "DragImageCairoWin.cpp(142): error C2362: initialization of 'cr' is skipped by 'goto exit'" with /std:c++20
+        https://bugs.webkit.org/show_bug.cgi?id=234505
+
+        Reviewed by Don Olmstead.
+
+        * platform/win/DragImageCairoWin.cpp:
+        (WebCore::scaleDragImage):
+        Reimplemented without goto statements.
+
 2021-12-14  Sergio Villar Senin  <[email protected]>
 
         [css-flexbox] Pre-layout orthogonal children to compute the preferred logical width

Modified: trunk/Source/WebCore/platform/win/DragImageCairoWin.cpp (287267 => 287268)


--- trunk/Source/WebCore/platform/win/DragImageCairoWin.cpp	2021-12-20 19:03:36 UTC (rev 287267)
+++ trunk/Source/WebCore/platform/win/DragImageCairoWin.cpp	2021-12-20 19:54:43 UTC (rev 287268)
@@ -107,7 +107,6 @@
     if (!imageRef)
         return 0;
 
-    GDIObject<HBITMAP> hbmp;
     auto image = adoptGDIObject(imageRef);
 
     IntSize srcSize = dragImageSize(image.get());
@@ -116,12 +115,12 @@
     HWndDC dc(0);
     auto dstDC = adoptGDIObject(::CreateCompatibleDC(dc));
     if (!dstDC)
-        goto exit;
+        return image.leak();
 
     GraphicsContextCairo* targetContext;
-    hbmp = allocImage(dstDC.get(), dstSize, &targetContext);
+    GDIObject<HBITMAP> hbmp = allocImage(dstDC.get(), dstSize, &targetContext);
     if (!hbmp)
-        goto exit;
+        return image.leak();
 
     cairo_surface_t* srcImage = createCairoContextFromBitmap(image.get());
 
@@ -139,9 +138,6 @@
     cairo_surface_destroy(srcImage);
     deallocContext(targetContext);
 
-exit:
-    if (!hbmp)
-        hbmp.swap(image);
     return hbmp.leak();
 }
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to