libgralloc: use proper types and type casts

- Use proper types for pointers
- Resolve compiler errors
- handle proper type casts
- remove unused variables

Change-Id: I628ebe174485d30abadea4ca40b67f9aab1a0652
diff --git a/libgralloc/gr.h b/libgralloc/gr.h
index 20b2994..52e9cc4 100644
--- a/libgralloc/gr.h
+++ b/libgralloc/gr.h
@@ -42,7 +42,8 @@
     return (x + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1);
 }
 
-inline size_t ALIGN(size_t x, size_t align) {
+template <class Type>
+inline Type ALIGN(Type x, Type align) {
     return (x + align-1) & ~(align-1);
 }