]> wimlib.net Git - wimlib/commitdiff
Always use abbreviated integer types in library code
authorEric Biggers <ebiggers3@gmail.com>
Thu, 7 May 2015 01:26:21 +0000 (20:26 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 7 May 2015 01:26:40 +0000 (20:26 -0500)
include/wimlib/apply.h
include/wimlib/inode.h
include/wimlib/security.h
include/wimlib/wof.h
src/extract.c
src/ntfs-3g_apply.c
src/security.c
src/unix_apply.c
src/verify.c
src/win32_apply.c
src/write.c

index 3d7873e7499fcc7c60e7b025159e56b8e2fa8972..e4c741b88c39c9ebdc488083c19508276f7fbbdf 100644 (file)
@@ -103,10 +103,10 @@ maybe_do_file_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)
 }
 
 extern int
-start_file_structure_phase(struct apply_ctx *ctx, uint64_t end_file_count);
+start_file_structure_phase(struct apply_ctx *ctx, u64 end_file_count);
 
 extern int
-start_file_metadata_phase(struct apply_ctx *ctx, uint64_t end_file_count);
+start_file_metadata_phase(struct apply_ctx *ctx, u64 end_file_count);
 
 /* Report that a file was created, prior to blob extraction.  */
 static inline int
index f516a1f89060bf411ac53b343ca7e96008a35b56..8455e667b47044b2bc2d52ea3962d9b93d36a5d7 100644 (file)
@@ -161,7 +161,7 @@ struct wim_inode {
         * wimlib sets out-of-bounds indices and values less than -1 in this
         * field to -1.  So the extraction code need not do an upper bound check
         * after checking for -1 (or equivalently < 0).  */
-       int32_t i_security_id;
+       s32 i_security_id;
 
        /* Identity of a reparse point.  See
         * http://msdn.microsoft.com/en-us/library/windows/desktop/aa365503(v=vs.85).aspx
index 002aef4cc36d16f7b829882bc21fa8da51db99d1..5c864ddd7754e4fbe853d90a1a6bb31d9df1584f 100644 (file)
@@ -12,7 +12,7 @@ struct avl_tree_node;
 struct wim_sd_set {
        struct wim_security_data *sd;
        struct avl_tree_node *root;
-       int32_t orig_num_entries;
+       s32 orig_num_entries;
 };
 
 /* Table of security descriptors for a WIM image. */
@@ -41,7 +41,7 @@ rollback_new_security_descriptors(struct wim_sd_set *sd_set);
 extern void
 destroy_sd_set(struct wim_sd_set *sd_set);
 
-extern int32_t
+extern s32
 sd_set_add_sd(struct wim_sd_set *sd_set, const char descriptor[],
              size_t size);
 
index 2c690c48d34e17a47466e6038d1d508e451f2f54..0715211ddaef45aa18cf8587f3d11760fe788c55 100644 (file)
@@ -378,32 +378,32 @@ struct wim_provider_external_info {
 struct wim_provider_overlay_entry {
        /* Byte offset of the next entry from the beginning of this structure,
         * or 0 if there are no more entries.  */
-       uint32_t next_entry_offset;
+       u32 next_entry_offset;
 
-       uint32_t padding;
+       u32 padding;
 
        /* Identifier for the WIM file.  */
-       uint64_t data_source_id;
+       u64 data_source_id;
 
        /* GUID of the WIM file.  */
-       uint8_t guid[16];
+       u8 guid[16];
 
        /* Byte offset of the WIM's file name from the beginning of this
         * structure.  */
-       uint32_t wim_file_name_offset;
+       u32 wim_file_name_offset;
 
        /* Type of WIM file: WIM_BOOT_OS_WIM or WIM_BOOT_NOT_OS_WIM.  */
-       uint32_t wim_type;
+       u32 wim_type;
 
        /* Index of the image in the WIM to use??? (This doesn't really make
         * sense, since WIM files combine file data "blobs" for all images into
         * a single table.  Set to 1 if unsure...)  */
-       uint32_t wim_index;
+       u32 wim_index;
 
        /* 0 when WIM provider active, otherwise
         * WIM_PROVIDER_EXTERNAL_FLAG_NOT_ACTIVE or
         * WIM_PROVIDER_EXTERNAL_FLAG_SUSPENDED.  */
-       uint32_t flags;
+       u32 flags;
 
        /* Full path to the WIM in the NT device namespace, e.g.
         * "\Device\HardDiskVolume2\test.wim".  Seems to be null-terminated,
index b14489379d0275e3b734e73c81e4af02fb7a2a70..99320268e2a7a8af66a135cf927d93161d938363 100644 (file)
@@ -96,7 +96,7 @@ do_file_extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)
 }
 
 static int
-start_file_phase(struct apply_ctx *ctx, uint64_t end_file_count, enum wimlib_progress_msg msg)
+start_file_phase(struct apply_ctx *ctx, u64 end_file_count, enum wimlib_progress_msg msg)
 {
        ctx->progress.extract.current_file_count = 0;
        ctx->progress.extract.end_file_count = end_file_count;
@@ -104,13 +104,13 @@ start_file_phase(struct apply_ctx *ctx, uint64_t end_file_count, enum wimlib_pro
 }
 
 int
-start_file_structure_phase(struct apply_ctx *ctx, uint64_t end_file_count)
+start_file_structure_phase(struct apply_ctx *ctx, u64 end_file_count)
 {
        return start_file_phase(ctx, end_file_count, WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE);
 }
 
 int
-start_file_metadata_phase(struct apply_ctx *ctx, uint64_t end_file_count)
+start_file_metadata_phase(struct apply_ctx *ctx, u64 end_file_count)
 {
        return start_file_phase(ctx, end_file_count, WIMLIB_PROGRESS_MSG_EXTRACT_METADATA);
 }
index 249de4c644aa047686a5d74341075a7a193abc59..690c2207708f9d6cfc32a92650801d1f87571fbd 100644 (file)
@@ -886,11 +886,11 @@ out:
        return ret;
 }
 
-static uint64_t
+static u64
 ntfs_3g_count_dentries(const struct list_head *dentry_list)
 {
        const struct wim_dentry *dentry;
-       uint64_t count = 0;
+       u64 count = 0;
 
        list_for_each_entry(dentry, dentry_list, d_extraction_list_node) {
                count++;
index a17b889c661022f78b0f0465ea1cfd72a7628be1..b49ba69cd459f5f2640173eb49a3339a8b74ca9a 100644 (file)
@@ -230,7 +230,7 @@ free_wim_security_data(struct wim_security_data *sd)
 }
 
 struct sd_node {
-       int32_t security_id;
+       s32 security_id;
        u8 hash[SHA1_HASH_SIZE];
        struct avl_tree_node index_node;
 };
@@ -284,7 +284,7 @@ insert_sd_node(struct wim_sd_set *set, struct sd_node *new)
 
 /* Returns the index of the security descriptor having a SHA1 message digest of
  * @hash.  If not found, return -1. */
-static int32_t
+static s32
 lookup_sd(struct wim_sd_set *set, const u8 hash[SHA1_HASH_SIZE])
 {
        struct avl_tree_node *res;
@@ -305,11 +305,11 @@ lookup_sd(struct wim_sd_set *set, const u8 hash[SHA1_HASH_SIZE])
  * the security ID for it.  If a new security descriptor cannot be allocated,
  * return -1.
  */
-int32_t
+s32
 sd_set_add_sd(struct wim_sd_set *sd_set, const char *descriptor, size_t size)
 {
        u8 hash[SHA1_HASH_SIZE];
-       int32_t security_id;
+       s32 security_id;
        struct sd_node *new;
        u8 **descriptors;
        u64 *sizes;
index e6bd2321276baeae20b1f177c21b211a24cd45df..3f613537f94578776c3c8125de36d7ce9af7931b 100644 (file)
@@ -472,11 +472,11 @@ unix_create_dirs_and_empty_files(const struct list_head *dentry_list,
 
 static void
 unix_count_dentries(const struct list_head *dentry_list,
-                   uint64_t *dir_count_ret, uint64_t *empty_file_count_ret)
+                   u64 *dir_count_ret, u64 *empty_file_count_ret)
 {
        const struct wim_dentry *dentry;
-       uint64_t dir_count = 0;
-       uint64_t empty_file_count = 0;
+       u64 dir_count = 0;
+       u64 empty_file_count = 0;
 
        list_for_each_entry(dentry, dentry_list, d_extraction_list_node) {
 
@@ -723,8 +723,8 @@ unix_extract(struct list_head *dentry_list, struct apply_ctx *_ctx)
        int ret;
        struct unix_apply_ctx *ctx = (struct unix_apply_ctx *)_ctx;
        size_t path_max;
-       uint64_t dir_count;
-       uint64_t empty_file_count;
+       u64 dir_count;
+       u64 empty_file_count;
 
        /* Compute the maximum path length that will be needed, then allocate
         * some path buffers.  */
index 11b47600c9b8c58217c19ad1e87b74568b0a2e58..11efe559ed8d2a488151c57b0fdbb4afd7727443 100644 (file)
@@ -71,7 +71,7 @@ end_verify_blob(struct blob_descriptor *blob, int status, void *_ctx)
                return status;
 
        if (ctx->next_progress == progress->verify_streams.total_bytes) {
-               ctx->next_progress = ~(uint64_t)0;
+               ctx->next_progress = ~(u64)0;
                return 0;
        }
 
index b326e182a5eb788f8827c31ec0ca5f8675052299..ffcd3a1fc7a4c675216194b1ab5c270963cdf184 100644 (file)
@@ -2465,11 +2465,11 @@ do_warnings(const struct win32_apply_ctx *ctx)
        }
 }
 
-static uint64_t
+static u64
 count_dentries(const struct list_head *dentry_list)
 {
        const struct list_head *cur;
-       uint64_t count = 0;
+       u64 count = 0;
 
        list_for_each(cur, dentry_list)
                count++;
@@ -2483,7 +2483,7 @@ win32_extract(struct list_head *dentry_list, struct apply_ctx *_ctx)
 {
        int ret;
        struct win32_apply_ctx *ctx = (struct win32_apply_ctx *)_ctx;
-       uint64_t dentry_count;
+       u64 dentry_count;
 
        ret = prepare_target(dentry_list, ctx);
        if (ret)
index e33759a2abf06df184ac1282f5f38615717fc280..879a3102ddce6e246e46716eea37c9af2f9d37a0 100644 (file)
@@ -277,7 +277,7 @@ struct write_blobs_progress_data {
        wimlib_progress_func_t progfunc;
        void *progctx;
        union wimlib_progress_info progress;
-       uint64_t next_progress;
+       u64 next_progress;
 };
 
 static int
@@ -290,7 +290,7 @@ do_write_blobs_progress(struct write_blobs_progress_data *progress_data,
        if (discarded) {
                progress->write_streams.total_bytes -= complete_size;
                progress->write_streams.total_streams -= complete_count;
-               if (progress_data->next_progress != ~(uint64_t)0 &&
+               if (progress_data->next_progress != ~(u64)0 &&
                    progress_data->next_progress > progress->write_streams.total_bytes)
                {
                        progress_data->next_progress = progress->write_streams.total_bytes;
@@ -310,7 +310,7 @@ do_write_blobs_progress(struct write_blobs_progress_data *progress_data,
                        return ret;
 
                if (progress_data->next_progress == progress->write_streams.total_bytes) {
-                       progress_data->next_progress = ~(uint64_t)0;
+                       progress_data->next_progress = ~(u64)0;
                } else {
                        /* Handle rate-limiting of messages  */