@@ -65,14 +65,14 @@ class Env {
6565 return Status::OK ();
6666 }
6767
68- static Status Init () WARN_UNUSED_RESULT { return init_throw_exception (); }
68+ static Status Init () { return init_throw_exception (); }
6969
7070 static Status GetJniExceptionMsg (JNIEnv* env, bool log_stack = true ,
7171 const std::string& prefix = " " ) WARN_UNUSED_RESULT;
7272
7373private:
7474 static Status GetJNIEnvSlowPath (JNIEnv** env);
75- static Status init_throw_exception () WARN_UNUSED_RESULT {
75+ static Status init_throw_exception () {
7676 JNIEnv* env = nullptr ;
7777 RETURN_IF_ERROR (Jni::Env::Get (&env));
7878
@@ -370,8 +370,8 @@ class FunctionCall {
370370 requires std::disjunction_v<std::is_same<T, jboolean>, std::is_same<T, jbyte>,
371371 std::is_same<T, jchar>, std::is_same<T, jshort>,
372372 std::is_same<T, jint>, std::is_same<T, jlong>,
373- std::is_same<T, jfloat>, std::is_same<T, jdouble> >
374- FunctionCall& with_arg (T arg) WARN_UNUSED_RESULT {
373+ std::is_same<T, jfloat>, std::is_same<T, jdouble>>
374+ FunctionCall& with_arg (T arg) {
375375 jvalue v;
376376 std::memset (&v, 0 , sizeof (v));
377377 if constexpr (std::is_same_v<T, jboolean>) {
@@ -414,11 +414,12 @@ class FunctionCall {
414414
415415 Status call () {
416416 using return_type = typename CallHelper<tag>::RETURN_TYPE;
417- if constexpr (std::disjunction_v<std::is_same<return_type, jboolean>, std::is_same<return_type, jbyte>,
418- std::is_same<return_type, jchar>, std::is_same<return_type, jshort>,
419- std::is_same<return_type, jint>, std::is_same<return_type, jlong>,
420- std::is_same<return_type, jfloat>, std::is_same<return_type, jdouble>,
421- std::is_same<return_type, void >>) {
417+ if constexpr (std::disjunction_v<
418+ std::is_same<return_type, jboolean>, std::is_same<return_type, jbyte>,
419+ std::is_same<return_type, jchar>, std::is_same<return_type, jshort>,
420+ std::is_same<return_type, jint>, std::is_same<return_type, jlong>,
421+ std::is_same<return_type, jfloat>, std::is_same<return_type, jdouble>,
422+ std::is_same<return_type, void >>) {
422423 CallHelper<tag>::call_impl (_env, _base, _method, _args.data ());
423424 RETURN_ERROR_IF_EXC (_env);
424425 } else if constexpr (std::is_same_v<return_type, jobject>) {
@@ -459,8 +460,8 @@ class NonvirtaulFunctionCall : public FunctionCall<tag> {
459460 requires std::disjunction_v<std::is_same<T, jboolean>, std::is_same<T, jbyte>,
460461 std::is_same<T, jchar>, std::is_same<T, jshort>,
461462 std::is_same<T, jint>, std::is_same<T, jlong>,
462- std::is_same<T, jfloat>, std::is_same<T, jdouble> >
463- NonvirtaulFunctionCall& with_arg (T arg) WARN_UNUSED_RESULT {
463+ std::is_same<T, jfloat>, std::is_same<T, jdouble>>
464+ NonvirtaulFunctionCall& with_arg (T arg) {
464465 jvalue v;
465466 std::memset (&v, 0 , sizeof (v));
466467 if constexpr (std::is_same_v<T, jboolean>) {
@@ -492,17 +493,18 @@ class NonvirtaulFunctionCall : public FunctionCall<tag> {
492493 // no override
493494 Status call () {
494495 using return_type = typename CallHelper<tag>::RETURN_TYPE;
495- if constexpr (std::disjunction_v<std::is_same<return_type, jboolean>, std::is_same<return_type, jbyte>,
496- std::is_same<return_type, jchar>, std::is_same<return_type, jshort>,
497- std::is_same<return_type, jint>, std::is_same<return_type, jlong>,
498- std::is_same<return_type, jfloat>, std::is_same<return_type, jdouble>,
499- std::is_same<return_type, void >>) {
496+ if constexpr (std::disjunction_v<
497+ std::is_same<return_type, jboolean>, std::is_same<return_type, jbyte>,
498+ std::is_same<return_type, jchar>, std::is_same<return_type, jshort>,
499+ std::is_same<return_type, jint>, std::is_same<return_type, jlong>,
500+ std::is_same<return_type, jfloat>, std::is_same<return_type, jdouble>,
501+ std::is_same<return_type, void >>) {
500502 CallHelper<tag>::call_impl (this ->_env , this ->_base , _cls, this ->_method ,
501503 this ->_args .data ());
502504 RETURN_ERROR_IF_EXC (this ->_env );
503505 } else if constexpr (std::is_same_v<return_type, jobject>) {
504506 jobject tmp = CallHelper<tag>::call_impl (this ->_env , this ->_base , _cls, this ->_method ,
505- this ->_args .data ());
507+ this ->_args .data ());
506508 RETURN_ERROR_IF_EXC (this ->_env );
507509 this ->_env ->DeleteLocalRef (tmp);
508510 } else {
@@ -738,6 +740,7 @@ class String : public Object<Ref> {
738740 Status get_string_chars (JNIEnv* env, StringBufferGuard<Ref>* jni_chars) const {
739741 return StringBufferGuard<Ref>::create (env, *this , jni_chars, nullptr );
740742 }
743+
741744private:
742745 DISALLOW_COPY_AND_ASSIGN (String);
743746};
@@ -810,6 +813,7 @@ class Array : public Object<Ref> {
810813 RETURN_IF_ERROR (WriteBufferToByteArray (env, (jbyte*)buffer, size, serialized_msg));
811814 return Status::OK ();
812815 }
816+
813817private:
814818 DISALLOW_COPY_AND_ASSIGN (Array);
815819};
@@ -907,6 +911,7 @@ class Class : public Object<Ref> {
907911 DCHECK (!method_id.uninitialized ());
908912 return FunctionCall<StaticVoidMethod>::instance (env, (jclass)this ->_obj , method_id._id );
909913 }
914+
910915private:
911916 DISALLOW_COPY_AND_ASSIGN (Class);
912917};
@@ -922,7 +927,7 @@ using GlobalString = String<Global>;
922927
923928template <CallTag tag>
924929template <RefType Ref>
925- FunctionCall<tag>& FunctionCall<tag>::with_arg(const Object<Ref>& obj) WARN_UNUSED_RESULT {
930+ FunctionCall<tag>& FunctionCall<tag>::with_arg(const Object<Ref>& obj) {
926931 jvalue v;
927932 std::memset (&v, 0 , sizeof (v));
928933 v.l = obj._obj ;
@@ -932,8 +937,7 @@ FunctionCall<tag>& FunctionCall<tag>::with_arg(const Object<Ref>& obj) WARN_UNUS
932937
933938template <CallTag tag>
934939template <RefType Ref>
935- NonvirtaulFunctionCall<tag>& NonvirtaulFunctionCall<tag>::with_arg(const Object<Ref>& obj)
936- WARN_UNUSED_RESULT {
940+ NonvirtaulFunctionCall<tag>& NonvirtaulFunctionCall<tag>::with_arg(const Object<Ref>& obj) {
937941 jvalue v;
938942 std::memset (&v, 0 , sizeof (v));
939943 v.l = obj._obj ;
0 commit comments