refactor: `__typeof__` to `typeof`
`typeof` is now a keyword in C23, so we can use it instead of
`__typeof__`/`__typeof`.
Change-Id: I575c4442b3c08ef8c2fbf9cbe195c1d90bff3cb5
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/inc/hf/arch/std.h b/inc/hf/arch/std.h
index ff606b2..ab8f895 100644
--- a/inc/hf/arch/std.h
+++ b/inc/hf/arch/std.h
@@ -56,10 +56,9 @@
*/
#define align_up_overflow(v, size, res) \
__extension__({ \
- typedef __typeof(v) v_t; \
- v_t __v = (v); \
- __typeof(size) __size = (size); \
- __typeof(res) __res = (res); \
+ typeof(v) __v = (v); \
+ typeof(size) __size = (size); \
+ typeof(res) __res = (res); \
*__res = align_up(__v, __size); \
__v > *__res; \
})
@@ -71,7 +70,7 @@
*/
#define add_with_round_up_overflow(a, b, size, res) \
(__extension__({ \
- __typeof__(a) __add_res = 0; \
+ typeof(a) __add_res = 0; \
add_overflow((a), (b), &__add_res) || \
align_up_overflow(__add_res, (size), (res)); \
}))
diff --git a/test/inc/test/hftest_impl.h b/test/inc/test/hftest_impl.h
index 4b40b34..a54d421 100644
--- a/test/inc/test/hftest_impl.h
+++ b/test/inc/test/hftest_impl.h
@@ -230,8 +230,8 @@
#define HFTEST_ASSERT_OP(lhs, rhs, op, fatal) \
do { \
- __typeof(lhs) lhs_value = lhs; \
- __typeof(rhs) rhs_value = rhs; \
+ typeof(lhs) lhs_value = lhs; \
+ typeof(rhs) rhs_value = rhs; \
if (!(lhs_value op rhs_value)) { \
struct hftest_context *ctx = hftest_get_context(); \
++ctx->failures; \