header cleanups
authorEric Biggers <ebiggers3@gmail.com>
Sun, 25 Jan 2015 16:35:24 +0000 (10:35 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 25 Jan 2015 16:55:09 +0000 (10:55 -0600)
49 files changed:
Makefile.am
include/wimlib/avl_tree.h
include/wimlib/decompress_common.h
include/wimlib/encoding.h
include/wimlib/file_io.h
include/wimlib/glob.h
include/wimlib/header.h
include/wimlib/integrity.h
include/wimlib/lz_mf_ops.h
include/wimlib/matchfinder_common.h
include/wimlib/sha1.h
include/wimlib/types.h
include/wimlib/wimboot.h
include/wimlib/win32_common.h
include/wimlib/wof.h
include/wimlib/xml.h
src/capture_common.c
src/compress.c
src/compress_common.c
src/compress_parallel.c
src/compress_serial.c
src/dentry.c
src/encoding.c
src/extract.c
src/file_io.c
src/header.c
src/lookup_table.c
src/lzms_common.c
src/lzms_compress.c
src/lzms_decompress.c
src/lzx_common.c
src/lzx_decompress.c
src/mount_image.c
src/ntfs-3g_capture.c
src/paths.c
src/progress.c
src/reparse.c
src/resource.c
src/split.c
src/textfile.c
src/unix_apply.c
src/update_image.c
src/wildcard.c
src/wim.c
src/wimboot.c
src/win32_capture.c
src/win32_common.c
src/write.c
src/xml.c

index 157fd59..79a91c4 100644 (file)
@@ -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       \
index a281d63..e2e2227 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <stdbool.h>
 #include <stddef.h>
-#include <inttypes.h> /* for uintptr_t */
+#include <stdint.h> /* for uintptr_t */
 
 #ifdef __GNUC__
 #  define AVL_INLINE inline __attribute__((always_inline))
index 8ed98ca..148b44e 100644 (file)
@@ -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"
 
index 3d3c685..f9e5f26 100644 (file)
@@ -1,12 +1,12 @@
 #ifndef _WIMLIB_ENCODING_H
 #define _WIMLIB_ENCODING_H
 
+#include <string.h>
+
 #include "wimlib/error.h"
 #include "wimlib/util.h"
 #include "wimlib/types.h"
 
-#include <string.h>
-
 extern void
 iconv_global_init(void);
 
index 549dc5e..34c9d40 100644 (file)
@@ -1,9 +1,9 @@
 #ifndef _WIMLIB_FILE_IO_H
 #define _WIMLIB_FILE_IO_H
 
+#include <stdbool.h>
 #include <stddef.h>
 #include <sys/types.h>
-#include <stdbool.h>
 
 /* 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
index 22ebfa9..1027ec7 100644 (file)
@@ -4,9 +4,8 @@
 #ifndef __WIN32__
 #  include <glob.h>
 #else
-
-#include <wchar.h>
 #include <stddef.h>
+#include <wchar.h>
 
 typedef struct {
        size_t    gl_pathc;
index 1254576..2cd1aba 100644 (file)
@@ -1,11 +1,11 @@
 #ifndef _WIMLIB_HEADER_H
 #define _WIMLIB_HEADER_H
 
+#include <limits.h>
+
 #include "wimlib/resource.h"
 #include "wimlib/types.h"
 
-#include <limits.h>
-
 /* Length of "Globally Unique ID" field in WIM header.  */
 #define WIM_GUID_LEN    16
 
index fa4e6a3..1fa723a 100644 (file)
@@ -1,9 +1,10 @@
 #ifndef _WIMLIB_INTEGRITY_H
 #define _WIMLIB_INTEGRITY_H
 
-#include "wimlib/types.h"
 #include <sys/types.h>
 
+#include "wimlib/types.h"
+
 #define WIM_INTEGRITY_OK 0
 #define WIM_INTEGRITY_NOT_OK -1
 #define WIM_INTEGRITY_NONEXISTENT -2
index d647571..2186534 100644 (file)
@@ -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;
index 15543ed..2372bd6 100644 (file)
 #ifndef _MATCHFINDER_COMMON_H
 #define _MATCHFINDER_COMMON_H
 
-#include "wimlib/types.h"
-
 #include <string.h>
 
+#include "wimlib/types.h"
+
 #ifndef MATCHFINDER_MAX_WINDOW_ORDER
 #  error "MATCHFINDER_MAX_WINDOW_ORDER must be defined!"
 #endif
index 9c34c89..05650e0 100644 (file)
@@ -8,11 +8,11 @@
 #ifndef _WIMLIB_SHA1_H
 #define _WIMLIB_SHA1_H
 
+#include <string.h>
+
 #include "wimlib/types.h"
 #include "wimlib/util.h"
 
-#include <string.h>
-
 #define SHA1_HASH_SIZE 20
 
 extern const u8 zero_hash[SHA1_HASH_SIZE];
index 84b55be..e838e7f 100644 (file)
@@ -1,13 +1,13 @@
 #ifndef _WIMLIB_TYPES_H
 #define _WIMLIB_TYPES_H
 
-#include "wimlib_tchar.h"
-#include "wimlib/compiler.h"
-
 #include <inttypes.h>
 #include <stdbool.h>
 #include <stddef.h>
 
+#include "wimlib_tchar.h"
+#include "wimlib/compiler.h"
+
 #ifndef _NTFS_TYPES_H
 /* Unsigned integer types of exact size in bits */
 typedef uint8_t  u8;
index c10d0dc..f9bdbe8 100644 (file)
@@ -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;
 
index e5317b6..2fc12c1 100644 (file)
@@ -1,17 +1,16 @@
 #ifndef _WIMLIB_WIN32_COMMON_H
 #define _WIMLIB_WIN32_COMMON_H
 
+#include <ntstatus.h>
 #include <windows.h>
+#include <winternl.h>
+
 #ifdef ERROR
 #  undef ERROR
 #endif
-
 #include "wimlib/types.h"
 #include "wimlib/win32.h"
 
-#include <ntstatus.h>
-#include <winternl.h>
-
 extern void
 set_errno_from_GetLastError(void);
 
index 80504a7..969be85 100644 (file)
@@ -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
index 5bb16f2..8562a0a 100644 (file)
@@ -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 */
index df45f08..cbc1aa4 100644 (file)
@@ -23,6 +23,8 @@
 #  include "config.h"
 #endif
 
+#include <string.h>
+
 #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 <string.h>
-
 /*
  * Tally a file (or directory) that has been scanned for a capture operation,
  * and possibly call the progress function provided by the library user.
index 1976579..47026e3 100644 (file)
 #  include "config.h"
 #endif
 
+#include <stdlib.h>
+#include <string.h>
+
 #include "wimlib.h"
 #include "wimlib/error.h"
 #include "wimlib/compressor_ops.h"
 #include "wimlib/util.h"
 
-#include <stdlib.h>
-#include <string.h>
-
 struct wimlib_compressor {
        const struct compressor_ops *ops;
        void *private;
index f743095..e2ad298 100644 (file)
 #  include "config.h"
 #endif
 
+#include <string.h>
+
 #include "wimlib/compress_common.h"
 #include "wimlib/util.h"
 
-#include <string.h>
-
 /* 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
index 90b81dd..acf4ea5 100644 (file)
 
 #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 <errno.h>
 #include <limits.h>
 #include <pthread.h>
 #  include <sys/sysctl.h>
 #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;
index db41957..b5eb951 100644 (file)
 #  include "config.h"
 #endif
 
+#include <string.h>
+
 #include "wimlib.h"
 #include "wimlib/assert.h"
 #include "wimlib/chunk_compressor.h"
 #include "wimlib/util.h"
 
-#include <string.h>
-
 struct serial_chunk_compressor {
        struct chunk_compressor base;
        struct wimlib_compressor *compressor;
index 38b4efa..e351a65 100644 (file)
@@ -58,6 +58,8 @@
 #  include "config.h"
 #endif
 
+#include <errno.h>
+
 #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 <errno.h>
-
 /* On-disk format of a WIM dentry (directory entry), located in the metadata
  * resource for a WIM image.  */
 struct wim_dentry_on_disk {
index 6a1148a..5819f0e 100644 (file)
 #  include "config.h"
 #endif
 
+#include <errno.h>
+#include <iconv.h>
+#include <pthread.h>
+#include <string.h>
+
 #include "wimlib.h"
+#include "wimlib/alloca.h"
 #include "wimlib/assert.h"
 #include "wimlib/encoding.h"
 #include "wimlib/endianness.h"
 #include "wimlib/list.h"
 #include "wimlib/util.h"
 
-#include <errno.h>
-#include <iconv.h>
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_ALLOCA_H
-#  include <alloca.h>
-#endif
 
 bool wimlib_mbs_is_utf8 = !TCHAR_IS_UTF16LE;
 
index ac50fa8..9d65bef 100644 (file)
 #  include "config.h"
 #endif
 
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
 #include "wimlib/apply.h"
 #include "wimlib/assert.h"
 #include "wimlib/dentry.h"
 #include "wimlib/wildcard.h"
 #include "wimlib/wim.h"
 
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
 #define WIMLIB_EXTRACT_FLAG_FROM_PIPE   0x80000000
 #define WIMLIB_EXTRACT_FLAG_IMAGEMODE   0x40000000
 
index 6807129..9455ed6 100644 (file)
@@ -23,6 +23,9 @@
 #  include "config.h"
 #endif
 
+#include <errno.h>
+#include <unistd.h>
+
 #include "wimlib/error.h"
 #include "wimlib/file_io.h"
 #include "wimlib/util.h"
 #  include "wimlib/win32.h" /* For pread(), pwrite() replacements */
 #endif
 
-#include <errno.h>
-#include <unistd.h>
-
-
 /* Wrapper around read() that checks for errors keeps retrying until all
  * requested bytes have been read or until end-of file has occurred.
  *
index 58c9046..613256f 100644 (file)
 #  include "config.h"
 #endif
 
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "wimlib.h"
+#include "wimlib/alloca.h"
 #include "wimlib/assert.h"
 #include "wimlib/endianness.h"
 #include "wimlib/error.h"
 #include "wimlib/util.h"
 #include "wimlib/wim.h"
 
-#include <limits.h>
-#include <string.h>
-#include <unistd.h>
-#ifdef HAVE_ALLOCA_H
-#  include <alloca.h>
-#else
-#  include <stdlib.h>
-#endif
-
 /*
  * Reads the header from a WIM file.
  *
index 3d2abf6..65f52b5 100644 (file)
 #  include "config.h"
 #endif
 
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h> /* for unlink()  */
+
 #include "wimlib/assert.h"
 #include "wimlib/endianness.h"
 #include "wimlib/error.h"
 #include "wimlib/util.h"
 #include "wimlib/write.h"
 
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h> /* for unlink()  */
-
 /* WIM lookup table:
  *
  * This is a logical mapping from SHA1 message digests to the data streams
index 117e2f3..d986b1d 100644 (file)
@@ -23,7 +23,6 @@
 #  include "config.h"
 #endif
 
-#include "wimlib/endianness.h"
 #include "wimlib/lzms_common.h"
 #include "wimlib/unaligned.h"
 
index ded8c0b..411d667 100644 (file)
 #  include "config.h"
 #endif
 
+#include <limits.h>
+#include <pthread.h>
+#include <string.h>
+
 #include "wimlib/compress_common.h"
 #include "wimlib/compressor_ops.h"
 #include "wimlib/endianness.h"
 #include "wimlib/unaligned.h"
 #include "wimlib/util.h"
 
-#include <string.h>
-#include <limits.h>
-#include <pthread.h>
-
 /* 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.  */
index 8cb096f..73d4486 100644 (file)
 #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"
index 0993f60..3cc6981 100644 (file)
 
 #include <string.h>
 
-#include "wimlib/bitops.h"
-#include "wimlib/endianness.h"
-#include "wimlib/lzx_common.h"
-#include "wimlib/unaligned.h"
-#include "wimlib/util.h"
-
 #ifdef __SSE2__
 #  include <emmintrin.h>
 #endif
 #  include <immintrin.h>
 #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] = {
index 67fbea9..dba2766 100644 (file)
 #  include "config.h"
 #endif
 
+#include <string.h>
+
 #include "wimlib/decompressor_ops.h"
 #include "wimlib/decompress_common.h"
 #include "wimlib/error.h"
 #include "wimlib/lzx_common.h"
 #include "wimlib/util.h"
 
-#include <string.h>
-
 /* These values are chosen for fast decompression.  */
 #define LZX_MAINCODE_TABLEBITS         11
 #define LZX_LENCODE_TABLEBITS          10
index 0672c9c..2e50d6c 100644 (file)
 #  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 <attr/xattr.h>
 #include <dirent.h>
 #include <errno.h>
+#include <fuse.h>
 #include <limits.h>
 #include <mqueue.h>
 #include <pthread.h>
 #include <unistd.h>
 #include <utime.h>
 
-#define FUSE_USE_VERSION 26
-#include <fuse.h>
-#include <attr/xattr.h>
+#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...  */
index 22b9e55..0417b0b 100644 (file)
 #ifdef WITH_NTFS_3G
 
 #include <errno.h>
-#include <stdlib.h>
-
-#ifdef HAVE_ALLOCA_H
-#  include <alloca.h>
-#endif
 
 #include <ntfs-3g/attrib.h>
 #include <ntfs-3g/reparse.h>
 #include <ntfs-3g/security.h>
 #include <ntfs-3g/volume.h>
 
+#include "wimlib/alloca.h"
 #include "wimlib/assert.h"
 #include "wimlib/capture.h"
 #include "wimlib/dentry.h"
index 4d6b4cf..32770ac 100644 (file)
 #  include "config.h"
 #endif
 
+#include <string.h>
+
 #include "wimlib.h"
 #include "wimlib/paths.h"
 #include "wimlib/util.h"
 
-#include <string.h>
-
 /* 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.  */
index b616dff..cdf0147 100644 (file)
@@ -23,6 +23,8 @@
 #  include "config.h"
 #endif
 
+#include <string.h>
+
 #include "wimlib/progress.h"
 
 int
index cf9fc68..ff46e9b 100644 (file)
@@ -23,6 +23,9 @@
 #  include "config.h"
 #endif
 
+#include <errno.h>
+
+#include "wimlib/alloca.h"
 #include "wimlib/assert.h"
 #include "wimlib/compiler.h"
 #include "wimlib/endianness.h"
 #include "wimlib/reparse.h"
 #include "wimlib/resource.h"
 
-#ifdef HAVE_ALLOCA_H
-#  include <alloca.h>
-#endif
-#include <errno.h>
-#include <stdlib.h>
-
 /*
  * Read the data from a symbolic link, junction, or mount point reparse point
  * buffer into a `struct reparse_data'.
index 13c1581..d5c26b4 100644 (file)
 #  include "config.h"
 #endif
 
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "wimlib/alloca.h"
 #include "wimlib/assert.h"
 #include "wimlib/bitops.h"
 #include "wimlib/endianness.h"
 #  include "wimlib/ntfs_3g.h"
 #endif
 
-#ifdef HAVE_ALLOCA_H
-#  include <alloca.h>
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
 
 /*
  *                         Compressed WIM resources
index 4df258a..24c2acf 100644 (file)
@@ -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"
 #include "wimlib/wim.h"
 #include "wimlib/write.h"
 
-#ifdef HAVE_ALLOCA_H
-#  include <alloca.h>
-#else
-#  include <stdlib.h>
-#endif
-
 struct swm_part_info {
        struct list_head stream_list;
        u64 size;
index 01c3959..9bd9b6a 100644 (file)
 #  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 <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
+#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)
 {
index 27f2657..afa4b72 100644 (file)
 #  include "config.h"
 #endif
 
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
+
 #include "wimlib/apply.h"
 #include "wimlib/assert.h"
 #include "wimlib/dentry.h"
 #include "wimlib/timestamp.h"
 #include "wimlib/unix_data.h"
 
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-
 /* 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
index d5e0c78..b973c21 100644 (file)
 #  include "config.h"
 #endif
 
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include "wimlib/alloca.h"
 #include "wimlib/assert.h"
 #include "wimlib/capture.h"
 #include "wimlib/dentry.h"
 #include "wimlib/progress.h"
 #include "wimlib/xml.h"
 
-#include <errno.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-
-#ifdef HAVE_ALLOCA_H
-#  include <alloca.h>
-#endif
-
 /* Saved specification of a "primitive" update operation that was performed.  */
 struct update_primitive {
        enum {
index 5715e5f..febe8ee 100644 (file)
@@ -26,6 +26,7 @@
 #endif
 
 #include <ctype.h>
+
 #include "wimlib/dentry.h"
 #include "wimlib/encoding.h"
 #include "wimlib/error.h"
index 1c0e6ef..df55562 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
 #  include "config.h"
 #endif
 
+#include <errno.h>
+#include <fcntl.h>
+#ifndef __WIN32__
+#  include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <unistd.h>
+
 #include "wimlib.h"
 #include "wimlib/assert.h"
 #include "wimlib/bitops.h"
 #include "wimlib/security.h"
 #include "wimlib/wim.h"
 #include "wimlib/xml.h"
-
 #ifdef __WIN32__
 #  include "wimlib/win32.h" /* for realpath() replacement */
 #endif
 
-#include <errno.h>
-#include <fcntl.h>
-#ifndef __WIN32__
-#  include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <unistd.h>
-
 static int
 wim_default_pack_compression_type(void)
 {
index b1db0f8..2b6a241 100644 (file)
 #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
index ab572cb..78a59e3 100644 (file)
@@ -27,6 +27,8 @@
 #  include "config.h"
 #endif
 
+#include <errno.h>
+
 #include "wimlib/win32_common.h"
 
 #include "wimlib/assert.h"
@@ -39,8 +41,6 @@
 #include "wimlib/paths.h"
 #include "wimlib/reparse.h"
 
-#include <errno.h>
-
 struct winnt_scan_stats {
        unsigned long num_get_sd_access_denied;
        unsigned long num_get_sacl_priv_notheld;
index a1c3378..f66b33a 100644 (file)
@@ -28,6 +28,7 @@
 #include <errno.h>
 
 #include "wimlib/win32_common.h"
+
 #include "wimlib/error.h"
 #include "wimlib/util.h"
 
index fcc5983..f3c12ff 100644 (file)
 #  include <sys/file.h>
 #endif
 
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "wimlib/alloca.h"
 #include "wimlib/assert.h"
 #include "wimlib/chunk_compressor.h"
 #include "wimlib/endianness.h"
 #include "wimlib/write.h"
 #include "wimlib/xml.h"
 
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#ifdef HAVE_ALLOCA_H
-#  include <alloca.h>
-#endif
 
 /* wimlib internal flags used when writing resources.  */
 #define WRITE_RESOURCE_FLAG_RECOMPRESS         0x00000001
index 3825005..22966e0 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
 #  include "config.h"
 #endif
 
+#include <libxml/encoding.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xmlwriter.h>
+#include <string.h>
+
 #include "wimlib/assert.h"
 #include "wimlib/dentry.h"
 #include "wimlib/encoding.h"
 #include "wimlib/xml.h"
 #include "wimlib/write.h"
 
-#include <libxml/encoding.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <libxml/xmlwriter.h>
-#include <limits.h>
-#include <string.h>
-#include <unistd.h>
-
 /* Structures used to form an in-memory representation of the XML data (other
  * than the raw parse tree from libxml). */