diff options
author | bungeman <bungeman@chromium.org> | 2015-08-19 14:52:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-19 21:52:46 +0000 |
commit | 9a5d7fab14643a6d7276967ed7da2143a2597a61 (patch) | |
tree | 39ffa4693360de5d2c75dacd426e0c77838573b7 /skia | |
parent | 5f7fdaf11da7fa24898dfb42bbb6f035fd7554fc (diff) | |
download | chromium_src-9a5d7fab14643a6d7276967ed7da2143a2597a61.zip chromium_src-9a5d7fab14643a6d7276967ed7da2143a2597a61.tar.gz chromium_src-9a5d7fab14643a6d7276967ed7da2143a2597a61.tar.bz2 |
Use static_assert instead of SK_COMPILE_ASSERT.
Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion.
Review URL: https://codereview.chromium.org/1300183003
Cr-Commit-Position: refs/heads/master@{#344340}
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/benchmarking_canvas.cc | 12 | ||||
-rw-r--r-- | skia/ext/skia_utils_win.cc | 18 | ||||
-rw-r--r-- | skia/ext/skia_utils_win.h | 4 |
3 files changed, 17 insertions, 17 deletions
diff --git a/skia/ext/benchmarking_canvas.cc b/skia/ext/benchmarking_canvas.cc index added95..752e398 100644 --- a/skia/ext/benchmarking_canvas.cc +++ b/skia/ext/benchmarking_canvas.cc @@ -355,15 +355,15 @@ scoped_ptr<base::Value> AsValue(const SkPath& path) { { "move", "line", "quad", "conic", "cubic", "close", "done" }; static const int gPtsPerVerb[] = { 1, 1, 2, 2, 3, 0, 0 }; static const int gPtOffsetPerVerb[] = { 0, 1, 1, 1, 1, 0, 0 }; - SK_COMPILE_ASSERT( + static_assert( SK_ARRAY_COUNT(gVerbStrings) == static_cast<size_t>(SkPath::kDone_Verb + 1), - gVerbStrings_size_mismatch); - SK_COMPILE_ASSERT( + "gVerbStrings size mismatch"); + static_assert( SK_ARRAY_COUNT(gVerbStrings) == SK_ARRAY_COUNT(gPtsPerVerb), - gPtsPerVerb_size_mismatch); - SK_COMPILE_ASSERT( + "gPtsPerVerb size mismatch"); + static_assert( SK_ARRAY_COUNT(gVerbStrings) == SK_ARRAY_COUNT(gPtOffsetPerVerb), - gPtOffsetPerVerb_size_mismatch); + "gPtOffsetPerVerb size mismatch"); scoped_ptr<base::ListValue> verbs_val(new base::ListValue()); SkPath::Iter iter(const_cast<SkPath&>(path), false); diff --git a/skia/ext/skia_utils_win.cc b/skia/ext/skia_utils_win.cc index e065b1e..3089b24 100644 --- a/skia/ext/skia_utils_win.cc +++ b/skia/ext/skia_utils_win.cc @@ -13,15 +13,15 @@ namespace { -SK_COMPILE_ASSERT(offsetof(RECT, left) == offsetof(SkIRect, fLeft), o1); -SK_COMPILE_ASSERT(offsetof(RECT, top) == offsetof(SkIRect, fTop), o2); -SK_COMPILE_ASSERT(offsetof(RECT, right) == offsetof(SkIRect, fRight), o3); -SK_COMPILE_ASSERT(offsetof(RECT, bottom) == offsetof(SkIRect, fBottom), o4); -SK_COMPILE_ASSERT(sizeof(RECT().left) == sizeof(SkIRect().fLeft), o5); -SK_COMPILE_ASSERT(sizeof(RECT().top) == sizeof(SkIRect().fTop), o6); -SK_COMPILE_ASSERT(sizeof(RECT().right) == sizeof(SkIRect().fRight), o7); -SK_COMPILE_ASSERT(sizeof(RECT().bottom) == sizeof(SkIRect().fBottom), o8); -SK_COMPILE_ASSERT(sizeof(RECT) == sizeof(SkIRect), o9); +static_assert(offsetof(RECT, left) == offsetof(SkIRect, fLeft), "o1"); +static_assert(offsetof(RECT, top) == offsetof(SkIRect, fTop), "o2"); +static_assert(offsetof(RECT, right) == offsetof(SkIRect, fRight), "o3"); +static_assert(offsetof(RECT, bottom) == offsetof(SkIRect, fBottom), "o4"); +static_assert(sizeof(RECT().left) == sizeof(SkIRect().fLeft), "o5"); +static_assert(sizeof(RECT().top) == sizeof(SkIRect().fTop), "o6"); +static_assert(sizeof(RECT().right) == sizeof(SkIRect().fRight), "o7"); +static_assert(sizeof(RECT().bottom) == sizeof(SkIRect().fBottom), "o8"); +static_assert(sizeof(RECT) == sizeof(SkIRect), "o9"); } // namespace diff --git a/skia/ext/skia_utils_win.h b/skia/ext/skia_utils_win.h index 6ac5234..379cba12 100644 --- a/skia/ext/skia_utils_win.h +++ b/skia/ext/skia_utils_win.h @@ -24,14 +24,14 @@ POINT SkPointToPOINT(const SkPoint& point); SkRect RECTToSkRect(const RECT& rect); // Converts a Windows RECT to a Skia rect. -// Both use same in-memory format. Verified by SK_COMPILE_ASSERT() in +// Both use same in-memory format. Verified by static_assert in // skia_utils_win.cc. inline const SkIRect& RECTToSkIRect(const RECT& rect) { return reinterpret_cast<const SkIRect&>(rect); } // Converts a Skia rect to a Windows RECT. -// Both use same in-memory format. Verified by SK_COMPILE_ASSERT() in +// Both use same in-memory format. Verified by static_assert in // skia_utils_win.cc. inline const RECT& SkIRectToRECT(const SkIRect& rect) { return reinterpret_cast<const RECT&>(rect); |