make in_queue int tptre

This commit is contained in:
Redo
2022-11-04 15:32:30 -06:00
parent 7823e413ee
commit f1b909279c
4 changed files with 17 additions and 26 deletions

View File

@@ -1,16 +1,6 @@
local ffi = FFI
ffi.cdef[[
struct Net {
int in_queue;
int num_out_ports_on;
int state;
int update_tick;
struct Gate* gates_update[0];
};
]]
Group = {}
function Group.new()
@@ -18,7 +8,7 @@ function Group.new()
-- Logic Critical
state = 0,
state_num = 0,
in_queue = 0,
in_queue = ffi.new("int[1]"),
gates_update = {},
num_gates_update = 0,
@@ -195,7 +185,7 @@ function Group.setstate(group, state)
local len = group.num_gates_update
for i = 1, len do
local gate = group.gates_update[i]
if gate and gate.in_queue==0 then
if gate and gate.in_queue[0]==0 then
Simulation.queuegate(sim, gate)
end
end