chore: eliminate some compile warnings

This commit is contained in:
Aleksandar Fabijanic 2023-10-21 19:15:57 +02:00
parent d640c659a2
commit c0f7257ccd
2 changed files with 10 additions and 10 deletions

View File

@ -323,8 +323,8 @@ std::string::size_type RegularExpression::substOne(std::string& subject, std::st
int c = d - '0'; int c = d - '0';
if (c < rc) if (c < rc)
{ {
int o = ovec[c*2]; std::size_t o = ovec[c*2];
int l = ovec[c*2 + 1] - o; std::size_t l = ovec[c*2 + 1] - o;
result.append(subject, o, l); result.append(subject, o, l);
} }
} }

View File

@ -94,7 +94,7 @@ void HMACEngineTest::testHMAC_SHA2_224()
0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19
}; };
key = std::string(str.begin(), str.end()); // 25 bytes key = std::string(str.begin(), str.end()); // 25 bytes
data = std::string(50, 0xcd); data = std::string(50, (char)0xcd);
HMACEngine<SHA2Engine224> hmac4(key); HMACEngine<SHA2Engine224> hmac4(key);
hmac4.update(data); hmac4.update(data);
digest = DigestEngine::digestToHex(hmac4.digest()); digest = DigestEngine::digestToHex(hmac4.digest());
@ -131,7 +131,7 @@ void HMACEngineTest::testHMAC_SHA2_224()
digest = DigestEngine::digestToHex(d, d.size()+1); digest = DigestEngine::digestToHex(d, d.size()+1);
fail("Invalid digest length, must throw."); fail("Invalid digest length, must throw.");
} }
catch(const Poco::InvalidArgumentException& e) {} catch(const Poco::InvalidArgumentException&) {}
} }
@ -166,7 +166,7 @@ void HMACEngineTest::testHMAC_SHA2_256()
0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19
}; };
key = std::string(str.begin(), str.end()); // 25 bytes key = std::string(str.begin(), str.end()); // 25 bytes
data = std::string(50, 0xcd); data = std::string(50, (char)0xcd);
HMACEngine<SHA2Engine256> hmac4(key); HMACEngine<SHA2Engine256> hmac4(key);
hmac4.update(data); hmac4.update(data);
digest = DigestEngine::digestToHex(hmac4.digest()); digest = DigestEngine::digestToHex(hmac4.digest());
@ -203,7 +203,7 @@ void HMACEngineTest::testHMAC_SHA2_256()
digest = DigestEngine::digestToHex(d, d.size()+1); digest = DigestEngine::digestToHex(d, d.size()+1);
fail("Invalid digest length, must throw."); fail("Invalid digest length, must throw.");
} }
catch(const Poco::InvalidArgumentException& e) {} catch(const Poco::InvalidArgumentException&) {}
} }
@ -244,7 +244,7 @@ void HMACEngineTest::testHMAC_SHA2_384()
0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19
}; };
key = std::string(str.begin(), str.end()); // 25 bytes key = std::string(str.begin(), str.end()); // 25 bytes
data = std::string(50, 0xcd); data = std::string(50, (char)0xcd);
HMACEngine<SHA2Engine384> hmac4(key); HMACEngine<SHA2Engine384> hmac4(key);
hmac4.update(data); hmac4.update(data);
digest = DigestEngine::digestToHex(hmac4.digest()); digest = DigestEngine::digestToHex(hmac4.digest());
@ -287,7 +287,7 @@ void HMACEngineTest::testHMAC_SHA2_384()
digest = DigestEngine::digestToHex(d, d.size()+1); digest = DigestEngine::digestToHex(d, d.size()+1);
fail("Invalid digest length, must throw."); fail("Invalid digest length, must throw.");
} }
catch(const Poco::InvalidArgumentException& e) {} catch(const Poco::InvalidArgumentException&) {}
} }
@ -331,7 +331,7 @@ void HMACEngineTest::testHMAC_SHA2_512()
0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19
}; };
key = std::string(str.begin(), str.end()); // 25 bytes key = std::string(str.begin(), str.end()); // 25 bytes
data = std::string(50, 0xcd); data = std::string(50, (char)0xcd);
HMACEngine<SHA2Engine512> hmac4(key); HMACEngine<SHA2Engine512> hmac4(key);
hmac4.update(data); hmac4.update(data);
digest = DigestEngine::digestToHex(hmac4.digest()); digest = DigestEngine::digestToHex(hmac4.digest());
@ -377,7 +377,7 @@ void HMACEngineTest::testHMAC_SHA2_512()
digest = DigestEngine::digestToHex(d, d.size()+1); digest = DigestEngine::digestToHex(d, d.size()+1);
fail("Invalid digest length, must throw."); fail("Invalid digest length, must throw.");
} }
catch(const Poco::InvalidArgumentException& e) {} catch(const Poco::InvalidArgumentException&) {}
} }