From 25965b18d7e6f97b813f45138219124a01f0ca42 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Fri, 22 Aug 2025 16:59:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B0=E5=AE=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/xy.h | 3 --- src/chsrc-main.c | 2 +- src/framework/struct.h | 4 +--- src/recipe/lang/Python/PDM.c | 2 +- src/recipe/lang/Python/Rye.c | 2 +- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/xy.h b/lib/xy.h index a5a55a8..5a62e70 100644 --- a/lib/xy.h +++ b/lib/xy.h @@ -167,9 +167,6 @@ void p (const char *s) { printf ("%s\n", s); } #define xy_c_array_len(arr) (sizeof (arr) / sizeof (arr[0])) -/* @deprecated 应迁移到后者 */ -#define xy_arylen xy_c_array_len - static inline void * xy_malloc0 (size_t size) diff --git a/src/chsrc-main.c b/src/chsrc-main.c index d4bdf2e..29c16b5 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -113,7 +113,7 @@ cli_print_available_mirrors () say ("--------- -------------- ------------------------------------- ---------------------"); } - for (int i = 0; i < xy_arylen (chsrc_available_mirrors); i++) + for (int i = 0; i < xy_c_array_len (chsrc_available_mirrors); i++) { MirrorSite_t *mir = chsrc_available_mirrors[i]; printf ("%-14s%-18s%-41s ", mir->code, mir->abbr, mir->site); say (mir->name); diff --git a/src/framework/struct.h b/src/framework/struct.h index caaf8d6..d8daa3c 100644 --- a/src/framework/struct.h +++ b/src/framework/struct.h @@ -94,8 +94,6 @@ Source_t; /* 由 prelude() 填充 */ #define FeedByPrelude NULL -#define def_sources_n(t) const size_t t##_sources_n = xy_arylen(t##_sources) - typedef enum Capability_t { @@ -182,7 +180,7 @@ TargetRegisterInfo_t; #define def_sources_begin() Source_t sources[] = { #define def_sources_end() }; \ - this->sources_n = xy_arylen(sources); \ + this->sources_n = xy_c_array_len(sources); \ char *_sources_storage = xy_malloc0 (sizeof(sources)); \ memcpy (_sources_storage, sources, sizeof(sources)); \ this->sources = (Source_t *)_sources_storage; diff --git a/src/recipe/lang/Python/PDM.c b/src/recipe/lang/Python/PDM.c index 276298e..a52b582 100644 --- a/src/recipe/lang/Python/PDM.c +++ b/src/recipe/lang/Python/PDM.c @@ -17,7 +17,7 @@ pl_python_pdm_prelude (void) chef_set_cooks (this, 1, "@ccmywish"); chef_set_sauciers (this, 0); - chef_allow_local_mode (this, FullyCan, "支持项目级配置", "Supports project-level configuration"); + chef_allow_local_mode (this, FullyCan, NULL, NULL); chef_allow_english(this); chef_allow_user_define(this); diff --git a/src/recipe/lang/Python/Rye.c b/src/recipe/lang/Python/Rye.c index 709809f..fd1cbfb 100644 --- a/src/recipe/lang/Python/Rye.c +++ b/src/recipe/lang/Python/Rye.c @@ -19,7 +19,7 @@ pl_python_rye_prelude (void) chef_set_cooks (this, 1, "@ccmywish"); chef_set_sauciers (this, 0); - chef_allow_local_mode (this, FullyCan, "支持项目级配置", "Supports project-level configuration"); + chef_allow_local_mode (this, FullyCan, NULL, NULL); chef_allow_english(this); chef_allow_user_define(this);