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

Unified Diff: chrome/common/mac/mock_launchd.cc

Issue 812503003: replace COMPILE_ASSERT with static_assert in chrome/common/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « chrome/common/mac/launchd.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/mac/mock_launchd.cc
diff --git a/chrome/common/mac/mock_launchd.cc b/chrome/common/mac/mock_launchd.cc
index 237e3ed38b8cb2e779c21d2241eae23c20ea8f60..e463733e26d032ae4b51a6a6034e85e2c4139e74 100644
--- a/chrome/common/mac/mock_launchd.cc
+++ b/chrome/common/mac/mock_launchd.cc
@@ -129,7 +129,8 @@ CFDictionaryRef MockLaunchd::CopyExports() {
kCFAllocatorDefault, pipe_name_.c_str(), kCFStringEncodingUTF8));
const void *keys[] = { env_var };
const void *values[] = { socket_path };
- COMPILE_ASSERT(arraysize(keys) == arraysize(values), array_sizes_must_match);
+ static_assert(arraysize(keys) == arraysize(values),
+ "keys must have the same number of elements as values");
return CFDictionaryCreate(kCFAllocatorDefault,
keys,
values,
@@ -155,7 +156,8 @@ CFDictionaryRef MockLaunchd::CopyJobDictionary(CFStringRef label) {
base::ScopedCFTypeRef<CFNumberRef> pid(
CFNumberCreate(NULL, kCFNumberIntType, &process_id));
const void *values[] = { path, pid };
- COMPILE_ASSERT(arraysize(keys) == arraysize(values), array_sizes_must_match);
+ static_assert(arraysize(keys) == arraysize(values),
+ "keys must have the same number of elements as values");
return CFDictionaryCreate(kCFAllocatorDefault,
keys,
values,
@@ -177,8 +179,8 @@ CFDictionaryRef MockLaunchd::CopyDictionaryByCheckingIn(CFErrorRef* error) {
if (!create_socket_) {
const void *keys[] = { program, program_args };
const void *values[] = { path, args };
- COMPILE_ASSERT(arraysize(keys) == arraysize(values),
- array_sizes_must_match);
+ static_assert(arraysize(keys) == arraysize(values),
+ "keys must have the same number of elements as values");
return CFDictionaryCreate(kCFAllocatorDefault,
keys,
values,
@@ -230,8 +232,9 @@ CFDictionaryRef MockLaunchd::CopyDictionaryByCheckingIn(CFErrorRef* error) {
CFStringRef socket_dict_key = CFSTR("ServiceProcessSocket");
const void *socket_keys[] = { socket_dict_key };
const void *socket_values[] = { sockets };
- COMPILE_ASSERT(arraysize(socket_keys) == arraysize(socket_values),
- socket_array_sizes_must_match);
+ static_assert(arraysize(socket_keys) == arraysize(socket_values),
+ "socket_keys must have the same number of elements "
+ "as socket_values");
base::ScopedCFTypeRef<CFDictionaryRef> socket_dict(
CFDictionaryCreate(kCFAllocatorDefault,
socket_keys,
@@ -241,7 +244,8 @@ CFDictionaryRef MockLaunchd::CopyDictionaryByCheckingIn(CFErrorRef* error) {
&kCFTypeDictionaryValueCallBacks));
const void *keys[] = { program, program_args, socket_key };
const void *values[] = { path, args, socket_dict };
- COMPILE_ASSERT(arraysize(keys) == arraysize(values), array_sizes_must_match);
+ static_assert(arraysize(keys) == arraysize(values),
+ "keys must have the same number of elements as values");
return CFDictionaryCreate(kCFAllocatorDefault,
keys,
values,
« no previous file with comments | « chrome/common/mac/launchd.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698