summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/basic/architecture.c8
-rw-r--r--src/basic/architecture.h6
-rw-r--r--src/basic/process-util.c4
-rw-r--r--src/shared/condition.c2
-rw-r--r--src/shared/dissect-image.c4
-rw-r--r--src/shared/dissect-image.h6
-rw-r--r--src/test/test-architecture.c2
-rw-r--r--src/test/test-condition.c2
-rw-r--r--src/test/test-gpt.c2
9 files changed, 18 insertions, 18 deletions
diff --git a/src/basic/architecture.c b/src/basic/architecture.c
index f474ed2954..773ee3c508 100644
--- a/src/basic/architecture.c
+++ b/src/basic/architecture.c
@@ -7,7 +7,7 @@
#include "string-table.h"
#include "string-util.h"
-int uname_architecture(void) {
+Architecture uname_architecture(void) {
/* Return a sanitized enum identifying the architecture we are running on. This
* is based on uname(), and the user may hence control what this returns by using
@@ -22,7 +22,7 @@ int uname_architecture(void) {
static const struct {
const char *machine;
- int arch;
+ Architecture arch;
} arch_map[] = {
#if defined(__aarch64__) || defined(__arm__)
{ "aarch64", ARCHITECTURE_ARM64 },
@@ -122,7 +122,7 @@ int uname_architecture(void) {
#endif
};
- static int cached = _ARCHITECTURE_INVALID;
+ static Architecture cached = _ARCHITECTURE_INVALID;
struct utsname u;
if (cached != _ARCHITECTURE_INVALID)
@@ -175,4 +175,4 @@ static const char *const architecture_table[_ARCHITECTURE_MAX] = {
[ARCHITECTURE_TILEGX] = "tilegx",
};
-DEFINE_STRING_TABLE_LOOKUP(architecture, int);
+DEFINE_STRING_TABLE_LOOKUP(architecture, Architecture);
diff --git a/src/basic/architecture.h b/src/basic/architecture.h
index cb4c79b84e..b86f5f35d0 100644
--- a/src/basic/architecture.h
+++ b/src/basic/architecture.h
@@ -48,7 +48,7 @@ typedef enum {
_ARCHITECTURE_INVALID = -EINVAL,
} Architecture;
-int uname_architecture(void);
+Architecture uname_architecture(void);
/*
* LIB_ARCH_TUPLE should resolve to the local library path
@@ -243,5 +243,5 @@ int uname_architecture(void);
# error "Please register your architecture here!"
#endif
-const char *architecture_to_string(int a) _const_;
-int architecture_from_string(const char *s) _pure_;
+const char *architecture_to_string(Architecture a) _const_;
+Architecture architecture_from_string(const char *s) _pure_;
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 204a5d9490..6980e0c4f6 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -1026,7 +1026,7 @@ bool oom_score_adjust_is_valid(int oa) {
}
unsigned long personality_from_string(const char *p) {
- int architecture;
+ Architecture architecture;
if (!p)
return PERSONALITY_INVALID;
@@ -1050,7 +1050,7 @@ unsigned long personality_from_string(const char *p) {
}
const char* personality_to_string(unsigned long p) {
- int architecture = _ARCHITECTURE_INVALID;
+ Architecture architecture = _ARCHITECTURE_INVALID;
if (p == PER_LINUX)
architecture = native_architecture();
diff --git a/src/shared/condition.c b/src/shared/condition.c
index ea334bfeb7..be09b852db 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -490,7 +490,7 @@ static int condition_test_virtualization(Condition *c, char **env) {
}
static int condition_test_architecture(Condition *c, char **env) {
- int a, b;
+ Architecture a, b;
assert(c);
assert(c->parameter);
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c
index f4756bf8c5..e63b168c24 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -612,7 +612,7 @@ static void dissected_partition_done(DissectedPartition *p) {
*p = (DissectedPartition) {
.partno = -1,
- .architecture = -1
+ .architecture = _ARCHITECTURE_INVALID,
};
}
@@ -917,7 +917,7 @@ int dissect_image(
if (is_gpt) {
PartitionDesignator designator = _PARTITION_DESIGNATOR_INVALID;
- int architecture = _ARCHITECTURE_INVALID;
+ Architecture architecture = _ARCHITECTURE_INVALID;
const char *stype, *sid, *fstype = NULL, *label;
sd_id128_t type_id, id;
bool rw = true, growfs = false;
diff --git a/src/shared/dissect-image.h b/src/shared/dissect-image.h
index 032126627c..b74adf5f8d 100644
--- a/src/shared/dissect-image.h
+++ b/src/shared/dissect-image.h
@@ -20,9 +20,9 @@ struct DissectedPartition {
bool found:1;
bool rw:1;
bool growfs:1;
- int partno; /* -1 if there was no partition and the images contains a file system directly */
- int architecture; /* Intended architecture: either native, secondary or unset (-1). */
- sd_id128_t uuid; /* Partition entry UUID as reported by the GPT */
+ int partno; /* -1 if there was no partition and the images contains a file system directly */
+ Architecture architecture; /* Intended architecture: either native, secondary or unset ARCHITECTURE_INVALID. */
+ sd_id128_t uuid; /* Partition entry UUID as reported by the GPT */
char *fstype;
char *node;
char *label;
diff --git a/src/test/test-architecture.c b/src/test/test-architecture.c
index 6455e5c2fa..b542fe1ddf 100644
--- a/src/test/test-architecture.c
+++ b/src/test/test-architecture.c
@@ -9,8 +9,8 @@
int main(int argc, char *argv[]) {
Virtualization v;
+ Architecture a;
const char *p;
- int a;
test_setup_logging(LOG_INFO);
diff --git a/src/test/test-condition.c b/src/test/test-condition.c
index c872a6c2b9..a637a490ec 100644
--- a/src/test/test-condition.c
+++ b/src/test/test-condition.c
@@ -276,7 +276,7 @@ TEST(condition_test_host) {
TEST(condition_test_architecture) {
Condition *condition;
const char *sa;
- int a;
+ Architecture a;
a = uname_architecture();
assert_se(a >= 0);
diff --git a/src/test/test-gpt.c b/src/test/test-gpt.c
index 05da7a9e48..5037f498bb 100644
--- a/src/test/test-gpt.c
+++ b/src/test/test-gpt.c
@@ -17,7 +17,7 @@ TEST(gpt_types_against_architectures) {
* types. Also validates whether we can properly categorize the entries. */
FOREACH_STRING(prefix, "root-", "usr-")
- for (int a = 0; a < _ARCHITECTURE_MAX; a++)
+ for (Architecture a = 0; a < _ARCHITECTURE_MAX; a++)
FOREACH_STRING(suffix, "", "-verity", "-verity-sig") {
_cleanup_free_ char *joined = NULL;
sd_id128_t id;