refactor(argparse): 将null替换为nullptr以提高C++兼容性
- 在argparse库中将所有null指针常量替换为nullptr - 更新头文件和源文件中的指针初始化和比较操作 - 修改测试文件中的相关断言检查 - 更新AST定义文件中的注释说明
This commit is contained in:
@@ -170,14 +170,14 @@ static void test_unary_expr(void) {
|
||||
TEST_CASE("sizeof expression");
|
||||
{
|
||||
scc_ast_expr_t sizeof_expr;
|
||||
scc_ast_expr_sizeof_init(&sizeof_expr, NULL, &x, LOC);
|
||||
scc_ast_expr_sizeof_init(&sizeof_expr, nullptr, &x, LOC);
|
||||
SCC_CHECK_AST(&sizeof_expr.base, "sizeof(x)", scc_parse_expression);
|
||||
}
|
||||
|
||||
TEST_CASE("sizeof type");
|
||||
{
|
||||
scc_ast_expr_t sizeof_type;
|
||||
scc_ast_expr_sizeof_init(&sizeof_type, &int_type, NULL, LOC);
|
||||
scc_ast_expr_sizeof_init(&sizeof_type, &int_type, nullptr, LOC);
|
||||
SCC_CHECK_AST(&sizeof_type.base, "sizeof(int)", scc_parse_expression);
|
||||
}
|
||||
}
|
||||
@@ -391,5 +391,5 @@ TEST_LIST = {
|
||||
{"test_comma_expr", test_comma_expr},
|
||||
{"test_complex_expr", test_complex_expr},
|
||||
{"test_detail_expr", test_detail_expr},
|
||||
{NULL, NULL},
|
||||
{nullptr, nullptr},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user