X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Flookup_table.c;h=3d2abf60539380b9ab3656cdfb72cff13f7d2777;hb=a5f0f107247cc6400c0bd25f41e49d658fd2b7d7;hp=882e7dd7048cd979f81dde2a9a611f630d3d12da;hpb=4c73e29d8d74a4e969782d2d40e209337414034c;p=wimlib diff --git a/src/lookup_table.c b/src/lookup_table.c index 882e7dd7..3d2abf60 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -33,6 +33,7 @@ #include "wimlib/metadata.h" #include "wimlib/ntfs_3g.h" #include "wimlib/resource.h" +#include "wimlib/unaligned.h" #include "wimlib/util.h" #include "wimlib/write.h" @@ -377,7 +378,7 @@ lookup_stream(const struct wim_lookup_table *table, const u8 hash[]) struct wim_lookup_table_entry *lte; struct hlist_node *pos; - i = *(size_t*)hash % table->capacity; + i = load_size_t_unaligned(hash) % table->capacity; hlist_for_each_entry(lte, pos, &table->array[i], hash_list) if (hashes_equal(hash, lte->hash)) return lte; @@ -1271,13 +1272,6 @@ write_wim_lookup_table_from_stream_list(struct list_head *stream_list, return ret; } -int -lte_zero_out_refcnt(struct wim_lookup_table_entry *lte, void *_ignore) -{ - lte->out_refcnt = 0; - return 0; -} - /* Allocate a stream entry for the contents of the buffer, or re-use an existing * entry in @lookup_table for the same stream. */ struct wim_lookup_table_entry *