projects
/
libusual.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4a86f4
)
base: make CUSTOM_ALIGN use uintptr_t
author
Marko Kreen
<markokr@gmail.com>
Tue, 29 Nov 2011 18:42:50 +0000
(20:42 +0200)
committer
Marko Kreen
<markokr@gmail.com>
Tue, 29 Nov 2011 18:42:50 +0000
(20:42 +0200)
For cases where long is shorter than ptr.
usual/base.h
patch
|
blob
|
blame
|
history
diff --git
a/usual/base.h
b/usual/base.h
index e14d09a2f13354cd15e7ac82bfe0fee62daa52d9..36eb359987b9ae5ef12fac60ec96d9e512d8c4a7 100644
(file)
--- a/
usual/base.h
+++ b/
usual/base.h
@@
-69,7
+69,7
@@
/** power-of-2 alignment */
#ifndef CUSTOM_ALIGN
-#define CUSTOM_ALIGN(x, a) (((u
nsigned long)(x) + (a) - 1) & ~(
(a) - 1))
+#define CUSTOM_ALIGN(x, a) (((u
intptr_t)(x) + (uintptr_t)(a) - 1) & ~((uintptr_t)
(a) - 1))
#endif
/** preferred alignment */