Commit 00f08389 authored by George Burgess IV's avatar George Burgess IV Committed by Commit Bot

viewport: convert an enum -> float constexprs

This wipes out a lot of clang warnings of the form:

third_party/blink/renderer/core/page/viewport_description.cc:125:23:
warning: comparison of floating-point type 'float' with enumeration type
'blink::ViewportDescription::(anonymous enum at
third_party/blink/renderer/core/page/viewport_description.h:71:3)'
[-Wenum-float-conversion]

Regrettably, enums can't have a `float` underlying type.

Bug: 1058218
Change-Id: I43487e8165791165337ac3df0d612aa968349ee7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087875Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747836}
parent aa0af83c
......@@ -68,18 +68,16 @@ struct CORE_EXPORT ViewportDescription {
kTypeCount = 7
};
enum {
kValueAuto = -1,
kValueDeviceWidth = -2,
kValueDeviceHeight = -3,
kValuePortrait = -4,
kValueLandscape = -5,
kValueDeviceDPI = -6,
kValueLowDPI = -7,
kValueMediumDPI = -8,
kValueHighDPI = -9,
kValueExtendToZoom = -10
};
constexpr static float kValueAuto = -1.;
constexpr static float kValueDeviceWidth = -2.;
constexpr static float kValueDeviceHeight = -3.;
constexpr static float kValuePortrait = -4.;
constexpr static float kValueLandscape = -5.;
constexpr static float kValueDeviceDPI = -6.;
constexpr static float kValueLowDPI = -7.;
constexpr static float kValueMediumDPI = -8.;
constexpr static float kValueHighDPI = -9.;
constexpr static float kValueExtendToZoom = -10.;
ViewportDescription(Type type = kUserAgentStyleSheet)
: type(type),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment