From fb5ecb94992e7febf4bc059cb6ec4a51f50c66b0 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 2 May 2011 17:42:12 +0000 Subject: (svn r22411) -Document: another bunch of bits --- src/core/endian_type.hpp | 4 ++++ src/core/pool_func.hpp | 4 ++++ src/core/smallvec_type.hpp | 10 +++++++++- src/core/string_compare_type.hpp | 7 +++++++ 4 files changed, 24 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/endian_type.hpp b/src/core/endian_type.hpp index ad0b814c6..dbb7faec6 100644 --- a/src/core/endian_type.hpp +++ b/src/core/endian_type.hpp @@ -13,12 +13,16 @@ #define ENDIAN_TYPE_HPP #if defined(ARM) || defined(__arm__) || defined(__alpha__) + /** The architecture requires aligned access. */ #define OTTD_ALIGNMENT 1 #else + /** The architecture does not require aligned access. */ #define OTTD_ALIGNMENT 0 #endif +/** Little endian builds use this for TTD_ENDIAN. */ #define TTD_LITTLE_ENDIAN 0 +/** Big endian builds use this for TTD_ENDIAN. */ #define TTD_BIG_ENDIAN 1 /* Windows has always LITTLE_ENDIAN */ diff --git a/src/core/pool_func.hpp b/src/core/pool_func.hpp index 0d9c23165..8f53c66f9 100644 --- a/src/core/pool_func.hpp +++ b/src/core/pool_func.hpp @@ -16,6 +16,10 @@ #include "mem_func.hpp" #include "pool_type.hpp" +/** + * Helper for defining the method's signature. + * @param type The return type of the method. + */ #define DEFINE_POOL_METHOD(type) \ template \ type Pool diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 8116ca2ea..00fb7c5a0 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -35,12 +35,20 @@ protected: public: SmallVector() : data(NULL), items(0), capacity(0) { } + /** + * Copy constructor. + * @param other The other vector to copy. + */ template SmallVector(const SmallVector &other) : data(NULL), items(0), capacity(0) { MemCpyT(this->Append(other.Length()), other.Begin(), other.Length()); } + /** + * Assignment. + * @param other The new vector that. + */ template SmallVector &operator=(const SmallVector &other) { @@ -318,6 +326,6 @@ public: } }; -typedef AutoFreeSmallVector StringList; +typedef AutoFreeSmallVector StringList; ///< Type for a list of strings. #endif /* SMALLVEC_TYPE_HPP */ diff --git a/src/core/string_compare_type.hpp b/src/core/string_compare_type.hpp index 2bc018feb..77180747b 100644 --- a/src/core/string_compare_type.hpp +++ b/src/core/string_compare_type.hpp @@ -12,7 +12,14 @@ #ifndef STRING_COMPARE_TYPE_HPP #define STRING_COMPARE_TYPE_HPP +/** Comparator for strings. */ struct StringCompare { + /** + * Compare two strings. + * @param a The first string. + * @param b The second string. + * @return True is the first string is deemed "lower" than the second string. + */ bool operator () (const char *a, const char *b) const { return strcmp(a, b) < 0; -- cgit v1.2.3-70-g09d2