int ret;
struct blob_descriptor blob;
- blob.blob_location = BLOB_IN_ATTACHED_BUFFER;
- blob.attached_buffer = (void*)buf;
- blob.size = buf_size;
+ blob_set_is_located_in_attached_buffer(&blob, (void *)buf, buf_size);
sha1_buffer(buf, buf_size, blob.hash);
blob.unhashed = 0;
blob.is_metadata = is_metadata;
struct blob_size_table *tab = _tab;
size_t pos;
struct blob_descriptor *same_size_blob;
- struct hlist_node *tmp;
pos = hash_u64(blob->size) % tab->capacity;
blob->unique_size = 1;
- hlist_for_each_entry(same_size_blob, tmp, &tab->array[pos], hash_list_2) {
+ hlist_for_each_entry(same_size_blob, &tab->array[pos], hash_list_2) {
if (same_size_blob->size == blob->size) {
blob->unique_size = 0;
same_size_blob->unique_size = 0;
wim->hdr.part_number = part_number;
wim->hdr.total_parts = total_parts;
- /* Set compression type if different. */
- if (wim->compression_type != wim->out_compression_type) {
- ret = set_wim_hdr_cflags(wim->out_compression_type, &wim->hdr);
- wimlib_assert(ret == 0);
- }
-
- /* Set chunk size if different. */
+ /* Set the compression type and chunk size. */
+ set_wim_hdr_cflags(wim->out_compression_type, &wim->hdr);
wim->hdr.chunk_size = wim->out_chunk_size;
/* Set GUID. */