From 8eb500e74f1508c4722df217fb60bdf4710fbff6 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 6 May 2015 20:26:21 -0500 Subject: [PATCH] Always use abbreviated integer types in library code --- include/wimlib/apply.h | 4 ++-- include/wimlib/inode.h | 2 +- include/wimlib/security.h | 4 ++-- include/wimlib/wof.h | 16 ++++++++-------- src/extract.c | 6 +++--- src/ntfs-3g_apply.c | 4 ++-- src/security.c | 8 ++++---- src/unix_apply.c | 10 +++++----- src/verify.c | 2 +- src/win32_apply.c | 6 +++--- src/write.c | 6 +++--- 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/include/wimlib/apply.h b/include/wimlib/apply.h index 3d7873e7..e4c741b8 100644 --- a/include/wimlib/apply.h +++ b/include/wimlib/apply.h @@ -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 diff --git a/include/wimlib/inode.h b/include/wimlib/inode.h index f516a1f8..8455e667 100644 --- a/include/wimlib/inode.h +++ b/include/wimlib/inode.h @@ -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 diff --git a/include/wimlib/security.h b/include/wimlib/security.h index 002aef4c..5c864ddd 100644 --- a/include/wimlib/security.h +++ b/include/wimlib/security.h @@ -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); diff --git a/include/wimlib/wof.h b/include/wimlib/wof.h index 2c690c48..0715211d 100644 --- a/include/wimlib/wof.h +++ b/include/wimlib/wof.h @@ -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, diff --git a/src/extract.c b/src/extract.c index b1448937..99320268 100644 --- a/src/extract.c +++ b/src/extract.c @@ -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); } diff --git a/src/ntfs-3g_apply.c b/src/ntfs-3g_apply.c index 249de4c6..690c2207 100644 --- a/src/ntfs-3g_apply.c +++ b/src/ntfs-3g_apply.c @@ -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++; diff --git a/src/security.c b/src/security.c index a17b889c..b49ba69c 100644 --- a/src/security.c +++ b/src/security.c @@ -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; diff --git a/src/unix_apply.c b/src/unix_apply.c index e6bd2321..3f613537 100644 --- a/src/unix_apply.c +++ b/src/unix_apply.c @@ -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. */ diff --git a/src/verify.c b/src/verify.c index 11b47600..11efe559 100644 --- a/src/verify.c +++ b/src/verify.c @@ -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; } diff --git a/src/win32_apply.c b/src/win32_apply.c index b326e182..ffcd3a1f 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -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) diff --git a/src/write.c b/src/write.c index e33759a2..879a3102 100644 --- a/src/write.c +++ b/src/write.c @@ -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 */ -- 2.43.0