Rename built-in procedure to expand_values

This commit is contained in:
gingerBill
2023-02-07 15:39:39 +00:00
parent 7bbcf22deb
commit 8a16fd7699
4 changed files with 10 additions and 10 deletions

View File

@@ -2550,7 +2550,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
break; break;
} }
case BuiltinProc_expand_to_tuple: { case BuiltinProc_expand_values: {
Type *type = base_type(operand->type); Type *type = base_type(operand->type);
if (!is_type_struct(type) && !is_type_array(type)) { if (!is_type_struct(type) && !is_type_array(type)) {
gbString type_str = type_to_string(operand->type); gbString type_str = type_to_string(operand->type);

View File

@@ -25,7 +25,7 @@ enum BuiltinProcId {
BuiltinProc_kmag, BuiltinProc_kmag,
BuiltinProc_conj, BuiltinProc_conj,
BuiltinProc_expand_to_tuple, BuiltinProc_expand_values,
BuiltinProc_min, BuiltinProc_min,
BuiltinProc_max, BuiltinProc_max,
@@ -325,7 +325,7 @@ gb_global BuiltinProc builtin_procs[BuiltinProc_COUNT] = {
{STR_LIT("kmag"), 1, false, Expr_Expr, BuiltinProcPkg_builtin}, {STR_LIT("kmag"), 1, false, Expr_Expr, BuiltinProcPkg_builtin},
{STR_LIT("conj"), 1, false, Expr_Expr, BuiltinProcPkg_builtin}, {STR_LIT("conj"), 1, false, Expr_Expr, BuiltinProcPkg_builtin},
{STR_LIT("expand_to_tuple"), 1, false, Expr_Expr, BuiltinProcPkg_builtin}, {STR_LIT("expand_values"), 1, false, Expr_Expr, BuiltinProcPkg_builtin},
{STR_LIT("min"), 1, true, Expr_Expr, BuiltinProcPkg_builtin}, {STR_LIT("min"), 1, true, Expr_Expr, BuiltinProcPkg_builtin},
{STR_LIT("max"), 1, true, Expr_Expr, BuiltinProcPkg_builtin}, {STR_LIT("max"), 1, true, Expr_Expr, BuiltinProcPkg_builtin},

View File

@@ -744,7 +744,7 @@ gb_internal LoadedFileError load_file_32(char const *fullpath, LoadedFile *memor
handle = nullptr; handle = nullptr;
goto window_handle_file_error; goto window_handle_file_error;
} }
li_file_size = {}; li_file_size = {};
if (!GetFileSizeEx(handle, &li_file_size)) { if (!GetFileSizeEx(handle, &li_file_size)) {
goto window_handle_file_error; goto window_handle_file_error;
@@ -754,7 +754,7 @@ gb_internal LoadedFileError load_file_32(char const *fullpath, LoadedFile *memor
CloseHandle(handle); CloseHandle(handle);
return LoadedFile_FileTooLarge; return LoadedFile_FileTooLarge;
} }
if (file_size == 0) { if (file_size == 0) {
CloseHandle(handle); CloseHandle(handle);
err = LoadedFile_Empty; err = LoadedFile_Empty;
@@ -763,10 +763,10 @@ gb_internal LoadedFileError load_file_32(char const *fullpath, LoadedFile *memor
memory_mapped_file->size = 0; memory_mapped_file->size = 0;
return err; return err;
} }
file_mapping = CreateFileMappingW(handle, nullptr, PAGE_READONLY, 0, 0, nullptr); file_mapping = CreateFileMappingW(handle, nullptr, PAGE_READONLY, 0, 0, nullptr);
CloseHandle(handle); CloseHandle(handle);
file_data = MapViewOfFileEx(file_mapping, FILE_MAP_READ, 0, 0, 0/*file_size*/, nullptr/*base address*/); file_data = MapViewOfFileEx(file_mapping, FILE_MAP_READ, 0, 0, 0/*file_size*/, nullptr/*base address*/);
memory_mapped_file->handle = cast(void *)file_mapping; memory_mapped_file->handle = cast(void *)file_mapping;
memory_mapped_file->data = file_data; memory_mapped_file->data = file_data;

View File

@@ -1836,7 +1836,7 @@ gb_internal lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValu
return lb_emit_conjugate(p, val, tv.type); return lb_emit_conjugate(p, val, tv.type);
} }
case BuiltinProc_expand_to_tuple: { case BuiltinProc_expand_values: {
lbValue val = lb_build_expr(p, ce->args[0]); lbValue val = lb_build_expr(p, ce->args[0]);
Type *t = base_type(val.type); Type *t = base_type(val.type);
@@ -1848,7 +1848,7 @@ gb_internal lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValu
GB_ASSERT(t->Array.count == 1); GB_ASSERT(t->Array.count == 1);
return lb_emit_struct_ev(p, val, 0); return lb_emit_struct_ev(p, val, 0);
} else { } else {
GB_PANIC("Unknown type of expand_to_tuple"); GB_PANIC("Unknown type of expand_values");
} }
} }
@@ -1874,7 +1874,7 @@ gb_internal lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValu
lb_emit_store(p, ep, f); lb_emit_store(p, ep, f);
} }
} else { } else {
GB_PANIC("Unknown type of expand_to_tuple"); GB_PANIC("Unknown type of expand_values");
} }
return lb_emit_load(p, tuple); return lb_emit_load(p, tuple);
} }