1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Core: Drop custom copymem/zeromem defines

We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.

Backport of #48239.
This commit is contained in:
Rémi Verschelde
2021-04-29 12:34:11 +02:00
parent 1db31d0afa
commit 70ae90e0e8
66 changed files with 173 additions and 242 deletions

View File

@@ -630,7 +630,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &tw_
PoolVector<uint8_t> id = mipmap_images[i]->get_data();
int len = id.size();
PoolVector<uint8_t>::Read r = id.read();
copymem(&w[ofs], r.ptr(), len);
memcpy(&w[ofs], r.ptr(), len);
ofs += len;
}
}
@@ -699,7 +699,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &tw_
int expected = total_size - ofs;
if (bytes < expected) {
//this is a compatibility workaround for older format, which saved less mipmaps2. It is still recommended the image is reimported.
zeromem(w.ptr() + bytes, (expected - bytes));
memset(w.ptr() + bytes, 0, (expected - bytes));
} else if (bytes != expected) {
ERR_FAIL_V(ERR_FILE_CORRUPT);
}
@@ -2328,7 +2328,7 @@ Error TextureLayered::load(const String &p_path) {
PoolVector<uint8_t> id = mipmap_images[i]->get_data();
int len = id.size();
PoolVector<uint8_t>::Read r = id.read();
copymem(&w[ofs], r.ptr(), len);
memcpy(&w[ofs], r.ptr(), len);
ofs += len;
}
}