summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-06-14 14:21:43 +0000
committerThomas Martitz <kugel@rockbox.org>2011-06-14 14:21:43 +0000
commitd43e8ea5a2d0ba2032a5badcf276a65747f8ca60 (patch)
tree1aae8cb275d14e487e1a25df75807aec70a734fe /firmware/export
parent50be1a8c4ce38d97b7ae76cb4dccf961065f9d94 (diff)
downloadrockbox-d43e8ea5a2d0ba2032a5badcf276a65747f8ca60.tar.gz
rockbox-d43e8ea5a2d0ba2032a5badcf276a65747f8ca60.zip
Slightly more typesafe ALIGN_DOWN/UP macros.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30004 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/system.h2
1 files changed, 1 insertions, 1 deletions
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);
110#define ALIGN_UP_P2(n, p2) ALIGN_DOWN_P2((n) + P2_M1(p2),p2) 110#define ALIGN_UP_P2(n, p2) ALIGN_DOWN_P2((n) + P2_M1(p2),p2)
111 111
112/* align up or down to nearest integer multiple of a */ 112/* align up or down to nearest integer multiple of a */
113#define ALIGN_DOWN(n, a) ((n)/(a)*(a)) 113#define ALIGN_DOWN(n, a) ((typeof(n))((typeof(a))(n)/(a)*(a)))
114#define ALIGN_UP(n, a) ALIGN_DOWN((n)+((a)-1),a) 114#define ALIGN_UP(n, a) ALIGN_DOWN((n)+((a)-1),a)
115 115
116/* align start and end of buffer to nearest integer multiple of a */ 116/* align start and end of buffer to nearest integer multiple of a */