diff options
author | Patric Stout <truebrain@openttd.org> | 2021-06-03 16:55:08 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-06-03 17:30:00 +0200 |
commit | 28e90769f74e55ea7c8f75146d5b33e0aa777da8 (patch) | |
tree | eeff0974346ef9da7cbc2b33b040d016c341ff0b /src/core/pool_type.hpp | |
parent | f8dd5dd00a7aa3cc5769b4bce0a1b7a63073c8ce (diff) | |
download | openttd-28e90769f74e55ea7c8f75146d5b33e0aa777da8.tar.xz |
Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
Diffstat (limited to 'src/core/pool_type.hpp')
-rw-r--r-- | src/core/pool_type.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index 33f952dde..2201d5cb0 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -90,9 +90,9 @@ struct Pool : PoolBase { size_t first_free; ///< No item with index lower than this is free (doesn't say anything about this one!) size_t first_unused; ///< This and all higher indexes are free (doesn't say anything about first_unused-1 !) size_t items; ///< Number of used indexes (non-nullptr) -#ifdef OTTD_ASSERT +#ifdef WITH_ASSERT size_t checked; ///< Number of items we checked for -#endif /* OTTD_ASSERT */ +#endif /* WITH_ASSERT */ bool cleaning; ///< True if cleaning pool (deleting all items) Titem **data; ///< Pointer to array of pointers to Titem @@ -130,9 +130,9 @@ struct Pool : PoolBase { inline bool CanAllocate(size_t n = 1) { bool ret = this->items <= Tmax_size - n; -#ifdef OTTD_ASSERT +#ifdef WITH_ASSERT this->checked = ret ? n : 0; -#endif /* OTTD_ASSERT */ +#endif /* WITH_ASSERT */ return ret; } |