diff options
author | danakj <danakj@chromium.org> | 2016-02-05 16:37:37 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-06 00:39:56 +0000 |
commit | 365175c67f230c9f34c0be8580d9477daf0faa26 (patch) | |
tree | 938a36cda712f6daadf49da7332e05bd8f265c16 /ppapi | |
parent | 3da433ff8fa3908d14bbeb40a6549d88b3fa6623 (diff) | |
download | chromium_src-365175c67f230c9f34c0be8580d9477daf0faa26.zip chromium_src-365175c67f230c9f34c0be8580d9477daf0faa26.tar.gz chromium_src-365175c67f230c9f34c0be8580d9477daf0faa26.tar.bz2 |
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<int>() 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}
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/thunk/ppb_text_input_thunk.cc | 5 |
1 files changed, 3 insertions, 2 deletions
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<int>(a) == static_cast<int>(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); |