** Copy 'size' bytes from 'src' to 'dest', correcting endianness if ** given 'islittle' is different from native endianness. */
| 1530 | ** given 'islittle' is different from native endianness. |
| 1531 | */ |
| 1532 | static 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 | |
| 1544 | static int str_pack (lua_State *L) { |
no outgoing calls
no test coverage detected