diff --git a/src/base/net/stratum/Client.cpp b/src/base/net/stratum/Client.cpp index 039ff6930..7b9c32229 100644 --- a/src/base/net/stratum/Client.cpp +++ b/src/base/net/stratum/Client.cpp @@ -445,9 +445,9 @@ bool xmrig::Client::parseJob(const rapidjson::Value ¶ms, int *code) if (Cvt::fromHex(signatureKeyBuf, sizeof(signatureKeyBuf), Json::getValue(params, "sig_key"))) { job.setEphemeralKeys(signatureKeyBuf, signatureKeyBuf + 32); - uint8_t major_version; - uint8_t minor_version; - uint64_t timestamp; + uint8_t major_version = 0; + uint8_t minor_version = 0; + uint64_t timestamp = 0; CBlobReader ar(job.blob(), job.size()); ar(major_version); diff --git a/src/base/tools/cryptonote/WalletAddress.cpp b/src/base/tools/cryptonote/WalletAddress.cpp index 394274daa..7be1ef9d6 100644 --- a/src/base/tools/cryptonote/WalletAddress.cpp +++ b/src/base/tools/cryptonote/WalletAddress.cpp @@ -39,8 +39,8 @@ bool WalletAddress::Decode(const String& address) int8_t reverse_alphabet[256]; memset(reverse_alphabet, -1, sizeof(reverse_alphabet)); - for (int i = 0; i < alphabet_size; ++i) { - reverse_alphabet[alphabet[i]] = i; + for (size_t i = 0; i < alphabet_size; ++i) { + reverse_alphabet[static_cast(alphabet[i])] = i; } const int len = static_cast(address.size()); @@ -49,7 +49,7 @@ bool WalletAddress::Decode(const String& address) int last_block_size_index = -1; - for (int i = 0; i < block_sizes.size(); ++i) { + for (size_t i = 0; i < block_sizes.size(); ++i) { if (block_sizes[i] == last_block_size) { last_block_size_index = i; break; @@ -70,7 +70,7 @@ bool WalletAddress::Decode(const String& address) uint64_t order = 1; for (int j = ((i < num_full_blocks) ? block_sizes.back() : last_block_size) - 1; j >= 0; --j) { - const int digit = reverse_alphabet[address_data[j]]; + const int digit = reverse_alphabet[static_cast(address_data[j])]; if (digit < 0) { return false; } diff --git a/src/hw/dmi/DmiReader_win.cpp b/src/hw/dmi/DmiReader_win.cpp index 837bdb7b3..26f8a7f61 100644 --- a/src/hw/dmi/DmiReader_win.cpp +++ b/src/hw/dmi/DmiReader_win.cpp @@ -46,14 +46,16 @@ struct RawSMBIOSData { bool xmrig::DmiReader::read() { - const uint32_t size = GetSystemFirmwareTable('RSMB', 0, nullptr, 0); + constexpr uint32_t RSMB = 0x52534D42; + + const uint32_t size = GetSystemFirmwareTable(RSMB, 0, nullptr, 0); auto smb = reinterpret_cast(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size)); if (!smb) { return false; } - if (GetSystemFirmwareTable('RSMB', 0, smb, size) != size) { + if (GetSystemFirmwareTable(RSMB, 0, smb, size) != size) { HeapFree(GetProcessHeap(), 0, smb); return false;