diff options
author | skidd13 <skidd13@openttd.org> | 2008-06-22 15:21:51 +0000 |
---|---|---|
committer | skidd13 <skidd13@openttd.org> | 2008-06-22 15:21:51 +0000 |
commit | 640e5478862e3b83d85db6332e0d82a45a95e4ed (patch) | |
tree | 8904cbdb49b1373360cba22af59cfdea4811c6de /src/core/mem_func.hpp | |
parent | 31b002dab0cb1bcbc00c9982a72e2cd948f74de5 (diff) | |
download | openttd-640e5478862e3b83d85db6332e0d82a45a95e4ed.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.hpp | 16 |
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); |