Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: mojo/converters/surfaces/surfaces_type_converters.cc

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: message cleanup Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/converters/surfaces/surfaces_type_converters.cc
diff --git a/mojo/converters/surfaces/surfaces_type_converters.cc b/mojo/converters/surfaces/surfaces_type_converters.cc
index 8908fc807f7189b4cbc3aa2af08a2b12fdb018a6..f0a32bdb37345be225b2c6c2297231a0a3cd529c 100644
--- a/mojo/converters/surfaces/surfaces_type_converters.cc
+++ b/mojo/converters/surfaces/surfaces_type_converters.cc
@@ -69,10 +69,10 @@ using mus::mojom::YUVVideoQuadStatePtr;
namespace mojo {
-#define ASSERT_ENUM_VALUES_EQUAL(value) \
- COMPILE_ASSERT(cc::DrawQuad::value == static_cast<cc::DrawQuad::Material>( \
- mus::mojom::MATERIAL_##value), \
- value##_enum_value_matches)
+#define ASSERT_ENUM_VALUES_EQUAL(value) \
+ static_assert(cc::DrawQuad::value == static_cast<cc::DrawQuad::Material>( \
+ mus::mojom::MATERIAL_##value), \
+ #value " enum value must match")
ASSERT_ENUM_VALUES_EQUAL(DEBUG_BORDER);
ASSERT_ENUM_VALUES_EQUAL(IO_SURFACE_CONTENT);
@@ -85,10 +85,10 @@ ASSERT_ENUM_VALUES_EQUAL(TEXTURE_CONTENT);
ASSERT_ENUM_VALUES_EQUAL(TILED_CONTENT);
ASSERT_ENUM_VALUES_EQUAL(YUV_VIDEO_CONTENT);
-COMPILE_ASSERT(cc::YUVVideoDrawQuad::REC_601 ==
- static_cast<cc::YUVVideoDrawQuad::ColorSpace>(
- mus::mojom::YUV_COLOR_SPACE_REC_601),
- rec_601_enum_matches);
+static_assert(cc::YUVVideoDrawQuad::REC_601 ==
+ static_cast<cc::YUVVideoDrawQuad::ColorSpace>(
+ mus::mojom::YUV_COLOR_SPACE_REC_601),
+ "REC_601 enum value must match");
// TODO(jamesr): Add REC_709 and JPEG to the YUVColorSpace enum upstream in
// mojo.
« no previous file with comments | « mojo/converters/input_events/input_events_type_converters.cc ('k') | mojo/environment/default_logger_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698