使用新宏

This commit is contained in:
Aoran Zeng 2025-08-22 16:59:54 +08:00
parent 18ba902da5
commit 25965b18d7
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
5 changed files with 4 additions and 9 deletions

View File

@ -167,9 +167,6 @@ void p (const char *s) { printf ("%s\n", s); }
#define xy_c_array_len(arr) (sizeof (arr) / sizeof (arr[0])) #define xy_c_array_len(arr) (sizeof (arr) / sizeof (arr[0]))
/* @deprecated 应迁移到后者 */
#define xy_arylen xy_c_array_len
static inline void * static inline void *
xy_malloc0 (size_t size) xy_malloc0 (size_t size)

View File

@ -113,7 +113,7 @@ cli_print_available_mirrors ()
say ("--------- -------------- ------------------------------------- ---------------------"); 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]; MirrorSite_t *mir = chsrc_available_mirrors[i];
printf ("%-14s%-18s%-41s ", mir->code, mir->abbr, mir->site); say (mir->name); printf ("%-14s%-18s%-41s ", mir->code, mir->abbr, mir->site); say (mir->name);

View File

@ -94,8 +94,6 @@ Source_t;
/* 由 prelude() 填充 */ /* 由 prelude() 填充 */
#define FeedByPrelude NULL #define FeedByPrelude NULL
#define def_sources_n(t) const size_t t##_sources_n = xy_arylen(t##_sources)
typedef enum Capability_t typedef enum Capability_t
{ {
@ -182,7 +180,7 @@ TargetRegisterInfo_t;
#define def_sources_begin() Source_t sources[] = { #define def_sources_begin() Source_t sources[] = {
#define def_sources_end() }; \ #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)); \ char *_sources_storage = xy_malloc0 (sizeof(sources)); \
memcpy (_sources_storage, sources, sizeof(sources)); \ memcpy (_sources_storage, sources, sizeof(sources)); \
this->sources = (Source_t *)_sources_storage; this->sources = (Source_t *)_sources_storage;

View File

@ -17,7 +17,7 @@ pl_python_pdm_prelude (void)
chef_set_cooks (this, 1, "@ccmywish"); chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0); 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_english(this);
chef_allow_user_define(this); chef_allow_user_define(this);

View File

@ -19,7 +19,7 @@ pl_python_rye_prelude (void)
chef_set_cooks (this, 1, "@ccmywish"); chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0); 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_english(this);
chef_allow_user_define(this); chef_allow_user_define(this);