os

An operating system
git clone https://erai.gay/code/os/
Log | Files | Refs | README | LICENSE

commit a2c43ca99846ac690f3d4c4bc556de9e92af05a9
parent 5ebdcce90ba41520880d8e5270f1ca4275c0103a
Author: erai <erai@omiltem.net>
Date:   Wed, 20 Nov 2024 23:26:59 -0500

use nil

Diffstat:
Malloc.om | 2+-
Mas.om | 16++++++++--------
Mcc0.c | 481++++++++++++++++++++++++++++++++++++++++++++-----------------------------------
Mcc1.om | 146++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mcout.om | 34+++++++++++++++++-----------------
Mdecl.om | 32++++++++++++++++----------------
Mgenlex.om | 44++++++++++++++++++++++----------------------
Mkernel.om | 74+++++++++++++++++++++++++++++++++++++-------------------------------------
Mnode.om | 10+++++-----
Mparse2.om | 20++++++++++----------
Mpeglib.om | 16++++++++--------
Msh.om | 36++++++++++++++++++------------------
Msshd.om | 12++++++------
Mtype.om | 14+++++++-------
14 files changed, 499 insertions(+), 438 deletions(-)

diff --git a/alloc.om b/alloc.om @@ -9,7 +9,7 @@ struct alloc { } func setup_alloc(c: *alloc) { - c.page = 0 as *page; + c.page = nil; } func alloc(c: *alloc, size: int): *byte { diff --git a/as.om b/as.om @@ -196,12 +196,12 @@ func setup_assembler(a: *alloc): *assembler { var c: *assembler; c = alloc(a, sizeof(*c)) as *assembler; c.a = a; - c.out = 0 as *file; + c.out = nil; c.at = 160; // elf header + program header + multiboot header - c.text = 0 as *chunk; - c.text_end = 0 as *chunk; + c.text = nil; + c.text_end = nil; c.bits32 = 0; - c.symbols = 0 as *symbol; + c.symbols = nil; c.num_sections = 0; add_section(c, "", SHT_NULL); add_section(c, ".text", SHT_PROGBITS); @@ -219,7 +219,7 @@ func add_section(c: *assembler, name: *byte, type: int) { s = alloc(c.a, sizeof(*s)) as *section; - s.next = 0 as *section; + s.next = nil; s.name = name; s.start = c.at; s.end = c.at; @@ -289,7 +289,7 @@ func mklabel(c: *assembler): *label { l = alloc(c.a, sizeof(*l)) as *label; - l.fix = 0 as *fixup; + l.fix = nil; l.at = 0; l.fixed = 0; @@ -315,7 +315,7 @@ func reserve(c: *assembler, n: int) { b.buf = m; b.fill = 0; b.cap = n; - b.next = 0 as *chunk; + b.next = nil; if (c.text_end) { c.text_end.next = b; @@ -953,7 +953,7 @@ func emit_sections(c: *assembler): int { var y: *symbol; var n: int; - add_symbol(c, "", 0 as *label); + add_symbol(c, "", nil); s = find_section(c, ""); s.start = 0; diff --git a/cc0.c b/cc0.c @@ -247,65 +247,66 @@ enum { my_LOOK_AND = 2, my_LOOK_NORMAL = 0, my_LOOK_NOT = 1, - my_N_ADD = 43, - my_N_AND = 51, - my_N_ARGDECL = 10, - my_N_ARGLIST = 8, - my_N_ASSIGN = 31, - my_N_BAND = 50, - my_N_BNOT = 48, - my_N_BOR = 49, - my_N_BREAK = 25, - my_N_CALL = 6, - my_N_CAST = 35, + my_N_ADD = 44, + my_N_AND = 52, + my_N_ARGDECL = 11, + my_N_ARGLIST = 9, + my_N_ASSIGN = 32, + my_N_BAND = 51, + my_N_BNOT = 49, + my_N_BOR = 50, + my_N_BREAK = 26, + my_N_CALL = 7, + my_N_CAST = 36, my_N_CHAR = 2, - my_N_COND = 20, - my_N_CONDLIST = 19, - my_N_CONTINUE = 26, - my_N_DEREF = 34, - my_N_DIV = 57, - my_N_DOT = 7, - my_N_ENUM = 21, - my_N_ENUMITEM = 22, - my_N_ENUMLIST = 23, - my_N_EQ = 41, - my_N_EXPRLIST = 5, - my_N_FUNC = 9, - my_N_FUNCDECL = 11, - my_N_FUNCTYPE = 13, - my_N_GE = 40, - my_N_GOTO = 30, - my_N_GT = 38, + my_N_COND = 21, + my_N_CONDLIST = 20, + my_N_CONTINUE = 27, + my_N_DEREF = 35, + my_N_DIV = 58, + my_N_DOT = 8, + my_N_ENUM = 22, + my_N_ENUMITEM = 23, + my_N_ENUMLIST = 24, + my_N_EQ = 42, + my_N_EXPRLIST = 6, + my_N_FUNC = 10, + my_N_FUNCDECL = 12, + my_N_FUNCTYPE = 14, + my_N_GE = 41, + my_N_GOTO = 31, + my_N_GT = 39, my_N_IDENT = 0, - my_N_INDEX = 36, - my_N_LABEL = 29, - my_N_LE = 39, - my_N_LOOP = 24, - my_N_LSH = 46, - my_N_LT = 37, - my_N_MEMBERDECL = 17, - my_N_MEMBERLIST = 18, - my_N_MOD = 58, - my_N_MUL = 45, - my_N_NE = 42, - my_N_NEG = 56, - my_N_NOT = 54, + my_N_INDEX = 37, + my_N_LABEL = 30, + my_N_LE = 40, + my_N_LOOP = 25, + my_N_LSH = 47, + my_N_LT = 38, + my_N_MEMBERDECL = 18, + my_N_MEMBERLIST = 19, + my_N_MOD = 59, + my_N_MUL = 46, + my_N_NE = 43, + my_N_NEG = 57, + my_N_NIL = 4, + my_N_NOT = 55, my_N_NUM = 1, - my_N_OR = 52, - my_N_POS = 55, - my_N_PROGRAM = 12, - my_N_PTRTYPE = 14, - my_N_REF = 33, - my_N_RETURN = 27, - my_N_RSH = 47, - my_N_SIZEOF = 32, - my_N_STMTLIST = 4, + my_N_OR = 53, + my_N_POS = 56, + my_N_PROGRAM = 13, + my_N_PTRTYPE = 15, + my_N_REF = 34, + my_N_RETURN = 28, + my_N_RSH = 48, + my_N_SIZEOF = 33, + my_N_STMTLIST = 5, my_N_STR = 3, - my_N_STRUCT = 15, - my_N_SUB = 44, - my_N_UNION = 16, - my_N_VARDECL = 28, - my_N_XOR = 53, + my_N_STRUCT = 16, + my_N_SUB = 45, + my_N_UNION = 17, + my_N_VARDECL = 29, + my_N_XOR = 54, my_ONE_OR_MORE = 3, my_OP_ADCRM = 19, my_OP_ADDI = 129, @@ -535,14 +536,15 @@ enum { my_SIG_DFL = 0, my_SIG_IGN = 1, my_SOCK_STREAM = 1, - my_TY_ARG = 4, - my_TY_BYTE = 2, - my_TY_FUNC = 5, - my_TY_INT = 1, - my_TY_PTR = 3, - my_TY_STRUCT = 6, - my_TY_UNION = 7, - my_TY_VOID = 0, + my_TY_ARG = 5, + my_TY_BYTE = 3, + my_TY_FUNC = 6, + my_TY_INT = 2, + my_TY_NIL = 0, + my_TY_PTR = 4, + my_TY_STRUCT = 7, + my_TY_UNION = 8, + my_TY_VOID = 1, my_WNOHANG = 1, my_ZERO_OR_MORE = 2, my_ZERO_OR_ONE = 0 @@ -780,6 +782,7 @@ unsigned long( my_peg_P_mul_expr)(struct my_peg* my_c); unsigned long( my_peg_P_mul_op)(struct my_peg* my_c); unsigned long( my_peg_P_ne_op)(struct my_peg* my_c); unsigned long( my_peg_P_neg_op)(struct my_peg* my_c); +unsigned long( my_peg_P_nil)(struct my_peg* my_c); unsigned long( my_peg_P_not_op)(struct my_peg* my_c); unsigned long( my_peg_P_or_op)(struct my_peg* my_c); unsigned long( my_peg_P_pos_op)(struct my_peg* my_c); @@ -846,6 +849,7 @@ struct my_node*( my_reconstruct_loop)(struct my_parser* my_c,struct my_peg_node* struct my_node*( my_reconstruct_member_decl)(struct my_parser* my_c,struct my_peg_node* my_pn); struct my_node*( my_reconstruct_member_list)(struct my_parser* my_c,struct my_peg_node* my_pn); struct my_node*( my_reconstruct_mul)(struct my_parser* my_c,struct my_peg_node* my_pn); +struct my_node*( my_reconstruct_nil)(struct my_parser* my_c,struct my_peg_node* my_pn); struct my_node*( my_reconstruct_post)(struct my_parser* my_c,struct my_peg_node* my_pn); struct my_node*( my_reconstruct_primary)(struct my_parser* my_c,struct my_peg_node* my_pn); struct my_node*( my_reconstruct_return)(struct my_parser* my_c,struct my_peg_node* my_pn); @@ -1211,7 +1215,7 @@ void( my_add_section)(struct my_assembler* my_c,unsigned char* my_name,unsigned (my_end)=((my_c)->my_at); (my_emit_align)((my_c),(16UL),(my_OP_NOP)); (my_s)=((struct my_section*)(my_alloc)(((my_c)->my_a),(72UL))); - ((my_s)->my_next)=((struct my_section*)0UL); + ((my_s)->my_next)=((void *)0); ((my_s)->my_name)=(my_name); ((my_s)->my_start)=((my_c)->my_at); ((my_s)->my_end)=((my_c)->my_at); @@ -1542,7 +1546,7 @@ unsigned long( my_call_check)(struct my_compiler* my_c,struct my_node* my_n){ (my_result)=((unsigned long)(((unsigned long)(my_result))|((unsigned long)(my_ret)))); } else if ((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_REF))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_DEREF))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_POS))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_NEG))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_NOT))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_CAST))))||((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_DOT)))))))))))))))) { (my_result)=((my_call_check)((my_c),((my_n)->my_a))); - } else if ((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_STR))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_NUM))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_CHAR))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_IDENT))))||((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_SIZEOF)))))))))))) { + } else if ((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_STR))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_NUM))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_CHAR))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_IDENT))))||((unsigned long)(((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_SIZEOF))))||((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_NIL)))))))))))))) { } else { (my_fdputd)((2UL),((my_n)->my_kind)); (my_die)(((unsigned char *)"invalid expr")); @@ -1612,16 +1616,16 @@ struct my_compiler*( my_comp_setup)(struct my_alloc* my_a){ (my_c)=((struct my_compiler*)(my_alloc)((my_a),(96UL))); ((my_c)->my_a)=(my_a); ((my_c)->my_p)=((my_setup_parser)((my_a))); - ((my_c)->my_filename)=((unsigned char*)0UL); + ((my_c)->my_filename)=((void *)0); ((my_c)->my_lineno)=(0UL); ((my_c)->my_colno)=(0UL); ((my_c)->my_s)=((my_setup_assembler)((my_a))); - ((my_c)->my_decls)=((struct my_decl*)0UL); + ((my_c)->my_decls)=((void *)0); ((my_c)->my_do_cout)=(0UL); - ((my_c)->my_cout)=((struct my_file*)0UL); - ((my_c)->my_start)=((struct my_label*)0UL); - ((my_c)->my_kstart)=((struct my_label*)0UL); - ((my_c)->my_used_top)=((struct my_decl*)0UL); + ((my_c)->my_cout)=((void *)0); + ((my_c)->my_start)=((void *)0); + ((my_c)->my_kstart)=((void *)0); + ((my_c)->my_used_top)=((void *)0); return my_c; } void( my_compile)(struct my_compiler* my_c,struct my_node* my_p){ @@ -1678,12 +1682,12 @@ void( my_compile)(struct my_compiler* my_c,struct my_node* my_p){ } (my_d)=((my_next_decl)((my_c),(my_d))); } - (my_d)=((my_find)((my_c),((unsigned char *)"_start"),((unsigned char*)0UL),(0UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_start"),((void *)0),(0UL))); if ((unsigned long)((my_d)&&((my_d)->my_func_defined))) { ((my_c)->my_start)=((my_d)->my_func_label); (my_mark_func_used)((my_c),(my_d)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_kstart"),((unsigned char*)0UL),(0UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_kstart"),((void *)0),(0UL))); if ((unsigned long)((my_d)&&((my_d)->my_func_defined))) { ((my_c)->my_kstart)=((my_d)->my_func_label); (my_mark_func_used)((my_c),(my_d)); @@ -1711,6 +1715,8 @@ void( my_compile_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my_n (my_kind)=((my_n)->my_kind); if ((unsigned long)(((long)(my_kind))==((long)(my_N_STR)))) { (my_emit_str)(((my_c)->my_s),((my_n)->my_s)); + } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_NIL)))) { + (my_emit_num)(((my_c)->my_s),(0UL)); } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_NUM)))) { (my_emit_num)(((my_c)->my_s),((my_n)->my_n)); } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_CHAR)))) { @@ -1725,7 +1731,7 @@ void( my_compile_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my_n (my_compile_expr)((my_c),(my_d),((my_n)->my_b),(1UL)); } if ((unsigned long)(((long)(((my_n)->my_a)->my_kind))==((long)(my_N_IDENT)))) { - (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((void *)0),(0UL))); if ((unsigned long)((my_v)&&((my_v)->my_enum_defined))) { (my_cdie)((my_c),((unsigned char *)"type error")); } @@ -1735,10 +1741,10 @@ void( my_compile_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my_n (my_emit_load)(((my_c)->my_s),(((my_n)->my_a)->my_t)); (my_emit_call)(((my_c)->my_s),((my_count_args)((my_c),((((my_n)->my_a)->my_t)->my_arg)))); } else if ((unsigned long)(!((my_strcmp)((((my_n)->my_a)->my_s),((unsigned char *)"_include"))))) { - (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((void *)0),(0UL))); (my_compile_include)((my_c),(my_n)); } else { - (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((void *)0),(0UL))); (my_emit_lcall)(((my_c)->my_s),((my_v)->my_func_label),((my_count_args)((my_c),((((my_n)->my_a)->my_t)->my_arg)))); } } else { @@ -1748,7 +1754,7 @@ void( my_compile_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my_n if ((my_n)->my_b) { (my_unify)((my_c),((((my_n)->my_a)->my_t)->my_arg),(((my_n)->my_b)->my_t)); } else { - (my_unify)((my_c),((((my_n)->my_a)->my_t)->my_arg),((struct my_type*)0UL)); + (my_unify)((my_c),((((my_n)->my_a)->my_t)->my_arg),((void *)0)); } } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_DOT)))) { (my_compile_expr)((my_c),(my_d),((my_n)->my_a),(0UL)); @@ -1764,7 +1770,7 @@ void( my_compile_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my_n (my_emit_load)(((my_c)->my_s),((my_n)->my_t)); } } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_IDENT)))) { - (my_v)=((my_find)((my_c),((my_n)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),((my_n)->my_s),((void *)0),(0UL))); if ((unsigned long)((my_v)&&((my_v)->my_enum_defined))) { (my_emit_num)(((my_c)->my_s),((my_v)->my_enum_value)); return; @@ -1777,7 +1783,7 @@ void( my_compile_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my_n } return; } - (my_v)=((my_find)((my_c),((my_n)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),((my_n)->my_s),((void *)0),(0UL))); if ((unsigned long)((my_v)&&((my_v)->my_func_defined))) { (my_emit_ptr)(((my_c)->my_s),((my_v)->my_func_label)); return; @@ -1947,7 +1953,7 @@ void( my_compile_func)(struct my_compiler* my_c,struct my_decl* my_d){ (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); (my_emit_preamble)(((my_c)->my_s),((my_d)->my_func_preamble),(my_pragma)); - (my_compile_stmt)((my_c),(my_d),(((my_d)->my_func_def)->my_b),((struct my_label*)0UL),((struct my_label*)0UL)); + (my_compile_stmt)((my_c),(my_d),(((my_d)->my_func_def)->my_b),((void *)0),((void *)0)); (my_emit_num)(((my_c)->my_s),(0UL)); if (my_pragma) { (my_emit_ud)(((my_c)->my_s)); @@ -1990,7 +1996,7 @@ void( my_compile_stmt)(struct my_compiler* my_c,struct my_decl* my_d,struct my_n (my_kind)=((my_n)->my_kind); if ((unsigned long)(((long)(my_kind))==((long)(my_N_CONDLIST)))) { (my_ifout)=((my_mklabel)(((my_c)->my_s))); - (my_no)=((struct my_label*)0UL); + (my_no)=((void *)0); while (1) { if (my_no) { (my_fixup_label)(((my_c)->my_s),(my_no)); @@ -2084,7 +2090,7 @@ struct my_peg_node*( my_construct)(struct my_peg* my_c,unsigned long my_sp){ unsigned long my_nargs = 0; struct my_peg_node* my_n = 0; struct my_peg_node** my_link = 0; - (((my_c)->my_nstack)[0UL])=((struct my_peg_node*)0UL); + (((my_c)->my_nstack)[0UL])=((void *)0); (my_i)=(0UL); while (1) { if ((unsigned long)(((long)(my_i))==((long)((my_c)->my_op)))) { @@ -2093,8 +2099,8 @@ struct my_peg_node*( my_construct)(struct my_peg* my_c,unsigned long my_sp){ if ((unsigned long)(((long)((((my_c)->my_out)[my_i]).my_tag))!=((long)(my_sp)))) { (my_n)=((struct my_peg_node*)(my_alloc)(((my_c)->my_a),(64UL))); ((my_n)->my_tag)=((((my_c)->my_out)[my_i]).my_tag); - ((my_n)->my_next)=((struct my_peg_node*)0UL); - ((my_n)->my_child)=((struct my_peg_node*)0UL); + ((my_n)->my_next)=((void *)0); + ((my_n)->my_child)=((void *)0); ((my_n)->my_str)=(&(((my_c)->my_src)[(((my_c)->my_out)[my_i]).my_start])); ((my_n)->my_len)=((unsigned long)(((unsigned long)((((my_c)->my_out)[my_i]).my_end))-((unsigned long)((((my_c)->my_out)[my_i]).my_start)))); ((my_n)->my_filename)=((my_c)->my_filename); @@ -2121,7 +2127,7 @@ struct my_peg_node*( my_construct)(struct my_peg* my_c,unsigned long my_sp){ (my_die)(((unsigned char *)"node overflow")); } } else { - (my_n)=((struct my_peg_node*)0UL); + (my_n)=((void *)0); } (((my_c)->my_nstack)[(my_c)->my_np])=(my_n); ((my_c)->my_np)=((unsigned long)(((unsigned long)((my_c)->my_np))+((unsigned long)(1UL)))); @@ -2247,6 +2253,8 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_NUM)))) { (my_fputd)(((my_c)->my_cout),((my_n)->my_n)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"UL")); + } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_NIL)))) { + (my_fputs)(((my_c)->my_cout),((unsigned char *)"(void *)0")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_CHAR)))) { (my_fputd)(((my_c)->my_cout),((my_n)->my_n)); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_CALL)))) { @@ -2361,19 +2369,19 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_ctranslate_expr)((my_c),((my_n)->my_a)); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_NEG)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(-(unsigned long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_NOT)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(~(unsigned long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_ADD)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((unsigned long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))+((unsigned long)(")); @@ -2381,7 +2389,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_SUB)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((unsigned long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))-((unsigned long)(")); @@ -2389,7 +2397,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_MUL)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))*((long)(")); @@ -2397,7 +2405,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_DIV)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))/((long)(")); @@ -2405,7 +2413,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_MOD)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))%((long)(")); @@ -2413,7 +2421,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_LSH)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((unsigned long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))<<((unsigned long)(")); @@ -2421,7 +2429,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_RSH)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((unsigned long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))>>((unsigned long)(")); @@ -2429,7 +2437,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_AND)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((unsigned long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))&((unsigned long)(")); @@ -2437,7 +2445,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_OR)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((unsigned long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))|((unsigned long)(")); @@ -2445,7 +2453,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_XOR)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")(((unsigned long)(")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); (my_fputs)(((my_c)->my_cout),((unsigned char *)"))^((unsigned long)(")); @@ -2453,7 +2461,7 @@ void( my_ctranslate_expr)(struct my_compiler* my_c,struct my_node* my_n){ (my_fputs)(((my_c)->my_cout),((unsigned char *)")))")); } else if ((unsigned long)(((long)((my_n)->my_kind))==((long)(my_N_CAST)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"(")); - (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),((unsigned char *)""),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)")")); (my_ctranslate_expr)((my_c),((my_n)->my_a)); } else { @@ -2577,7 +2585,7 @@ void( my_ctranslate_struct)(struct my_compiler* my_c,struct my_decl* my_d){ } (my_v)=((my_find)((my_c),((my_d)->my_name),((((my_n)->my_a)->my_a)->my_s),(0UL))); (my_fputs)(((my_c)->my_cout),((unsigned char *)"\011")); - (my_ctranslate_type)((my_c),((my_v)->my_member_type),((((my_n)->my_a)->my_a)->my_s),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_v)->my_member_type),((((my_n)->my_a)->my_a)->my_s),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)";\012")); (my_n)=((my_n)->my_b); } @@ -2624,9 +2632,9 @@ void( my_ctranslate_type2)(struct my_compiler* my_c,struct my_type* my_ty,unsign if (my_arg) { while (1) { if (my_args) { - (my_ctranslate_type)((my_c),((my_arg)->my_val),((((my_args)->my_a)->my_a)->my_s),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_arg)->my_val),((((my_args)->my_a)->my_a)->my_s),(0UL),((void *)0)); } else { - (my_ctranslate_type)((my_c),((my_arg)->my_val),((unsigned char *)""),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_arg)->my_val),((unsigned char *)""),(0UL),((void *)0)); } (my_arg)=((my_arg)->my_arg); if (my_arg) { @@ -2676,7 +2684,7 @@ void( my_ctranslate_vars)(struct my_compiler* my_c,struct my_node* my_n){ (my_ctranslate_vars)((my_c),((my_n)->my_a)); } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_VARDECL)))) { (my_fputs)(((my_c)->my_cout),((unsigned char *)"\011")); - (my_ctranslate_type)((my_c),((my_n)->my_t),(((my_n)->my_a)->my_s),(0UL),((struct my_node*)0UL)); + (my_ctranslate_type)((my_c),((my_n)->my_t),(((my_n)->my_a)->my_s),(0UL),((void *)0)); (my_fputs)(((my_c)->my_cout),((unsigned char *)" = ")); (my_ctranslate_zero)((my_c),((my_n)->my_t)); (my_fputs)(((my_c)->my_cout),((unsigned char *)";\012")); @@ -2817,7 +2825,7 @@ void( my_defenum)(struct my_compiler* my_c,struct my_node* my_n){ ((my_c)->my_lineno)=(((my_n)->my_a)->my_lineno); ((my_c)->my_colno)=(((my_n)->my_a)->my_colno); (my_name)=((((my_n)->my_a)->my_a)->my_s); - (my_d)=((my_find)((my_c),(my_name),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),(my_name),((void *)0),(1UL))); if ((my_d)->my_enum_defined) { (my_cdie)((my_c),((unsigned char *)"duplicate enum")); } @@ -2840,7 +2848,7 @@ struct my_decl*( my_defextern)(struct my_compiler* my_c,struct my_node* my_n){ ((my_c)->my_colno)=((my_n)->my_colno); (my_name)=(((my_n)->my_a)->my_s); (my_t)=((my_prototype)((my_c),((my_n)->my_b))); - (my_d)=((my_find)((my_c),(my_name),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),(my_name),((void *)0),(1UL))); if ((my_d)->my_func_defined) { (my_cdie)((my_c),((unsigned char *)"duplicate function")); } @@ -2859,7 +2867,7 @@ void( my_defstruct)(struct my_compiler* my_c,struct my_node* my_n){ if ((unsigned long)(((unsigned long)(!((my_strcmp)((my_name),((unsigned char *)"int")))))||((unsigned long)(((unsigned long)(!((my_strcmp)((my_name),((unsigned char *)"byte")))))||((unsigned long)(!((my_strcmp)((my_name),((unsigned char *)"func"))))))))) { (my_cdie)((my_c),((unsigned char *)"reserved word")); } - (my_d)=((my_find)((my_c),(my_name),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),(my_name),((void *)0),(1UL))); if ((my_d)->my_struct_defined) { (my_cdie)((my_c),((unsigned char *)"duplicate struct")); } @@ -2909,7 +2917,7 @@ void( my_defunion)(struct my_compiler* my_c,struct my_node* my_n){ if ((unsigned long)(((unsigned long)(!((my_strcmp)((my_name),((unsigned char *)"int")))))||((unsigned long)(((unsigned long)(!((my_strcmp)((my_name),((unsigned char *)"byte")))))||((unsigned long)(!((my_strcmp)((my_name),((unsigned char *)"func"))))))))) { (my_cdie)((my_c),((unsigned char *)"reserved word")); } - (my_d)=((my_find)((my_c),(my_name),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),(my_name),((void *)0),(1UL))); if ((my_d)->my_struct_defined) { (my_cdie)((my_c),((unsigned char *)"duplicate struct")); } @@ -2983,7 +2991,7 @@ void( my_emit_blob)(struct my_assembler* my_c,unsigned char* my_s,unsigned long } void( my_emit_builtin)(struct my_compiler* my_c){ struct my_decl* my_d = 0; - (my_d)=((my_find)((my_c),((unsigned char *)"syscall"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"syscall"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -2991,13 +2999,13 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_emit_syscall)(((my_c)->my_s)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_restorer"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_restorer"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); (my_emit_restorer)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_include"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_include"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3006,7 +3014,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"ud2"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"ud2"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3015,7 +3023,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"cpuid"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"cpuid"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3040,7 +3048,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"inb"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"inb"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3050,7 +3058,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"outb"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"outb"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3061,7 +3069,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"inw"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"inw"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3072,7 +3080,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"outw"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"outw"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3084,7 +3092,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"ind"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"ind"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3094,7 +3102,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"outd"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"outd"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3105,7 +3113,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"rdmsr"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"rdmsr"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3118,7 +3126,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"wrmsr"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"wrmsr"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3132,7 +3140,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"rdcr0"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"rdcr0"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3141,7 +3149,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"wrcr0"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"wrcr0"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3151,7 +3159,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"rdcr2"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"rdcr2"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3160,7 +3168,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"wrcr2"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"wrcr2"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3170,7 +3178,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"rdcr3"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"rdcr3"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3179,7 +3187,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"wrcr3"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"wrcr3"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3189,7 +3197,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"rdcr4"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"rdcr4"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3198,7 +3206,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"wrcr4"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"wrcr4"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3208,7 +3216,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"lgdt"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"lgdt"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3224,7 +3232,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"lidt"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"lidt"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3240,7 +3248,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"lldt"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"lldt"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3250,7 +3258,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"ltr"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"ltr"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3260,7 +3268,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"lseg"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"lseg"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3289,7 +3297,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"hlt"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"hlt"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3298,7 +3306,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"cli"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"cli"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3307,7 +3315,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"sti"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"sti"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3316,7 +3324,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"rdflags"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"rdflags"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3324,7 +3332,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_op)(((my_c)->my_s),(my_OP_PUSHF)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"wrflags"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"wrflags"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3335,7 +3343,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_op)(((my_c)->my_s),(my_OP_POPF)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"wbinvld"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"wbinvld"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3345,7 +3353,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"invlpg"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"invlpg"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3355,19 +3363,19 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_ssr0"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_ssr0"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); (my_emit_ssr)((my_c)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_isr0"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_isr0"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); (my_emit_isr)((my_c)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_rgs"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_rgs"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3378,7 +3386,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_r32"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_r32"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3390,7 +3398,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_w32"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_w32"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3403,7 +3411,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_r16"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_r16"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3416,7 +3424,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_w16"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_w16"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3429,7 +3437,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"_rdrand"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_rdrand"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3438,7 +3446,7 @@ void( my_emit_builtin)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); (my_emit_ret)(((my_c)->my_s)); } - (my_d)=((my_find)((my_c),((unsigned char *)"taskswitch"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"taskswitch"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&((unsigned long)(!(((my_d)->my_func_label)->my_fixed))))) { (my_fixup_label)(((my_c)->my_s),((my_d)->my_func_label)); (my_add_symbol)(((my_c)->my_s),((my_d)->my_name),((my_d)->my_func_label)); @@ -3608,7 +3616,7 @@ void( my_emit_isr)(struct my_compiler* my_c){ (my_as_modrm)(((my_c)->my_s),(my_OP_STORE),(my_R_RAX),(my_R_RBP),(0UL),(0UL),(32UL)); (my_as_modrm)(((my_c)->my_s),(my_OP_LOAD),(my_R_RAX),(my_R_RBP),(0UL),(0UL),((unsigned long)(((unsigned long)(176UL))+((unsigned long)(48UL))))); (my_as_modrm)(((my_c)->my_s),(my_OP_STORE),(my_R_RAX),(my_R_RBP),(0UL),(0UL),(152UL)); - (my_d)=((my_find)((my_c),((unsigned char *)"_isr"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_isr"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&(((my_d)->my_func_label)->my_fixed))) { (my_as_jmp)(((my_c)->my_s),(my_OP_CALL),((my_d)->my_func_label)); } @@ -3896,7 +3904,7 @@ unsigned long( my_emit_sections)(struct my_assembler* my_c){ struct my_section* my_s = 0; struct my_symbol* my_y = 0; unsigned long my_n = 0; - (my_add_symbol)((my_c),((unsigned char *)""),((struct my_label*)0UL)); + (my_add_symbol)((my_c),((unsigned char *)""),((void *)0)); (my_s)=((my_find_section)((my_c),((unsigned char *)""))); ((my_s)->my_start)=(0UL); ((my_s)->my_end)=(0UL); @@ -4125,7 +4133,7 @@ void( my_emit_ssr)(struct my_compiler* my_c){ (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RBP)); (my_as_modrr)(((my_c)->my_s),(my_OP_MOVE),(my_R_RBP),(my_R_RSP)); (my_as_opr)(((my_c)->my_s),(my_OP_PUSHR),(my_R_RAX)); - (my_d)=((my_find)((my_c),((unsigned char *)"_ssr"),((unsigned char*)0UL),(1UL))); + (my_d)=((my_find)((my_c),((unsigned char *)"_ssr"),((void *)0),(1UL))); if ((unsigned long)(((my_d)->my_func_defined)&&(((my_d)->my_func_label)->my_fixed))) { (my_as_jmp)(((my_c)->my_s),(my_OP_CALL),((my_d)->my_func_label)); } @@ -4244,7 +4252,7 @@ void( my_fail)(struct my_peg* my_c){ ((my_c)->my_fail_tag)=((my_c)->my_tag); ((my_c)->my_fail_line)=((my_c)->my_line); ((my_c)->my_fail_col)=((my_c)->my_col); - ((my_c)->my_fail_literal)=((unsigned char*)0UL); + ((my_c)->my_fail_literal)=((void *)0); } ((my_c)->my_sp)=((unsigned long)(((unsigned long)((my_c)->my_sp))-((unsigned long)(1UL)))); ((my_c)->my_pos)=((((my_c)->my_stack)[(my_c)->my_sp]).my_pos); @@ -4358,7 +4366,7 @@ struct my_decl*( my_find)(struct my_compiler* my_c,unsigned char* my_name,unsign struct my_decl* my_d = 0; struct my_decl** my_link = 0; unsigned long my_dir = 0; - (my_p)=((struct my_decl*)0UL); + (my_p)=((void *)0); (my_link)=(&((my_c)->my_decls)); while (1) { (my_d)=(*(my_link)); @@ -4388,35 +4396,35 @@ struct my_decl*( my_find)(struct my_compiler* my_c,unsigned char* my_name,unsign } } if ((unsigned long)(!(my_make))) { - return (struct my_decl*)0UL; + return (void *)0; } (my_d)=((struct my_decl*)(my_alloc)(((my_c)->my_a),(240UL))); ((my_d)->my_name)=(my_name); ((my_d)->my_member_name)=(my_member_name); ((my_d)->my_p)=(my_p); - ((my_d)->my_l)=((struct my_decl*)0UL); - ((my_d)->my_r)=((struct my_decl*)0UL); - ((my_d)->my_used_next)=((struct my_decl*)0UL); + ((my_d)->my_l)=((void *)0); + ((my_d)->my_r)=((void *)0); + ((my_d)->my_used_next)=((void *)0); ((my_d)->my_func_defined)=(0UL); - ((my_d)->my_func_type)=((struct my_type*)0UL); + ((my_d)->my_func_type)=((void *)0); ((my_d)->my_func_label)=((my_mklabel)(((my_c)->my_s))); - ((my_d)->my_func_def)=((struct my_node*)0UL); + ((my_d)->my_func_def)=((void *)0); ((my_d)->my_func_used)=(0UL); ((my_d)->my_struct_defined)=(0UL); ((my_d)->my_struct_size)=(0UL); ((my_d)->my_struct_layout_done)=(0UL); - ((my_d)->my_struct_def)=((struct my_node*)0UL); + ((my_d)->my_struct_def)=((void *)0); ((my_d)->my_member_defined)=(0UL); - ((my_d)->my_member_type)=((struct my_type*)0UL); + ((my_d)->my_member_type)=((void *)0); ((my_d)->my_member_offset)=(0UL); - ((my_d)->my_member_def)=((struct my_node*)0UL); + ((my_d)->my_member_def)=((void *)0); ((my_d)->my_enum_defined)=(0UL); ((my_d)->my_enum_value)=(0UL); - ((my_d)->my_enum_def)=((struct my_node*)0UL); + ((my_d)->my_enum_def)=((void *)0); ((my_d)->my_var_defined)=(0UL); - ((my_d)->my_var_type)=((struct my_type*)0UL); + ((my_d)->my_var_type)=((void *)0); ((my_d)->my_var_offset)=(0UL); - ((my_d)->my_var_def)=((struct my_node*)0UL); + ((my_d)->my_var_def)=((void *)0); ((my_d)->my_goto_defined)=(0UL); ((my_d)->my_goto_label)=((my_mklabel)(((my_c)->my_s))); (*(my_link))=(my_d); @@ -4440,7 +4448,7 @@ struct my_decl*( my_first_decl)(struct my_compiler* my_c){ struct my_decl* my_d = 0; (my_d)=((my_c)->my_decls); if ((unsigned long)(!(my_d))) { - return (struct my_decl*)0UL; + return (void *)0; } while (1) { if ((unsigned long)(!((my_d)->my_l))) { @@ -4874,7 +4882,7 @@ void( my_main)(unsigned long my_argc,unsigned char** my_argv,unsigned char** my_ (my_die)(((unsigned char *)"invalid argument")); } (my_tmp)=((struct my_name_node*)(my_alloc)((&(my_a)),(16UL))); - ((my_tmp)->my_next)=((struct my_name_node*)0UL); + ((my_tmp)->my_next)=((void *)0); ((my_tmp)->my_name)=((my_argv)[my_i]); (*(my_link))=(my_tmp); (my_link)=(&((my_tmp)->my_next)); @@ -4939,7 +4947,7 @@ void( my_mark_expr_used)(struct my_compiler* my_c,struct my_decl* my_d,struct my } return; } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_IDENT)))) { - (my_v)=((my_find)((my_c),((my_n)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),((my_n)->my_s),((void *)0),(0UL))); if ((unsigned long)((my_v)&&((my_v)->my_enum_defined))) { return; } @@ -4947,7 +4955,7 @@ void( my_mark_expr_used)(struct my_compiler* my_c,struct my_decl* my_d,struct my if ((unsigned long)((my_v)&&((my_v)->my_var_defined))) { return; } - (my_v)=((my_find)((my_c),((my_n)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),((my_n)->my_s),((void *)0),(0UL))); if ((unsigned long)((my_v)&&((my_v)->my_func_defined))) { (my_mark_func_used)((my_c),(my_v)); return; @@ -4960,7 +4968,7 @@ void( my_mark_expr_used)(struct my_compiler* my_c,struct my_decl* my_d,struct my } else if ((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_REF))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_DEREF))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_BNOT))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_POS))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_NEG))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_NOT))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_CAST))))||((unsigned long)(((long)(my_kind))==((long)(my_N_DOT)))))))))))))))))) { (my_mark_expr_used)((my_c),(my_d),((my_n)->my_a)); return; - } else if ((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_SIZEOF))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_STR))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_NUM))))||((unsigned long)(((long)(my_kind))==((long)(my_N_CHAR)))))))))) { + } else if ((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_SIZEOF))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_STR))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_NUM))))||((unsigned long)(((unsigned long)(((long)(my_kind))==((long)(my_N_CHAR))))||((unsigned long)(((long)(my_kind))==((long)(my_N_NIL)))))))))))) { return; } else { (my_cdie)((my_c),((unsigned char *)"not an expression")); @@ -5057,7 +5065,7 @@ void( my_memset)(unsigned char* my_dest,unsigned long my_c,unsigned long my_size struct my_label*( my_mklabel)(struct my_assembler* my_c){ struct my_label* my_l = 0; (my_l)=((struct my_label*)(my_alloc)(((my_c)->my_a),(24UL))); - ((my_l)->my_fix)=((struct my_fixup*)0UL); + ((my_l)->my_fix)=((void *)0); ((my_l)->my_at)=(0UL); ((my_l)->my_fixed)=(0UL); return my_l; @@ -5068,20 +5076,20 @@ struct my_node*( my_mknode)(struct my_parser* my_c,unsigned long my_kind,struct ((my_ret)->my_kind)=(my_kind); ((my_ret)->my_a)=(my_a); ((my_ret)->my_b)=(my_b); - ((my_ret)->my_filename)=((unsigned char*)0UL); + ((my_ret)->my_filename)=((void *)0); ((my_ret)->my_lineno)=(0UL); ((my_ret)->my_colno)=(0UL); ((my_ret)->my_n)=(0UL); - ((my_ret)->my_s)=((unsigned char*)0UL); - ((my_ret)->my_t)=((struct my_type*)0UL); + ((my_ret)->my_s)=((void *)0); + ((my_ret)->my_t)=((void *)0); (my_fillpos)((my_c),(my_ret)); return my_ret; } struct my_node*( my_mknode0)(struct my_parser* my_c,unsigned long my_kind){ - return (my_mknode)((my_c),(my_kind),((struct my_node*)0UL),((struct my_node*)0UL)); + return (my_mknode)((my_c),(my_kind),((void *)0),((void *)0)); } struct my_node*( my_mknode1)(struct my_parser* my_c,unsigned long my_kind,struct my_node* my_a){ - return (my_mknode)((my_c),(my_kind),(my_a),((struct my_node*)0UL)); + return (my_mknode)((my_c),(my_kind),(my_a),((void *)0)); } struct my_type*( my_mktype)(struct my_compiler* my_c,unsigned long my_kind,struct my_type* my_a,struct my_type* my_b,struct my_decl* my_st){ struct my_type* my_t = 0; @@ -5093,26 +5101,26 @@ struct my_type*( my_mktype)(struct my_compiler* my_c,unsigned long my_kind,struc return my_t; } struct my_type*( my_mktype0)(struct my_compiler* my_c,unsigned long my_kind){ - return (my_mktype)((my_c),(my_kind),((struct my_type*)0UL),((struct my_type*)0UL),((struct my_decl*)0UL)); + return (my_mktype)((my_c),(my_kind),((void *)0),((void *)0),((void *)0)); } struct my_type*( my_mktype1)(struct my_compiler* my_c,unsigned long my_kind,struct my_type* my_a){ - return (my_mktype)((my_c),(my_kind),(my_a),((struct my_type*)0UL),((struct my_decl*)0UL)); + return (my_mktype)((my_c),(my_kind),(my_a),((void *)0),((void *)0)); } struct my_type*( my_mktype2)(struct my_compiler* my_c,unsigned long my_kind,struct my_type* my_a,struct my_type* my_b){ - return (my_mktype)((my_c),(my_kind),(my_a),(my_b),((struct my_decl*)0UL)); + return (my_mktype)((my_c),(my_kind),(my_a),(my_b),((void *)0)); } struct my_type*( my_mktype_struct)(struct my_compiler* my_c,struct my_decl* my_st){ - return (my_mktype)((my_c),(my_TY_STRUCT),((struct my_type*)0UL),((struct my_type*)0UL),(my_st)); + return (my_mktype)((my_c),(my_TY_STRUCT),((void *)0),((void *)0),(my_st)); } struct my_type*( my_mktype_union)(struct my_compiler* my_c,struct my_decl* my_st){ - return (my_mktype)((my_c),(my_TY_UNION),((struct my_type*)0UL),((struct my_type*)0UL),(my_st)); + return (my_mktype)((my_c),(my_TY_UNION),((void *)0),((void *)0),(my_st)); } unsigned long( my_mmap)(unsigned long my_addr,unsigned long my_len,unsigned long my_prot,unsigned long my_flags,unsigned long my_fd,unsigned long my_off){ return (my_syscall)((9UL),(my_addr),(my_len),(my_prot),(my_flags),(my_fd),(my_off)); } struct my_decl*( my_next_decl)(struct my_compiler* my_c,struct my_decl* my_d){ if ((unsigned long)(!(my_d))) { - return (struct my_decl*)0UL; + return (void *)0; } if ((my_d)->my_r) { (my_d)=((my_d)->my_r); @@ -5125,7 +5133,7 @@ struct my_decl*( my_next_decl)(struct my_compiler* my_c,struct my_decl* my_d){ } while (1) { if ((unsigned long)(!((my_d)->my_p))) { - return (struct my_decl*)0UL; + return (void *)0; } if ((unsigned long)(((long)(((my_d)->my_p)->my_l))==((long)(my_d)))) { return (my_d)->my_p; @@ -5146,6 +5154,9 @@ unsigned char*( my_node_to_str)(unsigned long my_kind){ if ((unsigned long)(((long)(my_kind))==((long)(my_N_STR)))) { return (unsigned char *)"N_STR"; } + if ((unsigned long)(((long)(my_kind))==((long)(my_N_NIL)))) { + return (unsigned char *)"N_NIL"; + } if ((unsigned long)(((long)(my_kind))==((long)(my_N_STMTLIST)))) { return (unsigned char *)"N_STMTLIST"; } @@ -7405,6 +7416,28 @@ unsigned long( my_peg_P_neg_op)(struct my_peg* my_c){ } return my_ok; } +unsigned long( my_peg_P_nil)(struct my_peg* my_c){ + unsigned long my_ok = 0; + (my_enter)((my_c),(my_P_nil)); + (my_ok)=((my_literal)((my_c),((unsigned char *)"nil"))); + if (my_ok) { + (my_choice)((my_c)); + (my_ok)=((my_charset)((my_c),((unsigned char *)"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"))); + if (my_ok) { + (my_fail)((my_c)); + (my_fail)((my_c)); + (my_ok)=(0UL); + } else { + (my_ok)=(1UL); + } + } + if (my_ok) { + (my_leave)((my_c),(my_P_nil)); + } else { + (my_fail)((my_c)); + } + return my_ok; +} unsigned long( my_peg_P_not_op)(struct my_peg* my_c){ unsigned long my_ok = 0; (my_enter)((my_c),(my_P_not_op)); @@ -7531,6 +7564,13 @@ unsigned long( my_peg_P_primary)(struct my_peg* my_c){ } if ((unsigned long)(!(my_ok))) { (my_choice)((my_c)); + (my_ok)=((my_peg_P_nil)((my_c))); + if (my_ok) { + (my_ok)=((my_peg_P_sp)((my_c))); + } + } + if ((unsigned long)(!(my_ok))) { + (my_choice)((my_c)); (my_ok)=((my_literal)((my_c),((unsigned char *)"("))); if (my_ok) { (my_ok)=((my_peg_P_sp)((my_c))); @@ -7665,6 +7705,10 @@ unsigned long( my_peg_P_reserved)(struct my_peg* my_c){ (my_choice)((my_c)); (my_ok)=((my_peg_P_as)((my_c))); } + if ((unsigned long)(!(my_ok))) { + (my_choice)((my_c)); + (my_ok)=((my_peg_P_nil)((my_c))); + } if (my_ok) { (my_commit)((my_c)); } else { @@ -8385,13 +8429,13 @@ struct my_peg*( my_peg_new)(unsigned char* my_filename,unsigned char* my_src,uns ((my_c)->my_fail_tag)=(0UL); ((my_c)->my_fail_line)=(0UL); ((my_c)->my_fail_col)=(0UL); - ((my_c)->my_fail_literal)=((unsigned char*)0UL); + ((my_c)->my_fail_literal)=((void *)0); ((my_c)->my_limit)=(1024UL); ((my_c)->my_stack)=((struct my_peg_frame*)(my_alloc)((my_a),((unsigned long)(((long)((my_c)->my_limit))*((long)(48UL)))))); ((my_c)->my_sp)=(0UL); ((my_c)->my_depth)=(0UL); ((my_c)->my_op)=(0UL); - ((my_c)->my_out)=((struct my_peg_op*)0UL); + ((my_c)->my_out)=((void *)0); ((my_c)->my_cap)=(0UL); ((my_c)->my_ncap)=(1024UL); ((my_c)->my_nstack)=((struct my_peg_node**)(my_alloc)((my_a),((unsigned long)(((long)((my_c)->my_ncap))*((long)(8UL)))))); @@ -8444,7 +8488,7 @@ void( my_peg_reset)(struct my_peg* my_c,unsigned char* my_filename,unsigned char ((my_c)->my_fail_tag)=(0UL); ((my_c)->my_fail_line)=(0UL); ((my_c)->my_fail_col)=(0UL); - ((my_c)->my_fail_literal)=((unsigned char*)0UL); + ((my_c)->my_fail_literal)=((void *)0); ((my_c)->my_depth)=(0UL); ((my_c)->my_sp)=(0UL); ((my_c)->my_op)=(0UL); @@ -8456,7 +8500,7 @@ struct my_type*( my_prototype)(struct my_compiler* my_c,struct my_node* my_n){ struct my_decl* my_st = 0; unsigned long my_kind = 0; if ((unsigned long)(!(my_n))) { - return (struct my_type*)0UL; + return (void *)0; } ((my_c)->my_lineno)=((my_n)->my_lineno); ((my_c)->my_colno)=(0UL); @@ -8471,7 +8515,7 @@ struct my_type*( my_prototype)(struct my_compiler* my_c,struct my_node* my_n){ if ((unsigned long)(!((my_strcmp)(((my_n)->my_s),((unsigned char *)"byte"))))) { return (my_mktype0)((my_c),(my_TY_BYTE)); } - (my_st)=((my_find)((my_c),((my_n)->my_s),((unsigned char*)0UL),(0UL))); + (my_st)=((my_find)((my_c),((my_n)->my_s),((void *)0),(0UL))); if ((unsigned long)(((unsigned long)(!(my_st)))||((unsigned long)(!((my_st)->my_struct_defined))))) { (my_cdie)((my_c),((unsigned char *)"unknown struct")); } @@ -8552,7 +8596,7 @@ struct my_node*( my_reconstruct)(struct my_parser* my_c,struct my_peg_node* my_p struct my_node* my_n = 0; struct my_node* my_p = 0; (my_assert)(((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_grammar)))),((unsigned char *)"grammar")); - (my_ret)=((struct my_node*)0UL); + (my_ret)=((void *)0); (my_link)=(&(my_ret)); (my_pn)=((my_pn)->my_child); while (1) { @@ -8625,7 +8669,7 @@ struct my_node*( my_reconstruct_args)(struct my_parser* my_c,struct my_peg_node* struct my_node** my_link = 0; struct my_node* my_a = 0; struct my_node* my_n = 0; - (my_ret)=((struct my_node*)0UL); + (my_ret)=((void *)0); (my_link)=(&(my_ret)); while (1) { if ((unsigned long)(!(my_pn))) { @@ -8741,7 +8785,7 @@ struct my_node*( my_reconstruct_compound)(struct my_parser* my_c,struct my_peg_n struct my_node** my_link = 0; (my_assert)(((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_compound_stmt)))),((unsigned char *)"compound_stmt")); (my_pn)=((my_pn)->my_child); - (my_ret)=((struct my_node*)0UL); + (my_ret)=((void *)0); (my_link)=(&(my_ret)); while (1) { if ((unsigned long)(!(my_pn))) { @@ -8781,14 +8825,14 @@ struct my_node*( my_reconstruct_dec)(struct my_parser* my_c,struct my_peg_node* } struct my_node*( my_reconstruct_empty)(struct my_parser* my_c,struct my_peg_node* my_pn){ (my_assert)(((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_empty_stmt)))),((unsigned char *)"empty_stmt")); - return (struct my_node*)0UL; + return (void *)0; } struct my_node*( my_reconstruct_enum)(struct my_parser* my_c,struct my_peg_node* my_pn){ struct my_node* my_a = 0; struct my_node** my_link = 0; struct my_node* my_n = 0; (my_assert)(((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_enum_decl)))),((unsigned char *)"enum_decl")); - (my_n)=((my_mknode)((my_c),(my_N_ENUM),((struct my_node*)0UL),((struct my_node*)0UL))); + (my_n)=((my_mknode)((my_c),(my_N_ENUM),((void *)0),((void *)0))); (my_copypos)((my_n),(my_pn)); (my_pn)=(((my_pn)->my_child)->my_next); (my_link)=(&((my_n)->my_b)); @@ -8810,7 +8854,7 @@ struct my_node*( my_reconstruct_enum_item)(struct my_parser* my_c,struct my_peg_ struct my_node* my_n = 0; (my_assert)(((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_enum_item)))),((unsigned char *)"enum_item")); (my_a)=((my_reconstruct_ident)((my_c),((my_pn)->my_child))); - (my_b)=((struct my_node*)0UL); + (my_b)=((void *)0); if (((my_pn)->my_child)->my_next) { (my_b)=((my_reconstruct_expr)((my_c),(((my_pn)->my_child)->my_next))); (my_assert)(((unsigned long)(((long)((my_b)->my_kind))==((long)(my_N_NUM)))),((unsigned char *)"enum must be num")); @@ -8851,7 +8895,7 @@ struct my_node*( my_reconstruct_func_type)(struct my_parser* my_c,struct my_peg_ struct my_node* my_n = 0; struct my_node** my_link = 0; (my_assert)(((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_func_type)))),((unsigned char *)"func_type")); - (my_n)=((my_mknode)((my_c),(my_N_FUNCTYPE),((struct my_node*)0UL),((struct my_node*)0UL))); + (my_n)=((my_mknode)((my_c),(my_N_FUNCTYPE),((void *)0),((void *)0))); (my_copypos)((my_n),(my_pn)); (my_pn)=((my_pn)->my_child); (my_link)=(&((my_n)->my_a)); @@ -8927,7 +8971,7 @@ struct my_node*( my_reconstruct_if)(struct my_parser* my_c,struct my_peg_node* m (*(my_link))=(my_n); (my_link)=(&((my_n)->my_b)); } else if ((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_else_stmt)))) { - (my_a)=((struct my_node*)0UL); + (my_a)=((void *)0); (my_b)=((my_reconstruct_compound)((my_c),(((my_pn)->my_child)->my_next))); (my_n)=((my_mknode1)((my_c),(my_N_CONDLIST),((my_mknode)((my_c),(my_N_COND),(my_a),(my_b))))); (my_copypos)((my_n),(my_pn)); @@ -8993,7 +9037,7 @@ struct my_node*( my_reconstruct_member_list)(struct my_parser* my_c,struct my_pe struct my_node* my_a = 0; struct my_node* my_ret = 0; struct my_node** my_link = 0; - (my_ret)=((struct my_node*)0UL); + (my_ret)=((void *)0); (my_link)=(&(my_ret)); while (1) { if ((unsigned long)(!(my_pn))) { @@ -9039,6 +9083,13 @@ struct my_node*( my_reconstruct_mul)(struct my_parser* my_c,struct my_peg_node* } return my_ret; } +struct my_node*( my_reconstruct_nil)(struct my_parser* my_c,struct my_peg_node* my_pn){ + struct my_node* my_n = 0; + (my_assert)(((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_nil)))),((unsigned char *)"nil")); + (my_n)=((my_mknode0)((my_c),(my_N_NIL))); + (my_copypos)((my_n),(my_pn)); + return my_n; +} struct my_node*( my_reconstruct_post)(struct my_parser* my_c,struct my_peg_node* my_pn){ struct my_node* my_ret = 0; struct my_node* my_n = 0; @@ -9089,6 +9140,8 @@ struct my_node*( my_reconstruct_primary)(struct my_parser* my_c,struct my_peg_no return (my_reconstruct_char)((my_c),(my_pn)); } else if ((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_sizeof_expr)))) { return (my_reconstruct_sizeof)((my_c),(my_pn)); + } else if ((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_nil)))) { + return (my_reconstruct_nil)((my_c),(my_pn)); } else if ((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_expr)))) { return (my_reconstruct_expr)((my_c),(my_pn)); } else { @@ -9099,7 +9152,7 @@ struct my_node*( my_reconstruct_return)(struct my_parser* my_c,struct my_peg_nod struct my_node* my_a = 0; struct my_node* my_n = 0; (my_assert)(((unsigned long)(((long)((my_pn)->my_tag))==((long)(my_P_return_stmt)))),((unsigned char *)"return_stmt")); - (my_a)=((struct my_node*)0UL); + (my_a)=((void *)0); if (((my_pn)->my_child)->my_next) { (my_a)=((my_reconstruct_expr)((my_c),(((my_pn)->my_child)->my_next))); } @@ -9311,7 +9364,7 @@ void( my_reserve)(struct my_assembler* my_c,unsigned long my_n){ ((my_b)->my_buf)=(my_m); ((my_b)->my_fill)=(0UL); ((my_b)->my_cap)=(my_n); - ((my_b)->my_next)=((struct my_chunk*)0UL); + ((my_b)->my_next)=((void *)0); if ((my_c)->my_text_end) { (((my_c)->my_text_end)->my_next)=(my_b); ((my_c)->my_text_end)=(my_b); @@ -9321,18 +9374,18 @@ void( my_reserve)(struct my_assembler* my_c,unsigned long my_n){ } } void( my_setup_alloc)(struct my_alloc* my_c){ - ((my_c)->my_page)=((struct my_page*)0UL); + ((my_c)->my_page)=((void *)0); } struct my_assembler*( my_setup_assembler)(struct my_alloc* my_a){ struct my_assembler* my_c = 0; (my_c)=((struct my_assembler*)(my_alloc)((my_a),(72UL))); ((my_c)->my_a)=(my_a); - ((my_c)->my_out)=((struct my_file*)0UL); + ((my_c)->my_out)=((void *)0); ((my_c)->my_at)=(160UL); - ((my_c)->my_text)=((struct my_chunk*)0UL); - ((my_c)->my_text_end)=((struct my_chunk*)0UL); + ((my_c)->my_text)=((void *)0); + ((my_c)->my_text_end)=((void *)0); ((my_c)->my_bits32)=(0UL); - ((my_c)->my_symbols)=((struct my_symbol*)0UL); + ((my_c)->my_symbols)=((void *)0); ((my_c)->my_num_sections)=(0UL); (my_add_section)((my_c),((unsigned char *)""),(my_SHT_NULL)); (my_add_section)((my_c),((unsigned char *)".text"),(my_SHT_PROGBITS)); @@ -9743,6 +9796,11 @@ void( my_typecheck_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my (my_cdie)((my_c),((unsigned char *)"str is not an lexpr")); } ((my_n)->my_t)=((my_mktype1)((my_c),(my_TY_PTR),((my_mktype0)((my_c),(my_TY_BYTE))))); + } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_NIL)))) { + if ((unsigned long)(!(my_rhs))) { + (my_cdie)((my_c),((unsigned char *)"nil is not an lexpr")); + } + ((my_n)->my_t)=((my_mktype0)((my_c),(my_TY_NIL))); } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_NUM)))) { if ((unsigned long)(!(my_rhs))) { (my_cdie)((my_c),((unsigned char *)"num is not an lexpr")); @@ -9774,7 +9832,7 @@ void( my_typecheck_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my (my_typecheck_expr)((my_c),(my_d),((my_n)->my_b),(1UL)); } if ((unsigned long)(((long)(((my_n)->my_a)->my_kind))==((long)(my_N_IDENT)))) { - (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((void *)0),(0UL))); if ((unsigned long)((my_v)&&((my_v)->my_enum_defined))) { (my_cdie)((my_c),((unsigned char *)"type error")); } @@ -9782,13 +9840,13 @@ void( my_typecheck_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my if ((unsigned long)((my_v)&&((my_v)->my_var_defined))) { (((my_n)->my_a)->my_t)=((my_v)->my_var_type); } else if ((unsigned long)(!((my_strcmp)((((my_n)->my_a)->my_s),((unsigned char *)"_include"))))) { - (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((void *)0),(0UL))); if ((unsigned long)(((unsigned long)(!(my_v)))||((unsigned long)(!((my_v)->my_func_defined))))) { (my_cdie)((my_c),((unsigned char *)"no such function")); } (((my_n)->my_a)->my_t)=((my_v)->my_func_type); } else { - (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),(((my_n)->my_a)->my_s),((void *)0),(0UL))); if ((unsigned long)(((unsigned long)(!(my_v)))||((unsigned long)(!((my_v)->my_func_defined))))) { (my_cdie)((my_c),((unsigned char *)"no such function")); } @@ -9803,7 +9861,7 @@ void( my_typecheck_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my if ((my_n)->my_b) { (my_unify)((my_c),((((my_n)->my_a)->my_t)->my_arg),(((my_n)->my_b)->my_t)); } else { - (my_unify)((my_c),((((my_n)->my_a)->my_t)->my_arg),((struct my_type*)0UL)); + (my_unify)((my_c),((((my_n)->my_a)->my_t)->my_arg),((void *)0)); } ((my_n)->my_t)=((((my_n)->my_a)->my_t)->my_val); } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_DOT)))) { @@ -9824,7 +9882,7 @@ void( my_typecheck_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my } ((my_n)->my_t)=((my_v)->my_member_type); } else if ((unsigned long)(((long)(my_kind))==((long)(my_N_IDENT)))) { - (my_v)=((my_find)((my_c),((my_n)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),((my_n)->my_s),((void *)0),(0UL))); if ((unsigned long)((my_v)&&((my_v)->my_enum_defined))) { ((my_n)->my_t)=((my_mktype0)((my_c),(my_TY_INT))); return; @@ -9834,7 +9892,7 @@ void( my_typecheck_expr)(struct my_compiler* my_c,struct my_decl* my_d,struct my ((my_n)->my_t)=((my_v)->my_var_type); return; } - (my_v)=((my_find)((my_c),((my_n)->my_s),((unsigned char*)0UL),(0UL))); + (my_v)=((my_find)((my_c),((my_n)->my_s),((void *)0),(0UL))); if ((unsigned long)((my_v)&&((my_v)->my_func_defined))) { ((my_n)->my_t)=((my_v)->my_func_type); return; @@ -10254,6 +10312,9 @@ void( my_unify)(struct my_compiler* my_c,struct my_type* my_a,struct my_type* my if ((unsigned long)(((long)(my_a))==((long)(my_b)))) { return; } + if ((unsigned long)((my_a)&&((unsigned long)((my_b)&&((unsigned long)(((unsigned long)(((unsigned long)(((long)((my_a)->my_kind))==((long)(my_TY_NIL))))&&((unsigned long)(((long)((my_b)->my_kind))==((long)(my_TY_PTR))))))||((unsigned long)(((unsigned long)(((long)((my_a)->my_kind))==((long)(my_TY_PTR))))&&((unsigned long)(((long)((my_b)->my_kind))==((long)(my_TY_NIL)))))))))))) { + return; + } if ((unsigned long)(((unsigned long)((my_a)&&((unsigned long)(!(my_b)))))||((unsigned long)(((unsigned long)((my_b)&&((unsigned long)(!(my_a)))))||((unsigned long)(((long)((my_a)->my_kind))!=((long)((my_b)->my_kind)))))))) { (my_cdie)((my_c),((unsigned char *)"type error")); } diff --git a/cc1.om b/cc1.om @@ -57,21 +57,21 @@ func comp_setup(a: *alloc): *compiler { c.p = setup_parser(a); - c.filename = 0 as *byte; + c.filename = nil; c.lineno = 0; c.colno = 0; c.s = setup_assembler(a); - c.decls = 0 as *decl; + c.decls = nil; c.do_cout = 0; - c.cout = 0 as *file; + c.cout = nil; - c.start = 0 as *label; - c.kstart = 0 as *label; + c.start = nil; + c.kstart = nil; - c.used_top = 0 as *decl; + c.used_top = nil; return c; } @@ -169,13 +169,13 @@ func compile(c: *compiler, p: *node) { } // Check usage - d = find(c, "_start", 0 as *byte, 0); + d = find(c, "_start", nil, 0); if (d && d.func_defined) { c.start = d.func_label; mark_func_used(c, d); } - d = find(c, "_kstart", 0 as *byte, 0); + d = find(c, "_kstart", nil, 0); if (d && d.func_defined) { c.kstart = d.func_label; mark_func_used(c, d); @@ -233,7 +233,7 @@ func mark_expr_used(c: *compiler, d: *decl, n: *node) { } return; } else if kind == N_IDENT { - v = find(c, n.s, 0 as *byte, 0); + v = find(c, n.s, nil, 0); if v && v.enum_defined { return; } @@ -243,7 +243,7 @@ func mark_expr_used(c: *compiler, d: *decl, n: *node) { return; } - v = find(c, n.s, 0 as *byte, 0); + v = find(c, n.s, nil, 0); if v && v.func_defined { mark_func_used(c, v); return; @@ -352,7 +352,7 @@ func defextern(c: *compiler, n: *node): *decl { t = prototype(c, n.b); - d = find(c, name, 0 as *byte, 1); + d = find(c, name, nil, 1); if (d.func_defined) { cdie(c, "duplicate function"); @@ -425,7 +425,7 @@ func defstruct(c: *compiler, n: *node) { cdie(c, "reserved word"); } - d = find(c, name, 0 as *byte, 1); + d = find(c, name, nil, 1); if (d.struct_defined) { cdie(c, "duplicate struct"); @@ -449,7 +449,7 @@ func defunion(c: *compiler, n: *node) { cdie(c, "reserved word"); } - d = find(c, name, 0 as *byte, 1); + d = find(c, name, nil, 1); if (d.struct_defined) { cdie(c, "duplicate struct"); @@ -476,7 +476,7 @@ func defenum(c: *compiler, n: *node) { c.colno = n.a.colno; name = n.a.a.s; - d = find(c, name, 0 as *byte, 1); + d = find(c, name, nil, 1); if (d.enum_defined) { cdie(c, "duplicate enum"); @@ -622,7 +622,7 @@ func compile_func(c: *compiler, d: *decl) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); emit_preamble(c.s, d.func_preamble, pragma); - compile_stmt(c, d, d.func_def.b, 0 as *label, 0 as *label); + compile_stmt(c, d, d.func_def.b, nil, nil); emit_num(c.s, 0); if (pragma) { @@ -691,7 +691,7 @@ func typecheck_expr(c: *compiler, d: *decl, n: *node, rhs: int) { } if (n.a.kind == N_IDENT) { - v = find(c, n.a.s, 0 as *byte, 0); + v = find(c, n.a.s, nil, 0); if (v && v.enum_defined) { cdie(c, "type error"); } @@ -700,13 +700,13 @@ func typecheck_expr(c: *compiler, d: *decl, n: *node, rhs: int) { if (v && v.var_defined) { n.a.t = v.var_type; } else if !strcmp(n.a.s, "_include") { - v = find(c, n.a.s, 0 as *byte, 0); + v = find(c, n.a.s, nil, 0); if (!v || !v.func_defined) { cdie(c, "no such function"); } n.a.t = v.func_type; } else { - v = find(c, n.a.s, 0 as *byte, 0); + v = find(c, n.a.s, nil, 0); if (!v || !v.func_defined) { cdie(c, "no such function"); } @@ -723,7 +723,7 @@ func typecheck_expr(c: *compiler, d: *decl, n: *node, rhs: int) { if (n.b) { unify(c, n.a.t.arg, n.b.t); } else { - unify(c, n.a.t.arg, 0 as *type); + unify(c, n.a.t.arg, nil); } n.t = n.a.t.val; @@ -750,7 +750,7 @@ func typecheck_expr(c: *compiler, d: *decl, n: *node, rhs: int) { n.t = v.member_type; } else if (kind == N_IDENT) { - v = find(c, n.s, 0 as *byte, 0); + v = find(c, n.s, nil, 0); if (v && v.enum_defined) { n.t = mktype0(c, TY_INT); return; @@ -762,7 +762,7 @@ func typecheck_expr(c: *compiler, d: *decl, n: *node, rhs: int) { return; } - v = find(c, n.s, 0 as *byte, 0); + v = find(c, n.s, nil, 0); if (v && v.func_defined) { n.t = v.func_type; return; @@ -1358,7 +1358,7 @@ func compile_expr(c: *compiler, d: *decl, n: *node, rhs: int) { } if (n.a.kind == N_IDENT) { - v = find(c, n.a.s, 0 as *byte, 0); + v = find(c, n.a.s, nil, 0); if (v && v.enum_defined) { cdie(c, "type error"); } @@ -1369,10 +1369,10 @@ func compile_expr(c: *compiler, d: *decl, n: *node, rhs: int) { emit_load(c.s, n.a.t); emit_call(c.s, count_args(c, n.a.t.arg)); } else if !strcmp(n.a.s, "_include") { - v = find(c, n.a.s, 0 as *byte, 0); + v = find(c, n.a.s, nil, 0); compile_include(c, n); } else { - v = find(c, n.a.s, 0 as *byte, 0); + v = find(c, n.a.s, nil, 0); emit_lcall(c.s, v.func_label, count_args(c, n.a.t.arg)); } } else { @@ -1383,7 +1383,7 @@ func compile_expr(c: *compiler, d: *decl, n: *node, rhs: int) { if (n.b) { unify(c, n.a.t.arg, n.b.t); } else { - unify(c, n.a.t.arg, 0 as *type); + unify(c, n.a.t.arg, nil); } } else if (kind == N_DOT) { compile_expr(c, d, n.a, 0); @@ -1402,7 +1402,7 @@ func compile_expr(c: *compiler, d: *decl, n: *node, rhs: int) { emit_load(c.s, n.t); } } else if (kind == N_IDENT) { - v = find(c, n.s, 0 as *byte, 0); + v = find(c, n.s, nil, 0); if (v && v.enum_defined) { emit_num(c.s, v.enum_value); return; @@ -1417,7 +1417,7 @@ func compile_expr(c: *compiler, d: *decl, n: *node, rhs: int) { return; } - v = find(c, n.s, 0 as *byte, 0); + v = find(c, n.s, nil, 0); if (v && v.func_defined) { emit_ptr(c.s, v.func_label); return; @@ -1671,7 +1671,7 @@ func compile_stmt(c: *compiler, d: *decl, n: *node, top: *label, out: *label) { kind = n.kind; if (kind == N_CONDLIST) { ifout = mklabel(c.s); - no = 0 as *label; + no = nil; loop { if (no) { fixup_label(c.s, no); @@ -1819,7 +1819,7 @@ func emit_ssr(c: *compiler) { as_opr(c.s, OP_PUSHR, R_RAX); - d = find(c, "_ssr", 0 as *byte, 1); + d = find(c, "_ssr", nil, 1); if (d.func_defined && d.func_label.fixed) { as_jmp(c.s, OP_CALL, d.func_label); } @@ -1936,7 +1936,7 @@ func emit_isr(c: *compiler) { as_modrm(c.s, OP_LOAD, R_RAX, R_RBP, 0, 0, 176 + 48); as_modrm(c.s, OP_STORE, R_RAX, R_RBP, 0, 0, 152); - d = find(c, "_isr", 0 as *byte, 1); + d = find(c, "_isr", nil, 1); if (d.func_defined && d.func_label.fixed) { as_jmp(c.s, OP_CALL, d.func_label); } @@ -1983,7 +1983,7 @@ func emit_isr(c: *compiler) { func emit_builtin(c: *compiler) { var d: *decl; - d = find(c, "syscall", 0 as *byte, 1); + d = find(c, "syscall", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -1992,14 +1992,14 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "_restorer", 0 as *byte, 1); + d = find(c, "_restorer", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); emit_restorer(c.s); } - d = find(c, "_include", 0 as *byte, 1); + d = find(c, "_include", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2009,7 +2009,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "ud2", 0 as *byte, 1); + d = find(c, "ud2", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2019,7 +2019,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "cpuid", 0 as *byte, 1); + d = find(c, "cpuid", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2045,7 +2045,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "inb", 0 as *byte, 1); + d = find(c, "inb", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2056,7 +2056,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "outb", 0 as *byte, 1); + d = find(c, "outb", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2068,7 +2068,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "inw", 0 as *byte, 1); + d = find(c, "inw", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2080,7 +2080,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "outw", 0 as *byte, 1); + d = find(c, "outw", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2093,7 +2093,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "ind", 0 as *byte, 1); + d = find(c, "ind", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2104,7 +2104,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "outd", 0 as *byte, 1); + d = find(c, "outd", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2116,7 +2116,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "rdmsr", 0 as *byte, 1); + d = find(c, "rdmsr", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2130,7 +2130,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "wrmsr", 0 as *byte, 1); + d = find(c, "wrmsr", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2145,7 +2145,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "rdcr0", 0 as *byte, 1); + d = find(c, "rdcr0", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2155,7 +2155,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "wrcr0", 0 as *byte, 1); + d = find(c, "wrcr0", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2166,7 +2166,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "rdcr2", 0 as *byte, 1); + d = find(c, "rdcr2", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2176,7 +2176,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "wrcr2", 0 as *byte, 1); + d = find(c, "wrcr2", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2187,7 +2187,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "rdcr3", 0 as *byte, 1); + d = find(c, "rdcr3", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2197,7 +2197,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "wrcr3", 0 as *byte, 1); + d = find(c, "wrcr3", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2208,7 +2208,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "rdcr4", 0 as *byte, 1); + d = find(c, "rdcr4", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2218,7 +2218,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "wrcr4", 0 as *byte, 1); + d = find(c, "wrcr4", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2229,7 +2229,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "lgdt", 0 as *byte, 1); + d = find(c, "lgdt", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2246,7 +2246,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "lidt", 0 as *byte, 1); + d = find(c, "lidt", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2263,7 +2263,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "lldt", 0 as *byte, 1); + d = find(c, "lldt", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2274,7 +2274,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "ltr", 0 as *byte, 1); + d = find(c, "ltr", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2285,7 +2285,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "lseg", 0 as *byte, 1); + d = find(c, "lseg", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2321,7 +2321,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "hlt", 0 as *byte, 1); + d = find(c, "hlt", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2331,7 +2331,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "cli", 0 as *byte, 1); + d = find(c, "cli", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2341,7 +2341,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "sti", 0 as *byte, 1); + d = find(c, "sti", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2351,7 +2351,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "rdflags", 0 as *byte, 1); + d = find(c, "rdflags", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2360,7 +2360,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "wrflags", 0 as *byte, 1); + d = find(c, "wrflags", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2372,7 +2372,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "wbinvld", 0 as *byte, 1); + d = find(c, "wbinvld", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2383,7 +2383,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "invlpg", 0 as *byte, 1); + d = find(c, "invlpg", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2394,21 +2394,21 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "_ssr0", 0 as *byte, 1); + d = find(c, "_ssr0", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); emit_ssr(c); } - d = find(c, "_isr0", 0 as *byte, 1); + d = find(c, "_isr0", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); emit_isr(c); } - d = find(c, "_rgs", 0 as *byte, 1); + d = find(c, "_rgs", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2420,7 +2420,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "_r32", 0 as *byte, 1); + d = find(c, "_r32", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2433,7 +2433,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "_w32", 0 as *byte, 1); + d = find(c, "_w32", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2447,7 +2447,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "_r16", 0 as *byte, 1); + d = find(c, "_r16", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2461,7 +2461,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "_w16", 0 as *byte, 1); + d = find(c, "_w16", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2475,7 +2475,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "_rdrand", 0 as *byte, 1); + d = find(c, "_rdrand", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2485,7 +2485,7 @@ func emit_builtin(c: *compiler) { emit_ret(c.s); } - d = find(c, "taskswitch", 0 as *byte, 1); + d = find(c, "taskswitch", nil, 1); if (d.func_defined && !d.func_label.fixed) { fixup_label(c.s, d.func_label); add_symbol(c.s, d.name, d.func_label); @@ -2649,7 +2649,7 @@ func main(argc: int, argv: **byte, envp: **byte) { } tmp = alloc(&a, sizeof(*tmp)) as *name_node; - tmp.next = 0 as *name_node; + tmp.next = nil; tmp.name = argv[i]; *link = tmp; link = &tmp.next; diff --git a/cout.om b/cout.om @@ -147,9 +147,9 @@ func ctranslate_type2(c: *compiler, ty: *type, name: *byte, args: *node) { if arg { loop { if args { - ctranslate_type(c, arg.val, args.a.a.s, 0, 0 as *node); + ctranslate_type(c, arg.val, args.a.a.s, 0, nil); } else { - ctranslate_type(c, arg.val, "", 0, 0 as *node); + ctranslate_type(c, arg.val, "", 0, nil); } arg = arg.arg; if arg { @@ -241,7 +241,7 @@ func ctranslate_struct(c: *compiler, d: *decl) { v = find(c, d.name, n.a.a.s, 0); fputs(c.cout, "\t"); - ctranslate_type(c, v.member_type, n.a.a.s, 0, 0 as *node); + ctranslate_type(c, v.member_type, n.a.a.s, 0, nil); fputs(c.cout, ";\n"); n = n.b; @@ -278,7 +278,7 @@ func ctranslate_vars(c: *compiler, n: *node) { ctranslate_vars(c, n.a); } else if kind == N_VARDECL { fputs(c.cout, "\t"); - ctranslate_type(c, n.t, n.a.s, 0, 0 as *node); + ctranslate_type(c, n.t, n.a.s, 0, nil); fputs(c.cout, " = "); ctranslate_zero(c, n.t); fputs(c.cout, ";\n"); @@ -433,19 +433,19 @@ func ctranslate_expr(c: *compiler, n: *node) { ctranslate_expr(c, n.a); } else if n.kind == N_NEG { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(-(unsigned long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))"); } else if n.kind == N_NOT { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(~(unsigned long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))"); } else if n.kind == N_ADD { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((unsigned long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))+((unsigned long)("); @@ -453,7 +453,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_SUB { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((unsigned long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))-((unsigned long)("); @@ -461,7 +461,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_MUL { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))*((long)("); @@ -469,7 +469,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_DIV { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))/((long)("); @@ -477,7 +477,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_MOD { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))%((long)("); @@ -485,7 +485,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_LSH { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((unsigned long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))<<((unsigned long)("); @@ -493,7 +493,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_RSH { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((unsigned long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))>>((unsigned long)("); @@ -501,7 +501,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_AND { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((unsigned long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))&((unsigned long)("); @@ -509,7 +509,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_OR { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((unsigned long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))|((unsigned long)("); @@ -517,7 +517,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_XOR { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")(((unsigned long)("); ctranslate_expr(c, n.a); fputs(c.cout, "))^((unsigned long)("); @@ -525,7 +525,7 @@ func ctranslate_expr(c: *compiler, n: *node) { fputs(c.cout, ")))"); } else if n.kind == N_CAST { fputs(c.cout, "("); - ctranslate_type(c, n.t, "", 0, 0 as *node); + ctranslate_type(c, n.t, "", 0, nil); fputs(c.cout, ")"); ctranslate_expr(c, n.a); } else { diff --git a/decl.om b/decl.om @@ -44,7 +44,7 @@ func find(c: *compiler, name: *byte, member_name: *byte, make: int): *decl { var link: **decl; var dir: int; - p = 0 as *decl; + p = nil; link = &c.decls; loop { d = *link; @@ -79,7 +79,7 @@ func find(c: *compiler, name: *byte, member_name: *byte, make: int): *decl { if (!make) { - return 0 as *decl; + return nil; } d = alloc(c.a, sizeof(*d)) as *decl; @@ -88,35 +88,35 @@ func find(c: *compiler, name: *byte, member_name: *byte, make: int): *decl { d.member_name = member_name; d.p = p; - d.l = 0 as *decl; - d.r = 0 as *decl; + d.l = nil; + d.r = nil; - d.used_next = 0 as *decl; + d.used_next = nil; d.func_defined = 0; - d.func_type = 0 as *type; + d.func_type = nil; d.func_label = mklabel(c.s); - d.func_def = 0 as *node; + d.func_def = nil; d.func_used = 0; d.struct_defined = 0; d.struct_size = 0; d.struct_layout_done = 0; - d.struct_def = 0 as *node; + d.struct_def = nil; d.member_defined = 0; - d.member_type = 0 as *type; + d.member_type = nil; d.member_offset = 0; - d.member_def = 0 as *node; + d.member_def = nil; d.enum_defined = 0; d.enum_value = 0; - d.enum_def = 0 as *node; + d.enum_def = nil; d.var_defined = 0; - d.var_type = 0 as *type; + d.var_type = nil; d.var_offset = 0; - d.var_def = 0 as *node; + d.var_def = nil; d.goto_defined = 0; d.goto_label = mklabel(c.s); @@ -132,7 +132,7 @@ func first_decl(c: *compiler): *decl { d = c.decls; if (!d) { - return 0 as *decl; + return nil; } loop { @@ -146,7 +146,7 @@ func first_decl(c: *compiler): *decl { func next_decl(c: *compiler, d: *decl): *decl { if (!d) { - return 0 as *decl; + return nil; } if (d.r) { @@ -163,7 +163,7 @@ func next_decl(c: *compiler, d: *decl): *decl { loop { if (!d.p) { - return 0 as *decl; + return nil; } if (d.p.l == d) { diff --git a/genlex.om b/genlex.om @@ -44,15 +44,15 @@ func setup(c: *compiler): void { c.lineno = 1; c.colno = 1; c.tt = 0; - c.n = 0 as *nfa; + c.n = nil; c.tmax = 256; c.tlen = 0; c.buf = alloc(&c.a, c.tmax); - c.tags = 0 as *tag; + c.tags = nil; c.ntags = 0; c.nnfa = 0; c.ndfa = 0; - c.d = 0 as *dfa; + c.d = nil; feed(c); } @@ -82,7 +82,7 @@ enum { } func feed(c: *compiler): void { - c.n = 0 as *nfa; + c.n = nil; c.tlen = 0; loop { @@ -388,7 +388,7 @@ func feed_charset(c: *compiler): void { func parse_ident(c: *compiler): *tag { var t: *tag; if (c.tt != T_IDENT) { - return 0 as *tag; + return nil; } t = find_tag(c, c.buf); feed(c); @@ -432,7 +432,7 @@ func find_tag(c: *compiler, s: *byte): *tag { link = &t.next; } t = alloc(&c.a, sizeof(*t)) as *tag; - t.next = 0 as *tag; + t.next = nil; t.s = intern(c); t.id = c.ntags; c.ntags = c.ntags + 1; @@ -458,8 +458,8 @@ func nfa_empty(c: *compiler): *nfa { n.left = -1; n.right = -1; n.live = 0; - n.a = 0 as *nfa; - n.b = 0 as *nfa; + n.a = nil; + n.b = nil; n.end = n; c.nnfa = c.nnfa + 1; return n; @@ -517,7 +517,7 @@ func nfa_star(c: *compiler, a: *nfa): *nfa { func parse_literal(c: *compiler): *nfa { var n: *nfa; if (c.tt != T_LITERAL) { - return 0 as *nfa; + return nil; } n = c.n; feed(c); @@ -527,7 +527,7 @@ func parse_literal(c: *compiler): *nfa { func parse_charset(c: *compiler): *nfa { var n: *nfa; if (c.tt != T_CHARSET) { - return 0 as *nfa; + return nil; } n = c.n; feed(c); @@ -537,7 +537,7 @@ func parse_charset(c: *compiler): *nfa { func parse_dot(c: *compiler): *nfa { var n: *nfa; if (c.tt != T_DOT) { - return 0 as *nfa; + return nil; } feed(c); n = nfa_empty(c); @@ -581,7 +581,7 @@ func parse_primary(c: *compiler): *nfa { return n; } - return 0 as *nfa; + return nil; } // post := primary @@ -593,7 +593,7 @@ func parse_post(c: *compiler): *nfa { n = parse_primary(c); if (!n) { - return 0 as *nfa; + return nil; } loop { @@ -620,7 +620,7 @@ func parse_concat(c: *compiler): *nfa { n = parse_post(c); if (!n) { - return 0 as *nfa; + return nil; } loop { @@ -668,7 +668,7 @@ func parse_decl(c: *compiler): *nfa { t = parse_ident(c); if (!t) { - return 0 as *nfa; + return nil; } if (c.tt != T_EQUALS) { @@ -695,7 +695,7 @@ func parse_program(c: *compiler): *nfa { var n: *nfa; var p: *nfa; - p = 0 as *nfa; + p = nil; loop { n = parse_decl(c); if (!n) { @@ -733,7 +733,7 @@ func alloc_nlist(c: *compiler, l: *nlist, cap: int): void { l.cap = cap; l.live = alloc(&c.a, sizeof(*l.live) * cap) as **nfa; l.fill = 0; - l.tag = 0 as *tag; + l.tag = nil; } func activate(l: *nlist, n: *nfa): void { @@ -882,7 +882,7 @@ func alloc_link(c: *compiler): **dfa { if (i == 256) { break; } - link[i] = 0 as *dfa; + link[i] = nil; i = i + 1; } return link; @@ -913,7 +913,7 @@ func nlist2dfa(c: *compiler, l: *nlist): *dfa { var j: int; if (l.fill == 0 && !l.tag) { - return 0 as *dfa; + return nil; } link = &c.d; @@ -938,8 +938,8 @@ func nlist2dfa(c: *compiler, l: *nlist): *dfa { d.id = c.ndfa; d.link = alloc_link(c); nlist_copy(c, &d.key, l); - d.l = 0 as *dfa; - d.r = 0 as *dfa; + d.l = nil; + d.r = nil; d.seen = 0; c.ndfa = c.ndfa + 1; @@ -986,7 +986,7 @@ func deactivate(l: *nlist): void { loop { if (i >= l.fill) { l.fill = 0; - l.tag = 0 as *tag; + l.tag = nil; break; } l.live[i].live = 0; diff --git a/kernel.om b/kernel.om @@ -536,7 +536,7 @@ func scan_pci(base: *byte, visit: func(dev: *pcidev)) { continue; } - dev.msi = 0 as *byte; + dev.msi = nil; if dev.type == 0 { cap = base[i * 4096 + 0x34] as int; @@ -2107,7 +2107,7 @@ func alloc_tcp(): *tcp_state { loop { if i == global.tcp_count { wrflags(flags); - return 0 as *tcp_state; + return nil; } if !global.tcp[i] { @@ -2137,7 +2137,7 @@ func tcp_free(tcb: *tcp_state) { break; } if global.tcp[i] == tcb { - global.tcp[i] = 0 as *tcp_state; + global.tcp[i] = nil; break; } i = i + 1; @@ -2242,7 +2242,7 @@ func send_rst(pkt: *rxinfo) { tx.tcp_src = pkt.tcp_dest; tx.tcp_dest = pkt.tcp_src; tx.tcp_win = 0; - tx.tcp_opt = 0 as *byte; + tx.tcp_opt = nil; tx.tcp_opt_len = 0; tx.len = 0; @@ -2273,7 +2273,7 @@ func send_ack(tcb: *tcp_state) { tx.tcp_src = tcb.sock_port; tx.tcp_dest = tcb.peer_port; tx.tcp_win = 4096 - tcb.recv_len; - tx.tcp_opt = 0 as *byte; + tx.tcp_opt = nil; tx.tcp_opt_len = 0; tx.len = 0; @@ -2300,7 +2300,7 @@ func send_psh(tcb: *tcp_state) { tx.tcp_src = tcb.sock_port; tx.tcp_dest = tcb.peer_port; tx.tcp_win = 4096 - tcb.recv_len; - tx.tcp_opt = 0 as *byte; + tx.tcp_opt = nil; tx.tcp_opt_len = 0; len = tcb.send_len; @@ -2405,7 +2405,7 @@ func find_tcb(pkt: *rxinfo): *tcp_state { i = i + 1; } - return 0 as *tcp_state; + return nil; } func handle_syn(tcb: *tcp_state, pkt: *rxinfo) { @@ -2443,7 +2443,7 @@ func handle_syn(tcb: *tcp_state, pkt: *rxinfo) { tx.tcp_src = c.sock_port; tx.tcp_dest = c.peer_port; tx.tcp_win = 4096 - c.recv_len; - tx.tcp_opt = 0 as *byte; + tx.tcp_opt = nil; tx.tcp_opt_len = 0; tx.len = 0; @@ -2983,7 +2983,7 @@ func init_ahci_port(ahci: *byte, i: int) { var ahci_port: *ahci_port; ahci_port = ptov(alloc_page()) as *ahci_port; - ahci_port.next = 0 as *ahci_port; + ahci_port.next = nil; ahci_port.ahci = ahci; ahci_port.port = port; @@ -3172,7 +3172,7 @@ func free_task(t: *task) { } if t.files[i] { vclose(t.files[i]); - t.files[i] = 0 as *vfile; + t.files[i] = nil; } i = i + 1; } @@ -3577,8 +3577,8 @@ func mkvnode(): *vnode { v.nlink = 0; v.ino = global.next_ino; v.size = 0; - v.pages = 0 as *vpage; - v.ents = 0 as *vent; + v.pages = nil; + v.ents = nil; return v; } @@ -3597,7 +3597,7 @@ func mkfile(v: *vnode, mode: int): *vfile { func mkroot(): *vfile { var f: *vfile; - f = mkfile(0 as *vnode, S_IFDIR); + f = mkfile(nil, S_IFDIR); f.node.nlink = 1; vlink(f, ".", 1, f); return f; @@ -3643,7 +3643,7 @@ func vlookup(d: *vfile, name: *byte, nlen: int, flags: int, mode: int): *vfile { var e: *vent; if !d { - return 0 as *vfile; + return nil; } e = efind(d, name, nlen); @@ -3654,15 +3654,15 @@ func vlookup(d: *vfile, name: *byte, nlen: int, flags: int, mode: int): *vfile { f = mkfile(e.node, S_IFREG); } } else { - f = 0 as *vfile; + f = nil; } if flags & O_CREAT && !f { if flags & O_DIRECTORY { - f = mkfile(0 as *vnode, S_IFDIR); + f = mkfile(nil, S_IFDIR); vlink(f, ".", 1, f); } else { - f = mkfile(0 as *vnode, S_IFREG); + f = mkfile(nil, S_IFREG); } vlink(d, name, nlen, f); } @@ -3674,12 +3674,12 @@ func vlookup(d: *vfile, name: *byte, nlen: int, flags: int, mode: int): *vfile { if flags & O_DIRECTORY { if f.mode != S_IFDIR { vclose(f); - return 0 as *vfile; + return nil; } } else { if f.mode != S_IFREG { vclose(f); - return 0 as *vfile; + return nil; } } @@ -3762,13 +3762,13 @@ func vrelease_page(p: *vpage) { q = p.parent; if q { if q.left == p { - q.left = 0 as *vpage; + q.left = nil; } else { - q.right = 0 as *vpage; + q.right = nil; } } - p.parent = 0 as *vpage; + p.parent = nil; free(p.page); free(p as *byte); @@ -3854,9 +3854,9 @@ func vwrite_page(v: *vnode, o: int, b: *byte, n: int): int { p = v.pages; if !p { q = alloc() as *vpage; - q.parent = 0 as *vpage; - q.left = 0 as *vpage; - q.right = 0 as *vpage; + q.parent = nil; + q.left = nil; + q.right = nil; q.offset = key; q.page = alloc(); bzero(q.page, 4096); @@ -3869,8 +3869,8 @@ func vwrite_page(v: *vnode, o: int, b: *byte, n: int): int { if !p.left { q = alloc() as *vpage; q.parent = p; - q.left = 0 as *vpage; - q.right = 0 as *vpage; + q.left = nil; + q.right = nil; q.offset = key; q.page = alloc(); bzero(q.page, 4096); @@ -3883,8 +3883,8 @@ func vwrite_page(v: *vnode, o: int, b: *byte, n: int): int { if ! p.right { q = alloc() as *vpage; q.parent = p; - q.left = 0 as *vpage; - q.right = 0 as *vpage; + q.left = nil; + q.right = nil; q.offset = key; q.page = alloc(); bzero(q.page, 4096); @@ -4285,7 +4285,7 @@ func map_user(vaddr: int): *byte { var i: int; if (vaddr >> 47) != 0 || (vaddr & 4095) != 0 { - return 0 as *byte; + return nil; } global = g(); @@ -4321,7 +4321,7 @@ func map_user(vaddr: int): *byte { return ptov(pt[i] & -4096); } - return 0 as *byte; + return nil; } func vload(f: *vfile, offset: int, vaddr: int, filesz: int, memsz: int): int { @@ -4491,7 +4491,7 @@ func vexec(prog: *byte, argv: **byte, envp: **byte): int { envs = alloc() as **byte; nargs = 0; nenv = 0; - f = 0 as *vfile; + f = nil; // Copy args if argv { @@ -4560,7 +4560,7 @@ func vexec(prog: *byte, argv: **byte, envp: **byte): int { args[1] = strdup(prog); prog = args[0]; vclose(f); - f = 0 as *vfile; + f = nil; continue; } @@ -4782,7 +4782,7 @@ func task_init(t: *task) { // open("/dev/null") => 0 // open("/dev/tty") => 1 // dup(1) => 2 - if vexec("/init", 0 as **byte, 0 as **byte) != 0 { + if vexec("/init", nil, nil) != 0 { kdie("failed to exec init"); } } @@ -4832,8 +4832,8 @@ func _kstart(mb: int) { vclear(&global.vga); kputs("Starting up\n"); - global.fr = 0 as *free_range; - global.fp = 0 as *free_page; + global.fr = nil; + global.fp = nil; global.kpt = rdcr3(); mbinfo = ptov(mb); @@ -5021,7 +5021,7 @@ func _kstart(mb: int) { parse_initramfs(); - spawn(task_init, "init", 0 as *void); + spawn(task_init, "init", nil); // Wait for interrupts kputs("zzz\n"); diff --git a/node.om b/node.om @@ -79,22 +79,22 @@ func mknode(c: *parser, kind: int, a: *node, b: *node): *node { ret.kind = kind; ret.a = a; ret.b = b; - ret.filename = 0 as *byte; + ret.filename = nil; ret.lineno = 0; ret.colno = 0; ret.n = 0; - ret.s = 0 as *byte; - ret.t = 0 as *type; + ret.s = nil; + ret.t = nil; fillpos(c, ret); return ret; } func mknode0(c: *parser, kind: int): *node { - return mknode(c, kind, 0 as *node, 0 as *node); + return mknode(c, kind, nil, nil); } func mknode1(c: *parser, kind: int, a: *node): *node { - return mknode(c, kind, a, 0 as *node); + return mknode(c, kind, a, nil); } func concat_program(a: *node, b: *node): *node { diff --git a/parse2.om b/parse2.om @@ -56,7 +56,7 @@ func reconstruct(c: *parser, pn: *peg_node): *node { var p: *node; assert(pn.tag == P_grammar, "grammar"); - ret = 0 as *node; + ret = nil; link = &ret; pn = pn.child; @@ -119,7 +119,7 @@ func reconstruct_enum_item(c: *parser, pn: *peg_node): *node { assert(pn.tag == P_enum_item, "enum_item"); a = reconstruct_ident(c, pn.child); - b = 0 as *node; + b = nil; if pn.child.next { b = reconstruct_expr(c, pn.child.next); @@ -138,7 +138,7 @@ func reconstruct_enum(c: *parser, pn: *peg_node): *node { var n: *node; assert(pn.tag == P_enum_decl, "enum_decl"); - n = mknode(c, N_ENUM, 0 as *node, 0 as *node); + n = mknode(c, N_ENUM, nil, nil); copypos(n, pn); pn = pn.child.next; @@ -181,7 +181,7 @@ func reconstruct_func_type(c: *parser, pn: *peg_node): *node { var link: **node; assert(pn.tag == P_func_type, "func_type"); - n = mknode(c, N_FUNCTYPE, 0 as *node, 0 as *node); + n = mknode(c, N_FUNCTYPE, nil, nil); copypos(n, pn); pn = pn.child; @@ -254,7 +254,7 @@ func reconstruct_member_list(c: *parser, pn: *peg_node): *node { var ret: *node; var link: **node; - ret = 0 as *node; + ret = nil; link = &ret; loop { if !pn { @@ -533,7 +533,7 @@ func reconstruct_args(c: *parser, pn: *peg_node): *node { var a: *node; var n: *node; - ret = 0 as *node; + ret = nil; link = &ret; loop { if !pn { @@ -777,7 +777,7 @@ func reconstruct_if(c: *parser, pn: *peg_node): *node { *link = n; link = &n.b; } else if pn.tag == P_else_stmt { - a = 0 as *node; + a = nil; b = reconstruct_compound(c, pn.child.next); n = mknode1(c, N_CONDLIST, mknode(c, N_COND, a, b)); copypos(n, pn); @@ -825,7 +825,7 @@ func reconstruct_return(c: *parser, pn: *peg_node): *node { var a: *node; var n: *node; assert(pn.tag == P_return_stmt, "return_stmt"); - a = 0 as *node; + a = nil; if pn.child.next { a = reconstruct_expr(c, pn.child.next); } @@ -885,7 +885,7 @@ func reconstruct_expr_stmt(c: *parser, pn: *peg_node): *node { func reconstruct_empty(c: *parser, pn: *peg_node): *node { assert(pn.tag == P_empty_stmt, "empty_stmt"); - return 0 as *node; + return nil; } func reconstruct_compound(c: *parser, pn: *peg_node): *node { @@ -895,7 +895,7 @@ func reconstruct_compound(c: *parser, pn: *peg_node): *node { var link: **node; assert(pn.tag == P_compound_stmt, "compound_stmt"); pn = pn.child; - ret = 0 as *node; + ret = nil; link = &ret; loop { if ! pn { diff --git a/peglib.om b/peglib.om @@ -92,7 +92,7 @@ func fail(c: *peg) { c.fail_tag = c.tag; c.fail_line = c.line; c.fail_col = c.col; - c.fail_literal = 0 as *byte; + c.fail_literal = nil; } c.sp = c.sp - 1; @@ -236,7 +236,7 @@ func construct(c: *peg, sp: int): *peg_node { var n: *peg_node; var link: **peg_node; - c.nstack[0] = 0 as *peg_node; + c.nstack[0] = nil; i = 0; loop { @@ -248,8 +248,8 @@ func construct(c: *peg, sp: int): *peg_node { n = alloc(c.a, sizeof(*n)) as *peg_node; n.tag = c.out[i].tag; - n.next = 0 as *peg_node; - n.child = 0 as *peg_node; + n.next = nil; + n.child = nil; n.str = &c.src[c.out[i].start]; n.len = c.out[i].end - c.out[i].start; n.filename = c.filename; @@ -281,7 +281,7 @@ func construct(c: *peg, sp: int): *peg_node { die("node overflow"); } } else { - n = 0 as *peg_node; + n = nil; } c.nstack[c.np] = n; @@ -315,7 +315,7 @@ func peg_new(filename: *byte, src: *byte, len: int, a: *alloc, grammar: (func(c: c.fail_tag = 0; c.fail_line = 0; c.fail_col = 0; - c.fail_literal = 0 as *byte; + c.fail_literal = nil; c.limit = 1024; c.stack = alloc(a, c.limit * sizeof(*c.stack)) as *peg_frame; @@ -323,7 +323,7 @@ func peg_new(filename: *byte, src: *byte, len: int, a: *alloc, grammar: (func(c: c.depth = 0; c.op = 0; - c.out = 0 as *peg_op; + c.out = nil; c.cap = 0; c.ncap = 1024; @@ -369,7 +369,7 @@ func peg_reset(c: *peg, filename: *byte, src: *byte, len: int) { c.fail_tag = 0; c.fail_line = 0; c.fail_col = 0; - c.fail_literal = 0 as *byte; + c.fail_literal = nil; c.depth = 0; c.sp = 0; c.op = 0; diff --git a/sh.om b/sh.om @@ -286,7 +286,7 @@ func parse_command(s: *shell): *cmd { c = parse_and_or(s); if !c { - return 0 as *cmd; + return nil; } if s.tt != T_LF { @@ -306,12 +306,12 @@ func parse_and_or(s: *shell): *cmd { var p: *cmd; var t: *cmd; - c = 0 as *cmd; + c = nil; link = &c; c = parse_pipeline(s); if !c { - return 0 as *cmd; + return nil; } loop { @@ -355,7 +355,7 @@ func parse_pipeline(s: *shell): *cmd { var p: *cmd; var t: *cmd; - c = 0 as *cmd; + c = nil; link = &c; if s.tt == T_NOT { @@ -374,7 +374,7 @@ func parse_pipeline(s: *shell): *cmd { } else { c = parse_compound(s); if !c { - return 0 as *cmd; + return nil; } } @@ -416,7 +416,7 @@ func parse_compound(s: *shell): *cmd { return c; } - return 0 as *cmd; + return nil; } // subshell = '(' command_list ')' @@ -426,11 +426,11 @@ func parse_subshell(s: *shell): *cmd { var link: **cmd; var t: *cmd; - body = 0 as *cmd; + body = nil; link = &body; if s.tt != T_LPAR { - return 0 as *cmd; + return nil; } feed(s); @@ -481,13 +481,13 @@ func parse_for(s: *shell): *cmd { var t: *cmd; var w: *byte; - arg = 0 as *cmd; + arg = nil; arg_link = &arg; - body = 0 as *cmd; + body = nil; body_link = &body; if !parse_keyword(s, "for") { - return 0 as *cmd; + return nil; } w = take(s); @@ -552,9 +552,9 @@ func parse_simple(s: *shell): *cmd { var t: *cmd; var w: *byte; - arg = 0 as *cmd; + arg = nil; arg_link = &arg; - redir = 0 as *cmd; + redir = nil; redir_link = &redir; w = take(s); @@ -569,7 +569,7 @@ func parse_simple(s: *shell): *cmd { *redir_link = t; redir_link = &t.next; } else { - return 0 as *cmd; + return nil; } } @@ -604,7 +604,7 @@ func parse_redir_list(s: *shell): *cmd { var t: *cmd; var link: **cmd; - c = 0 as *cmd; + c = nil; link = &c; loop { @@ -621,7 +621,7 @@ func take(s: *shell): *byte { var w: *byte; if s.tt != T_WORD { - return 0 as *byte; + return nil; } w = alloc(s.a, s.len + 1); @@ -660,7 +660,7 @@ func parse_redir(s: *shell): *cmd { return c; } - return 0 as *cmd; + return nil; } func execute_command(s: *shell, c: *cmd) { @@ -726,7 +726,7 @@ func main(argc: int, argv: **byte, envp: **byte) { s.script = ""; s.prog = ""; s.argc = 0; - s.argv = 0 as **byte; + s.argv = nil; } else if strcmp(argv[1], "--") == 0 { s.scriptfd = 0; s.script = ""; diff --git a/sshd.om b/sshd.om @@ -1463,7 +1463,7 @@ func ssh_spawn(ctx: *sshd_ctx, argv: **byte) { close(stdout_write); close(stderr_write); - exec(argv[0], argv, 0 as **byte); + exec(argv[0], argv, nil); exit(255); } @@ -1487,7 +1487,7 @@ func dopty(cr: *ssh_cr_pty, ctx: *sshd_ctx): int { func doshell(cr: *ssh_cr_shell, ctx: *sshd_ctx): int { var argv: _argv4; argv.arg0 = "/bin/sh"; - argv.arg1 = 0 as *byte; + argv.arg1 = nil; ssh_spawn(ctx, &argv.arg0); return 1; } @@ -1501,7 +1501,7 @@ func doexec(cr: *ssh_cr_exec, ctx: *sshd_ctx): int { argv.arg0 = "/bin/sh"; argv.arg1 = "-c"; argv.arg2 = cmd; - argv.arg3 = 0 as *byte; + argv.arg3 = nil; ssh_spawn(ctx, &argv.arg0); free(ctx.a, cmd); return 1; @@ -1937,7 +1937,7 @@ func signal(sig: int, handler: func()) { act.flags = 1 << 26; act.restorer = _restorer as int; act.mask = 0; - sigaction(sig, &act, 0 as *sigaction); + sigaction(sig, &act, nil); } func main(argc: int, argv: **byte, envp: **byte) { @@ -2001,12 +2001,12 @@ func main(argc: int, argv: **byte, envp: **byte) { loop { loop { - if wait(-1, 0 as *int, WNOHANG) <= 0 { + if wait(-1, nil, WNOHANG) <= 0 { break; } } - ctx.fd = accept(fd, 0 as *byte, 0 as *int); + ctx.fd = accept(fd, nil, nil); if ctx.fd == -EINTR { continue; } diff --git a/type.om b/type.om @@ -108,23 +108,23 @@ func mktype(c: *compiler, kind: int, a: *type, b: *type, st: *decl): *type { } func mktype_struct(c: *compiler, st: *decl): *type { - return mktype(c, TY_STRUCT, 0 as *type, 0 as *type, st); + return mktype(c, TY_STRUCT, nil, nil, st); } func mktype_union(c: *compiler, st: *decl): *type { - return mktype(c, TY_UNION, 0 as *type, 0 as *type, st); + return mktype(c, TY_UNION, nil, nil, st); } func mktype0(c: *compiler, kind: int): *type { - return mktype(c, kind, 0 as *type, 0 as *type, 0 as *decl); + return mktype(c, kind, nil, nil, nil); } func mktype1(c: *compiler, kind: int, a: *type): *type { - return mktype(c, kind, a, 0 as *type, 0 as *decl); + return mktype(c, kind, a, nil, nil); } func mktype2(c: *compiler, kind: int, a: *type, b: *type): *type { - return mktype(c, kind, a, b, 0 as *decl); + return mktype(c, kind, a, b, nil); } func type_isint(t: *type): int { @@ -142,7 +142,7 @@ func prototype(c: *compiler, n: *node): *type { var kind: int; if (!n) { - return 0 as *type; + return nil; } c.lineno = n.lineno; @@ -162,7 +162,7 @@ func prototype(c: *compiler, n: *node): *type { return mktype0(c, TY_BYTE); } - st = find(c, n.s, 0 as *byte, 0); + st = find(c, n.s, nil, 0); if (!st || !st.struct_defined) { cdie(c, "unknown struct"); }