OpenTTD Source
20241120-master-g6d3adc6169
|
Functions related to memory operations. More...
#include "math_func.hpp"
Go to the source code of this file.
Functions | |
template<typename T > | |
void | MemCpyT (T *destination, const T *source, size_t num=1) |
Type-safe version of memcpy(). More... | |
template<typename T > | |
void | MemMoveT (T *destination, const T *source, size_t num=1) |
Type-safe version of memmove(). More... | |
template<typename T > | |
void | MemSetT (T *ptr, uint8_t value, size_t num=1) |
Type-safe version of memset(). More... | |
template<typename T > | |
int | MemCmpT (const T *ptr1, const T *ptr2, size_t num=1) |
Type-safe version of memcmp(). More... | |
Functions related to memory operations.
Definition in file mem_func.hpp.
|
inline |
Type-safe version of memcmp().
ptr1 | Pointer to the first buffer |
ptr2 | Pointer to the second buffer |
num | Number of items to compare. (!not number of bytes!) |
Definition at line 63 of file mem_func.hpp.
Referenced by GRFGetSizeOfDataSection(), and MidiFile::ReadSMFHeader().
|
inline |
Type-safe version of memcpy().
destination | Pointer to the destination buffer |
source | Pointer to the source buffer |
num | number of items to be copied. (!not number of bytes!) |
Definition at line 23 of file mem_func.hpp.
Referenced by OutputBuffer::Add(), and NewGRFSpriteLayout::Clone().
|
inline |
Type-safe version of memmove().
destination | Pointer to the destination buffer |
source | Pointer to the source buffer |
num | number of items to be copied. (!not number of bytes!) |
Definition at line 36 of file mem_func.hpp.
|
inline |
Type-safe version of memset().
ptr | Pointer to the destination buffer |
value | Value to be set |
num | number of items to be set (!not number of bytes!) |
Definition at line 49 of file mem_func.hpp.
Referenced by DEFINE_POOL_METHOD(), DLSFile::LoadFile(), LoadNewGRFSound(), LoadWin32Font(), OpenGLSprite::OpenGLSprite(), DLSFile::ReadDLSWave(), VideoDriver_SDL_OpenGL::ReleaseVideoPointer(), and MusicSystem::SaveCustomPlaylist().