summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2012-12-01 13:12:39 +0000
committeralberth <alberth@openttd.org>2012-12-01 13:12:39 +0000
commit732e073261a0c9f2d644475ec800f5acae90ec94 (patch)
treeed921e856ce535c64e5542357fb942192a656df0 /src/core
parent01d023ad3bd9f33c702aa523e2b8efbdbe3f61f9 (diff)
downloadopenttd-732e073261a0c9f2d644475ec800f5acae90ec94.tar.xz
(svn r24776) -Doc: Typo fixes, additions, and additional dots collected from various sources (including Eagle_rainbow, MinchinWeb)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/bitmath_func.hpp40
-rw-r--r--src/core/overflowsafe_type.hpp4
-rw-r--r--src/core/random_func.hpp2
3 files changed, 23 insertions, 23 deletions
diff --git a/src/core/bitmath_func.hpp b/src/core/bitmath_func.hpp
index 533f7f279..bbb59c2b0 100644
--- a/src/core/bitmath_func.hpp
+++ b/src/core/bitmath_func.hpp
@@ -13,18 +13,18 @@
#define BITMATH_FUNC_HPP
/**
- * Fetch n bits from x, started at bit s.
+ * Fetch \a n bits from \a x, started at bit \a s.
*
- * This function can be used to fetch n bits from the value x. The
- * s value set the startposition to read. The startposition is
- * count from the LSB and starts at 0. The result starts at a
+ * This function can be used to fetch \a n bits from the value \a x. The
+ * \a s value set the start position to read. The start position is
+ * count from the LSB and starts at \c 0. The result starts at a
* LSB, as this isn't just an and-bitmask but also some
* bit-shifting operations. GB(0xFF, 2, 1) will so
* return 0x01 (0000 0001) instead of
* 0x04 (0000 0100).
*
* @param x The value to read some bits.
- * @param s The startposition to read some bits.
+ * @param s The start position to read some bits.
* @param n The number of bits to read.
* @return The selected bits, aligned to a LSB.
*/
@@ -44,10 +44,10 @@ static inline uint GB(const T x, const uint8 s, const uint8 n)
* This is not a bug, its a feature.
*
* @note Parameter \a x must be a variable as the result is saved there.
- * @note To avoid unexpecting results the value of \a d should not use more
+ * @note To avoid unexpected results the value of \a d should not use more
* space as the provided space of \a n bits (log2)
* @param x The variable to change some bits
- * @param s The startposition for the new bits
+ * @param s The start position for the new bits
* @param n The size/window for the new bits
* @param d The actually new bits to save in the defined position.
* @return The new value of \a x
@@ -61,19 +61,19 @@ static inline T SB(T &x, const uint8 s, const uint8 n, const U d)
}
/**
- * Add i to n bits of x starting at bit s.
+ * Add \a i to \a n bits of \a x starting at bit \a s.
*
- * This add the value of i on n bits of x starting at bit s. The parameters x,
- * s, i are similar to #GB besides x must be a variable as the result are
+ * This adds the value of \a i on \a n bits of \a x starting at bit \a s. The parameters \a x,
+ * \a s, \a i are similar to #GB. Besides, \ a x must be a variable as the result are
* saved there. An overflow does not affect the following bits of the given
* bit window and is simply ignored.
*
* @note Parameter x must be a variable as the result is saved there.
* @param x The variable to add some bits at some position
- * @param s The startposition of the addition
+ * @param s The start position of the addition
* @param n The size/window for the addition
- * @param i The value to add at the given startposition in the given window.
- * @return The new value of x
+ * @param i The value to add at the given start position in the given window.
+ * @return The new value of \a x
*/
template <typename T, typename U>
static inline T AB(T &x, const uint8 s, const uint8 n, const U i)
@@ -87,8 +87,8 @@ static inline T AB(T &x, const uint8 s, const uint8 n, const U i)
* Checks if a bit in a value is set.
*
* This function checks if a bit inside a value is set or not.
- * The y value specific the position of the bit, started at the
- * LSB and count from 0.
+ * The \a y value specific the position of the bit, started at the
+ * LSB and count from \c 0.
*
* @param x The value to check
* @param y The position of the bit to check, started from the LSB
@@ -165,7 +165,7 @@ static inline T ClrBit(T &x, const uint8 y)
* changed and the value is also returned. Parameter y defines the bit
* to toggle and starts at the LSB with 0.
*
- * @param x The varliable to toggle the bit
+ * @param x The variable to toggle the bit
* @param y The bit position to toggle
* @return The new value of the old value with the bit toggled
*/
@@ -281,11 +281,11 @@ static inline bool HasAtMostOneBit(T value)
}
/**
- * ROtate x Left by n
+ * ROtate \a x Left by \a n
*
* @note Assumes a byte has 8 bits
* @param x The value which we want to rotate
- * @param n The number how many we waht to rotate
+ * @param n The number how many we want to rotate
* @return A bit rotated number
*/
template <typename T>
@@ -295,11 +295,11 @@ static inline T ROL(const T x, const uint8 n)
}
/**
- * ROtate x Right by n
+ * ROtate \a x Right by \a n
*
* @note Assumes a byte has 8 bits
* @param x The value which we want to rotate
- * @param n The number how many we waht to rotate
+ * @param n The number how many we want to rotate
* @return A bit rotated number
*/
template <typename T>
diff --git a/src/core/overflowsafe_type.hpp b/src/core/overflowsafe_type.hpp
index dda08d96c..cfc245c6c 100644
--- a/src/core/overflowsafe_type.hpp
+++ b/src/core/overflowsafe_type.hpp
@@ -15,7 +15,7 @@
/**
* Overflow safe template for integers, i.e. integers that will never overflow
- * you multiply the maximum value with 2, or add 2, or substract somethng from
+ * you multiply the maximum value with 2, or add 2, or subtract something from
* the minimum value, etc.
* @param T the type these integers are stored with.
* @param T_MAX the maximum value for the integers.
@@ -54,7 +54,7 @@ public:
return *this;
}
- /* Operators for addition and substraction */
+ /* Operators for addition and subtraction */
inline OverflowSafeInt operator + (const OverflowSafeInt& other) const { OverflowSafeInt result = *this; result += other; return result; }
inline OverflowSafeInt operator + (const int other) const { OverflowSafeInt result = *this; result += (int64)other; return result; }
inline OverflowSafeInt operator + (const uint other) const { OverflowSafeInt result = *this; result += (int64)other; return result; }
diff --git a/src/core/random_func.hpp b/src/core/random_func.hpp
index ea0716b9a..e91413de2 100644
--- a/src/core/random_func.hpp
+++ b/src/core/random_func.hpp
@@ -135,7 +135,7 @@ static inline bool Chance16(const uint a, const uint b)
* This function uses the same parameters as Chance16. The third parameter
* must be a variable the randomize-number from Random() is saved in.
*
- * The low 16 bits of r will already be used and can therefor not be passed to
+ * The low 16 bits of r will already be used and can therefore not be passed to
* Chance16I. One can only send the high 16 bits to Chance16I.
*
* @see Chance16I()