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

@@ -134,5 +134,5 @@ TEST_LIST = {
TEST_LIST_CASE(test_define_double_pos),
TEST_LIST_CASE(test_define_param_pos),
TEST_LIST_CASE(test_define_stringify_pos),
{NULL, NULL},
{nullptr, nullptr},
};

View File

@@ -39,7 +39,7 @@ static cbool process_input(const char *input, scc_str_t *output) {
do { \
scc_str_t output; \
process_input(input, &output); \
assert(output.data != NULL); \
assert(output.data != nullptr); \
TEST_CHECK(strcmp(output.data, expect) == 0); \
TEST_MSG("Expected: %s", expect); \
TEST_MSG("Produced: %s", output.data); \
@@ -50,8 +50,8 @@ static cbool process_input(const char *input, scc_str_t *output) {
do { \
scc_str_t output; \
process_input(input, &output); \
assert(output.data != NULL); \
TEST_CHECK(strstr(output.data, expect) != NULL); \
assert(output.data != nullptr); \
TEST_CHECK(strstr(output.data, expect) != nullptr); \
TEST_MSG("Expected: %s", expect); \
TEST_MSG("Produced: %s", output.data); \
scc_str_drop(&output); \
@@ -649,5 +649,5 @@ TEST_LIST = {
TEST_LIST_CASE(test_real_case),
TEST_LIST_CASE(test_c99_docs),
{NULL, NULL},
{nullptr, nullptr},
};