From db5bc092aa5ad6104dfe01968ac0aca52fc5a63d Mon Sep 17 00:00:00 2001 From: Zhaojun Zhang Date: Fri, 27 Jul 2018 10:51:27 -0700 Subject: [PATCH] Remove clang compiler warnings for Android: -Wno-unused-parameter Summary: att Reviewed By: gkmhub Differential Revision: D8972835 fbshipit-source-id: c8b893eefec6ccb5d8506c959bcf5c3f43701e81 --- .../main/cpp/include/fb/fbjni/CoreClasses-inl.h | 12 ++++++++---- lib/fb/src/main/cpp/include/fb/fbjni/Hybrid.h | 12 +++++++----- lib/fb/src/main/cpp/include/fb/fbjni/Meta-inl.h | 9 +++++---- .../main/cpp/include/fb/fbjni/References-inl.h | 17 +++++++++-------- .../cpp/include/fb/fbjni/Registration-inl.h | 14 ++++++++------ 5 files changed, 37 insertions(+), 27 deletions(-) diff --git a/lib/fb/src/main/cpp/include/fb/fbjni/CoreClasses-inl.h b/lib/fb/src/main/cpp/include/fb/fbjni/CoreClasses-inl.h index 1e00441a..51131f84 100644 --- a/lib/fb/src/main/cpp/include/fb/fbjni/CoreClasses-inl.h +++ b/lib/fb/src/main/cpp/include/fb/fbjni/CoreClasses-inl.h @@ -1,10 +1,10 @@ /* - * Copyright (c) 2015-present, Facebook, Inc. + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. */ - #pragma once #include @@ -509,6 +509,8 @@ class PinnedCriticalAlloc { T** elements, size_t* size, jboolean* isCopy) { + (void)start; + (void)length; const auto env = internal::getEnv(); *elements = static_cast(env->GetPrimitiveArrayCritical(array.get(), isCopy)); FACEBOOK_JNI_THROW_EXCEPTION_IF(!elements); @@ -520,6 +522,8 @@ class PinnedCriticalAlloc { jint start, jint size, jint mode) { + (void)start; + (void)size; const auto env = internal::getEnv(); env->ReleasePrimitiveArrayCritical(array.get(), elements, mode); } diff --git a/lib/fb/src/main/cpp/include/fb/fbjni/Hybrid.h b/lib/fb/src/main/cpp/include/fb/fbjni/Hybrid.h index f020826c..143ec3b3 100644 --- a/lib/fb/src/main/cpp/include/fb/fbjni/Hybrid.h +++ b/lib/fb/src/main/cpp/include/fb/fbjni/Hybrid.h @@ -1,10 +1,10 @@ /* - * Copyright (c) 2015-present, Facebook, Inc. + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. */ - #pragma once #include @@ -188,7 +188,9 @@ public: // particular java class) to be hoisted to a common function. If // mapException returns, then the std::exception will be translated // to Java. - static void mapException(const std::exception& ex) {} + static void mapException(const std::exception& ex) { + (void)ex; + } }; template diff --git a/lib/fb/src/main/cpp/include/fb/fbjni/Meta-inl.h b/lib/fb/src/main/cpp/include/fb/fbjni/Meta-inl.h index ff4c016b..197dd2b1 100644 --- a/lib/fb/src/main/cpp/include/fb/fbjni/Meta-inl.h +++ b/lib/fb/src/main/cpp/include/fb/fbjni/Meta-inl.h @@ -1,10 +1,10 @@ /* - * Copyright (c) 2015-present, Facebook, Inc. + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. */ - #pragma once #include @@ -53,6 +53,7 @@ struct ArgsArraySetter { template struct ArgsArraySetter { static void set(alias_ref::javaobject> array) { + (void)array; } }; diff --git a/lib/fb/src/main/cpp/include/fb/fbjni/References-inl.h b/lib/fb/src/main/cpp/include/fb/fbjni/References-inl.h index 6bdc1815..99e152e8 100644 --- a/lib/fb/src/main/cpp/include/fb/fbjni/References-inl.h +++ b/lib/fb/src/main/cpp/include/fb/fbjni/References-inl.h @@ -1,10 +1,10 @@ /* - * Copyright (c) 2015-present, Facebook, Inc. + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. */ - #pragma once #include @@ -182,10 +182,11 @@ inline base_owned_ref::base_owned_ref() noexcept : base_owned_ref(nullptr) {} -template -inline base_owned_ref::base_owned_ref(std::nullptr_t t) noexcept - : base_owned_ref(static_cast(nullptr)) -{} +template +inline base_owned_ref::base_owned_ref(std::nullptr_t array) noexcept + : base_owned_ref(static_cast(nullptr)) { + (void)array; +} template inline base_owned_ref::base_owned_ref(const base_owned_ref& other) diff --git a/lib/fb/src/main/cpp/include/fb/fbjni/Registration-inl.h b/lib/fb/src/main/cpp/include/fb/fbjni/Registration-inl.h index e2817473..f8203cad 100644 --- a/lib/fb/src/main/cpp/include/fb/fbjni/Registration-inl.h +++ b/lib/fb/src/main/cpp/include/fb/fbjni/Registration-inl.h @@ -1,10 +1,10 @@ /* - * Copyright (c) 2015-present, Facebook, Inc. + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. */ - #pragma once #include "Exceptions.h" @@ -106,8 +106,10 @@ inline NativeMethodWrapper* exceptionWrapJNIMethod(R (*)(alias_ref, Args... a // registration wrappers for non-static methods, with autoconvertion of arguments. -template -inline NativeMethodWrapper* exceptionWrapJNIMethod(void (C::*method0)(Args... args)) { +template +inline NativeMethodWrapper* exceptionWrapJNIMethod( + void (C::*method0)(Args... args)) { + (void)method0; struct funcWrapper { JNI_ENTRY_POINT static void call(JNIEnv* env, jobject obj, typename Convert::type>::jniType... args) {