diff --git a/src/emu/chan.c b/src/emu/chan.c index 8ab9ef3..092ed9b 100644 --- a/src/emu/chan.c +++ b/src/emu/chan.c @@ -67,7 +67,7 @@ static int check_duplicates(struct chan *chan, struct value *v) { /* If duplicates are allowed just skip the check */ - if (chan->prop[CHAN_DUPLICATES]) + if (chan->prop[CHAN_ALLOW_DUP]) return 0; if (value_is_equal(&chan->last_value, v)) { diff --git a/src/emu/chan.h b/src/emu/chan.h index e0e519b..1ef377e 100644 --- a/src/emu/chan.h +++ b/src/emu/chan.h @@ -18,7 +18,7 @@ enum chan_type { enum chan_prop { CHAN_DIRTY_WRITE = 0, - CHAN_DUPLICATES, + CHAN_ALLOW_DUP, CHAN_MAXPROP, }; diff --git a/src/emu/cpu.c b/src/emu/cpu.c index 155240b..e06d76e 100644 --- a/src/emu/cpu.c +++ b/src/emu/cpu.c @@ -116,11 +116,11 @@ cpu_init_end(struct cpu *cpu) chan_fmt, cpu->gindex, chan_name[i]); } - chan_prop_set(&cpu->chan[CPU_CHAN_NRUN], CHAN_DUPLICATES, 1); - chan_prop_set(&cpu->chan[CPU_CHAN_TID], CHAN_DUPLICATES, 1); - chan_prop_set(&cpu->chan[CPU_CHAN_PID], CHAN_DUPLICATES, 1); - chan_prop_set(&cpu->chan[CPU_CHAN_THRUN], CHAN_DUPLICATES, 1); - chan_prop_set(&cpu->chan[CPU_CHAN_THACT], CHAN_DUPLICATES, 1); + chan_prop_set(&cpu->chan[CPU_CHAN_NRUN], CHAN_ALLOW_DUP, 1); + chan_prop_set(&cpu->chan[CPU_CHAN_TID], CHAN_ALLOW_DUP, 1); + chan_prop_set(&cpu->chan[CPU_CHAN_PID], CHAN_ALLOW_DUP, 1); + chan_prop_set(&cpu->chan[CPU_CHAN_THRUN], CHAN_ALLOW_DUP, 1); + chan_prop_set(&cpu->chan[CPU_CHAN_THACT], CHAN_ALLOW_DUP, 1); cpu->is_init = 1; diff --git a/src/emu/model_thread.c b/src/emu/model_thread.c index 0259ca7..5f5139a 100644 --- a/src/emu/model_thread.c +++ b/src/emu/model_thread.c @@ -25,7 +25,7 @@ init_chan(struct model_thread *th, const struct model_chan_spec *spec, int64_t g if (spec->ch_dup != NULL) { int dup = spec->ch_dup[i]; - chan_prop_set(c, CHAN_DUPLICATES, dup); + chan_prop_set(c, CHAN_ALLOW_DUP, dup); } if (bay_register(th->bay, c) != 0) { diff --git a/src/emu/mux.c b/src/emu/mux.c index e6a374c..fc7ea8d 100644 --- a/src/emu/mux.c +++ b/src/emu/mux.c @@ -171,7 +171,7 @@ mux_init(struct mux *mux, /* Similarly, we may switch to an input channel that has the same value * as the last output value, so we allow duplicates too */ - chan_prop_set(output, CHAN_DUPLICATES, 1); + chan_prop_set(output, CHAN_ALLOW_DUP, 1); memset(mux, 0, sizeof(struct mux)); mux->select = select; diff --git a/src/emu/thread.c b/src/emu/thread.c index f85f141..44fc37a 100644 --- a/src/emu/thread.c +++ b/src/emu/thread.c @@ -144,7 +144,7 @@ thread_init_end(struct thread *th) chan_fmt, th->gindex, chan_name[i]); } - chan_prop_set(&th->chan[TH_CHAN_TID], CHAN_DUPLICATES, 1); + chan_prop_set(&th->chan[TH_CHAN_TID], CHAN_ALLOW_DUP, 1); th->is_init = 1; return 0; diff --git a/test/unit/chan.c b/test/unit/chan.c index d79860e..1fbbe2a 100644 --- a/test/unit/chan.c +++ b/test/unit/chan.c @@ -91,7 +91,7 @@ test_duplicate(void) die("chan_set didn't fail\n"); /* Now enable duplicates */ - chan_prop_set(&chan, CHAN_DUPLICATES, 1); + chan_prop_set(&chan, CHAN_ALLOW_DUP, 1); /* Then it should allow writting the same value */ if (chan_set(&chan, value_int64(1)) != 0) diff --git a/test/unit/prv.c b/test/unit/prv.c index 810cb6c..a6b5447 100644 --- a/test/unit/prv.c +++ b/test/unit/prv.c @@ -80,7 +80,7 @@ test_duplicate(const char *path) chan_init(&chan, CHAN_SINGLE, "testchan"); /* Allow setting the same value in the channel */ - chan_prop_set(&chan, CHAN_DUPLICATES, 1); + chan_prop_set(&chan, CHAN_ALLOW_DUP, 1); if (bay_register(&bay, &chan) != 0) die("bay_register failed\n"); @@ -130,7 +130,7 @@ test_same_type(const char *path) chan_init(&chan, CHAN_SINGLE, "testchan"); /* Allow setting the same value in the channel */ - chan_prop_set(&chan, CHAN_DUPLICATES, 1); + chan_prop_set(&chan, CHAN_ALLOW_DUP, 1); OK(bay_register(&bay, &chan)); OK(prv_register(&prv, row, type, &bay, &chan, 0));