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

Unified Diff: gpu/command_buffer/common/id_allocator.cc

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: win 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: gpu/command_buffer/common/id_allocator.cc
diff --git a/gpu/command_buffer/common/id_allocator.cc b/gpu/command_buffer/common/id_allocator.cc
index eccb4681df72bced7aa00d1ac01d59931b0429d1..9f58695f4ee3706d515c304e5bd64675cbabec7c 100644
--- a/gpu/command_buffer/common/id_allocator.cc
+++ b/gpu/command_buffer/common/id_allocator.cc
@@ -12,7 +12,7 @@
namespace gpu {
IdAllocator::IdAllocator() {
- COMPILE_ASSERT(kInvalidResource == 0u, invalid_resource_is_not_zero);
+ static_assert(kInvalidResource == 0u, "invalid_resource_is_not_zero");
// Simplify the code by making sure that lower_bound(id) never
// returns the beginning of the map, if id is valid (eg !=
// kInvalidResource).
@@ -143,7 +143,7 @@ void IdAllocator::FreeID(ResourceId id) {
}
void IdAllocator::FreeIDRange(ResourceId first_id, uint32 range) {
- COMPILE_ASSERT(kInvalidResource == 0u, invalid_resource_is_not_zero);
+ static_assert(kInvalidResource == 0u, "invalid_resource_is_not_zero");
if (range == 0u || (first_id == 0u && range == 1u)) {
return;

Powered by Google App Engine
This is Rietveld 408576698