]> git.lizzy.rs Git - rust.git/commit
auto merge of #7194 : jensnockert/rust/endian, r=cmr
authorbors <bors@rust-lang.org>
Sat, 6 Jul 2013 15:32:10 +0000 (08:32 -0700)
committerbors <bors@rust-lang.org>
Sat, 6 Jul 2013 15:32:10 +0000 (08:32 -0700)
commit3e933b199c69e1b6c32ecb65bb8f06127cfb8312
tree8f28a9f7ecf7bd331be9fceade75ddb283831bb1
parente9897cd08a069342c1aae67faa04b119968b44eb
parentbc6848d352dd234ffb9c6cb97e2fbcf6c878c8d8
auto merge of #7194 : jensnockert/rust/endian, r=cmr

They simply byte-swap an integer to a specific endian, like the hton* functions in C.

These intrinsics are synthesized, so maybe they should be in another file. But since they are just a single line of code each, based on the bswap intrinsics and aren't really intended for public consumption I thought they would fit in the intrinsics file.

The next step working on this could be to expose a trait / generic function for byteswapping.
src/libstd/unstable/intrinsics.rs