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
1734c72e
Commit
1734c72e
authored
May 18, 2015
by
Jacob Potter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix local reference table overflow
parent
2aa776b9
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
14 additions
and
1 deletion
+14
-1
example/generated-src/jni/NativeItemList.cpp
example/generated-src/jni/NativeItemList.cpp
+1
-0
src/source/JNIGenerator.scala
src/source/JNIGenerator.scala
+1
-1
test-suite/generated-src/jni/NativeAssortedIntegers.cpp
test-suite/generated-src/jni/NativeAssortedIntegers.cpp
+1
-0
test-suite/generated-src/jni/NativeClientReturnedRecord.cpp
test-suite/generated-src/jni/NativeClientReturnedRecord.cpp
+1
-0
test-suite/generated-src/jni/NativeConstants.cpp
test-suite/generated-src/jni/NativeConstants.cpp
+1
-0
test-suite/generated-src/jni/NativeDateRecord.cpp
test-suite/generated-src/jni/NativeDateRecord.cpp
+1
-0
test-suite/generated-src/jni/NativeMapDateRecord.cpp
test-suite/generated-src/jni/NativeMapDateRecord.cpp
+1
-0
test-suite/generated-src/jni/NativeMapListRecord.cpp
test-suite/generated-src/jni/NativeMapListRecord.cpp
+1
-0
test-suite/generated-src/jni/NativeMapRecord.cpp
test-suite/generated-src/jni/NativeMapRecord.cpp
+1
-0
test-suite/generated-src/jni/NativeNestedCollection.cpp
test-suite/generated-src/jni/NativeNestedCollection.cpp
+1
-0
test-suite/generated-src/jni/NativePrimitiveList.cpp
test-suite/generated-src/jni/NativePrimitiveList.cpp
+1
-0
test-suite/generated-src/jni/NativeRecordWithDerivings.cpp
test-suite/generated-src/jni/NativeRecordWithDerivings.cpp
+1
-0
test-suite/generated-src/jni/NativeRecordWithNestedDerivings.cpp
...ite/generated-src/jni/NativeRecordWithNestedDerivings.cpp
+1
-0
test-suite/generated-src/jni/NativeSetRecord.cpp
test-suite/generated-src/jni/NativeSetRecord.cpp
+1
-0
No files found.
example/generated-src/jni/NativeItemList.cpp
View file @
1734c72e
...
@@ -19,6 +19,7 @@ auto NativeItemList::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Loca
...
@@ -19,6 +19,7 @@ auto NativeItemList::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Loca
}
}
auto
NativeItemList
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeItemList
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
2
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeItemList
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeItemList
>::
get
();
return
{
::
djinni
::
List
<::
djinni
::
String
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mItems
))};
return
{
::
djinni
::
List
<::
djinni
::
String
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mItems
))};
...
...
src/source/JNIGenerator.scala
View file @
1734c72e
...
@@ -148,7 +148,7 @@ class JNIGenerator(spec: Spec) extends Generator(spec) {
...
@@ -148,7 +148,7 @@ class JNIGenerator(spec: Spec) extends Generator(spec) {
w
.
wl
w
.
wl
writeJniTypeParams
(
w
,
params
)
writeJniTypeParams
(
w
,
params
)
w
.
w
(
s
"auto $jniHelperWithParams::toCpp(JNIEnv* jniEnv, JniType j) -> CppType"
).
braced
{
w
.
w
(
s
"auto $jniHelperWithParams::toCpp(JNIEnv* jniEnv, JniType j) -> CppType"
).
braced
{
//w.wl(s"::${spec.jniNamespace}::JniLocalScope jscope(jniEnv, 10
);")
w
.
wl
(
s
"::djinni::JniLocalScope jscope(jniEnv, ${r.fields.size + 1}
);"
)
w
.
wl
(
s
"assert(j != nullptr);"
)
w
.
wl
(
s
"assert(j != nullptr);"
)
if
(
r
.
fields
.
isEmpty
)
if
(
r
.
fields
.
isEmpty
)
w
.
wl
(
"(void)j; // Suppress warnings in release builds for empty records"
)
w
.
wl
(
"(void)j; // Suppress warnings in release builds for empty records"
)
...
...
test-suite/generated-src/jni/NativeAssortedIntegers.cpp
View file @
1734c72e
...
@@ -26,6 +26,7 @@ auto NativeAssortedIntegers::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djin
...
@@ -26,6 +26,7 @@ auto NativeAssortedIntegers::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djin
}
}
auto
NativeAssortedIntegers
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeAssortedIntegers
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
9
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeAssortedIntegers
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeAssortedIntegers
>::
get
();
return
{
::
djinni
::
I8
::
toCpp
(
jniEnv
,
jniEnv
->
GetByteField
(
j
,
data
.
field_mEight
)),
return
{
::
djinni
::
I8
::
toCpp
(
jniEnv
,
jniEnv
->
GetByteField
(
j
,
data
.
field_mEight
)),
...
...
test-suite/generated-src/jni/NativeClientReturnedRecord.cpp
View file @
1734c72e
...
@@ -21,6 +21,7 @@ auto NativeClientReturnedRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::
...
@@ -21,6 +21,7 @@ auto NativeClientReturnedRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::
}
}
auto
NativeClientReturnedRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeClientReturnedRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
4
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeClientReturnedRecord
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeClientReturnedRecord
>::
get
();
return
{
::
djinni
::
I64
::
toCpp
(
jniEnv
,
jniEnv
->
GetLongField
(
j
,
data
.
field_mRecordId
)),
return
{
::
djinni
::
I64
::
toCpp
(
jniEnv
,
jniEnv
->
GetLongField
(
j
,
data
.
field_mRecordId
)),
...
...
test-suite/generated-src/jni/NativeConstants.cpp
View file @
1734c72e
...
@@ -20,6 +20,7 @@ auto NativeConstants::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Loc
...
@@ -20,6 +20,7 @@ auto NativeConstants::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Loc
}
}
auto
NativeConstants
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeConstants
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
3
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeConstants
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeConstants
>::
get
();
return
{
::
djinni
::
I32
::
toCpp
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mSomeInteger
)),
return
{
::
djinni
::
I32
::
toCpp
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mSomeInteger
)),
...
...
test-suite/generated-src/jni/NativeDateRecord.cpp
View file @
1734c72e
...
@@ -19,6 +19,7 @@ auto NativeDateRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Lo
...
@@ -19,6 +19,7 @@ auto NativeDateRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Lo
}
}
auto
NativeDateRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeDateRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
2
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeDateRecord
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeDateRecord
>::
get
();
return
{
::
djinni
::
Date
::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mCreatedAt
))};
return
{
::
djinni
::
Date
::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mCreatedAt
))};
...
...
test-suite/generated-src/jni/NativeMapDateRecord.cpp
View file @
1734c72e
...
@@ -19,6 +19,7 @@ auto NativeMapDateRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni:
...
@@ -19,6 +19,7 @@ auto NativeMapDateRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni:
}
}
auto
NativeMapDateRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeMapDateRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
2
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeMapDateRecord
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeMapDateRecord
>::
get
();
return
{
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
Date
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mDatesById
))};
return
{
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
Date
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mDatesById
))};
...
...
test-suite/generated-src/jni/NativeMapListRecord.cpp
View file @
1734c72e
...
@@ -19,6 +19,7 @@ auto NativeMapListRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni:
...
@@ -19,6 +19,7 @@ auto NativeMapListRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni:
}
}
auto
NativeMapListRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeMapListRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
2
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeMapListRecord
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeMapListRecord
>::
get
();
return
{
::
djinni
::
List
<::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mMapList
))};
return
{
::
djinni
::
List
<::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mMapList
))};
...
...
test-suite/generated-src/jni/NativeMapRecord.cpp
View file @
1734c72e
...
@@ -19,6 +19,7 @@ auto NativeMapRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Loc
...
@@ -19,6 +19,7 @@ auto NativeMapRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Loc
}
}
auto
NativeMapRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeMapRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
2
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeMapRecord
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeMapRecord
>::
get
();
return
{
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mMap
))};
return
{
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mMap
))};
...
...
test-suite/generated-src/jni/NativeNestedCollection.cpp
View file @
1734c72e
...
@@ -19,6 +19,7 @@ auto NativeNestedCollection::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djin
...
@@ -19,6 +19,7 @@ auto NativeNestedCollection::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djin
}
}
auto
NativeNestedCollection
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeNestedCollection
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
2
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeNestedCollection
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeNestedCollection
>::
get
();
return
{
::
djinni
::
List
<::
djinni
::
Set
<::
djinni
::
String
>>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mSetList
))};
return
{
::
djinni
::
List
<::
djinni
::
Set
<::
djinni
::
String
>>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mSetList
))};
...
...
test-suite/generated-src/jni/NativePrimitiveList.cpp
View file @
1734c72e
...
@@ -19,6 +19,7 @@ auto NativePrimitiveList::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni:
...
@@ -19,6 +19,7 @@ auto NativePrimitiveList::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni:
}
}
auto
NativePrimitiveList
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativePrimitiveList
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
2
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativePrimitiveList
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativePrimitiveList
>::
get
();
return
{
::
djinni
::
List
<::
djinni
::
I64
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mList
))};
return
{
::
djinni
::
List
<::
djinni
::
I64
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mList
))};
...
...
test-suite/generated-src/jni/NativeRecordWithDerivings.cpp
View file @
1734c72e
...
@@ -20,6 +20,7 @@ auto NativeRecordWithDerivings::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::d
...
@@ -20,6 +20,7 @@ auto NativeRecordWithDerivings::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::d
}
}
auto
NativeRecordWithDerivings
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeRecordWithDerivings
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
3
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeRecordWithDerivings
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeRecordWithDerivings
>::
get
();
return
{
::
djinni
::
I32
::
toCpp
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mKey1
)),
return
{
::
djinni
::
I32
::
toCpp
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mKey1
)),
...
...
test-suite/generated-src/jni/NativeRecordWithNestedDerivings.cpp
View file @
1734c72e
...
@@ -21,6 +21,7 @@ auto NativeRecordWithNestedDerivings::fromCpp(JNIEnv* jniEnv, const CppType& c)
...
@@ -21,6 +21,7 @@ auto NativeRecordWithNestedDerivings::fromCpp(JNIEnv* jniEnv, const CppType& c)
}
}
auto
NativeRecordWithNestedDerivings
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeRecordWithNestedDerivings
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
3
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeRecordWithNestedDerivings
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeRecordWithNestedDerivings
>::
get
();
return
{
::
djinni
::
I32
::
toCpp
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mKey
)),
return
{
::
djinni
::
I32
::
toCpp
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mKey
)),
...
...
test-suite/generated-src/jni/NativeSetRecord.cpp
View file @
1734c72e
...
@@ -19,6 +19,7 @@ auto NativeSetRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Loc
...
@@ -19,6 +19,7 @@ auto NativeSetRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::Loc
}
}
auto
NativeSetRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
auto
NativeSetRecord
::
toCpp
(
JNIEnv
*
jniEnv
,
JniType
j
)
->
CppType
{
::
djinni
::
JniLocalScope
jscope
(
jniEnv
,
2
);
assert
(
j
!=
nullptr
);
assert
(
j
!=
nullptr
);
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeSetRecord
>::
get
();
const
auto
&
data
=
::
djinni
::
JniClass
<
NativeSetRecord
>::
get
();
return
{
::
djinni
::
Set
<::
djinni
::
String
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mSet
))};
return
{
::
djinni
::
Set
<::
djinni
::
String
>::
toCpp
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mSet
))};
...
...
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