diff --git a/DroidFish/jni/Android.mk b/DroidFish/jni/Android.mk index 9a19626..dc1091a 100644 --- a/DroidFish/jni/Android.mk +++ b/DroidFish/jni/Android.mk @@ -2,8 +2,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := jni -LOCAL_SRC_FILES := jni.cpp +LOCAL_MODULE := stockfishjni +LOCAL_SRC_FILES := stockfishjni.cpp LOCAL_CFLAGS := \ -mandroid \ diff --git a/DroidFish/jni/jni.cpp b/DroidFish/jni/stockfishjni.cpp similarity index 91% rename from DroidFish/jni/jni.cpp rename to DroidFish/jni/stockfishjni.cpp index 3f7a869..601da92 100644 --- a/DroidFish/jni/jni.cpp +++ b/DroidFish/jni/stockfishjni.cpp @@ -34,11 +34,11 @@ static int fdToChild = -1; static int childpid = -1; /* - * Class: org_petero_droidfish_engine_NativePipedProcess + * Class: org_petero_droidfish_engine_StockFishJNI * Method: startProcess * Signature: ()V */ -extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_NativePipedProcess_startProcess +extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_StockFishJNI_startProcess (JNIEnv* env, jobject obj) { if (childpid != -1) @@ -110,11 +110,11 @@ static bool getNextChar(int& c, int timeoutMillis) { static std::vector lineBuf; /* - * Class: org_petero_droidfish_engine_NativePipedProcess + * Class: org_petero_droidfish_engine_StockFishJNI * Method: readFromProcess * Signature: (I)Ljava/lang/String; */ -extern "C" JNIEXPORT jstring JNICALL Java_org_petero_droidfish_engine_NativePipedProcess_readFromProcess +extern "C" JNIEXPORT jstring JNICALL Java_org_petero_droidfish_engine_StockFishJNI_readFromProcess (JNIEnv* env, jobject obj, jint timeoutMillis) { struct timeval tv0, tv1; @@ -147,11 +147,11 @@ extern "C" JNIEXPORT jstring JNICALL Java_org_petero_droidfish_engine_NativePipe } /* - * Class: org_petero_droidfish_engine_NativePipedProcess + * Class: org_petero_droidfish_engine_StockFishJNI * Method: writeToProcess * Signature: (Ljava/lang/String;)V */ -extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_NativePipedProcess_writeToProcess +extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_StockFishJNI_writeToProcess (JNIEnv* env, jobject obj, jstring msg) { const char* str = (*env).GetStringUTFChars(msg, NULL); @@ -169,11 +169,11 @@ extern "C" JNIEXPORT void JNICALL Java_org_petero_droidfish_engine_NativePipedPr } /* - * Class: org_petero_droidfish_engine_NativePipedProcess + * Class: org_petero_droidfish_engine_StockFishJNI * Method: getNPhysicalProcessors * Signature: ()I */ -extern "C" JNIEXPORT jint JNICALL Java_org_petero_droidfish_engine_NativePipedProcess_getNPhysicalProcessors +extern "C" JNIEXPORT jint JNICALL Java_org_petero_droidfish_engine_StockFishJNI_getNPhysicalProcessors (JNIEnv *, jclass) { return sysconf(_SC_NPROCESSORS_ONLN); diff --git a/DroidFish/src/org/petero/droidfish/engine/DroidComputerPlayer.java b/DroidFish/src/org/petero/droidfish/engine/DroidComputerPlayer.java index cd91587..3e68c60 100644 --- a/DroidFish/src/org/petero/droidfish/engine/DroidComputerPlayer.java +++ b/DroidFish/src/org/petero/droidfish/engine/DroidComputerPlayer.java @@ -546,7 +546,7 @@ public class DroidComputerPlayer { if ("cuckoochess".equals(searchRequest.engine)) uciEngine = new CuckooChessEngine(); else - uciEngine = new NativePipedProcess(); + uciEngine = new StockFishJNI(); uciEngine.initialize(); engineMonitor = new Thread(new Runnable() { @@ -911,7 +911,7 @@ public class DroidComputerPlayer { nCPUsFromProc = nCPUs; } catch (IOException e) { } - int nCPUsFromOS = NativePipedProcess.getNPhysicalProcessors(); + int nCPUsFromOS = StockFishJNI.getNPhysicalProcessors(); return Math.max(nCPUsFromProc, nCPUsFromOS); } diff --git a/DroidFish/src/org/petero/droidfish/engine/NativePipedProcess.java b/DroidFish/src/org/petero/droidfish/engine/StockFishJNI.java similarity index 96% rename from DroidFish/src/org/petero/droidfish/engine/NativePipedProcess.java rename to DroidFish/src/org/petero/droidfish/engine/StockFishJNI.java index f3afc92..539e2a6 100644 --- a/DroidFish/src/org/petero/droidfish/engine/NativePipedProcess.java +++ b/DroidFish/src/org/petero/droidfish/engine/StockFishJNI.java @@ -18,9 +18,9 @@ package org.petero.droidfish.engine; -public class NativePipedProcess extends UCIEngineBase { +public class StockFishJNI extends UCIEngineBase { static { - System.loadLibrary("jni"); + System.loadLibrary("stockfishjni"); } @Override