summaryrefslogtreecommitdiff
path: root/src/fundamental/string-util-fundamental.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-06-24 10:45:52 +0200
committerJan Janssen <medhefgo@web.de>2022-06-27 12:16:27 +0200
commit6b852d22b621ef37ef67a3b24ca1f075e0b78698 (patch)
tree7f4b759f1cd91d45e36f9e9329bef006b5483e5a /src/fundamental/string-util-fundamental.c
parentaec2f54b30f58394f8f67d7e1c56ee3d7ca91eed (diff)
downloadsystemd-6b852d22b621ef37ef67a3b24ca1f075e0b78698.tar.gz
fundamental: Remove types-fundamental.h
This removes the fundamental typedefs in favor of just using standard C types. These are all used internally anyway and also do not do anything special to warrant any redefinition to EFI types. Even for BOOLEAN we can safely use stdbool. The defition from the EFI specification is fully compatible, including making any other values than 0/1 as undefined. The exception is sd_char as those need to be char16_t. The typedef is moved to string-util-fundamental.h instead.
Diffstat (limited to 'src/fundamental/string-util-fundamental.c')
-rw-r--r--src/fundamental/string-util-fundamental.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fundamental/string-util-fundamental.c b/src/fundamental/string-util-fundamental.c
index 169568e244..6f690b9c90 100644
--- a/src/fundamental/string-util-fundamental.c
+++ b/src/fundamental/string-util-fundamental.c
@@ -77,21 +77,21 @@ sd_char* endswith_no_case(const sd_char *s, const sd_char *postfix) {
return (sd_char*) s + sl - pl;
}
-static sd_bool is_digit(sd_char a) {
+static bool is_digit(sd_char a) {
/* Locale-independent version of isdigit(). */
return a >= '0' && a <= '9';
}
-static sd_bool is_alpha(sd_char a) {
+static bool is_alpha(sd_char a) {
/* Locale-independent version of isalpha(). */
return (a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z');
}
-static sd_bool is_valid_version_char(sd_char a) {
+static bool is_valid_version_char(sd_char a) {
return is_digit(a) || is_alpha(a) || IN_SET(a, '~', '-', '^', '.');
}
-sd_int strverscmp_improved(const sd_char *a, const sd_char *b) {
+int strverscmp_improved(const sd_char *a, const sd_char *b) {
/* This function is similar to strverscmp(3), but it treats '-' and '.' as separators.
*
* The logic is based on rpm's rpmvercmp(), but unlike rpmvercmp(), it distiguishes e.g.
@@ -129,7 +129,7 @@ sd_int strverscmp_improved(const sd_char *a, const sd_char *b) {
for (;;) {
const sd_char *aa, *bb;
- sd_int r;
+ int r;
/* Drop leading invalid characters. */
while (*a != '\0' && !is_valid_version_char(*a))