@@ -22,15 +22,18 @@ extern "C"
22
22
static jclass gStrCls ;
23
23
24
24
// / key is jobject, value is pai which contain jclass and reference count
25
- static std::map<jobject, std::pair<jclass, int >> objectGlobalReference;
25
+ static std::map<jobject, std::pair<jclass, int > > objectGlobalReference;
26
26
27
- void _addGlobalObject (jobject globalObject, jclass globalClass) {
27
+ void _addGlobalObject (jobject globalObject, jclass globalClass)
28
+ {
28
29
std::pair<jclass, int > objPair = std::make_pair (globalClass, 0 );
29
30
objectGlobalReference[globalObject] = objPair;
30
31
}
31
32
32
- jclass _getGlobalClass (jobject globalObject) {
33
- if (objectGlobalReference.find (globalObject) != objectGlobalReference.end ()) {
33
+ jclass _getGlobalClass (jobject globalObject)
34
+ {
35
+ if (objectGlobalReference.find (globalObject) != objectGlobalReference.end ())
36
+ {
34
37
std::pair<jclass, int > objPair = objectGlobalReference[globalObject];
35
38
return objPair.first ;
36
39
}
@@ -225,7 +228,7 @@ extern "C"
225
228
{
226
229
// / mark the last pointer as string
227
230
// / dart will check this pointer
228
- dataTypes[argumentCount] = (char *) " java.lang.String" ;
231
+ dataTypes[argumentCount] = (char *)" java.lang.String" ;
229
232
nativeInvokeResult = convertToDartUtf16 (env, (jstring)obj);
230
233
}
231
234
else
@@ -280,7 +283,8 @@ extern "C"
280
283
}
281
284
282
285
// / reference counter
283
- void _updateObjectReference (jobject globalObject, bool isRetain) {
286
+ void _updateObjectReference (jobject globalObject, bool isRetain)
287
+ {
284
288
DNDebug (" _updateObjectReference %s" , isRetain ? " retain" : " release" );
285
289
auto it = objectGlobalReference.find (globalObject);
286
290
if (it == objectGlobalReference.end ())
@@ -386,7 +390,7 @@ extern "C"
386
390
387
391
if (strcmp (dataTypes[i], " java.lang.String" ) == 0 )
388
392
{
389
- arguments[i] = (jstring) argument == nullptr ? reinterpret_cast <uint16_t *>((char *)" " )
393
+ arguments[i] = (jstring)argument == nullptr ? reinterpret_cast <uint16_t *>((char *)" " )
390
394
: convertToDartUtf16 (env, (jstring)argument);
391
395
}
392
396
else
@@ -414,7 +418,7 @@ extern "C"
414
418
415
419
const Work work = [dartObjectAddress, dataTypes, arguments, argumentCount, funName, &sem, isSemInitSuccess]() {
416
420
NativeMethodCallback methodCallback = getCallbackMethod (dartObjectAddress, funName);
417
- void *target = (void *) dartObjectAddress;
421
+ void *target = (void *)dartObjectAddress;
418
422
if (methodCallback != nullptr && target != nullptr )
419
423
{
420
424
methodCallback (target, funName, arguments, dataTypes, argumentCount);
@@ -440,7 +444,7 @@ extern "C"
440
444
}
441
445
else
442
446
{
443
- callbackResult = (jobject) arguments[argumentCount];
447
+ callbackResult = (jobject)arguments[argumentCount];
444
448
}
445
449
}
446
450
sem_destroy (&sem);
0 commit comments