clean up some debug prints
- free file and command memory on exit
This commit is contained in:
parent
16a082ce0a
commit
2b2eb51dff
2 changed files with 8 additions and 6 deletions
|
@ -195,7 +195,7 @@ pub const Image = struct {
|
||||||
|
|
||||||
var idx = c.lilv_port_get_index(ctx.plugin, port);
|
var idx = c.lilv_port_get_index(ctx.plugin, port);
|
||||||
std.debug.warn(
|
std.debug.warn(
|
||||||
"sym={}, idx={} to val={}\n",
|
"\tset sym={}, idx={} to val={}\n",
|
||||||
param.sym,
|
param.sym,
|
||||||
idx,
|
idx,
|
||||||
param.value,
|
param.value,
|
||||||
|
@ -223,10 +223,10 @@ pub const Image = struct {
|
||||||
|
|
||||||
const file_end = try getEndPos(self.curpath);
|
const file_end = try getEndPos(self.curpath);
|
||||||
const seek_pos = position.seekPos(file_end);
|
const seek_pos = position.seekPos(file_end);
|
||||||
std.debug.warn("start {} end {}\n", seek_pos.start, seek_pos.end);
|
std.debug.warn("\tstart {} end {}\n", seek_pos.start, seek_pos.end);
|
||||||
|
|
||||||
var seeked = c.sf_seek(self.sndfile, 0, c.SEEK_SET);
|
// make sure we start from 0
|
||||||
std.debug.warn("in: seek {}\n", seeked);
|
_ = c.sf_seek(self.sndfile, 0, c.SEEK_SET);
|
||||||
|
|
||||||
var i: usize = 0;
|
var i: usize = 0;
|
||||||
|
|
||||||
|
|
|
@ -21,16 +21,18 @@ pub fn main() !void {
|
||||||
// args[1] is the path to scri file
|
// args[1] is the path to scri file
|
||||||
const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path"));
|
const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path"));
|
||||||
|
|
||||||
std.debug.warn("path: '{}'\n", scri_path);
|
|
||||||
|
|
||||||
var file = try std.fs.File.openRead(scri_path);
|
var file = try std.fs.File.openRead(scri_path);
|
||||||
defer file.close();
|
defer file.close();
|
||||||
|
|
||||||
// sadly, we read it all into memory. such is life
|
// sadly, we read it all into memory. such is life
|
||||||
const total_bytes = try file.getEndPos();
|
const total_bytes = try file.getEndPos();
|
||||||
|
|
||||||
var data = try allocator.alloc(u8, total_bytes);
|
var data = try allocator.alloc(u8, total_bytes);
|
||||||
|
defer allocator.free(data);
|
||||||
_ = try file.read(data);
|
_ = try file.read(data);
|
||||||
|
|
||||||
var cmds = try lang.parse(data);
|
var cmds = try lang.parse(data);
|
||||||
|
defer cmds.deinit();
|
||||||
|
|
||||||
try runner.runCommands(cmds, true);
|
try runner.runCommands(cmds, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue