projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23ca30e
)
Fix align16() function to work with 32/64-bit pointers on big-endian.
author
Brian
<brian.paul@tungstengraphics.com>
Tue, 11 Dec 2007 16:13:12 +0000
(09:13 -0700)
committer
Brian
<brian.paul@tungstengraphics.com>
Tue, 11 Dec 2007 16:13:12 +0000
(09:13 -0700)
src/mesa/pipe/p_util.h
patch
|
blob
|
history
diff --git
a/src/mesa/pipe/p_util.h
b/src/mesa/pipe/p_util.h
index b4d1195c9b035ed0bba3f15765e427a9b73d87ea..e6d284d9327deda89323753ab0425c9f254d68dc 100644
(file)
--- a/
src/mesa/pipe/p_util.h
+++ b/
src/mesa/pipe/p_util.h
@@
-169,13
+169,25
@@
align_free(void *ptr)
static INLINE void *
align16( void *unaligned )
{
- union {
- void *p;
- uint64 u;
- } pu;
- pu.p = unaligned;
- pu.u = (pu.u + 15) & ~15;
- return pu.p;
+ if (sizeof(void *) == 64) {
+ union {
+ void *p;
+ uint64 u;
+ } pu;
+ pu.p = unaligned;
+ pu.u = (pu.u + 15) & ~15;
+ return pu.p;
+ }
+ else {
+ /* 32-bit pointers */
+ union {
+ void *p;
+ uint u;
+ } pu;
+ pu.p = unaligned;
+ pu.u = (pu.u + 15) & ~15;
+ return pu.p;
+ }
}