summaryrefslogtreecommitdiffstats
path: root/nxp
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-04-30 17:36:16 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-30 17:36:16 +0000
commit5a2a957ce07cafb60b649859cc326239b5c1ca55 (patch)
tree34fb76675519c0f84bad2ef51020cb87e520b2d4 /nxp
parent3b97ba7ee3a50c6d32ecc37052e5ba4f9e372adb (diff)
parent5f9671d0ff91bfd66dd84b2dcf57b21da4eecba9 (diff)
downloadandroid_packages_apps_Nfc-5a2a957ce07cafb60b649859cc326239b5c1ca55.tar.gz
android_packages_apps_Nfc-5a2a957ce07cafb60b649859cc326239b5c1ca55.tar.bz2
android_packages_apps_Nfc-5a2a957ce07cafb60b649859cc326239b5c1ca55.zip
am 5f9671d0: am 4f4e0ca5: am 99f3cc61: Merge "Fix warnings in the JNI code"
* commit '5f9671d0ff91bfd66dd84b2dcf57b21da4eecba9': Fix warnings in the JNI code
Diffstat (limited to 'nxp')
-rw-r--r--nxp/jni/com_android_nfc.cpp4
-rw-r--r--nxp/jni/com_android_nfc_NativeLlcpServiceSocket.cpp6
-rw-r--r--nxp/jni/com_android_nfc_NativeLlcpSocket.cpp2
-rw-r--r--nxp/jni/com_android_nfc_NativeNfcManager.cpp28
-rwxr-xr-xnxp/jni/com_android_nfc_NativeNfcSecureElement.cpp20
-rw-r--r--nxp/jni/com_android_nfc_NativeNfcTag.cpp18
-rw-r--r--nxp/jni/com_android_nfc_NativeP2pDevice.cpp6
7 files changed, 43 insertions, 41 deletions
diff --git a/nxp/jni/com_android_nfc.cpp b/nxp/jni/com_android_nfc.cpp
index 86e30194..f9e42dda 100644
--- a/nxp/jni/com_android_nfc.cpp
+++ b/nxp/jni/com_android_nfc.cpp
@@ -25,7 +25,7 @@
/*
* JNI Initialization
*/
-jint JNI_OnLoad(JavaVM *jvm, void *reserved)
+jint JNI_OnLoad(JavaVM *jvm, void* /*reserved*/)
{
JNIEnv *e;
@@ -160,7 +160,7 @@ struct nfc_jni_native_data* nfc_jni_get_nat(JNIEnv *e, jobject o)
return (struct nfc_jni_native_data*) e->GetLongField(o, f);
}
-struct nfc_jni_native_data* nfc_jni_get_nat_ext(JNIEnv *e)
+struct nfc_jni_native_data* nfc_jni_get_nat_ext(JNIEnv*)
{
return exported_nat;
}
diff --git a/nxp/jni/com_android_nfc_NativeLlcpServiceSocket.cpp b/nxp/jni/com_android_nfc_NativeLlcpServiceSocket.cpp
index 406079c8..e73df3e0 100644
--- a/nxp/jni/com_android_nfc_NativeLlcpServiceSocket.cpp
+++ b/nxp/jni/com_android_nfc_NativeLlcpServiceSocket.cpp
@@ -47,7 +47,7 @@ static phLibNfc_Handle getIncomingSocket(nfc_jni_native_monitor_t * pMonitor,
phLibNfc_Handle hServerSocket)
{
nfc_jni_listen_data_t * pListenData;
- phLibNfc_Handle pIncomingSocket = NULL;
+ phLibNfc_Handle pIncomingSocket = (phLibNfc_Handle)NULL;
/* Look for a pending incoming connection on the current server */
LIST_FOREACH(pListenData, &pMonitor->incoming_socket_head, entries)
@@ -80,6 +80,8 @@ static jobject com_NativeLlcpServiceSocket_doAccept(JNIEnv *e, jobject o, jint m
phLibNfc_Handle hIncomingSocket, hServerSocket;
nfc_jni_native_monitor_t * pMonitor = nfc_jni_get_monitor();
+ hIncomingSocket = (phLibNfc_Handle)NULL;
+
/* Create the local semaphore */
if (!nfc_cb_data_init(&cb_data, NULL))
{
@@ -101,7 +103,7 @@ static jobject com_NativeLlcpServiceSocket_doAccept(JNIEnv *e, jobject o, jint m
{
/* Wait for tag Notification */
pthread_mutex_lock(&pMonitor->incoming_socket_mutex);
- while ((hIncomingSocket = getIncomingSocket(pMonitor, hServerSocket)) == NULL) {
+ while ((hIncomingSocket = getIncomingSocket(pMonitor, hServerSocket)) == (phLibNfc_Handle)NULL) {
pthread_cond_wait(&pMonitor->incoming_socket_cond, &pMonitor->incoming_socket_mutex);
}
pthread_mutex_unlock(&pMonitor->incoming_socket_mutex);
diff --git a/nxp/jni/com_android_nfc_NativeLlcpSocket.cpp b/nxp/jni/com_android_nfc_NativeLlcpSocket.cpp
index 91a72a50..6a0fda28 100644
--- a/nxp/jni/com_android_nfc_NativeLlcpSocket.cpp
+++ b/nxp/jni/com_android_nfc_NativeLlcpSocket.cpp
@@ -167,7 +167,7 @@ static jboolean com_android_nfc_NativeLlcpSocket_doConnectBy(JNIEnv *e, jobject
{
NFCSTATUS ret;
struct timespec ts;
- phNfc_sData_t serviceName = {0};
+ phNfc_sData_t serviceName = {NULL, 0};
phLibNfc_Handle hRemoteDevice;
phLibNfc_Handle hLlcpSocket;
struct nfc_jni_callback_data cb_data;
diff --git a/nxp/jni/com_android_nfc_NativeNfcManager.cpp b/nxp/jni/com_android_nfc_NativeNfcManager.cpp
index 92ca65ac..4abc7e52 100644
--- a/nxp/jni/com_android_nfc_NativeNfcManager.cpp
+++ b/nxp/jni/com_android_nfc_NativeNfcManager.cpp
@@ -116,7 +116,7 @@ static void kill_client(nfc_jni_native_data *nat)
phDal4Nfc_msgsnd(gDrvCfg.nClientId, (struct msgbuf *)&wrapper, sizeof(phLibNfc_Message_t), 0);
}
-static void nfc_jni_ioctl_callback(void *pContext, phNfc_sData_t *pOutput, NFCSTATUS status) {
+static void nfc_jni_ioctl_callback(void *pContext, phNfc_sData_t* /*pOutput*/, NFCSTATUS status) {
struct nfc_jni_callback_data * pCallbackData = (struct nfc_jni_callback_data *) pContext;
LOG_CALLBACK("nfc_jni_ioctl_callback", status);
@@ -276,7 +276,7 @@ clean_and_return:
return result;
}
-static int nfc_jni_unconfigure_driver(struct nfc_jni_native_data *nat)
+static int nfc_jni_unconfigure_driver(struct nfc_jni_native_data* /*nat*/)
{
int result = FALSE;
NFCSTATUS status;
@@ -603,7 +603,7 @@ static int is_user_build() {
* Last-chance fallback when there is no clean way to recover
* Performs a software reset
*/
-void emergency_recovery(struct nfc_jni_native_data *nat) {
+void emergency_recovery(struct nfc_jni_native_data* /*nat*/) {
if (is_user_build()) {
ALOGE("emergency_recovery: force restart of NFC service");
} else {
@@ -1119,7 +1119,7 @@ static void nfc_jni_deinit_callback(void *pContext, NFCSTATUS status)
/* Set Secure Element mode callback*/
static void nfc_jni_smartMX_setModeCb (void* pContext,
- phLibNfc_Handle hSecureElement,
+ phLibNfc_Handle /*hSecureElement*/,
NFCSTATUS status)
{
struct nfc_jni_callback_data * pContextData = (struct nfc_jni_callback_data*)pContext;
@@ -1132,7 +1132,7 @@ static void nfc_jni_smartMX_setModeCb (void* pContext,
/* Card Emulation callback */
static void nfc_jni_transaction_callback(void *context,
- phLibNfc_eSE_EvtType_t evt_type, phLibNfc_Handle handle,
+ phLibNfc_eSE_EvtType_t evt_type, phLibNfc_Handle /*handle*/,
phLibNfc_uSeEvtInfo_t *evt_info, NFCSTATUS status)
{
JNIEnv *e;
@@ -1296,7 +1296,7 @@ static void nfc_jni_transaction_callback(void *context,
}
static void nfc_jni_se_set_mode_callback(void *pContext,
- phLibNfc_Handle handle, NFCSTATUS status)
+ phLibNfc_Handle /*handle*/, NFCSTATUS status)
{
struct nfc_jni_callback_data * pContextData = (struct nfc_jni_callback_data*)pContext;
@@ -1494,7 +1494,7 @@ clean_and_return:
CONCURRENCY_UNLOCK();
}
-static void com_android_nfc_NfcManager_doResetTimeouts( JNIEnv *e, jobject o) {
+static void com_android_nfc_NfcManager_doResetTimeouts(JNIEnv*, jobject) {
CONCURRENCY_LOCK();
nfc_jni_reset_timeout_values();
CONCURRENCY_UNLOCK();
@@ -1570,7 +1570,7 @@ static void setNfcATimeout(jint timeout) {
}
}
-static bool com_android_nfc_NfcManager_doSetTimeout( JNIEnv *e, jobject o,
+static bool com_android_nfc_NfcManager_doSetTimeout(JNIEnv*, jobject,
jint tech, jint timeout) {
bool success = false;
CONCURRENCY_LOCK();
@@ -1604,7 +1604,7 @@ static bool com_android_nfc_NfcManager_doSetTimeout( JNIEnv *e, jobject o,
return success;
}
-static jint com_android_nfc_NfcManager_doGetTimeout( JNIEnv *e, jobject o,
+static jint com_android_nfc_NfcManager_doGetTimeout(JNIEnv*, jobject,
jint tech) {
int timeout = -1;
CONCURRENCY_LOCK();
@@ -1860,7 +1860,7 @@ static jboolean com_android_nfc_NfcManager_deinitialize(JNIEnv *e, jobject o)
}
/* Secure Element methods */
-static jintArray com_android_nfc_NfcManager_doGetSecureElementList(JNIEnv *e, jobject o) {
+static jintArray com_android_nfc_NfcManager_doGetSecureElementList(JNIEnv *e, jobject) {
NFCSTATUS ret;
phLibNfc_SE_List_t se_list[PHLIBNFC_MAXNO_OF_SE];
uint8_t i, se_count = PHLIBNFC_MAXNO_OF_SE;
@@ -2059,7 +2059,7 @@ clean_and_return:
return result;
}
-static jboolean com_android_nfc_NfcManager_doActivateLlcp(JNIEnv *e, jobject o)
+static jboolean com_android_nfc_NfcManager_doActivateLlcp(JNIEnv*, jobject)
{
NFCSTATUS ret;
TRACE("phLibNfc_Llcp_Activate(hRemoteDevice=0x%08x)", hLlcpHandle);
@@ -2418,7 +2418,7 @@ static jobject com_android_nfc_NfcManager_doCreateLlcpSocket(JNIEnv *e, jobject
return clientSocket;
}
-static jint com_android_nfc_NfcManager_doGetLastError(JNIEnv *e, jobject o)
+static jint com_android_nfc_NfcManager_doGetLastError(JNIEnv*, jobject)
{
TRACE("Last Error Status = 0x%02x",lastErrorStatus);
@@ -2436,7 +2436,7 @@ static jint com_android_nfc_NfcManager_doGetLastError(JNIEnv *e, jobject o)
}
}
-static void com_android_nfc_NfcManager_doAbort(JNIEnv *e, jobject o)
+static void com_android_nfc_NfcManager_doAbort(JNIEnv*, jobject)
{
emergency_recovery(NULL);
}
@@ -2604,7 +2604,7 @@ static jboolean com_android_nfc_NfcManager_doDownload(JNIEnv *e, jobject o)
return performDownload(nat, true);
}
-static jstring com_android_nfc_NfcManager_doDump(JNIEnv *e, jobject o)
+static jstring com_android_nfc_NfcManager_doDump(JNIEnv *e, jobject)
{
char buffer[100];
snprintf(buffer, sizeof(buffer), "libnfc llc error_count=%u", libnfc_llc_error_count);
diff --git a/nxp/jni/com_android_nfc_NativeNfcSecureElement.cpp b/nxp/jni/com_android_nfc_NativeNfcSecureElement.cpp
index 9e0a6e23..a3a1000f 100755
--- a/nxp/jni/com_android_nfc_NativeNfcSecureElement.cpp
+++ b/nxp/jni/com_android_nfc_NativeNfcSecureElement.cpp
@@ -49,7 +49,7 @@ static void com_android_nfc_jni_ioctl_callback ( void* pContext,
}
static void com_android_nfc_jni_transceive_callback(void *pContext,
- phLibNfc_Handle handle, phNfc_sData_t *pResBuffer, NFCSTATUS status)
+ phLibNfc_Handle /*handle*/, phNfc_sData_t *pResBuffer, NFCSTATUS status)
{
struct nfc_jni_callback_data * pContextData = (struct nfc_jni_callback_data*)pContext;
@@ -62,8 +62,8 @@ static void com_android_nfc_jni_transceive_callback(void *pContext,
static void com_android_nfc_jni_connect_callback(void *pContext,
- phLibNfc_Handle hRemoteDev,
- phLibNfc_sRemoteDevInformation_t *psRemoteDevInfo, NFCSTATUS status)
+ phLibNfc_Handle /*hRemoteDev*/,
+ phLibNfc_sRemoteDevInformation_t* /*psRemoteDevInfo*/, NFCSTATUS status)
{
struct nfc_jni_callback_data * pContextData = (struct nfc_jni_callback_data*)pContext;
@@ -74,7 +74,7 @@ static void com_android_nfc_jni_connect_callback(void *pContext,
}
static void com_android_nfc_jni_disconnect_callback(void *pContext,
- phLibNfc_Handle hRemoteDev,
+ phLibNfc_Handle /*hRemoteDev*/,
NFCSTATUS status)
{
struct nfc_jni_callback_data * pContextData = (struct nfc_jni_callback_data*)pContext;
@@ -87,7 +87,7 @@ static void com_android_nfc_jni_disconnect_callback(void *pContext,
/* Set Secure Element mode callback*/
static void com_android_nfc_jni_smartMX_setModeCb (void* pContext,
- phLibNfc_Handle hSecureElement,
+ phLibNfc_Handle /*hSecureElement*/,
NFCSTATUS status)
{
struct nfc_jni_callback_data * pContextData = (struct nfc_jni_callback_data*)pContext;
@@ -175,7 +175,7 @@ clean_and_return:
}
-static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection(JNIEnv *e, jobject o)
+static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection(JNIEnv*, jobject)
{
NFCSTATUS ret;
int semResult;
@@ -471,7 +471,7 @@ clean_and_return:
}
-static jboolean com_android_nfc_NativeNfcSecureElement_doDisconnect(JNIEnv *e, jobject o, jint handle)
+static jboolean com_android_nfc_NativeNfcSecureElement_doDisconnect(JNIEnv*, jobject, jint handle)
{
jclass cls;
jfieldID f;
@@ -606,7 +606,7 @@ clean_and_return:
}
static jbyteArray com_android_nfc_NativeNfcSecureElement_doTransceive(JNIEnv *e,
- jobject o,jint handle, jbyteArray data)
+ jobject,jint handle, jbyteArray data)
{
uint8_t offset = 0;
uint8_t *buf;
@@ -707,7 +707,7 @@ clean_and_return:
return result;
}
-static jbyteArray com_android_nfc_NativeNfcSecureElement_doGetUid(JNIEnv *e, jobject o, jint handle)
+static jbyteArray com_android_nfc_NativeNfcSecureElement_doGetUid(JNIEnv *e, jobject, jint handle)
{
TRACE("Get Secure element UID function ");
jbyteArray SecureElementUid;
@@ -724,7 +724,7 @@ static jbyteArray com_android_nfc_NativeNfcSecureElement_doGetUid(JNIEnv *e, job
}
}
-static jintArray com_android_nfc_NativeNfcSecureElement_doGetTechList(JNIEnv *e, jobject o, jint handle)
+static jintArray com_android_nfc_NativeNfcSecureElement_doGetTechList(JNIEnv *e, jobject, jint handle)
{
jintArray techList;
TRACE("Get Secure element Type function ");
diff --git a/nxp/jni/com_android_nfc_NativeNfcTag.cpp b/nxp/jni/com_android_nfc_NativeNfcTag.cpp
index 2badff42..3fb98fce 100644
--- a/nxp/jni/com_android_nfc_NativeNfcTag.cpp
+++ b/nxp/jni/com_android_nfc_NativeNfcTag.cpp
@@ -50,7 +50,7 @@ extern void nfc_jni_reset_timeout_values();
}
static void nfc_jni_connect_callback(void *pContext,
- phLibNfc_Handle hRemoteDev,
+ phLibNfc_Handle /*hRemoteDev*/,
phLibNfc_sRemoteDevInformation_t *psRemoteDevInfo, NFCSTATUS status)
{
struct nfc_jni_callback_data * pCallbackData = (struct nfc_jni_callback_data *) pContext;
@@ -98,7 +98,7 @@ static void nfc_jni_checkndef_callback(void *pContext,
}
static void nfc_jni_disconnect_callback(void *pContext,
- phLibNfc_Handle hRemoteDev, NFCSTATUS status)
+ phLibNfc_Handle /*hRemoteDev*/, NFCSTATUS status)
{
struct nfc_jni_callback_data * pCallbackData = (struct nfc_jni_callback_data *) pContext;
LOG_CALLBACK("nfc_jni_disconnect_callback", status);
@@ -115,8 +115,8 @@ static void nfc_jni_disconnect_callback(void *pContext,
sem_post(&pCallbackData->sem);
}
-static void nfc_jni_async_disconnect_callback(void *pContext,
- phLibNfc_Handle hRemoteDev, NFCSTATUS status)
+static void nfc_jni_async_disconnect_callback(void * /*pContext*/,
+ phLibNfc_Handle /*hRemoteDev*/, NFCSTATUS status)
{
LOG_CALLBACK("nfc_jni_async_disconnect_callback", status);
@@ -131,7 +131,7 @@ static void nfc_jni_async_disconnect_callback(void *pContext,
static phNfc_sData_t *nfc_jni_transceive_buffer;
static void nfc_jni_transceive_callback(void *pContext,
- phLibNfc_Handle handle, phNfc_sData_t *pResBuffer, NFCSTATUS status)
+ phLibNfc_Handle /*handle*/, phNfc_sData_t *pResBuffer, NFCSTATUS status)
{
struct nfc_jni_callback_data * pCallbackData = (struct nfc_jni_callback_data *) pContext;
LOG_CALLBACK("nfc_jni_transceive_callback", status);
@@ -492,8 +492,8 @@ clean_and_return:
return status;
}
-static jint com_android_nfc_NativeNfcTag_doHandleReconnect(JNIEnv *e,
- jobject o, phLibNfc_Handle handle)
+static jint com_android_nfc_NativeNfcTag_doHandleReconnect(JNIEnv*,
+ jobject, phLibNfc_Handle handle)
{
jint status;
struct nfc_jni_callback_data cb_data;
@@ -589,7 +589,7 @@ static jboolean com_android_nfc_NativeNfcTag_doDisconnect(JNIEnv *e, jobject o)
/* Disconnect */
TRACE("Disconnecting from tag (%x)", handle);
- if (handle == -1) {
+ if (handle == (phLibNfc_Handle)-1) {
// Was never connected to any tag, exit
result = JNI_TRUE;
ALOGE("doDisconnect() - Target already disconnected");
@@ -892,7 +892,7 @@ clean_and_return:
return result;
}
-static jint com_android_nfc_NativeNfcTag_doGetNdefType(JNIEnv *e, jobject o,
+static jint com_android_nfc_NativeNfcTag_doGetNdefType(JNIEnv*, jobject,
jint libnfcType, jint javaType)
{
jint ndefType = NDEF_UNKNOWN_TYPE;
diff --git a/nxp/jni/com_android_nfc_NativeP2pDevice.cpp b/nxp/jni/com_android_nfc_NativeP2pDevice.cpp
index 19f3ecc8..2f4a5b20 100644
--- a/nxp/jni/com_android_nfc_NativeP2pDevice.cpp
+++ b/nxp/jni/com_android_nfc_NativeP2pDevice.cpp
@@ -41,7 +41,7 @@ static void nfc_jni_presence_check_callback(void* pContext, NFCSTATUS status)
}
static void nfc_jni_connect_callback(void *pContext,
- phLibNfc_Handle hRemoteDev,
+ phLibNfc_Handle /*hRemoteDev*/,
phLibNfc_sRemoteDevInformation_t *psRemoteDevInfo, NFCSTATUS status)
{
struct nfc_jni_callback_data * pCallbackData = (struct nfc_jni_callback_data *) pContext;
@@ -60,7 +60,7 @@ static void nfc_jni_connect_callback(void *pContext,
sem_post(&pCallbackData->sem);
}
-static void nfc_jni_disconnect_callback(void *pContext, phLibNfc_Handle hRemoteDev, NFCSTATUS status)
+static void nfc_jni_disconnect_callback(void *pContext, phLibNfc_Handle /*hRemoteDev*/, NFCSTATUS status)
{
struct nfc_jni_callback_data * pCallbackData = (struct nfc_jni_callback_data *) pContext;
LOG_CALLBACK("nfc_jni_disconnect_callback", status);
@@ -105,7 +105,7 @@ static void nfc_jni_send_callback(void *pContext, NFCSTATUS status)
*/
static void nfc_jni_transceive_callback(void *pContext,
- phLibNfc_Handle handle, phNfc_sData_t *pResBuffer, NFCSTATUS status)
+ phLibNfc_Handle /*handle*/, phNfc_sData_t *pResBuffer, NFCSTATUS status)
{
struct nfc_jni_callback_data * pCallbackData = (struct nfc_jni_callback_data *) pContext;
LOG_CALLBACK("nfc_jni_transceive_callback", status);