X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fheader.c;h=5b164161e82bce404a1e8235f57d72c047a87778;hb=c6eff1f0a0721331237030bdce4490bfafd436f7;hp=0066d75a3ba7b6d9d5db40a506c4fb9b75154327;hpb=30ba1eb06caca0b20a47d8dd75a117c82d730da7;p=wimlib diff --git a/src/header.c b/src/header.c index 0066d75a..5b164161 100644 --- a/src/header.c +++ b/src/header.c @@ -72,7 +72,7 @@ struct wim_header_disk { * the only supported value). */ u32 chunk_size; - /* Globally unique identifier for the WIM file. Basically bunch of + /* Globally unique identifier for the WIM file. Basically a bunch of * random bytes. */ u8 guid[WIM_GID_LEN]; @@ -102,9 +102,9 @@ struct wim_header_disk { u32 boot_idx; /* Location and size of the WIM's integrity table, or all zeroes if the - * WIM has no integrity table. */ - - /* Note the integrity_table_res_entry here is 4-byte aligned even though + * WIM has no integrity table. + * + * Note the integrity_table_res_entry here is 4-byte aligned even though * it would ordinarily be 8-byte aligned--- hence, the _packed_attribute * on the `struct wim_header_disk' is essential. */ struct resource_entry_disk integrity_table_res_entry; @@ -120,6 +120,8 @@ read_header(const tchar *filename, int in_fd, { struct wim_header_disk disk_hdr _aligned_attribute(8); + BUILD_BUG_ON(sizeof(struct wim_header_disk) != WIM_HEADER_DISK_SIZE); + DEBUG("Reading WIM header from \"%"TS"\"", filename); if (full_pread(in_fd, &disk_hdr, sizeof(disk_hdr), 0) != sizeof(disk_hdr)) { @@ -132,7 +134,6 @@ read_header(const tchar *filename, int in_fd, return WIMLIB_ERR_NOT_A_WIM_FILE; } - BUILD_BUG_ON(sizeof(struct wim_header_disk) != WIM_HEADER_DISK_SIZE); if (le32_to_cpu(disk_hdr.hdr_size) != sizeof(struct wim_header_disk)) { ERROR("\"%"TS"\": Header size is invalid (%u bytes)", filename, le32_to_cpu(disk_hdr.hdr_size));