io.is_a_directory, octal literal constants
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// needs to be compiled with -m -C="-lraylib"
|
||||
// needs to be compiled with -m -C "-lraylib"
|
||||
extern InitWindow
|
||||
extern SetTargetFPS
|
||||
extern WindowShouldClose
|
||||
@@ -45,6 +45,15 @@ func chip8_create[] : CHIP8
|
||||
|
||||
return c
|
||||
|
||||
func chip8_free[c: CHIP8] : void
|
||||
mem.free(c->memory)
|
||||
array.free(c->stack)
|
||||
mem.free(c->reg)
|
||||
array.free(c->keyboard)
|
||||
mem.free(c->display)
|
||||
array.free(c->keyboard_map)
|
||||
mem.free(c)
|
||||
|
||||
func chip8_disassemble[c: CHIP8, ins_count: i64] : void
|
||||
for i in 0..ins_count
|
||||
io.printf("0x%x: ", c->pc)
|
||||
@@ -264,15 +273,6 @@ func chip8_step[c: CHIP8] : void
|
||||
for i in 0..x+1
|
||||
c->reg[i] = c->memory[c->I + i]
|
||||
|
||||
func chip8_free[c: CHIP8] : void
|
||||
mem.free(c->memory)
|
||||
array.free(c->stack)
|
||||
mem.free(c->reg)
|
||||
array.free(c->keyboard)
|
||||
mem.free(c->display)
|
||||
array.free(c->keyboard_map)
|
||||
mem.free(c)
|
||||
|
||||
func main[argc: i64, argv: ptr] : i64
|
||||
let path: str = 0 as str
|
||||
let disassemble: bool = false
|
||||
|
||||
@@ -39,7 +39,7 @@ func main[argc: i64, argv: ptr] : i64
|
||||
net.send(s, req as ptr, str.len(req))
|
||||
mem.free(req)
|
||||
|
||||
let header_buf: str = mem.alloc(8192)
|
||||
let header_buf: str = mem.alloc(8192) as str
|
||||
let header_size = 0
|
||||
let found: bool = false
|
||||
let end_index: i64 = -1
|
||||
|
||||
@@ -43,7 +43,7 @@ func part2[lines: Array] : void
|
||||
for x in 1..lines->size-1
|
||||
for y in 1..str.len(array.nth(lines, x))-1
|
||||
if array.nth(lines, x)[y] == 'A'
|
||||
let s: str = mem.alloc(5)
|
||||
let s: str = mem.alloc(5) as str
|
||||
s[0] = array.nth(lines, x - 1)[y - 1]
|
||||
s[1] = array.nth(lines, x + 1)[y - 1]
|
||||
s[2] = array.nth(lines, x + 1)[y + 1]
|
||||
|
||||
@@ -7,7 +7,7 @@ func part1[lines: Array] : void
|
||||
let largest = 0
|
||||
for j in 0..str.len(line)
|
||||
for k in (j+1)..str.len(line)
|
||||
let s: str = mem.alloc(3)
|
||||
let s: str = mem.alloc(3) as str
|
||||
s[0] = line[j]
|
||||
s[1] = line[k]
|
||||
s[2] = 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// needs to be compiled with -m -C="-lraylib"
|
||||
// needs to be compiled with -m -C "-lraylib"
|
||||
extern InitWindow
|
||||
extern SetTargetFPS
|
||||
extern WindowShouldClose
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// needs to be compiled with -m -C="-lsqlite3"
|
||||
// needs to be compiled with -m -C "-lsqlite3"
|
||||
extern sqlite3_open
|
||||
extern sqlite3_exec
|
||||
extern sqlite3_prepare_v2
|
||||
|
||||
Reference in New Issue
Block a user