diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/algorithm.h | 2 | ||||
-rw-r--r-- | common/stream.h | 16 | ||||
-rw-r--r-- | common/util.h | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/common/algorithm.h b/common/algorithm.h index 13cdd9f991..0d3a11b348 100644 --- a/common/algorithm.h +++ b/common/algorithm.h @@ -274,7 +274,7 @@ T gcd(T a, T b) { * Replacement algorithm for iterables. * * Replaces all occurrences of "original" in [begin, end) with occurrences of "replaced". - * + * * @param[in, out] begin: First element to be examined. * @param[in] end: Last element in the seubsection. Not examined. * @param[in] original: Elements to be replaced. diff --git a/common/stream.h b/common/stream.h index c6c300fa97..e0ffc47d7f 100644 --- a/common/stream.h +++ b/common/stream.h @@ -402,6 +402,22 @@ public: #endif /** + * Read a 32-bit floating point value stored in little endian (LSB first) + * order from the stream and return it. + * Performs no error checking. The return value is undefined + * if a read error occurred (for which client code can check by + * calling err() and eos() ). + */ + FORCEINLINE float readFloatLE() { + uint32 n = readUint32LE(); + float f; + + memcpy(&f, &n, 4); + + return f; + } + + /** * Read the specified amount of data into a malloc'ed buffer * which then is wrapped into a MemoryReadStream. * The returned stream might contain less data than requested, diff --git a/common/util.h b/common/util.h index 1f635f3654..13c364e97d 100644 --- a/common/util.h +++ b/common/util.h @@ -180,7 +180,7 @@ bool isPrint(int c); /** - * Test whether the given character is a punctuation character, + * Test whether the given character is a punctuation character, * (i.e not alphanumeric. * * @param c the character to test |