mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-12 00:18:37 +00:00
[Strings] Add more number formatters (#2873)
* [Strings] Add more number formatters # Notes - Adds `Strings::ToUnsignedInt` for `uint32` support. - Adds `Strings::ToBigInt` for `int64` support. - Adds `Strings::ToUnsignedBigInt` for `uint64` support. - Adds `Strings::ToFloat` for `float` support. - Replaces all `std::stoi` references with `Strings::ToInt`. - Replaces all `atoi` references with `Strings::ToInt`. - Replaces all `std::stoul` references with `Strings::ToUnsignedInt`. - Replaces all `atoul` references with `Strings::ToUnsignedInt`. - Replaces all `std::stoll` references with `Strings::ToBigInt`. - Replaces all `atoll` references with `Strings::ToBigInt`. - Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `atoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `std::stof` references with `Strings::ToFloat`. * [Strings] Add more number formatters - Adds `Strings::ToUnsignedInt` for `uint32` support. - Adds `Strings::ToBigInt` for `int64` support. - Adds `Strings::ToUnsignedBigInt` for `uint64` support. - Adds `Strings::ToFloat` for `float` support. - Replaces all `std::stoi` references with `Strings::ToInt`. - Replaces all `atoi` references with `Strings::ToInt`. - Replaces all `std::stoul` references with `Strings::ToUnsignedInt`. - Replaces all `atoul` references with `Strings::ToUnsignedInt`. - Replaces all `std::stoll` references with `Strings::ToBigInt`. - Replaces all `atoll` references with `Strings::ToBigInt`. - Replaces all `std::stoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `atoull` references with `Strings::ToUnsignedBigInt`. - Replaces all `std::stof` references with `Strings::ToFloat`. * Rebase cleanup * Changes/benchmarks/tests --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -60,7 +60,7 @@ void EQEmuDatabase::GetPlayer(std::string name)
|
||||
while ((row = mysql_fetch_row(res)) != NULL)
|
||||
{
|
||||
player_entry pe;
|
||||
pe.id = atoi(row[1]);
|
||||
pe.id = Strings::ToInt(row[1]);
|
||||
pe.data = new char[sizeof(PlayerProfile_Struct)];
|
||||
memcpy(pe.data, row[0], sizeof(PlayerProfile_Struct));
|
||||
player_list.push_back(pe);
|
||||
@@ -97,7 +97,7 @@ void EQEmuDatabase::GetPlayers()
|
||||
while ((row = mysql_fetch_row(res)) != NULL)
|
||||
{
|
||||
player_entry pe;
|
||||
pe.id = atoi(row[1]);
|
||||
pe.id = Strings::ToInt(row[1]);
|
||||
pe.data = new char[sizeof(PlayerProfile_Struct)];
|
||||
memcpy(pe.data, row[0], sizeof(PlayerProfile_Struct));
|
||||
player_list.push_back(pe);
|
||||
|
||||
Reference in New Issue
Block a user