MCPcopy Create free account
hub / github.com/DFHack/dfhack / copywithendian

Function copywithendian

depends/lua/src/lstrlib.c:1316–1327  ·  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

1314** given 'islittle' is different from native endianness.
1315*/
1316static void copywithendian (volatile char *dest, volatile const char *src,
1317 int size, int islittle) {
1318 if (islittle == nativeendian.little) {
1319 while (size-- != 0)
1320 *(dest++) = *(src++);
1321 }
1322 else {
1323 dest += size - 1;
1324 while (size-- != 0)
1325 *(dest--) = *(src++);
1326 }
1327}
1328
1329
1330static 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