OpenTTD Source 20241224-master-gf74b0cf984
|
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(). | |
template<typename T > | |
void | MemMoveT (T *destination, const T *source, size_t num=1) |
Type-safe version of memmove(). | |
template<typename T > | |
void | MemSetT (T *ptr, uint8_t value, size_t num=1) |
Type-safe version of memset(). | |
template<typename T > | |
int | MemCmpT (const T *ptr1, const T *ptr2, size_t num=1) |
Type-safe version of memcmp(). | |
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(), NewGRFSpriteLayout::Clone(), NewGRFSpriteLayout::Clone(), Blitter_8bppOptimized::Draw(), and ErrorMessageData::ErrorMessageData().
|
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 VideoDriver_SDL_OpenGL::AllocateBackingStore(), DEFINE_POOL_METHOD(), Blitter_8bppOptimized::Draw(), DLSFile::LoadFile(), LoadWin32Font(), OpenGLSprite::OpenGLSprite(), StringReader::ParseFile(), DLSFile::ReadDLSWave(), VideoDriver_SDL_OpenGL::ReleaseVideoPointer(), MusicSystem::SaveCustomPlaylist(), MusicDriver_DMusic::Start(), and StationChangeInfo().