* Convert to little endian format. * Returns the offset up to which the fixup was performed. */
| 407 | * Returns the offset up to which the fixup was performed. |
| 408 | */ |
| 409 | static size_t fix_member(void *data, size_t offset, size_t size_bytes) |
| 410 | { |
| 411 | uint8_t *src = (uint8_t *)data + offset; |
| 412 | |
| 413 | switch (size_bytes) { |
| 414 | case 1: |
| 415 | write_at_le8(data, *(uint8_t *)src, offset); |
| 416 | break; |
| 417 | case 2: |
| 418 | write_at_le16(data, *(uint16_t *)src, offset); |
| 419 | break; |
| 420 | case 4: |
| 421 | write_at_le32(data, *(uint32_t *)src, offset); |
| 422 | break; |
| 423 | case 8: |
| 424 | write_at_le64(data, *(uint64_t *)src, offset); |
| 425 | break; |
| 426 | default: |
| 427 | ERROR("Write size not supported %zd\n", size_bytes); |
| 428 | exit(-1); |
| 429 | } |
| 430 | return (offset + size_bytes); |
| 431 | } |
| 432 | |
| 433 | |
| 434 | static void print_subpart_dir(struct subpart_dir *s) |
no test coverage detected