refactor(argparse): 将null替换为nullptr以提高C++兼容性

- 在argparse库中将所有null指针常量替换为nullptr
- 更新头文件和源文件中的指针初始化和比较操作
- 修改测试文件中的相关断言检查
- 更新AST定义文件中的注释说明
This commit is contained in:
zzy
2026-04-05 20:18:09 +08:00
parent 27d86d5685
commit 4144f7841c
76 changed files with 1430 additions and 998 deletions

View File

@@ -10,9 +10,9 @@
#ifndef __KLLIST_H__
#define __KLLIST_H__
#ifndef NULL
#define NULL (0)
#define __NULL_KLIST_DEFINED__
#ifndef nullptr
#define nullptr (0)
#define __nullptr_KLIST_DEFINED__
#endif
#ifndef container_of
@@ -88,8 +88,8 @@ static inline void __list_del(struct list_head *prev, struct list_head *next) {
static inline void list_del(struct list_head *entry) {
__list_del(entry->prev, entry->next);
entry->next = NULL;
entry->prev = NULL;
entry->next = nullptr;
entry->prev = nullptr;
}
/**
@@ -159,8 +159,9 @@ typedef int (*list_cmp_func_t)(void *, const struct list_head *,
static void list_sort(void *priv, struct list_head *head, list_cmp_func_t cmp);
#endif
#if defined(__NULL_KLIST_DEFINED__) && !defined(__NULL_KLIST_DEFINED_NOMOVE__)
#undef NULL
#if defined(__nullptr_KLIST_DEFINED__) && \
!defined(__nullptr_KLIST_DEFINED_NOMOVE__)
#undef nullptr
#endif
#endif