diff options
author | jvoung <jvoung@chromium.org> | 2014-10-03 11:26:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-03 18:26:54 +0000 |
commit | e0d053edfd25ecb1fd9720bec48ba5addc169abb (patch) | |
tree | 8e37fe87c7c31118b36267f95b3a6d3fa1b5c21d | |
parent | 616b1f8673430c2821ddd4d15e170eeb36fd0688 (diff) | |
download | chromium_src-e0d053edfd25ecb1fd9720bec48ba5addc169abb.zip chromium_src-e0d053edfd25ecb1fd9720bec48ba5addc169abb.tar.gz chromium_src-e0d053edfd25ecb1fd9720bec48ba5addc169abb.tar.bz2 |
Fix: comparison between 'enum PP_NaClAppProcessType' and 'enum nacl::NaClAppProcessType'
ChromeOS toolchain warns on this with -Werror=enum-compare.
BUG= https://code.google.com/p/chromium/issues/detail?id=420066
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3914
Review URL: https://codereview.chromium.org/624013002
Cr-Commit-Position: refs/heads/master@{#298064}
-rw-r--r-- | components/nacl/renderer/ppb_nacl_private_impl.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc index ff42194..0966ccd 100644 --- a/components/nacl/renderer/ppb_nacl_private_impl.cc +++ b/components/nacl/renderer/ppb_nacl_private_impl.cc @@ -277,16 +277,20 @@ int32_t FileDownloaderToPepperError(FileDownloader::Status status) { NaClAppProcessType PP_ToNaClAppProcessType( PP_NaClAppProcessType pp_process_type) { - static_assert(PP_UNKNOWN_NACL_PROCESS_TYPE == kUnknownNaClProcessType, - "PP_NaClAppProcessType differs from NaClAppProcessType"); - static_assert(PP_NATIVE_NACL_PROCESS_TYPE == kNativeNaClProcessType, - "PP_NaClAppProcessType differs from NaClAppProcessType"); - static_assert(PP_PNACL_PROCESS_TYPE == kPNaClProcessType, - "PP_NaClAppProcessType differs from NaClAppProcessType"); - static_assert(PP_PNACL_TRANSLATOR_PROCESS_TYPE == kPNaClTranslatorProcessType, - "PP_NaClAppProcessType differs from NaClAppProcessType"); - static_assert(PP_NUM_NACL_PROCESS_TYPES == kNumNaClProcessTypes, +#define STATICALLY_CHECK_NACLAPPPROCESSTYPE_EQ(pp, nonpp) \ + static_assert(static_cast<int>(pp) == static_cast<int>(nonpp), \ "PP_NaClAppProcessType differs from NaClAppProcessType"); + STATICALLY_CHECK_NACLAPPPROCESSTYPE_EQ(PP_UNKNOWN_NACL_PROCESS_TYPE, + kUnknownNaClProcessType); + STATICALLY_CHECK_NACLAPPPROCESSTYPE_EQ(PP_NATIVE_NACL_PROCESS_TYPE, + kNativeNaClProcessType); + STATICALLY_CHECK_NACLAPPPROCESSTYPE_EQ(PP_PNACL_PROCESS_TYPE, + kPNaClProcessType); + STATICALLY_CHECK_NACLAPPPROCESSTYPE_EQ(PP_PNACL_TRANSLATOR_PROCESS_TYPE, + kPNaClTranslatorProcessType); + STATICALLY_CHECK_NACLAPPPROCESSTYPE_EQ(PP_NUM_NACL_PROCESS_TYPES, + kNumNaClProcessTypes); +#undef STATICALLY_CHECK_NACLAPPPROCESSTYPE_EQ DCHECK(pp_process_type > PP_UNKNOWN_NACL_PROCESS_TYPE && pp_process_type < PP_NUM_NACL_PROCESS_TYPES); return static_cast<NaClAppProcessType>(pp_process_type); |