summaryrefslogtreecommitdiff
path: root/src/basic/architecture.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-04-04 12:46:03 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-04-05 02:19:37 +0900
commit6b41a7b281943d4aef9758988baed573a9b4d67a (patch)
treeda0657b7c7771c3bfb6da460cba933c07c6266a2 /src/basic/architecture.c
parent9858e6d2e73ad967666612d5cd05b91ef57e77f5 (diff)
downloadsystemd-6b41a7b281943d4aef9758988baed573a9b4d67a.tar.gz
tree-wide: use 'Architecture' type consistently across the tree
Some parts of our tree used 'Architecture' for storing architectures, others used ints. Let's unify on the former. Inspired by #22952's rework of the 'Virtualization' enum.
Diffstat (limited to 'src/basic/architecture.c')
-rw-r--r--src/basic/architecture.c8
1 files changed, 4 insertions, 4 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);