diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-05-31 20:06:57 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-05-31 20:12:33 +0200 |
commit | 394129f88b54a8a0886fe0f9867e2e9603eb0694 (patch) | |
tree | 1d11ba77069e1d6f851eff648c74011f87ae3581 | |
parent | Move message repeat (diff) | |
download | systemd-394129f88b54a8a0886fe0f9867e2e9603eb0694.tar.xz systemd-394129f88b54a8a0886fe0f9867e2e9603eb0694.zip |
tree-wide: use ALIGN_PTR()
-rw-r--r-- | src/basic/static-destruct.h | 4 | ||||
-rw-r--r-- | src/libsystemd/sd-bus/bus-error.c | 4 | ||||
-rw-r--r-- | src/libsystemd/sd-bus/test-bus-error.c | 4 | ||||
-rw-r--r-- | src/shared/tests.h | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/basic/static-destruct.h b/src/basic/static-destruct.h index a41c0e30d5..97baac7abb 100644 --- a/src/basic/static-destruct.h +++ b/src/basic/static-destruct.h @@ -55,9 +55,9 @@ static inline void static_destruct(void) { if (!__start_SYSTEMD_STATIC_DESTRUCT) return; - d = ALIGN_TO_PTR(__start_SYSTEMD_STATIC_DESTRUCT, sizeof(void*)); + d = ALIGN_PTR(__start_SYSTEMD_STATIC_DESTRUCT); while (d < __stop_SYSTEMD_STATIC_DESTRUCT) { d->destroy(d->data); - d = ALIGN_TO_PTR(d + 1, sizeof(void*)); + d = ALIGN_PTR(d + 1); } } diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c index bdfa145ab7..2454a95b9d 100644 --- a/src/libsystemd/sd-bus/bus-error.c +++ b/src/libsystemd/sd-bus/bus-error.c @@ -92,7 +92,7 @@ static int bus_error_name_to_errno(const char *name) { } } - m = ALIGN_TO_PTR(__start_SYSTEMD_BUS_ERROR_MAP, sizeof(void*)); + m = ALIGN_PTR(__start_SYSTEMD_BUS_ERROR_MAP); while (m < __stop_SYSTEMD_BUS_ERROR_MAP) { /* For magic ELF error maps, the end marker might * appear in the middle of things, since multiple maps @@ -101,7 +101,7 @@ static int bus_error_name_to_errno(const char *name) { * boundary, which is the selected alignment for the * arrays. */ if (m->code == BUS_ERROR_MAP_END_MARKER) { - m = ALIGN_TO_PTR(m + 1, sizeof(void*)); + m = ALIGN_PTR(m + 1); continue; } diff --git a/src/libsystemd/sd-bus/test-bus-error.c b/src/libsystemd/sd-bus/test-bus-error.c index 952455255d..cc59de12b4 100644 --- a/src/libsystemd/sd-bus/test-bus-error.c +++ b/src/libsystemd/sd-bus/test-bus-error.c @@ -131,11 +131,11 @@ static int dump_mapping_table(void) { const sd_bus_error_map *m; printf("----- errno mappings ------\n"); - m = ALIGN_TO_PTR(__start_SYSTEMD_BUS_ERROR_MAP, sizeof(void*)); + m = ALIGN_PTR(__start_SYSTEMD_BUS_ERROR_MAP); while (m < __stop_SYSTEMD_BUS_ERROR_MAP) { if (m->code == BUS_ERROR_MAP_END_MARKER) { - m = ALIGN_TO_PTR(m + 1, sizeof(void*)); + m = ALIGN_PTR(m + 1); continue; } diff --git a/src/shared/tests.h b/src/shared/tests.h index ade527590b..a2f7f38c41 100644 --- a/src/shared/tests.h +++ b/src/shared/tests.h @@ -88,7 +88,7 @@ static inline int run_test_table(void) { if (!__start_SYSTEMD_TEST_TABLE) return r; - const TestFunc *t = ALIGN_TO_PTR(__start_SYSTEMD_TEST_TABLE, sizeof(TestFunc*)); + const TestFunc *t = ALIGN_PTR(__start_SYSTEMD_TEST_TABLE); while (t < __stop_SYSTEMD_TEST_TABLE) { if (t->sd_booted && sd_booted() <= 0) { @@ -106,7 +106,7 @@ static inline int run_test_table(void) { t->f.void_func(); } - t = ALIGN_TO_PTR(t + 1, sizeof(TestFunc*)); + t = ALIGN_PTR(t + 1); } return r; |