util: Add util_bswap16.
This commit is contained in:
parent
092010db37
commit
fda9a19b34
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue