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

Unified Diff: ppapi/shared_impl/private/net_address_private_impl.cc

Issue 824153003: replace COMPILE_ASSERT with static_assert in ppapi/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 years, 11 months 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 | « ppapi/shared_impl/ppb_trace_event_impl.cc ('k') | ppapi/thunk/ppb_text_input_thunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/private/net_address_private_impl.cc
diff --git a/ppapi/shared_impl/private/net_address_private_impl.cc b/ppapi/shared_impl/private/net_address_private_impl.cc
index 04baf96fda2ccc54a00cee452cc9f2b5d103d095..43df743223fa4c4c6c7035740cfd72d9d5e1673d 100644
--- a/ppapi/shared_impl/private/net_address_private_impl.cc
+++ b/ppapi/shared_impl/private/net_address_private_impl.cc
@@ -92,14 +92,14 @@ struct NetAddress {
// that the alignment is the same on both sides of the NaCl proxy, which is
// important because we serialize and deserialize PP_NetAddress_Private by
// simply copying the raw bytes.
-COMPILE_ASSERT(sizeof(NetAddress) == 28,
- NetAddress_different_for_compiler);
+static_assert(sizeof(NetAddress) == 28,
+ "NetAddress different for compiler");
// Make sure the storage in |PP_NetAddress_Private| is big enough. (Do it here
// since the data is opaque elsewhere.)
-COMPILE_ASSERT(sizeof(reinterpret_cast<PP_NetAddress_Private*>(0)->data) >=
- sizeof(NetAddress),
- PP_NetAddress_Private_data_too_small);
+static_assert(sizeof(reinterpret_cast<PP_NetAddress_Private*>(0)->data) >=
+ sizeof(NetAddress),
+ "PP_NetAddress_Private data too small");
size_t GetAddressSize(const NetAddress* net_addr) {
return net_addr->is_ipv6 ? kIPv6AddressSize : kIPv4AddressSize;
@@ -556,8 +556,8 @@ bool NetAddressPrivateImpl::DescribeNetAddressPrivateAsIPv4Address(
ipv4_addr->port = ConvertToNetEndian16(net_addr->port);
- COMPILE_ASSERT(sizeof(ipv4_addr->addr) == kIPv4AddressSize,
- mismatched_IPv4_address_size);
+ static_assert(sizeof(ipv4_addr->addr) == kIPv4AddressSize,
+ "mismatched IPv4 address size");
memcpy(ipv4_addr->addr, net_addr->address, kIPv4AddressSize);
return true;
@@ -576,8 +576,8 @@ bool NetAddressPrivateImpl::DescribeNetAddressPrivateAsIPv6Address(
ipv6_addr->port = ConvertToNetEndian16(net_addr->port);
- COMPILE_ASSERT(sizeof(ipv6_addr->addr) == kIPv6AddressSize,
- mismatched_IPv6_address_size);
+ static_assert(sizeof(ipv6_addr->addr) == kIPv6AddressSize,
+ "mismatched IPv6 address size");
memcpy(ipv6_addr->addr, net_addr->address, kIPv6AddressSize);
return true;
« no previous file with comments | « ppapi/shared_impl/ppb_trace_event_impl.cc ('k') | ppapi/thunk/ppb_text_input_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698