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
e91fd99a
Commit
e91fd99a
authored
Sep 15, 2015
by
Jacob Potter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small cleanups to Java / JNI generators
parent
268b0201
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/source/JNIGenerator.scala
src/source/JNIGenerator.scala
+5
-5
src/source/JavaGenerator.scala
src/source/JavaGenerator.scala
+1
-1
No files found.
src/source/JNIGenerator.scala
View file @
e91fd99a
...
...
@@ -131,7 +131,7 @@ class JNIGenerator(spec: Spec) extends Generator(spec) {
w
.
wl
(
s
"const auto& data = ::djinni::JniClass<$jniHelper>::get();"
)
val
call
=
"auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject("
w
.
w
(
call
+
"data.clazz.get(), data.jconstructor"
)
if
(
!
r
.
fields
.
is
Empty
)
{
if
(
r
.
fields
.
non
Empty
)
{
w
.
wl
(
","
)
writeAlignedCall
(
w
,
" "
*
call
.
length
(),
r
.
fields
,
")}"
,
f
=>
{
val
name
=
idCpp
.
field
(
f
.
ident
)
...
...
@@ -167,11 +167,11 @@ class JNIGenerator(spec: Spec) extends Generator(spec) {
override
def
generateInterface
(
origin
:
String
,
ident
:
Ident
,
doc
:
Doc
,
typeParams
:
Seq
[
TypeParam
],
i
:
Interface
)
{
val
refs
=
new
JNIRefs
(
ident
.
name
)
i
.
methods
.
map
(
m
=>
{
m
.
params
.
map
(
p
=>
refs
.
find
(
p
.
ty
))
i
.
methods
.
foreach
(
m
=>
{
m
.
params
.
foreach
(
p
=>
refs
.
find
(
p
.
ty
))
m
.
ret
.
foreach
(
refs
.
find
)
})
i
.
consts
.
map
(
c
=>
{
i
.
consts
.
foreach
(
c
=>
{
refs
.
find
(
c
.
ty
)
})
...
...
@@ -258,7 +258,7 @@ class JNIGenerator(spec: Spec) extends Generator(spec) {
w
.
w
(
call
)
val
javaMethodName
=
idJava
.
method
(
m
.
ident
)
w
.
w
(
s
"getGlobalRef(), data.method_$javaMethodName"
)
if
(
!
m
.
params
.
is
Empty
){
if
(
m
.
params
.
non
Empty
){
w
.
wl
(
","
)
writeAlignedCall
(
w
,
" "
*
call
.
length
(),
m
.
params
,
")"
,
p
=>
{
val
param
=
jniMarshal
.
fromCpp
(
p
.
ty
,
"c_"
+
idCpp
.
local
(
p
.
ident
))
...
...
src/source/JavaGenerator.scala
View file @
e91fd99a
...
...
@@ -187,7 +187,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
w
.
wl
(
"super.finalize();"
)
}
for
(
m
<-
i
.
methods
if
!
m
.
static
)
{
// Static methods not in CppProxy
val
ret
=
marshal
.
returnType
(
m
.
ret
)
val
ret
=
marshal
.
returnType
(
m
.
ret
)
val
returnStmt
=
m
.
ret
.
fold
(
""
)(
_
=>
"return "
)
val
params
=
m
.
params
.
map
(
p
=>
marshal
.
paramType
(
p
.
ty
)
+
" "
+
idJava
.
local
(
p
.
ident
)).
mkString
(
", "
)
val
args
=
m
.
params
.
map
(
p
=>
idJava
.
local
(
p
.
ident
)).
mkString
(
", "
)
...
...
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