From: Eric Biggers Date: Sun, 25 Jan 2015 16:35:24 +0000 (-0600) Subject: header cleanups X-Git-Tag: v1.8.0~54 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=f18b7fc3361c4daac0ddd104af65a8eff8466fec header cleanups --- diff --git a/Makefile.am b/Makefile.am index 157fd59e..79a91c4c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -94,6 +94,7 @@ libwim_la_SOURCES = \ src/xml.c \ src/xpress_compress.c \ src/xpress_decompress.c \ + include/wimlib/alloca.h \ include/wimlib/apply.h \ include/wimlib/assert.h \ include/wimlib/avl_tree.h \ diff --git a/include/wimlib/avl_tree.h b/include/wimlib/avl_tree.h index a281d635..e2e22270 100644 --- a/include/wimlib/avl_tree.h +++ b/include/wimlib/avl_tree.h @@ -16,7 +16,7 @@ #include #include -#include /* for uintptr_t */ +#include /* for uintptr_t */ #ifdef __GNUC__ # define AVL_INLINE inline __attribute__((always_inline)) diff --git a/include/wimlib/decompress_common.h b/include/wimlib/decompress_common.h index 8ed98ca8..148b44ef 100644 --- a/include/wimlib/decompress_common.h +++ b/include/wimlib/decompress_common.h @@ -11,7 +11,6 @@ #define _WIMLIB_DECOMPRESS_COMMON_H #include "wimlib/compiler.h" -#include "wimlib/endianness.h" #include "wimlib/types.h" #include "wimlib/unaligned.h" diff --git a/include/wimlib/encoding.h b/include/wimlib/encoding.h index 3d3c6852..f9e5f264 100644 --- a/include/wimlib/encoding.h +++ b/include/wimlib/encoding.h @@ -1,12 +1,12 @@ #ifndef _WIMLIB_ENCODING_H #define _WIMLIB_ENCODING_H +#include + #include "wimlib/error.h" #include "wimlib/util.h" #include "wimlib/types.h" -#include - extern void iconv_global_init(void); diff --git a/include/wimlib/file_io.h b/include/wimlib/file_io.h index 549dc5e4..34c9d40b 100644 --- a/include/wimlib/file_io.h +++ b/include/wimlib/file_io.h @@ -1,9 +1,9 @@ #ifndef _WIMLIB_FILE_IO_H #define _WIMLIB_FILE_IO_H +#include #include #include -#include /* Wrapper around a file descriptor that keeps track of offset (including in * pipes, which don't support lseek()) and a cached flag that tells whether the diff --git a/include/wimlib/glob.h b/include/wimlib/glob.h index 22ebfa9e..1027ec7c 100644 --- a/include/wimlib/glob.h +++ b/include/wimlib/glob.h @@ -4,9 +4,8 @@ #ifndef __WIN32__ # include #else - -#include #include +#include typedef struct { size_t gl_pathc; diff --git a/include/wimlib/header.h b/include/wimlib/header.h index 12545762..2cd1abaf 100644 --- a/include/wimlib/header.h +++ b/include/wimlib/header.h @@ -1,11 +1,11 @@ #ifndef _WIMLIB_HEADER_H #define _WIMLIB_HEADER_H +#include + #include "wimlib/resource.h" #include "wimlib/types.h" -#include - /* Length of "Globally Unique ID" field in WIM header. */ #define WIM_GUID_LEN 16 diff --git a/include/wimlib/integrity.h b/include/wimlib/integrity.h index fa4e6a34..1fa723a9 100644 --- a/include/wimlib/integrity.h +++ b/include/wimlib/integrity.h @@ -1,9 +1,10 @@ #ifndef _WIMLIB_INTEGRITY_H #define _WIMLIB_INTEGRITY_H -#include "wimlib/types.h" #include +#include "wimlib/types.h" + #define WIM_INTEGRITY_OK 0 #define WIM_INTEGRITY_NOT_OK -1 #define WIM_INTEGRITY_NONEXISTENT -2 diff --git a/include/wimlib/lz_mf_ops.h b/include/wimlib/lz_mf_ops.h index d6475710..2186534d 100644 --- a/include/wimlib/lz_mf_ops.h +++ b/include/wimlib/lz_mf_ops.h @@ -1,7 +1,4 @@ #include "wimlib/lz_mf.h" -extern const struct lz_mf_ops lz_null_ops; -extern const struct lz_mf_ops lz_hash_chains_ops; -extern const struct lz_mf_ops lz_binary_trees_ops; extern const struct lz_mf_ops lz_lcp_interval_tree_ops; extern const struct lz_mf_ops lz_linked_suffix_array_ops; diff --git a/include/wimlib/matchfinder_common.h b/include/wimlib/matchfinder_common.h index 15543edd..2372bd66 100644 --- a/include/wimlib/matchfinder_common.h +++ b/include/wimlib/matchfinder_common.h @@ -13,10 +13,10 @@ #ifndef _MATCHFINDER_COMMON_H #define _MATCHFINDER_COMMON_H -#include "wimlib/types.h" - #include +#include "wimlib/types.h" + #ifndef MATCHFINDER_MAX_WINDOW_ORDER # error "MATCHFINDER_MAX_WINDOW_ORDER must be defined!" #endif diff --git a/include/wimlib/sha1.h b/include/wimlib/sha1.h index 9c34c898..05650e06 100644 --- a/include/wimlib/sha1.h +++ b/include/wimlib/sha1.h @@ -8,11 +8,11 @@ #ifndef _WIMLIB_SHA1_H #define _WIMLIB_SHA1_H +#include + #include "wimlib/types.h" #include "wimlib/util.h" -#include - #define SHA1_HASH_SIZE 20 extern const u8 zero_hash[SHA1_HASH_SIZE]; diff --git a/include/wimlib/types.h b/include/wimlib/types.h index 84b55be3..e838e7fc 100644 --- a/include/wimlib/types.h +++ b/include/wimlib/types.h @@ -1,13 +1,13 @@ #ifndef _WIMLIB_TYPES_H #define _WIMLIB_TYPES_H -#include "wimlib_tchar.h" -#include "wimlib/compiler.h" - #include #include #include +#include "wimlib_tchar.h" +#include "wimlib/compiler.h" + #ifndef _NTFS_TYPES_H /* Unsigned integer types of exact size in bits */ typedef uint8_t u8; diff --git a/include/wimlib/wimboot.h b/include/wimlib/wimboot.h index c10d0dcc..f9bdbe8b 100644 --- a/include/wimlib/wimboot.h +++ b/include/wimlib/wimboot.h @@ -1,10 +1,10 @@ #ifndef _WIMBOOT_H_ #define _WIMBOOT_H_ -#include "wimlib/win32_common.h" +#include "wimlib/header.h" #include "wimlib/sha1.h" #include "wimlib/types.h" -#include "wimlib/header.h" +#include "wimlib/win32_common.h" struct wim_lookup_table_entry; diff --git a/include/wimlib/win32_common.h b/include/wimlib/win32_common.h index e5317b61..2fc12c1c 100644 --- a/include/wimlib/win32_common.h +++ b/include/wimlib/win32_common.h @@ -1,17 +1,16 @@ #ifndef _WIMLIB_WIN32_COMMON_H #define _WIMLIB_WIN32_COMMON_H +#include #include +#include + #ifdef ERROR # undef ERROR #endif - #include "wimlib/types.h" #include "wimlib/win32.h" -#include -#include - extern void set_errno_from_GetLastError(void); diff --git a/include/wimlib/wof.h b/include/wimlib/wof.h index 80504a7b..969be854 100644 --- a/include/wimlib/wof.h +++ b/include/wimlib/wof.h @@ -12,8 +12,8 @@ #ifndef _WOF_H_ #define _WOF_H_ -#include "wimlib/types.h" #include "wimlib/compiler.h" +#include "wimlib/types.h" #define WOF_CURRENT_VERSION 1 #define WOF_PROVIDER_WIM 1 diff --git a/include/wimlib/xml.h b/include/wimlib/xml.h index 5bb16f2f..8562a0a9 100644 --- a/include/wimlib/xml.h +++ b/include/wimlib/xml.h @@ -2,7 +2,6 @@ #define _WIMLIB_XML_H #include "wimlib/types.h" -#include "wimlib/file_io.h" struct wim_info; struct wim_reshdr; @@ -71,4 +70,4 @@ xml_set_memory_allocator(void *(*malloc_func)(size_t), void (*free_func)(void *), void *(*realloc_func)(void *, size_t)); -#endif +#endif /* _WIMLIB_XML_H */ diff --git a/src/capture_common.c b/src/capture_common.c index df45f08f..cbc1aa49 100644 --- a/src/capture_common.c +++ b/src/capture_common.c @@ -23,6 +23,8 @@ # include "config.h" #endif +#include + #include "wimlib/capture.h" #include "wimlib/dentry.h" #include "wimlib/error.h" @@ -32,8 +34,6 @@ #include "wimlib/textfile.h" #include "wimlib/wildcard.h" -#include - /* * Tally a file (or directory) that has been scanned for a capture operation, * and possibly call the progress function provided by the library user. diff --git a/src/compress.c b/src/compress.c index 19765792..47026e36 100644 --- a/src/compress.c +++ b/src/compress.c @@ -26,14 +26,14 @@ # include "config.h" #endif +#include +#include + #include "wimlib.h" #include "wimlib/error.h" #include "wimlib/compressor_ops.h" #include "wimlib/util.h" -#include -#include - struct wimlib_compressor { const struct compressor_ops *ops; void *private; diff --git a/src/compress_common.c b/src/compress_common.c index f7430958..e2ad298e 100644 --- a/src/compress_common.c +++ b/src/compress_common.c @@ -14,11 +14,11 @@ # include "config.h" #endif +#include + #include "wimlib/compress_common.h" #include "wimlib/util.h" -#include - /* Given the binary tree node A[subtree_idx] whose children already * satisfy the maxheap property, swap the node with its greater child * until it is greater than both its children, so that the maxheap diff --git a/src/compress_parallel.c b/src/compress_parallel.c index 90b81dd8..acf4ea58 100644 --- a/src/compress_parallel.c +++ b/src/compress_parallel.c @@ -27,15 +27,6 @@ #ifdef ENABLE_MULTITHREADED_COMPRESSION -#include "wimlib/assert.h" -#include "wimlib/chunk_compressor.h" -#include "wimlib/error.h" -#include "wimlib/list.h" -#include "wimlib/util.h" -#ifdef __WIN32__ -# include "wimlib/win32.h" /* win32_get_number_of_processors() */ -#endif - #include #include #include @@ -46,6 +37,15 @@ # include #endif +#include "wimlib/assert.h" +#include "wimlib/chunk_compressor.h" +#include "wimlib/error.h" +#include "wimlib/list.h" +#include "wimlib/util.h" +#ifdef __WIN32__ +# include "wimlib/win32.h" /* win32_get_number_of_processors() */ +#endif + struct message_queue { struct list_head list; pthread_mutex_t lock; diff --git a/src/compress_serial.c b/src/compress_serial.c index db41957a..b5eb951d 100644 --- a/src/compress_serial.c +++ b/src/compress_serial.c @@ -25,13 +25,13 @@ # include "config.h" #endif +#include + #include "wimlib.h" #include "wimlib/assert.h" #include "wimlib/chunk_compressor.h" #include "wimlib/util.h" -#include - struct serial_chunk_compressor { struct chunk_compressor base; struct wimlib_compressor *compressor; diff --git a/src/dentry.c b/src/dentry.c index 38b4efa6..e351a65c 100644 --- a/src/dentry.c +++ b/src/dentry.c @@ -58,6 +58,8 @@ # include "config.h" #endif +#include + #include "wimlib/assert.h" #include "wimlib/dentry.h" #include "wimlib/inode.h" @@ -66,8 +68,6 @@ #include "wimlib/metadata.h" #include "wimlib/paths.h" -#include - /* On-disk format of a WIM dentry (directory entry), located in the metadata * resource for a WIM image. */ struct wim_dentry_on_disk { diff --git a/src/encoding.c b/src/encoding.c index 6a1148a8..5819f0ef 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -23,7 +23,13 @@ # include "config.h" #endif +#include +#include +#include +#include + #include "wimlib.h" +#include "wimlib/alloca.h" #include "wimlib/assert.h" #include "wimlib/encoding.h" #include "wimlib/endianness.h" @@ -31,15 +37,6 @@ #include "wimlib/list.h" #include "wimlib/util.h" -#include -#include -#include -#include -#include - -#ifdef HAVE_ALLOCA_H -# include -#endif bool wimlib_mbs_is_utf8 = !TCHAR_IS_UTF16LE; diff --git a/src/extract.c b/src/extract.c index ac50fa8f..9d65bef8 100644 --- a/src/extract.c +++ b/src/extract.c @@ -39,6 +39,11 @@ # include "config.h" #endif +#include +#include +#include +#include + #include "wimlib/apply.h" #include "wimlib/assert.h" #include "wimlib/dentry.h" @@ -60,12 +65,6 @@ #include "wimlib/wildcard.h" #include "wimlib/wim.h" -#include -#include -#include -#include -#include - #define WIMLIB_EXTRACT_FLAG_FROM_PIPE 0x80000000 #define WIMLIB_EXTRACT_FLAG_IMAGEMODE 0x40000000 diff --git a/src/file_io.c b/src/file_io.c index 68071298..9455ed63 100644 --- a/src/file_io.c +++ b/src/file_io.c @@ -23,6 +23,9 @@ # include "config.h" #endif +#include +#include + #include "wimlib/error.h" #include "wimlib/file_io.h" #include "wimlib/util.h" @@ -30,10 +33,6 @@ # include "wimlib/win32.h" /* For pread(), pwrite() replacements */ #endif -#include -#include - - /* Wrapper around read() that checks for errors keeps retrying until all * requested bytes have been read or until end-of file has occurred. * diff --git a/src/header.c b/src/header.c index 58c9046c..613256fa 100644 --- a/src/header.c +++ b/src/header.c @@ -25,7 +25,12 @@ # include "config.h" #endif +#include +#include +#include + #include "wimlib.h" +#include "wimlib/alloca.h" #include "wimlib/assert.h" #include "wimlib/endianness.h" #include "wimlib/error.h" @@ -34,15 +39,6 @@ #include "wimlib/util.h" #include "wimlib/wim.h" -#include -#include -#include -#ifdef HAVE_ALLOCA_H -# include -#else -# include -#endif - /* * Reads the header from a WIM file. * diff --git a/src/lookup_table.c b/src/lookup_table.c index 3d2abf60..65f52b55 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -26,6 +26,10 @@ # include "config.h" #endif +#include +#include +#include /* for unlink() */ + #include "wimlib/assert.h" #include "wimlib/endianness.h" #include "wimlib/error.h" @@ -37,10 +41,6 @@ #include "wimlib/util.h" #include "wimlib/write.h" -#include -#include -#include /* for unlink() */ - /* WIM lookup table: * * This is a logical mapping from SHA1 message digests to the data streams diff --git a/src/lzms_common.c b/src/lzms_common.c index 117e2f32..d986b1dd 100644 --- a/src/lzms_common.c +++ b/src/lzms_common.c @@ -23,7 +23,6 @@ # include "config.h" #endif -#include "wimlib/endianness.h" #include "wimlib/lzms_common.h" #include "wimlib/unaligned.h" diff --git a/src/lzms_compress.c b/src/lzms_compress.c index ded8c0bb..411d667f 100644 --- a/src/lzms_compress.c +++ b/src/lzms_compress.c @@ -25,6 +25,10 @@ # include "config.h" #endif +#include +#include +#include + #include "wimlib/compress_common.h" #include "wimlib/compressor_ops.h" #include "wimlib/endianness.h" @@ -35,10 +39,6 @@ #include "wimlib/unaligned.h" #include "wimlib/util.h" -#include -#include -#include - /* Stucture used for writing raw bits as a series of 16-bit little endian coding * units. This starts at the *end* of the compressed data buffer and proceeds * backwards. */ diff --git a/src/lzms_decompress.c b/src/lzms_decompress.c index 8cb096f2..73d4486d 100644 --- a/src/lzms_decompress.c +++ b/src/lzms_decompress.c @@ -202,8 +202,8 @@ #endif #include "wimlib/compress_common.h" -#include "wimlib/decompressor_ops.h" #include "wimlib/decompress_common.h" +#include "wimlib/decompressor_ops.h" #include "wimlib/error.h" #include "wimlib/lzms_common.h" #include "wimlib/util.h" diff --git a/src/lzx_common.c b/src/lzx_common.c index 0993f607..3cc6981b 100644 --- a/src/lzx_common.c +++ b/src/lzx_common.c @@ -25,12 +25,6 @@ #include -#include "wimlib/bitops.h" -#include "wimlib/endianness.h" -#include "wimlib/lzx_common.h" -#include "wimlib/unaligned.h" -#include "wimlib/util.h" - #ifdef __SSE2__ # include #endif @@ -39,6 +33,12 @@ # include #endif +#include "wimlib/bitops.h" +#include "wimlib/endianness.h" +#include "wimlib/lzx_common.h" +#include "wimlib/unaligned.h" +#include "wimlib/util.h" + /* Mapping: offset slot => first match offset that uses that offset slot. */ const u32 lzx_offset_slot_base[LZX_MAX_OFFSET_SLOTS + 1] = { diff --git a/src/lzx_decompress.c b/src/lzx_decompress.c index 67fbea94..dba27665 100644 --- a/src/lzx_decompress.c +++ b/src/lzx_decompress.c @@ -54,14 +54,14 @@ # include "config.h" #endif +#include + #include "wimlib/decompressor_ops.h" #include "wimlib/decompress_common.h" #include "wimlib/error.h" #include "wimlib/lzx_common.h" #include "wimlib/util.h" -#include - /* These values are chosen for fast decompression. */ #define LZX_MAINCODE_TABLEBITS 11 #define LZX_LENCODE_TABLEBITS 10 diff --git a/src/mount_image.c b/src/mount_image.c index 0672c9c2..2e50d6c3 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -37,20 +37,12 @@ # error "FUSE mount not supported on Windows! Please configure --without-fuse" #endif -#include "wimlib/dentry.h" -#include "wimlib/encoding.h" -#include "wimlib/lookup_table.h" -#include "wimlib/metadata.h" -#include "wimlib/paths.h" -#include "wimlib/progress.h" -#include "wimlib/reparse.h" -#include "wimlib/timestamp.h" -#include "wimlib/unix_data.h" -#include "wimlib/write.h" -#include "wimlib/xml.h" +#define FUSE_USE_VERSION 26 +#include #include #include +#include #include #include #include @@ -62,9 +54,17 @@ #include #include -#define FUSE_USE_VERSION 26 -#include -#include +#include "wimlib/dentry.h" +#include "wimlib/encoding.h" +#include "wimlib/lookup_table.h" +#include "wimlib/metadata.h" +#include "wimlib/paths.h" +#include "wimlib/progress.h" +#include "wimlib/reparse.h" +#include "wimlib/timestamp.h" +#include "wimlib/unix_data.h" +#include "wimlib/write.h" +#include "wimlib/xml.h" #ifndef O_NOFOLLOW # define O_NOFOLLOW 0 /* Security only... */ diff --git a/src/ntfs-3g_capture.c b/src/ntfs-3g_capture.c index 22b9e554..0417b0b8 100644 --- a/src/ntfs-3g_capture.c +++ b/src/ntfs-3g_capture.c @@ -29,17 +29,13 @@ #ifdef WITH_NTFS_3G #include -#include - -#ifdef HAVE_ALLOCA_H -# include -#endif #include #include #include #include +#include "wimlib/alloca.h" #include "wimlib/assert.h" #include "wimlib/capture.h" #include "wimlib/dentry.h" diff --git a/src/paths.c b/src/paths.c index 4d6b4cf8..32770ac0 100644 --- a/src/paths.c +++ b/src/paths.c @@ -23,12 +23,12 @@ # include "config.h" #endif +#include + #include "wimlib.h" #include "wimlib/paths.h" #include "wimlib/util.h" -#include - /* Like the basename() function, but does not modify @path; it just returns a * pointer to it. This assumes the path separator is the * OS_PREFERRED_PATH_SEPARATOR. */ diff --git a/src/progress.c b/src/progress.c index b616dff4..cdf01473 100644 --- a/src/progress.c +++ b/src/progress.c @@ -23,6 +23,8 @@ # include "config.h" #endif +#include + #include "wimlib/progress.h" int diff --git a/src/reparse.c b/src/reparse.c index cf9fc686..ff46e9b1 100644 --- a/src/reparse.c +++ b/src/reparse.c @@ -23,6 +23,9 @@ # include "config.h" #endif +#include + +#include "wimlib/alloca.h" #include "wimlib/assert.h" #include "wimlib/compiler.h" #include "wimlib/endianness.h" @@ -33,12 +36,6 @@ #include "wimlib/reparse.h" #include "wimlib/resource.h" -#ifdef HAVE_ALLOCA_H -# include -#endif -#include -#include - /* * Read the data from a symbolic link, junction, or mount point reparse point * buffer into a `struct reparse_data'. diff --git a/src/resource.c b/src/resource.c index 13c1581f..d5c26b40 100644 --- a/src/resource.c +++ b/src/resource.c @@ -25,6 +25,11 @@ # include "config.h" #endif +#include +#include +#include + +#include "wimlib/alloca.h" #include "wimlib/assert.h" #include "wimlib/bitops.h" #include "wimlib/endianness.h" @@ -45,13 +50,6 @@ # include "wimlib/ntfs_3g.h" #endif -#ifdef HAVE_ALLOCA_H -# include -#endif -#include -#include -#include -#include /* * Compressed WIM resources diff --git a/src/split.c b/src/split.c index 4df258ac..24c2acf7 100644 --- a/src/split.c +++ b/src/split.c @@ -26,6 +26,7 @@ #endif #include "wimlib.h" +#include "wimlib/alloca.h" #include "wimlib/error.h" #include "wimlib/list.h" #include "wimlib/lookup_table.h" @@ -35,12 +36,6 @@ #include "wimlib/wim.h" #include "wimlib/write.h" -#ifdef HAVE_ALLOCA_H -# include -#else -# include -#endif - struct swm_part_info { struct list_head stream_list; u64 size; diff --git a/src/textfile.c b/src/textfile.c index 01c39592..9bd9b6a7 100644 --- a/src/textfile.c +++ b/src/textfile.c @@ -23,12 +23,6 @@ # include "config.h" #endif -#include "wimlib/encoding.h" -#include "wimlib/error.h" -#include "wimlib/file_io.h" -#include "wimlib/textfile.h" -#include "wimlib/util.h" - #include #include #include @@ -36,6 +30,12 @@ #include #include +#include "wimlib/encoding.h" +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/textfile.h" +#include "wimlib/util.h" + static int read_file_contents(const tchar *path, void **buf_ret, size_t *bufsize_ret) { diff --git a/src/unix_apply.c b/src/unix_apply.c index 27f26576..afa4b723 100644 --- a/src/unix_apply.c +++ b/src/unix_apply.c @@ -23,6 +23,14 @@ # include "config.h" #endif +#include +#include +#include +#include +#include +#include +#include + #include "wimlib/apply.h" #include "wimlib/assert.h" #include "wimlib/dentry.h" @@ -33,15 +41,6 @@ #include "wimlib/timestamp.h" #include "wimlib/unix_data.h" -#include -#include -#include -#include -#include -#include -#include -#include - /* We don't require O_NOFOLLOW, but the advantage of having it is that if we * need to extract a file to a location at which there exists a symbolic link, * open(..., O_NOFOLLOW | ...) recognizes the symbolic link rather than diff --git a/src/update_image.c b/src/update_image.c index d5e0c787..b973c21d 100644 --- a/src/update_image.c +++ b/src/update_image.c @@ -49,6 +49,11 @@ # include "config.h" #endif +#include +#include +#include + +#include "wimlib/alloca.h" #include "wimlib/assert.h" #include "wimlib/capture.h" #include "wimlib/dentry.h" @@ -64,14 +69,6 @@ #include "wimlib/progress.h" #include "wimlib/xml.h" -#include -#include -#include - -#ifdef HAVE_ALLOCA_H -# include -#endif - /* Saved specification of a "primitive" update operation that was performed. */ struct update_primitive { enum { diff --git a/src/wildcard.c b/src/wildcard.c index 5715e5fc..febe8ee0 100644 --- a/src/wildcard.c +++ b/src/wildcard.c @@ -26,6 +26,7 @@ #endif #include + #include "wimlib/dentry.h" #include "wimlib/encoding.h" #include "wimlib/error.h" diff --git a/src/wim.c b/src/wim.c index 1c0e6efd..df555621 100644 --- a/src/wim.c +++ b/src/wim.c @@ -23,6 +23,14 @@ # include "config.h" #endif +#include +#include +#ifndef __WIN32__ +# include +#endif +#include +#include + #include "wimlib.h" #include "wimlib/assert.h" #include "wimlib/bitops.h" @@ -38,19 +46,10 @@ #include "wimlib/security.h" #include "wimlib/wim.h" #include "wimlib/xml.h" - #ifdef __WIN32__ # include "wimlib/win32.h" /* for realpath() replacement */ #endif -#include -#include -#ifndef __WIN32__ -# include -#endif -#include -#include - static int wim_default_pack_compression_type(void) { diff --git a/src/wimboot.c b/src/wimboot.c index b1db0f8c..2b6a2415 100644 --- a/src/wimboot.c +++ b/src/wimboot.c @@ -34,12 +34,13 @@ #endif #include "wimlib/win32_common.h" -#include "wimlib/win32.h" + #include "wimlib/assert.h" #include "wimlib/error.h" #include "wimlib/lookup_table.h" #include "wimlib/util.h" #include "wimlib/wimboot.h" +#include "wimlib/win32.h" #include "wimlib/wof.h" static HANDLE diff --git a/src/win32_capture.c b/src/win32_capture.c index ab572cb2..78a59e3b 100644 --- a/src/win32_capture.c +++ b/src/win32_capture.c @@ -27,6 +27,8 @@ # include "config.h" #endif +#include + #include "wimlib/win32_common.h" #include "wimlib/assert.h" @@ -39,8 +41,6 @@ #include "wimlib/paths.h" #include "wimlib/reparse.h" -#include - struct winnt_scan_stats { unsigned long num_get_sd_access_denied; unsigned long num_get_sacl_priv_notheld; diff --git a/src/win32_common.c b/src/win32_common.c index a1c3378e..f66b33a9 100644 --- a/src/win32_common.c +++ b/src/win32_common.c @@ -28,6 +28,7 @@ #include #include "wimlib/win32_common.h" + #include "wimlib/error.h" #include "wimlib/util.h" diff --git a/src/write.c b/src/write.c index fcc5983f..f3c12ffe 100644 --- a/src/write.c +++ b/src/write.c @@ -32,6 +32,12 @@ # include #endif +#include +#include +#include +#include + +#include "wimlib/alloca.h" #include "wimlib/assert.h" #include "wimlib/chunk_compressor.h" #include "wimlib/endianness.h" @@ -51,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 diff --git a/src/xml.c b/src/xml.c index 38250059..22966e0e 100644 --- a/src/xml.c +++ b/src/xml.c @@ -25,6 +25,12 @@ # include "config.h" #endif +#include +#include +#include +#include +#include + #include "wimlib/assert.h" #include "wimlib/dentry.h" #include "wimlib/encoding.h" @@ -37,14 +43,6 @@ #include "wimlib/xml.h" #include "wimlib/write.h" -#include -#include -#include -#include -#include -#include -#include - /* Structures used to form an in-memory representation of the XML data (other * than the raw parse tree from libxml). */