1
0
mirror of synced 2025-01-31 03:53:44 +01:00

Use htonl instead of bswap to technically support big endian systems

This commit is contained in:
WerWolv 2020-11-19 11:37:16 +01:00
parent 6fffc589bf
commit 9b04373809

View File

@ -6,6 +6,12 @@
#include <vector>
#ifdef __MINGW32__
#include <winsock.h>
#else
#include <arpa/inet.h>
#endif
namespace hex {
ViewHashes::ViewHashes(prv::Provider* &dataProvider) : View(), m_dataProvider(dataProvider) {
@ -21,7 +27,7 @@ namespace hex {
static void formatBigHexInt(auto dataArray, char *buffer, size_t bufferSize) {
for (int i = 0; i < dataArray.size(); i++)
snprintf(buffer + 8 * i, bufferSize - 8 * i, "%08X", __builtin_bswap32(dataArray[i]));
snprintf(buffer + 8 * i, bufferSize - 8 * i, "%08X", htonl(dataArray[i]));
}
void ViewHashes::createView() {