add support for 64-bit ARM

Add a third processor type to the .so, and fix first compile-time
warnings and then a few dumb bugs based on assumptions about ptr sizes.
Works to play networked games and browse wordlists, but is not
extensively tested and needs to be before release.
This commit is contained in:
Eric House 2019-05-29 19:16:56 -07:00
parent ce26696a37
commit c72e97e0f6
10 changed files with 91 additions and 87 deletions

View file

@ -546,9 +546,10 @@ public class BoardCanvas extends Canvas implements DrawCtx {
} }
} }
public void dictChanged( final int newPtr ) @Override
public void dictChanged( final long newPtr )
{ {
int curPtr = m_dict.getDictPtr(); long curPtr = m_dict.getDictPtr();
if ( curPtr != newPtr ) { if ( curPtr != newPtr ) {
if ( 0 == newPtr ) { if ( 0 == newPtr ) {
m_fontDims = null; m_fontDims = null;

View file

@ -54,7 +54,7 @@ public class DictBrowseDelegate extends DelegateBase
private static final int MIN_LEN = 2; private static final int MIN_LEN = 2;
private Activity m_activity; private Activity m_activity;
private int m_dictClosure = 0; private long m_dictClosure = 0L;
private int m_lang; private int m_lang;
private String m_name; private String m_name;
private DictUtils.DictLoc m_loc; private DictUtils.DictLoc m_loc;

View file

@ -54,7 +54,7 @@ public class ThumbCanvas extends BoardCanvas {
// calling us. So don't switch threads for the dict_getChars() // calling us. So don't switch threads for the dict_getChars()
// call // call
@Override @Override
public void dictChanged( int dictPtr ) public void dictChanged( long dictPtr )
{ {
if ( 0 != dictPtr ) { if ( 0 != dictPtr ) {
m_fontDims = null; m_fontDims = null;

View file

@ -81,6 +81,6 @@ public interface DrawCtx {
void objFinished( /*BoardObjectType*/int typ, Rect rect ); void objFinished( /*BoardObjectType*/int typ, Rect rect );
void dictChanged( int dictPtr ); void dictChanged( long dictPtr );
} }

View file

@ -36,19 +36,19 @@ public class XwJNI {
private static final String TAG = XwJNI.class.getSimpleName(); private static final String TAG = XwJNI.class.getSimpleName();
public static class GamePtr implements AutoCloseable { public static class GamePtr implements AutoCloseable {
private int m_ptr = 0; private long m_ptr = 0;
private int m_refCount = 0; private int m_refCount = 0;
private long m_rowid; private long m_rowid;
private String mStack; private String mStack;
private GamePtr( int ptr, long rowid ) private GamePtr( long ptr, long rowid )
{ {
m_ptr = ptr; m_ptr = ptr;
m_rowid = rowid; m_rowid = rowid;
mStack = android.util.Log.getStackTraceString(new Exception()); mStack = android.util.Log.getStackTraceString(new Exception());
} }
public synchronized int ptr() public synchronized long ptr()
{ {
Assert.assertTrue( 0 != m_ptr ); Assert.assertTrue( 0 != m_ptr );
return m_ptr; return m_ptr;
@ -110,7 +110,7 @@ public class XwJNI {
return s_JNI; return s_JNI;
} }
private int m_ptr; private long m_ptr;
private XwJNI() private XwJNI()
{ {
m_ptr = initGlobals( new DUtilCtxt(), JNIUtilsImpl.get() ); m_ptr = initGlobals( new DUtilCtxt(), JNIUtilsImpl.get() );
@ -188,7 +188,7 @@ public class XwJNI {
private static GamePtr initGameJNI( long rowid ) private static GamePtr initGameJNI( long rowid )
{ {
int seed = Utils.nextRandomInt(); int seed = Utils.nextRandomInt();
int ptr = initGameJNI( getJNI().m_ptr, seed ); long ptr = initGameJNI( getJNI().m_ptr, seed );
GamePtr result = 0 == ptr ? null : new GamePtr( ptr, rowid ); GamePtr result = 0 == ptr ? null : new GamePtr( ptr, rowid );
return result; return result;
} }
@ -453,14 +453,14 @@ public class XwJNI {
// Dicts // Dicts
public static class DictWrapper { public static class DictWrapper {
private int m_dictPtr; private long m_dictPtr;
public DictWrapper() public DictWrapper()
{ {
m_dictPtr = 0; m_dictPtr = 0L;
} }
public DictWrapper( int dictPtr ) public DictWrapper( long dictPtr )
{ {
m_dictPtr = dictPtr; m_dictPtr = dictPtr;
dict_ref( dictPtr ); dict_ref( dictPtr );
@ -474,7 +474,7 @@ public class XwJNI {
} }
} }
public int getDictPtr() public long getDictPtr()
{ {
return m_dictPtr; return m_dictPtr;
} }
@ -487,64 +487,64 @@ public class XwJNI {
} }
} }
public static native boolean dict_tilesAreSame( int dict1, int dict2 ); public static native boolean dict_tilesAreSame( long dict1, long dict2 );
public static native String[] dict_getChars( int dict ); public static native String[] dict_getChars( long dict );
public static boolean dict_getInfo( byte[] dict, String name, String path, public static boolean dict_getInfo( byte[] dict, String name, String path,
boolean check, DictInfo info ) boolean check, DictInfo info )
{ {
return dict_getInfo( getJNI().m_ptr, dict, name, path, check, info ); return dict_getInfo( getJNI().m_ptr, dict, name, path, check, info );
} }
public static native int dict_getTileValue( int dictPtr, int tile ); public static native int dict_getTileValue( long dictPtr, int tile );
// Dict iterator // Dict iterator
public final static int MAX_COLS_DICT = 15; // from dictiter.h public final static int MAX_COLS_DICT = 15; // from dictiter.h
public static int dict_iter_init( byte[] dict, String name, public static long dict_iter_init( byte[] dict, String name,
String path ) String path )
{ {
return dict_iter_init( getJNI().m_ptr, dict, name, path ); return dict_iter_init( getJNI().m_ptr, dict, name, path );
} }
public static native void dict_iter_setMinMax( int closure, public static native void dict_iter_setMinMax( long closure,
int min, int max ); int min, int max );
public static native void dict_iter_destroy( int closure ); public static native void dict_iter_destroy( long closure );
public static native int dict_iter_wordCount( int closure ); public static native int dict_iter_wordCount( long closure );
public static native int[] dict_iter_getCounts( int closure ); public static native int[] dict_iter_getCounts( long closure );
public static native String dict_iter_nthWord( int closure, int nn ); public static native String dict_iter_nthWord( long closure, int nn );
public static native String[] dict_iter_getPrefixes( int closure ); public static native String[] dict_iter_getPrefixes( long closure );
public static native int[] dict_iter_getIndices( int closure ); public static native int[] dict_iter_getIndices( long closure );
public static native int dict_iter_getStartsWith( int closure, public static native int dict_iter_getStartsWith( long closure,
String prefix ); String prefix );
public static native String dict_iter_getDesc( int closure ); public static native String dict_iter_getDesc( long closure );
// Private methods -- called only here // Private methods -- called only here
private static native int initGlobals(DUtilCtxt dutil, JNIUtils jniu); private static native long initGlobals( DUtilCtxt dutil, JNIUtils jniu );
private static native void cleanGlobals( int jniState ); private static native void cleanGlobals( long jniState );
private static native byte[] gi_to_stream( int jniState, CurGameInfo gi ); private static native byte[] gi_to_stream( long jniState, CurGameInfo gi );
private static native void gi_from_stream( int jniState, CurGameInfo gi, private static native void gi_from_stream( long jniState, CurGameInfo gi,
byte[] stream ); byte[] stream );
private static native byte[] nli_to_stream( int jniState, NetLaunchInfo nli ); private static native byte[] nli_to_stream( long jniState, NetLaunchInfo nli );
private static native void nli_from_stream( int jniState, NetLaunchInfo nli, private static native void nli_from_stream( long jniState, NetLaunchInfo nli,
byte[] stream ); byte[] stream );
private static native int initGameJNI( int jniState, int seed ); private static native long initGameJNI( long jniState, int seed );
private static native void envDone( int globals ); private static native void envDone( long globals );
private static native void dict_ref( int dictPtr ); private static native void dict_ref( long dictPtr );
private static native void dict_unref( int dictPtr ); private static native void dict_unref( long dictPtr );
private static native boolean dict_getInfo( int jniState, byte[] dict, private static native boolean dict_getInfo( long jniState, byte[] dict,
String name, String path, String name, String path,
boolean check, boolean check,
DictInfo info ); DictInfo info );
private static native int dict_iter_init( int jniState, byte[] dict, private static native long dict_iter_init( long jniState, byte[] dict,
String name, String path ); String name, String path );
private static native byte[][] private static native byte[][]
smsproto_prepOutbound( int jniState, SMS_CMD cmd, int gameID, byte[] buf, smsproto_prepOutbound( long jniState, SMS_CMD cmd, int gameID, byte[] buf,
String phone, int port, boolean forceNow, String phone, int port, boolean forceNow,
/*out*/int[] waitSecs ); /*out*/int[] waitSecs );
private static native SMSProtoMsg[] smsproto_prepInbound( int jniState, private static native SMSProtoMsg[] smsproto_prepInbound( long jniState,
byte[] data, byte[] data,
String fromPhone, String fromPhone,
int wantPort); int wantPort);
private static native boolean haveEnv( int jniState ); private static native boolean haveEnv( long jniState );
} }

View file

@ -567,7 +567,7 @@ and_draw_dictChanged( DrawCtx* dctx, XP_S16 playerNum,
if ( code != draw->curLang ) { if ( code != draw->curLang ) {
draw->curLang = code; draw->curLang = code;
DRAW_CBK_HEADER( "dictChanged", "(I)V" ); DRAW_CBK_HEADER( "dictChanged", "(J)V" );
/* /\* create a DictWrapper object -- if the API changes to require it *\/ */ /* /\* create a DictWrapper object -- if the API changes to require it *\/ */
/* jclass rclass = (*env)->FindClass( env, PKG_PATH("jni/XwJNI$DictWrapper") ); */ /* jclass rclass = (*env)->FindClass( env, PKG_PATH("jni/XwJNI$DictWrapper") ); */
@ -576,7 +576,7 @@ and_draw_dictChanged( DrawCtx* dctx, XP_S16 playerNum,
/* jmethodID initId = (*env)->GetMethodID( env, rclass, "<init>", sig ); */ /* jmethodID initId = (*env)->GetMethodID( env, rclass, "<init>", sig ); */
/* jobject jdict = (*env)->NewObject( env, rclass, initId, (int)dict ); */ /* jobject jdict = (*env)->NewObject( env, rclass, initId, (int)dict ); */
(*env)->CallVoidMethod( env, draw->jdraw, mid, (jint)dict ); (*env)->CallVoidMethod( env, draw->jdraw, mid, (jlong)dict );
} }
} }
} }
@ -653,7 +653,7 @@ makeDraw( MPFORMAL EnvThreadInfo* ti, jobject jdraw )
draw->ti = ti; draw->ti = ti;
MPASSIGN( draw->mpool, mpool ); MPASSIGN( draw->mpool, mpool );
for ( int ii = 0; ii < sizeof(*draw->vtable)/4; ++ii ) { for ( int ii = 0; ii < sizeof(*draw->vtable)/sizeof(void*); ++ii ) {
((void**)(draw->vtable))[ii] = draw_doNothing; ((void**)(draw->vtable))[ii] = draw_doNothing;
} }

View file

@ -111,7 +111,7 @@ releaseMPool( JNIGlobalState* globalState )
#ifdef GAMEPTR_IS_OBJECT #ifdef GAMEPTR_IS_OBJECT
typedef jobject GamePtrType; typedef jobject GamePtrType;
#else #else
typedef int GamePtrType; typedef long GamePtrType;
#endif #endif
#ifdef LOG_MAPPING #ifdef LOG_MAPPING
@ -188,7 +188,7 @@ map_thread_prv( EnvThreadInfo* ti, JNIEnv* env, const char* caller )
firstEmpty->env = env; firstEmpty->env = env;
#ifdef LOG_MAPPING #ifdef LOG_MAPPING
firstEmpty->ownerFunc = caller; firstEmpty->ownerFunc = caller;
XP_LOGF( "%s: entry %d: mapped env %p to thread %x", __func__, XP_LOGF( "%s: entry %zu: mapped env %p to thread %x", __func__,
firstEmpty - ti->entries, env, (int)self ); firstEmpty - ti->entries, env, (int)self );
XP_LOGF( "%s: num entries USED now %d", __func__, countUsed(ti) ); XP_LOGF( "%s: num entries USED now %d", __func__, countUsed(ti) );
#endif #endif
@ -294,20 +294,21 @@ getState( JNIEnv* env, GamePtrType gamePtr, const char* func )
} }
#endif #endif
XP_ASSERT( NULL != gamePtr ); /* fired */ XP_ASSERT( NULL != gamePtr ); /* fired */
jmethodID mid = getMethodID( env, gamePtr, "ptr", "()I" ); jmethodID mid = getMethodID( env, gamePtr, "ptr", "()J" );
XP_ASSERT( !!mid ); XP_ASSERT( !!mid );
return (JNIState*)(*env)->CallIntMethod( env, gamePtr, mid ); return (JNIState*)(*env)->CallLongMethod( env, gamePtr, mid );
} }
#else #else
# define getState( env, gamePtr, func ) ((JNIState*)(gamePtr)) # define getState( env, gamePtr, func ) ((JNIState*)(gamePtr))
#endif #endif
JNIEXPORT jint JNICALL JNIEXPORT jlong JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_initGlobals Java_org_eehouse_android_xw4_jni_XwJNI_initGlobals
( JNIEnv* env, jclass C, jobject jdutil, jobject jniu ) ( JNIEnv* env, jclass C, jobject jdutil, jobject jniu )
{ {
#ifdef MEM_DEBUG #ifdef MEM_DEBUG
MemPoolCtx* mpool = mpool_make( NULL ); MemPoolCtx* mpool = mpool_make( NULL );
XP_LOGF( "%s(): ptr size: %zu", __func__, sizeof(mpool) );
#endif #endif
JNIGlobalState* globalState = (JNIGlobalState*)XP_CALLOC( mpool, JNIGlobalState* globalState = (JNIGlobalState*)XP_CALLOC( mpool,
sizeof(*globalState) ); sizeof(*globalState) );
@ -320,12 +321,12 @@ Java_org_eehouse_android_xw4_jni_XwJNI_initGlobals
globalState->smsProto = smsproto_init( MPPARM( mpool ) globalState->dutil ); globalState->smsProto = smsproto_init( MPPARM( mpool ) globalState->dutil );
MPASSIGN( globalState->mpool, mpool ); MPASSIGN( globalState->mpool, mpool );
// LOG_RETURNF( "%p", globalState ); // LOG_RETURNF( "%p", globalState );
return (jint)globalState; return (jlong)globalState;
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_cleanGlobals Java_org_eehouse_android_xw4_jni_XwJNI_cleanGlobals
( JNIEnv* env, jclass C, jint jniGlobalPtr ) ( JNIEnv* env, jclass C, jlong jniGlobalPtr )
{ {
// LOG_FUNC(); // LOG_FUNC();
if ( 0 != jniGlobalPtr ) { if ( 0 != jniGlobalPtr ) {
@ -589,7 +590,7 @@ streamFromJStream( MPFORMAL JNIEnv* env, VTableMgr* vtMgr, jbyteArray jstream )
****************************************************/ ****************************************************/
JNIEXPORT jbyteArray JNICALL JNIEXPORT jbyteArray JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_gi_1to_1stream Java_org_eehouse_android_xw4_jni_XwJNI_gi_1to_1stream
( JNIEnv* env, jclass C, jint jniGlobalPtr, jobject jgi ) ( JNIEnv* env, jclass C, jlong jniGlobalPtr, jobject jgi )
{ {
jbyteArray result; jbyteArray result;
JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr; JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr;
@ -611,7 +612,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_gi_1to_1stream
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_gi_1from_1stream Java_org_eehouse_android_xw4_jni_XwJNI_gi_1from_1stream
( JNIEnv* env, jclass C, jint jniGlobalPtr, jobject jgi, jbyteArray jstream ) ( JNIEnv* env, jclass C, jlong jniGlobalPtr, jobject jgi, jbyteArray jstream )
{ {
JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr; JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr;
#ifdef MEM_DEBUG #ifdef MEM_DEBUG
@ -637,7 +638,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_gi_1from_1stream
JNIEXPORT jbyteArray JNICALL JNIEXPORT jbyteArray JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_nli_1to_1stream Java_org_eehouse_android_xw4_jni_XwJNI_nli_1to_1stream
( JNIEnv* env, jclass C, jint jniGlobalPtr, jobject njli ) ( JNIEnv* env, jclass C, jlong jniGlobalPtr, jobject njli )
{ {
LOG_FUNC(); LOG_FUNC();
JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr; JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr;
@ -662,7 +663,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_nli_1to_1stream
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_nli_1from_1stream Java_org_eehouse_android_xw4_jni_XwJNI_nli_1from_1stream
( JNIEnv* env, jclass C, jint jniGlobalPtr, jobject jnli, jbyteArray jstream ) ( JNIEnv* env, jclass C, jlong jniGlobalPtr, jobject jnli, jbyteArray jstream )
{ {
LOG_FUNC(); LOG_FUNC();
JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr; JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr;
@ -717,7 +718,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1getUUID
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1ref Java_org_eehouse_android_xw4_jni_XwJNI_dict_1ref
( JNIEnv* env, jclass C, jint dictPtr ) ( JNIEnv* env, jclass C, jlong dictPtr )
{ {
if ( 0 != dictPtr ) { if ( 0 != dictPtr ) {
DictionaryCtxt* dict = (DictionaryCtxt*)dictPtr; DictionaryCtxt* dict = (DictionaryCtxt*)dictPtr;
@ -727,7 +728,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1ref
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1unref Java_org_eehouse_android_xw4_jni_XwJNI_dict_1unref
( JNIEnv* env, jclass C, jint dictPtr ) ( JNIEnv* env, jclass C, jlong dictPtr )
{ {
if ( 0 != dictPtr ) { if ( 0 != dictPtr ) {
DictionaryCtxt* dict = (DictionaryCtxt*)dictPtr; DictionaryCtxt* dict = (DictionaryCtxt*)dictPtr;
@ -737,7 +738,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1unref
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getInfo Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getInfo
( JNIEnv* env, jclass C, jint jniGlobalPtr, jbyteArray jDictBytes, ( JNIEnv* env, jclass C, jlong jniGlobalPtr, jbyteArray jDictBytes,
jstring jname, jstring jpath, jboolean check, jobject jinfo ) jstring jname, jstring jpath, jboolean check, jobject jinfo )
{ {
jboolean result = false; jboolean result = false;
@ -770,7 +771,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getInfo
/* Dictionary methods: don't use gamePtr */ /* Dictionary methods: don't use gamePtr */
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1tilesAreSame Java_org_eehouse_android_xw4_jni_XwJNI_dict_1tilesAreSame
( JNIEnv* env, jclass C, jint dictPtr1, jint dictPtr2 ) ( JNIEnv* env, jclass C, jlong dictPtr1, jlong dictPtr2 )
{ {
jboolean result; jboolean result;
const DictionaryCtxt* dict1 = (DictionaryCtxt*)dictPtr1; const DictionaryCtxt* dict1 = (DictionaryCtxt*)dictPtr1;
@ -783,7 +784,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1tilesAreSame
JNIEXPORT jobjectArray JNICALL JNIEXPORT jobjectArray JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getChars Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getChars
( JNIEnv* env, jclass C, jint dictPtr ) ( JNIEnv* env, jclass C, jlong dictPtr )
{ {
jobject result = NULL; jobject result = NULL;
result = and_dictionary_getChars( env, (DictionaryCtxt*)dictPtr ); result = and_dictionary_getChars( env, (DictionaryCtxt*)dictPtr );
@ -792,7 +793,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getChars
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getTileValue Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getTileValue
( JNIEnv* env, jclass C, jint dictPtr, jint tile ) ( JNIEnv* env, jclass C, jlong dictPtr, jint tile )
{ {
return dict_getTileValue( (DictionaryCtxt*)dictPtr, tile ); return dict_getTileValue( (DictionaryCtxt*)dictPtr, tile );
} }
@ -840,7 +841,7 @@ msgArrayToJMsgArray( JNIEnv* env, const SMSMsgArray* arr )
JNIEXPORT jobjectArray JNICALL JNIEXPORT jobjectArray JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_smsproto_1prepOutbound Java_org_eehouse_android_xw4_jni_XwJNI_smsproto_1prepOutbound
( JNIEnv* env, jclass C, jint jniGlobalPtr, jobject jCmd, jint jGameID, ( JNIEnv* env, jclass C, jlong jniGlobalPtr, jobject jCmd, jint jGameID,
jbyteArray jData, jstring jToPhone, jint jPort, jboolean jForce, jbyteArray jData, jstring jToPhone, jint jPort, jboolean jForce,
jintArray jWaitSecsArr ) jintArray jWaitSecsArr )
{ {
@ -878,7 +879,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_smsproto_1prepOutbound
JNIEXPORT jobjectArray JNICALL JNIEXPORT jobjectArray JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_smsproto_1prepInbound Java_org_eehouse_android_xw4_jni_XwJNI_smsproto_1prepInbound
( JNIEnv* env, jclass C, jint jniGlobalPtr, jbyteArray jData, ( JNIEnv* env, jclass C, jlong jniGlobalPtr, jbyteArray jData,
jstring jFromPhone, jint jWantPort ) jstring jFromPhone, jint jWantPort )
{ {
jobjectArray result = NULL; jobjectArray result = NULL;
@ -933,9 +934,9 @@ struct _JNIState {
#define XWJNI_END() \ #define XWJNI_END() \
} \ } \
JNIEXPORT jint JNICALL JNIEXPORT jlong JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_initGameJNI Java_org_eehouse_android_xw4_jni_XwJNI_initGameJNI
( JNIEnv* env, jclass C, int jniGlobalPtr, jint seed ) ( JNIEnv* env, jclass C, jlong jniGlobalPtr, jint seed )
{ {
#ifdef MEM_DEBUG #ifdef MEM_DEBUG
MemPoolCtx* mpool = ((JNIGlobalState*)jniGlobalPtr)->mpool; MemPoolCtx* mpool = ((JNIGlobalState*)jniGlobalPtr)->mpool;
@ -953,12 +954,12 @@ Java_org_eehouse_android_xw4_jni_XwJNI_initGameJNI
srandom( seed ); srandom( seed );
/* LOG_RETURNF( "%p", state ); */ /* LOG_RETURNF( "%p", state ); */
return (jint) state; return (jlong) state;
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_envDone Java_org_eehouse_android_xw4_jni_XwJNI_envDone
( JNIEnv* env, jclass C, int jniGlobalPtr ) ( JNIEnv* env, jclass C, jlong jniGlobalPtr )
{ {
JNIGlobalState* globalJNI = (JNIGlobalState*)jniGlobalPtr; JNIGlobalState* globalJNI = (JNIGlobalState*)jniGlobalPtr;
MAP_REMOVE( &globalJNI->ti, env ); MAP_REMOVE( &globalJNI->ti, env );
@ -2211,7 +2212,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1getAddrDisabled
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_haveEnv Java_org_eehouse_android_xw4_jni_XwJNI_haveEnv
( JNIEnv* env, jclass C, jint jniGlobalPtr ) ( JNIEnv* env, jclass C, jlong jniGlobalPtr )
{ {
JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr; JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr;
jboolean result = NULL != prvEnvForMe(&globalState->ti); jboolean result = NULL != prvEnvForMe(&globalState->ti);
@ -2263,12 +2264,12 @@ typedef struct _DictIterData {
static void makeIndex( DictIterData* data ); static void makeIndex( DictIterData* data );
static void freeIndices( DictIterData* data ); static void freeIndices( DictIterData* data );
JNIEXPORT jint JNICALL JNIEXPORT jlong JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1init Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1init
( JNIEnv* env, jclass C, jint jniGlobalPtr, jbyteArray jDictBytes, jstring jname, ( JNIEnv* env, jclass C, jlong jniGlobalPtr, jbyteArray jDictBytes,
jstring jpath ) jstring jname, jstring jpath )
{ {
jint closure = 0; jlong closure = 0;
JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr; JNIGlobalState* globalState = (JNIGlobalState*)jniGlobalPtr;
DictionaryCtxt* dict = makeDict( MPPARM(globalState->mpool) env, DictionaryCtxt* dict = makeDict( MPPARM(globalState->mpool) env,
@ -2284,14 +2285,14 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1init
#ifdef MEM_DEBUG #ifdef MEM_DEBUG
data->mpool = globalState->mpool; data->mpool = globalState->mpool;
#endif #endif
closure = (int)data; closure = (jlong)data;
} }
return closure; return closure;
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1setMinMax Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1setMinMax
( JNIEnv* env, jclass C, jint closure, jint min, jint max ) ( JNIEnv* env, jclass C, jlong closure, jint min, jint max )
{ {
DictIterData* data = (DictIterData*)closure; DictIterData* data = (DictIterData*)closure;
if ( NULL != data ) { if ( NULL != data ) {
@ -2303,7 +2304,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1setMinMax
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1destroy Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1destroy
( JNIEnv* env, jclass C, jint closure ) ( JNIEnv* env, jclass C, jlong closure )
{ {
DictIterData* data = (DictIterData*)closure; DictIterData* data = (DictIterData*)closure;
if ( NULL != data ) { if ( NULL != data ) {
@ -2320,7 +2321,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1destroy
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1wordCount Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1wordCount
(JNIEnv* env, jclass C, jint closure ) (JNIEnv* env, jclass C, jlong closure )
{ {
jint result = 0; jint result = 0;
DictIterData* data = (DictIterData*)closure; DictIterData* data = (DictIterData*)closure;
@ -2332,7 +2333,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1wordCount
JNIEXPORT jintArray JNICALL JNIEXPORT jintArray JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getCounts Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getCounts
(JNIEnv* env, jclass C, jint closure ) (JNIEnv* env, jclass C, jlong closure )
{ {
jintArray result = NULL; jintArray result = NULL;
DictIterData* data = (DictIterData*)closure; DictIterData* data = (DictIterData*)closure;
@ -2352,7 +2353,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getCounts
JNIEXPORT jobjectArray JNICALL JNIEXPORT jobjectArray JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getPrefixes Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getPrefixes
( JNIEnv* env, jclass C, jint closure ) ( JNIEnv* env, jclass C, jlong closure )
{ {
jobjectArray result = NULL; jobjectArray result = NULL;
DictIterData* data = (DictIterData*)closure; DictIterData* data = (DictIterData*)closure;
@ -2375,7 +2376,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getPrefixes
JNIEXPORT jintArray JNICALL JNIEXPORT jintArray JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getIndices Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getIndices
( JNIEnv* env, jclass C , jint closure ) ( JNIEnv* env, jclass C, jlong closure )
{ {
jintArray jindices = NULL; jintArray jindices = NULL;
DictIterData* data = (DictIterData*)closure; DictIterData* data = (DictIterData*)closure;
@ -2391,7 +2392,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getIndices
JNIEXPORT jstring JNICALL JNIEXPORT jstring JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1nthWord Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1nthWord
( JNIEnv* env, jclass C, jint closure, jint nn) ( JNIEnv* env, jclass C, jlong closure, jint nn)
{ {
jstring result = NULL; jstring result = NULL;
DictIterData* data = (DictIterData*)closure; DictIterData* data = (DictIterData*)closure;
@ -2407,7 +2408,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1nthWord
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getStartsWith Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getStartsWith
( JNIEnv* env, jclass C, jint closure, jstring jprefix ) ( JNIEnv* env, jclass C, jlong closure, jstring jprefix )
{ {
jint result = -1; jint result = -1;
DictIterData* data = (DictIterData*)closure; DictIterData* data = (DictIterData*)closure;
@ -2423,7 +2424,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getStartsWith
JNIEXPORT jstring JNICALL JNIEXPORT jstring JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getDesc Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1getDesc
( JNIEnv* env, jclass C, jint closure ) ( JNIEnv* env, jclass C, jlong closure )
{ {
jstring result = NULL; jstring result = NULL;
DictIterData* data = (DictIterData*)closure; DictIterData* data = (DictIterData*)closure;

View file

@ -3,7 +3,7 @@
set -e -u set -e -u
NODE=xw4 NODE=xw4
VARIANT=xw4 VARIANT=xw4NoSMS
CLASSPATH=${CLASSPATH:-""} CLASSPATH=${CLASSPATH:-""}
usage() { usage() {

View file

@ -42,7 +42,7 @@ if [ -n "$XWORDS_DEBUG_ARMONLY" ]; then
elif [ -n "$XWORDS_DEBUG_X86ONLY" ]; then elif [ -n "$XWORDS_DEBUG_X86ONLY" ]; then
echo "APP_ABI := x86" >> $TMP_MK echo "APP_ABI := x86" >> $TMP_MK
else else
echo "APP_ABI := armeabi x86" >> $TMP_MK echo "APP_ABI := armeabi arm64-v8a x86" >> $TMP_MK
fi fi
# echo "APP_OPTIM := debug" >> $TMP_MK # echo "APP_OPTIM := debug" >> $TMP_MK

View file

@ -2049,6 +2049,8 @@ dawg2dict( const LaunchParams* params, GSList* testDicts )
int int
main( int argc, char** argv ) main( int argc, char** argv )
{ {
XP_LOGF( "%s(): ptr size: %zu", __func__, sizeof(argv) );
int opt; int opt;
int totalPlayerCount = 0; int totalPlayerCount = 0;
XP_Bool isServer = XP_FALSE; XP_Bool isServer = XP_FALSE;