summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/endian_type.hpp4
-rw-r--r--src/core/pool_func.hpp4
-rw-r--r--src/core/smallvec_type.hpp10
-rw-r--r--src/core/string_compare_type.hpp7
4 files changed, 24 insertions, 1 deletions
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 <class Titem, typename Tindex, size_t Tgrowth_step, size_t Tmax_size, PoolType Tpool_type, bool Tcache, bool Tzero> \
type Pool<Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero>
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 <uint X>
SmallVector(const SmallVector<T, X> &other) : data(NULL), items(0), capacity(0)
{
MemCpyT<T>(this->Append(other.Length()), other.Begin(), other.Length());
}
+ /**
+ * Assignment.
+ * @param other The new vector that.
+ */
template <uint X>
SmallVector &operator=(const SmallVector<T, X> &other)
{
@@ -318,6 +326,6 @@ public:
}
};
-typedef AutoFreeSmallVector<char*, 4> StringList;
+typedef AutoFreeSmallVector<char*, 4> 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;