Skip to content

Commit 2a52c89

Browse files
committed
Update inner macro
1 parent ffaee0b commit 2a52c89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+98
-98
lines changed

src/chsrc-framework.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -701,13 +701,13 @@ source_has_empty_url (SourceInfo *source)
701701
* 1. 用户指定某个 MirrorCode
702702
* 2. NULL: 用户什么都没指定 (将测速选择最快镜像)
703703
* 3. 用户给了一个 URL
704-
* 4. ChsrcTypeReset
704+
* 4. SetsrcType_Reset
705705
* 选用了Leader target
706706
* 5. ProgMode_Leader_Selected_Index 将给出所选索引
707707
*
708708
* @dependency 变量 option
709709
*/
710-
#define chsrc_yield_the_source(for_what) \
710+
#define chsrc_yield_for_the_source(for_what) \
711711
if (ProgMode_Target_Group==true && ProgMode_Leader_Selected_Index==-1) \
712712
{ \
713713
ProgMode_Leader_Selected_Index = use_specific_mirror_or_auto_select (option, for_what); \
@@ -730,7 +730,7 @@ source_has_empty_url (SourceInfo *source)
730730

731731
#define chsrc_yield_source(for_what) \
732732
SourceInfo source; \
733-
chsrc_yield_the_source(for_what)
733+
chsrc_yield_for_the_source(for_what)
734734

735735

736736

@@ -778,11 +778,11 @@ confirm_source (SourceInfo *source)
778778
#define chsrc_yield_source_and_confirm(for_what) chsrc_yield_source(for_what);chsrc_confirm_source
779779

780780

781-
#define ChsrcTypeAuto "auto"
782-
#define ChsrcTypeReset "reset"
783-
#define ChsrcTypeSemiAuto "semiauto"
784-
#define ChsrcTypeManual "manual"
785-
#define ChsrcTypeUntested "untested"
781+
#define SetsrcType_Auto "auto"
782+
#define SetsrcType_Reset "reset"
783+
#define SetsrcType_SemiAuto "semiauto"
784+
#define SetsrcType_Manual "manual"
785+
#define SetsrcType_Untested "untested"
786786

787787
#define MSG_EN_PUBLIC_URL "If the URL you specify is a public service, you are invited to contribute: chsrc issue"
788788
#define MSG_CN_PUBLIC_URL "若您指定的URL为公有服务,邀您参与贡献: chsrc issue"
@@ -809,15 +809,15 @@ confirm_source (SourceInfo *source)
809809

810810
/**
811811
* @param source 可为NULL
812-
* @param last_word 5种选择:ChsrcTypeAuto | ChsrcTypeReset | ChsrcTypeSemiAuto | ChsrcTypeManual | ChsrcTypeUntested
812+
* @param last_word 5种选择:SetsrcType_Auto | SetsrcType_Reset | SetsrcType_SemiAuto | SetsrcType_Manual | SetsrcType_Untested
813813
* @translation Done
814814
*/
815815
void
816816
chsrc_conclude (SourceInfo *source, const char *last_word)
817817
{
818818
split_between_source_changing_process;
819819

820-
if (xy_streql (ChsrcTypeAuto, last_word))
820+
if (xy_streql (SetsrcType_Auto, last_word))
821821
{
822822
if (source)
823823
{
@@ -840,13 +840,13 @@ chsrc_conclude (SourceInfo *source, const char *last_word)
840840
chsrc_log (msg);
841841
}
842842
}
843-
else if (xy_streql (ChsrcTypeReset, last_word))
843+
else if (xy_streql (SetsrcType_Reset, last_word))
844844
{
845845
// source_is_upstream (source)
846846
char *msg = CliOpt_InEnglish ? "Has been reset to the upstream default source" : "已重置为上游默认源";
847847
chsrc_log (purple (msg));
848848
}
849-
else if (xy_streql (ChsrcTypeSemiAuto, last_word))
849+
else if (xy_streql (SetsrcType_SemiAuto, last_word))
850850
{
851851
if (source)
852852
{
@@ -873,7 +873,7 @@ chsrc_conclude (SourceInfo *source, const char *last_word)
873873
char *msg = CliOpt_InEnglish ? MSG_EN_BETTER : MSG_CN_BETTER;
874874
chsrc_warn (msg);
875875
}
876-
else if (xy_streql (ChsrcTypeManual, last_word))
876+
else if (xy_streql (SetsrcType_Manual, last_word))
877877
{
878878
if (source)
879879
{
@@ -898,7 +898,7 @@ chsrc_conclude (SourceInfo *source, const char *last_word)
898898
char *msg = CliOpt_InEnglish ? MSG_EN_BETTER : MSG_CN_BETTER;
899899
chsrc_warn (msg);
900900
}
901-
else if (xy_streql (ChsrcTypeUntested, last_word))
901+
else if (xy_streql (SetsrcType_Untested, last_word))
902902
{
903903
if (source)
904904
{

src/recipe/lang/Clojure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pl_clojure_setsrc (char *option)
2727

2828
chsrc_note2 ("抱歉,Clojure换源较复杂,您可手动查阅并换源:");
2929
puts (source.url);
30-
chsrc_conclude (&source, ChsrcTypeManual);
30+
chsrc_conclude (&source, SetsrcType_Manual);
3131
}
3232

3333
def_target_s (pl_clojure);

src/recipe/lang/Dart/Flutter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pl_dart_flutter_setsrc (char *option)
8282
chsrc_append_to_file (towrite, bashrc);
8383
}
8484
}
85-
chsrc_conclude (&source, ChsrcTypeAuto);
85+
chsrc_conclude (&source, SetsrcType_Auto);
8686
}
8787

8888

src/recipe/lang/Dart/Pub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pl_dart_setsrc (char *option)
7878
chsrc_append_to_file (towrite, bashrc);
7979
}
8080
}
81-
chsrc_conclude (&source, ChsrcTypeAuto);
81+
chsrc_conclude (&source, SetsrcType_Auto);
8282
}
8383

8484

src/recipe/lang/Go.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pl_go_setsrc (char *option)
6666

6767
cmd = xy_strjoin (3, "go env -w GOPROXY=", source.url, ",direct");
6868
chsrc_run (cmd, RunOpt_Default);
69-
chsrc_conclude (&source, ChsrcTypeAuto);
69+
chsrc_conclude (&source, SetsrcType_Auto);
7070
}
7171

7272
def_target(pl_go);

src/recipe/lang/Haskell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pl_haskell_setsrc (char *option)
6262

6363
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
6464
puts (file);
65-
chsrc_conclude (&source, ChsrcTypeManual);
65+
chsrc_conclude (&source, SetsrcType_Manual);
6666
}
6767

6868
def_target_s (pl_haskell);

src/recipe/lang/Java.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pl_java_setsrc (char *option)
9595
chsrc_note2 ("请在您的 build.gradle 中添加:");
9696
puts (file);
9797
}
98-
chsrc_conclude (&source, ChsrcTypeManual);
98+
chsrc_conclude (&source, SetsrcType_Manual);
9999
}
100100

101101
def_target(pl_java);

src/recipe/lang/Julia.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pl_julia_setsrc (char *option)
4747
const char *towrite = xy_strjoin (3, "ENV[\"JULIA_PKG_SERVER\"] = \"", source.url, "\"");
4848

4949
chsrc_append_to_file (towrite, "~/.julia/config/startup.jl");
50-
chsrc_conclude (&source, ChsrcTypeUntested);
50+
chsrc_conclude (&source, SetsrcType_Untested);
5151
}
5252

5353
def_target(pl_julia);

src/recipe/lang/Lua.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pl_lua_setsrc (char *option)
5151
chsrc_note2 ("请手动修改 ~/.luarocks/upload_config.lua 文件 (用于上传):");
5252
puts (upload_config);
5353

54-
chsrc_conclude (&source, ChsrcTypeManual);
54+
chsrc_conclude (&source, SetsrcType_Manual);
5555
}
5656

5757
def_target(pl_lua);

src/recipe/lang/Node.js/Bun.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pl_nodejs_bun_getsrc (char *option)
2626
void
2727
pl_nodejs_bun_setsrc (char *option)
2828
{
29-
char *chsrc_type = xy_streql (option, ChsrcTypeReset) ? ChsrcTypeReset : ChsrcTypeManual;
29+
char *chsrc_type = xy_streql (option, SetsrcType_Reset) ? SetsrcType_Reset : SetsrcType_Manual;
3030
chsrc_yield_source (pl_nodejs);
3131

3232
char *file = xy_strjoin(3, "[install]\n"
@@ -45,7 +45,7 @@ pl_nodejs_bun_setsrc (char *option)
4545
void
4646
pl_nodejs_bun_resetsrc (char *option)
4747
{
48-
pl_nodejs_bun_setsrc (ChsrcTypeReset);
48+
pl_nodejs_bun_setsrc (SetsrcType_Reset);
4949
}
5050

5151

0 commit comments

Comments
 (0)