Skip to content

Commit

Permalink
Merge pull request #1593 from Sirox228/patch-2
Browse files Browse the repository at this point in the history
remove arguments limit in jni
  • Loading branch information
player-03 authored Apr 16, 2023
2 parents a440989 + 505d90b commit 9ebe6f3
Showing 1 changed file with 2 additions and 42 deletions.
44 changes: 2 additions & 42 deletions src/lime/system/JNI.hx
Original file line number Diff line number Diff line change
Expand Up @@ -48,52 +48,12 @@ class JNI

public static function callMember(method:Dynamic, jobject:Dynamic, a:Array<Dynamic>):Dynamic
{
switch (a.length)
{
case 0:
return method(jobject);
case 1:
return method(jobject, a[0]);
case 2:
return method(jobject, a[0], a[1]);
case 3:
return method(jobject, a[0], a[1], a[2]);
case 4:
return method(jobject, a[0], a[1], a[2], a[3]);
case 5:
return method(jobject, a[0], a[1], a[2], a[3], a[4]);
case 6:
return method(jobject, a[0], a[1], a[2], a[3], a[4], a[5]);
case 7:
return method(jobject, a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
default:
return null;
}
return Reflect.callMethod(null, method, [jobject].concat(a));
}

public static function callStatic(method:Dynamic, a:Array<Dynamic>):Dynamic
{
switch (a.length)
{
case 0:
return method();
case 1:
return method(a[0]);
case 2:
return method(a[0], a[1]);
case 3:
return method(a[0], a[1], a[2]);
case 4:
return method(a[0], a[1], a[2], a[3]);
case 5:
return method(a[0], a[1], a[2], a[3], a[4]);
case 6:
return method(a[0], a[1], a[2], a[3], a[4], a[5]);
case 7:
return method(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
default:
return null;
}
return Reflect.callMethod(null, method, a);
}

public static function createMemberField(className:String, memberName:String, signature:String):JNIMemberField
Expand Down

0 comments on commit 9ebe6f3

Please sign in to comment.