MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / copywithendian

Function copywithendian

lib/lua/src/lstrlib.c:1589–1598  ·  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

1587** given 'islittle' is different from native endianness.
1588*/
1589static void copywithendian (char *dest, const char *src,
1590 int size, int islittle) {
1591 if (islittle == nativeendian.little)
1592 memcpy(dest, src, size);
1593 else {
1594 dest += size - 1;
1595 while (size-- != 0)
1596 *(dest--) = *(src++);
1597 }
1598}
1599
1600
1601static 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