summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl/vl_vlc.h
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2015-02-20 19:46:21 -0800
committerMatt Turner <[email protected]>2015-02-23 10:41:22 -0800
commit14ded5ee61b2dfc23878c4a6f38021b15bd0a2fc (patch)
treec18fe35996ccfe416e558683075479876537830d /src/gallium/auxiliary/vl/vl_vlc.h
parent3492e88090d2d0c0bfbc934963b8772b45fc8880 (diff)
gallium: Use util_cpu_to_le{16,32} in many more places.
... and util_le{16,32}_to_cpu. I think I've used the right ones for describing the actual operation performed (even though they're both just "byte-swap this if I'm on big-endian"). The Linux Kernel has typedefs __le32/__be32 and friends that static analysis tools can use to check that byte-orderings are correct. It might be interesting to apply that here as well. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_vlc.h')
-rw-r--r--src/gallium/auxiliary/vl/vl_vlc.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/vl/vl_vlc.h b/src/gallium/auxiliary/vl/vl_vlc.h
index 2f905956dbf..cad998911b6 100644
--- a/src/gallium/auxiliary/vl/vl_vlc.h
+++ b/src/gallium/auxiliary/vl/vl_vlc.h
@@ -149,11 +149,7 @@ vl_vlc_fillbits(struct vl_vlc *vlc)
} else if (bytes_left >= 4) {
/* enough bytes in buffer, read in a whole dword */
- uint64_t value = *(const uint32_t*)vlc->data;
-
-#ifndef PIPE_ARCH_BIG_ENDIAN
- value = util_bswap32(value);
-#endif
+ uint64_t value = util_cpu_to_le32(*(const uint32_t*)vlc->data);
vlc->buffer |= value << vlc->invalid_bits;
vlc->data += 4;