summaryrefslogtreecommitdiff
path: root/src/core/mem_func.hpp
diff options
context:
space:
mode:
authorskidd13 <skidd13@openttd.org>2008-06-22 15:21:51 +0000
committerskidd13 <skidd13@openttd.org>2008-06-22 15:21:51 +0000
commit8b7d893d85d2493548c023000fca99b1ce16b5f2 (patch)
tree8904cbdb49b1373360cba22af59cfdea4811c6de /src/core/mem_func.hpp
parentccd27d1e5ba03bb8b9d6e487e158358d22d26b3b (diff)
downloadopenttd-8b7d893d85d2493548c023000fca99b1ce16b5f2.tar.xz
(svn r13606) -Codechange: use "static FORCEINLINE" where possible as default for core functions (big functions use just inline instead)
Diffstat (limited to 'src/core/mem_func.hpp')
-rw-r--r--src/core/mem_func.hpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/mem_func.hpp b/src/core/mem_func.hpp
index 3d87f4290..e56ad365d 100644
--- a/src/core/mem_func.hpp
+++ b/src/core/mem_func.hpp
@@ -16,7 +16,7 @@
* @param num number of items to be copied. (!not number of bytes!)
*/
template <typename T>
-FORCEINLINE void MemCpyT(T *destination, const T *source, uint num = 1)
+static FORCEINLINE void MemCpyT(T *destination, const T *source, uint num = 1)
{
memcpy(destination, source, num * sizeof(T));
}
@@ -29,7 +29,7 @@ FORCEINLINE void MemCpyT(T *destination, const T *source, uint num = 1)
* @param num number of items to be copied. (!not number of bytes!)
*/
template <typename T>
-FORCEINLINE void MemMoveT(T *destination, const T *source, uint num = 1)
+static FORCEINLINE void MemMoveT(T *destination, const T *source, uint num = 1)
{
memmove(destination, source, num * sizeof(T));
}
@@ -42,7 +42,7 @@ FORCEINLINE void MemMoveT(T *destination, const T *source, uint num = 1)
* @param num number of items to be set (!not number of bytes!)
*/
template <typename T>
-FORCEINLINE void MemSetT(T *ptr, int value, uint num = 1)
+static FORCEINLINE void MemSetT(T *ptr, int value, uint num = 1)
{
memset(ptr, value, num * sizeof(T));
}
@@ -56,7 +56,7 @@ FORCEINLINE void MemSetT(T *ptr, int value, uint num = 1)
* @return an int value indicating the relationship between the content of the two buffers
*/
template <typename T>
-FORCEINLINE int MemCmpT(const T *ptr1, const T *ptr2, uint num = 1)
+static FORCEINLINE int MemCmpT(const T *ptr1, const T *ptr2, uint num = 1)
{
return memcmp(ptr1, ptr2, num * sizeof(T));
}
@@ -69,8 +69,8 @@ FORCEINLINE int MemCmpT(const T *ptr1, const T *ptr2, uint num = 1)
* @param ptr1 Start-pointer to the block of memory.
* @param ptr2 End-pointer to the block of memory.
*/
-template<typename T>
-FORCEINLINE void MemReverseT(T *ptr1, T *ptr2)
+template <typename T>
+static FORCEINLINE void MemReverseT(T *ptr1, T *ptr2)
{
assert(ptr1 != NULL && ptr2 != NULL);
assert(ptr1 < ptr2);
@@ -86,8 +86,8 @@ FORCEINLINE void MemReverseT(T *ptr1, T *ptr2)
* @param ptr Pointer to the block of memory.
* @param num The number of items we want to reverse.
*/
-template<typename T>
-FORCEINLINE void MemReverseT(T *ptr, uint num)
+template <typename T>
+static FORCEINLINE void MemReverseT(T *ptr, uint num)
{
assert(ptr != NULL);