more 32bit stuff

This commit is contained in:
Green Sky 2024-10-20 18:37:01 +02:00
parent c3c2d0f133
commit fd094b157f
No known key found for this signature in database
2 changed files with 10 additions and 10 deletions

View File

@ -108,7 +108,7 @@ namespace Components {
struct Peer { struct Peer {
struct Entry { struct Entry {
float time_point {0.f}; float time_point {0.f};
size_t bytes {0u}; uint64_t bytes {0u};
bool accounted {false}; bool accounted {false};
}; };
std::deque<Entry> recently_sent; std::deque<Entry> recently_sent;

View File

@ -25,16 +25,16 @@ std::ostream& operator<<(std::ostream& out, const SHA1Digest& v);
namespace std { // inject namespace std { // inject
template<> struct hash<SHA1Digest> { template<> struct hash<SHA1Digest> {
std::size_t operator()(const SHA1Digest& h) const noexcept { std::uint64_t operator()(const SHA1Digest& h) const noexcept {
return return
size_t(h.data[0]) << (0*8) | std::uint64_t(h.data[0]) << (0*8) |
size_t(h.data[1]) << (1*8) | std::uint64_t(h.data[1]) << (1*8) |
size_t(h.data[2]) << (2*8) | std::uint64_t(h.data[2]) << (2*8) |
size_t(h.data[3]) << (3*8) | std::uint64_t(h.data[3]) << (3*8) |
size_t(h.data[4]) << (4*8) | std::uint64_t(h.data[4]) << (4*8) |
size_t(h.data[5]) << (5*8) | std::uint64_t(h.data[5]) << (5*8) |
size_t(h.data[6]) << (6*8) | std::uint64_t(h.data[6]) << (6*8) |
size_t(h.data[7]) << (7*8) std::uint64_t(h.data[7]) << (7*8)
; ;
} }
}; };