am 4d5d99ce: am 7cf05b15: am 2f0a1d66: am 7f6932df: am 35ab6119: am 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.

* commit '4d5d99ce39b5edd0b78c47a93563aed6b3d56356':
  Validate asec names.
diff --git a/Android.mk b/Android.mk
index cecab1e..0064cb4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -20,7 +20,6 @@
 	cryptfs.c
 
 common_c_includes := \
-	$(KERNEL_HEADERS) \
 	system/extras/ext4_utils \
 	external/openssl/include \
 	external/stlport/stlport \
@@ -83,7 +82,7 @@
 
 LOCAL_MODULE:= vdc
 
-LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_C_INCLUDES :=
 
 LOCAL_CFLAGS := 
 
diff --git a/DirectVolume.h b/DirectVolume.h
index 7be133f..beda7c3 100644
--- a/DirectVolume.h
+++ b/DirectVolume.h
@@ -21,8 +21,6 @@
 
 #include "Volume.h"
 
-#define MAX_PARTS 4
-
 typedef android::List<char *> PathCollection;
 
 class DirectVolume : public Volume {
diff --git a/Volume.cpp b/Volume.cpp
index 6dd1cc0..c290200 100644
--- a/Volume.cpp
+++ b/Volume.cpp
@@ -260,7 +260,7 @@
     // Only initialize the MBR if we are formatting the entire device
     if (formatEntireDevice) {
         sprintf(devicePath, "/dev/block/vold/%d:%d",
-                MAJOR(diskNode), MINOR(diskNode));
+                major(diskNode), minor(diskNode));
 
         if (initializeMbr(devicePath)) {
             SLOGE("Failed to initialize MBR (%s)", strerror(errno));
@@ -269,7 +269,7 @@
     }
 
     sprintf(devicePath, "/dev/block/vold/%d:%d",
-            MAJOR(partNode), MINOR(partNode));
+            major(partNode), minor(partNode));
 
     if (mDebug) {
         SLOGI("Formatting volume %s (%s)", getLabel(), devicePath);
@@ -415,8 +415,8 @@
     for (i = 0; i < n; i++) {
         char devicePath[255];
 
-        sprintf(devicePath, "/dev/block/vold/%d:%d", MAJOR(deviceNodes[i]),
-                MINOR(deviceNodes[i]));
+        sprintf(devicePath, "/dev/block/vold/%d:%d", major(deviceNodes[i]),
+                minor(deviceNodes[i]));
 
         SLOGI("%s being considered for volume %s\n", devicePath, getLabel());
 
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index f2d4e55..f9b7b6a 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -1391,7 +1391,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");
@@ -1513,7 +1513,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++;
         }
     }
diff --git a/fstrim.c b/fstrim.c
index 73705f9..2bd0577 100644
--- a/fstrim.c
+++ b/fstrim.c
@@ -116,7 +116,7 @@
     /* Release the wakelock that let us work */
     release_wake_lock(FSTRIM_WAKELOCK);
 
-    return (void *)ret;
+    return (void *)(uintptr_t)ret;
 }
 
 int fstrim_filesystems(void)