@@ -49,16 +49,16 @@ namespace jni
49
49
Wrap<jfieldID*>(env.FromReflectedField (Unwrap (obj))));
50
50
}
51
51
52
- inline jobject& ToReflectedMethod (JNIEnv& env, jclass& clazz, jmethodID& method, jboolean isStatic)
52
+ inline jobject& ToReflectedMethod (JNIEnv& env, jclass& clazz, jmethodID& method, bool isStatic)
53
53
{
54
54
return *CheckJavaException (env,
55
- Wrap<jobject*>(env.ToReflectedMethod (Unwrap (clazz), Unwrap (method), Unwrap ( isStatic) )));
55
+ Wrap<jobject*>(env.ToReflectedMethod (Unwrap (clazz), Unwrap (method), isStatic)));
56
56
}
57
57
58
- inline jobject& ToReflectedField (JNIEnv& env, jclass& clazz, jfieldID& field, jboolean isStatic)
58
+ inline jobject& ToReflectedField (JNIEnv& env, jclass& clazz, jfieldID& field, bool isStatic)
59
59
{
60
60
return *CheckJavaException (env,
61
- Wrap<jobject*>(env.ToReflectedField (Unwrap (clazz), Unwrap (field), Unwrap ( isStatic) )));
61
+ Wrap<jobject*>(env.ToReflectedField (Unwrap (clazz), Unwrap (field), isStatic)));
62
62
}
63
63
64
64
@@ -68,10 +68,10 @@ namespace jni
68
68
Wrap<jclass*>(env.GetSuperclass (Unwrap (clazz))));
69
69
}
70
70
71
- inline jboolean IsAssignableFrom (JNIEnv& env, jclass& clazz1, jclass& clazz2)
71
+ inline bool IsAssignableFrom (JNIEnv& env, jclass& clazz1, jclass& clazz2)
72
72
{
73
73
return CheckJavaException (env,
74
- Wrap<jboolean>( env.IsAssignableFrom (Unwrap (clazz1), Unwrap (clazz2) )));
74
+ env.IsAssignableFrom (Unwrap (clazz1), Unwrap (clazz2)));
75
75
}
76
76
77
77
@@ -87,7 +87,7 @@ namespace jni
87
87
throw PendingJavaException ();
88
88
}
89
89
90
- inline jboolean ExceptionCheck (JNIEnv& env)
90
+ inline bool ExceptionCheck (JNIEnv& env)
91
91
{
92
92
return env.ExceptionCheck ();
93
93
}
@@ -175,10 +175,10 @@ namespace jni
175
175
}
176
176
177
177
178
- inline jboolean IsSameObject (JNIEnv& env, jobject* ref1, jobject* ref2)
178
+ inline bool IsSameObject (JNIEnv& env, jobject* ref1, jobject* ref2)
179
179
{
180
180
return CheckJavaException (env,
181
- Wrap<jboolean>( env.IsSameObject (Unwrap (ref1), Unwrap (ref2) )));
181
+ env.IsSameObject (Unwrap (ref1), Unwrap (ref2)));
182
182
}
183
183
184
184
inline jobject& AllocObject (JNIEnv& env, jclass& clazz)
@@ -200,10 +200,10 @@ namespace jni
200
200
Wrap<jclass*>(env.GetObjectClass (Unwrap (obj))));
201
201
}
202
202
203
- inline jboolean IsInstanceOf (JNIEnv& env, jobject* obj, jclass& clazz)
203
+ inline bool IsInstanceOf (JNIEnv& env, jobject* obj, jclass& clazz)
204
204
{
205
205
return CheckJavaException (env,
206
- Wrap<jboolean>( env.IsInstanceOf (Unwrap (obj), Unwrap (clazz)))) ;
206
+ env.IsInstanceOf (Unwrap (obj), Unwrap (clazz))) == JNI_TRUE ;
207
207
}
208
208
209
209
@@ -330,12 +330,12 @@ namespace jni
330
330
Wrap<jsize>(env.GetStringLength (Unwrap (string))));
331
331
}
332
332
333
- inline std::tuple<UniqueStringChars, jboolean > GetStringChars (JNIEnv& env, jstring& string)
333
+ inline std::tuple<UniqueStringChars, bool > GetStringChars (JNIEnv& env, jstring& string)
334
334
{
335
335
::jboolean isCopy = JNI_FALSE;
336
336
const char16_t * result = CheckJavaException (env,
337
337
Wrap<const char16_t *>(env.GetStringChars (Unwrap (string), &isCopy)));
338
- return std::make_tuple (UniqueStringChars (result, StringCharsDeleter (env, string)), Wrap<jboolean>( isCopy) );
338
+ return std::make_tuple (UniqueStringChars (result, StringCharsDeleter (env, string)), isCopy);
339
339
}
340
340
341
341
inline void ReleaseStringChars (JNIEnv& env, jstring& string, UniqueStringChars&& chars)
@@ -356,12 +356,12 @@ namespace jni
356
356
Wrap<jsize>(env.GetStringUTFLength (Unwrap (string))));
357
357
}
358
358
359
- inline std::tuple<UniqueStringUTFChars, jboolean > GetStringUTFChars (JNIEnv& env, jstring& string)
359
+ inline std::tuple<UniqueStringUTFChars, bool > GetStringUTFChars (JNIEnv& env, jstring& string)
360
360
{
361
361
::jboolean isCopy = JNI_FALSE;
362
362
const char * result = CheckJavaException (env,
363
363
env.GetStringUTFChars (Unwrap (string), &isCopy));
364
- return std::make_tuple (UniqueStringUTFChars (result, StringUTFCharsDeleter (env, string)), Wrap<jboolean>( isCopy) );
364
+ return std::make_tuple (UniqueStringUTFChars (result, StringUTFCharsDeleter (env, string)), isCopy);
365
365
}
366
366
367
367
inline void ReleaseStringUTFChars (JNIEnv& env, jstring& string, UniqueStringUTFChars&& chars)
@@ -396,12 +396,12 @@ namespace jni
396
396
GetStringUTFRegion (env, string, start, ArraylikeSize (buf), ArraylikeData (buf));
397
397
}
398
398
399
- inline std::tuple<UniqueStringCritical, jboolean > GetStringCritical (JNIEnv& env, jstring& string)
399
+ inline std::tuple<UniqueStringCritical, bool > GetStringCritical (JNIEnv& env, jstring& string)
400
400
{
401
401
::jboolean isCopy = JNI_FALSE;
402
402
const char16_t * result = CheckJavaException (env,
403
403
Wrap<const char16_t *>(env.GetStringCritical (Unwrap (string), &isCopy)));
404
- return std::make_tuple (UniqueStringCritical (result, StringCriticalDeleter (env, string)), Wrap<jboolean>( isCopy) );
404
+ return std::make_tuple (UniqueStringCritical (result, StringCriticalDeleter (env, string)), isCopy);
405
405
}
406
406
407
407
inline void ReleaseStringCritical (JNIEnv& env, jstring& string, UniqueStringCritical&& chars)
@@ -426,12 +426,12 @@ namespace jni
426
426
}
427
427
428
428
template < class E >
429
- std::tuple<UniqueArrayElements<E>, jboolean > GetArrayElements (JNIEnv& env, jarray<E>& array)
429
+ std::tuple<UniqueArrayElements<E>, bool > GetArrayElements (JNIEnv& env, jarray<E>& array)
430
430
{
431
431
::jboolean isCopy = JNI_FALSE;
432
432
E* result = CheckJavaException (env,
433
433
(env.*(TypedMethods<E>::GetArrayElements))(Unwrap (array), &isCopy));
434
- return std::make_tuple (UniqueArrayElements<E>(result, ArrayElementsDeleter<E>(env, array)), Wrap<jboolean>( isCopy) );
434
+ return std::make_tuple (UniqueArrayElements<E>(result, ArrayElementsDeleter<E>(env, array)), isCopy);
435
435
}
436
436
437
437
template < class E >
@@ -449,12 +449,12 @@ namespace jni
449
449
}
450
450
451
451
template < class E >
452
- std::tuple<UniquePrimitiveArrayCritical<E>, jboolean > GetPrimitiveArrayCritical (JNIEnv& env, jarray<E>& array)
452
+ std::tuple<UniquePrimitiveArrayCritical<E>, bool > GetPrimitiveArrayCritical (JNIEnv& env, jarray<E>& array)
453
453
{
454
454
::jboolean isCopy = JNI_FALSE;
455
455
void * result = CheckJavaException (env,
456
456
env.GetPrimitiveArrayCritical (Unwrap (array), &isCopy));
457
- return std::make_tuple (UniquePrimitiveArrayCritical<E>(result, PrimitiveArrayCriticalDeleter<E>(env, array)), Wrap<jboolean>( isCopy) );
457
+ return std::make_tuple (UniquePrimitiveArrayCritical<E>(result, PrimitiveArrayCriticalDeleter<E>(env, array)), isCopy);
458
458
}
459
459
460
460
template < class E >
0 commit comments