diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2021-04-02 21:08:16 +0100 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2021-04-04 08:01:54 +0100 |
commit | f481c9fc2c68ff7b83eef78d3e37982492dae981 (patch) | |
tree | 922b22de6b2e48716c763b19dcc3177e1c8f1b47 /src/misc/array.hpp | |
parent | 33c5f984f533bc101f4a92130a2b56432d5dcc08 (diff) | |
download | openttd-f481c9fc2c68ff7b83eef78d3e37982492dae981.tar.xz |
Codechange: Replace CStrA with std::string
Diffstat (limited to 'src/misc/array.hpp')
-rw-r--r-- | src/misc/array.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/misc/array.hpp b/src/misc/array.hpp index d23fb7a0d..aea58aba4 100644 --- a/src/misc/array.hpp +++ b/src/misc/array.hpp @@ -11,7 +11,7 @@ #define ARRAY_HPP #include "fixedsizearray.hpp" -#include "str.hpp" +#include "../string_func.h" /** * Flexible array with size limit. Implemented as fixed size @@ -103,14 +103,14 @@ public: */ template <typename D> void Dump(D &dmp) const { - dmp.WriteLine("capacity = %d", Tcapacity); + dmp.WriteValue("capacity", Tcapacity); uint num_items = Length(); - dmp.WriteLine("num_items = %d", num_items); - CStrA name; + dmp.WriteValue("num_items", num_items); for (uint i = 0; i < num_items; i++) { const T &item = (*this)[i]; - name.Format("item[%d]", i); - dmp.WriteStructT(name.Data(), &item); + char name[32]; + seprintf(name, lastof(name), "item[%d]", i); + dmp.WriteStructT(name, &item); } } }; |