diff options
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/array.hpp | 3 | ||||
-rw-r--r-- | src/misc/blob.hpp | 18 | ||||
-rw-r--r-- | src/misc/countedptr.hpp | 6 | ||||
-rw-r--r-- | src/misc/dbg_helpers.cpp | 3 | ||||
-rw-r--r-- | src/misc/fixedsizearray.hpp | 6 | ||||
-rw-r--r-- | src/misc/hashtable.hpp | 6 |
6 files changed, 28 insertions, 14 deletions
diff --git a/src/misc/array.hpp b/src/misc/array.hpp index 78dd0098f..2832d9299 100644 --- a/src/misc/array.hpp +++ b/src/misc/array.hpp @@ -15,7 +15,8 @@ #include "fixedsizearray.hpp" #include "str.hpp" -/** Flexible array with size limit. Implemented as fixed size +/** + * Flexible array with size limit. Implemented as fixed size * array of fixed size arrays */ template <class T, uint B = 1024, uint N = B> class SmallArray { diff --git a/src/misc/blob.hpp b/src/misc/blob.hpp index d77a1b9d8..95e0ae1af 100644 --- a/src/misc/blob.hpp +++ b/src/misc/blob.hpp @@ -16,7 +16,8 @@ #include "../core/mem_func.hpp" #include <new> -/** Base class for simple binary blobs. +/** + * Base class for simple binary blobs. * Item is byte. * The word 'simple' means: * - no configurable allocator type (always made from heap) @@ -102,7 +103,8 @@ protected: return (BlobHeader*)MallocT<byte>(num_bytes); } - /** Return header pointer to the static BlobHeader with + /** + * Return header pointer to the static BlobHeader with * both items and capacity containing zero */ static FORCEINLINE BlobHeader *Zero() { @@ -231,7 +233,8 @@ public: } } - /** Reallocate if there is no free space for num_bytes bytes. + /** + * Reallocate if there is no free space for num_bytes bytes. * @return pointer to the new data to be added */ FORCEINLINE byte *Prepare(size_t num_bytes) { @@ -240,7 +243,8 @@ public: return data + Length(); } - /** Increase Length() by num_bytes. + /** + * Increase Length() by num_bytes. * @return pointer to the new data added */ FORCEINLINE byte *Append(size_t num_bytes) { @@ -286,7 +290,8 @@ public: } }; -/** Blob - simple dynamic T array. T (template argument) is a placeholder for any type. +/** + * Blob - simple dynamic T array. T (template argument) is a placeholder for any type. * T can be any integral type, pointer, or structure. Using Blob instead of just plain C array * simplifies the resource management in several ways: * 1. When adding new item(s) it automatically grows capacity if needed. @@ -380,7 +385,8 @@ public: return (T*)base::Append(num_items * type_size); } - /** Ensures that given number of items can be added to the end of Blob. Returns pointer to the + /** + * Ensures that given number of items can be added to the end of Blob. Returns pointer to the * first free (unused) item */ FORCEINLINE T *MakeFreeSpace(size_t num_items) { diff --git a/src/misc/countedptr.hpp b/src/misc/countedptr.hpp index 643c1b83b..78115c091 100644 --- a/src/misc/countedptr.hpp +++ b/src/misc/countedptr.hpp @@ -12,7 +12,8 @@ #ifndef COUNTEDPTR_HPP #define COUNTEDPTR_HPP -/** CCountedPtr - simple reference counting smart pointer. +/** + * CCountedPtr - simple reference counting smart pointer. * * One of the standard ways how to maintain object's lifetime. * @@ -136,7 +137,8 @@ template <class T> struct AdaptT { }; -/** Simple counted object. Use it as base of your struct/class if you want to use +/** + * Simple counted object. Use it as base of your struct/class if you want to use * basic reference counting. Your struct/class will destroy and free itself when * last reference to it is released (using Relese() method). The initial reference * count (when it is created) is zero (don't forget AddRef() at least one time if diff --git a/src/misc/dbg_helpers.cpp b/src/misc/dbg_helpers.cpp index 78b2ec493..f87070fa0 100644 --- a/src/misc/dbg_helpers.cpp +++ b/src/misc/dbg_helpers.cpp @@ -72,7 +72,8 @@ CStrA TileStr(TileIndex tile) return out.Transfer(); } -/** Keep track of the last assigned type_id. Used for anti-recursion. +/** + * Keep track of the last assigned type_id. Used for anti-recursion. *static*/ size_t& DumpTarget::LastTypeId() { static size_t last_type_id = 0; diff --git a/src/misc/fixedsizearray.hpp b/src/misc/fixedsizearray.hpp index 5c008089c..404db8184 100644 --- a/src/misc/fixedsizearray.hpp +++ b/src/misc/fixedsizearray.hpp @@ -14,7 +14,8 @@ #include "../core/alloc_func.hpp" -/** fixed size array +/** + * fixed size array * Upon construction it preallocates fixed size block of memory * for all items, but doesn't construct them. Item's construction * is delayed. */ @@ -32,7 +33,8 @@ protected: static const uint Tsize = sizeof(T); // size of item static const uint HeaderSize = sizeof(ArrayHeader); // size of header - /** the only member of fixed size array is pointer to the block + /** + * the only member of fixed size array is pointer to the block * of C array of items. Header can be found on the offset -sizeof(ArrayHeader). */ T *data; diff --git a/src/misc/hashtable.hpp b/src/misc/hashtable.hpp index 4c18737d3..8dd1310a7 100644 --- a/src/misc/hashtable.hpp +++ b/src/misc/hashtable.hpp @@ -106,7 +106,8 @@ struct CHashTableSlotT } }; -/** class CHashTableT<Titem, Thash_bits> - simple hash table +/** + * class CHashTableT<Titem, Thash_bits> - simple hash table * of pointers allocated elsewhere. * * Supports: Add/Find/Remove of Titems. @@ -136,7 +137,8 @@ public: static const int Tcapacity = 1 << Thash_bits; // and num of slots 2^bits protected: - /** each slot contains pointer to the first item in the list, + /** + * each slot contains pointer to the first item in the list, * Titem contains pointer to the next item - GetHashNext(), SetHashNext() */ typedef CHashTableSlotT<Titem_> Slot; |