From ad0fc16a496e55b0a2c14fe150b9993b3178707a Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Wed, 6 Sep 2023 17:03:36 +0800 Subject: [PATCH 1/2] Explicitly cast to char* --- chsrc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chsrc.c b/chsrc.c index b1edebb..e302e6a 100644 --- a/chsrc.c +++ b/chsrc.c @@ -53,7 +53,7 @@ does_the_program_exist (char* check_cmd, char* progname) * @param target 目标名 * @param input 如果用户输入 default 或者 def,则选择第一个源 */ -#define lets_find_mirror(s, input) does_the_input_mirror_exist(s##_sources, s##_sources_n, #s+3, input) +#define lets_find_mirror(s, input) does_the_input_mirror_exist(s##_sources, s##_sources_n, (char*)#s+3, input) int does_the_input_mirror_exist (source_info* sources, size_t size, char* target, char* input) { @@ -158,7 +158,7 @@ test_speed_url (const char* url) } -#define lets_test_speed(s) lets_test_speed_(s##_sources, s##_sources_n, #s+3) +#define lets_test_speed(s) lets_test_speed_(s##_sources, s##_sources_n, (char*)#s+3) int lets_test_speed_ (source_info* sources, size_t size, const char* target) { From 70d243fb8c7a764eb9277a0646ff2c31d687a94d Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Wed, 6 Sep 2023 17:06:09 +0800 Subject: [PATCH 2/2] Make `print_help()` void --- chsrc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chsrc.c b/chsrc.c index e302e6a..eb58545 100644 --- a/chsrc.c +++ b/chsrc.c @@ -1448,8 +1448,7 @@ print_supported_sources_for_target (source_info sources[]) - -int +void print_help () { puts(xy_strjoin(3, "chsrc: Change Source (GPLv3) ",