| 114 | } |
| 115 | |
| 116 | bool check_magic(const FileHeader* header) { |
| 117 | static const char good_magic[] = {'N','6','4','R','S','Y','M','S'}; |
| 118 | static_assert(sizeof(good_magic) == sizeof(FileHeader::magic)); |
| 119 | |
| 120 | return memcmp(header->magic, good_magic, sizeof(good_magic)) == 0; |
| 121 | } |
| 122 | |
| 123 | static inline uint32_t round_up_4(uint32_t value) { |
| 124 | return (value + 3) & (~3); |