[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:
Alex King
2023-03-04 18:01:19 -05:00
committed by GitHub
parent be567af70d
commit 2a6cf8c8e7
261 changed files with 3178 additions and 3012 deletions
+9 -9
View File
@@ -774,16 +774,16 @@ Ground_Spawns* ZoneDatabase::LoadGroundSpawns(uint32 zone_id, int16 version, Gro
int spawnIndex=0;
for (auto row = results.begin(); row != results.end(); ++row, ++spawnIndex) {
gs->spawn[spawnIndex].max_x=atof(row[0]);
gs->spawn[spawnIndex].max_y=atof(row[1]);
gs->spawn[spawnIndex].max_z=atof(row[2]);
gs->spawn[spawnIndex].min_x=atof(row[3]);
gs->spawn[spawnIndex].min_y=atof(row[4]);
gs->spawn[spawnIndex].heading=atof(row[5]);
gs->spawn[spawnIndex].max_x=Strings::ToFloat(row[0]);
gs->spawn[spawnIndex].max_y=Strings::ToFloat(row[1]);
gs->spawn[spawnIndex].max_z=Strings::ToFloat(row[2]);
gs->spawn[spawnIndex].min_x=Strings::ToFloat(row[3]);
gs->spawn[spawnIndex].min_y=Strings::ToFloat(row[4]);
gs->spawn[spawnIndex].heading=Strings::ToFloat(row[5]);
strcpy(gs->spawn[spawnIndex].name,row[6]);
gs->spawn[spawnIndex].item=atoi(row[7]);
gs->spawn[spawnIndex].max_allowed=atoi(row[8]);
gs->spawn[spawnIndex].respawntimer=atoi(row[9]);
gs->spawn[spawnIndex].item=Strings::ToInt(row[7]);
gs->spawn[spawnIndex].max_allowed=Strings::ToInt(row[8]);
gs->spawn[spawnIndex].respawntimer=Strings::ToInt(row[9]);
}
return gs;
}