diff options
author | Colin Cross <ccross@android.com> | 2014-03-25 17:55:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-03-25 17:55:25 +0000 |
commit | 15d81f71a668b3092549c6b7f83694bf680d9c49 (patch) | |
tree | c7ca4355fd0b340b23f8aaf4fda3b2376f5f7fb0 | |
parent | 259abdcbb35206e0ae728d516d01c4892367bee6 (diff) | |
parent | a5282496f1c25f5c8cfefd3b8bc4220ee2192881 (diff) | |
download | libnfc-nxp-15d81f71a668b3092549c6b7f83694bf680d9c49.tar.gz |
Merge "libnfc-nxp: fix build for 64-bit"android-l-preview_r2l-previewidea133-weekly-release
-rw-r--r-- | Android.mk | 2 | ||||
-rw-r--r-- | Linux_x86/phDal4Nfc_i2c.c | 4 | ||||
-rw-r--r-- | Linux_x86/phDal4Nfc_messageQueueLib.c | 10 | ||||
-rw-r--r-- | Linux_x86/phDal4Nfc_uart.c | 4 | ||||
-rw-r--r-- | inc/phNfcTypes.h | 2 | ||||
-rw-r--r-- | src/phDal4Nfc_messageQueueLib.h | 8 | ||||
-rw-r--r-- | src/phLibNfc.h | 2 | ||||
-rw-r--r-- | src/phLibNfc_Internal.h | 4 | ||||
-rw-r--r-- | src/phLibNfc_initiator.c | 30 | ||||
-rw-r--r-- | src/phLibNfc_ndef_raw.c | 2 |
10 files changed, 35 insertions, 33 deletions
@@ -132,6 +132,8 @@ LOCAL_CFLAGS += -I$(LOCAL_PATH)/inc LOCAL_CFLAGS += -I$(LOCAL_PATH)/Linux_x86 LOCAL_CFLAGS += -I$(LOCAL_PATH)/src +LOCAL_CFLAGS += -Wno-unused-parameter + LOCAL_MODULE:= libnfc LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := libcutils libnfc_ndef libdl libhardware liblog diff --git a/Linux_x86/phDal4Nfc_i2c.c b/Linux_x86/phDal4Nfc_i2c.c index 72edb22..8e83a73 100644 --- a/Linux_x86/phDal4Nfc_i2c.c +++ b/Linux_x86/phDal4Nfc_i2c.c @@ -82,7 +82,7 @@ PURPOSE: The application could have opened the link itself. So we just need void phDal4Nfc_i2c_set_open_from_handle(phHal_sHwReference_t * pDalHwContext) { - gI2cPortContext.nHandle = (int) pDalHwContext->p_board_driver; + gI2cPortContext.nHandle = (int)(intptr_t) pDalHwContext->p_board_driver; DAL_ASSERT_STR(gI2cPortContext.nHandle >= 0, "Bad passed com port handle"); gI2cPortContext.nOpened = 1; } @@ -156,7 +156,7 @@ NFCSTATUS phDal4Nfc_i2c_open_and_configure(pphDal4Nfc_sConfig_t pConfig, void ** } gI2cPortContext.nOpened = 1; - *pLinkHandle = (void*)gI2cPortContext.nHandle; + *pLinkHandle = (void*)(intptr_t)gI2cPortContext.nHandle; DAL_PRINT("Open succeed\n"); diff --git a/Linux_x86/phDal4Nfc_messageQueueLib.c b/Linux_x86/phDal4Nfc_messageQueueLib.c index 30d389b..3b288ba 100644 --- a/Linux_x86/phDal4Nfc_messageQueueLib.c +++ b/Linux_x86/phDal4Nfc_messageQueueLib.c @@ -67,7 +67,7 @@ typedef struct phDal4Nfc_message_queue * \retval -1 Can not allocate memory or can not init mutex. * \retval handle The handle on the message queue. */ -int phDal4Nfc_msgget ( key_t key, int msgflg ) +intptr_t phDal4Nfc_msgget ( key_t key, int msgflg ) { phDal4Nfc_message_queue_t * pQueue; pQueue = (phDal4Nfc_message_queue_t *) phOsalNfc_GetMemory(sizeof(phDal4Nfc_message_queue_t)); @@ -78,7 +78,7 @@ int phDal4Nfc_msgget ( key_t key, int msgflg ) return -1; if (sem_init (&pQueue->nProcessSemaphore, 0, 0) == -1) return -1; - return ((int)pQueue); + return ((intptr_t)pQueue); } /** @@ -93,7 +93,7 @@ int phDal4Nfc_msgget ( key_t key, int msgflg ) * \retval 0 If success. * \retval -1 Bad passed parameter */ -int phDal4Nfc_msgctl ( int msqid, int cmd, void *buf ) +int phDal4Nfc_msgctl ( intptr_t msqid, int cmd, void *buf ) { phDal4Nfc_message_queue_t * pQueue; phDal4Nfc_message_queue_item_t * p; @@ -136,7 +136,7 @@ int phDal4Nfc_msgctl ( int msqid, int cmd, void *buf ) * \retval 0 If success. * \retval -1 Bad passed parameter, or can not allocate memory */ -int phDal4Nfc_msgsnd (int msqid, void * msgp, size_t msgsz, int msgflg) +int phDal4Nfc_msgsnd (intptr_t msqid, void * msgp, size_t msgsz, int msgflg) { phDal4Nfc_message_queue_t * pQueue; phDal4Nfc_message_queue_item_t * p; @@ -187,7 +187,7 @@ int phDal4Nfc_msgsnd (int msqid, void * msgp, size_t msgsz, int msgflg) * \retval 0 If success. * \retval -1 Bad passed parameter. */ -int phDal4Nfc_msgrcv (int msqid, void * msgp, size_t msgsz, long msgtyp, int msgflg) +int phDal4Nfc_msgrcv (intptr_t msqid, void * msgp, size_t msgsz, long msgtyp, int msgflg) { phDal4Nfc_message_queue_t * pQueue; phDal4Nfc_message_queue_item_t * p; diff --git a/Linux_x86/phDal4Nfc_uart.c b/Linux_x86/phDal4Nfc_uart.c index 520ab9c..657dc80 100644 --- a/Linux_x86/phDal4Nfc_uart.c +++ b/Linux_x86/phDal4Nfc_uart.c @@ -97,7 +97,7 @@ PURPOSE: The application could have opened the link itself. So we just need void phDal4Nfc_uart_set_open_from_handle(phHal_sHwReference_t * pDalHwContext) { - gComPortContext.nHandle = (int) pDalHwContext->p_board_driver; + gComPortContext.nHandle = (int)(intptr_t) pDalHwContext->p_board_driver; DAL_ASSERT_STR(gComPortContext.nHandle >= 0, "Bad passed com port handle"); gComPortContext.nOpened = 1; } @@ -176,7 +176,7 @@ NFCSTATUS phDal4Nfc_uart_open_and_configure(pphDal4Nfc_sConfig_t pConfig, void * } gComPortContext.nOpened = 1; - *pLinkHandle = (void*)gComPortContext.nHandle; + *pLinkHandle = (void*)(intptr_t)gComPortContext.nHandle; /* * Now configure the com port diff --git a/inc/phNfcTypes.h b/inc/phNfcTypes.h index 914ae07..79d12aa 100644 --- a/inc/phNfcTypes.h +++ b/inc/phNfcTypes.h @@ -232,7 +232,7 @@ typedef struct phLibNfc_sConfig_t /** Device node of the controller */ const char* deviceNode; /** The client ID (thread ID or message queue ID) */ - unsigned int nClientId; + intptr_t nClientId; } phLibNfc_sConfig_t, *pphLibNfc_sConfig_t; diff --git a/src/phDal4Nfc_messageQueueLib.h b/src/phDal4Nfc_messageQueueLib.h index 0bf2ba4..b13823b 100644 --- a/src/phDal4Nfc_messageQueueLib.h +++ b/src/phDal4Nfc_messageQueueLib.h @@ -41,10 +41,10 @@ typedef struct phDal4Nfc_Message_Wrapper phLibNfc_Message_t msg; } phDal4Nfc_Message_Wrapper_t; -int phDal4Nfc_msgget(key_t key, int msgflg); -int phDal4Nfc_msgctl(int msqid, int cmd, void *buf); -int phDal4Nfc_msgsnd(int msqid, void * msgp, size_t msgsz, int msgflg); -int phDal4Nfc_msgrcv (int msqid, void * msgp, size_t msgsz, long msgtyp, int msgflg); +intptr_t phDal4Nfc_msgget(key_t key, int msgflg); +int phDal4Nfc_msgctl(intptr_t msqid, int cmd, void *buf); +int phDal4Nfc_msgsnd(intptr_t msqid, void * msgp, size_t msgsz, int msgflg); +int phDal4Nfc_msgrcv(intptr_t msqid, void * msgp, size_t msgsz, long msgtyp, int msgflg); #endif #endif /* PHDAL4NFC_MESSAGEQUEUE_H */ diff --git a/src/phLibNfc.h b/src/phLibNfc.h index 6111a93..ddce262 100644 --- a/src/phLibNfc.h +++ b/src/phLibNfc.h @@ -49,7 +49,7 @@ #define LIBNFC_READONLY_NDEF #define PHLIBNFC_MAXNO_OF_SE (0x02) -typedef uint32_t phLibNfc_Handle; +typedef uintptr_t phLibNfc_Handle; extern const unsigned char *nxp_nfc_full_version; diff --git a/src/phLibNfc_Internal.h b/src/phLibNfc_Internal.h index c136032..368c6c9 100644 --- a/src/phLibNfc_Internal.h +++ b/src/phLibNfc_Internal.h @@ -222,11 +222,11 @@ typedef struct phLibNfc_LibContext /*To re configure the discovery wheel*/ phLibNfc_sADD_Cfg_t sADDconfig; - uint32_t Connected_handle, + uintptr_t Connected_handle, Discov_handle[MAX_REMOTE_DEVICES]; /* To store the previous connected handle in case of Multiple protocol tags */ - uint32_t Prev_Connected_handle; + uintptr_t Prev_Connected_handle; /*Call back function pointers */ diff --git a/src/phLibNfc_initiator.c b/src/phLibNfc_initiator.c index 6bd48b8..ab4d766 100644 --- a/src/phLibNfc_initiator.c +++ b/src/phLibNfc_initiator.c @@ -155,7 +155,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; gpphLibContext->Discov_handle[DeviceIndx1] = gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -170,7 +170,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; gpphLibContext->Discov_handle[DeviceIndx1]= gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -187,7 +187,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; gpphLibContext->Discov_handle[DeviceIndx1] = gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -203,7 +203,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; gpphLibContext->Discov_handle[DeviceIndx1] = gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -219,7 +219,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; gpphLibContext->Discov_handle[DeviceIndx1] = gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -235,7 +235,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; gpphLibContext->Discov_handle[DeviceIndx1] = gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -251,7 +251,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; gpphLibContext->Discov_handle[DeviceIndx1] = gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -268,7 +268,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; gpphLibContext->Discov_handle[DeviceIndx1] = gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -283,7 +283,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx].psRemoteDevInfo; gpphLibContext->Discov_handle[DeviceIndx1] = gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -299,7 +299,7 @@ void phLibNfc_NotificationRegister_Resp_Cb ( gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo= info.psDiscoveryInfo->ppRemoteDevInfo[DeviceIndx]; gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev = - (uint32_t)gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo; + (phLibNfc_Handle)gpphLibContext->psRemoteDevList[DeviceIndx1].psRemoteDevInfo; gpphLibContext->sNfcIp_Context.Rem_Initiator_Handle= gpphLibContext->psRemoteDevList[DeviceIndx1].hTargetDev; DeviceIndx1++; @@ -756,7 +756,7 @@ STATIC void phLibNfc_RemoteDev_Connect_Cb( else if(PHNFCSTATUS(status)==NFCSTATUS_SUCCESS) { /* Copy the Remote device address as connected handle*/ - gpphLibContext->Connected_handle =(uint32_t) pRmtdev_info; + gpphLibContext->Connected_handle = (uintptr_t)pRmtdev_info; /* Update the state to connected and return status as SUCCESS*/ gpphLibContext->LibNfcState.next_state = eLibNfcHalStateConnect; Connect_status = NFCSTATUS_SUCCESS; @@ -774,7 +774,7 @@ STATIC void phLibNfc_RemoteDev_Connect_Cb( /* Call the upper layer callback*/ gpphLibContext->CBInfo.pClientConnectCb( gpphLibContext->CBInfo.pClientConCntx, - (uint32_t)pRmtdev_info, + (phLibNfc_Handle)pRmtdev_info, (phLibNfc_sRemoteDevInformation_t*)pRmtdev_info, Connect_status); } @@ -948,7 +948,7 @@ STATIC void phLibNfc_RemoteDev_Disconnect_cb( } /* Call the upper layer Callback */ (*pUpper_NtfCb)(pUpper_Context, - (uint32_t)reg_handle, + (phLibNfc_Handle)reg_handle, DisCnct_status); return; } @@ -1197,7 +1197,7 @@ void phLibNfc_RemoteDev_Transceive_Cb(void *context, PHDBG_INFO("LibNfc:Transceive Complete"); /* Notify the Transceive Completion to upper layer */ gpphLibContext->CBInfo.pClientTransceiveCb(pUpper_Context, - (uint32_t)pRmtdev_info, + (phLibNfc_Handle)pRmtdev_info, trans_resp, trans_status); } @@ -1210,7 +1210,7 @@ void phLibNfc_RemoteDev_Transceive_Cb(void *context, PHDBG_INFO("LibNfc:Transceive Complete"); /* Notify the Transceive Completion to upper layer */ gpphLibContext->CBInfo.pClientTransceiveCb(pUpper_Context, - (uint32_t)pRmtdev_info, + (phLibNfc_Handle)pRmtdev_info, trans_resp, trans_status); } diff --git a/src/phLibNfc_ndef_raw.c b/src/phLibNfc_ndef_raw.c index 31dbbac..4b87d31 100644 --- a/src/phLibNfc_ndef_raw.c +++ b/src/phLibNfc_ndef_raw.c @@ -1228,7 +1228,7 @@ void phLibNfc_Reconnect_Mifare_Cb ( NFCSTATUS_FAILED:NFCSTATUS_TARGET_LOST); /* call the upper transceive callback */ pClientCb(pUpperLayerContext, - (uint32_t)psRemoteDevInfo, + (phLibNfc_Handle)psRemoteDevInfo, & trans_resp, status); } |