Paolo Bonzini
eb350d1d01
include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()
...
The typeof_strip_qual() is most useful for the atomic fetch-and-modify
operations in atomic.h, but it can be used elsewhere as well. For example,
QAPI_LIST_LENGTH() assumes that the argument is not const, which is not a
requirement.
Move the macro to compiler.h and, while at it, move it under #ifndef
__cplusplus to emphasize that it uses C-only constructs. A C++ version
of typeof_strip_qual() using type traits is possible[1], but beyond the
scope of this patch because the little C++ code that is in QEMU does not
use QAPI.
The patch was tested by changing the declaration of strv_from_str_list()
in qapi/qapi-type-helpers.c to:
char **strv_from_str_list(const strList *const list)
This is valid C code, and it fails to compile without this change.
[1] https://lore.kernel.org/qemu-devel/20240624205647.112034-1-flwu@google.com/
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Tested-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-06-28 14:44:52 +02:00
..
2023-10-03 08:00:25 -07:00
2023-02-08 07:28:05 +01:00
2023-10-07 19:02:33 +02:00
2024-06-28 14:44:52 +02:00
2020-11-15 17:04:40 +01:00
2016-07-12 16:20:46 +02:00
2024-05-03 15:47:48 +02:00
2024-03-01 15:42:04 +08:00
2024-06-24 10:35:26 +02:00
2022-03-22 14:40:51 +04:00
2021-01-07 05:09:41 -10:00
2022-02-21 13:30:20 +00:00
2023-12-19 19:03:38 +01:00
2022-12-15 16:07:43 +01:00
2021-06-25 14:24:24 +03:00
2024-06-28 14:44:52 +02:00
2024-04-18 11:17:27 +02:00
2020-06-23 15:46:05 +01:00
2024-01-08 10:45:43 -05:00
2022-03-04 18:14:40 +01:00
2024-05-03 15:47:48 +02:00
2022-05-11 16:50:01 +02:00
2023-09-15 13:57:00 +00:00
2023-05-23 15:20:15 +08:00
2023-08-31 19:47:43 +02:00
2019-06-11 20:22:09 +02:00
2024-06-05 12:14:18 -07:00
2020-12-10 12:15:18 -05:00
2023-02-08 07:28:05 +01:00
2023-10-31 15:41:42 +01:00
2019-05-13 08:58:55 +02:00
2023-02-10 14:12:06 +01:00
2022-04-21 17:09:09 +04:00
2022-03-06 06:19:47 -05:00
2024-01-10 06:58:50 +00:00
2016-06-07 18:19:23 +03:00
2020-11-15 17:04:40 +01:00
2017-10-16 20:57:13 +03:00
2023-10-06 13:27:48 +02:00
2023-02-17 14:34:24 +01:00
2020-10-15 16:06:27 +02:00
2024-03-11 17:21:21 +00:00
2023-09-06 11:19:33 +02:00
2022-02-21 13:30:20 +00:00
2021-03-09 21:47:45 +01:00
2023-11-13 11:35:47 +01:00
2022-12-20 17:09:41 -08:00
2023-06-05 13:11:24 +02:00
2023-08-31 19:47:43 +02:00
2019-05-13 08:58:55 +02:00
2024-03-18 12:03:04 +01:00
2022-05-11 16:50:01 +02:00
2024-05-29 12:41:56 +02:00
2022-04-20 10:51:11 -07:00
2024-04-30 16:12:05 -07:00
2022-02-21 13:30:20 +00:00
2024-01-08 10:45:43 -05:00
2022-03-07 13:16:49 +00:00
2019-09-11 08:46:17 +02:00
2023-04-24 11:29:00 +02:00
2022-11-06 09:48:50 +01:00
2022-02-21 13:30:20 +00:00
2024-02-28 11:31:28 +08:00
2020-12-10 17:16:44 +01:00
2019-01-11 15:46:55 +01:00
2024-05-03 15:47:48 +02:00
2024-06-21 09:47:22 -03:00
2016-07-12 16:20:46 +02:00
2023-03-22 15:06:57 +00:00
2023-09-16 14:57:15 +00:00
2024-05-16 08:55:23 +01:00
2019-05-13 08:58:55 +02:00
2023-08-31 19:47:43 +02:00
2023-01-19 10:18:28 +01:00
2019-06-12 13:20:20 +02:00
2024-06-24 10:15:04 +01:00
2022-03-22 14:40:51 +04:00
2022-04-06 14:31:43 +02:00
2018-09-26 08:55:54 -07:00
2019-04-18 22:18:59 +02:00
2024-01-30 21:20:20 +03:00
2020-09-23 16:07:44 +01:00
2024-06-24 23:15:30 +02:00
2021-06-25 14:22:21 +03:00
2023-02-10 14:12:06 +01:00
2023-08-31 19:47:43 +02:00
2023-02-04 07:56:54 +01:00
2023-11-03 09:20:31 +01:00
2023-09-01 13:34:03 -07:00
2020-09-23 16:07:44 +01:00
2023-03-13 15:39:31 +04:00
2023-04-27 16:39:43 +02:00
2023-08-31 19:47:43 +02:00
2019-05-13 08:58:55 +02:00
2022-10-27 11:00:43 +02:00
2022-04-06 14:31:56 +02:00
2021-06-16 15:03:26 +02:00
2024-01-08 10:45:43 -05:00
2017-09-06 10:12:02 +02:00
2023-08-29 10:49:24 +02:00
2016-02-23 12:43:05 +00:00
2024-06-24 10:14:41 +01:00
2021-11-16 09:43:44 +01:00
2020-06-16 14:49:05 +01:00
2024-05-15 08:55:19 +02:00
2018-08-24 20:26:37 +02:00
2019-02-01 13:46:45 +01:00
2023-02-08 07:27:20 +01:00
2023-11-03 09:20:31 +01:00
2021-09-07 09:08:24 +01:00
2023-11-28 14:56:32 +01:00
2022-04-22 13:36:04 +04:00
2022-12-23 11:48:13 +01:00
2023-06-01 11:05:05 -04:00
2024-01-26 07:04:53 +01:00