summaryrefslogtreecommitdiffstats
path: root/libs/usb
diff options
context:
space:
mode:
authorAshok Bhat <ashok.bhat@arm.com>2014-03-25 20:51:35 +0000
committerNarayan Kamath <narayan@google.com>2014-03-27 12:30:42 +0000
commitf5df700e6ce056ebfa322314d970e52d6facc35a (patch)
tree5a3e1f8dc1089601389509f54d2eef98ec2528a8 /libs/usb
parent57f2764bf104b0fe7b5cd67ad5b2cae9bc8352ed (diff)
downloadframeworks_base-f5df700e6ce056ebfa322314d970e52d6facc35a.zip
frameworks_base-f5df700e6ce056ebfa322314d970e52d6facc35a.tar.gz
frameworks_base-f5df700e6ce056ebfa322314d970e52d6facc35a.tar.bz2
AArch64: Make frameworks/base code more portable
Changes in this patch include [x] Use %zu for size_t, %zd for ssize_t [x] Some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) Change-Id: Id1aaa7894a7d0b85ac7ecd7b2bfd8cc40374261f Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Diffstat (limited to 'libs/usb')
-rw-r--r--libs/usb/tests/AccessoryChat/accessorychat/accessorychat.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/usb/tests/AccessoryChat/accessorychat/accessorychat.c b/libs/usb/tests/AccessoryChat/accessorychat/accessorychat.c
index 06b477f..57c0320 100644
--- a/libs/usb/tests/AccessoryChat/accessorychat/accessorychat.c
+++ b/libs/usb/tests/AccessoryChat/accessorychat/accessorychat.c
@@ -32,7 +32,7 @@
struct usb_device *sDevice = NULL;
static void* read_thread(void* arg) {
- int endpoint = (int)arg;
+ int endpoint = (int)(uintptr_t)arg;
int ret = 0;
while (sDevice && ret >= 0) {
@@ -52,7 +52,7 @@ static void* read_thread(void* arg) {
}
static void* write_thread(void* arg) {
- int endpoint = (int)arg;
+ int endpoint = (int)(uintptr_t)arg;
int ret = 0;
while (ret >= 0) {
@@ -136,11 +136,11 @@ static int usb_device_added(const char *devname, void* client_data) {
}
if ((ep1->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) {
- pthread_create(&th, NULL, read_thread, (void *)ep1->bEndpointAddress);
- pthread_create(&th, NULL, write_thread, (void *)ep2->bEndpointAddress);
+ pthread_create(&th, NULL, read_thread, (void *)(uintptr_t)ep1->bEndpointAddress);
+ pthread_create(&th, NULL, write_thread, (void *)(uintptr_t)ep2->bEndpointAddress);
} else {
- pthread_create(&th, NULL, read_thread, (void *)ep2->bEndpointAddress);
- pthread_create(&th, NULL, write_thread, (void *)ep1->bEndpointAddress);
+ pthread_create(&th, NULL, read_thread, (void *)(uintptr_t)ep2->bEndpointAddress);
+ pthread_create(&th, NULL, write_thread, (void *)(uintptr_t)ep1->bEndpointAddress);
}
} else {
printf("Found possible android device - attempting to switch to accessory mode\n");