mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-28 11:47:55 +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:
+9
-9
@@ -270,22 +270,22 @@ void ZoneDatabase::RefreshPetitionsFromDB()
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
newpet = new Petition(atoi(row[0]));
|
||||
newpet = new Petition(Strings::ToInt(row[0]));
|
||||
newpet->SetCName(row[1]);
|
||||
newpet->SetAName(row[2]);
|
||||
newpet->SetLastGM(row[3]);
|
||||
newpet->SetPetitionText(row[4]);
|
||||
newpet->SetZone(atoi(row[5]));
|
||||
newpet->SetUrgency(atoi(row[6]));
|
||||
newpet->SetClass(atoi(row[7]));
|
||||
newpet->SetRace(atoi(row[8]));
|
||||
newpet->SetLevel(atoi(row[9]));
|
||||
newpet->SetCheckouts(atoi(row[10]));
|
||||
newpet->SetUnavails(atoi(row[11]));
|
||||
newpet->SetZone(Strings::ToInt(row[5]));
|
||||
newpet->SetUrgency(Strings::ToInt(row[6]));
|
||||
newpet->SetClass(Strings::ToInt(row[7]));
|
||||
newpet->SetRace(Strings::ToInt(row[8]));
|
||||
newpet->SetLevel(Strings::ToInt(row[9]));
|
||||
newpet->SetCheckouts(Strings::ToInt(row[10]));
|
||||
newpet->SetUnavails(Strings::ToInt(row[11]));
|
||||
newpet->SetSentTime2(atol(row[13]));
|
||||
newpet->SetGMText(row[14]);
|
||||
|
||||
if (atoi(row[12]) == 1)
|
||||
if (Strings::ToInt(row[12]) == 1)
|
||||
newpet->SetCheckedOut(true);
|
||||
else
|
||||
newpet->SetCheckedOut(false);
|
||||
|
||||
Reference in New Issue
Block a user