Fix bug of wrong joining in def_target_sources_n

This commit is contained in:
Aoran Zeng 2023-09-04 11:18:38 +08:00
parent e7bb9c1c6d
commit 4c1d45cd01
2 changed files with 19 additions and 16 deletions

25
chsrc.c
View File

@ -2,7 +2,7 @@
* File : chsrc.c * File : chsrc.c
* Authors : Aoran Zeng <ccmywish@qq.com> * Authors : Aoran Zeng <ccmywish@qq.com>
* Created on : <2023-08-28> * Created on : <2023-08-28>
* Last modified : <2023-09-03> * Last modified : <2023-09-04>
* *
* chsrc: * chsrc:
* *
@ -154,6 +154,7 @@ common_cesu_ (source_info* sources, size_t size)
speed = test_speed (url); speed = test_speed (url);
} }
speeds[i] = speed; speeds[i] = speed;
printf("%d %d\n", i, size);
} }
int fastidx = dblary_maxidx (speeds, size); int fastidx = dblary_maxidx (speeds, size);
xy_success (xy_2strjoin("最快镜像站为: ", sources[fastidx].mirror->name)); xy_success (xy_2strjoin("最快镜像站为: ", sources[fastidx].mirror->name));
@ -458,8 +459,8 @@ void
_pl_go_check_cmd () _pl_go_check_cmd ()
{ {
char* check_cmd = NULL; char* check_cmd = NULL;
if (xy_on_windows) check_cmd = "go --version >nul 2>nul"; if (xy_on_windows) check_cmd = "go version >nul 2>nul";
else check_cmd = "go --version 1>/dev/null 2>&1"; else check_cmd = "go version 1>/dev/null 2>&1";
bool exist_b = does_the_program_exist (check_cmd, "go"); bool exist_b = does_the_program_exist (check_cmd, "go");
@ -944,15 +945,15 @@ def_target_info(pl_ruby);
def_target_info(pl_python); def_target_info(pl_python);
target_info target_info
pl_nodejs_target = {pl_nodejs_setsrc, NULL, pl_nodejs_sources, 2}, pl_nodejs_target = {pl_nodejs_setsrc, NULL, pl_nodejs_sources, pl_nodejs_sources_n},
pl_perl_target = {pl_perl_setsrc, NULL, pl_perl_sources, 5}, pl_perl_target = {pl_perl_setsrc, NULL, pl_perl_sources, pl_perl_sources_n},
pl_rust_target = {pl_rust_setsrc, NULL, pl_rust_sources, 5}, pl_rust_target = {pl_rust_setsrc, NULL, pl_rust_sources, pl_rust_sources_n},
pl_go_target = {pl_go_setsrc, NULL, pl_go_sources, 3}, pl_go_target = {pl_go_setsrc, NULL, pl_go_sources, pl_go_sources_n},
pl_dotnet_target = {pl_dotnet_setsrc, NULL, pl_dotnet_sources, 1}, pl_dotnet_target = {pl_dotnet_setsrc, NULL, pl_dotnet_sources, pl_dotnet_sources_n},
pl_java_target = {pl_java_setsrc, NULL, pl_java_sources, 1}, pl_java_target = {pl_java_setsrc, NULL, pl_java_sources, pl_java_sources_n},
pl_php_target = {pl_php_setsrc, pl_php_getsrc, pl_php_sources, pl_php_sources_n}, pl_php_target = {pl_php_setsrc, pl_php_getsrc, pl_php_sources, pl_php_sources_n},
pl_r_target = {pl_r_setsrc, NULL, pl_r_sources, 5}, pl_r_target = {pl_r_setsrc, NULL, pl_r_sources, pl_r_sources_n},
pl_julia_target = {pl_julia_setsrc, NULL, pl_julia_sources, 3}; pl_julia_target = {pl_julia_setsrc, NULL, pl_julia_sources, pl_julia_sources_n};
#define targetinfo(t) (const char const*)t #define targetinfo(t) (const char const*)t

10
chsrc.h
View File

@ -91,7 +91,7 @@ mirror_info
RubyChina = {"rubychina", "RubyChina", "Ruby China 社区", "https://gems.ruby-china.com/", RubyChina = {"rubychina", "RubyChina", "Ruby China 社区", "https://gems.ruby-china.com/",
"https://gems.ruby-china.com/rubygems/gems/nokogiri-1.15.0-java.gem"}, // 9.9 MB "https://gems.ruby-china.com/rubygems/gems/nokogiri-1.15.0-java.gem"}, // 9.9 MB
GoProxyCN = {"goproxy.cn", "Goproxy.cn", "七牛云 Goproxy.cn", "https://goproxy.cn/", NULL}, GoProxyCN = {"goproxy.cn", "Goproxy.cn", "七牛云 Goproxy.cn", "https://goproxy.cn/", NULL},
GoProxyIO = {"goproxy.io", "GOPROXY.IO", "GOPROXY.IO", "https://goproxy.io/", NULL}, GoProxyIO = {"goproxy.io", "GOPROXY.IO", "GOPROXY.IO", "https://goproxy.io/", NULL},
@ -386,6 +386,7 @@ os_mysys2_sources[] = {
int int
dblary_maxidx(double* array, int size) dblary_maxidx(double* array, int size)
{ {
puts("here");
double maxval = array[0]; double maxval = array[0];
double maxidx = 0; double maxidx = 0;
@ -395,6 +396,7 @@ dblary_maxidx(double* array, int size)
maxidx = i; maxidx = i;
} }
} }
puts("hello");
return maxidx; return maxidx;
} }
@ -408,11 +410,11 @@ say_for_setsrc (source_info* source)
} }
#define def_target_sources_n(t) const size_t t##_sources_n = xy_arylen(pl_ruby_sources) #define def_target_sources_n(t) const size_t t##_sources_n = xy_arylen(t##_sources)
def_target_sources_n(pl_ruby); def_target_sources_n(pl_python); def_target_sources_n(pl_nodejs); def_target_sources_n(pl_ruby); def_target_sources_n(pl_python); def_target_sources_n(pl_nodejs);
def_target_sources_n(pl_perl); def_target_sources_n(pl_php); def_target_sources_n(pl_go); def_target_sources_n(pl_perl); def_target_sources_n(pl_php); def_target_sources_n(pl_go);
def_target_sources_n(pl_rust); def_target_sources_n(pl_java); def_target_sources_n(pl_r); def_target_sources_n(pl_rust); def_target_sources_n(pl_java); def_target_sources_n(pl_dotnet);
def_target_sources_n(pl_julia); def_target_sources_n(pl_r); def_target_sources_n(pl_julia);
def_target_sources_n(os_ubuntu); def_target_sources_n(os_debian); def_target_sources_n(os_fedora); def_target_sources_n(os_ubuntu); def_target_sources_n(os_debian); def_target_sources_n(os_fedora);
def_target_sources_n(os_kali); def_target_sources_n(os_openbsd); def_target_sources_n(os_mysys2); def_target_sources_n(os_kali); def_target_sources_n(os_openbsd); def_target_sources_n(os_mysys2);