Fix C++20 -Wenum-float-conversion warnings in layout-related code (in layout, dom, and gfx)
Categories
(Core :: Layout, task, P3)
Tracking
()
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'
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 1•3 years ago
|
||
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'
| Assignee | ||
Comment 2•3 years ago
|
||
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)'
Updated•3 years ago
|
Comment 5•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/8bff394e9702
https://hg.mozilla.org/mozilla-central/rev/ee014b202046
Updated•3 years ago
|
Description
•