mirror of
https://github.com/RubyMetric/chsrc
synced 2025-09-09 02:26:43 +08:00
使用新宏
This commit is contained in:
parent
18ba902da5
commit
25965b18d7
3
lib/xy.h
3
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)
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user