Merge pull request #48239 from akien-mga/goodbye-copymem

Core: Drop custom `copymem`/`zeromem` defines
This commit is contained in:
Rémi Verschelde 2021-04-28 11:04:05 +02:00 committed by GitHub
commit 305b2a15bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 200 additions and 268 deletions

View file

@ -31,7 +31,6 @@
#include "basis.h"
#include "core/math/math_funcs.h"
#include "core/os/copymem.h"
#include "core/string/print_string.h"
#define cofac(row1, col1, row2, col2) \

View file

@ -343,7 +343,7 @@ void DynamicBVH::aabb_query(const AABB &p_box, QueryResult &r_result) {
if (depth > threshold) {
if (aux_stack.is_empty()) {
aux_stack.resize(ALLOCA_STACK_SIZE * 2);
copymem(aux_stack.ptr(), stack, ALLOCA_STACK_SIZE * sizeof(const Node *));
memcpy(aux_stack.ptr(), stack, ALLOCA_STACK_SIZE * sizeof(const Node *));
} else {
aux_stack.resize(aux_stack.size() * 2);
}
@ -399,7 +399,7 @@ void DynamicBVH::convex_query(const Plane *p_planes, int p_plane_count, const Ve
if (depth > threshold) {
if (aux_stack.is_empty()) {
aux_stack.resize(ALLOCA_STACK_SIZE * 2);
copymem(aux_stack.ptr(), stack, ALLOCA_STACK_SIZE * sizeof(const Node *));
memcpy(aux_stack.ptr(), stack, ALLOCA_STACK_SIZE * sizeof(const Node *));
} else {
aux_stack.resize(aux_stack.size() * 2);
}
@ -456,7 +456,7 @@ void DynamicBVH::ray_query(const Vector3 &p_from, const Vector3 &p_to, QueryResu
if (depth > threshold) {
if (aux_stack.is_empty()) {
aux_stack.resize(ALLOCA_STACK_SIZE * 2);
copymem(aux_stack.ptr(), stack, ALLOCA_STACK_SIZE * sizeof(const Node *));
memcpy(aux_stack.ptr(), stack, ALLOCA_STACK_SIZE * sizeof(const Node *));
} else {
aux_stack.resize(aux_stack.size() * 2);
}

View file

@ -358,7 +358,7 @@ Vector<Point2i> Geometry2D::pack_rects(const Vector<Size2i> &p_sizes, const Size
Vector<Vector3i> Geometry2D::partial_pack_rects(const Vector<Vector2i> &p_sizes, const Size2i &p_atlas_size) {
Vector<stbrp_node> nodes;
nodes.resize(p_atlas_size.width);
zeromem(nodes.ptrw(), sizeof(stbrp_node) * nodes.size());
memset(nodes.ptrw(), 0, sizeof(stbrp_node) * nodes.size());
stbrp_context context;
stbrp_init_target(&context, p_atlas_size.width, p_atlas_size.height, nodes.ptrw(), p_atlas_size.width);

View file

@ -31,7 +31,6 @@
#include "transform.h"
#include "core/math/math_funcs.h"
#include "core/os/copymem.h"
#include "core/string/print_string.h"
void Transform::affine_invert() {