Index: uspace/lib/c/include/align.h
===================================================================
--- uspace/lib/c/include/align.h	(revision dc5647ed5a125308dfb3f30e9c035e9392912353)
+++ uspace/lib/c/include/align.h	(revision 09f41d3d60ae4abb40aff09edace1ef60c15b484)
@@ -41,5 +41,5 @@
  * @param a		Size of alignment, must be power of 2.
  */
-#define ALIGN_DOWN(s, a)	((s) & ~((a) - 1))
+#define ALIGN_DOWN(s, a)	((s) & ~((typeof(s))(a) - 1))
 
 /** Align to the nearest higher address which is a power of two.
@@ -48,5 +48,5 @@
  * @param a		Size of alignment, must be power of 2.
  */
-#define ALIGN_UP(s, a)		((long)((s) + ((a) - 1)) & ~((long) (a) - 1))
+#define ALIGN_UP(s, a)		((((s) + ((a) - 1)) & ~((typeof(s))(a) - 1)))
 
 /** Round up to the nearest higher boundary.
