mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
refactor: replace multiple C-style casts to reinterpret_cast
This commit is contained in:
parent
f36bb1f085
commit
3abeab16d3
@ -297,10 +297,10 @@ struct SaltedHasherImpl<llmq::CQuorumDataRequestKey>
|
||||
static std::size_t CalcHash(const llmq::CQuorumDataRequestKey& v, uint64_t k0, uint64_t k1)
|
||||
{
|
||||
CSipHasher c(k0, k1);
|
||||
c.Write((unsigned char*)&(v.proRegTx), sizeof(v.proRegTx));
|
||||
c.Write((unsigned char*)&(v.m_we_requested), sizeof(v.m_we_requested));
|
||||
c.Write((unsigned char*)&(v.quorumHash), sizeof(v.quorumHash));
|
||||
c.Write((unsigned char*)&(v.llmqType), sizeof(v.llmqType));
|
||||
c.Write(reinterpret_cast<const unsigned char*>(&v.proRegTx), sizeof(v.proRegTx));
|
||||
c.Write(reinterpret_cast<const unsigned char*>(&v.m_we_requested), sizeof(v.m_we_requested));
|
||||
c.Write(reinterpret_cast<const unsigned char*>(&v.quorumHash), sizeof(v.quorumHash));
|
||||
c.Write(reinterpret_cast<const unsigned char*>(&v.llmqType), sizeof(v.llmqType));
|
||||
return c.Finalize();
|
||||
}
|
||||
};
|
||||
|
@ -231,7 +231,7 @@ int StatsdClient::send(const std::string& message)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
ret = sendto(d->sock, message.data(), message.size(), 0, (struct sockaddr *) &d->server, sizeof(d->server));
|
||||
ret = sendto(d->sock, message.data(), message.size(), 0, reinterpret_cast<const sockaddr*>(&d->server), sizeof(d->server));
|
||||
if ( ret == -1) {
|
||||
snprintf(d->errmsg, sizeof(d->errmsg),
|
||||
"sendto server fail, host=%s:%d, err=%m", d->host.c_str(), d->port);
|
||||
|
@ -244,7 +244,7 @@ using DebugLock = UniqueLock<typename std::remove_reference<typename std::remove
|
||||
#define LEAVE_CRITICAL_SECTION(cs) \
|
||||
{ \
|
||||
std::string lockname; \
|
||||
CheckLastCritical((void*)(&cs), lockname, #cs, __FILE__, __LINE__); \
|
||||
CheckLastCritical(reinterpret_cast<void*>(&cs), lockname, #cs, __FILE__, __LINE__); \
|
||||
(cs).unlock(); \
|
||||
LeaveCritical(); \
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user