]> wimlib.net Git - wimlib/blobdiff - include/wimlib/lookup_table.h
WIM chunk size: Calculate with existing macros when possible
[wimlib] / include / wimlib / lookup_table.h
index a01598c24896efd5a7df99b011ce1f2de17b36e1..d6bd5ee30726ecb6fb5ad22e21a4230413f1d512 100644 (file)
@@ -259,7 +259,7 @@ wim_resource_size(const struct wim_lookup_table_entry *lte)
 static inline u64
 wim_resource_chunks(const struct wim_lookup_table_entry *lte)
 {
 static inline u64
 wim_resource_chunks(const struct wim_lookup_table_entry *lte)
 {
-       return (wim_resource_size(lte) + WIM_CHUNK_SIZE - 1) / WIM_CHUNK_SIZE;
+       return DIV_ROUND_UP(wim_resource_size(lte), WIM_CHUNK_SIZE);
 }
 
 static inline u64
 }
 
 static inline u64
@@ -288,7 +288,7 @@ lte_filename_valid(const struct wim_lookup_table_entry *lte)
 }
 
 extern struct wim_lookup_table *
 }
 
 extern struct wim_lookup_table *
-new_lookup_table(size_t capacity);
+new_lookup_table(size_t capacity) _malloc_attribute;
 
 extern int
 read_lookup_table(WIMStruct *w);
 
 extern int
 read_lookup_table(WIMStruct *w);
@@ -318,10 +318,11 @@ lookup_table_unlink(struct wim_lookup_table *table, struct wim_lookup_table_entr
 }
 
 extern struct wim_lookup_table_entry *
 }
 
 extern struct wim_lookup_table_entry *
-new_lookup_table_entry(void);
+new_lookup_table_entry(void) _malloc_attribute;
 
 extern struct wim_lookup_table_entry *
 
 extern struct wim_lookup_table_entry *
-clone_lookup_table_entry(const struct wim_lookup_table_entry *lte);
+clone_lookup_table_entry(const struct wim_lookup_table_entry *lte)
+                       _malloc_attribute;
 
 extern void
 print_lookup_table_entry(const struct wim_lookup_table_entry *entry,
 
 extern void
 print_lookup_table_entry(const struct wim_lookup_table_entry *entry,