mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
add assert and a debugging aid
This commit is contained in:
parent
5c40f175bb
commit
fad2c7b3c1
3 changed files with 14 additions and 4 deletions
|
@ -929,7 +929,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_nli_1from_1stream
|
||||||
jnli = makeObjectEmptyConst( env, PKG_PATH("NetLaunchInfo") );
|
jnli = makeObjectEmptyConst( env, PKG_PATH("NetLaunchInfo") );
|
||||||
setNLI( env, jnli, &nli );
|
setNLI( env, jnli, &nli );
|
||||||
} else {
|
} else {
|
||||||
XP_LOGFF( "game_makeFromStream failed" );
|
XP_LOGFF( "nli_makeFromStream failed" );
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_destroy( stream, env );
|
stream_destroy( stream, env );
|
||||||
|
@ -1303,8 +1303,17 @@ struct _JNIState {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GAME_GUARD 0x453627
|
#define GAME_GUARD 0x453627
|
||||||
|
#if 0
|
||||||
|
# define LOG_FUNC_IF() LOG_FUNC()
|
||||||
|
# define LOG_RETURN_VOID_IF() LOG_RETURN_VOID()
|
||||||
|
#else
|
||||||
|
# define LOG_FUNC_IF()
|
||||||
|
# define LOG_RETURN_VOID_IF()
|
||||||
|
#endif
|
||||||
|
|
||||||
#define XWJNI_START() { \
|
#define XWJNI_START() { \
|
||||||
JNIState* state = getState( env, gamePtr, __func__ ); \
|
JNIState* state = getState( env, gamePtr, __func__ ); \
|
||||||
|
LOG_FUNC_IF(); \
|
||||||
XP_ASSERT( state->guard == GAME_GUARD ); \
|
XP_ASSERT( state->guard == GAME_GUARD ); \
|
||||||
MPSLOT; \
|
MPSLOT; \
|
||||||
MPASSIGN( mpool, state->mpool ); \
|
MPASSIGN( mpool, state->mpool ); \
|
||||||
|
@ -1316,8 +1325,9 @@ struct _JNIState {
|
||||||
AndGameGlobals* globals = &state->globals; \
|
AndGameGlobals* globals = &state->globals; \
|
||||||
XP_USE(globals); /*no warnings */ \
|
XP_USE(globals); /*no warnings */ \
|
||||||
|
|
||||||
#define XWJNI_END() \
|
#define XWJNI_END() \
|
||||||
} \
|
LOG_RETURN_VOID_IF(); \
|
||||||
|
} \
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL
|
JNIEXPORT jlong JNICALL
|
||||||
Java_org_eehouse_android_xw4_jni_XwJNI_gameJNIInit
|
Java_org_eehouse_android_xw4_jni_XwJNI_gameJNIInit
|
||||||
|
|
|
@ -938,7 +938,6 @@ comms_stop( CommsCtxt* comms
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
LOG_FUNC();
|
|
||||||
if ( addr_hasType( &comms->selfAddr, COMMS_CONN_RELAY ) ) {
|
if ( addr_hasType( &comms->selfAddr, COMMS_CONN_RELAY ) ) {
|
||||||
relayDisconnect( comms, xwe );
|
relayDisconnect( comms, xwe );
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,6 +163,7 @@ stack_loadFromStream( StackCtxt* stack, XWStreamCtxt* stream )
|
||||||
if ( STREAM_VERS_NINETILES <= stream_getVersion(stream) ) {
|
if ( STREAM_VERS_NINETILES <= stream_getVersion(stream) ) {
|
||||||
stackVersion = stream_getU8( stream );
|
stackVersion = stream_getU8( stream );
|
||||||
XP_LOGFF( "read stackVersion: %d from stream", stackVersion );
|
XP_LOGFF( "read stackVersion: %d from stream", stackVersion );
|
||||||
|
XP_ASSERT( stackVersion <= CUR_STREAM_VERS );
|
||||||
}
|
}
|
||||||
stack->highWaterMark = stream_getU16( stream );
|
stack->highWaterMark = stream_getU16( stream );
|
||||||
stack->nEntries = stream_getU16( stream );
|
stack->nEntries = stream_getU16( stream );
|
||||||
|
|
Loading…
Add table
Reference in a new issue