a bit of cleanup

This commit is contained in:
Eric House 2020-12-06 21:27:12 -08:00
parent 1a231455f0
commit 858b6d3fbe
7 changed files with 28 additions and 30 deletions

View file

@ -206,7 +206,7 @@ and_dictionary_destroy( DictionaryCtxt* dict, XWEnv xwe )
{
AndDictionaryCtxt* ctxt = (AndDictionaryCtxt*)dict;
ASSERT_ENV( ctxt->ti, xwe );
XP_LOGF( "%s(dict=%p); code=%x", __func__, ctxt, ctxt->dbgid );
XP_LOGFF( "(dict=%p); code=%x", ctxt, ctxt->dbgid );
XP_U16 nSpecials = countSpecials( &ctxt->super );
JNIEnv* env = xwe;
@ -376,7 +376,7 @@ makeDict( MPFORMAL JNIEnv* env,
/* copy the name */
anddict->super.name = copyString( mpool, name );
XP_LOGF( "%s(dict=%p); code=%x; name=%s", __func__, anddict,
XP_LOGFF( "(dict=%p); code=%x; name=%s", anddict,
anddict->dbgid, anddict->super.name );
anddict->super.langName = getStringCopy( MPPARM(mpool)
env, jlangname );

View file

@ -487,8 +487,8 @@ getMethodID( JNIEnv* env, jobject obj, const char* proc, const char* sig )
#endif
jmethodID mid = (*env)->GetMethodID( env, cls, proc, sig );
if ( !mid ) {
XP_LOGF( "%s: no mid for proc %s, sig %s in object of class %s",
__func__, proc, sig, buf );
XP_LOGFF( "no mid for proc %s, sig %s in object of class %s",
proc, sig, buf );
}
XP_ASSERT( !!mid );
deleteLocalRef( env, cls );

View file

@ -379,7 +379,7 @@ and_draw_drawTimer( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect, XP_U16 player
XP_S16 secondsLeft, XP_Bool inDuplicateMode )
{
if ( rect->width == 0 ) {
XP_LOGF( "%s: exiting b/c rect empty", __func__ );
XP_LOGFF( "exiting b/c rect empty" );
} else {
DRAW_CBK_HEADER("drawTimer", "(Landroid/graphics/Rect;IIZ)V" );

View file

@ -112,7 +112,7 @@ and_util_getMD5SumForDict( JNIUtilCtxt* jniutil, JNIEnv* env, const XP_UCHAR* na
#ifdef DEBUG
if ( !!result ) {
const char* chars = (*env)->GetStringUTFChars( env, result, NULL );
XP_LOGF( "%s(%s, len=%d) => %s", __func__, name, len, chars );
XP_LOGFF( "(%s, len=%d) => %s", name, len, chars );
(*env)->ReleaseStringUTFChars( env, result, chars );
}
#endif

View file

@ -86,8 +86,7 @@ and_util_makeStreamFromAddr( XW_UtilCtxt* uc, XWEnv XP_UNUSED(xwe),
#define UTIL_CBK_TAIL() \
} else { \
XP_LOGF( "%s: skipping call into java because jutil==NULL", \
__func__ ); \
XP_LOGFF( "skipping call into java because jutil==NULL" ); \
}
#define DUTIL_CBK_HEADER(nam,sig) \
@ -135,7 +134,7 @@ and_util_userError( XW_UtilCtxt* uc, XWEnv xwe, UtilErrID id )
if ((*env)->ExceptionOccurred(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
XP_LOGF( "exception found" );
XP_LOGFF( "exception found" );
}
UTIL_CBK_TAIL();
}
@ -333,10 +332,10 @@ utilTimerFired( XW_UtilCtxt* uc, XWEnv xwe, XWTimerReason why, int handle )
if ( !!proc ) {
handled = (*proc)( timerStorage->closure, xwe, why );
} else {
XP_LOGF( "%s(why=%d): ERROR: no proc set", __func__, why );
XP_LOGFF( "(why=%d): ERROR: no proc set", why );
}
} else {
XP_LOGF( "%s: mismatch: handle=%d; timerStorage=%d", __func__,
XP_LOGFF( "mismatch: handle=%d; timerStorage=%d",
handle, (int)timerStorage );
}
return handled;
@ -454,10 +453,10 @@ and_dutil_getUserQuantityString( XW_DUtilCtxt* duc, XWEnv xwe,
int indx = 0;
for ( ; indx < MAX_QUANTITY_STRS; ++indx ) {
if ( !ptrs[indx] ) {
XP_LOGF( "%s: found empty slot %d for %s", __func__, indx, jchars );
XP_LOGFF( "found empty slot %d for %s", indx, jchars );
break;
} else if ( 0 == XP_STRCMP( jchars, ptrs[indx] ) ) {
XP_LOGF( "%s: found %s at slot %d", __func__, jchars, indx );
XP_LOGFF( "found %s at slot %d", jchars, indx );
break;
}
}
@ -731,9 +730,9 @@ and_dutil_getDevID( XW_DUtilCtxt* duc, XWEnv xwe, DevIDType* typ )
jsize len = (*env)->GetStringUTFLength( env, jresult );
if ( NULL != dutil->devIDStorage
&& 0 == XP_MEMCMP( dutil->devIDStorage, jchars, len ) ) {
XP_LOGF( "%s: already have matching devID", __func__ );
XP_LOGFF( "already have matching devID" );
} else {
XP_LOGF( "%s: allocating storage for devID", __func__ );
XP_LOGFF( "allocating storage for devID" );
XP_FREEP( dutil->dutil.mpool, &dutil->devIDStorage );
dutil->devIDStorage = XP_MALLOC( dutil->dutil.mpool, len + 1 );
XP_MEMCPY( dutil->devIDStorage, jchars, len );

View file

@ -75,7 +75,7 @@ and_xport_send( XWEnv xwe, const XP_U8* buf, XP_U16 len,
}
if ( result < len ) {
XP_LOGF( "%s(): changing result %d to -1", __func__, result );
XP_LOGFF( "changing result %d to -1", result );
result = -1; /* signal failure. Not sure where 0's coming from */
}

View file

@ -91,8 +91,8 @@ static MemPoolCtx*
getMPoolImpl( JNIGlobalState* globalState, const char* user )
{
if ( globalState->mpoolInUse ) {
XP_LOGF( "%s(): mpoolInUse ALREADY SET!!!! (by %s)",
__func__, globalState->mpoolUser );
XP_LOGFF( "mpoolInUse ALREADY SET!!!! (by %s)",
globalState->mpoolUser );
}
globalState->mpoolInUse = XP_TRUE;
globalState->mpoolUser = user;
@ -106,8 +106,7 @@ releaseMPool( JNIGlobalState* globalState )
{
// XP_ASSERT( globalState->mpoolInUse ); /* fired again!!! */
if ( !globalState->mpoolInUse ) {
XP_LOGF( "%s() line %d; ERROR ERROR ERROR mpoolInUse not set",
__func__, __LINE__ );
XP_LOGFF( "line %d; ERROR ERROR ERROR mpoolInUse not set", __LINE__ );
}
globalState->mpoolInUse = XP_FALSE;
}
@ -133,7 +132,7 @@ countUsed( const EnvThreadInfo* ti )
EnvThreadEntry* entry = &ti->entries[ii];
if ( 0 != entry->owner ) {
# ifdef LOG_MAPPING_ALL
XP_LOGF( "%s(): ii=%d; owner: %x", __func__, ii, (unsigned int)entry->owner );
XP_LOGFF( "ii=%d; owner: %x", ii, (unsigned int)entry->owner );
# endif
++count;
}
@ -292,7 +291,7 @@ envForMe( EnvThreadInfo* ti, const char* caller )
#ifdef DEBUG
if( !result ) {
pthread_t self = pthread_self();
XP_LOGF( "no env for %s (thread %x)", caller, (int)self );
XP_LOGFF( "no env for %s (thread %x)", caller, (int)self );
XP_ASSERT(0);
}
#endif
@ -354,8 +353,8 @@ getState( JNIEnv* env, GamePtrType gamePtr, const char* func )
{
#ifdef DEBUG
if ( NULL == gamePtr ) {
XP_LOGF( "ERROR: getState() called from %s() with null gamePtr",
func );
XP_LOGFF( "ERROR: getState() called from %s() with null gamePtr",
func );
}
#endif
XP_ASSERT( NULL != gamePtr ); /* fired */
@ -373,7 +372,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_globalsInit
{
#ifdef MEM_DEBUG
MemPoolCtx* mpool = mpool_make( NULL );
XP_LOGF( "%s(): ptr size: %zu", __func__, sizeof(mpool) );
XP_LOGFF( "ptr size: %zu", sizeof(mpool) );
#endif
int seed = (int)jseed;
XP_LOGFF( "calling srandom(seed %d)", seed );
@ -888,7 +887,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_gi_1from_1stream
&gi, NULL, NULL, NULL, NULL, NULL, NULL ) ) {
setJGI( env, jgi, &gi );
} else {
XP_LOGF( "%s: game_makeFromStream failed", __func__ );
XP_LOGFF( "game_makeFromStream failed" );
}
gi_disposePlayerInfo( MPPARM(mpool) &gi );
@ -939,7 +938,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_nli_1from_1stream
jnli = makeObjectEmptyConst( env, PKG_PATH("NetLaunchInfo") );
setNLI( env, jnli, &nli );
} else {
XP_LOGF( "%s: game_makeFromStream failed", __func__ );
XP_LOGFF( "game_makeFromStream failed" );
}
stream_destroy( stream, env );
@ -1282,7 +1281,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_smsproto_1prepInbound
(*env)->ReleaseStringUTFChars( env, jFromPhone, fromPhone );
(*env)->ReleaseByteArrayElements( env, jData, data, 0 );
} else {
XP_LOGF( "%s() => null (null input)", __func__ );
XP_LOGFF( " => null (null input)" );
}
return result;
}
@ -1389,7 +1388,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1makeNewGame
j_paths, j_lang );
#ifdef STUBBED_DICT
if ( !dict ) {
XP_LOGF( "falling back to stubbed dict" );
XP_LOGFF( "falling back to stubbed dict" );
dict = make_stubbed_dict( MPPARM_NOCOMMA(mpool) );
}
#endif
@ -2219,7 +2218,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1augmentHostAddr
getJAddrRec( env, &addr, jaddr );
comms_augmentHostAddr( state->game.comms, env, &addr );
} else {
XP_LOGF( "%s: no comms this game", __func__ );
XP_LOGFF( "no comms this game" );
}
XWJNI_END();
}