* Save/Load bytes. These do not need to be converted to Little/Big Endian * so directly write them or read them to/from file * @param ptr The source or destination of the object being manipulated * @param length number of bytes this fast CopyBytes lasts */
| 781 | * @param length number of bytes this fast CopyBytes lasts |
| 782 | */ |
| 783 | static void SlCopyBytes(void *ptr, size_t length) |
| 784 | { |
| 785 | uint8_t *p = (uint8_t *)ptr; |
| 786 | |
| 787 | switch (_sl.action) { |
| 788 | case SLA_LOAD_CHECK: |
| 789 | case SLA_LOAD: |
| 790 | for (; length != 0; length--) *p++ = SlReadByte(); |
| 791 | break; |
| 792 | case SLA_SAVE: |
| 793 | for (; length != 0; length--) SlWriteByte(*p++); |
| 794 | break; |
| 795 | default: NOT_REACHED(); |
| 796 | } |
| 797 | } |
| 798 | |
| 799 | /** Get the length of the current object */ |
| 800 | size_t SlGetFieldLength() |
no test coverage detected