Skip to content

Commit fee4fe5

Browse files
committed
refactor: rename argument type pointer
1 parent 8970098 commit fee4fe5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

dart_native/android/src/main/jni/dart_native.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,15 @@ extern "C"
108108
void _fillArgs(void **arguments, char **argumentTypes, jvalue *argValues, int argumentCount, uint32_t stringTypeBitmask)
109109
{
110110
JNIEnv *env = _getEnv();
111-
for (jsize index(0); index < argumentCount; ++arguments, ++index, ++argumentTypes)
111+
for (jsize index(0); index < argumentCount; ++arguments, ++index)
112112
{
113-
char *argType = *argumentTypes;
114113
/// check basic map convert
115-
auto it = basicTypeConvertMap.find(*argType);
114+
auto it = basicTypeConvertMap.find(*argumentTypes[index]);
116115

117116
if (it == basicTypeConvertMap.end())
118117
{
119118
/// when argument type is string or stringTypeBitmask mark as string
120-
if (strcmp(argType, "Ljava/lang/String;") == 0 || (stringTypeBitmask >> index & 0x1) == 1)
119+
if (strcmp(argumentTypes[index], "Ljava/lang/String;") == 0 || (stringTypeBitmask >> index & 0x1) == 1)
121120
{
122121
convertToJavaUtf16(env, *arguments, argValues, index);
123122
}
@@ -203,7 +202,7 @@ extern "C"
203202
{
204203
/// mark the last pointer as string
205204
/// dart will check this pointer
206-
*++dataTypes = (char *) "java/lang/String";
205+
dataTypes[argumentCount] = (char *) "java/lang/String";
207206
nativeInvokeResult = convertToDartUtf16(env, (jstring)obj);
208207
}
209208
else

0 commit comments

Comments
 (0)