Don't use uint32_t in functions working on uint64_t, shifting uint32_t by 56 bits causes evil compiler warnings. On some compilers!

Originally committed to SVN as r2225.
This commit is contained in:
Niels Martin Hansen 2008-07-03 23:24:47 +00:00
parent d6ada6f0bd
commit 0fbe0a001f
1 changed files with 16 additions and 16 deletions

View File

@ -299,14 +299,14 @@ namespace Endian {
bytes64 pack;
pack.word = val;
return
(uint32_t(pack.byte[0]) << 56) |
(uint32_t(pack.byte[1]) << 48) |
(uint32_t(pack.byte[2]) << 40) |
(uint32_t(pack.byte[3]) << 32) |
(uint32_t(pack.byte[4]) << 24) |
(uint32_t(pack.byte[5]) << 16) |
(uint32_t(pack.byte[6]) << 8) |
uint32_t(pack.byte[7]);
(uint64_t(pack.byte[0]) << 56) |
(uint64_t(pack.byte[1]) << 48) |
(uint64_t(pack.byte[2]) << 40) |
(uint64_t(pack.byte[3]) << 32) |
(uint64_t(pack.byte[4]) << 24) |
(uint64_t(pack.byte[5]) << 16) |
(uint64_t(pack.byte[6]) << 8) |
uint64_t(pack.byte[7]);
}
uint64_t LittleToMachine(uint64_t val)
@ -314,14 +314,14 @@ namespace Endian {
bytes64 pack;
pack.word = val;
return
(uint32_t(pack.byte[7]) << 56) |
(uint32_t(pack.byte[6]) << 48) |
(uint32_t(pack.byte[5]) << 40) |
(uint32_t(pack.byte[4]) << 32) |
(uint32_t(pack.byte[3]) << 24) |
(uint32_t(pack.byte[2]) << 16) |
(uint32_t(pack.byte[1]) << 8) |
uint32_t(pack.byte[0]);
(uint64_t(pack.byte[7]) << 56) |
(uint64_t(pack.byte[6]) << 48) |
(uint64_t(pack.byte[5]) << 40) |
(uint64_t(pack.byte[4]) << 32) |
(uint64_t(pack.byte[3]) << 24) |
(uint64_t(pack.byte[2]) << 16) |
(uint64_t(pack.byte[1]) << 8) |
uint64_t(pack.byte[0]);
}