aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2024-03-16 14:19:49 +0200
committerTimo Teräs <timo.teras@iki.fi>2024-03-16 14:19:49 +0200
commitf2f10d7e851ed3ff2a239c89c1a6a3612adbd63f (patch)
tree64e66f2172442b0b73c1d74c6560db49bbba9c3a
parent6425126e1ee8277136beb0afd27014b45a0273f5 (diff)
convert bitfields to be unsigned typesHEADmaster
- avoid clang warnings on sign changes from 1 to -1 - convert also to smaller main type size when useful
-rw-r--r--src/adb.h4
-rw-r--r--src/apk_database.h22
-rw-r--r--src/apk_trust.h4
-rw-r--r--src/app_adbsign.c4
-rw-r--r--src/app_audit.c2
-rw-r--r--src/app_cache.c2
-rw-r--r--src/app_del.c2
-rw-r--r--src/app_dot.c6
-rw-r--r--src/app_fix.c6
-rw-r--r--src/app_index.c2
-rw-r--r--src/app_search.c8
-rw-r--r--src/app_upgrade.c8
-rw-r--r--src/app_version.c2
-rw-r--r--src/database.c4
-rw-r--r--src/extract_v2.c12
15 files changed, 44 insertions, 44 deletions
diff --git a/src/adb.h b/src/adb.h
index 949b50c..183c5f0 100644
--- a/src/adb.h
+++ b/src/adb.h
@@ -306,8 +306,8 @@ struct adb_walk_gentext {
struct adb_walk d;
FILE *out;
int nest;
- int line_started : 1;
- int key_printed : 1;
+ unsigned int line_started : 1;
+ unsigned int key_printed : 1;
};
#define ADB_WALK_GENADB_MAX_IDB 2
diff --git a/src/apk_database.h b/src/apk_database.h
index 3efef5e..7575963 100644
--- a/src/apk_database.h
+++ b/src/apk_database.h
@@ -151,17 +151,17 @@ struct apk_database {
unsigned int pending_triggers;
unsigned int extract_flags;
unsigned int active_layers;
- int performing_self_upgrade : 1;
- int usermode : 1;
- int permanent : 1;
- int autoupdate : 1;
- int write_arch : 1;
- int script_dirs_checked : 1;
- int open_complete : 1;
- int compat_newfeatures : 1;
- int compat_notinstallable : 1;
- int sorted_names : 1;
- int sorted_installed_packages : 1;
+ unsigned int performing_self_upgrade : 1;
+ unsigned int usermode : 1;
+ unsigned int permanent : 1;
+ unsigned int autoupdate : 1;
+ unsigned int write_arch : 1;
+ unsigned int script_dirs_checked : 1;
+ unsigned int open_complete : 1;
+ unsigned int compat_newfeatures : 1;
+ unsigned int compat_notinstallable : 1;
+ unsigned int sorted_names : 1;
+ unsigned int sorted_installed_packages : 1;
struct apk_dependency_array *world;
struct apk_id_cache *id_cache;
diff --git a/src/apk_trust.h b/src/apk_trust.h
index 6e6f6b8..ee39f5a 100644
--- a/src/apk_trust.h
+++ b/src/apk_trust.h
@@ -23,8 +23,8 @@ struct apk_trust {
struct apk_digest_ctx dctx;
struct list_head trusted_key_list;
struct list_head private_key_list;
- int allow_untrusted : 1;
- int keys_loaded : 1;
+ unsigned int allow_untrusted : 1;
+ unsigned int keys_loaded : 1;
};
void apk_trust_init(struct apk_trust *trust);
diff --git a/src/app_adbsign.c b/src/app_adbsign.c
index 251375f..67bb83f 100644
--- a/src/app_adbsign.c
+++ b/src/app_adbsign.c
@@ -14,8 +14,8 @@ struct sign_ctx {
struct apk_ostream *os;
struct adb_verify_ctx vfy;
- int reset_signatures : 1;
- int signatures_written : 1;
+ unsigned int reset_signatures : 1;
+ unsigned int signatures_written : 1;
};
#define ADBSIGN_OPTIONS(OPT) \
diff --git a/src/app_audit.c b/src/app_audit.c
index 8f727aa..2315ea6 100644
--- a/src/app_audit.c
+++ b/src/app_audit.c
@@ -310,7 +310,7 @@ recurse_check:
report_audit(actx, reason, bfull, child, NULL, &fi);
if (reason != 'D' && recurse) {
atctx->dir = child;
- reason = apk_dir_foreach_file(
+ apk_dir_foreach_file(
openat(dirfd, name, O_RDONLY|O_CLOEXEC),
audit_directory_tree_item, atctx);
atctx->dir = dir;
diff --git a/src/app_cache.c b/src/app_cache.c
index ce6c8df..2b9ecdc 100644
--- a/src/app_cache.c
+++ b/src/app_cache.c
@@ -26,7 +26,7 @@
struct cache_ctx {
unsigned short solver_flags;
- int add_dependencies : 1;
+ unsigned short add_dependencies : 1;
};
#define CACHE_OPTIONS(OPT) \
diff --git a/src/app_del.c b/src/app_del.c
index bc2751a..7acb370 100644
--- a/src/app_del.c
+++ b/src/app_del.c
@@ -14,8 +14,8 @@
#include "apk_solver.h"
struct del_ctx {
- int recursive_delete : 1;
struct apk_dependency_array *world;
+ unsigned short recursive_delete : 1;
unsigned int genid;
int errors;
};
diff --git a/src/app_dot.c b/src/app_dot.c
index ed0c234..8b208da 100644
--- a/src/app_dot.c
+++ b/src/app_dot.c
@@ -17,9 +17,9 @@
#define S_EVALUATING -2
struct dot_ctx {
- int not_empty : 1;
- int errors_only : 1;
- int installed_only : 1;
+ unsigned short not_empty : 1;
+ unsigned short errors_only : 1;
+ unsigned short installed_only : 1;
};
#define DOT_OPTIONS(OPT) \
diff --git a/src/app_fix.c b/src/app_fix.c
index 19ae1bd..f87ec8c 100644
--- a/src/app_fix.c
+++ b/src/app_fix.c
@@ -16,9 +16,9 @@
struct fix_ctx {
unsigned short solver_flags;
- int fix_depends : 1;
- int fix_xattrs : 1;
- int fix_directory_permissions : 1;
+ unsigned short fix_depends : 1;
+ unsigned short fix_xattrs : 1;
+ unsigned short fix_directory_permissions : 1;
int errors;
};
diff --git a/src/app_index.c b/src/app_index.c
index d73f3e0..b4e57bf 100644
--- a/src/app_index.c
+++ b/src/app_index.c
@@ -26,7 +26,7 @@
struct counts {
struct apk_indent indent;
int unsatisfied;
- int header : 1;
+ unsigned short header : 1;
};
struct index_ctx {
diff --git a/src/app_search.c b/src/app_search.c
index 149d2a0..632f2e5 100644
--- a/src/app_search.c
+++ b/src/app_search.c
@@ -19,10 +19,10 @@ struct search_ctx {
void (*print_package)(struct search_ctx *ctx, struct apk_package *pkg);
int verbosity;
- int show_all : 1;
- int search_exact : 1;
- int search_description : 1;
- int search_origin : 1;
+ unsigned int show_all : 1;
+ unsigned int search_exact : 1;
+ unsigned int search_description : 1;
+ unsigned int search_origin : 1;
unsigned int matches;
struct apk_string_array *filter;
diff --git a/src/app_upgrade.c b/src/app_upgrade.c
index e1c0fc3..fd74a68 100644
--- a/src/app_upgrade.c
+++ b/src/app_upgrade.c
@@ -20,10 +20,10 @@ extern char **apk_argv;
struct upgrade_ctx {
unsigned short solver_flags;
- int no_self_upgrade : 1;
- int self_upgrade_only : 1;
- int ignore : 1;
- int prune : 1;
+ unsigned short no_self_upgrade : 1;
+ unsigned short self_upgrade_only : 1;
+ unsigned short ignore : 1;
+ unsigned short prune : 1;
int errors;
};
diff --git a/src/app_version.c b/src/app_version.c
index 70594af..71d5907 100644
--- a/src/app_version.c
+++ b/src/app_version.c
@@ -17,7 +17,7 @@
struct ver_ctx {
int (*action)(struct apk_database *db, struct apk_string_array *args);
const char *limchars;
- int all_tags : 1;
+ unsigned short all_tags : 1;
};
static int ver_indexes(struct apk_database *db, struct apk_string_array *args)
diff --git a/src/database.c b/src/database.c
index 0d90209..45024bc 100644
--- a/src/database.c
+++ b/src/database.c
@@ -61,8 +61,8 @@ struct install_ctx {
int script;
char **script_args;
- int script_pending : 1;
- int missing_checksum : 1;
+ unsigned int script_pending : 1;
+ unsigned int missing_checksum : 1;
struct apk_db_dir_instance *diri;
struct apk_checksum data_csum;
diff --git a/src/extract_v2.c b/src/extract_v2.c
index cc23635..cae69aa 100644
--- a/src/extract_v2.c
+++ b/src/extract_v2.c
@@ -23,12 +23,12 @@ struct apk_sign_ctx {
int action;
const EVP_MD *md;
int num_signatures;
- int control_started : 1;
- int data_started : 1;
- int has_data_checksum : 1;
- int control_verified : 1;
- int data_verified : 1;
- int allow_untrusted : 1;
+ unsigned int control_started : 1;
+ unsigned int data_started : 1;
+ unsigned int has_data_checksum : 1;
+ unsigned int control_verified : 1;
+ unsigned int data_verified : 1;
+ unsigned int allow_untrusted : 1;
char data_checksum[EVP_MAX_MD_SIZE];
struct apk_checksum identity;
EVP_MD_CTX *mdctx;