MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / copywithendian

Function copywithendian

3rd/lua-5.4.3/src/lstrlib.c:1532–1541  ·  view source on GitHub ↗

** Copy 'size' bytes from 'src' to 'dest', correcting endianness if ** given 'islittle' is different from native endianness. */

Source from the content-addressed store, hash-verified

1530** given 'islittle' is different from native endianness.
1531*/
1532static void copywithendian (char *dest, const char *src,
1533 int size, int islittle) {
1534 if (islittle == nativeendian.little)
1535 memcpy(dest, src, size);
1536 else {
1537 dest += size - 1;
1538 while (size-- != 0)
1539 *(dest--) = *(src++);
1540 }
1541}
1542
1543
1544static int str_pack (lua_State *L) {

Callers 2

str_packFunction · 0.85
str_unpackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected