code wiki / _hdl_build / nx_magicnum_preventer.nx

nx_magicnum_preventer.nx

buildroot/runtime/_hdl_build/nx_magicnum_preventer.nx

8306 B119 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind orphan librarytopic magicnum
docsdependenciesstructsconstsfunctions

dependencies 3 imports · 0 importers

nx_gate_gn.nx nx_gate_base.nx nx_syscalls.nx nx_magicnum_preventer.nx

imports: nx_gate_gn.nxnx_gate_base.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

none

consts

12const NX_MAGIC_1048576: i64 = 1048576
13const NX_MAGIC_65536: i64 = 65536
14const NX_MAGIC_1000000: i64 = 1000000
16const NX_MAGICNUM_BUDGET: i64 = 0 // zero-tolerance for NEW code (named, not a magic number)
17const NX_MAGICNUM_DET_MASK: i64 = 51 // the team's discovered detector (require>=2, exclude const-line+identifier)

functions

19func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw("
calls 1: gw
21func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
22func is_digit(c: u8) -> i64 { if c>=(48 as u8) { if c<=(57 as u8) { return 1 } } return 0 }
23func is_alnum_us(c: u8) -> i64
30func match_at(buf: *u8, i: i64, len: i64, lit: *u8) -> i64
35func trit_pass(t: i64, pv: i64) -> i64 { if t==0 { return 1 } if t==1 { if pv==1 { return 1 } return 0 } if pv==0 { return 1 } return 0 }
37func scan_count(buf: *u8, len: i64, mask: i64) -> i64
65func preventer_gate(buf: *u8, len: i64) -> i64
70func read_file(path: *u8, lenbox: *i64) -> i64
77func main() -> i64