remove dead code

This commit is contained in:
Eric House 2022-12-18 18:50:05 -08:00
parent 3b6132d8a1
commit b179a0bade
4 changed files with 0 additions and 64 deletions

View file

@ -550,7 +550,6 @@ public class XwJNI {
boolean andAck ) {
return comms_resendAll( gamePtr, force, null, andAck );
}
public static native byte[][] comms_getPending( GamePtr gamePtr );
public static native int comms_countPendingPackets( GamePtr gamePtr );
public static native void comms_ackAny( GamePtr gamePtr );

View file

@ -2581,45 +2581,6 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1resendAll
return result;
}
typedef struct _GotOneClosure {
JNIEnv* env;
jbyteArray msgs[16];
int count;
} GotOneClosure;
static void
onGotOne( void* closure, XWEnv xwe, XP_U8* msg, XP_U16 len, MsgID XP_UNUSED(msgID) )
{
GotOneClosure* goc = (GotOneClosure*)closure;
XP_ASSERT( goc->env == xwe );
if ( goc->count < VSIZE(goc->msgs) ) {
jbyteArray arr = makeByteArray( xwe, len, (const jbyte*)msg );
goc->msgs[goc->count++] = arr;
} else {
XP_ASSERT( 0 );
}
}
JNIEXPORT jobjectArray JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_comms_1getPending
( JNIEnv* env, jclass C, GamePtrType gamePtr )
{
jobjectArray result = NULL;
XWJNI_START(gamePtr);
GotOneClosure goc = { .env = env, .count = 0 };
XP_ASSERT( !!state->game.comms );
comms_getPending( state->game.comms, env, onGotOne, &goc );
result = makeByteArrayArray( env, goc.count );
for ( int ii = 0; ii < goc.count; ++ii ) {
(*env)->SetObjectArrayElement( env, result, ii, goc.msgs[ii] );
deleteLocalRef( env, goc.msgs[ii] );
}
XWJNI_END();
return result;
}
JNIEXPORT jint JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_comms_1countPendingPackets
( JNIEnv* env, jclass C, GamePtrType gamePtr )

View file

@ -2107,27 +2107,6 @@ comms_resendAll( CommsCtxt* comms, XWEnv xwe, CommsConnType filter, XP_Bool forc
return result;
}
typedef struct _GetAllClosure{
PendingMsgProc proc;
void* closure;
} GetAllClosure;
static XP_S16
gatherMsgs( CommsCtxt* XP_UNUSED(comms), XWEnv xwe, MsgQueueElem* msg,
CommsConnType XP_UNUSED(filter), void* closure )
{
GetAllClosure* gac = (GetAllClosure*)closure;
(*gac->proc)( gac->closure, xwe, msg->msg, msg->len, msg->msgID );
return 1; /* 0 gets an assert */
}
void
comms_getPending( CommsCtxt* comms, XWEnv xwe, PendingMsgProc proc, void* closure )
{
GetAllClosure gac = { .proc = proc, .closure = closure };
(void)resendImpl( comms, xwe, COMMS_CONN_NONE, XP_TRUE, gatherMsgs, &gac );
}
#ifdef XWFEATURE_COMMSACK
static void
ackAnyImpl( CommsCtxt* comms, XWEnv xwe, XP_Bool force )

View file

@ -219,9 +219,6 @@ XP_S16 comms_send( CommsCtxt* comms, XWEnv xwe, XWStreamCtxt* stream );
XP_S16 comms_resendAll( CommsCtxt* comms, XWEnv xwe, CommsConnType filter,
XP_Bool force );
typedef void (*PendingMsgProc)( void* closure, XWEnv xwe, XP_U8* msg,
XP_U16 len, MsgID msgID );
void comms_getPending( CommsCtxt* comms, XWEnv xwe, PendingMsgProc proc, void* closure );
XP_U16 comms_getChannelSeed( CommsCtxt* comms );
#ifdef XWFEATURE_COMMSACK