system/core LP64 cleanup.
Fixes -Wint-to-pointer and -Wpointer-to-int warnings, plus various -Wformat
warnings.
Change-Id: I6c5eea6b4273d82d28b8e5d2925f3e5457511b17
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c
index 05fbfba..4722708 100644
--- a/sdcard/sdcard.c
+++ b/sdcard/sdcard.c
@@ -200,7 +200,7 @@
}
static int int_hash(void *key) {
- return (int) key;
+ return (int) (uintptr_t) key;
}
static bool int_equals(void *keyA, void *keyB) {
@@ -487,7 +487,7 @@
break;
case PERM_ANDROID_DATA:
case PERM_ANDROID_OBB:
- appid = (appid_t) hashmapGet(fuse->package_to_appid, node->name);
+ appid = (appid_t) (uintptr_t) hashmapGet(fuse->package_to_appid, node->name);
if (appid != 0) {
node->uid = multiuser_get_uid(parent->userid, appid);
}
@@ -511,7 +511,7 @@
}
appid_t appid = multiuser_get_app_id(hdr->uid);
- return hashmapContainsKey(fuse->appid_with_rw, (void*) appid);
+ return hashmapContainsKey(fuse->appid_with_rw, (void*) (uintptr_t) appid);
}
/* Kernel has already enforced everything we returned through
@@ -1621,12 +1621,12 @@
if (sscanf(buf, "%s %d %*d %*s %*s %s", package_name, &appid, gids) == 3) {
char* package_name_dup = strdup(package_name);
- hashmapPut(fuse->package_to_appid, package_name_dup, (void*) appid);
+ hashmapPut(fuse->package_to_appid, package_name_dup, (void*) (uintptr_t) appid);
char* token = strtok(gids, ",");
while (token != NULL) {
if (strtoul(token, NULL, 10) == fuse->write_gid) {
- hashmapPut(fuse->appid_with_rw, (void*) appid, (void*) 1);
+ hashmapPut(fuse->appid_with_rw, (void*) (uintptr_t) appid, (void*) (uintptr_t) 1);
break;
}
token = strtok(NULL, ",");