projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
092010d
)
util: Add util_bswap16.
author
José Fonseca
<jfonseca@vmware.com>
Fri, 26 Feb 2010 15:37:18 +0000
(15:37 +0000)
committer
José Fonseca
<jfonseca@vmware.com>
Fri, 26 Feb 2010 16:46:34 +0000
(16:46 +0000)
src/gallium/auxiliary/util/u_math.h
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/util/u_math.h
b/src/gallium/auxiliary/util/u_math.h
index b2969a210a7878f0daed5df6d715981139e2dc3d..d1ec13def30f831e81a11f95d65b917ef4177cb2 100644
(file)
--- a/
src/gallium/auxiliary/util/u_math.h
+++ b/
src/gallium/auxiliary/util/u_math.h
@@
-531,6
+531,17
@@
util_bswap32(uint32_t n)
}
+/**
+ * Reverse byte order of a 16 bit word.
+ */
+static INLINE uint16_t
+util_bswap16(uint16_t n)
+{
+ return (n >> 8) |
+ (n << 8);
+}
+
+
/**
* Clamp X to [MIN, MAX].
* This is a macro to allow float, int, uint, etc. types.