mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 05:48:47 +03:00
Merge pull request #3517 from glassez/strict_aliasing
Fix strict-aliasing warning.
This commit is contained in:
commit
929cd30e33
1 changed files with 4 additions and 4 deletions
|
@ -374,11 +374,11 @@ namespace
|
||||||
bool left = true;
|
bool left = true;
|
||||||
Node node;
|
Node node;
|
||||||
for (quint32 i = 0; i < (2 * m_geoIPData->nodeCount); ++i) {
|
for (quint32 i = 0; i < (2 * m_geoIPData->nodeCount); ++i) {
|
||||||
uchar buf[4] = { 0 };
|
quint32 id = 0;
|
||||||
|
uchar *idPtr = reinterpret_cast<uchar *>(&id);
|
||||||
|
|
||||||
memcpy(&buf[4 - recordBytes], ptr, recordBytes);
|
memcpy(&idPtr[4 - recordBytes], ptr, recordBytes);
|
||||||
fromBigEndian(buf, 4);
|
fromBigEndian(idPtr, 4);
|
||||||
quint32 id = *(reinterpret_cast<quint32 *>(buf));
|
|
||||||
|
|
||||||
if ((id > m_geoIPData->nodeCount) && !m_geoIPData->countries.contains(id)) {
|
if ((id > m_geoIPData->nodeCount) && !m_geoIPData->countries.contains(id)) {
|
||||||
const quint32 offset = id - m_geoIPData->nodeCount - sizeof(DATA_SECTION_SEPARATOR);
|
const quint32 offset = id - m_geoIPData->nodeCount - sizeof(DATA_SECTION_SEPARATOR);
|
||||||
|
|
Loading…
Reference in a new issue