DEV9: Fix function parameter should be passed by const reference warnings.

Codacy.
This commit is contained in:
lightningterror 2024-06-30 17:18:53 +02:00
parent bed31d3903
commit 3f952c88a4
2 changed files with 6 additions and 6 deletions

View File

@ -66,7 +66,7 @@ namespace PacketReader::IP::UDP::DHCP
NetLib::WriteByteArray(buffer, offset, dnsServers.size() * 4, (u8*)&dnsServers[0]);
}
DHCPopHostName::DHCPopHostName(std::string name)
DHCPopHostName::DHCPopHostName(const std::string& name)
{
if (name.size() > 255)
{
@ -298,7 +298,7 @@ namespace PacketReader::IP::UDP::DHCP
NetLib::WriteByteArray(buffer, offset, requests.size(), &requests[0]);
}
DHCPopMSGStr::DHCPopMSGStr(std::string msg)
DHCPopMSGStr::DHCPopMSGStr(const std::string& msg)
{
if (msg.size() > 255)
{
@ -375,7 +375,7 @@ namespace PacketReader::IP::UDP::DHCP
NetLib::WriteUInt32(buffer, offset, ipRebindingTimeT2);
}
DHCPopClassID::DHCPopClassID(std::string id)
DHCPopClassID::DHCPopClassID(const std::string& id)
{
if (id.size() > 255)
{

View File

@ -90,7 +90,7 @@ namespace PacketReader::IP::UDP::DHCP
//ASCII encoding
std::string hostName;
DHCPopHostName(std::string name);
DHCPopHostName(const std::string& name);
DHCPopHostName(u8* data, int offset); //Offset will include Kind and Len
virtual u8 GetLength() { return 2 + hostName.size(); }
@ -276,7 +276,7 @@ namespace PacketReader::IP::UDP::DHCP
//ASCII encoding
std::string message;
DHCPopMSGStr(std::string msg);
DHCPopMSGStr(const std::string& msg);
DHCPopMSGStr(u8* data, int offset); //Offset will include Kind and Len
virtual u8 GetLength() { return 2 + message.size(); }
@ -353,7 +353,7 @@ namespace PacketReader::IP::UDP::DHCP
//ASCII encoding
std::string classID;
DHCPopClassID(std::string id);
DHCPopClassID(const std::string& id);
DHCPopClassID(u8* data, int offset); //Offset will include Kind and Len
virtual u8 GetLength() { return 2 + classID.size(); }