Closed Bug 1794164 Opened 3 years ago Closed 3 years ago

Fix C++20 -Wenum-float-conversion warnings in layout-related code (in layout, dom, and gfx)

Categories

(Core :: Layout, task, P3)

task

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox105 --- wontfix
firefox106 --- wontfix
firefox107 --- wontfix
firefox108 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(2 files)

C++20 deprecates some operations between enums and floating point types:

https://clang.llvm.org/docs/DiagnosticsReference.html#wenum-float-conversion

dom/base/Document.cpp:10408:22 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:33:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:33:48 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:34:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:34:48 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:35:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:38:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'

dom/canvas/CanvasRenderingContext2D.cpp:4743:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'

dom/events/EventStateManager.cpp:6656:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'
dom/events/EventStateManager.cpp:6664:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'

gfx/thebes/gfxTextRun.cpp:2992:24 [-Wenum-float-conversion] comparison of floating-point type 'gfxFloat' (aka 'double') with enumeration type 'gfxFontGroup::(unnamed enum at gfx/thebes/gfxTextRun.h:1035:3)'

layout/generic/nsVideoFrame.cpp:59:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'

layout/painting/nsCSSRenderingBorders.cpp:2752:27 [-Wenum-float-conversion] arithmetic between enumeration type 'mozilla::Corner' and floating-point type 'double'

Blocks: Wenum-float-conversion
No longer blocks: C++20

C++20 deprecates some operations between enums and floating point types:

https://clang.llvm.org/docs/DiagnosticsReference.html#wenum-float-conversion

dom/base/Document.cpp:10408:22 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:33:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:33:48 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:34:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:34:48 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:35:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:38:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'

dom/canvas/CanvasRenderingContext2D.cpp:4743:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'

dom/events/EventStateManager.cpp:6656:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'
dom/events/EventStateManager.cpp:6664:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'

gfx/thebes/gfxTextRun.cpp:2992:24 [-Wenum-float-conversion] comparison of floating-point type 'gfxFloat' (aka 'double') with enumeration type 'gfxFontGroup::(unnamed enum at gfx/thebes/gfxTextRun.h:1035:3)'

layout/generic/nsVideoFrame.cpp:59:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'

layout/painting/nsCSSRenderingBorders.cpp:2752:27 [-Wenum-float-conversion] arithmetic between enumeration type 'mozilla::Corner' and floating-point type 'double'

C++20 deprecates some operations between enums and floating point types:

https://clang.llvm.org/docs/DiagnosticsReference.html#wenum-float-conversion

dom/base/Document.cpp:10408:22 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:33:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:33:48 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:34:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:34:48 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:35:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'
dom/base/nsViewportInfo.cpp:38:10 [-Wenum-float-conversion] comparison of floating-point type 'float' with enumeration type 'nsViewportInfo::(unnamed enum at dom/base/nsViewportInfo.h:108:3)'

Attachment #9297634 - Attachment description: Bug 1794164 - Fix C++20 -Wenum-float-conversion warnings in layout-related code. r?#layout-reviewers → Bug 1794164 - Fix C++20 -Wenum-float-conversion warnings in layout-related code. r?dholbert
Pushed by cpeterson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8bff394e9702 Change nsViewportInfo enums to constexprs and add 'k' prefix. r=dholbert
Pushed by cpeterson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ee014b202046 Fix C++20 -Wenum-float-conversion warnings in layout-related code. r=dholbert
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: