1
0
Fork 0

Codechange: remove core/mem_func.hpp

pull/13264/head
glx22 2025-05-08 00:46:56 +02:00 committed by Loïc Guilloux
parent aba5e1258e
commit 1d18b4a80b
4 changed files with 0 additions and 42 deletions

View File

@ -15,7 +15,6 @@ add_files(
kdtree.hpp
math_func.cpp
math_func.hpp
mem_func.hpp
multimap.hpp
overflowsafe_type.hpp
pool_func.cpp

View File

@ -1,39 +0,0 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file mem_func.hpp Functions related to memory operations. */
#ifndef MEM_FUNC_HPP
#define MEM_FUNC_HPP
/**
* Type-safe version of memcpy().
*
* @param destination Pointer to the destination buffer
* @param source Pointer to the source buffer
* @param num number of items to be copied. (!not number of bytes!)
*/
template <typename T>
inline void MemCpyT(T *destination, const T *source, size_t num = 1)
{
memcpy(destination, source, num * sizeof(T));
}
/**
* Type-safe version of memset().
*
* @param ptr Pointer to the destination buffer
* @param value Value to be set
* @param num number of items to be set (!not number of bytes!)
*/
template <typename T>
inline void MemSetT(T *ptr, uint8_t value, size_t num = 1)
{
memset(ptr, value, num * sizeof(T));
}
#endif /* MEM_FUNC_HPP */

View File

@ -14,7 +14,6 @@
#endif
#include "../debug.h"
#include "../os/windows/win32.h"
#include "../core/mem_func.hpp"
#include "../thread.h"
#include "../fileio_func.h"
#include "../base_media_base.h"

View File

@ -9,7 +9,6 @@
#include "../stdafx.h"
#include "../core/endian_func.hpp"
#include "../core/mem_func.hpp"
#include "../core/math_func.hpp"
#include "../error_func.h"
#include "../string_func.h"