mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 17:38:26 +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:
+8
-8
@@ -1471,8 +1471,8 @@ void Raid::GetRaidDetails()
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
locked = atoi(row[0]);
|
||||
LootType = atoi(row[1]);
|
||||
locked = Strings::ToInt(row[0]);
|
||||
LootType = Strings::ToInt(row[1]);
|
||||
motd = std::string(row[2]);
|
||||
}
|
||||
|
||||
@@ -1509,17 +1509,17 @@ bool Raid::LearnMembers()
|
||||
|
||||
members[index].member = nullptr;
|
||||
strn0cpy(members[index].membername, row[0], 64);
|
||||
int groupNum = atoi(row[1]);
|
||||
int groupNum = Strings::ToInt(row[1]);
|
||||
if(groupNum > 11)
|
||||
members[index].GroupNumber = 0xFFFFFFFF;
|
||||
else
|
||||
members[index].GroupNumber = groupNum;
|
||||
|
||||
members[index]._class = atoi(row[2]);
|
||||
members[index].level = atoi(row[3]);
|
||||
members[index].IsGroupLeader = atoi(row[4]);
|
||||
members[index].IsRaidLeader = atoi(row[5]);
|
||||
members[index].IsLooter = atoi(row[6]);
|
||||
members[index]._class = Strings::ToInt(row[2]);
|
||||
members[index].level = Strings::ToInt(row[3]);
|
||||
members[index].IsGroupLeader = Strings::ToInt(row[4]);
|
||||
members[index].IsRaidLeader = Strings::ToInt(row[5]);
|
||||
members[index].IsLooter = Strings::ToInt(row[6]);
|
||||
++index;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user