From d43e8ea5a2d0ba2032a5badcf276a65747f8ca60 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 14 Jun 2011 14:21:43 +0000 Subject: Slightly more typesafe ALIGN_DOWN/UP macros. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30004 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/export') diff --git a/firmware/export/system.h b/firmware/export/system.h index b85b09ea70..0f709cdae6 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h @@ -110,7 +110,7 @@ int get_cpu_boost_counter(void); #define ALIGN_UP_P2(n, p2) ALIGN_DOWN_P2((n) + P2_M1(p2),p2) /* align up or down to nearest integer multiple of a */ -#define ALIGN_DOWN(n, a) ((n)/(a)*(a)) +#define ALIGN_DOWN(n, a) ((typeof(n))((typeof(a))(n)/(a)*(a))) #define ALIGN_UP(n, a) ALIGN_DOWN((n)+((a)-1),a) /* align start and end of buffer to nearest integer multiple of a */ -- cgit v1.2.3