X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwrite.c;h=f3c12ffe4cbc8ffacced2e635ff3a352c773a21f;hp=908de9adbb17b18ca645aabe33fbfc316bdd685f;hb=f18b7fc3361c4daac0ddd104af65a8eff8466fec;hpb=b9a8ffb8938df0f58b34aef1cc57f083f28c82db diff --git a/src/write.c b/src/write.c index 908de9ad..f3c12ffe 100644 --- a/src/write.c +++ b/src/write.c @@ -32,6 +32,13 @@ # include #endif +#include +#include +#include +#include + +#include "wimlib/alloca.h" +#include "wimlib/assert.h" #include "wimlib/chunk_compressor.h" #include "wimlib/endianness.h" #include "wimlib/error.h" @@ -50,14 +57,6 @@ #include "wimlib/write.h" #include "wimlib/xml.h" -#include -#include -#include -#include - -#ifdef HAVE_ALLOCA_H -# include -#endif /* wimlib internal flags used when writing resources. */ #define WRITE_RESOURCE_FLAG_RECOMPRESS 0x00000001 @@ -517,8 +516,8 @@ end_chunk_table(struct write_streams_ctx *ctx, u64 res_actual_size, 0 != (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PACK_STREAMS)); - typedef le64 __attribute__((may_alias)) aliased_le64_t; - typedef le32 __attribute__((may_alias)) aliased_le32_t; + typedef le64 _may_alias_attribute aliased_le64_t; + typedef le32 _may_alias_attribute aliased_le32_t; if (chunk_entry_size == 4) { aliased_le32_t *entries = (aliased_le32_t*)ctx->chunk_csizes; @@ -3248,7 +3247,7 @@ overwrite_wim_inplace(WIMStruct *wim, int write_flags, unsigned num_threads) * allow any file and metadata resources to appear without returning * WIMLIB_ERR_RESOURCE_ORDER (due to the fact that we would otherwise * overwrite these resources). */ - if (!wim->deletion_occurred && !any_images_modified(wim)) { + if (!wim->image_deletion_occurred && !any_images_modified(wim)) { /* If no images have been modified and no images have been * deleted, a new lookup table does not need to be written. We * shall write the new XML data and optional integrity table @@ -3405,8 +3404,9 @@ can_overwrite_wim_inplace(const WIMStruct *wim, int write_flags) if (write_flags & WIMLIB_WRITE_FLAG_REBUILD) return false; - /* Deletions cause full rebuild by default. */ - if (wim->deletion_occurred && !(write_flags & WIMLIB_WRITE_FLAG_SOFT_DELETE)) + /* Image deletions cause full rebuild by default. */ + if (wim->image_deletion_occurred && + !(write_flags & WIMLIB_WRITE_FLAG_SOFT_DELETE)) return false; /* Pipable WIMs cannot be updated in place, nor can a non-pipable WIM be