Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
djinni
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
djinni
Commits
cd5c74e0
Commit
cd5c74e0
authored
Apr 09, 2015
by
Jacob Potter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More asserts
parent
3ccbc162
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
support-lib/jni/djinni_support.cpp
support-lib/jni/djinni_support.cpp
+13
-0
No files found.
support-lib/jni/djinni_support.cpp
View file @
cd5c74e0
...
...
@@ -152,6 +152,7 @@ void jniThrowAssertionError(JNIEnv * env, const char * file, int line, const cha
GlobalRef
<
jclass
>
jniFindClass
(
const
char
*
name
)
{
JNIEnv
*
env
=
jniGetThreadEnv
();
DJINNI_ASSERT
(
name
,
env
);
GlobalRef
<
jclass
>
guard
(
env
,
env
->
FindClass
(
name
));
jniExceptionCheck
(
env
);
if
(
!
guard
)
{
...
...
@@ -162,6 +163,9 @@ GlobalRef<jclass> jniFindClass(const char * name) {
jmethodID
jniGetStaticMethodID
(
jclass
clazz
,
const
char
*
name
,
const
char
*
sig
)
{
JNIEnv
*
env
=
jniGetThreadEnv
();
DJINNI_ASSERT
(
clazz
,
env
);
DJINNI_ASSERT
(
name
,
env
);
DJINNI_ASSERT
(
sig
,
env
);
jmethodID
id
=
env
->
GetStaticMethodID
(
clazz
,
name
,
sig
);
jniExceptionCheck
(
env
);
if
(
!
id
)
{
...
...
@@ -172,6 +176,9 @@ jmethodID jniGetStaticMethodID(jclass clazz, const char * name, const char * sig
jmethodID
jniGetMethodID
(
jclass
clazz
,
const
char
*
name
,
const
char
*
sig
)
{
JNIEnv
*
env
=
jniGetThreadEnv
();
DJINNI_ASSERT
(
clazz
,
env
);
DJINNI_ASSERT
(
name
,
env
);
DJINNI_ASSERT
(
sig
,
env
);
jmethodID
id
=
env
->
GetMethodID
(
clazz
,
name
,
sig
);
jniExceptionCheck
(
env
);
if
(
!
id
)
{
...
...
@@ -182,6 +189,9 @@ jmethodID jniGetMethodID(jclass clazz, const char * name, const char * sig) {
jfieldID
jniGetFieldID
(
jclass
clazz
,
const
char
*
name
,
const
char
*
sig
)
{
JNIEnv
*
env
=
jniGetThreadEnv
();
DJINNI_ASSERT
(
clazz
,
env
);
DJINNI_ASSERT
(
name
,
env
);
DJINNI_ASSERT
(
sig
,
env
);
jfieldID
id
=
env
->
GetFieldID
(
clazz
,
name
,
sig
);
jniExceptionCheck
(
env
);
if
(
!
id
)
{
...
...
@@ -197,6 +207,7 @@ JniEnum::JniEnum(const std::string & name)
{}
jint
JniEnum
::
ordinal
(
JNIEnv
*
env
,
jobject
obj
)
const
{
DJINNI_ASSERT
(
obj
,
env
);
const
jint
res
=
env
->
CallIntMethod
(
obj
,
m_methOrdinal
);
jniExceptionCheck
(
env
);
return
res
;
...
...
@@ -222,6 +233,7 @@ JniLocalScope::~JniLocalScope() {
}
bool
JniLocalScope
::
_pushLocalFrame
(
JNIEnv
*
const
env
,
jint
capacity
)
{
DJINNI_ASSERT
(
capacity
>=
0
,
env
);
const
jint
push_res
=
env
->
PushLocalFrame
(
capacity
);
return
0
==
push_res
;
}
...
...
@@ -388,6 +400,7 @@ static void utf8_encode(char32_t pt, std::string & out) {
}
std
::
string
jniUTF8FromString
(
JNIEnv
*
env
,
const
jstring
jstr
)
{
DJINNI_ASSERT
(
jstr
,
env
);
const
jsize
length
=
env
->
GetStringLength
(
jstr
);
jniExceptionCheck
(
env
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment