From 365175c67f230c9f34c0be8580d9477daf0faa26 Mon Sep 17 00:00:00 2001 From: danakj Date: Fri, 5 Feb 2016 16:37:37 -0800 Subject: Stop using macros to paste together names for static_asserts. This unifies all the static assert macros to be: - Named STATIC_ASSERT_ENUM - Use static_cast() instead of other disallowed casts. - Take the full enum name as an input so that code search and rewriter tools etc can find the actual thing being done by the code. This will allow the rewrite_to_chrome_style tool to change blink enum names and fix these places up too so things compile. R=thakis@chromium.org TBR=sievers,raymes BUG=584474 Review URL: https://codereview.chromium.org/1676703002 Cr-Commit-Position: refs/heads/master@{#373970} --- ppapi/thunk/ppb_text_input_thunk.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ppapi') diff --git a/ppapi/thunk/ppb_text_input_thunk.cc b/ppapi/thunk/ppb_text_input_thunk.cc index 030a7f5..c376ce0 100644 --- a/ppapi/thunk/ppb_text_input_thunk.cc +++ b/ppapi/thunk/ppb_text_input_thunk.cc @@ -16,8 +16,9 @@ namespace thunk { namespace { -#define STATIC_ASSERT_ENUM(a, b) \ - static_assert(int(a) == int(b), "mismatching enum values: " #a) +#define STATIC_ASSERT_ENUM(a, b) \ + static_assert(static_cast(a) == static_cast(b), \ + "mismatching enum: " #a) STATIC_ASSERT_ENUM(PP_TEXTINPUT_TYPE_DEV_NONE, PP_TEXTINPUT_TYPE_NONE); STATIC_ASSERT_ENUM(PP_TEXTINPUT_TYPE_DEV_TEXT, PP_TEXTINPUT_TYPE_TEXT); -- cgit v1.1