vold: fix warnings for 64-bit
Replace MINOR(dev_t) and MAJOR(dev_t) with minor and major,
which cast to int.
Cast int to uintptr_t before casting to pointer
Change-Id: I59375518f15d27f400fcd4f8a8dfe5ebdd8350e6
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 2a9cd20..117eee0 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -1293,7 +1293,7 @@
char nodepath[255];
int written = snprintf(nodepath,
sizeof(nodepath), "/dev/block/vold/%d:%d",
- MAJOR(d), MINOR(d));
+ major(d), minor(d));
if ((written < 0) || (size_t(written) >= sizeof(nodepath))) {
SLOGE("shareVolume failed: couldn't construct nodepath");
@@ -1415,7 +1415,7 @@
if ((d=(*i)->getShareDevice()) != (dev_t)0) {
(*i)->getVolInfo(&vol_list[n]);
snprintf(vol_list[n].blk_dev, sizeof(vol_list[n].blk_dev),
- "/dev/block/vold/%d:%d",MAJOR(d), MINOR(d));
+ "/dev/block/vold/%d:%d", major(d), minor(d));
n++;
}
}